Daily Archives

Articles indexed Thursday June 10 2010

Page 8/121 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How does Qt implement signals and slots?

    - by anton
    Can someone explain to me the basic idea of Qt signals&slots mechanism IMPLEMENTATION? I want to know what all those Q_OBJECT macros do "in plain C++". This question is NOT about signals&slots usage. added: I know that Qt uses moc compiler to transform Qt-C++ in plain C++. But what does moc do? I tried to read "moc_filename.cpp" files but I have no idea what can something like this mean void *Widget::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_Widget)) return static_cast<void*>(const_cast< Widget*>(this)); return QDialog::qt_metacast(_clname); } Thanks in Advance, anton

    Read the article

  • Php code works on every browser but not on IE8, help please

    - by DomingoSL
    I think the error has to be in a incompatibility with IE8 and the cookies manipulation, cuz in IE8 you can see the password and login asking screen but when you enter the data and send it the browser seems to do nothing, this is a url you were you can try my code: http://200.8.27.127/tiempo/teacher.php and this is the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="it" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Formulario</title> <style type="text/css"> h1 { font: 50px Tahoma, Helvetica, Arial, Sans-Serif; text-align: center; color: #111; text-shadow: 0px 2px 3px #555; } h2 { font: 14px Tahoma, Helvetica, Arial, Sans-Serif; text-align: center; color: #CCC; text-shadow: 0px 1px 2px #555; } h3 { font: 10px Tahoma, Helvetica, Arial, Sans-Serif; text-align: center; color: #CCC; } b1 { font: 16px Tahoma, Helvetica, Arial, Sans-Serif; color: #DDD; } b2 { font: 10px Tahoma, Helvetica, Arial, Sans-Serif; color: #F9F7ED; } .caja { width: 690px; height: 40px; background-color: transparent; border: 0px solid #000000; font-size:x-large; color: #222; font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-weight: bold;" size="299"; } .style1 { text-align: right; } </style> </head> <body style="background-image: url('IMG/bg.png')"> <script type="text/javascript" src="JS/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="JS/jquery.notifications-1.1.min.js"></script> <link rel="stylesheet" type="text/css" href="JS/jquery.notifications.css" /> <script> function checkCharCount(textfield) { if(textfield.value.length > 300) textfield.value = textfield.value.substr(0, 300); document.getElementById("charCounter").innerHTML = 300 - textfield.value.length; } </script> <?php include("/LIB/HeadSQL.php"); include("/LIB/error.php"); if (isset($_COOKIE['ID_tablon'])) { $username = $_COOKIE['ID_tablon']; $pass = $_COOKIE['Key_tablon']; $check = mysql_query("SELECT * FROM usuarios WHERE nombre = '$username'") or die(mysql_error()); while($info = mysql_fetch_array( $check )) { if ($pass != $info['clave']) { login(); } else { entro($info['email'],$username); } } } else { login(); } function login() { if (isset($_POST['quiere'])) { if(!$_POST['username'] | !$_POST['pass']) { include("LIB/login.php"); error('Debes llenar todos los campos.',0); } else { $check = mysql_query("SELECT * FROM usuarios WHERE nombre = '".$_POST['username']."'") or die(mysql_error()); $check2 = mysql_num_rows($check); if ($check2 == 0) { include("LIB/login.php"); error('Ese usuario no existe.',0); } while($info = mysql_fetch_array( $check )) { $_POST['pass'] = stripslashes($_POST['pass']); $info['clave'] = stripslashes($info['clave']); //$_POST['pass'] = md5($_POST['pass']); if ($_POST['pass'] != $info['clave']) { include("LIB/login.php"); error('La clave es incorrecta.',0); } else { $_POST['username'] = stripslashes($_POST['username']); $hour = time() + 3600; setcookie("ID_tablon", $_POST['username'], $hour); setcookie("Key_tablon", $_POST['pass'], $hour); entro($info['email'],$_POST['username']); } } } } else { include("LIB/login.php"); } exit; } function entro($email,$username) { ?> <div id="todo" align="center" > <div id="cabeza" style="width:850px;height:100px"> </div> <div id="contenido" style="width:850px;height:420px;background-image: url(IMG/cuadro.png)" > <div id="titulo" style="width:765px;height:75px;padding-top: 18px;margin: auto;text-align: left;"> <b1>Bienvenido <b><?php echo($username); ?></b></b1><br> <?php $check = mysql_query("SELECT * FROM sms WHERE ref = '".$username."' ORDER BY fecha DESC LIMIT 0, 1") or die(mysql_error()); while($info = mysql_fetch_array( $check )) { echo("<b1> Tu ultimo mensaje enviado fue: </b1><b2>" . $info['texto'] . " enviado el " . $info['fecha'] . "</b2>"); } ?> </div> <form method="post"> <div id="formulario" style="width:850px;height:255px;margin-top: 10px"> <div id="foto" align="right" style="width:725px; height:40px;padding-top: 11px;margin: auto"> <?php $size = 60; $grav_url = "http://www.gravatar.com/avatar/" . md5( strtolower( $email ) ) . "?size=" . $size; $size = 256; $grav_urlB = "http://www.gravatar.com/avatar/" . md5( strtolower( $email ) ) . "?size=" . $size; echo('<img alt="Image" src="' . $grav_url . '" />'); ?> </div> <div id="texto" style="width:850px;height:29px; margin-top: 38px;margin-left: 4px"> <input name="sms" type="text" onKeyUp="checkCharCount(this)" class="caja" /> </div> <div id="botones" style="width:725px;height:27px; margin-top: 15px" class="style1"> <input name="usuario" type="hidden" value="<?php echo($username); ?>" /> <input name="Submit1" type="image" value="submit" src="IMG/envia.png" /> </div> <div id="resta" style="width:850px;height:29px; margin-top: 53px;margin-left: 4px"> <h2><span id="charCounter">300</span> caracteres restantes.</h2> <h3><a href=logout.php>Cerrar Sesion</a></h3> </div> </div> </form> </div> </div> </body> </html> <?php session_start(); if (isset($_POST['Submit1'])) { if (isset($_SESSION['token']) && (time() - $_SESSION['token']) < 5) { error('Debes esperar 5 segundos para poder enviar otra informacion.',0); } else { $_SESSION['token'] = time(); include("/LIB/HeadSQL.php"); include("/LIB/comprueba.php"); $insert = "INSERT INTO sms (ref, texto, fecha) VALUES ('" . addslashes($_POST['usuario']) . "', '" . addslashes($_POST['sms']) . "', NOW() )"; $add_member = mysql_query($insert); error("Tu mensage ha sido enviado con exito.",1); } } exit; } ?> do you think the isuue can be on the javascript? try the code firts with Firefox or google chrome, then try in IE8.

    Read the article

  • Pull info from Excel Spreadsheet into C# Web Application

    - by Gene
    I want to show information from an excel spreadsheet in a web page. The xls will have maybe 5 columns, and as many rows as needed. The columns will be 'Name', 'Created Date', 'Expired Date', 'Owner', and maybe down the road maybe more. What I would like is for the C# to nightly read the xls, and display the information in a table on the website. If there is a PDF available for download I am going to link that as well. Thanks in advance, Gene

    Read the article

  • Need help for this syntax: "#define LEDs (char *) 0x0003010"

    - by Noge
    I'm doing programming of a softcore processor, Nios II from Altera, below is the code in one of the tutorial, I manage to get the code working by testing it on the hardware (DE2 board), however, I could not understand the code. #define Switches (volatile char *) 0x0003000 #define LEDs (char *) 0x0003010 void main() { while (1) *LEDs = *Switches; } What I know about #define is that, it is either used to define a constant, or a macro, but why in the above code, there are casting like, (char *) 0x0003010, in #define? why the 2 constants, Switches and LEDs act like a variable instead of a constant? Thanks in advance !

    Read the article

  • Can 2 different applications use the same database?

    - by cdonner
    Without additional context, the answer is "no", I think. Here is the context. I want to have a free version and a premium version of the same application. When people buy the application, I want them to be able to "upgrade" without losing their data, i.e. the premium version should install over the free version. I want to use the same code base and just switch a setting to build the premium version. Andoid Market does not let me convert a free app to a paid app, so the trivial option is not available. I am curious if someone has tried this successfully. How does Android Market identify an application - will it think that the premium version is a different app and just install it in parallel?

    Read the article

  • Where to put conditionals in ANSI-syntax SQL queries

    - by RenderIn
    What's the difference between these two queries? I've been resistant to jumping on the ANSI-syntax bandwagon because I have not been able to unravel various syntactical ambiguities. Is 1) returning the product of the join and only then filtering out those joined records which have weight = 500? And is 2) filtering out those prior to the join? Is 2 bad syntax? Why might I use that? 1: SELECT SOMETHING FROM FOO INNER JOIN BAR ON FOO.NAME = BAR.NAME WHERE BAR.WEIGHT < 500 2: SELECT SOMETHING FROM FOO INNER JOIN BAR ON FOO.NAME = BAR.NAME AND BAR.WEIGHT < 500

    Read the article

  • How can you tell if an activity is starting or resuming?

    - by Joren
    I have an activity which pulls some JSON from my server, and then uses it to draw a list. That list launches further activities. My problem is that I can't figure out a way to tell if the activity is still alive when you go back to it, so I end up re-querying my JSON from the server and redrawing the list every time the user goes back to the activity. How can I tell if my activity is still alive so I can skip the redraw? Using onRestart works for hitting the home key then going back, but onCreate not onRestart is called if I selected a list item then hit back.

    Read the article

  • Wpf Mvvm ComboBox

    - by 2Fast4YouBR
    Hi All, I am new in the Wpf world, so I created a couple of views and all of them have at least one ComboBox, as I am using the MvvM pattern, I get my self re-typing all the time the same line of codes to fill the Combo and to get the SelectedItem (creating properties, privates for fill and other to get). Is there some kind of framework that can improve this part ? or hack/trick ??? as I see too much repetitive code... maybe I am doing something wrong, take a look: XAML: <ComboBox name= "cbDepartments" DisplayMemberPath="DepartmentName" SelectedValuePath ="PrimaryKey" ItemsSource="{Binding Path=Departments}" SelectedItem="{Binding Path=DefaultBranch,Mode=TwoWay}" > ViewModel: private Department defaultBranch; public Department DefaultBranch { get { return this.defaultBranch; } set { if (this.defaultBranch != value) { this.defaultBranch = value; this.OnPropertyChanged("DefaultBranch"); this.saveChangeCommand.RaiseCanExecuteChanged(); this.UserMessage = string.Empty; } } } private ObservableCollection<Department> departments; public ObservableCollection<Department> Departments { get { return this.departments; } set { if (this. departments!= value) { this. departments = value; this.OnPropertyChanged("Departments"); } } }

    Read the article

  • Flash Security Error Accessing URL with crossdomain.xml

    - by user163757
    Hello, I recently deployed a Flash application to a server, and am now experiencing errors when making HTTPService requests. I have put what I believe to be the most permissive crossdomain.xml possible in the wwwroot folder, and still get the errors. Interestingly enough, the error only seems to occur when the request is made from a direct user interaction (i.e. button click). The application makes other requests that are initiated by other means(i.e creationComplete) , and they seem to work as expected. Anyone see anything wrong with the crossdomain.xml, or have any other suggestions? ERROR MESSAGE [RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal%3A%3AfaultHandler() at mx.rpc::Responder/fault() at mx.rpc::AsyncRequest/fault() at DirectHTTPMessageResponder/securityErrorHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/redirectEvent() <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <site-control permitted-cross-domain-policies="all" /> <allow-access-from domain="*" secure="false" /> <allow-http-request-headers-from domain="*" headers="*" secure="false" /> </cross-domain-policy>

    Read the article

  • Java problem cant find image file

    - by user363035
    I am a student working on a homework project. I spent DAYS trying to get the following code to display an image on my new windows 7 laptop. I compiled it and ran it on my old xp pc and it worked! I really want to use my laptop. Any suggestions on how to get it to display the image? import java.awt.*; import java.applet.*; import java.awt.event.*; import java.awt.image.*; public class MoveIt extends Applet implements ActionListener { // set variables and componets private Image cup; Panel keypad = new Panel(); public int top = 15; public int left = 15; private Button keysArray[]; public void init() { cup = getImage(getDocumentBase(), "cup.gif"); Canvas myCanvas = new Canvas(); keysArray = new Button[5]; setLayout(new BorderLayout(5,5)); setBackground(Color.blue); // set up keypad layout keypad.setLayout(new BorderLayout(0,0)); keysArray[0] = new Button("Up"); keysArray[1] = new Button("Left"); keysArray[2] = new Button("Center"); keysArray[3] = new Button("Right"); keysArray[4] = new Button("Down"); // add buttons to the keypad panel keypad.add(keysArray[0], BorderLayout.NORTH); keysArray[0].addActionListener(this); keypad.add(keysArray[1], BorderLayout.EAST); keysArray[1].addActionListener(this); keypad.add(keysArray[2], BorderLayout.CENTER); keysArray[2].addActionListener(this); keypad.add(keysArray[3], BorderLayout.WEST); keysArray[3].addActionListener(this); keypad.add(keysArray[4], BorderLayout.SOUTH); keysArray[4].addActionListener(this); // add canvas and keypad to the BorderLayout add(myCanvas, BorderLayout.NORTH); add(keypad, BorderLayout.SOUTH); } public void paint(Graphics g) { g.drawImage( cup, left, top, this ); } public void actionPerformed(ActionEvent e) { // test for menu item clicks String arg = e.getActionCommand(); if (arg == "Up") top -=15; else if (arg == "Down") top +=15; else if (arg == "Left") left -=15; else if (arg == "Right") left +=15; else { top = 60; left =125; } repaint(); } }

    Read the article

  • Why is it supposedly "hard" to deploy Ruby on Rails to production?

    - by johnny
    I admit that I don't follow much of anything "right" on deploying test versus production code. I have been using ASP.NET, and I typically run it locally in Visual Studio, it works, I upload it, I test it again on the production server. I have read several people say that deploying Rails apps is harder and there are special programs/ways on the ruby site about deploying RoR. I've only toyed with RoR. What is special about deployment? You don't just copy and paste the code and run it (from development machine to the production)? Is it because one is in Apache and the other running on the built in server? This will be on a Mac Server if it matters. Thank you for comments.

    Read the article

  • Ch-ch-ch-changes...

    - by Lou Vega
    The last few months have been pretty crazy. Just before the MVP summit in February I was approached about changing to a different project with my (then current) employer, and right after the summit I was approached by another company. Eventually I went with the new company and a new role in the Information Assurance field. More to come on that as things progress. All that being said I've not been as active in the .NET community as I once was and I miss it - so I'm looking to dive back in especially as Windows Phone 7 draws nearer and nearer. Speaking of the community - many of you may not recognize me if you see me now :) I had told my son for the last couple years that I would cut my hair before he turned 5 (he always asked how come he didn't have long hair) and he turns 5 (time has flown!) on June 19th so May 30th I cut my long hair down pretty short and donated the hair to Locks of Love. As Chris said to me on Twitter, "pics or it didn't happen" - well fortunately my wife was there to document the whole thing so I'll get a picture or two posted here soon.

    Read the article

  • AMIs in Amazon EC2

    - by Jack of Trades
    I really like the Amazon EC2 environment, and thought I'll spend a bit of time playing around with various types of public (Windows!) AMI servers. But testing has been a bit, well, questionable. Some of my findings: It's very difficult to know what exactly a specific public EC2 image is supposed to be doing. Many images come with little to no information. I can't seem to find the passwords to log onto various windows images. Why are they public if they can't be used!? Lots of images are based on S3, and not EBS backed. This is very annoying, as S3 takes a lot longer to do pretty much anything (stop, image etc.) I am only testing images here, so of-course I don't question the value of S3 for other attributes. The description of what an image does is almost useless and many times confusing. Have others come across these EC2 issues. Again, my interest was to just play around with public images for testing/experimentation/etc, and therefore these issues may not be too relevant for more normal EC2 deployment uses.

    Read the article

  • initrd problem and Kernel panics after openSUSE 11.2 upgrade.

    - by unixbhaskar
    Once I have done the upgrade form openSUSE11.1 to openSUSE11.2 by doing this: zypper dup Now I tried to boot the system and it failed sync with VFS and kernel panic, so clearly a initrd problem . if I'm not mistaken. Now a bit of explanation about the problem: while upgrading it shows me the error updating initramfs( I forgot the exact error or might be warning).Oh yeah it shows some grub warning too. I have had been doing that from a chroot environment.. with all the required file mounted in proper place in the chroot environment. Now .after bit googling and painfully looking the susegeek.com forum and opensuse.org forum I have decided to recreate the initrd ...but the fellow called "mkinitrd" is real real crap as I hev been pointed out by few forum members. I tried to make an initrd image by myself, failed to do so .as it shows error that device not found( if I boot into suse live cd and mount the partition ) then I tried from the chrooted env and it says "there is no space left on the device" A bit bemused :( yeah most of you pointed it right may lack of knowledge of mine. Kindly suggest me and show me steps to do it correctly and get opensuse11.2 up and running. TIA

    Read the article

  • outlining in colors

    - by John
    ? I like outlining all information, but I am looking for better way to outline: I would like my outlines to be colorful like programming, so that it is very easy to distinguish between different types of texts within an outline. How can I do this?

    Read the article

  • Connecting to a computer using Remote Desktop does not work first time

    - by dev
    Hi all, I'm having a weird sort of problem with Remote desktop and that too, only on one machine. If I boot up this machine, and then try to Remote desktop into it, it does not work.( I get the following error: The client could not connect to the remote computer. Remote connections might not be enabled or the computer might be too busy to accept new connections. It is also possible that network problems are preventing your connection. Please try connecting again later. If the problem continues to occur, contact your administrator. ) But if I physically log into it & then log out, and then try to Remote desktop into it, it works flawlessly. The problematic machine is Xp 64 Bit, but other systems with Xp 64 Bit work fine. Any Ideas on how to solve this?

    Read the article

  • Google Docs not importing CSVs consistently

    - by nick
    Hey everyone, I'm trying to import some csv data into google docs spreadsheet. The data I am entering is all made up of 16 digit integers. About 90% of them are imported perfectly but 10% are rewritten automatically into scientific notation. How do I turn this feature of. I just want all the numbers kept in their standard form. Kind Regards Nick

    Read the article

  • How to cancel a deeply nested process

    - by Mystere Man
    I have a class that is a "manager" sort of class. One of it's functions is to signal that the long running process of the class should shut down. It does this by setting a boolean called "IsStopping" in class. public class Foo { bool isStoping void DoWork() { while (!isStopping) { // do work... } } } Now, DoWork() was a gigantic function, and I decided to refactor it out and as part of the process broke some of it into other classes. The problem is, Some of these classes also have long running functions that need to check if isStopping is true. public class Foo { bool isStoping void DoWork() { while (!isStopping) { MoreWork mw = new MoreWork() mw.DoMoreWork() // possibly long running // do work... } } } What are my options here? I have considered passing isStopping by reference, which I don't really like because it requires there to be an outside object. I would prefer to make the additional classes as stand alone and dependancy free as possible. I have also considered making isStopping a property, and then then having it call an event that the inner classes could be subscribed to, but this seems overly complex. Another option was to create a "Process Cancelation Token" class, similar to what .net 4 Tasks use, then that token be passed to those classes. How have you handled this situation? EDIT: Also consider that MoreWork might have a EvenMoreWork object that it instantiates and calls a potentially long running method on... and so on. I guess what i'm looking for is a way to be able to signal an arbitrary number of objects down a call tree to tell them to stop what they're doing and clean up and return.

    Read the article

  • Django - The included urlconf doesn't have any patterns in it

    - by unsorted
    My website, which was working before, suddenly started breaking with the error "ImproperlyConfigured at / The included urlconf resume.urls doesn't have any patterns in it" The project base is called resume. In settings.py I have set ROOT_URLCONF = 'resume.urls' Here's my resume.urls, which sits in the project root directory. from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^resume/', include('resume.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: (r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: (r'^admin/', include(admin.site.urls)), (r'^accounts/login/$', 'django.contrib.auth.views.login'), #(r'^employer/', include(students.urls)), (r'^ajax/', include('urls.ajax')), (r'^student/', include('students.urls')), (r'^club/(?P<object_id>\d+)/$', 'resume.students.views.club_detail'), (r'^company/(?P<object_id>\d+)/$', 'resume.students.views.company_detail'), (r'^program/(?P<object_id>\d+)/$', 'resume.students.views.program_detail'), (r'^course/(?P<object_id>\d+)/$', 'resume.students.views.course_detail'), (r'^career/(?P<object_id>\d+)/$', 'resume.students.views.career_detail'), (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'C:/code/django/resume/media'}), ) Anyone know what's wrong? This is driving me crazy. Thanks,

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >