Search Results

Search found 556 results on 23 pages for 'nathan f77'.

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

  • Populate a jTable Using MySQL

    - by Nathan Campos
    I have a project with a jTable called AchTable, that is like this: +-------+------+ | File | Type | +-------+------+ | | | | | | | | | +--------------+ And I have a mySQL table that is like the same, then I want to know how could I populate the jTable.

    Read the article

  • How to make a custom NSFormatter work correctly on Snow Leopard?

    - by Nathan
    I have a custom NSFormatter attached to several NSTextFields who's only purpose is to uppercase the characters as they are typed into field. The entire code for my formatter is included below. The stringForObjectValue() and getObjectValue() implementations are no-ops and taken pretty much directly out of Apple's documentation. I'm using the isPartialStringValid() method to return an uppercase version of the string. This code works correctly in 10.4 and 10.5. When I run it on 10.6, I get "strange" behaviour where text fields aren't always render the characters that are typed and sometimes are just displaying garbage. I've tried enabling NSZombie detection and running under Instruments but nothing was reported. I see errors like the following in "Console": HIToolbox: ignoring exception '*** -[NSCFString replaceCharactersInRange:withString:]: Range or index out of bounds' that raised inside Carbon event dispatch ( 0 CoreFoundation 0x917ca58a __raiseError + 410 1 libobjc.A.dylib 0x94581f49 objc_exception_throw + 56 2 CoreFoundation 0x917ca2b8 +[NSException raise:format:arguments:] + 136 3 CoreFoundation 0x917ca22a +[NSException raise:format:] + 58 4 Foundation 0x9140f528 mutateError + 218 5 AppKit 0x9563803a -[NSCell textView:shouldChangeTextInRange:replacementString:] + 852 6 AppKit 0x95636cf1 -[NSTextView(NSSharing) shouldChangeTextInRanges:replacementStrings:] + 1276 7 AppKit 0x95635704 -[NSTextView insertText:replacementRange:] + 667 8 AppKit 0x956333bb -[NSTextInputContext handleTSMEvent:] + 2657 9 AppKit 0x95632949 _NSTSMEventHandler + 209 10 HIToolbox 0x93379129 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1567 11 HIToolbox 0x933783f0 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 411 12 HIToolbox 0x9339aa81 SendEventToEventTarget + 52 13 HIToolbox 0x933fc952 SendTSMEvent + 82 14 HIToolbox 0x933fc2cf SendUnicodeTextAEToUnicodeDoc + 700 15 HIToolbox 0x933fbed9 TSMKeyEvent + 998 16 HIToolbox 0x933ecede TSMProcessRawKeyEvent + 2515 17 AppKit 0x95632228 -[NSTextInputContext handleEvent:] + 1453 18 AppKit 0x9562e088 -[NSView interpretKeyEvents:] + 209 19 AppKit 0x95631b45 -[NSTextView keyDown:] + 751 20 AppKit 0x95563194 -[NSWindow sendEvent:] + 5757 21 AppKit 0x9547bceb -[NSApplication sendEvent:] + 6431 22 AppKit 0x9540f6fb -[NSApplication run] + 917 23 AppKit 0x95407735 NSApplicationMain + 574 24 macsetup 0x00001f9f main + 24 25 macsetup 0x00001b75 start + 53 ) Can anybody shed some light on what is happening? Am I just using NSFormatter incorrectly? -(NSString*) stringForObjectValue:(id)object { if( ![object isKindOfClass: [ NSString class ] ] ) { return nil; } return [ NSString stringWithString: object ]; } -(BOOL)getObjectValue: (id*)object forString: string errorDescription:(NSString**)error { if( object ) { *object = [ NSString stringWithString: string ]; return YES; } return NO; } -(BOOL) isPartialStringValid: (NSString*) cStr newEditingString: (NSString**) nStr errorDescription: (NSString**) error { *nStr = [NSString stringWithString: [cStr uppercaseString]]; return NO; }

    Read the article

  • How can I force asp.net webapi to always decode POST data as JSON

    - by Nathan Reed
    I getting some json data posted to my asp.net webapi, but the post parameter is always coming up null - the data is not being serialized correctly. The method looks something like this: public HttpResponseMessage Post(string id, RegistrationData registerData) It seems the problem is that the client (which I have no control over) is always sending the content-type as x-www-form-urlencoded, even though the content is actually json. This causes mvc to try to deserialize as form data, which fails. Is there anyway to get webapi to always deserialize as json, and to ignore the content-type header?

    Read the article

  • NHibernate Query

    - by Nathan Roe
    Is it possible to get NHibernate to generate a query similar to the following with HQL or Criteria API? select * from ( select row_number() over ( partition by Column1 order by Column2 ) as RowNumber, T.* from MyTable T ) where RowNumber = 1 I can get it to execute the inner select using the formula attribute, but I can't figure out a way to write a HQL or Criteria query that lets me wrap the inner select in the outer one.

    Read the article

  • Grep and Awk in Windows Invalid Char in Expression Error

    - by Nathan
    I am new to grep and awk - using Windows 7 (I downloaded grep and awk for windows from GnuWin). I am have having trouble running this script: grep -Fwf dictionary.txt frequency.txt | awk '{print $2 "," $1}' I get the error: awk: '{print awk: ^ invalid char ''' in expression I believe it might have something to do with having to use double quotes in Windows, but I tried all the combinations I can think of and still it doesn't work. Can anyone help? Thanks

    Read the article

  • Using TortoiseHg to push to a authenticated git repository

    - by Nathan Palmer
    I'm trying to push a changeset from a local Mercurial repository created with TortoiseHg to a remote Git repository. I have hg-git installed and configured and it will pull just fine. But when I run the push it gives me this Command hg push git+ssh://git@dummyrepo:username/repo.git Result pushing to git+ssh://git@dummyrepo:username/repo.git importing Hg objects into Git creating and sending data abort: the remote end hung up unexpectedly There are several things I've done to get to this point. But I'm hoping to resolve this last thing because I find TortoiseHg to be much easier to work with than any of the Git tools out there (for windows.) Installed TortoiseHg Pulled down the hg-git from http://bitbucket.org/durin42/hg-git/ Configured mercurial.ini to point to the hg-git library Pulled down dulwich source from git://git.samba.org/jelmer/dulwich.git Compiled dulwich and put it into library.zip for TortoiseHg Configured TortoiseHg to use TortoisePlink.exe for ssh Added my private key to Pageant Any ideas what I could be missing?

    Read the article

  • Using TortoiseHg to push to an authenticated git repository

    - by Nathan Palmer
    I'm trying to push a changeset from a local Mercurial repository created with TortoiseHg to a remote Git repository. I have hg-git installed and configured and it will pull just fine. But when I run the push it gives me this Command hg push git+ssh://git@dummyrepo:username/repo.git Result pushing to git+ssh://git@dummyrepo:username/repo.git importing Hg objects into Git creating and sending data abort: the remote end hung up unexpectedly There are several things I've done to get to this point. But I'm hoping to resolve this last thing because I find TortoiseHg to be much easier to work with than any of the Git tools out there (for windows.) Installed TortoiseHg Pulled down the hg-git from http://bitbucket.org/durin42/hg-git/ Configured mercurial.ini to point to the hg-git library Pulled down dulwich source from git://git.samba.org/jelmer/dulwich.git Compiled dulwich and put it into library.zip for TortoiseHg Configured TortoiseHg to use TortoisePlink.exe for ssh Added my private key to Pageant Any ideas what I could be missing?

    Read the article

  • DDD and MVC: Difference between 'Model' and 'Entity'

    - by Nathan Loding
    I'm seriously confused about the concept of the 'Model' in MVC. Most frameworks that exist today put the Model between the Controller and the database, and the Model almost acts like a database abstraction layer. The concept of 'Fat Model Skinny Controller' is lost as the Controller starts doing more and more logic. In DDD, there is also the concept of a Domain Entity, which has a unique identity to it. As I understand it, a user is a good example of an Entity (unique userid, for instance). The Entity has a life-cycle -- it's values can change throughout the course of the action -- and then it's saved or discarded. The Entity I describe above is what I thought Model was supposed to be in MVC? How off-base am I? To clutter things more, you throw in other patterns, such as the Repository pattern (maybe putting a Service in there). It's pretty clear how the Repository would interact with an Entity -- how does it with a Model? Controllers can have multiple Models, which makes it seem like a Model is less a "database table" than it is a unique Entity. So, in very rough terms, which is better? No "Model" really ... class MyController { public function index() { $repo = new PostRepository(); $posts = $repo->findAllByDateRange('within 30 days'); foreach($posts as $post) { echo $post->Author; } } } Or this, which has a Model as the DAO? class MyController { public function index() { $model = new PostModel(); // maybe this returns a PostRepository? $posts = $model->findAllByDateRange('within 30 days'); while($posts->getNext()) { echo $posts->Post->Author; } } } Both those examples didn't even do what I was describing above. I'm clearly lost. Any input?

    Read the article

  • EDIT Control Showing Squares Instead Of Returns

    - by Nathan Campos
    I'm playing a little bit with PocketC by doing a simple text editor. But with this code to read and to display the contents of the file on the EDIT control: int filehandle; int file_len; string file_mode; initComponents() { createctrl("EDIT", "test", 2, 1, 0, 24, 70, 25, TEXTBOX); wndshow(TEXTBOX, SW_SHOW); guigetfocus(); } main() { filehandle = fileopen(OpenFileDlg("Plain Text Files (*.txt)|*.txt; All Files (*.*)|*.*"), 0, FILE_READWRITE); file_len = filegetlen(filehandle); if(filehandle == -1) { MessageBox("File Could Not Be Found!", "Error", 3, 1); } initComponents(); editset(TEXTBOX, fileread(filehandle, file_len)); } It's all ok, but my test file, now have returns: Hello, World! PocketC Test Of My Editor Then when I open this file on the editor, instead of returns, I just see two squares(that means that it's a unknown character for that control), but if I change the control to a STATIC, it does he returns ok, but I can't edit the text if I use a STATIC. Then I want to know what I need to do to do the returns instead of showing those squares.

    Read the article

  • Precompile Lambda Expression Tree conversions as constants?

    - by Nathan
    It is fairly common to take an Expression tree, and convert it to some other form, such as a string representation (for example this question and this question, and I suspect Linq2Sql does something similar). In many cases, perhaps even most cases, the Expression tree conversion will always be the same, i.e. if I have a function public string GenerateSomeSql(Expression<Func<TResult, TProperty>> expression) then any call with the same argument will always return the same result for example: GenerateSomeSql(x => x.Age) //suppose this will always return "select Age from Person" GenerateSomeSql(x => x.Ssn) //suppose this will always return "select Ssn from Person" So, in essence, the function call with a particular argument is really just a constant, except time is wasted at runtime re-computing it continuously. Assuming, for the sake of argument, that the conversion was sufficiently complex to cause a noticeable performance hit, is there any way to pre-compile the function call into an actual constant?

    Read the article

  • How can I test caching and cache busting?

    - by Nathan Long
    In PHP, I'm trying to steal a page from the Rails playbook (see 'Using Asset Timestamps' here): By default, Rails appends assets' timestamps to all asset paths. This allows you to set a cache-expiration date for the asset far into the future, but still be able to instantly invalidate it by simply updating the file (and hence updating the timestamp, which then updates the URL as the timestamp is part of that, which in turn busts the cache). It‘s the responsibility of the web server you use to set the far-future expiration date on cache assets that you need to take advantage of this feature. Here‘s an example for Apache: # Asset Expiration ExpiresActive On <FilesMatch "\.(ico|gif|jpe?g|png|js|css)$"> ExpiresDefault "access plus 1 year" </FilesMatch> If you look at a the source for a Rails page, you'll see what they mean: the path to a stylesheet might be "/stylesheets/scaffold.css?1268228124", where the numbers at the end are the timestamp when the file was last updated. So it should work like this: The browser says 'give me this page' The server says 'here, and by the way, this stylesheet called scaffold.css?1268228124 can be cached for a year - it's not gonna change.' On reloads, the browser says 'I'm not asking for that css file, because my local copy is still good.' A month later, you edit and save the file, which changes the timestamp, which means that the file is no longer called scaffold.css?1268228124 because the numbers change. When the browser sees that, it says 'I've never seen that file! Give me a copy, please.' The cache is 'busted.' I think that's brilliant. So I wrote a function that spits out stylesheet and javascript tags with timestamps appended to the file names, and I configured Apache with the statement above. Now: how do I tell if the caching and cache busting are working? I'm checking my pages with two plugins for Firebug: Yslow and Google Page Speed. Both seem to say that my files are caching: "Add expires headers" in Yslow and "leverage browser caching" in Page Speed are both checked. But when I look at the Page Speed Activity, I see a lot of requests and waiting and no 'cache hits'. If I change my stylesheet and reload, I do see the change immediately. But I don't know if that's because the browser never cached in the first place or because the cache is busted. How can I tell?

    Read the article

  • Can I redirect/alias one web service call to another?

    - by Nathan Pitman
    I've written a simple PHP nusoap web service for an application and wish to change the name of one of the actions so that it makes more sense. However there is a CD-ROM based application in the wild using this web service and this action and so I need to redirect or alias any incoming requests to the new action... any idea how I might go about doing this?

    Read the article

  • Getting Error When Opening Files

    - by Nathan Campos
    I'm developing a simple Text Editor to understand better PocketC language, then I've done this: #include "\\Storage Card\\My Documents\\PocketC\\Parrot\\defines.pc" int filehandle; int file_len; string file_mode; initComponents() { createctrl("EDIT", "test", 2, 1, 0, 24, 70, 25, TEXTBOX); wndshow(TEXTBOX, SW_SHOW); guigetfocus(); } main() { filehandle = fileopen(OpenFileDlg("Plain Text Files (*.txt)|*.txt; All Files (*.*)|*.*"), 0, FILE_READWRITE); file_len = filegetlen(filehandle); if(filehandle = -1) { MessageBox("File Could Not Be Found!", "Error", 3, 1); } initComponents(); editset(TEXTBOX, fileread(filehandle, file_len)); } Then I tried to run the application, it opens the Open File Dialog, I select a file(that is at \test.txt) that I've created with notepad, then I got my MessageBox saying that the file wans't found. Then I want to know why I'm getting this if the file is all correct? *PS: When I click to exit the MessageBox, I saw that the TextBox is displaying where the file is(I've tested with many other files, and with all I got the error and this).

    Read the article

  • Execute a Application On The Server Using PHP

    - by Nathan Campos
    I have an application on my server that is called leaf.exe, that haves two arguments needed to run, they are: inputfile and outputfile, that will be like this example: pnote.exe input.pnt output.txt The executable is at exec/, inputfile is at upload/ and outputfile is on compiled/. But I need that a PHP could run the application like that, then I want to know: How could I do this? How could I echo the output of the program?

    Read the article

  • Why did you pick your current job?

    - by Nathan Feger
    Why are you working where you are right now? Specifically, how did you go from offer to acceptance? I have found that it is pretty difficult to figure out how to analyze a new company and I'm looking for some advice. My current choice was heavily influenced by a former mentor of mine. Yet, I'll probably need to be my own man soon enough... So, what did it for you?

    Read the article

  • Changing save directory

    - by Nathan
    Disregard my previous pre-edit post. Rethought what I needed to do. This is what I'm currently doing: https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIScriptableIO downloadFile: function(httpLoc) { try { //new obj_URI object var obj_URI = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService). newURI(httpLoc, null, null); //new file object //set file with path obj_TargetFile.initWithPath("C:\\javascript\\cache\\test.pdf"); //if file doesn't exist, create if(!obj_TargetFile.exists()) { obj_TargetFile.create(0x00,0644); } //new persitence object var obj_Persist = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]. createInstance(Ci.nsIWebBrowserPersist); // with persist flags if desired const nsIWBP = Ci.nsIWebBrowserPersist; const flags = nsIWBP.PERSIST_FLAGS_REPLACE_EXISTING_FILES; obj_Persist.persistFlags = flags | nsIWBP.PERSIST_FLAGS_FROM_CACHE; //save file to target obj_Persist.saveURI(obj_URI,null,null,null,null,obj_TargetFile); return true; } catch (e) { alert(e); } },//end downloadFile As you can see the directory is hardcoded in there, I want to save the pdf file open in the active tab to a relative temporary directory, or anywhere that's out of the way enough that the user won't stumble along and delete it. I'm going to try that using File I/O, I was under the impression that what I was looking for was in scriptable file I/O and thus disabled.

    Read the article

  • What is the fastest collection in c# to implement a prioritizing queue?

    - by Nathan Smith
    I need to implement a queue for messages on a game server so it needs to as fast as possible. The queue will have a maxiumem size. I need to prioritize messages once the queue is full by working backwards and removing a lower priority message (if one exists) before adding the new message. The appliation is asynchronous so access to the queue needs to be locked. I'm currently implementing it using a LinkedList as the underlying storage but have concerns that searching and removing nodes will keep it locked for too long. Heres the basic code I have at the moment: public class ActionQueue { private LinkedList<ClientAction> _actions = new LinkedList<ClientAction>(); private int _maxSize; /// <summary> /// Initializes a new instance of the ActionQueue class. /// </summary> public ActionQueue(int maxSize) { _maxSize = maxSize; } public int Count { get { return _actions.Count; } } public void Enqueue(ClientAction action) { lock (_actions) { if (Count < _maxSize) _actions.AddLast(action); else { LinkedListNode<ClientAction> node = _actions.Last; while (node != null) { if (node.Value.Priority < action.Priority) { _actions.Remove(node); _actions.AddLast(action); break; } } } } } public ClientAction Dequeue() { ClientAction action = null; lock (_actions) { action = _actions.First.Value; _actions.RemoveFirst(); } return action; } }

    Read the article

  • jQuery Accordion: IE animation issues

    - by Nathan Long
    Update I am making this a community wiki, for three reasons: I don't feel like I got a definitive answer, but I have long since stopped needing an answer, because I rolled my own accordion function this question gets tons of views, so clearly lots of people are still interested So if anybody wants to change/clarify this question and make it a definitive guide, be my guest. I'm working on a page using jQuery's accordion UI element. I modeled my HTML on that example, except that inside the <li> elements, I have some unordered lists of links. Like this: $(document).ready(function() { $(".ui-accordion-container").accordion( {active: "a.default", alwaysOpen: true, autoHeight: false} ); }); <ul class="ui-accordion-container"> <li> <!-- Start accordion section --> <a href='#' class="accordion-label">A Group of Links</a> <ul class="linklist"> <li><a href="http://example.com">Example Link</a></li> <li><a href="http://example.com">Example Link</a></li> </ul> <!--and of course there's another group --> Problem: IE Animation stinks Although IE7 animates the documentation's example accordion menu just fine, it has problems with mine. Specifically, one accordion menu on the page moves jerkily and has flashes of content. I know that it's not a CSS issue because the same thing happens if I don't include my CSS files. The other accordion menu on the page opens the first section you click and, after that, won't open any of them. Both of these problems are IE-specific, and both go away if I use the option animated: false. But I'd like to keep the default slide animation, since it helps the user understand what the menu is doing. Is there another way?

    Read the article

  • .Net Regular expression - how to do an exact match exclusion on a full string?

    - by Nathan Ridley
    I need a .Net regular expression that matches anything OTHER than the exact full string match specified. So basically: ^Index$ ... is the only exclusion I care about. Strings can start with, finish with or contain "Index", but not match exactly. My brain doesn't seem to be working today and I'm failing to work this one out. EDIT The answer MUST be via the pattern itself, as I am passing an argument to a third party library and do not have control over the process other than via the Regex pattern.

    Read the article

  • Did I find a bug in PHP's `crypt()`?

    - by Nathan Long
    I think I may have found a bug in PHP's crypt() function under Windows. However: I recognize that it's probably my fault. PHP is used by millions and worked on by thousands; my code is used by tens and worked on by me. (This argument is best explained on Coding Horror.) So I'm asking for help: show me my fault. I've been trying to find it for a few days now, with no luck. The setup I'm using a Windows server installation with Apache 2.2.14 (Win32) and PHP 5.3.2. My development box runs Windows XP Professional; the 'production' server (this is an intranet setup) runs Windows Storage Server 2003. The problem happens on both. I don't see anything in php.ini related to crypt(), but will happily answer questions about my config. The problem Several scripts in my PHP app occasionally hang: the page sits there on 'waiting for localhost' and never finishes. Each of these scripts uses crypt to hash a user's password before storing it in the database, or, in the case of the login page, to hash the entered password before comparing it to the version stored in the database. Since the login page is the simplest, I focused on it for testing. I repeatedly logged in, and found that it would hang maybe 4 out of 10 times. As an experiment, I changed the login page to use the plain text password and changed my password in the database to its plain text version. The page stopped hanging. I saw that PHP's latest version lists this bugfix: Fixed bug #51059 (crypt crashes when invalid salt are [sic] given). So I created a very simple test script, as follows, using the same salt given in an official example: $foo = crypt('rasmuslerdorf','r1'); echo $foo; This page, too, will hang, if I reload it like crazy. I only see it hanging in Chrome, but regardless of browser, the effect on Apache is the same. Effect on Apache When these pages hang, Apache's server-status page (which I explained here, regarding a different problem) increments the number of requests being processed and decrements the number of idle workers. The requests being processed almost all have a status of 'Sending Reply,' though sometimes for a moment they will show either 'Reading request' or 'keepalive (read).' Eventually, Apache may crash. When it does, the Windows crash report looks like this: szAppName: httpd.exe szAppVer: 2.2.14.0 szModName: php5ts.dll szModVer: 5.3.1.0 // OK, this report was before I upgraded to PHP 5.3.2, // but that didn't fix it offset: 00a2615 Is it my fault? I'm tempted to file a bug report to PHP on this. The argument against it is, as stated above, that bugs are nearly always my fault. However, my argument in favor of 'it's PHP's fault' is: I'm using Windows, whereas most servers use Linux (I don't get to choose this), so the chances are greater that I've found an edge case There was recently a bug with crypt(), so maybe it still has issues I have made the simplest test case I can, and I still have the problem Can anyone duplicate this? Can you suggest where I've gone wrong? Should I file the bug after all? Thanks in advance for any help you may give.

    Read the article

  • Global variable life in Javascript - destroyed on a reload?

    - by Paul Nathan
    (I am learning Javascript) Problem: A page I am working on has 2 views, a data entry view with a textbox and a data rendering view. There is a a href src="currentpage#" link that switches between the 2 views. In order to transmit data from view to view, the javascript parses it from the current HTML and pushes it into the correct form for the other view. This is ugly and I want to refactor it out, ideally into some sort of global where it can be neatly rendered down into the view on command (I'm refactoring the code base to a point where I can AJAX it from a server). However, I am not certain about scoping rules and variable life in JS.

    Read the article

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