Search Results

Search found 4252 results on 171 pages for 'david 85'.

Page 113/171 | < Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >

  • Why does $('#id') return true if id doesn't exist?

    - by David
    I always wondered why jQuery returns true if I'm trying to find elements by id selector that doesnt exist in the DOM structure. Like this: <div id="one">one</div> <script> console.log( !!$('#one') ) // prints true console.log( !!$('#two') ) // is also true! (empty jQuery object) console.log( !!document.getElementById('two') ) // prints false </script> I know I can use !!$('#two').length since length === 0 if the object is empty, but it seems logical to me that a selector would return the element if found, otherwise null (like the native document.getElementById does). F.ex, this logic can't be done in jQuery: var div = $('#two') || $('<div id="two"></div>'); Wouldnt it be more logical if the ID selector returned null if not found? anyone?

    Read the article

  • .net bitmap file type limitations

    - by David Archer
    Hi, Given the line: Bitmap bitmap = new Bitmap(stream); where stream is a System.IO.Stream, are there any limitations on the image file type e.g png, jpg, gif etc that can be handled. i.e are all image file/stream header info clear enough to say "I am an image". I haven't run into any yet, but have only being using the pretty standard ones so far. Thanks

    Read the article

  • Android: Width and Height of View After Orientation Change

    - by David
    I need to get the width and height of a WebView and pass them in the query string of the URL I am loading in the WebView. I have found a way to do this in onResume(). Since the width and height are not calculated at this point, I post a Runnable to the WebView to be queued for after the UI loads. Here's my problem: when the orientation changes, I am handling it in onConfigurationChanged. When I try to post a Runnable in onConfigurationChanged to the WebView, the WebView's width and height end up being the old orientation's width and height. At what point can I intercept the new width and height after orientation change?

    Read the article

  • How can I use splne() with ggplot?

    - by David
    I would like to fit my data using spline(y~x) but all of the examples that I can find use a spline with smoothing, e.g. lm(y~ns(x), df=_). I want to use spline() specifically because I am using this to do the analysis represented by the plot that I am making. Is there a simple way to use spline() in ggplot? I have considered the hackish approach of fitting a line using geom_smooth(aes(x=(spline(y~x)$x, y=spline(y~x)$y)) but I would prefer not to have to resort to this. Thanks!

    Read the article

  • Including Build Date strings in a C# project

    - by David Rutten
    I'd like to hard code the build date into my application (DD-mmmm-YYYY), but how do I embed this constant into the code? I thought perhaps I could make a pre-build event that executes a *.bat file that updates a textfile which is resourced, but it sounds pretty involved. What's the best approach?

    Read the article

  • Resolving Assemblies, the fuzzy way

    - by David Rutten
    Here's the setup: A pure DotNET class library is loaded by an unmanaged desktop application. The Class Library acts as a plugin. This plugin loads little baby plugins of its own (all DotNET Class Libraries), and it does so by reading the dll into memory as a byte-stream, then Assembly asm = Assembly.Load(COFF_Image); The problem arises when those little baby plugins have references to other dlls. Since they are loaded via the memory rather than directly from the disk, the framework often cannot find these referenced assemblies and is thus incapable of loading them. I can add an AssemblyResolver handler to my project and I can see these referenced assemblies drop past. I have a reasonably good idea about where to find these referenced assemblies on the disk, but how can I make sure that the Assmebly I load is the correct one? In short, how do I reliably go from the System.ResolveEventArgs.Name field to a dll file path, presuming I have a list of all the folders where this dll could be hiding)?

    Read the article

  • iPhone Application: force landscape mode, strange behaviour...?

    - by David Lawson
    This is a method I use to switch display views, based on a string passed (for example you could pass MainMenuViewController to switch views to a new instance of that class): - (void)displayView:(NSString *)newView { NSLog(@"%@", newView); [[currentView view] removeFromSuperview]; [currentView release]; UIViewController *newView = [[NSClassFromString(newView) alloc] init]; [[newView view] setFrame:CGRectMake(0, 0, 320, 460)]; [self setCurrentView:newView]; [[self view] addSubview:[currentView view]]; } I have my application forced into landscape view (.plist and -shouldRotate), but if you look in the code: [[newView view] setFrame:CGRectMake(0, 0, 320, 460)]; I have to set the frame of the newView to a portrait frame for the view to be displayed correctly - otherwise, for example, a button on the new view can only be pressed in certain parts of the screen (rectangle up the top), unresponsive anywhere else. Even though in all my NIB files they are set to landscape.

    Read the article

  • Possible iphone animation timing/rendering bug?

    - by David
    Hi all, I have been working on an iphone apps for several weeks. Now I encounter an animation problem that I can't figure out how to resolve. Mayhbe you can help. Here is the details (a little long, bear with me): Basically the effect I want to achieve is, when user click a button, a loading view pops up, hiding the whole screen; and then the apps does a lot of heavy computation, which takes a few seconds. Once the computation is done, soem result views (something likes checkers on a checker board) are rendered under the loading view. Once all result views are rendered, I used animation animation to remove the loading view nand show the result views to the user. Here is what I do: when user click a button, run this code: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(loadingViewInserted:finished:context:)]; // use a really high index number so it will always on top [self.view insertSubview:loadingViewController.view atIndex:1000]; [UIView commitAnimations]; In the "loadingViewInserted" function, it calls another function doing the heavy computation work. Once the computation is done, a lot of result views (like checkers on a checker board) are rendered under the loading view. for(int colIndex = 1; colIndex <= result.columns; colIndex++) { for(int rowIndex = 1; rowIndex <= result.rows; rowIndex++) { ResultView *rv = [ResultView resultViewWithData:results[colIndex][rowIndex]]; [self.view addSubview:rv]; } } Once all result views are added, following animation is invoked to remove the loading view: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES]; [loadingViewController.view removeFromSuperview]; [UIView commitAnimations]; By doing this, most of the time (maybe 90%) it does exactly what I want. However, sometime I see some weird result: the loading view shows up first as expected, then before it disappears, some result views, which suppose to be under the loading view, suddenly appears on top of the loading view; and some of them are partial rendered. And then the loading view curled up, and everything looks normal again. The weird situation only lasts for less than a second, but already bad enough to screw up the UI. I have tried all different kinds of thing to fix this (using another thread to remove the loading view, make the loading view non-transparent), but none of them works. The only thing that makes a little better is, I hide all the result views first; after the last animation finished, in its call back, unhide all result views. But this loses the nice effect that when curling up the loading view, the results are already there. At this point, I really think this is a bug in iphone (I compile it with OS 3.0) OS. Or maybe you can point out what I have done wrong (or could do differently). (thanks for finishing this long post, :-) )

    Read the article

  • iPhone - Launching selectors from a different class

    - by David Schiefer
    Hi, I'd like to reload a table view which is in another class called "WriteIt_MobileAppDelegate" from one of my other classes which is called "Properties". I've tried to do this via the NSNotificationCenter class - the log gets called but the table is never updated. Properties.h: [[NSNotificationCenter defaultCenter] postNotificationName:@"NameChanged" object:[WriteIt_MobileAppDelegate class] userInfo:nil]; WriteIt_MobileAppDelegate.m -(void)awakeFromNib { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadItProperties:) name:@"NameChanged" object:self]; } - (void) reloadItProperties: (NSNotification *)notification { NSLog(@"Reloading Data"); //this gets called [self.navigationController popToRootViewControllerAnimated:YES]; [self.tblSimpleTable reloadData]; [self.tblSimpleTable reloadSectionIndexTitles]; // but the rest doesn't } What am I doing wrong here?

    Read the article

  • Within an aray of objects can one create a new instance of an object at an index?

    - by David
    Here's the sample code: class TestAO { int[] x; public TestAO () { this.x = new int[5] ; for (int i = 0; i<x.length; i++) x[i] = i; } public static void main (String[]arg) { TestAO a = new TestAO (); System.out.println (a) ; TestAO c = new TestAO () ; c.x[3] = 35 ; TestAO[] Z = new TestAO[3] ; Z[0] = a ; Z[1] = (TestAO b = new TestAO()) ; Z[2] = c ; } } When i try to compile this i get an error message at the line Z[1] which reads as follows: TestAO.java:22: ')' expected Z[1] = (TestAO b = new TestAO()) ; ^ What i'm trying to do here is create an instance of the object TestAO that i want to be in that index within the assignment of the value at that index instead of creating the instance of the object outside of the array like i did with a. Is this legal and i'm just making some syntax error that i can't see (thus causing the error message) or can what i'm trying to do just not be done?

    Read the article

  • How do I deliver mail for wildcard addresses to a particular user/alias/program?

    - by David M
    I need to configure sendmail so that mail delivered for wildcard addresses is accepted for delivery and then delivered to a user, alias, or directly to a script. I can rewrite the envelope/headers any number of ways, but I don't know how to accept the wildcard address when it's provided in RCPT TO: Everything I've tried so far winds up with a 550 user unknown error. So here's a specific example: I want to be able to handle any address that consists of a series of digits followed by a dot followed by a word, then pipe that to a script. If the headers get rewritten, that's OK, but I need the envelope to contain the actual Delivered-To address. Here's the sort of SMTP session I need: 220 blah.foo.com ESMTP server ready; Thu, 22 Apr 2010 20:41:08 -0700 (PDT) HELO blort.foo.com 250 blah.foo.com Hello blort.foo.com [10.1.2.3], pleased to meet you MAIL FROM: <[email protected]> 250 2.1.0 <[email protected]>... Sender ok RCPT TO: <[email protected]> 250 2.1.5 <[email protected]>... Recipient ok I tried some stuff with regex maps, but I never got past 550 user unknown.

    Read the article

  • Prove that the set of regular languages is a proper subset of the set of the context-free languages

    - by David Relihan
    I was brushing up (not homework)on some computation-theory and came accross this problem: How can you prove that the set of regular languages is a proper subset of the set of the context-free languages. Now I know a language is regular iff it is accepted by a finite automaton. And I know a language is context-free iff it is accepted by a pushdown automaton. But I'm not sure of what solution is.

    Read the article

  • How do I secure a .NET Web Service for use by an iPhone application?

    - by David A Gibson
    Hello, The title says it all, I have a Web Service written in .NET that provides data for an iPhone application. It will also allow the application make a "reservation." Currently it's all internal to the corporate network but obviously when the iPhone application is published I will need ensure the Web Service is available externally. How would I go about securing the Web Service? There are two aspects I'm looking into: Authentication for accessing the web service Protection for the data being transferred I'm no so bothered about the data being passed back and forth as it will be viewable in the application anyway (which will be free). The key issue for me is preventing users from accessing the Web Service and making reservations themselves. At the moment I am considering encrypting any strings in the XML data passed back and forth so only the client can effectively use the web service sidestepping the need for authentication and providing protection for the data. This is the only model I have seen but I think the overheads on the iPhone and even for the web service make for a poor user experience. Any solutions at all would be most welcome? Thanks

    Read the article

  • preg_match_all image source

    - by David
    I have the following regex expression which is to extract the source of any img tag in HTML. /(<img).*(src\s*=\s*"([a-zA-Z0-9\.;:\/\?&=\-_|\r|\n]{1,})")/isxmU However, it doesn't appear to be matching the following: <IMG SRC='http://www.mysite.com/pix/lens/mtf/CAEF8512L.gif'> How can I build it to match this as well?

    Read the article

  • Getting user data from Active Directory using PL/SQL

    - by David Neale
    I had a discussion today regarding an Oracle procedure I wrote some time ago. I wanted to get 7500 user email addresses from Active Directory using PL/SQL. AD will return a maximum of 1000 rows and the LDAP provider used by Oracle will not support paging. Therefore, my solution was to filter on the last two characters of the sAMAccountName (*00,*01,*02...etc.). This results in 126 queries (100 for account names ending in digits, 26 for those ending in a letter...this was sufficient for my AD setup). The person I was speaking to (it was a job interview by the way) said he could have done it a better way, but he would not tell me what that method was. Could anybody hazard a guess at what this method was?

    Read the article

  • How to get total cpu usage in Linux (c++)

    - by cz-david
    I am trying to get total cpu usage in %. First I should start by saying that "top" will simply not do, as there is a delay between cpu dumps, it requires 2 dumps and several seconds, which hangs my program (I do not want to give it its own thread) next thing what I tried is "ps" which is instant but always gives very high number in total (20+) and when I actually got my cpu to do something it stayed at about 20... Is there any other way that I could get total cpu usage? It does not matter if it is over one second or longer periods of time... Longer periods would be more useful, though.

    Read the article

  • How does one declare the type of an Android preference?

    - by David R.
    I have a preferences.xml that looks like this: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <EditTextPreference android:name="Sample" android:enabled="true" android:persistent="true" android:summary="Sample" android:defaultValue="3.0" android:title="Sample" android:key="sample" /> </PreferenceScreen> When I do sp.getString("sample", "3.0"), it works fine and returns a string, but it shouldn't be a string, it should be a float. Running sp.getFloat("sample", 3.0f) throws a ClassCastException because it is a string. What should I put in the XML so that the preference is stored as a float?

    Read the article

  • OpenLayers: Get resolution of map in a given projection (4326)

    - by David Pfeffer
    I'm using OpenLayers to display OpenStreetMap maps. (Though, I'd assume this should be general enough to work for any map product...) I'm displaying some very sophisticated vector overlays, and the amount and resolution of the features I'm returning from the server via GeoJSON to overlay has proven too much for many computers. What I'd like to do now instead is to only send data befitting the resolution of the current zoom. This should be relatively easy to do using the getResolution and calculateBounds methods on the Map object. calculateBounds returns a Bounds object that then can be transformed between the map projection and display projection. How do I transform the resolution into my desired projection (4326 in this case)?

    Read the article

< Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >