Daily Archives

Articles indexed Tuesday April 13 2010

Page 16/126 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Object mapping in objective-c (iphone) from JSON

    - by freshfunk
    For my iPhone app, I'm consuming a RESTful service and getting JSON. I've found libraries to deserialize this into an NSDictionary. However, I'm wondering if there are any libraries to deserialize the JSON/NSDictionary/Property List into my object (an arbitrary one on my side). The java equivalent would be the object-relational mappers although the sort of object mapping I'm looking for is relatively straightforward (simple data types, no complex relationships, etc.). I noticed that Objective-C does have introspection so it seems theoretically possible but I haven't found a library to do it. Or is there a simple way to load an object from an NSDictionary/Property List object that doesn't require modification every time the object changes? For example: { "id" : "user1", "name" : "mister foobar" "age" : 20 } gets loaded into object @interface User : NSObject { NSString *id; NSString *name; int *age; }

    Read the article

  • How come this image won't resize to fit the sprite?

    - by George Edison
    I have this snippet of ActionScript code that is supposed to resize an image to fit the sprite: package { import flash.display.Sprite; import flash.display.Bitmap; import flash.events.Event; public class Main extends Sprite { [Embed(source = 'img.png')] private var TheImage:Class; public static const TheImageWidth:Number = 1300; public static const TheImageHeight:Number = 1300; public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); // entry point var image:Bitmap = new TheImage(); addChild(image); image.scaleX = width / TheImageWidth; image.scaleY = height / TheImageHeight; } } } Why isn't it working?

    Read the article

  • How can I add styles to dynamically added table cells?

    - by Doc Hoffiday
    In my program I have a table that, when loaded, has jQuery add some styles/classes to the table cells and table headers. Everything works fine until rows are added via functionality on the rest of the page. Instead of adding the classes to the table cell during addition, is it possible to "listen" or fire some event that checks to see if child elements were added to the table. Essentially, I want something functionally equivalent to this: $("#table td").live("ready", function(){ // do something }); but the live/ready won't work on a table cell... Any ideas?

    Read the article

  • Why does my UIButton.titleLabel.text disappear when I place an image in the button?

    - by nickthedude
    I've had this problem before but was able to work around it until now, Basically I'm creating a custom UIbutton setting its image as a uiimage and then the button that has had a label until I implimented the below code now loses its label. I need that label because it is set programatically in code that follows. NSString *imageName = [NSString stringWithFormat:kNameOfButtonimage ]; UIImage *image = [UIImage imageNamed:imageName]; [button setImage:image forState:UIControlStateNormal ]; Any help you could lend would be mucho appreciated. -nick

    Read the article

  • Chrome Extension: how to capture selected text and send to a web service

    - by phil swenson
    For the Google Chrome extension, I need to capture selected text in a web page and send to a web service. I'm stuck! First I tried a bookmarklet, but Chrome on Mac seems to have some bookmarklet bugs so I decided to write an extension. I use this code in my ext: function getSelText(){ var txt = 'nothing'; if (window.getSelection){ txt = "1" + window.getSelection(); } else if (document.getSelection) { txt = "2" + document.getSelection(); } else if (document.selection) { txt = "3" + document.selection.createRange().text; } else txt = "wtf"; return txt; } var selection = getSelText(); alert("selection = " + selection); When I click on my extension icon, I get a "1". So I think the act of selecting outside the browser window is causing the text to not be seen by the browser as "selected" any more. Just a theory.... thoughts?

    Read the article

  • jQuery UI draggable() and resizable()

    - by foxlance
    I want to write the draggable() and resizable() code in such a way that all future elements with a particular class will inherit those plugins without calling them again. $('div.resizeMe').resizable({ containment: 'parent', minWidth: 400, minHeight: 200 }) When the above code is executed, all divs with resizeMe class inherits the resizable() function. But if I appended BODY with a new div with the same class, I needed to execute that code again. So my goal here is how to rewrite that code such that it will work for all and including future elements.

    Read the article

  • I am trying to use user-defined functions to print out an A out of stars, but i need help defining m

    - by lm
    def horizline(col): for col in range (col): print("*", end='') print() def vertline(rows, col): for rows in range (rows-2): print ("*", end='') for col in range (col-2): print(' ', end='') print("*") def functionA(width): horizline(width) vertline(width) horizline(width) vertline(width) print() def main(): width=int(input("Please enter a width for the letter: ")) length=int(input("Please enter a lenght for the letter: ")) letter=input("Enter one of the capital letters: A ") if(width>=5 and width<=20): functionA(width) else: print("You have entered an incorrect value") main()

    Read the article

  • How to layout dll or com when develop windows application with .net?

    - by ziang
    Is there any resources that how to create windows application especially for how to design the dll to wrap the api call or the similar? It seems that people don't compile the entire project into a single exe for release and what is the best practice to architect the windows application component based on MVC pattern? Is there any resources or any good book on this topic? Thanks!

    Read the article

  • Forms/AD Authentication with Sharepoint

    - by David Lively
    All, I'm configuring Sharepoint to use forms authentication with LDAP/Active Directory. I'm new to Sharepoint, so if this is obvious, please point me in the right direction. Whenever I attempt to log in with a bad account or password, I get the very friendly (and correct) error message, The server could not sign you in. Make sure your user name and password are correct, and then try again. ... which implies that Sharepoint is able to communicate with AD. If I log in with a valid account, I get a page that says: (I added the grey bar to cover up the login name) Any suggestions? The account I'm logging in with is an administrator and has been granted full control in central administration. Also, interesting note: If I click the "sign in as a different user" link, and attempt to sign in using with the same credentials I just used, the site just redirects back to the login page, with no error or status message. If I then manually enter the site url, it again shows the "Error: Access Denied" page. Argh.

    Read the article

  • How to get Linux in your office

    <b>Tux Radar:</b> "And with Linux and free software making a name for itself in the world of big business, many more people are testing the feasibility of switching small and home office software to their open source equivalents."

    Read the article

  • Need help in making my new laptop dual boot with ubuntu 9.10

    - by michael
    Hi, I have a new laptop which comes with window 7. I want to dual-boot it with ubuntu 9.10. I have burned the install disk of 9.10. But during the install process, I am stuck in 'setup my partition'. It has 2 options: wipe out my whole hard disk' or 'manually configure' I don't want it to wipe out my whole hard disk (i want to keep my window 7). But how can I manually configure the partition to use the free space and create a partition so that I can install ubuntu 9.10 and swap space? Thank you.

    Read the article

  • Pidgin getting "Connection Refused" whenever I connect to IRC server

    - by tvanover
    On my win 7 x64 machine using pidgin 2.6.3 I cannot connect to any IRC server. I have tried most of the North American servers, as well as my workplace's internal server with no luck. I have tried from work as well as from home but different networks have no effect. I keep getting Unable to Connect: Connection refused. It work fine 3 weeks ago on this very machine running Win 7 x64. But then I re-imaged, and did not backup my .purple folder. Which I had used for the past 2 years and originally created on a vista install. I can connect using this install of Pigin to yahoo and msn with no problems. Just not to irc. Any thoughts?

    Read the article

  • automated uninstall

    - by user23950
    Is there any application that can do this?Ive tried pc decrapifier but it seems to be needing a user in order to uninstall the programs that are checked. This is in windows

    Read the article

  • user creating/saving

    - by Xaver
    i want to write 2 program: 1) programm saves all local users to the file. 2) loads file find that users not found on local machine and create user. for searching all users which create on local machine i use next code: foreach (ManagementObject user in userSearcher.Get()) { if ((bool)user["LocalAccount"]) { string UserName = (string)user["FullName"]; } } How can i save the settings of user by name and create user?

    Read the article

  • Bash: Terminate on Timeout/File Overflow while Executing Command

    - by Chris
    I'm writing a mock-grading script in bash. It's supposed to execute a C program which will give some output (which I redirect to a file.) I'm trying to (1) make it timeout after a certain duration and also (2) terminate if the output file reaches a certain file size limit. Not sure how to go about either of these. Any help? Thanks.

    Read the article

  • Installing Django/Python on IIS6

    - by Sohrab Hejazi
    We are currently installing the latest version of Django and Python on IIS6. We have followed the instructions on the following site: http://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer We are receiving a 403 error when trying to access our Django application via the IIS server. We have verified the python installation on IIS6 and it is working properly. We have also verified the Django installation. Our application runs fine under the built-in Django server, but we are having difficulties getting it to run under IIS. We presume we could be getting errors from "Linking Django to PyISAPIe" section of the instructions provided on the link above. Thanks.

    Read the article

  • htaccess problem

    - by ruru
    RewriteEngine On RewriteBase /home RewriteRule ^()$ index.php [NC,L] Rewritecond %{REQUEST_URI} !(^/?.*\..*$) [NC] RewriteRule (.*)$ $1.php [NC] i got css problem(got blank) when i type http://dot.com/home/index.php/

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >