Daily Archives

Articles indexed Wednesday April 14 2010

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

  • HTML checkbox field is being passed to PHP as checked even when it is not

    - by Ryan
    Hello all, First of all thanks in advance, this has been very frustrating and I'm hoping someone can see something I'm not, I am definitely no php expert. Well here' what is going on. I have a form where I have a checkbox for people to opt in to our newletter. The form element looks like this: <label for=newsletter accesskey=N class="checkbox">Signup for Cloverton's Newsletter</label> <input name="newsletter" type="checkbox" id="newsletter" value="Yes" style="width:20px;" /> That is then submitted to a php file with this code: if (isset($_POST['newsletter']) && $_POST['newsletter'] == 'Yes'){ echo "newletter yes"; $newsletter = 1; }else{ echo "newsletter no"; $newsletter = 0; } $newsletter is then inserted into a database field. The issue is that whether the box is checked or not it is being sent to php as true, so every entry is receiving the newsletter. Any help would be greatly appreciated! Thanks!

    Read the article

  • How to handle float values in a plist

    - by Banjer
    I'm reading in a plist from a web server, generated with some php. When I read that into an NSArray in my iphone app, and then spit the NSArray out with NSLog to check it out, I see that the float values are treated as strings. I would like the "distance" values to be treated as numeric and not strings. This plist is displayed in a table view where it can be sorted by distance, but the problem is is distance is sorted as a string, so I get some funny sorting results. Can I convert the distance values to float from string in the NSArray? Or maybe theres a simpler solution like tweaking the plist definition, or maybe something in the NSMutableURLRequest code? My plist looks like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>name</key> <string>Pizza Joint</string> <key>distance</key> <string>2.1</string> </dict> <dict> <key>name</key> <string>Burger Kang</string> <key>distance</key> <string>5</string> </dict> </array> </plist> After reading it into an NSArray, it looks like this per NSLog: result: ( { distance = "2.1"; name = "Pizza Joint"; }, { distance = 5; name = "Burger Kang"; } ) Here is the Objective-C code that retrieves the plist: // Set up url request // postData and postLength are left out, but I can post in this question if needed. NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:@"http://mysite.com/get_plist.php"]]; [request setHTTPMethod:@"POST"]; [request setValue:postLength forHTTPHeaderField:@"Content-Length"]; [request setValue:@"application/x-www-form-urlencoded charset=utf-8" forHTTPHeaderField:@"Content-Type"]; [request setHTTPBody:postData]; NSError *error; NSURLResponse *response; NSData *result = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; NSString *string = [[NSString alloc] initWithData:result encoding:NSUTF8StringEncoding]; // libraryContent is an NSArray self.libraryContent = [string propertyList]; NSLog(@"result: %@", self.libraryContent);

    Read the article

  • What happens when a computer starts?

    - by darkie15
    Hi All, Hopefully the title isn't funny to be ignored! But I have a genuine interest in understanding what happens when a computer is turned on. i.e. how the computer works on startup, various initializations that take place. For example, is bootstrap loader the first step, when are device drivers loaded etc.. Please guide me to understand. Regards, darkie

    Read the article

  • Silverlight MEF Embedded Resources

    - by Fastidious
    I have two different Silverlight UserControls imported with MEF from two different xaps. The UserControls are simply an Image on a Canvas. Both UserControls have the image marked as 'Resource'. The images are different but their names are the same (key point). I'm not quite sure what's going on behind the scenes of the MEF import but both images seem to end up in the same AppDomain. After the composition when I stick the UserControls on a Canvas, each is an instance of the class it should be, but they both show the same image. Obviously if the image file names are unique across all xaps I import I have no problem but I don't like that solution. Is there a better one?

    Read the article

  • Can a custom WPF control implement the IsDefault property

    - by jpierson
    I have a custom button control that does not derive from Button. Is it possible for me to implement the equivalent of IsDefault so that the command associated with my control will be invoked. I was hoping that this was an attached property that I could add to any control but as far as I can tell it doesn't seem to be. Am I out of luck if my control does not derive from Button or is there at least a reasonable workaround?

    Read the article

  • JavaScript DOM dimension properties (height, width) vs. jQuery dimension methods

    - by powerboy
    Take height for example. JQ height() <=> JS height // WITHOUT padding, border and margin, including invisible areas JQ innerHeight() <==> JS ??? // WITH padding, WITHOUT border and margin, including invisible areas JQ outerHeight(false) <==> JS ??? // WITH padding and border, WITHOUT margin, including invisible areas JQ outerHeight(true) <==> JS ??? // WITH padding, border and margin, including invisible areas JQ ??? <=> JS offsetHeight // WITH padding and border, WITHOUT margin, NOT including invisible areas JQ ??? <=> JS clientHeight // WITH padding, WITHOUT border and margin, NOT including invisible areas Please help me to correct and complete the list.

    Read the article

  • ASP.NET AJAX, WebSeal Junctions, and Sessions

    - by powella
    I've run up across a problem with ASP.NET AJAX (hooked up to WebServices directly) and accessing our site through a WebSeal junction. Listing 11. On this page; http://www.ibm.com/developerworks/tivoli/library/t-ajaxtam/index.html explains that requests to pages which do not result in a content type of text/html are not sent with cookie data. Hence, no session. ASP.NET AJAX requests are returned with a content type of "application/json; charset=utf-8". As such, the WebSeal junction is not appending the Session Cookie to the request. This results in our WebService seeing the user as invalid, due to no session information. The Junction has been setup properly with the -J parameter (thats an uppercase J, which appends the required script for WebSeal to the bottom of the page - this prevents forcing IE into quirks mode.) and we've confirmed that the necessary script exists in the output source. I'm up for any suggestions at this point, as I'm out of ideas. FWIW, the site runs perfectly when not accessed through the WebSeal Junction.

    Read the article

  • Colour Issues in OS X Terminal ssh'd to Ubuntu terminal

    - by devians
    In the OS X Terminal.app, I'm having some colour issues. If I am working locally, there are no colours. If I ssh into my opensolaris machine (using screen inside ssh) there are no colours. If I then ssh into my ubuntu virtualmachine, and say, vim edit a file, the colours are completely broken. On quitting vim, it then keeps the broken colours and applies them to everything until I force a terminal bell. I assume this is a misconfiguration of the ubuntu machines colours, or a mismatching of terminal emulators. What is the best fix in this instance.

    Read the article

  • How can I tell a fresh ubuntu 9.0.4 install to boot from an external Mac OS X usb drive?

    - by Richard Dyce
    I have a reformatted Mac mini containing only a fresh install of Ubuntu 9.0.4. The Apple boot loader as been removed, so I can't hold down option, or the c key to get it to reboot form the install DVD. I do have an external drive (with both a usb and firewire interface available) with a bootable cloned OS X system on it. What steps do I need to go through to in order get grub to see the external drive, and to boot from it so that I can reformat the internal disk as an OS X drive?

    Read the article

  • Windows 7 User / Documents and Settings folders

    - by Kip
    Yo, I have a machine - Windows 7, nothing remarkable about the install but i have multiple drives in the machine. I have a c:\users\username folder which seems to be current and is the one that all windows properties point to. However, i also have a f:\documents and settings\username folder (which was hidden) which is also current and up to date. If i edit anything from either, they seem to "replicate" or update each other ie if i rename an icon on my desktop, it renames it in c:\users\username\desktop and f:\documents and settings\username\desktop. Likewise if i edit directly in one of those folders, it does the same to the other. Any one got any ideas what might cause this? Problem i have is that I need to remove the f drive all together! Thanks in advance

    Read the article

  • Twitter s'éloigne de plus en plus de ses développeurs externes, quel avenir pour leurs applications

    Mise à jour du 14.04.2010 par Katleen Twitter s'éloigne de plus en plus de ses développeurs externes, quel avenir pour leurs applications face aux outils officiels ? A ses débuts, le site de micro-blogging Twitter n'avait pas les moyens financiers de ses ambitions. Aussi s'est-il appuyé sur l'aide de développeurs externes qui lui ont crée gratuitement des services et des outils, en échange de revenus publicitaires. C'est grâce à ces programmeurs que les utilisateurs du réseau communautaire peuvent aujourd'hui raccourcir leurs URLs, poster des twitpics, gèrer plusieurs comptes en même temps, etc. Le travail des développeurs extérieurs a donc largement contribué à l'ascension vertigineuse du sit...

    Read the article

  • How to prevent MSBUILD from copying dependent GAC assemblies to bin

    - by Matt Wrock
    I have a msbuild task that builds my solution and I am migrating it from .net 3.5 to 4.0. I have some dependent DLLs that have Local Copy set to true. The 4.0 version of msbuild is not only copying the dependent DLL (which I want), it is also copying all dependent assemblies of that DLL from the 32 bit version of the GAC to my bin. Not only do I not want these files being copied from the GAC, I especially do not want the 32 bit versions for this 64 bit build. Has the behavior changed in msbuild 4.0? And does anyone know how to force msbuild to use the behavior in 3.5?

    Read the article

  • How to make .focus() work on a radio button array?

    - by flavour404
    Hi, I am trying to get the .focus() working in IE, it works in chrome etc. My form is called: <form name="feedbackform" action="feedback.asp" target="_self" onsubmit="return validate_txt(this)" method="post" style="margin: 0;" my radio buttons: <input type="radio" name="fb_commentype" value="Comment" />Comment <input type="radio" name="fb_commentype" value="Complaint" />Complaint <input type="radio" name="fb_commentype" value="Request" />Request in my javascript I am trying to call using this line: document.forms["feedbackform"].elements["fb_commentype"][0].focus(); As I said, it works in chrome, firefox blah blah blah but in IE 8 I am getting nada, zip and I don't know why, nor can I find a satisfactory answer, is there a way around it? Thanks R.

    Read the article

  • How do I set up TFS PowerShell Snapin

    - by TheSean
    I have installed TFS Power Tools and I am trying to use the powershell snapin, but I can't figure out how to set it up. When I look in the install folder, I only see the following 5 dlls. Microsoft.TeamFoundation.PowerToys.Client.dll Microsoft.TeamFoundation.PowerToys.Common.dll Microsoft.TeamFoundation.PowerToys.Controls.dll Microsoft.VisualStudio.TeamFoundation.PowerToys.Common.dll Microsoft.VisualStudio.TeamFoundation.PowerToys.dll I used instalutil to install each one, and then I used the folowing ps code to see what cmdlets where installed so I could add the snapin but it looks like only a handfull exist in those dlls and these commands are not useful to me right now. PS H:\> get-pssnapin -registered Name : TfsBPAPowerShellSnapIn PSVersion : 1.0 Description : This is a PowerShell snap-in that includes Team Foundation Server cmdlets. PS H:\> get-command -pssnapin TfsBPAPowerShellSnapIn CommandType Name Definition ----------- ---- ---------- Cmdlet Get-MsiProductId Get-MsiProductId [[-ProductIndex] <Int32>] [[-Mo... Cmdlet Get-TfsDBServer Get-TfsDBServer [[-DBPath] <String>] [-Verbose] ... Cmdlet Get-TfsHealthPing Get-TfsHealthPing [-Verbose] [-Debug] [-ErrorAct... Cmdlet Get-TfsSqlData Get-TfsSqlData [[-ConnectionBuilder] <SqlConnect... thanks.

    Read the article

  • How can I limit access to a particular class to one caller at a time in an ASMX web service?

    - by MusiGenesis
    I have a web service method in which I create a particular type of object, use it for a few seconds, and then dispose it. Because of problems arising from multiple threads creating and using instances of this class at the same time, I need to restrict the method so that only one caller at a time ever has one of these objects. To do this, I am creating a private static object: private static object _lock = new object(); ... and then inside the web service method I do this around the critical code: lock (_lock) { using (DangerousObject do = new DangerousObject()) { do.MakeABigMess(); do.CleanItUp(); } } I'm not sure this is working, though. Do I have this right? Will this code ensure that only one instance of DangerousObject is instantiated and in use at a time? Or does each caller get their own copy of _lock, rendering my code here laughable?

    Read the article

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