Search Results

Search found 8167 results on 327 pages for 'general tapioca'.

Page 134/327 | < Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >

  • Is it standard behavior for this code to throw a NullPointerException?

    - by Eric
    I've had a big problem in some library code, which I've pinned down to a single statement: System.out.println((String) null); Ok, the code doesn't actually look like that, but it certainly calls println with a null argument. Doing this causes my whole applicaio to throw an unexpected NullPointerException. In general, should println throw this exception under that circumstance, or is this non-standard behavior due to a poor implementation of the out instance?

    Read the article

  • 'Good' programming form in maintaining / updating / accessing files by entry

    - by zhermes
    Basic Question: If I'm storying/modifying data, should I access elements of a file by index hard-coded index, i.e. targetFile.getElement(5); via a hardcoded identifier (internally translated into index), i.e. target.getElementWithID("Desired Element"), or with some intermediate DESIRED_ELEMENT = 5; ... target.getElement(DESIRED_ELEMENT), etc. Background: My program (c++) stores data in lots of different 'dataFile's. I also keep a list of all of the data-files in another file---a 'listFile'---which also stores some of each one's properties (see below, but i.e. what it's name is, how many lines of information it has etc.). There is an object which manages the data files and the list file, call it a 'fileKeeper'. The entries of a listFile look something like: filename , contents name , number of lines , some more numbers ... Its definitely possible that I may add / remove fields from this list --- but in general, they'll stay static. Right now, I have a constant string array which holds the identification of each element in each entry, something like: const string fileKeeper::idKeys[] = { "FileName" , "Contents" , "NumLines" ... }; const int fileKeeper::idKeysNum = 6; // 6 - for example I'm trying to manage this stuff in 'good' programatic form. Thus, when I want to retrieve the number of lines in a file (for example), instead of having a method which just retrieves the '3'rd element... Instead I do something like: string desiredID = "NumLines"; int desiredIndex = indexForID(desiredID); string desiredElement = elementForIndex(desiredIndex); where the function indexForID() goes through the entries of idKeys until it finds desiredID then returns the index it corresponds to. And elementForIndex(index) actually goes into the listFile to retrieve the index'th element of the comma-delimited string. Problem: This still seems pretty ugly / poor-form. Is there a way I should be doing this? If not, what are some general ways in which this is usually done? Thanks!

    Read the article

  • Calendar formatting issues

    - by Philipp
    Hi folks! We're searching for information on how to format instances of java.util.Calendar and more general information and coding hints regarding transition from using java.util.Date to java.util.Calendar. best, phil

    Read the article

  • C++ TerminateProcess function

    - by jemper
    I've been searching examples for the Win32 API C++ function TerminateProcess() but couldn't find any. I'm not that familiar with the Win32 API in general and so I wanted to ask if someone here who is better in it than me could show me an example for, Retrieving a process handle by its PID required to terminate it and then call TerminateProcess with it. If you aren't familiar with C++ a C# equivalent would help too.

    Read the article

  • Given a PHP class would be the best and simplest way to override one or two of its methods with one

    - by racl101
    Here's the objective. I have a PHP class and there are one or two of its methods that I would like to override with my own. As I understand OOP (in PHP and in general) I could write a child class that extends it and overrides the functionality of the methods in question. However, I was wondering if this is the best way of achieving this task and if this is a proper use for child classes or if there is something better in PHP for what I'm trying to do.

    Read the article

  • Validating entered user data

    - by msfanboy
    Hello, this is a general question but I do a desktop application. Should I check for example the firstname exceeding 50 chars or is this a matter of taste? Or should I check for 50 chars because the user could flood my database with 10000000 chars ?

    Read the article

  • iPhone 3rd Party Controls?

    - by Driss Zouak
    I was wondering if there are any 3rd party controls for use with the iPhone that are available, even better if usable from Interface Builder. From what I can gather, the answer is no. I come from a Microsoft .NET background where of course there are tons of controls available from 3rd parties. I'm curious if this is a general Mac development ecosystem fact, i.e. no 3rd party controls for sale, or just an iPhone one, or if I've just missed finding them.

    Read the article

  • Add a custom jquery validation method not connected to a field

    - by Johan Wikström
    Normally all validation methods is connected to a field, radiobuttons, dropdowns etc. In my case I would like to do a general custom validation that depends on many fields in my form. I dont want one field of them to become highlighted like a normal "required", i would rather just show a message in the errorcontainer. Is there a simple way to do this I have overlooked?

    Read the article

  • What is a .NET application domain?

    - by Luke
    In particular, what are the implications of running code in two different application domains? How is data normally passed across the application domain boundary? Is it the same as passing data across the process boundary? I'm curious to know more about this abstraction and what it is useful for. EDIT: Good existing coverage of the AppDomain class in general at http://stackoverflow.com/questions/622516/i-dont-understand-appdomains

    Read the article

  • Visual Studio 2005- 2008 IDE Editor Tools

    - by GutierrezDev
    Hi everyone. I'm looking for some Vs 2005-2008 Editor Tools like those one in NetBeans or Eclipse that auto insert a close bracket '}' or auto insert a line after an opening bracket '{'. In general a tool that enhance the Editor. I know that resharper does some of the tricks but it is expensive for me.

    Read the article

  • How does one programmatically download files from the web?

    - by ytrp
    How are files downloaded from servers in programming languages like C? I understand higher level languages have magic functions like "download_file_from_url()" but they don't help me understand what is actually going on. I'm a little familiar with sockets but network programming in general is still a black box to me. Thanks for any help.

    Read the article

  • Is strict mode more performant?

    - by sje397
    Does executing javascript within a browser in 'strict mode' make it more performant, in general? Do any of the major browsers do additional optimisation or use any other techniques that will improve performance in strict mode? Edit: Since none of the major engines actually implement strict mode, I'll rephrase slightly: Is strict mode intended, amongst its other goals, to allow browsers to introduce additional optimisations or other performance enhancements?

    Read the article

  • Possible ways of representing data in memory (.net)

    - by This is it
    Hi What are the possible ways of representing data in memory in .Net (or in general)? It would be great if data could be sorted and looked up by key (or multiple keys). We are thinking to use collections, arrays, list of collections/arrays. One object would be in several collections (one sorted asc, other desc, etc.). Maybe this is not a good idea, and we would like to hear some other possible solutions. Thank you

    Read the article

  • How do you find out what element type the root element is with jquery

    - by user363873
    I'm sending an ajax request that will either give me an error or a userID <?xml version="1.0" encoding="UTF-8"?> <error>1000</error> <?xml version="1.0" encoding="UTF-8"?> <userID>8</userID> how can I find out if the root element is error or userID using jquery or just javascript in general. Using the find method doesn't appear to work if what you're trying to access is the root element

    Read the article

  • Can this statement ever evaluate to FALSE?

    - by BojanG
    I stumbled upon this while doing a review and the author is not available: int n = Convert.ToInt32(text); if (((n > 0) || (n < 0)) || (n == 0)) { return 1; } The code in general looks solid and it's hard for me to believe that the only purpose of this snippet is to confuse reviewers, but I don't see a way for this condition to fail. Am I missing something?

    Read the article

  • Call the official *Settings* app from my app on iPhone(Location Service)

    - by zt9788
    At one point in my app, I would like to redirect the user to the official Settings app. If possible, I also want go straight to the Location service section within the Settings app. i see Call the official *Settings* app from my app on iPhone but In iPhone4 the following code does not respond(my ios version 5.1.1): [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]];//1 call Location service [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]];//2 //call wifi [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=General&path=Network"]];//3

    Read the article

< Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >