Search Results

Search found 21001 results on 841 pages for 'spelling check'.

Page 86/841 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • How to check which files I fopen'ed on Windows?

    - by Igor Oks
    I received a "Too many open files" error when tried to do fopen (C++, Windows XP). Probably it happened because somewhere in my program I open files without closing them. Is there a way on Windows to see a list of all open file descriptors (or all files that my program fopened)?

    Read the article

  • Way to check files in and out with multiple developers.

    - by Roeland
    I am a web developer working with 2-3 people including me. Our current setup is very simplistic. We try to let each other know when we are working on a specific file. We use FTP to edit our files. Recently we have run into the problem of 2 people accidentally editing one file, or working on a local file then uploading when another person just did the same. From what I have read I need some sort of control system. I have heard of subversion and mercurial. It seems that these systems may not be what I need though, since its just giving me different versions of the files. I don't know if it solves the issue of two people working on a file and overwriting each others work. What are your suggestions for solving my problem?

    Read the article

  • What is the Fastest Way to Check for a Keyword in a List of Keywords in Delphi?

    - by lkessler
    I have a small list of keywords. What I'd really like to do is akin to: case MyKeyword of 'CHIL': (code for CHIL); 'HUSB': (code for HUSB); 'WIFE': (code for WIFE); 'SEX': (code for SEX); else (code for everything else); end; Unfortunately the CASE statement can't be used like that for strings. I could use the straight IF THEN ELSE IF construct, e.g.: if MyKeyword = 'CHIL' then (code for CHIL) else if MyKeyword = 'HUSB' then (code for HUSB) else if MyKeyword = 'WIFE' then (code for WIFE) else if MyKeyword = 'SEX' then (code for SEX) else (code for everything else); but I've heard this is relatively inefficient. What I had been doing instead is: P := pos(' ' + MyKeyword + ' ', ' CHIL HUSB WIFE SEX '); case P of 1: (code for CHIL); 6: (code for HUSB); 11: (code for WIFE); 17: (code for SEX); else (code for everything else); end; This, of course is not the best programming style, but it works fine for me and up to now didn't make a difference. So what is the best way to rewrite this in Delphi so that it is both simple, understandable but also fast? (For reference, I am using Delphi 2009 with Unicode strings.) Followup: Toby recommended I simply use the If Then Else construct. Looking back at my examples that used a CASE statement, I can see how that is a viable answer. Unfortunately, my inclusion of the CASE inadvertently hid my real question. I actually don't care which keyword it is. That is just a bonus if the particular method can identify it like the POS method can. What I need is to know whether or not the keyword is in the set of keywords. So really I want to know if there is anything better than: if pos(' ' + MyKeyword + ' ', ' CHIL HUSB WIFE SEX ') > 0 then The If Then Else equivalent does not seem better in this case being: if (MyKeyword = 'CHIL') or (MyKeyword = 'HUSB') or (MyKeyword = 'WIFE') or (MyKeyword = 'SEX') then In Barry's comment to Kornel's question, he mentions the TDictionary Generic. I've not yet picked up on the new Generic collections and it looks like I should delve into them. My question here would be whether they are built for efficiency and how would using TDictionary compare in looks and in speed to the above two lines? In later profiling, I have found that the concatenation of strings as in: (' ' + MyKeyword + ' ') is VERY expensive time-wise and should be avoided whenever possible. Almost any other solution is better than doing this.

    Read the article

  • Is it possible to make WebLogic check REDEPLOY file more often?

    - by doublep
    [sorry for apparent shouting in the title, it's just that the file is named in all uppercase] Given advice in http://stackoverflow.com/questions/2695124 I successfully implemented and have been using autodeployment in WebLogic. This works great, but a tad too slow to my tastes, it seems like about 10 seconds pass between touching REDEPLOY file and WebLogic's start of redeployment. Is there any way I can instruct WebLogic to test timestamp on that file more often?

    Read the article

  • How to make a big switch control structure with variable check values?

    - by mystify
    For example, I have a huge switch control structure with a few hundred checks. They're an animation sequence, which is numbered from 0 to n. Someone said I can't use variables with switch. What I need is something like: NSInteger step = 0; NSInteger i = 0; switch (step) { case i++: // do stuff break; case i++: // do stuff break; case i++: // do stuff break; case i++: // do stuff break; } The point of this is, that the animation system calls a method with this big switch structure, giving it a step number. I want to be able to simply cut-copy-paste large blocks and put them in a different position inside the switch. for example, the first 50 blocks to the end. I could do that easily with a huge if-else structure, but it would look ugly and something tells me switch is much faster. How to?

    Read the article

  • Web app that contains a check-list based task management UI?

    - by meder
    I'm looking to develop my own task application so I'm trying to study the UI of any possible in-browser apps that have some sort of functionality which has an ordered list where items can be tagged as "done" and they either get color-highlighted or move into a "DONE" column. By the way, the area would be a tinyMCE or similar editable area and not some primitive html rendering. Example:

    Read the article

  • Is there a way in PHP to check if a directory is a symlink?

    - by tixrus
    The title says it all. I have symlinks to certain directories because the directories' names have non English characters that I got fed up trying to get apache's rewrite rules to match. There's a bounty on that question http://stackoverflow.com/questions/2916194/trouble-with-utf-8-chars-apache2-rewrite-rulesif anyone wants to go for it, and from the looks of things a lot of people would like to see a general solution to this problem, but meanwhile I made a plain ascii symlink to each of these offending directories. Now the rewrite rules are back to just alpha and _ and - and my security concerns are less and it loads the resources I want. But I still need the actual target directory name for display purposes. I googled "PHP directory info, PHP symlink" but didn't find anything. I need to do something like this: if (is_symlink($myResDirName)) { $realDirName = follow_symlink($myResDirName); }

    Read the article

  • How to check if a Statistics is auto-created in a SQL Server 2000 DB using T-SQL?

    - by The Shaper
    Hi all. A while back I had to come up with a way to clean up all indexes and user-created statistics from some tables in a SQL Server 2005 database. After a few attempts it worked, but now I gotta have it working in SQL Server 2000 databases as well. For SQL Server 2005, I used SELECT Name FROM sys.stats WHERE object_id = object_id(@tableName) AND auto_created = 0 to fetch Statistics that were user-created. However, SQL 2000 doesn't have a sys.stats table. I managed to fetch the indexes and statistics in a distinguishable way from the sysindexes table, but I just couldn't figure out what the sys.stats.auto_created match is for SQL 2000. Any pointers? BTW: T-SQL please.

    Read the article

  • Why this Either-monad code does not type check?

    - by pf_miles
    instance Monad (Either a) where return = Left fail = Right Left x >>= f = f x Right x >>= _ = Right x this code frag in 'baby.hs' caused the horrible compilation error: Prelude> :l baby [1 of 1] Compiling Main ( baby.hs, interpreted ) baby.hs:2:18: Couldn't match expected type `a1' against inferred type `a' `a1' is a rigid type variable bound by the type signature for `return' at <no location info> `a' is a rigid type variable bound by the instance declaration at baby.hs:1:23 In the expression: Left In the definition of `return': return = Left In the instance declaration for `Monad (Either a)' baby.hs:3:16: Couldn't match expected type `[Char]' against inferred type `a1' `a1' is a rigid type variable bound by the type signature for `fail' at <no location info> Expected type: String Inferred type: a1 In the expression: Right In the definition of `fail': fail = Right baby.hs:4:26: Couldn't match expected type `a1' against inferred type `a' `a1' is a rigid type variable bound by the type signature for `>>=' at <no location info> `a' is a rigid type variable bound by the instance declaration at baby.hs:1:23 In the first argument of `f', namely `x' In the expression: f x In the definition of `>>=': Left x >>= f = f x baby.hs:5:31: Couldn't match expected type `b' against inferred type `a' `b' is a rigid type variable bound by the type signature for `>>=' at <no location info> `a' is a rigid type variable bound by the instance declaration at baby.hs:1:23 In the first argument of `Right', namely `x' In the expression: Right x In the definition of `>>=': Right x >>= _ = Right x Failed, modules loaded: none. why this happen? and how could I make this code compile ? thanks for any help~

    Read the article

  • How can I check the version of an assembly then delete the assembly?

    - by Nescio
    I am using the FileVersionInfo to retrieve the version of a .Net assembly. Then, I want to immediately delete the file. Unfortunately after I call GetVersionInfo, any attempt to delete the file results in an error “…in use by another process…” Is there another technique to determine the version that does not lock the file? Or, is it possible to ensure the lock is released after calling GetVersionInfo? The below example is heavily simplified, but scope matches my real code. void Main() { var fvi = GetVersion("myPath"); if (fvi.ToString() == "2.0.0.7") DeleteFile("myPath"); } FileVersionInfo GetVersion(string path) { return FileVersionInfo.GetVersionInfo(path); } void DeleteFile(string path) { File.Delete(path); }

    Read the article

  • How to check if a variable exists in a FreeMarker template?

    - by Don
    Hi, I have a Freemarker template which contains a bunch of placeholders for which values are supplied when the template is processed. I want to conditionally include part of the template if the userName variable is supplied, something like: [#if_exists userName] Hi ${userName}, How are you? [/#if_exists] However, the FreeMarker manual seems to indicate that if_exists is deprecated, but I can't find another way to achieve this. Of course, I could simple providing an additional boolean variable isUserName and use that like this: [#if isUserName] Hi ${userName}, How are you? [/#if] But if there's a way of checking whether userName exists then I can avoid adding this extra variable. Cheers, Don

    Read the article

  • Check which nodes of Beowulf HPC cluster system are free from PHP app?

    - by Skuja
    I am working on my diploma thesis project. I have access to 32Node Dell poweredge HPC cluster system with Linux(Debian i think) installed on it. My first goal is to create web (PHP) app where logged users could see free and busy nodes, turn them on and off. I am planning to do something like this - write some cron daemon that would run every 30seconds or other interval, and it could run ping utility for each node to find out if it is on or off, then write results to some file. Then from my web app i could read the info. Will it be a good solution? What existing for node management solutions are there?

    Read the article

  • python and paramiko: how to check if end of ssh tunnel is still alive and reestablish if not?

    - by Christian
    Hello all, I'm trying to achieve the following: I have two hosts A and B. A establishes a remote port forwarding tunnel on B, i.e. B is the one a port is forwarded on to some where else and A is the one that sets up the tunnel. I tried the script rforward.py that ships with paramiko and it works very well so far. (I'm running rforward.py on A, which connects to B and forwards a port of B to somewhere else) However, when B is shutting down, A doesn't seem to recognize it. I'd rather like A to recognize that B is down and to try to reestablish the connection periodically in case B comes up again. Is there a way to do this? Thanks.

    Read the article

  • How can I check that the NSPasteboard is updated?

    - by Ben Packard
    I'm automating a copy command to place some text on the pasteboard every second or so - unfortunately this is my only way of accessing the text, which is in another application. After copying, I access the pasteboard text and process it. Sometimes, the copy command will be sent when nothing is selected - for example in textEdit, if the cursor is at the end of a line (instead of highlighting some text) and you hit copy, you get a system beep because there is nothing selected to copy. The pasteboard does not update and retains its previous data. I can't think of a creative way to identify when this happens. If I send a copy command and the pasteboard doesn't update, is there any kind of time stamp on the pasteboard I can access that will confirm that something has or hasn't been captured? I was looking at the changeCount, but I'm not sure what that is for exactly, and the documentation didn't help me much - red herring? Any simple and effective ideas gratefully received!

    Read the article

  • How to check if a integer is sum of given integers?

    - by p3trix
    Lets say I have a integer result and an array of integers, lets say [a,b,c] (not a fixed length). I need to detect if result=a*i +b*j + c*k, with i,j,k=0. I prefer a solution in C/C# if it is possible. PS The problem is from a reservation system, a trip can be sold if its durations is a combination of given durations. Thanks!

    Read the article

  • Rspec Selenium. Test to check certain Ajax functions passes when i expect it to fail.

    - by alokswain
    I am testing a Ajax action using Rspec and Selenium. My story is as follows: it "should create a new User with any input" do @browser.open "/people" @browser.wait_for_page_to_load "2000" @browser.type "user_name", "Alok Swain" @browser.click "user_submit" @browser.text?("Alok Swain").should be_true end The action i am testing is: def add_user @users = User.all User.create(params[:user]) render :update do |page| page.alert "Created User" page.replace_html "users", :partial => '/people/users_list', :locals => {:users => @users} end end The test fails and the error I get is: 'User should create a new User with any input' FAILED expected false to be true. This test should pass right ? I also kept an alert and tried @browser.is_alert_present.should be_true but i got the same error. I tried @browser.is_text_present("test") and this test succeeded. In the test database a record was created for Alok Swain but when I tried the above assertion it passed when i expected it to fail. Is there any thing else to be done here. What am I missing ?

    Read the article

  • Completion block not being called. How to check validity?

    - by HCHogan
    I have this method which takes a block, but that block isn't always called. See the method: - (void)updateWithCompletion:(void (^)(void))completion { [MYObject myMethodWithCompletion:^(NSArray *array, NSError *error) { if (error) { NSLog(@"%s, ERROR not nil", __FUNCTION__); completion(); return; } NSLog(@"%s, calling completion %d", __FUNCTION__, &completion); completion(); NSLog(@"%s, finished completion", __FUNCTION__); }]; } I have some more NSLogs inside completion. Sometimes this program counter just blows right past the call to completion() in the code above. I don't see why this would be as the calling code always passes a literal block of code as input. If you're curious of the output of the line containing the addressof operator, it's always something different, but never 0 or nil. What would cause completion not to be executed?

    Read the article

  • Why check if your popoverController is nil? Doesn't Obj-C ignore messages to nil?

    - by Rob Fonseca-Ensor
    Pretty much everyone that writes about the UISplitView on the iPad uses the following code structure to dismiss a popover: if (popoverController != nil) { [popoverController dismissPopoverAnimated:YES]; } I though Objective-C was happy to ignore messages that are passed to nil? In fact, in the File New Project New Split View Application template, there's an example of this shortcut in the same code block (DetailsViewController.m): - (void)setDetailItem:(id)newDetailItem { if (detailItem != newDetailItem) { [detailItem release]; //might be nil detailItem = [newDetailItem retain]; // Update the view. [self configureView]; } if (popoverController != nil) { [popoverController dismissPopoverAnimated:YES]; //was checked for nil } } Why is that second if necessary?

    Read the article

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