Search Results

Search found 3984 results on 160 pages for 'david gray wright'.

Page 88/160 | < Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >

  • Trouble getting $.ajax() to work in PhoneGap against a locally hosted server

    - by David Gutierrez
    Currently trying to make an ajax post request to an IIS Express hosted MVC 4 Web API end point from an android VM (Bluestacks) on my machine. Here are the snippets of code that I am trying, and cannot get to work: $.ajax({ type: "POST", url: "http://10.0.2.2:28434/api/devices", data: {'EncryptedPassword':'1234','UserName':'test','DeviceToken':'d234'} }).always(function( data, textStatus, jqXHR ) { alert( textStatus ); }); Whenever I run this request I always get back a textStatus of 'error'. After hours of trying different things, I pushed my End Point to an actual server, and was able to actually get responses back in PhoneGap if I built up an XMLHttpRequest by hand, like so: var request = new XMLHttpRequest(); request.open("POST", "http://172.16.100.42/MobileRewards/api/devices", true); request.onreadystatechange = function(){//Call a function when the state changes. console.log("state = " + request.readyState); console.log("status = " + request.status); if (request.readyState == 4) { if (request.status == 200 || request.status == 0) { console.log("*" + request.responseText + "*"); } } } request.send("{EncryptedPassword:1234,UserName:test,DeviceToken:d234}"); Unfortunately, if I try to use $.ajax() against the same end point in the snippet above I still get a status text that says 'error', here is that snippet for reference: $.ajax({ type: "POST", url: "http://172.16.100.42/MobileRewards/api/devices", data: {'EncryptedPassword':'1234','UserName':'test','DeviceToken':'d234'} }).always(function( data, textStatus, jqXHR ) { alert( textStatus ); }); So really, there are a couple of questions here. 1) Why can't I get any ajax calls (post or get) to successfully hit my End Point when it's hosted via IIS Express on the same machine that the Android VM is running? 2) When my end point is hosted on an actual server, through IIS and served through port 80, why can't I get post requests to be successful when I use jquery's ajax calls? (Even though I can get it to work by manually creating an XMLHttpRequest) Thanks

    Read the article

  • Creating an SQL Compact file: Template or script?

    - by David Veeneman
    I am writing an application that writes to SQL Compact files that have a specific schema, and I am now implementing the New File use case. The simplest approach seems to be to use a Template pattern: first, create a template file that lives in the application directory. Then, when the user selects New File, the template is copied to the name and destination specified by the user in a New File dialog. The alternative is a scripted approach: Use the same New File dialog, but dispense with the template file. Instead, create an empty SQL Compact file using the name/destination specified by the user, and then execute a T-SQL script on it from managed code. At this point, I am leaning toward the Template approach, because it is simpler. Is there any reason I should not use that approach? Thanks for your help.

    Read the article

  • Flex: Unexpected leakage with RemoteObject + IExternalizable?

    - by David Wolever
    I've been tinkering with IExternalizable, but I've noticed some unexpected behavior. I've got this class: public function readExternal(input:IDataInput):void { input.readObject(); input.readObject(); input.readObject(); } public function writeExternal(output:IDataOutput):void { output.writeObject("first string"); output.writeObject(424242); output.writeObject("second string"); } But when I try to serialize this class using AMF and send it to a remote server (via RemoteObject), Charles shows me that the request looks like this: But it seems wrong that my serialized object is leaking out into the rest of the request. So, what am I doing wrong? Is there some part of the documentation I've missed?

    Read the article

  • Ad/Banner Management/Rotation for Ruby on Rails?

    - by David N. Welton
    Hi, I have a niche site that I'd like to sell banners for directly, rather than going through adsense. I need a system to manage the whole process: displaying ads and an administrative interface to manage them. It doesn't have to be anything terribly fancy, although open source is greatly preferred so that I can grow the system as needs be. Since the site itself is in Rails, I would prefer something for that environment. Googling turns up bunches of them in PHP, but the results are a bit polluted and I didn't have any luck finding one that was done in/for Rails. If I don't find one, I suppose I'll see what I can do to hack together something and release it myself under an open license. Another possibility is this: http://www.google.com/admanager - anyone have anything to say about it? Is it right for someone just selling a few ads for a not-so-big site? Thanks, Dave

    Read the article

  • How can I modify a custom object in an ASP.NET FormView based on a button click?

    - by David
    I have a FormView that modifies an instance of a custom class. The various form controls (TextBox, DropDownList etc.) are working fine. However, I want to include a Button that will modify the state of the DataItem based on some very simple logic. There is no form control which could control this change in a non-confusing way. So I tried adding a Button and modifying the state of the DataItem in the code-behind. But the problem I encounter is that the FormView's DataItem is null/nothing. From reading this SO question it seems the problem is that the item is not databound when the Button's Click event is fired. So, the question; Is it possible to get the DataItem for the FormView during a Button's Click event? and if not: what are my options for implementing this? Thanks in advance. Edit: I can include any code that might help

    Read the article

  • Why doesn't this loop terminate?

    - by David
    Here's the sample code: public static void col (int n) { if (n % 2 == 0) n = n/2 ; if (n % 2 != 0) n = ((n*3)+1) ; System.out.println (n) ; if (n != 1) col (n) ; } this works just fine until it gets down to 2. then it outputs 2 4 2 4 2 4 2 4 2 4 infinitely. it seems to me that if 2 is entered as n then (n % 2 == 0) is true 2 will be divided by 2 to yeild 1. then 1 will be printed and since (n != 1) is false the loop will terminate. Why doesn't this happen?

    Read the article

  • MS-Access nested DIR - check if a file exists elsewhere whilst looping through a folder

    - by David Carle
    I have used the DIR() command in Microsoft Access 2003 to loop through the files in folder A. This works fine, but I need to check if each file also exists in another location (folder B), and only process the file if it doesn't exist in folder B. The problem is that checking for the file existing in folder B also uses the DIR() function and this then resets or confuses the original one, with the result that no further files are found in folder A. Is there a way to check if a file exists without using DIR? Or, is there a way to have a separate instance of DIR? I suppose I could build a list of the files in folder A into an array and then process the entries in the array, but this seems rather 'clunky' Any suggestions for a better solution? Thanks

    Read the article

  • LINQ Join 2 List<T>s

    - by David Murdoch
    Preface: I don't understand what this does: o => o.ID, i => i.ID, (o, id) => o So go easy on me. :-) I have 2 lists that I need to join together: // contains ALL contacts for a customer. // Each item has a unique ID. // There are no duplicates. ContactCollection list1 = myCustomer.GetContacts(); // contains the customer contacts (in list1) relevant to a REPORT // the items in this list may have properties that differ from those in list1. /*****/// e.g.: /*****/ bool SelectedForNotification; /*****/// may be different. ContactCollection list2 = myReport.GetContacts(); I need to create a third ContactCollection that contains all of the contacts in list1 but with the properties of the items in list2, if they are there (list3.Count == list1.Count). I feel as though I'm not making any sense. So, please ask questions in the comments and I'll try to clarify.

    Read the article

  • Forcing Spring web services to add the xsd namespace to the response

    - by David Rabinowitz
    I'm using the Spring WS version 1.5.8. My response looks like this: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> ... </SOAP-ENV:Body> </SOAP-ENV:Envelope> However, my client (whom I integrate with) requires that I will add more namespace declerations in order for the parsing to succeed: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> ... </soapenv:Body> </soapenv:Envelope> How can I do it?

    Read the article

  • Where does the tomcat axis file server-config.wsdd come from?

    - by David Sykes
    Part of our system provides a web service through apache tomcat, the service is referenced in the server-config.wsdd file. Unfortunately nobody can remember how it got in there. The apache set up has changed, and I need to update the system for the new configuration. What magic keywords can I google for to help me work out how and why it got into the existing server-config.wsdd, and how it might fit into the new server-config.wsdd

    Read the article

  • How can I disable all images for an JFace menu but leave them enabled in the toolbar

    - by David
    If I create a set of actions to be used in a JFace application and I assign images to those actions, those images show up in both the toolbar (where I want them) and in the menus (where I don't want them). Other than supplying two completely separate sets of actions (which eliminates part of the point of actions in the first place), how can I arrange to have those images displayed ONLY in the toolbar, and have the menus display only text?

    Read the article

  • Insert a datetime value with GetDate() function to a SQL server (2005) table?

    - by David.Chu.ca
    I am working (or fixing bugs) on an application which was developed in VS 2005 C#. The application saves data to a SQL server 2005. One of insert SQL statement tries to insert a time-stamp value to a field with GetDate() TSQL function as date time value. Insert into table1 (field1, ... fieldDt) values ('value1', ... GetDate()); The reason to use GetDate() function is that the SQL server may be at a remove site, and the date time may be in a difference time zone. Therefore, GetDate() will always get a date from the server. As the function can be verified in SQL Management Studio, this is what I get: SELECT GetDate(), LEN(GetDate()); -- 2010-06-10 14:04:48.293 19 One thing I realize is that the length is not up to the milliseconds, i.e., 19 is actually for '2010-06-10 14:04:48'. Anyway, the issue I have right now is that after the insert, the fieldDt actually has a date time value up to minutes, for example, '2010-06-10 14:04:00'. I am not sure why. I don't have permission to update or change the table with a trigger to update the field. My question is that how I can use a INSERT T-SQL to add a new row with a date time value ( SQL server's local date time) with a precision up to milliseconds?

    Read the article

  • Varchar2 and Oracle quick question

    - by DAVID
    Hi guys im using varchar2 for a product name field, but when i query the databa from the run SQL command line it shows too many empty spaces, how can i fixe this withouth changing the datatype here is the link to the ss http://img203.imageshack.us/img203/20/varchar.jpg

    Read the article

  • How to retrieve caller context object in Ruby ?

    - by David
    Hi, hereafter is my piece of code that I want to simplify in order to avoid passing an extra argument on each call : module M def do_something(context) puts "Called from #{context}" end module_function :do_something end class Foo def do_stuff M.do_something(self) end end Foo.new.do_stuff Is there a way to do the same think without passing 'self' as an input argument to 'do_something' method like this ? module M def do_something puts "Called from #{method that returns caller object}" end module_function :do_something end class Foo def do_stuff M.do_something end end Foo.new.do_stuff Thanks for your support!

    Read the article

  • Dynamically add a new row as Add in UITableView in edit mode?

    - by David.Chu.ca
    I have a table view with 0 or n rows of data from datastore. I added a customized Edit button on the right of the view's navigation bar. By default, when the edit button is clicked, in the action event, I set the view as edit mode: [self.tableView setEditing:YES animated:YES]; I would like to add a row at the end of the table view with Add button as an accessory on the left when the table view is in edit mode. And the "Add" row will not be displayed when the view is not in edit mode. This is very similar to the case of iPhon'e Contacts application when a contact is in edit mode. I am not sure if I need to add a row dynamically, and how if so? An alternative way I guess is to add more row when tableView:numberOfRowsInSection: is called? If later is the case, I have to make it hidden when the view is not in edit mode and visible when the view is in edit.

    Read the article

  • .NET 2.0 vs .NET 4.0 loading error

    - by David Rutten
    My class library is compiled against .NET 2.0 and works just fine whenever I try to load it as a plugin under the 2.0 runtime. If however the master application is running the .NET 4.0 runtime, I get an exception as soon as the resources need to be accessed: Exception occurred during processing of command: Grasshopper Plug-in = Grasshopper Could not find file 'Grasshopper.resources'. Stack trace: at UnhandledExceptionLogger.UnhandledThreadException(Object sender, ThreadExceptionEventArgs args) at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t) at System.Windows.Forms.Control.WndProcException(Exception e) at System.Windows.Forms.ControlNativeWindow.OnThreadException(Exception e) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.SafeNativeMethods.ShowWindow(Handle Ref hWnd, Int32 nCmdShow) at System.Windows.Forms.Control.SetVisibleCore(Boolean value) at System.Windows.Forms.Form.SetVisibleCore(Boolean value) at System.Windows.Forms.Form.Show(IWin32Window owner) .... What's going on and how do I make my project load on all .NET Runtimes?

    Read the article

  • UITableViewCell is transparent when not supposed to be

    - by David Liu
    My UITableViewCell is being transparent when it's not supposed to be. My table view has a background color and it shows through the table cell, even though they're supposed to be opaque. I'm not sure why this is. Relevant code: UITableViewCell *cell = [table dequeueReusableCellWithIdentifier:emptyIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:emptyIdentifier] autorelease]; } cell.textLabel.text = @"Empty"; cell.textLabel.textAlignment = UITextAlignmentCenter; cell.textLabel.backgroundColor = [UIColor whiteColor]; return cell;

    Read the article

  • How to Make a DVCS Completely Interoperable with Subversion?

    - by David M
    What architectural changes would a DVCS need to be completely interoperable with Subversion? Many DVCSs have some kind of bidirectional interface with Subversion, but there are limitations and caveats. For instance, git-svn can create a repository that mirrors Subversion, and changes to that repo can be sent back to Subversion via 'dcommit'. But the git-svn manpage explicitly cautions against making clones of that repository, so essentially, it's a Subversion working copy that you can use git commands on. Bazaar has a bidirectional Subversion capability too, but its documentation notes that Subversion properties aren't supported at all. Here's the end that I'm pursuing. I want a Subversion repository and a DVCS repository that, in the steady state, have identical content. When something is changed on one, it's automatically mirrored to the other. Subversion users interact with the Subversion repository normally. DVCS users clone the DVCS repository, pull changes from it, and push changes back to it. Most importantly, they don't need to know that this special DVCS repository is associated with a Subversion repository. It would probably be nifty if any clone of the special repository is itself a special repository and could commit directly to Subversion, but it might be sufficient if only the special repository directly interacts with Subversion. I think that's what mostly needed is to improve the bidirectional capability so that changes to Subversion properties are translated to changes in the DVCS repository. Some changes in the DVCS repository would be translated to changes to Subversion properties. Or is the answer to create a new capability in Subversion that interacts with a DVCS repository, using the DVCS repository as just a special storage layer such as fsfs or bdb? If there's not a direct mapping between the things that Subversion and a DVCS regard as having versions, does that imply that there's always going to be some activity that cannot be recorded properly on one or the other?

    Read the article

  • Reading Certificates on iOS Problem

    - by David Schiefer
    I am trying to read certificates from various URLs in iOS. My code however is not working well - the array that should return the information I need always returns null. What am I missing? - (void)findCertificate:(NSString *)url { NSInputStream*input = [[NSInputStream inputStreamWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"https://store.writeitstudios.com"]]] retain]; [input setDelegate:self]; [input scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; [input open]; NSLog(@"Status: %i",[input streamStatus]); } - (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode { NSLog(@"handle Event: %i",eventCode); if (eventCode == NSStreamStatusOpen) { NSArray *certificates = (NSArray*)CFReadStreamCopyProperty((CFReadStreamRef)aStream, kCFStreamPropertySSLPeerCertificates); NSLog(@"Certs: %@",CFReadStreamCopyProperty((CFReadStreamRef)aStream, kCFStreamPropertySSLPeerCertificates)); if ([certificates count] > 0) { SecCertificateRef certificate = (SecCertificateRef)[certificates objectAtIndex:0]; NSString *description = (NSString*)SecCertificateCopySubjectSummary(certificate); NSData *data = (NSData *)SecCertificateCopyData(certificate); NSLog(@"Description: %@",description); } } } And yes, I am aware that I am leaking memory. This is just a snippet.

    Read the article

  • special debugging lines (java)

    - by David
    Recently i've found myself writing a lot of methods with what i can only think to call debugging scaffolding. Here's an example: public static void printArray (String[] array, boolean bug) { for (int i = 0; i<array.lenght; i++) { if (bug) System.out.print (i) ; //this line is what i'm calling the debugging scaffolding i guess. System.out.println(array[i]) ; } } in this method if i set bug to true, wherever its being called from maybe by some kind of user imput, then i get the special debugging text to let me know what index the string being printed as at just in case i needed to know for the sake of my debugging (pretend a state of affairs exists where its helpful). All of my questions more or less boil down to the question: is this a good idea? but with a tad bit more objectivity: Is this an effective way to test my methods and debug them? i mean effective in terms of efficiency and not messing up my code. Is it acceptable to leave the if (bug) stuff ; code in place after i've got my method up and working? (if a definition of "acceptability" is needed to make this question objective then use "is not a matter of programing controversy such as ommiting brackets in an if(boolean) with only one line after it, though if you've got something better go ahead and use your definition i won't mind) Is there a more effective way to accomplish the gole of making debugging easier than what i'm doing? Anything you know i mean to ask but that i have forgotten too (as much information as makes sense is appreciated).

    Read the article

  • Can I use the AJAX Autocomplete extender *without* a webservice?

    - by David
    Using ASP.NET 3.5 with VB codebehind. I don't want to use a webservice to populate an autocomplete extender on a textbox. In this case, it's where the user is entering email addresses and I don't want to make a trip to the database every single time. I'd much rather keep a collection in session state and 'bind' the autocomplete to that. Is it possible to set ServicePath and/or ServiceMethod to something in the codebehind as opposed to a webservice?

    Read the article

  • Why won't this println command start a new line?

    - by David
    Here's the relevant code: public static void printBoarders (Territory x) { int t = 0 ; int n = 0 ; for (int i = 0; i<x.borders.length; i++) { if (x.borders[i] == -1) t = i ; } for (int j = 0; j<x.borders.length; j++) { if (x.borders[j] == 1) n++ ; } Territory.translate (t) ; System.out.print (" has " + n + " borders: ") ; Territory.translate (x.borders) ; System.out.println (" ") ; } When I run this, I get everything on one line without a line break. Why isn't the System.out.println (" ") ; creating a line break? Here is an example of what the output winds up being: Northwest Territory, Alberta, Kamchatka, hidavid-names-macbook-pro:~ davidname$ EDIT: the problem was that this method was never being invoked. A different one which i was replacing was. All is well.

    Read the article

  • Would this method work to scale out SQL queries?

    - by David
    I have a database containing a single huge table. At the moment a query can take anything from 10 to 20 minutes and I need that to go down to 10 seconds. I have spent months trying different products like GridSQL. GridSQL works fine, but is using its own parser which does not have all the needed features. I have also optimized my database in various ways without getting the speedup I need. I have a theory on how one could scale out queries, meaning that I utilize several nodes to run a single query in parallel. The idea is to take an incoming SQL query and simply run it exactly like it is on all the nodes. When the results are returned to a coordinator node, the same query is run on the union of the resultsets. I realize that an aggregate function like average need to be rewritten into a count and sum to the nodes and that the coordinator divides the sum of the sums with the sum of the counts to get the average. What kinds of problems could not easily be solved using this model. I believe one issue would be the count distinct function. Edit: I am getting so many nice suggestions, but none have addressed the method.

    Read the article

< Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >