Search Results

Search found 31491 results on 1260 pages for 'simple talk'.

Page 61/1260 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • Write simple data to iphone sandbox?

    - by fuzzygoat
    I want to write a small bit of data from my app to the iphone so I can load it when the app next starts. I am going to write the data using NSCoding, but I don't know what I should be specifying as a path. I understand I would write the data to the application sandbox, just not sure how to specify that. gary

    Read the article

  • Simple Javascript question

    - by butteff
    When I click on the button, the first time, everything works fine, but the second time, nothing happens. Why is that? <form name="alert"><input type="text" name="hour"><input type="text" name="min"><input type="button" value="ok" onclick="budilnik(this.form)"> <script type="text/javascript"> function budilnik(form) { budilnik=1; min=form.min.value; hour=form.hour.value; alert (min+' '+hour+' '+budilnik); } </script>

    Read the article

  • Simple PHP file

    - by Peter
    Here is my code <html> <body> <?php echo "<b>Hello World</b> <br />"; ?> </body> </html> I have named the file as test.php but I dont get the desired output in my firefox 3.6 browser. Output Hello World "; ?>

    Read the article

  • ASP.NET MVC vs. WebForms - a simple question

    - by Tony
    Hi, I'm wondering about one thing - as we know, the MVC pattern is stateless (it doesn't use the ViewState, so we use only HTML controls), but if we use them in WebForms as well, it'll become stateless too ? so, by doing this, we are getting closer to the MVC pattern ?

    Read the article

  • Simple ASP.NET MVC views without writing a controller

    - by Jake Stevenson
    We're building a site that will have very minimal code, it's mostly just going to be a bunch of static pages served up. I know over time that will change and we'll want to swap in more dynamic information, so I've decided to go ahead and build a web application using ASP.NET MVC2 and the Spark view engine. There will be a couple of controllers that will have to do actual work (like in the /products area), but most of it will be static. I want my designer to be able to build and modify the site without having to ask me to write a new controller or route every time they decide to add or move a page. So if he wants to add a "http://mysite.com/News" page he can just create a "News" folder under Views and put an index.spark page within it. Then later if he decides he wants a /News/Community page, he can drop a community.spark file within that folder and have it work. I'm able to have a view without a specific action by making my controllers override HandleUnknownAction, but I still have to create a controller for each of these folders. It seems silly to have to add an empty controller and recompile every time they decide to add an area to the site. Is there any way to make this easier, so I only have to write a controller and recompile if there's actual logic to be done? Some sort of "master" controller that will handle any requests where there was no specific controller defined?

    Read the article

  • Ruby PTY.spawn is Hanging - How to fill out Email and Password in simple example

    - by viatropos
    After asking this question, it looks like I need to use Ruby's PTY Module, of which there is no documentation. I have written this code to try to push content to Google App Engine because the python command sometimes asks me for my username and password. But when I run this code, it just hangs. cmd = "appcfg.py update cdn" PTY.spawn("#{cmd} 2>&1") do | input, output, pid | begin input.expect("Email:") do output.write("#{credentials[:username]}\n") end input.expect("Password:") do output.write("#{credentials[:password]}\n") end rescue Exception => e puts "GAE Error..." end end What am I missing here? How can I get this to work?

    Read the article

  • A simple factory_girl question

    - by gmile
    I have two factories (post_factory.rb, comment_factory.rb) in separate files. I'd like to create a bit complex factory, which will create a post with associated comments for me. I created a third file, called complex_factory.rb, and wrote the following code: Factory.define :post_with_comments, :parent => :post do |post| post.after_create { |p| Factory(:user_last_state, :post => p) } end But rake spec raises an error, stating that the file is unaware of post and comment factories. At the very next moment, I naïvely wrote requires at the top: require "post_factory.rb" require "comment_factory.rb" But that didn't gave any proper result. Maybe this requires actually looking the wrong direction? Or they pretty much don't matter (as registering factories for visibility might be more complex that I assume). Am I missing something? Any ideas?

    Read the article

  • Simple Python Challenge: Fastest Bitwise XOR on Data Buffers

    - by user213060
    Challenge: Perform a bitwise XOR on two equal sized buffers. The buffers will be required to be the python str type since this is traditionally the type for data buffers in python. Return the resultant value as a str. Do this as fast as possible. The inputs are two 1 megabyte (2**20 byte) strings. The challenge is to substantially beat my inefficient algorithm using python or existing third party python modules (relaxed rules: or create your own module.) Marginal increases are useless. from os import urandom from numpy import frombuffer,bitwise_xor,byte def slow_xor(aa,bb): a=frombuffer(aa,dtype=byte) b=frombuffer(bb,dtype=byte) c=bitwise_xor(a,b) r=c.tostring() return r aa=urandom(2**20) bb=urandom(2**20) def test_it(): for x in xrange(1000): slow_xor(aa,bb)

    Read the article

  • Simple NSTableView bindings example

    - by sirjorj
    I am trying to populate a 2-column NSVTableView via bindings, but the data is not showing up in the table. In XCode: I have a NSMutableArray in my AppDelegate that will hold the data, as well as the corresponding @property and @synthesize. On an event, I call [removeAllObjects] on the NSMutableArray and repopulate it with some NSDictionary objects. Each dictionary contains 2 KVP's: a NAME and a VALUE. In IB: I added an NSArrayController and bound it's Content Array to my AppDelegate and set the ModelKeyPath to the name of the NSMutableArray in the AppDelegate. On the NSTableView, I bound the Content to the ArrayController. ControllerKey = "arrangedObjects", ModelKeyPath = empty. For each of the two columns, I bound the Value to the AppController and set the ModelKeyPaths to NAME and VALUE respectively. ControllerKey = "ArrangedObjects". I have tried several other things, such as using an NSArray in the app delegate and making a new one every time I need to update the values. There must be some tiny little thing I am forgetting. What is it? jorj

    Read the article

  • Simple Java Applet not loading in FireFox / Safari on MacOS

    - by Sleepless
    Hello all, I'm probably missing something very basic here. I'm trying to get my first applet to run inside a local HTML page in Firefox 3.6 on Mac OS 10.5.8. Here's the applet's code: package SimpleApplet; import java.applet.Applet; import java.awt.*; public class MyApplet extends Applet { private static final long serialVersionUID = 1L; public void init() { } public void stop() { } public void paint(Graphics g) { g.drawString("Tweedle-Dee!",20,40); } } Here's the HTML page: <html> <body> Here's the applet: <br/> <applet code="MyApplet.class" width="300" height="150"> </applet> </body> </html> Both files (.class and .html) are in the same folder on my local machine. Now when I load the .html file into Firefox, a rectangle with a red X gets displayed. The applet works when started from Eclipse (using JRE 1.5 BTW). Also, it's not a general problem with my browser, as several pages with applets (e.g. http://java.sun.com/applets/jdk/1.4/demo/applets/Blink/example1.html) work. This is also difficult to troubleshoot because there is no output at all on the Java console... Any suggestions are appreciated!

    Read the article

  • IS there a simple way to remove Alt-Character shortcuts at runtime

    - by Dan Neely
    I have a dialog with a number of Alt-Letter shortcuts on labels for textboxes/etc. This dialog can present data in either an editable or a read-only mode. I've received a request to hide the underlines for the shortcuts if the dialog is in read only mode. Other than editing the label text at runtime (ugh) is there any way to remove them? If you don't know what I'm referring to by alt-Letter shortcuts see this question.

    Read the article

  • Facebook Connect for simple authentication?

    - by Starnzy
    Hi I have an ASP.net website which I want to introduce 'Facebook Connect' functionality into, purely for account login/creation purposes. I want a user to be able to click the 'Login using Facebook' type button, and to then log that user into my website based on a userid lookup from the Facebook response. I have a couple of questions surrounding this: Presumeably I can do all of this using the Facebook API - without the need for an actual pretty public facing 'application' on Facebook? I simply want to utilise the Facebook API for authenticating an account. I'm not interested in creating some app for doing something 'within' facebook itself. I have located some code snippets online and tried using the Facebook Developer Toolkit, calling the getInfo method, and whilst it does come back to my website with a uid, none of the other user information is present within the response, like Email, Name etc. The uid is the only populated field in the response. Here is the code I use: if (ConnectAuthentication.isConnected()) { API api = new API(); api.ApplicationKey = ConnectAuthentication.ApiKey; api.SessionKey = ConnectAuthentication.SessionKey; api.Secret = ConnectAuthentication.SecretKey; api.uid = ConnectAuthentication.UserID; //Display user data captured from the Facebook API. facebook.Schema.user facebookUser = null; try { facebookUser = api.users.getInfo(); User user = new User(); user.FacebookUser = facebookUser; user.IsFacebookUser = true; return user; } catch { return null; } } else { return null; } Can anyone please help with either/both of these queries? Thanks in advance...

    Read the article

  • Using Session in Silverlight using simple WebServices (NOT WCF)

    - by Syed
    Hi, I need to use Session variables in my Silverlight application ( Using Visual Studio 2008, and Silverlight 3). I am already using a webservice (not WCF service) and would like to know if I can add two methods say GetSessionVariable and SetSessionVariable in my existing WebService Class? Any assistance with sample code would be great! Regards and Thanks in advance, Nadeem.

    Read the article

  • Simple mod_rewrite rule.....?

    - by eberswine
    Hello. I have a edit page that looks at record_id's in the url.. I don't want the user to see any record id, that way they can't replace it with another and edit another record.... Anyways, my url is like: http://www.mywebsite.com/folder/folder_detail_edit.php?recordID=3980 I would like it to just display: http://www.mywebsite.com/folder/folder_detail_edit.php Is this possible regardless of the recordID???

    Read the article

  • Simple PHP upload form not working

    - by Lea
    Hi all, I seem to run into so many issues when dealing with writing to directories. If someone could please look over this script, and tell me why it's not working, I'd be so appreciative. Upon uploading the file from the form, I don't get anything.. It doesnt output any errors, it simply just refreshes. Thanks, Lea <?php include ('config.php'); if( isset($_POST['submit']) ) { $target = ''.$_SERVER['DOCUMENT_ROOT'].'/images/'; $target = $target . basename( $_FILES['photo']['name']) ; $url = basename( $_FILES['photo']['name']) ; if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { $moved = "File has been moved to location $target"; $name = mysql_real_escape_string($_POST['photoname']); mysql_query("INSERT INTO photos (photo_name, photo_image) VALUES ('$name', '$url' )") or die(mysql_error()); $success = "Photo has been added!"; } else { $moved = "File has not been moved to $target"; $success = "Failed to upload:("; } } ?> <!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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Photo Upload</title> <meta name="robots" content="index, follow" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="<?php echo $globalurl; ?>styles.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="holder"> <br /><br /> <b>Add a new photo</b> <hr /> <br /> <b><?php echo "$success<br />"; ?> <?php echo "$moved<br />"; ?></b> <form enctype="multipart/form-data" method="post" action="<?php echo $PHP_SELF; ?>"> <table cellspacing="0" cellpadding="0" width="500px"> <tbody> <tr> <td valign="top">Photo Name:</td> <td valign="top"> <input type="text" name="photoname" /><br /> <br /> </td> </tr> <tr> <td valign="top">Photo:</td> <td valign="top"> <input type="file" name="photo"><br /> <br /> </td> </tr> </tbody> </table> <input type="submit" value="submit" /> </form> </div> </body> </html>

    Read the article

  • Android ==> Simple 2d Animation ???

    - by aryaxt
    public void MoveMyButton (int x) //where the button suppose to move to { TranslateAnimation anim=new TranslateAnimation(this.getLeft() ,x, this.getTop() ,20)); anim.setFillAfter(true); anim.setDuration(1000); this.setAnimation(anim); anim.start(); } button's x at start is 1. I call the method to move it to 100, and it goes from 1 to 100 I call it to go to 200, and it goes from 1 to 200, instead of 100 to 200 Is there any way to make the animation to save the location of the button as it animates it? Thanks

    Read the article

  • I need a simple command line program to transform XML using XSLT

    - by fuzzy lollipop
    I am on OSX Snow Leopard (10.6.2) I can install anything I need to. I would preferably like a Python or Java solution. I have searched on Google and found lots of information on writing my own program to do this, but this is a just a quick and dirty experiment so I don't want to invest a lot of time on writing a bunch of code to do this, I am sure someone else has done this already.

    Read the article

  • simple regex to splice out text in ruby

    - by user141146
    I'm using ruby and I want to splice out a piece of a string that matches a regex (I think this is relatively easy, but I'm having difficulty) I have several thousand strings that look like this (to varying degrees) my_string = "adfa <b>weru</b> orua fklajdfqwieru ofaslkdfj alrjeowur woer woeriuwe <img src=\"/images/abcde_111-222-333/111-222-333.xml/blahblahblah.jpg\" />" I would like to splice out the /111-222-333.xml (the value of this changes from string to string, but suffice it to say is that I want to remove the piece between 2 forward slashes that contains something.xml. my hope was to find a match like this my_match = my_string.match(/\/.+?\.xml\//) but this actually captures "/b> orua fklajdfqwieru ofaslkdfj alrjeowur woer woeriuwe <img src=\"/images/abcde_111-222-333/111-222-333.xml/" I assumed that .+? would match what I am looking for, but it seems like it starts with the first forward slash that it finds (even though it's non-greedy) and then expands forward to the ".xml"). Any thoughts on what I'm doing wrong? TKS!!

    Read the article

  • Why isn't this simple PHP/MySQL code working?

    - by Sammy
    I am very new to php/mysql and this is causing me to loose hairs, I am trying to build a multi level site navigation. In this part of my script I am readying the sub and parent categories coming from a form for insertion into the database: // get child categories $catFields = $_POST['categories']; if (is_array($catFields)) { $categories = $categories; for ($i=0; $i<count($catFields); $i++) { $categories = $categories . $catFields[$i]"; } } // get parent category $select = mysql_query ("SELECT parent FROM categories WHERE id = $categories"); while ($return = mysql_fetch_assoc($select)) { $parentId = $return['parent']; } The first part of my script works fine, it grabs all the categories that the user has chosen to assign a post by checking the checkboxes in a form and readies it for insertion into the database. But the second part does not work and I can't understand why. I am trying to match a category with a parent that is stored in it's own table, but it returns nothing even though the categories all have parents. Can anyone tell me why this is? p.s. The $categories variable contains the sub category id.

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >