Daily Archives

Articles indexed Tuesday June 1 2010

Page 4/125 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • If handcoded webpage displays the same as WYSIWYG generated page, what did I gain? Can I compete wit

    - by CrazyJugglerDrummer
    My friend uses DreamWeaver to create web pages and doesn't know any HTML at all. I know HTML inside and out and can hand code from the ground up. But our web pages look similar and he can get paid for his WYSIWYG generated sites. What have I gained from learning HTML and hand-coding? Can I compete with people using DreamWeaver or other WYSIWYG editors? I know that for something like JavaScript or PHP the only way to go is to hand-code the whole thing yourself, no tools can do that for you, but is HTML in the same position?

    Read the article

  • Very simply, how can check if a user exists against my MySQL database?

    - by Sergio Tapia
    Here's what I have but nothing is output to the screen. :\ <html> <head> </head> <body> <? mysql_connect(localhost, "sergio", "123"); @mysql_select_db("multas") or die( "Unable to select database"); $query="SELECT * FROM usuario"; $result=mysql_query($query); $num=mysql_numrows($result); $i=0; $username=GET["u"]; $password=GET["p"]; while ($i < $num) { $dbusername=mysql_result($result,$i,"username"); $dbpassword=mysql_result($result,$i,"password"); if(($username == $dbusername) && ($password == $dbpassword)){ echo "si"; } $i++; } ?> </body> </html> I'm iterating through all users and seeing if there is a match for user && password. Any guidance?

    Read the article

  • Where can I find soft-multiply and divide algorithms?

    - by srking
    I'm working on a micro-controller without hardware multiply and divide. I need to cook up software algorithms for these basic operations that are a nice balance of compact size and efficiency. My C compiler port will employ these algos, not the the C developers themselves. My google-fu is so far turning up mostly noise on this topic. Can anyone point me to something informative? I can use add/sub and shift instructions. Table lookup based algos might also work for me, but I'm a bit worried about cramming so much into the compiler's back-end...um, so to speak. Thanks!

    Read the article

  • turn on bluetooth in pocket pc VS-c++

    - by baash05
    I'm attempting to turn on the bluetooth network of a Janam (wince5.0) I understand it involves ndisuio, but I'm not sure how to invoke it. I assume it will involve the use of a standard DLL or api call, how can I find out what that call would be?

    Read the article

  • Conference on LinQ at Montreal's ETS

    - by Vincent Grondin
    Today I gave a presentation at Montreal's "Ecole de Technologies Supérieure" and I said I would put my presentation and the material itself online in here....  The audience was exclusively composed of teachers from colleges around Montreal.  There's the link to download the content : http://cid-bdf9cf467011e705.skydrive.live.com/self.aspx/.Public/LinQ%20at%20Montreal%5E4s%20ETS/LinQ.zip   I hope all attendees learned more on LinQ than they knew before!

    Read the article

  • Searching for literal "> \" using ack-grep

    - by Stephen Gornick
    I am looking for lines that literally have a greater than character (a "") followed by a space followed by a backslash character (a "\") i.e., a line with this: \ I thought escaping would allow this, and for the greater-than it does: $ ack-grep " " returns lines that have " " in them. But when I try to escape the backslash as well I get: $ ack-grep " \" ack-grep: Invalid regex ' \': Trailing \ in regex m/ \/

    Read the article

  • grailsui plugin for accordion not working

    - by inquirer
    Hi! I have been trying to figure out what's wrong with grailsui accordion. I have checked out the sample source files (http://guidemo.googlecode.com/svn/trunk/) from different ui tags, like menu, datatable and etc. they are working fine but the accordion is not working properly. All i can see is all of the divs shown. the panels are not moving since they are already shown. I've also followed the screencast for it. I've used the yui-skin-sam class name and I've downloaded the grails plugins.grails-ui=1.2-SNAPSHOT. I am not sure what's wrong.I used the rich-ui plugin and it is working great. But there are still features that are not in rich-ui compared to the possible configurations for the grails-ui tags. Anyway. if you have any suggestions to what js library I may use for a grails application or if you have a working grails-ui accordion sample, I would really appreciate it. Thanks in advance. Hope you can help me since I am still new to Grails.

    Read the article

  • How to protect and hidden form HTML/PHP with JS callback to AS3

    - by Jk_
    Hi guys, I'm developing a Flash website (as3) where I need to be able to upload directly to YouTube by using the DATA API. However in order to do so, I had to use a proper HTML form on top of my flash object. Why? Because of the Browser Based Upload restictions. I first hide the form using JQuery and with a little CSS the form is display just where I want it. Within flash I use ExternalInterface.call() to show/hide the form when I need it! ExternalInterface.call("YTUploader.showIt"); The upload process is working great my only problem is that the form can be displayed easily... You just need a tool like firebug and you can use the form wherever you want on my flash app. So I was wandering which will be the best way to 'protect' this form or the best way to limit its access. Any advices will be appreciated. Thanks for your time. Jk.

    Read the article

  • Exclude records matching subquery

    - by Skudd
    There is probably an obvious answer to this question, but I am having one heck of a time getting anywhere with it. Consider the query: SELECT * FROM reports AS r JOIN reportvalues AS rv ON rv.report_id = r.report_id JOIN metrics AS m ON m.metric_id = rv.metric_id WHERE r.report_id NOT IN( SELECT DISTINCT report_id FROM exclude_report ) In this query, exclude_report is a view constructed in a similar manner. Now what happens is the query takes an EXTREMELY long time to execute, presumably because the subquery is being executed over each and every row in the parent query. However, I am finding no feasible means of doing this any other way. Oh great SQL wizards, please advise. I really need a way of doing this all in SQL, which I will be using in SSRS.

    Read the article

  • Factory(:user) hits database?

    - by davidegp
    Playing around with factories, which I read weren't supposed to hit the database, allowing you to avoid having your controller specs interacting with the DB. But when I fire up the Rails console in test and use a factory to create a sample user, I noticed an actual user gets created in the database. Huh? (Using Rails 2.3.8 and Factory Girl 1.2.3.)

    Read the article

  • MSSQL Search Proper Names Full Text Index vs LIKE + SOUNDEX

    - by Matthew Talbert
    I have a database of names of people that has (currently) 35 million rows. I need to know what is the best method for quickly searching these names. The current system (not designed by me), simply has the first and last name columns indexed and uses "LIKE" queries with the additional option of using SOUNDEX (though I'm not sure this is actually used much). Performance has always been a problem with this system, and so currently the searches are limited to 200 results (which still takes too long to run). So, I have a few questions: Does full text index work well for proper names? If so, what is the best way to query proper names? (CONTAINS, FREETEXT, etc) Is there some other system (like Lucene.net) that would be better? Just for reference, I'm using Fluent NHibernate for data access, so methods that work will with that will be preferred. I'm using MS SQL 2008 currently.

    Read the article

  • python json_encode throws KeyError exception

    - by MattM
    In a unit test case that I am running, I get a KeyError exception on the 4th json object in the json text below. I went through the sub-objects and found that it was the "cpuid" object that is the offending object, but I am completely at a loss as to what is wrong with the formatting. response = self.app.post( '/machinestats', params=dict(record=self.json_encode([ {"type": "crash", "instance_id": "xxx", "version": "0.2.0", "build_id": "unknown", "crash_text": "Gah!"}, {"type": "machine_info", "machine_info": "I'm awesome.", "version": "0.2.0", "build_id": "unknown", "instance_id": "yyy"}, {"machine_info": "Soup", "crash_text": "boom!", "version": "0.2.0", "build_id": "unknown", "instance_id": "zzz", "type": "crash"}, {"build_id" : "unknown", "cpu_brand" : "intel", "cpu_count" : 4, "cpuid": { "00000000": {"eax" :123,"ebx" :456, "ecx" :789,"edx" :321}, "00000001": {"eax" :123,"ebx" :456, "ecx" :789,"edx" :321}}, "driver_installed" : True, "instance_id" : "yyy", "version" : "0.2.0", "machine_info" : "I'm awesome.", "os_version" : "linux", "physical_memory_mib" : 1024, "product_loaded" : True, "type" : "machine_info", "virtualization_advertised" : True} ])))

    Read the article

  • Recursive function causing a stack overflow

    - by dbyrne
    I am trying to write a simple sieve function to calculate prime numbers in clojure. I've seen this question about writing an efficient sieve function, but I am not to that point yet. Right now I am just trying to write a very simple (and slow) sieve. Here is what I have come up with: (defn sieve [potentials primes] (if-let [p (first potentials)] (recur (filter #(not= (mod % p) 0) potentials) (conj primes p)) primes)) For small ranges it works fine, but causes a stack overflow for large ranges: user=> (sieve (range 2 30) []) [2 3 5 7 11 13 17 19 23 29] user=> (sieve (range 2 15000) []) java.lang.StackOverflowError (NO_SOURCE_FILE:0) I thought that by using recur this would be a non-stack-consuming looping construct? What am I missing?

    Read the article

  • IPC speed and compare

    - by Lily
    I am trying to implement a real-time application which involves IPC across different modules. The modules are doing some data intensive processing. I am using message queue as the backbone(Activemq) for IPC in the prototype, which is easy(considering I am a totally IPC newbie), but it's very very slow. Here is my situation: I have isolated the IPC part so that I could change it other ways in future. I have 3 weeks to implement another faster version. ;-( IPC should be fast, but also comparatively easy to pick up I have been looking into different IPC approaches: socket, pipe, shared memory. However, I have no experience in IPC, and there is definitely no way I could fail this demo in 3 weeks... Which IPC will be the safe way to start with? Thanks. Lily

    Read the article

  • trying to build a web ui tree from scratch

    - by Susan
    I have seen yahoo ui using div for every node of the tree. Is this a good thing to do. Seems like every node including leaf node is heavily nested. I saw a div, table, tr, td being used for creating a node. Is this necessary. Is there a better way to do the same. I tried to us tr for every node. Are there any issues with this approach Thanks

    Read the article

  • PHP: SUBMIT Type vs IMAGE Type

    - by sebb
    I have noticed that when using a SUBMIT type its name attribute gets passed via POST , while an IMAGE type button do not have this data sent, can any one clear this up for me? In both instances the NAME attribute is present at HTML level, but only the SUMBIT type has the NAME sent via POST....is this right?

    Read the article

  • Visual Studio - 'Browse UDDI Servers' -> 404 ?

    - by southof40
    Hi - I have a ASP.Net application which implements a web service. Within the ASP.Net application there's a test script which consumes the web service and it all works etc. I have built a .NET console application and want to 'Add a Web Reference' so that the console app can consume the web service provided by the ASP.NET application. When I use the 'Browse UDDI Servers on the local network' to do that any plausible URL I use results in a 404. I'm guessing I need to do something to my ASP.Net application so that it acts as an UDDI server ? Does anyone know what ? Update I just wanted to clarify something - I'm not desperate to use UDDI it just seems that's the only option in my circumstances which are : I'm actually doing this for another developer who is used to using Visual Studio to do this stuff The other developers system will need to run on another machine within the same network.

    Read the article

  • Conditional column values in NSTableView?

    - by velocityb0y
    I have an NSTableView that binds via an NSArrayController to an NSMutableArray. What's in the array are derived classes; the first few columns of the table are bound to properties that exist on the base class. That all works fine. Where I'm running into problem is a column that should only be populated if the row maps to one specific subclass. The property that column is meant to display only exists in that subclass, since it makes no sense in terms of the base class. The user will know, from the first two columns, why the third column's cell is populated/editable or not. The binding on the third column's value is on arrangedObjects, with a model path of something like "foo.name" where foo is the property on the subclass. However, this doesn't work, as the other subclasses in the hierarchy are not key-value compliant for foo. It seems like my only choice is to have foo be a property on the base class so everybody responds to it, but this clutters up the interfaces of the model objects. Has anyone come up with a clean design for this situation? It can't be uncommon (I'm a relative newcomer to Cocoa and I'm just learning the ins and outs of bindings.)

    Read the article

  • iphone: Help with AudioToolbox Leak: Stack trace/code included here...

    - by editor guy
    Part of this app is a "Scream" button that plays random screams from cast members of a TV show. I have to bang on the app quite a while to see a memory leak in Instruments, but it's there, occasionally coming up (every 45 seconds to 2 minutes.) The leak is 3.50kb when it occurs. Haven't been able to crack it for several hours. Any help appreciated. Instruments says this is the offending code line: [appSoundPlayer play]; that's linked to from line 9 of the below stack trace: 0 libSystem.B.dylib malloc 1 libSystem.B.dylib pthread_create 2 AudioToolbox CAPThread::Start() 3 AudioToolbox GenericRunLoopThread::Start() 4 AudioToolbox AudioQueueNew(bool, AudioStreamBasicDescription const*, TCACallback const&, CACallbackTarget const&, unsigned long, OpaqueAudioQueue*) 5 AudioToolbox AudioQueueNewOutput 6 AVFoundation allocAudioQueue(AVAudioPlayer, AudioPlayerImpl*) 7 AVFoundation prepareToPlayQueue(AVAudioPlayer*, AudioPlayerImpl*) 8 AVFoundation -[AVAudioPlayer prepareToPlay] 9 Scream Queens -[ScreamViewController scream:] /Users/laptop2/Desktop/ScreamQueens Versions/ScreamQueens25/Scream Queens/Classes/../ScreamViewController.m:210 10 CoreFoundation -[NSObject performSelector:withObject:withObject:] 11 UIKit -[UIApplication sendAction:to:from:forEvent:] 12 UIKit -[UIApplication sendAction:toTarget:fromSender:forEvent:] 13 UIKit -[UIControl sendAction:to:forEvent:] 14 UIKit -[UIControl(Internal) _sendActionsForEvents:withEvent:] 15 UIKit -[UIControl touchesEnded:withEvent:] 16 UIKit -[UIWindow _sendTouchesForEvent:] 17 UIKit -[UIWindow sendEvent:] 18 UIKit -[UIApplication sendEvent:] 19 UIKit _UIApplicationHandleEvent 20 GraphicsServices PurpleEventCallback 21 CoreFoundation CFRunLoopRunSpecific 22 CoreFoundation CFRunLoopRunInMode 23 GraphicsServices GSEventRunModal 24 UIKit -[UIApplication _run] 25 UIKit UIApplicationMain 26 Scream Queens main /Users/laptop2/Desktop/ScreamQueens Versions/ScreamQueens25/Scream Queens/main.m:14 27 Scream Queens start Here's .h: #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> #import <MediaPlayer/MediaPlayer.h> #import <AudioToolbox/AudioToolbox.h> #import <MessageUI/MessageUI.h> #import <MessageUI/MFMailComposeViewController.h> @interface ScreamViewController : UIViewController <UIApplicationDelegate, AVAudioPlayerDelegate, MFMailComposeViewControllerDelegate> { //AudioPlayer related AVAudioPlayer *appSoundPlayer; NSURL *soundFileURL; BOOL interruptedOnPlayback; BOOL playing; //Scream button related IBOutlet UIButton *screamButton; int currentScreamIndex; NSString *currentScream; NSMutableArray *screams; NSMutableArray *personScreaming; NSMutableArray *photoArray; int currentSayingsIndex; NSString *currentButtonSaying; NSMutableArray *funnyButtonSayings; IBOutlet UILabel *funnyButtonSayingsLabel; IBOutlet UILabel *personScreamingField; IBOutlet UIImageView *personScreamingImage; //Mailing the scream related IBOutlet UILabel *mailStatusMessage; IBOutlet UIButton *shareButton; } //AudioPlayer related @property (nonatomic, retain) AVAudioPlayer *appSoundPlayer; @property (nonatomic, retain) NSURL *soundFileURL; @property (readwrite) BOOL interruptedOnPlayback; @property (readwrite) BOOL playing; //Scream button related @property (nonatomic, retain) UIButton *screamButton; @property (nonatomic, retain) NSMutableArray *screams; @property (nonatomic, retain) NSMutableArray *personScreaming; @property (nonatomic, retain) NSMutableArray *photoArray; @property (nonatomic, retain) UILabel *personScreamingField; @property (nonatomic, retain) UIImageView *personScreamingImage; @property (nonatomic, retain) NSMutableArray *funnyButtonSayings; @property (nonatomic, retain) UILabel *funnyButtonSayingsLabel; //Mailing the scream related @property (nonatomic, retain) IBOutlet UILabel *mailStatusMessage; @property (nonatomic, retain) IBOutlet UIButton *shareButton; //Scream Button - (IBAction) scream: (id) sender; //Mail the scream - (IBAction) showPicker: (id)sender; - (void)displayComposerSheet; - (void)launchMailAppOnDevice; @end Here's the top of .m: #import "ScreamViewController.h" //top of code has Audio session callback function for responding to audio route changes (from Apple's code), then my code continues... @implementation ScreamViewController @synthesize appSoundPlayer; // AVAudioPlayer object for playing the selected scream @synthesize soundFileURL; // Path to the scream @synthesize interruptedOnPlayback; // Was application interrupted during audio playback @synthesize playing; // Track playing/not playing state @synthesize screamButton; //Press this button, girls scream. @synthesize screams; //Mutable array holding strings pointing to sound files of screams. @synthesize personScreaming; //Mutable array tracking the person doing the screaming @synthesize photoArray; //Mutable array holding strings pointing to photos of screaming girls @synthesize personScreamingField; //Field updates to announce which girl is screaming. @synthesize personScreamingImage; //Updates to show image of the screamer. @synthesize funnyButtonSayings; //Mutable array holding the sayings @synthesize funnyButtonSayingsLabel; //Label that updates with the funnyButtonSayings @synthesize mailStatusMessage; //did the email go out @synthesize shareButton; //share scream via email Next line begins the block with the offending code: - (IBAction) scream: (id) sender { //Play a click sound effect SystemSoundID soundID; NSString *sfxPath = [[NSBundle mainBundle] pathForResource:@"aClick" ofType:@"caf"]; AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:sfxPath],&soundID); AudioServicesPlaySystemSound (soundID); // Because someone may slam the scream button over and over, //must stop current sound, then begin next if ([self appSoundPlayer] != nil) { [[self appSoundPlayer] setDelegate:nil]; [[self appSoundPlayer] stop]; [self setAppSoundPlayer: nil]; } //after selecting a random index in the array (did that in View Did Load), //we move to the next scream on each click. //First check... //Are we past the end of the array? if (currentScreamIndex == [screams count]) { currentScreamIndex = 0; } //Get the string at the index in the personScreaming array currentScream = [screams objectAtIndex: currentScreamIndex]; //Get the string at the index in the personScreaming array NSString *screamer = [personScreaming objectAtIndex:currentScreamIndex]; //Log the string to the console NSLog (@"playing scream: %@", screamer); // Display the string in the personScreamingField field NSString *listScreamer = [NSString stringWithFormat:@"scream by: %@", screamer]; [personScreamingField setText:listScreamer]; // Gets the file system path to the scream to play. NSString *soundFilePath = [[NSBundle mainBundle] pathForResource: currentScream ofType: @"caf"]; // Converts the sound's file path to an NSURL object NSURL *newURL = [[NSURL alloc] initFileURLWithPath: soundFilePath]; self.soundFileURL = newURL; [newURL release]; [[AVAudioSession sharedInstance] setDelegate: self]; [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: nil]; // Registers the audio route change listener callback function AudioSessionAddPropertyListener ( kAudioSessionProperty_AudioRouteChange, audioRouteChangeListenerCallback, self ); // Activates the audio session. NSError *activationError = nil; [[AVAudioSession sharedInstance] setActive: YES error: &activationError]; // Instantiates the AVAudioPlayer object, initializing it with the sound AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: soundFileURL error: nil]; //Error check and continue if (newPlayer != nil) { self.appSoundPlayer = newPlayer; [newPlayer release]; [appSoundPlayer prepareToPlay]; [appSoundPlayer setVolume: 1.0]; [appSoundPlayer setDelegate:self]; //NEXT LINE IS FLAGGED BY INSTRUMENTS AS LEAKY [appSoundPlayer play]; playing = YES; //Get the string at the index in the photoArray array NSString *screamerPic = [photoArray objectAtIndex:currentScreamIndex]; //Log the string to the console NSLog (@"displaying photo: %@", screamerPic); // Display the image of the person screaming personScreamingImage.image = [UIImage imageNamed:screamerPic]; //show the share button shareButton.hidden = NO; mailStatusMessage.hidden = NO; mailStatusMessage.text = @"share!"; //Get the string at the index in the funnySayings array currentSayingsIndex = random() % [funnyButtonSayings count]; currentButtonSaying = [funnyButtonSayings objectAtIndex: currentSayingsIndex]; NSString *theSaying = [funnyButtonSayings objectAtIndex:currentSayingsIndex]; [funnyButtonSayingsLabel setText: theSaying]; currentScreamIndex++; } } Here's my dealloc: - (void)dealloc { [appSoundPlayer stop]; [appSoundPlayer release], appSoundPlayer = nil; [screamButton release], screamButton = nil; [mailStatusMessage release], mailStatusMessage = nil; [personScreamingField release], personScreamingField = nil; [personScreamingImage release], personScreamingImage = nil; [funnyButtonSayings release], funnyButtonSayings = nil; [funnyButtonSayingsLabel release], funnyButtonSayingsLabel = nil; [screams release], screams = nil; [personScreaming release], personScreaming = nil; [soundFileURL release]; [super dealloc]; } @end Thanks so much for reading this far! Any input appreciated.

    Read the article

  • Paperclip - Stream not recognized by identify command

    - by user117046
    I'm getting a paperclip error every time that I upload an image: [paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /tmp/stream20100531-1921-uvlewk-0 is not recognized by the 'identify' command.> I'm running: Ubuntu 10.04, Imagemagick 6.5.1-0 (via apt-get), Paperclip 3.2.1.1 My path to identify is 'usr/bin/identify' and have confirmed Imagemagick works via command line I've tried putting adding the path to the options, but to no avail. I've tried: Paperclip.options[:command_path] = "usr/bin" or Paperclip.options.merge!(:command_path => "/usr/bin") in environment.rb or config/initializers/paperclip.rb. Though it makes no rational sense, I also tried "usr/local/bin" since this is the default for most people. Any thoughts on getting around this? Thanks!

    Read the article

  • dvi generation: no bounding box

    - by Akshey
    Hi, I wrote a research paper in latex and generated pdf using kile. It worked perfectly well. Now conference people are asking for dvi file also. But Kile's quick build process does not give a dvi file, but its 'Latex' compile process does. So I tried to compile the document, and it gave errors for includegraphics saying figure not found. When I append the correct extensions to the image names, that errors stopped coming but new errors came "bounding box is missing". I added bounding box values and now DVI file is being generated. My questions are: I have tried giving very high and low bounding box values but there is no deformation in the PDF. Why? Can I generate a DVI without giving bounding box values? Thanks and regards, Akshey

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >