qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
406,667
<p>I'm teaching myself Objective-C from a book (<em>Cocoa programming for mac OS X</em>) and am about halfway through however I have two questions that aren't answered or defined in the book.</p> <ol> <li><p>When defining class methods what is the difference between (assuming there in a .h file):</p> <p>- (int) popul...
[ { "answer_id": 406698, "author": "Jason Coco", "author_id": 34218, "author_profile": "https://Stackoverflow.com/users/34218", "pm_score": 5, "selected": true, "text": "@interface MyObject : NSObject\n-(void)myInstanceMethod;\n+(void)myClassMethod;\n@end\n\n// ...\n\nMyObject* obj = [[MyO...
2009/01/02
[ "https://Stackoverflow.com/questions/406667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/313002/" ]
406,682
<p>I'm having a little problem with the following:</p> <p>When I execute this line:</p> <pre><code>echo exec(createDir($somevariable)); </code></pre> <p>I get this error:</p> <pre><code>Warning: exec() [function.exec]: Cannot execute a blank command in /home/mydir/myfile.inc.php on line 32 </code></pre> <p>Any ide...
[ { "answer_id": 406688, "author": "Max", "author_id": 50023, "author_profile": "https://Stackoverflow.com/users/50023", "pm_score": -1, "selected": false, "text": "exec(\"mkdir $somevariable\");" }, { "answer_id": 406691, "author": "okoman", "author_id": 35903, "author...
2009/01/02
[ "https://Stackoverflow.com/questions/406682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071/" ]
406,695
<p>I want to (quickly) put a program/script together to read the fileset from a .torrent file. I want to then use that set to delete any files from a specific directory that do not belong to the torrent.</p> <p>Any recommendations on a handy library for reading this index from the .torrent file? Whilst I don't object ...
[ { "answer_id": 406809, "author": "Benedikt Waldvogel", "author_id": 4308, "author_profile": "https://Stackoverflow.com/users/4308", "pm_score": 5, "selected": false, "text": "import libtorrent\ninfo = libtorrent.torrent_info('test.torrent')\nfor f in info.files():\n print \"%s - %s\" ...
2009/01/02
[ "https://Stackoverflow.com/questions/406695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1820/" ]
406,731
<p>I've been trying to push my mentallity when developing at home to be geared more towards TDD and a bit DDD. </p> <p>One thing I don't understand though is why you would create a fake repository to test against? I haven't really looked into it much but surely the idea of testing is to help decouple your code (giving...
[ { "answer_id": 406910, "author": "joel.neely", "author_id": 3525, "author_profile": "https://Stackoverflow.com/users/3525", "pm_score": 2, "selected": false, "text": "HashMap" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/406731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26081/" ]
406,760
<p>This is definitely subjective, but I'd like to try to avoid it becoming argumentative. I think it could be an interesting question if people treat it appropriately.</p> <p>The idea for this question came from the comment thread from <a href="https://stackoverflow.com/questions/282329/what-are-five-things-you-hate-a...
[ { "answer_id": 406807, "author": "Pablo Fernandez", "author_id": 7595, "author_profile": "https://Stackoverflow.com/users/7595", "pm_score": 9, "selected": false, "text": "private fields + public accessors == encapsulation" }, { "answer_id": 406930, "author": "fizzer", "a...
2009/01/02
[ "https://Stackoverflow.com/questions/406760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22656/" ]
406,776
<p><em>Removed link, problem solved</em></p> <p>The menu at the top is supposed to be a dropdown menu, but it expands to the right instead. </p> <p>My CSS is this (I believe this is the relevant bit anyway)</p> <pre><code>#primary-nav, #primary-nav ul { list-style: none; margin: 0px; padding: 0px; } #primary-nav ul...
[ { "answer_id": 406784, "author": "stuartloxton", "author_id": 313002, "author_profile": "https://Stackoverflow.com/users/313002", "pm_score": 2, "selected": false, "text": "position: absolute;" }, { "answer_id": 408663, "author": "Community", "author_id": -1, "author_...
2009/01/02
[ "https://Stackoverflow.com/questions/406776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42389/" ]
406,791
<p>I'm having a problem with the following code snippet:</p> <pre><code>using System; using System.Collections.Generic; using System.Text; namespace trees_by_firas { class Program { static void Main(string[] args) { BinarySearchTree t = new BinarySearchTree(); t.insert...
[ { "answer_id": 406796, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": false, "text": "root." }, { "answer_id": 409120, "author": "SteinNorheim", "author_id": 19220, "author_profile": "ht...
2009/01/02
[ "https://Stackoverflow.com/questions/406791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
406,810
<p>I have a html page A and a link in the page which opens up page B in a new window. How to reload the page A on clicking and opening this link ? </p> <p><strong>EDIT:</strong></p> <p>I should have been more clear. Page B opens in a new window and not as a popup. The hyperlink in question has its target attribute se...
[ { "answer_id": 406817, "author": "Mark Davidson", "author_id": 50866, "author_profile": "https://Stackoverflow.com/users/50866", "pm_score": 1, "selected": false, "text": "<a href=\"# \" onClick=\"window.open('newPage.htm','window','width=400,height=200')\">link</a>\n" }, { "answ...
2009/01/02
[ "https://Stackoverflow.com/questions/406810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27474/" ]
406,813
<p>I have a contactbook, and a form close to it... For the form, one of the requirements is to fill in the receiver for the message. So when the user clicks on a contact from the contactbook, automaticly the username from the titel-tag should appear in the receiver inpunt in the form.</p> <p>All help with this is appr...
[ { "answer_id": 406839, "author": "stuartloxton", "author_id": 313002, "author_profile": "https://Stackoverflow.com/users/313002", "pm_score": 1, "selected": false, "text": "<title>" }, { "answer_id": 406900, "author": "stuartloxton", "author_id": 313002, "author_profi...
2009/01/02
[ "https://Stackoverflow.com/questions/406813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50896/" ]
406,830
<p>Is there a way in Java to declare an enumeration whose values can be used together? For example:</p> <pre><code>enum FileAccess { Read, Write, ReadWrite } </code></pre> <p>Is it possible to define ReadWrite as <code>Read | Write</code> (or anything that would yield the same result)?</p>
[ { "answer_id": 406841, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 6, "selected": true, "text": "EnumSet<FileAccess> readWrite = EnumSet.of(FileAccess.Read, FileAccess.Write);\n" }, { "answer_id": 406845, "...
2009/01/02
[ "https://Stackoverflow.com/questions/406830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41283/" ]
406,866
<p>I'm calling a SSIS package using LoadPackage(...).</p> <p>Is it possible to make this call an Asynchronous call?</p>
[ { "answer_id": 406974, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 0, "selected": false, "text": "using System.Threading.Tasks;\n...\nvar future = Future.Create(()=>LoadPackage); // Starts loading the package\n// Do oth...
2009/01/02
[ "https://Stackoverflow.com/questions/406866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
406,880
<p>I've used the following code to map <a href="https://live.example.com" rel="nofollow noreferrer">https://live.example.com</a> on to <a href="http://example.com/api" rel="nofollow noreferrer">http://example.com/api</a></p> <pre><code>Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTPS} =on RewriteCond %{...
[ { "answer_id": 406983, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "RewriteMap escapemap int:escape \n" }, { "answer_id": 15284873, "author": "aaandre", "author_id": 1236013, ...
2009/01/02
[ "https://Stackoverflow.com/questions/406880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
406,903
<p>I need a template like this, which work perfectly</p> <pre><code>template &lt;typename container&gt; void mySuperTempalte (const container myCont) { //do something here } </code></pre> <p>then i want to specialize the above template for std::string so i came up with</p> <pre><code>template &lt;typename contai...
[ { "answer_id": 406935, "author": "sep", "author_id": 30333, "author_profile": "https://Stackoverflow.com/users/30333", "pm_score": 3, "selected": false, "text": "template<> void mySuperTempalte<std:string>(const std::string myCont)\n{\n //check type of container\n //do something he...
2009/01/02
[ "https://Stackoverflow.com/questions/406903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28954/" ]
406,912
<p>I have 2 textbox in my asp.net page and also have one hiddenfield in my asp.net page , my hiddenfield will always have numeric value like 123.00 , and in my one textbox also I will always have numeric value like 20.00 now I want to add this hiddenfield value and textbox value and display it into second textbox thru...
[ { "answer_id": 406920, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 2, "selected": false, "text": "parseFloat(foo)" }, { "answer_id": 406922, "author": "epascarello", "author_id": 14104, "author_profi...
2009/01/02
[ "https://Stackoverflow.com/questions/406912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14299/" ]
406,915
<p>Andreas Huber's answer to <a href="https://stackoverflow.com/questions/405600/detecting-that-a-threadpool-workitem-has-completed-waiting-for-completion">this question</a> gave me an idea to implement <code>Concurrent&lt;T&gt;</code> with async delegates instead of the ThreadPool. However, I am finding it harder to u...
[ { "answer_id": 406920, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 2, "selected": false, "text": "parseFloat(foo)" }, { "answer_id": 406922, "author": "epascarello", "author_id": 14104, "author_profi...
2009/01/02
[ "https://Stackoverflow.com/questions/406915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9204/" ]
406,927
<p>How can I detect if an application is not used for more than x minutes in DELPHI</p>
[ { "answer_id": 407070, "author": "Charles Faiga", "author_id": 17560, "author_profile": "https://Stackoverflow.com/users/17560", "pm_score": 2, "selected": false, "text": "procedure TUserActivity.AppMessage(var Msg: TMsg; var Handled: Boolean);\nbegin\n Handled := False;\n case Msg.mes...
2009/01/02
[ "https://Stackoverflow.com/questions/406927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48705/" ]
406,939
<p>I'm having difficulty getting widgets in a QDialog resized automatically when the dialog itself is resized.</p> <p>In the following program, the textarea resizes automatically if you resize the main window. However, the textarea within the dialog stays the same size when the dialog is resized.</p> <p>Is there any...
[ { "answer_id": 407309, "author": "Luke Woodward", "author_id": 48503, "author_profile": "https://Stackoverflow.com/users/48503", "pm_score": 2, "selected": false, "text": "dialog.setLayout(some_layout)\n" }, { "answer_id": 13209797, "author": "sdaau", "author_id": 277826,...
2009/01/02
[ "https://Stackoverflow.com/questions/406939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48503/" ]
406,954
<p>Is there a database term for "table or view"?<br> In my app, the table name I'm pulling data from is configurable using the configuration setting <code>UserTableName</code> Now the DBA went and renamed the table but created a view using the original name.<br> So nothing changed on my side but now I feel that <code>U...
[ { "answer_id": 406961, "author": "M4N", "author_id": 19635, "author_profile": "https://Stackoverflow.com/users/19635", "pm_score": 0, "selected": false, "text": "UserDataSource" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/406954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1287/" ]
406,955
<p>I've got an app which is using a WCF service. Now I'd like to add unit tests to the app.</p> <p>For some cases I need to mock the WCF service, since getting the desired behaviour from the service sometimes is tough (e.g. service throws special exceptions).</p> <p>I could add yet another interface to the wcf client...
[ { "answer_id": 407240, "author": "David Schmitt", "author_id": 4918, "author_profile": "https://Stackoverflow.com/users/4918", "pm_score": 4, "selected": true, "text": "IMyWcfService" }, { "answer_id": 50390595, "author": "Alex", "author_id": 1215913, "author_profile"...
2009/01/02
[ "https://Stackoverflow.com/questions/406955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7021/" ]
406,963
<p>I'm probably missing something simple here, but I can't find the answer elsewhere. I just want to display an applet in my GWT code. </p> <p>OS: Windows XP Java: JDK 1.6.0_10 Other: GWT, GWT-Ext 2.0.5</p> <p>Here is the applet (obviously simplified for testing):</p> <pre><code>package foo.applet; import javax.swi...
[ { "answer_id": 9639416, "author": "Josh", "author_id": 1260000, "author_profile": "https://Stackoverflow.com/users/1260000", "pm_score": 1, "selected": false, "text": "gwt" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/406963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9945/" ]
406,966
<p>I have an application which had optional extras depending on if the user has the software installed.</p> <p>On Linux what is the best way to determine if something like python and PyUsb is installed?</p> <p>I am developing a C++ Qt application if that helps.</p>
[ { "answer_id": 406992, "author": "Kris Kumler", "author_id": 4281, "author_profile": "https://Stackoverflow.com/users/4281", "pm_score": 1, "selected": false, "text": "which" }, { "answer_id": 407038, "author": "Fabio Ceconello", "author_id": 8999, "author_profile": "...
2009/01/02
[ "https://Stackoverflow.com/questions/406966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24459/" ]
406,985
<p>I want to be able to predicate pattern matches on whether they occur after word characters or after non-word characters. In other words, I want to simulate the \b word break regex char at the beginning of the pattern which flex/lex does not support.</p> <p>Here's my attempt below (which does not work as desired):</...
[ { "answer_id": 408711, "author": "user49117", "author_id": 49117, "author_profile": "https://Stackoverflow.com/users/49117", "pm_score": 1, "selected": false, "text": "%%\n[a-zA-Z]+a[a-zA-Z]* {printf(\"a in word: %s\\n\", yytext);}\na[a-zA-Z]+ {printf(\"a in word: %s\\n\", yytext);}\na {...
2009/01/02
[ "https://Stackoverflow.com/questions/406985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41613/" ]
406,987
<p>I've been using javascript to do lightweight functionality on sites for years - DOM manipulation etc - but just now im beginning to investigate using it to do a lot more of the heavy lifting (in combo with PHP). I've only just started getting into OO JS, and im still trying to get my head around the best-practices a...
[ { "answer_id": 419243, "author": "Luca Matteis", "author_id": 50394, "author_profile": "https://Stackoverflow.com/users/50394", "pm_score": 2, "selected": false, "text": "$(\"form\").serialize(true);" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/406987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
407,016
<p>I have a Java application, to start it I use</p> <blockquote> <p>java -jar myapp.jar</p> </blockquote> <p>To stop it I use CTRL+C.</p> <p>Now I need to convert that application to something that I can start with:</p> <blockquote> <p>/etc/init.d/myapp start</p> </blockquote> <p>And I can stop with:</p> <blo...
[ { "answer_id": 412175, "author": "opyate", "author_id": 51280, "author_profile": "https://Stackoverflow.com/users/51280", "pm_score": 3, "selected": false, "text": "$ ./yourprogram &\n$ echo $! > /var/run/yourpid\n" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407016", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36131/" ]
407,020
<p>I wanna do a macro program for a game. But there is a problem with sending keys to only game application (game window). I am using <code>keybd_event</code> API for sending keys to game window. But I only want to send keys to the game window, not to explorer or any opened window while my macro program is running. Whe...
[ { "answer_id": 407113, "author": "Tom Anderson", "author_id": 13502, "author_profile": "https://Stackoverflow.com/users/13502", "pm_score": 1, "selected": false, "text": "Private Const WM_KEYDOWN As Integer = &H100\nPrivate Const WM_KEYUP As Integer = &H101\n" }, { "answer_id": 4...
2009/01/02
[ "https://Stackoverflow.com/questions/407020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
407,026
<p>I am a little confused here.</p> <p>I would like to do something like this:</p> <ol> <li>create some kind of buffer I can write into</li> <li>clear the buffer</li> <li>use a printf()-like function several times to append a bunch of stuff into the buffer based on some complicated calculations I only want to do once...
[ { "answer_id": 407084, "author": "Jason S", "author_id": 44330, "author_profile": "https://Stackoverflow.com/users/44330", "pm_score": 3, "selected": true, "text": "Formatter" }, { "answer_id": 408453, "author": "Dave Ray", "author_id": 40310, "author_profile": "https...
2009/01/02
[ "https://Stackoverflow.com/questions/407026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44330/" ]
407,027
<p>We've a table with a <code>varchar2(100)</code> column, that occasionally contains carriage-return &amp; line-feeds. We should like to remove those characters in the SQL query. We're using:</p> <pre><code>REPLACE( col_name, CHR(10) ) </code></pre> <p>which has <strong>no effect</strong>, however replacing 'CHR(10...
[ { "answer_id": 407050, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 4, "selected": false, "text": "CHR(13) + CHR(10)" }, { "answer_id": 407111, "author": "Gordon Bell", "author_id": 16473, "author_pr...
2009/01/02
[ "https://Stackoverflow.com/questions/407027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42429/" ]
407,048
<p>I've heard from a variety of places that global variables are inherently nasty and evil, but when doing some non-object oriented Javascript, I can't see how to avoid them. Say I have a function which generates a number using a complex algorithm using random numbers and stuff, but I need to keep using that particular...
[ { "answer_id": 407076, "author": "Paul Stephenson", "author_id": 5536, "author_profile": "https://Stackoverflow.com/users/5536", "pm_score": 7, "selected": true, "text": "function A()\n{\n var rand_num = calculate_random_number();\n B(rand_num);\n}\n\nfunction B(r)\n{\n use_rand...
2009/01/02
[ "https://Stackoverflow.com/questions/407048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
407,069
<p>Let me state first: I know that any user that wants to run a program (or even log in), has to have access to (probably at least) the Windows system directories and the shared libraries in <code>%ProgramFiles%</code>, but I'd like to be able to access Skype, for example, by running it with an unprivileged user and ma...
[ { "answer_id": 407263, "author": "Chris Smith", "author_id": 9073, "author_profile": "https://Stackoverflow.com/users/9073", "pm_score": 3, "selected": true, "text": "C:\\Documents and Settings\\skype\\Program Files\\Skype" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50928/" ]
407,074
<p>We're looking for a way to include some sort of build ID automatically in our builds. This needs to be portable (VC++, g++ on Linux and Mac) and automatic. VC++ is what matters most, since in the other environments we use custom Python build scripts so I can do whatever I want.</p> <p>We use SVN, so we were looking...
[ { "answer_id": 407107, "author": "Josh Kelley", "author_id": 25507, "author_profile": "https://Stackoverflow.com/users/25507", "pm_score": 3, "selected": false, "text": "svnversion" }, { "answer_id": 407134, "author": "Paul Beckingham", "author_id": 14356, "author_pro...
2009/01/02
[ "https://Stackoverflow.com/questions/407074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39301/" ]
407,080
<p>I have read through the solutions to similar problems, but they all seem to involve scripts and extra tools. I'm hoping my problem simple enough to avoid that.</p> <p>So the user uploads a csv of next week's data. It gets inserted into the DB, no problem.</p> <p>BUT</p> <p>an hour later he gets feedback from ever...
[ { "answer_id": 407107, "author": "Josh Kelley", "author_id": 25507, "author_profile": "https://Stackoverflow.com/users/25507", "pm_score": 3, "selected": false, "text": "svnversion" }, { "answer_id": 407134, "author": "Paul Beckingham", "author_id": 14356, "author_pro...
2009/01/02
[ "https://Stackoverflow.com/questions/407080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49478/" ]
407,100
<p>I need to call a const function from a non-const object. See example</p> <pre><code>struct IProcess { virtual bool doSomeWork() const = 0L; }; class Foo : public IProcess { virtual bool doSomeWork() const { ... } }; class Bar { public: const IProcess&amp; getProcess() const {return ...;} IProc...
[ { "answer_id": 407114, "author": "Judge Maygarden", "author_id": 1491, "author_profile": "https://Stackoverflow.com/users/1491", "pm_score": 1, "selected": false, "text": "const_cast<const IProcess&> (getProcess()).doSomeWork();\n" }, { "answer_id": 407122, "author": "Communi...
2009/01/02
[ "https://Stackoverflow.com/questions/407100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49145/" ]
407,108
<p>This is the SP...</p> <pre><code>USE [EBDB] GO /****** Object: StoredProcedure [dbo].[delete_treatment_category] Script Date: 01/02/2009 15:18:12 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /* RETURNS 0 FOR SUCESS 1 FOR NO DELETE AS HAS ITEMS 2 FOR DELETE ERROR */ ALTER PROCEDURE [...
[ { "answer_id": 415823, "author": "gbn", "author_id": 27535, "author_profile": "https://Stackoverflow.com/users/27535", "pm_score": 0, "selected": false, "text": "DECLARE @rtn int;\nEXEC @rtn = dbo.delete_treatment_category /*insert valid id here > 2*/;\nSELECT @rtn;\n" }, { "answ...
2009/01/02
[ "https://Stackoverflow.com/questions/407108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37381/" ]
407,115
<p>I have a combobox in WPF that I add items to at run-time (via a data binding to a List). I'd like to set the height of the dropdown box dynamically so that all (or most) of the items show. Unfortunately it seems that the height of the dropdown is set once and cannot be dynamically altered. It always seems to be t...
[ { "answer_id": 407439, "author": "w4g3n3r", "author_id": 36745, "author_profile": "https://Stackoverflow.com/users/36745", "pm_score": 4, "selected": false, "text": "MaxDropDownHeight" }, { "answer_id": 45017459, "author": "kimmoli", "author_id": 4537127, "author_prof...
2009/01/02
[ "https://Stackoverflow.com/questions/407115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50932/" ]
407,130
<p>From a web service (WCF), I want an endpoint to take 10 seconds to finish.</p> <p>Is there a way I can do a <code>thread.sleep(10);</code> on the method?</p>
[ { "answer_id": 407148, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 4, "selected": true, "text": "Thread.Sleep(TimeSpan.FromSeconds(10))\n" }, { "answer_id": 407173, "author": "missaghi", "author_id": 467...
2009/01/02
[ "https://Stackoverflow.com/questions/407130", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
407,154
<p>Not that it is seriously burdensome to type </p> <pre><code>:My_custom_foobar() </code></pre> <p>instead of just </p> <pre><code>:my_custom_foobar() </code></pre> <p>but it just feels odd considering how virtually every other aspect of Vim is so extensible. Some searching for an answer has not turned up much, bu...
[ { "answer_id": 407224, "author": "Yada", "author_id": 45066, "author_profile": "https://Stackoverflow.com/users/45066", "pm_score": 3, "selected": true, "text": "nnoremap <Leader>f :call My_custom_foobar()<CR>\n" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42223/" ]
407,179
<p>I have a PDF document that needs to be pulled up in the browser, edited, and saved. I can save via the embedded adobe toolbar, along with all the other acrobat functions. But, what I am trying to see is if there is a way to display the PDF in a webpage alongside web controls.</p> <p>For example, in the top part o...
[ { "answer_id": 407191, "author": "Vilx-", "author_id": 41360, "author_profile": "https://Stackoverflow.com/users/41360", "pm_score": 0, "selected": false, "text": "<object>" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28045/" ]
407,180
<p>I am working with an object which has sub objects within (see example below). I am attempting to bind a <code>List&lt;rootClass&gt;</code> to the datagrid. When I bind the <code>List&lt;&gt;</code>, in the cell that contains the <code>subObject</code>, I see the following value <code>... "namespace.subObject" ...</c...
[ { "answer_id": 407197, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 4, "selected": true, "text": "List<rootClass> yourList = ...\nTypedListWrapper<rootClass> bindableList = new TypedListWrapper<rootClass>(yourList);\...
2009/01/02
[ "https://Stackoverflow.com/questions/407180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
407,184
<p>I am writing a nightly build script in bash.<br> Everything is fine and dandy except for one little snag:</p> <pre><code> #!/bin/bash for file in "$PATH_TO_SOMEWHERE"; do if [ -d $file ] then # do something directory-ish else if [ "$file" == "*.txt" ] # this is ...
[ { "answer_id": 407229, "author": "Paul Stephenson", "author_id": 5536, "author_profile": "https://Stackoverflow.com/users/5536", "pm_score": 9, "selected": true, "text": ".txt" }, { "answer_id": 407271, "author": "Eldelshell", "author_id": 48869, "author_profile": "ht...
2009/01/02
[ "https://Stackoverflow.com/questions/407184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
407,202
<p>The phrase was used as a warning that the code was pulling some serious stunts. My google search for this is pulling up nada; but I remember someone doing a search of google source for the phrase quite a while back.</p> <p>in lies dragons?</p> <p>dragons sleep here... </p> <p>Bah... </p>
[ { "answer_id": 13246586, "author": "bwDraco", "author_id": 681231, "author_profile": "https://Stackoverflow.com/users/681231", "pm_score": 3, "selected": false, "text": "// Here be dragons. Thou art forewarned\n" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16260/" ]
407,209
<p>I want to make Visual Studio move the autocompleted closing tag a word (or more) to the right. For example, given the following HTML:</p> <pre><code>&lt;p&gt;I need to emphasize some text.&lt;/p&gt; </code></pre> <p>If I type <code>&lt;em&gt;</code> before the word "emphasize", Visual Studio autocompletes like so:...
[ { "answer_id": 408356, "author": "w4g3n3r", "author_id": 36745, "author_profile": "https://Stackoverflow.com/users/36745", "pm_score": 4, "selected": true, "text": "Sub MoveClosingTag()\n Dim ts As EnvDTE.TextSelection = CType(DTE.ActiveDocument.Selection(), EnvDTE.TextSelection)\n ...
2009/01/02
[ "https://Stackoverflow.com/questions/407209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42685/" ]
407,237
<p>Is it possible to determine if an ASP.NET page is a postback from javascript? So basically a javascript equivalent of C# Page.IsPostBack.</p> <p>Thanks.</p>
[ { "answer_id": 407246, "author": "Bob", "author_id": 45, "author_profile": "https://Stackoverflow.com/users/45", "pm_score": 5, "selected": true, "text": "var isPostBack = <%= Page.IsPostBack ? \"true\" : \"false\" %>;\n" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47036/" ]
407,238
<p>I have an <code>IDictionary&lt;TKey,TValue&gt;</code> implementation that internally holds n other <code>Dictionary&lt;TKey, TValue&gt;</code> and distributes that insertions by the HashCode of the key to the invidual sub-dictionaries. With 16 sub-dictionaries, the number of collisions is pretty low on a 4-core mach...
[ { "answer_id": 407267, "author": "Dmitri Nesteruk", "author_id": 9476, "author_profile": "https://Stackoverflow.com/users/9476", "pm_score": 0, "selected": false, "text": "Monitor" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48722/" ]
407,255
<p>I have always wondered if, in general, declaring a throw-away variable before a loop, as opposed to repeatedly inside the loop, makes any (performance) difference? A <em>(quite pointless)</em> example in Java:</p> <p><strong>a)</strong> declaration before loop:</p> <pre><code>double intermediateResult; for(int i=...
[ { "answer_id": 407294, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 6, "selected": false, "text": "using System;\nusing System.Collections.Generic;\n\nclass Test\n{\n static void Main()\n {\n List<Action> a...
2009/01/02
[ "https://Stackoverflow.com/questions/407255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50899/" ]
407,256
<p>I am using a simple regex to replace break tags with newlines:</p> <pre><code>br_regex = /&lt;br&gt;/; input_content = input_content.replace(br_regex, "\n"); </code></pre> <p>This only replaces the first instance of a break tag, but I need to replace all. <code>preg_match_all()</code> would do the trick in PHP, bu...
[ { "answer_id": 407264, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 8, "selected": true, "text": "g" }, { "answer_id": 408318, "author": "bobince", "author_id": 18936, "author_profile": "https://Stack...
2009/01/02
[ "https://Stackoverflow.com/questions/407256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74552/" ]
407,272
<p>I am creating an HTML form with some radio button options. I'd like to have one option as "Other - please specify" and allow the user to type something in.</p> <p>Two questions: </p> <p>1) How can I make a "hybrid" input type of <code>radio/text</code>? </p> <p>2) On the PHP back end, if the input has the s...
[ { "answer_id": 407356, "author": "Piskvor left the building", "author_id": 19746, "author_profile": "https://Stackoverflow.com/users/19746", "pm_score": 4, "selected": true, "text": "<input type=\"text\" ...>" }, { "answer_id": 1423691, "author": "Community", "author_id":...
2009/01/02
[ "https://Stackoverflow.com/questions/407272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4376/" ]
407,279
<p>I have a skeleton text file with placeholder strings:</p> <pre><code>blah blah blah blah $PLACEHOLDER_1$ blah $PLACEHOLDER_2$ </code></pre> <p>and so on. Specific "form" of placeholders does not matter -- I may change them to whatever most comfortable for specific implementation.</p> <p>I have a bash script where...
[ { "answer_id": 407311, "author": "Adam Peck", "author_id": 26658, "author_profile": "https://Stackoverflow.com/users/26658", "pm_score": 4, "selected": true, "text": "sed -i 's/PLACEHOLDER_1/string 1/g;s/PLACEHOLDER_2/string 2/g' <file>\n" }, { "answer_id": 407486, "author": ...
2009/01/02
[ "https://Stackoverflow.com/questions/407279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6236/" ]
407,287
<p>Title might be a bit confusing, so let me explain.</p> <p>I have a website that has a side-panel, which contains information about the user, things the user can do, etc. When the user is not logged in, this side-panel becomes the area for logging in or registration.</p> <p>The code for this is:</p> <pre><code>&lt...
[ { "answer_id": 407316, "author": "Ionuț Staicu", "author_id": 23810, "author_profile": "https://Stackoverflow.com/users/23810", "pm_score": 0, "selected": false, "text": "$.ajax({\n type: \"GET\",\n url: \"url\", // replace 'url' with your url\n cache: false,\n success: funct...
2009/01/02
[ "https://Stackoverflow.com/questions/407287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29595/" ]
407,314
<p>I want to create a quick application for people to resolve the name of a user stored in Active Directory from a set of credentials. Some applications only provide the user id and it is too much to expect an end user to fire up the Active Directory Users and Groups MMC snap-in.</p> <p>Input would be something like "...
[ { "answer_id": 407401, "author": "Adam Lassek", "author_id": 1249, "author_profile": "https://Stackoverflow.com/users/1249", "pm_score": 2, "selected": false, "text": "string[] strUserName = username.Split(\"\\\\\".ToCharArray());\nusing (var entry = new DirectoryEntry(\"LDAP://\" + ADSe...
2009/01/02
[ "https://Stackoverflow.com/questions/407314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/636/" ]
407,337
<p>This is really stumping me today. I'm sure its not that hard, but I have a System.Reflection.PropertyInfo object. I want to set its value based on the result of a database lookup (think ORM, mapping a column back to a property).</p> <p>My problem is if the DB returned value is DBNull, I just want to set the proper...
[ { "answer_id": 407345, "author": "Darin Dimitrov", "author_id": 29407, "author_profile": "https://Stackoverflow.com/users/29407", "pm_score": 6, "selected": false, "text": "object defaultValue = type.IsValueType ? Activator.CreateInstance(type) : null;\n" }, { "answer_id": 407364...
2009/01/02
[ "https://Stackoverflow.com/questions/407337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28278/" ]
407,350
<p>I need to do some processing on fairly large XML files ( large here being potentially upwards of a gigabyte ) in C# including performing some complex xpath queries. The problem I have is that the standard way I would normally do this through the System.XML libraries likes to load the whole file into memory before it...
[ { "answer_id": 407485, "author": "Dimitre Novatchev", "author_id": 36305, "author_profile": "https://Stackoverflow.com/users/36305", "pm_score": 1, "selected": false, "text": "XPathDocument" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15394/" ]
407,362
<p>A beginner's question. </p> <p>I'm building a .swf with Flex Ant.</p> <p>To my .swf I link a file, <code>target.as</code>, which I generate from file <code>source.txt</code> with command </p> <pre><code>./tool.sh source.txt &gt; target.as </code></pre> <p>How can I add what is described in the above sentence to ...
[ { "answer_id": 407406, "author": "Adam Peck", "author_id": 26658, "author_profile": "https://Stackoverflow.com/users/26658", "pm_score": 2, "selected": false, "text": "exec" }, { "answer_id": 407411, "author": "Simon Lehmann", "author_id": 27011, "author_profile": "ht...
2009/01/02
[ "https://Stackoverflow.com/questions/407362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6236/" ]
407,367
<p>I have a couple of inline SQL in many of our reports on the report manager. Now I need to do some code change for all of them, is there a way to list all those reports based on the inline SQL and not any SP?</p> <p>Thanks,<br /> D</p>
[ { "answer_id": 407406, "author": "Adam Peck", "author_id": 26658, "author_profile": "https://Stackoverflow.com/users/26658", "pm_score": 2, "selected": false, "text": "exec" }, { "answer_id": 407411, "author": "Simon Lehmann", "author_id": 27011, "author_profile": "ht...
2009/01/02
[ "https://Stackoverflow.com/questions/407367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
407,405
<p>We have 2 applications that run under JBoss. I am looking for a way to reduce the overhead of the server. The main app runs under Tomcat. The other app is made up of MBeans. Is there a way to run MBeans under Tomcat? </p> <p>Alternative suggestions are appreciated.</p>
[ { "answer_id": 1161861, "author": "utku.utkan", "author_id": 127370, "author_profile": "https://Stackoverflow.com/users/127370", "pm_score": 2, "selected": false, "text": "-Dcom.sun.management.jmxremote\n-Dcom.sun.management.jmxremote.port=4444 (could be anything)\n-Dcom.sun.management.j...
2009/01/02
[ "https://Stackoverflow.com/questions/407405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6013/" ]
407,407
<p>What's the best way to read a fixed length record in Perl. I know to read a file like:</p> <pre><code>ABCDE 302 DEFGC 876 </code></pre> <p>I can do</p> <pre><code>while (&lt;FILE&gt;) { $key = substr($_, 0, 5); $value = substr($_, 7, 3); } </code></pre> <p>but isn't there a way to do this with read/unpack...
[ { "answer_id": 407422, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 4, "selected": false, "text": "my($key, $value) = unpack \"A5 A3\"; # Original, but slightly dubious\n" }, { "answer_id": 407498, ...
2009/01/02
[ "https://Stackoverflow.com/questions/407407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14167/" ]
407,420
<p>I understand that the goal of moving towards <code>&lt;div&gt;</code> tags from <code>&lt;table&gt;</code> makes sense since it is more semantic. However, I don't understand the benefit gained if you still need a clearing block to make column-based layouts work. For example:</p> <pre><code>&lt;!-- Note: location-in...
[ { "answer_id": 407421, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 6, "selected": true, "text": ".clear-block:after {\n content: \".\";\n display: block;\n height: 0;\n clear: both;\n visibility: hidden;\...
2009/01/02
[ "https://Stackoverflow.com/questions/407420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26/" ]
407,428
<p>I'm trying to bind an ASP.net DropDownList to the results of an entity framework query, while still maintaining multi-tier separation. (i.e. I don't want my UI code to contain query details, nor my Data Layer code to have UI dependencies.) My code-behind in the Page_Load event handler looks like this:</p> <pre><c...
[ { "answer_id": 407441, "author": "M4N", "author_id": 19635, "author_profile": "https://Stackoverflow.com/users/19635", "pm_score": 3, "selected": true, "text": "IEnumerable<Lookup> l = (from c in context.Lookup\n where c.LookupTypeID == LookupTypeID\n ...
2009/01/02
[ "https://Stackoverflow.com/questions/407428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46731/" ]
407,452
<p>Lets say you have inherited a MS SQL 2000 or 2005 database, and you know that some of the Tables, Views, Procs, and Functions are not actually used in the final product. </p> <p>Is there some kind of internal logging or another mechanism that could tell me what objects are NOT being called? or have only been calle...
[ { "answer_id": 407656, "author": "Timbo", "author_id": 20992, "author_profile": "https://Stackoverflow.com/users/20992", "pm_score": 3, "selected": false, "text": "select \n id, \n name\nfrom\n sys.sysdepends sd\ninner join sys.sysobjects so\n on so.id = sd.id\nwhere \n no...
2009/01/02
[ "https://Stackoverflow.com/questions/407452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36590/" ]
407,459
<p>I'm building a Windows service and following <a href="http://msdn.microsoft.com/en-us/library/aa984464(VS.71).aspx" rel="noreferrer">this MSDN article</a>, but I'm stuck on step 3 under "Create an installer". I can't find the "Add Installer" link it's referring to. I've clicked everywhere, including following the in...
[ { "answer_id": 18963275, "author": "Contango", "author_id": 107409, "author_profile": "https://Stackoverflow.com/users/107409", "pm_score": 2, "selected": false, "text": "Add Installer" }, { "answer_id": 40409936, "author": "Carol", "author_id": 2763467, "author_profi...
2009/01/02
[ "https://Stackoverflow.com/questions/407459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8114/" ]
407,460
<p>Can someone illustrate (or point me to a good tutorial) on how to add a Date Picker to a view programmatically (i.e., without using the interface editor)? </p>
[ { "answer_id": 407480, "author": "Marc Charbonneau", "author_id": 35136, "author_profile": "https://Stackoverflow.com/users/35136", "pm_score": 2, "selected": false, "text": "initWithFrame" }, { "answer_id": 3931401, "author": "Ajay Sharma", "author_id": 434898, "auth...
2009/01/02
[ "https://Stackoverflow.com/questions/407460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
407,467
<p>When WSDL importer wizard generates the interfaces, all properties have the Index option, but reading the code and the InvokeRegistry unit, I can't found what is that for, anyone know if it is really necessary?</p> <p>Like this</p> <pre><code> Login = class(TRemotable) private [...] published propert...
[ { "answer_id": 408636, "author": "Wouter van Nifterick", "author_id": 38813, "author_profile": "https://Stackoverflow.com/users/38813", "pm_score": 2, "selected": false, "text": "function GetUser(Index:Integer):String;\nprocedure SetUser(Index:Integer;const value:string);\n" }, { ...
2009/01/02
[ "https://Stackoverflow.com/questions/407467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36875/" ]
407,468
<p>I'm currently trying to initiate a file upload with urllib2 and the <a href="http://fabien.seisen.org/python/urllib2_multipart.html" rel="nofollow noreferrer">urllib2_file</a> library. Here's my code:</p> <pre><code>import sys import urllib2_file import urllib2 URL='http://aquate.us/upload.php' d = [('uploaded', o...
[ { "answer_id": 407545, "author": "Ben Blank", "author_id": 46387, "author_profile": "https://Stackoverflow.com/users/46387", "pm_score": 2, "selected": false, "text": "urllib2_file" }, { "answer_id": 407557, "author": "S.Lott", "author_id": 10661, "author_profile": "h...
2009/01/02
[ "https://Stackoverflow.com/questions/407468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50548/" ]
407,491
<p>Take the example classes below. I want to display the customer and two addresses (from a LIST) on a form. Does the model binder in MVC beta support this or will I have to write my own custom binder? </p> <pre><code>public class Customer { public string FirstName { get; set; } public string LastName { get; ...
[ { "answer_id": 409216, "author": "Tim Scott", "author_id": 29493, "author_profile": "https://Stackoverflow.com/users/29493", "pm_score": 1, "selected": false, "text": "<%= Html.TextBox(\"Address[0].Line1\", ViewData.Model.Address[0].Line1)%>\n<%= Html.TextBox(\"Address[1].Line1\", ViewDa...
2009/01/02
[ "https://Stackoverflow.com/questions/407491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50964/" ]
407,518
<p>I recently posted <a href="https://stackoverflow.com/questions/406760/whats-your-most-controversial-programming-opinion#406948">one of my favourite interview whiteboard coding questions</a> in "<a href="https://stackoverflow.com/questions/406760/whats-your-most-controversial-programming-opinion">What's your more con...
[ { "answer_id": 407530, "author": "Greg Beech", "author_id": 13552, "author_profile": "https://Stackoverflow.com/users/13552", "pm_score": 2, "selected": false, "text": "StackOverflowException" }, { "answer_id": 407540, "author": "Federico A. Ramponi", "author_id": 18770, ...
2009/01/02
[ "https://Stackoverflow.com/questions/407518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13552/" ]
407,521
<p>The application I want to build using MS Visual C# Express (I'm willing to upgrade to Standard if that becomes required) that needs a database.</p> <p>I was all psyched about the SQL Server Compact - because I don't want the folks who would be installing my application on their computers to have to install the whol...
[ { "answer_id": 407539, "author": "Anthony Mastrean", "author_id": 3619, "author_profile": "https://Stackoverflow.com/users/3619", "pm_score": 1, "selected": false, "text": "TEXT" }, { "answer_id": 407584, "author": "Joel Coehoorn", "author_id": 3043, "author_profile":...
2009/01/02
[ "https://Stackoverflow.com/questions/407521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44004/" ]
407,523
<p>In my bash script I have an external (received from user) string, which I should use in sed pattern.</p> <pre><code>REPLACE="&lt;funny characters here&gt;" sed "s/KEYWORD/$REPLACE/g" </code></pre> <p>How can I escape the <code>$REPLACE</code> string so it would be safely accepted by <code>sed</code> as a literal r...
[ { "answer_id": 407563, "author": "Alex", "author_id": 30181, "author_profile": "https://Stackoverflow.com/users/30181", "pm_score": 0, "selected": false, "text": "ls | awk '{ print \"awk \" \"'\"'\"'\" \" {print $1,$2,$3} \" \"'\"'\"'\" \" \" $1 \".old_ext > \" $1 \".new_ext\" }' > fo...
2009/01/02
[ "https://Stackoverflow.com/questions/407523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6236/" ]
407,550
<p>I have a PHP application that makes extensive use of Javascript on the client side. I have a simple system on the PHP side for providing translators an easy way to provide new languages. But there are cases where javascript needs to display language elements to the user (maybe an OK or cancel button or "loading" o...
[ { "answer_id": 407568, "author": "Pim Jager", "author_id": 35197, "author_profile": "https://Stackoverflow.com/users/35197", "pm_score": 5, "selected": true, "text": " <script type='text/javascript' src='jsscript.js'></script>\n" }, { "answer_id": 410584, "author": "scronide...
2009/01/02
[ "https://Stackoverflow.com/questions/407550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2494/" ]
407,571
<p>I'm using VSS 2008 and Visual Studio 2008. When my source files are checked in, the VSS property dialog shows them as type "Unicode (UTF-8)". But if I check one out from within Visual Studio, then do a compare, it says "binary files differ". Is anyone else seeing this? Do I have a screwed up setting somewhere?</...
[ { "answer_id": 413438, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 3, "selected": false, "text": "auto" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46731/" ]
407,579
<p>HI i did this code with help of Marc Gravell in </p> <p><a href="https://stackoverflow.com/questions/406791/">Why can&#39;t I find _left and _right in BinarySearchTree?</a><br> &amp;<br> <a href="https://stackoverflow.com/questions/406402/bst-c-code-with-errors">How do I correct an implicit conversion error in BST ...
[ { "answer_id": 407606, "author": "R. Martinho Fernandes", "author_id": 46642, "author_profile": "https://Stackoverflow.com/users/46642", "pm_score": 3, "selected": true, "text": "CountNodes" }, { "answer_id": 407610, "author": "Yuval Adam", "author_id": 24545, "author...
2009/01/02
[ "https://Stackoverflow.com/questions/407579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
407,586
<p>Can someone tell me what the code equivelant in VB.Net to this C# code is?</p> <pre><code>new {name="value"} </code></pre>
[ { "answer_id": 407594, "author": "BFree", "author_id": 15861, "author_profile": "https://Stackoverflow.com/users/15861", "pm_score": 3, "selected": true, "text": " New With {.Name = \"value\"}\n" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13502/" ]
407,587
<p>Few blob's have been duplicated in my database(oracle 11g), performed XOR operations on the blob using UTL_RAW.BIT_XOR. After that i wanted to count the number of set bits in the binary string, so wrote the code above.</p> <p>During a small experiment, i wanted to see what is the hex and the integer value produced...
[ { "answer_id": 407619, "author": "Alex", "author_id": 30181, "author_profile": "https://Stackoverflow.com/users/30181", "pm_score": 2, "selected": false, "text": " def bitsoncount(x): \n b=0\n while(x > 0):\n x &= x - 1 \n b+=1\n return b\n" }, { ...
2009/01/02
[ "https://Stackoverflow.com/questions/407587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1636/" ]
407,596
<p>Let's say I have the following jQuery AJAX call:</p> <pre><code>$.ajax({ type: "POST", url: "MyUrl", data: "val1=test", success: function(result){ // Do stuff } }); </code></pre> <p>Now, when this AJAX call is made I want the server-side code to run through a few error handling checks (e.g....
[ { "answer_id": 407608, "author": "rodbv", "author_id": 79101, "author_profile": "https://Stackoverflow.com/users/79101", "pm_score": 2, "selected": false, "text": "fail:function(...){..}" }, { "answer_id": 407636, "author": "Salty", "author_id": 50548, "author_profile...
2009/01/02
[ "https://Stackoverflow.com/questions/407596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
407,612
<p>I have a Java application that I run from a console which in turn executes an another Java process. I want to get a thread/heap dump of that child process.</p> <p>On Unix, I could do a <code>kill -3 &lt;pid&gt;</code> but on Windows AFAIK the only way to get a thread dump is Ctrl-Break in the console. But that only...
[ { "answer_id": 407625, "author": "krosenvold", "author_id": 23691, "author_profile": "https://Stackoverflow.com/users/23691", "pm_score": 3, "selected": false, "text": "kill -3 <pid>" }, { "answer_id": 407685, "author": "Steve Kuo", "author_id": 24396, "author_profile...
2009/01/02
[ "https://Stackoverflow.com/questions/407612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
407,614
<p>I am currently undertaking a project that involves extensive use of Java RMI and I was wondering if anyone is aware of any good resources about it.</p> <p>The problem I am having with the material I am finding currently is that its usually quite out of date (like Java 1.3) and / or half complete. I would even be ha...
[ { "answer_id": 37628026, "author": "Nikita Koksharov", "author_id": 764206, "author_profile": "https://Stackoverflow.com/users/764206", "pm_score": 0, "selected": false, "text": "YourServiceImpl" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50866/" ]
407,646
<p>Suppose I've got a table:</p> <pre><code>Role ---- person_id company_id financial_year </code></pre> <p>How can I tell the following:</p> <ol> <li>Whether each person_id occurs at most once per company_id per financial_year in this table</li> <li>If 1. is false, which person_id's and company_id's and financial_ye...
[ { "answer_id": 407660, "author": "Harper Shelby", "author_id": 21196, "author_profile": "https://Stackoverflow.com/users/21196", "pm_score": 0, "selected": false, "text": "select left.person_id, left.company_id, left.financial_year, count(*)\nfrom role left\ninner join role right\n on...
2009/01/02
[ "https://Stackoverflow.com/questions/407646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41613/" ]
407,651
<p>This is related to my question on <a href="https://stackoverflow.com/questions/407596/how-do-you-handle-errors-from-ajax-calls">how to handle errors from jQuery AJAX calls</a>. Several responses suggested that I use the "error" callback to display any errors from a jQuery AJAX call. I was wondering how to do that ...
[ { "answer_id": 407665, "author": "John Sheehan", "author_id": 1786, "author_profile": "https://Stackoverflow.com/users/1786", "pm_score": 1, "selected": false, "text": "throw new HttpException(500, \"Error message\");\n" }, { "answer_id": 407686, "author": "Salty", "autho...
2009/01/02
[ "https://Stackoverflow.com/questions/407651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
407,658
<p>Situation: I entered several functions while working with REPL in Emacs. Problem: There is junk like "; Evaluation aborted" when I'm simply saving buffer. What I want: clear descriptions of all the functions I entered in their latest revision.</p> <p>Can I do that? Thanks.</p>
[ { "answer_id": 407750, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 2, "selected": false, "text": "C-x o" }, { "answer_id": 409281, "author": "HD.", "author_id": 6525, "author_profile": "https:/...
2009/01/02
[ "https://Stackoverflow.com/questions/407658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47937/" ]
407,687
<p>How I insert my username, Password values to database using Zend framework. </p> <p>And how I get the values from the database using zend framework.</p>
[ { "answer_id": 407745, "author": "Thomaschaaf", "author_id": 19929, "author_profile": "https://Stackoverflow.com/users/19929", "pm_score": 0, "selected": false, "text": "$db = new Zend_Db(....);\n$data = array('username'=>'thomaschaaf', 'password'= md5('secret'));\n$db->insert('field', $...
2009/01/02
[ "https://Stackoverflow.com/questions/407687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
407,688
<p>I'm giving <a href="http://db.apache.org/derby/" rel="noreferrer">Apache Derby</a>, aka <a href="http://developers.sun.com/javadb/" rel="noreferrer">JavaDB</a> a spin. I can't seem to get around duplicate key issues when inserting records that may already exist. Is there a Derby equivalent to "<code>insert if not ...
[ { "answer_id": 430929, "author": "Snukker", "author_id": 44721, "author_profile": "https://Stackoverflow.com/users/44721", "pm_score": 4, "selected": false, "text": "INSERT INTO foo ( \n SELECT 'a' as A, 'b' as B\n FROM foo \n WHERE \n A = 'a' AND B = 'b' \n HAVING count(*)=0 ...
2009/01/02
[ "https://Stackoverflow.com/questions/407688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1274957/" ]
407,712
<p>I am using the Entity framework to create a new order. The order contains a collection of contacts, a many to many relationship. I want to add a reference to an existing contact on the order on creation of the order. Both Order and Contact a Entity Objects.</p> <pre><code> Order order = new Order(); //set deta...
[ { "answer_id": 413516, "author": "Craig Stuntz", "author_id": 7714, "author_profile": "https://Stackoverflow.com/users/7714", "pm_score": 2, "selected": false, "text": "order.Contact.Add(contact);\n" }, { "answer_id": 1912464, "author": "Michael L Perry", "author_id": 766...
2009/01/02
[ "https://Stackoverflow.com/questions/407712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46400/" ]
407,713
<p>Is there a recommended way to bounce an asp.net application besides touching web.config from inside the application? is <code>HttpRuntime.UnloadAppDomain()</code>; the preferred way to do this ? and if so where do you do this? In the unload of a page or some other place in the application?</p>
[ { "answer_id": 407778, "author": "casperOne", "author_id": 50776, "author_profile": "https://Stackoverflow.com/users/50776", "pm_score": 5, "selected": false, "text": "UnloadAppDomain" }, { "answer_id": 17057662, "author": "user2431693", "author_id": 2431693, "author_...
2009/01/02
[ "https://Stackoverflow.com/questions/407713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10676/" ]
407,720
<p>I'm using LINQ to SQL to update my database. I'm inserting a lot of records, and when I call SubmitChanges(), LINQ to SQL executes an insert and a select statement for each object. I don't really care to update my objects after they are inserted into the database.</p> <p>Do you know I can prevent LINQ to SQL from...
[ { "answer_id": 407976, "author": "Amy B", "author_id": 8155, "author_profile": "https://Stackoverflow.com/users/8155", "pm_score": 3, "selected": false, "text": "INSERT INTO [dbo].[TableName]( fieldlist )\nVALUES (@p0, @p1, @p2, @p3, @p4)\n\nSELECT CONVERT(Int,SCOPE_IDENTITY()) AS [value...
2009/01/02
[ "https://Stackoverflow.com/questions/407720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571/" ]
407,729
<p>Given two sets of values:</p> <pre><code>var subset = new[] { 2, 4, 6, 8 }; var superset = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; </code></pre> <p>how do I determine if <code>superset</code> contains all elements of <code>subset</code>?</p> <p>I have come up with this:</p> <pre><code>superset.Intersect(subset)...
[ { "answer_id": 407741, "author": "leppie", "author_id": 15541, "author_profile": "https://Stackoverflow.com/users/15541", "pm_score": 2, "selected": false, "text": "subset.Except(superset).Count() == 0\n" }, { "answer_id": 407748, "author": "Amy B", "author_id": 8155, ...
2009/01/02
[ "https://Stackoverflow.com/questions/407729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37815/" ]
407,731
<p>The problem statement:</p> <p>Given a set of integers that is known in advance, <strong>generate</strong> code to test if a single integer is in the set. The domain of the testing function is the integers in some consecutive range.</p> <hr> <p>Nothing in particular is known now about the range or the set to be te...
[ { "answer_id": 407741, "author": "leppie", "author_id": 15541, "author_profile": "https://Stackoverflow.com/users/15541", "pm_score": 2, "selected": false, "text": "subset.Except(superset).Count() == 0\n" }, { "answer_id": 407748, "author": "Amy B", "author_id": 8155, ...
2009/01/02
[ "https://Stackoverflow.com/questions/407731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
407,734
<p>I need to use a priority queue in my Python code, and:</p> <ul> <li>am looking for any <strong>fast</strong> implementations for priority queues</li> <li>optimally, I'd like the queue to be <strong>generic</strong> (i.e. work well for any object with a specified comparison operator).</li> </ul> <p>Looking around f...
[ { "answer_id": 407755, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 7, "selected": true, "text": "(priority, thing)" }, { "answer_id": 407922, "author": "Eli Bendersky", "author_id": 8206, "auth...
2009/01/02
[ "https://Stackoverflow.com/questions/407734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
407,737
<p>I'm trying to build a query with hibernate criteria for the following scenario:</p> <ul> <li>Two entities: Indicator and report (each with their own tables, classes etc.)</li> <li>an indicator can be used in zero to many reports</li> <li>a report uses zero to many indicators</li> <li>therefore, I have an intersecti...
[ { "answer_id": 407779, "author": "zmf", "author_id": 13285, "author_profile": "https://Stackoverflow.com/users/13285", "pm_score": 3, "selected": true, "text": " Criteria c = session.createCriteria(Indicator.class);\n c.add(Restrictions.eq(\"someField\", myObject).createCriteria(\"re...
2009/01/02
[ "https://Stackoverflow.com/questions/407737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25320/" ]
407,739
<p>With more and more projects under my belt I find that I am often repeating many common tasks from project to project, client to client. So I have started to assemble a "utility" library, a collection of these common elements that are often repeated from project to project.</p> <p>So far I have utilities to resize ...
[ { "answer_id": 407768, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 1, "selected": false, "text": "Tuple<..>" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13279/" ]
407,763
<p>Backdrop: There are two forms, the main application form and a form to edit various settings for the operations of main application.</p> <p>What would be the proper way to show the frmSettings form and how to dispose it once clicked OK or Cancel in the actual frmSettings form?</p>
[ { "answer_id": 407785, "author": "Austin Salonen", "author_id": 4068, "author_profile": "https://Stackoverflow.com/users/4068", "pm_score": 0, "selected": false, "text": "using (frmSettings s = new frmSettings() )\n{\n if( s.ShowDialog() == DialogResult.OK )\n {\n //do work\n ...
2009/01/02
[ "https://Stackoverflow.com/questions/407763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
407,770
<p>I have an application where I need the user to be able to update or delete rows of data from the database. The rows are displayed to the user using a foreach loop in the .aspx file of my view. Each row will have two text fields (txtName, txtDesc), an update button, and a delete button. What I'm not sure of, is ho...
[ { "answer_id": 408006, "author": "rodbv", "author_id": 79101, "author_profile": "https://Stackoverflow.com/users/79101", "pm_score": 5, "selected": true, "text": "<form method=\"post\" action=\"/YourController/YourAction/<%=rowId%>\">\n" }, { "answer_id": 408839, "author": "A...
2009/01/02
[ "https://Stackoverflow.com/questions/407770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14101/" ]
407,771
<p>How can one allow code snippets to be entered into an editor (as stackoverflow does) like FCKeditor or any other editor while preventing XSS, SQL injection, and related attacks.</p>
[ { "answer_id": 407836, "author": "luiscubal", "author_id": 32775, "author_profile": "https://Stackoverflow.com/users/32775", "pm_score": 0, "selected": false, "text": "$code = getTheCodeSnippet();\n$code = htmlentities($code);\n$code = str_ireplace(\"&lt;br&gt;\", \"<br>\", $code); //exa...
2009/01/02
[ "https://Stackoverflow.com/questions/407771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40376/" ]
407,793
<p>This should be a simple question, but I haven't been able to find a way to make it work.</p> <p>Essentially, I have a silly localhost page that I use in my webdevelopment. When I am surfing between our development server and my local version of the C# code (redirected from the dev url via host file) I have been kn...
[ { "answer_id": 407804, "author": "bobwienholt", "author_id": 24257, "author_profile": "https://Stackoverflow.com/users/24257", "pm_score": 2, "selected": false, "text": "R2 = ~R1;\nG2 = ~G1;\nB2 = ~B1;\n" }, { "answer_id": 407819, "author": "mhenry1384", "author_id": 2426...
2009/01/02
[ "https://Stackoverflow.com/questions/407793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23902/" ]
407,854
<p>When building a project I tag the source using the svn copy command. When viewing history for trunk I don't see a log message for those tags. I would like to see a log message for each of my release versions in trunk. </p> <p>I want to be able to easily see which changes were in each release. Right now I need to ...
[ { "answer_id": 408992, "author": "Bert Huijben", "author_id": 2094, "author_profile": "https://Stackoverflow.com/users/2094", "pm_score": 1, "selected": false, "text": "svnmucc \\\n cp 1234 http://srv/svn/project/trunk http://srv/svn/project/tags/release \\\n propset last-tag ^/tags/re...
2009/01/02
[ "https://Stackoverflow.com/questions/407854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6174/" ]
407,855
<p>Hopefully a simple question. Take for instance a Circularly-linked list:</p> <pre><code>class ListContainer { private listContainer next; &lt;..&gt; public void setNext(listContainer next) { this.next = next; } } class List { private listContainer entry; &lt;..&gt; } </code></pre> <p>Now since ...
[ { "answer_id": 18350674, "author": "Aniket Thakur", "author_id": 2396539, "author_profile": "https://Stackoverflow.com/users/2396539", "pm_score": 2, "selected": false, "text": "How?\n" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35685/" ]
407,858
<p>I have a Flex 3 app (player v9) which loads a Flash SWF (AS3, also player v9) and needs to dynamically pass it a collection of parameters which are known at run-time. These are parameters that are normally passed via the <code>flashvars</code> element in an HTML page. The embedded movie accesses these parameters via...
[ { "answer_id": 408859, "author": "Theo", "author_id": 1109, "author_profile": "https://Stackoverflow.com/users/1109", "pm_score": 0, "selected": false, "text": "file:///some/path/to/a.swf" }, { "answer_id": 447728, "author": "aleksk", "author_id": 55533, "author_profi...
2009/01/02
[ "https://Stackoverflow.com/questions/407858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26829/" ]
407,881
<p>I often want to define new 'Exception' classes, but need to have an appropriate constructor defined because constructors aren't inherited. </p> <pre><code>class MyException : public Exception { public: MyException (const UString Msg) : Exception(Msg) { }; } </code></pre> <p>Typedefs don't work for this, be...
[ { "answer_id": 407949, "author": "Judge Maygarden", "author_id": 1491, "author_profile": "https://Stackoverflow.com/users/1491", "pm_score": 1, "selected": false, "text": "#include <iostream>\n#include <string>\n\nusing namespace std;\n\nenum ExceptionId {\n EXCEPTION_FOO,\n EXCEPT...
2009/01/02
[ "https://Stackoverflow.com/questions/407881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1737/" ]
407,904
<p>I have a constantly growing database of keywords. I need to parse incoming text inputs (articles, feeds etc) and find which keywords from the database are present in the text. The database of keywords is much larger than the text.</p> <p>Since the database is constantly growing (users add more and more keywords to...
[ { "answer_id": 407972, "author": "ʞɔıu", "author_id": 41613, "author_profile": "https://Stackoverflow.com/users/41613", "pm_score": 0, "selected": false, "text": "inverted_index\n-----\ndocument_id keyword\n" }, { "answer_id": 408244, "author": "Norman Ramsey", "author_id...
2009/01/02
[ "https://Stackoverflow.com/questions/407904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10585/" ]
407,929
<p>By default <a href="http://en.wikipedia.org/wiki/Eclipse_%28software%29" rel="noreferrer">Eclipse</a> indents with a hard tab character. How do I change it to spaces?</p>
[ { "answer_id": 407933, "author": "Brian Deacon", "author_id": 409, "author_profile": "https://Stackoverflow.com/users/409", "pm_score": 5, "selected": false, "text": "Indentation" }, { "answer_id": 408449, "author": "Dave Ray", "author_id": 40310, "author_profile": "h...
2009/01/02
[ "https://Stackoverflow.com/questions/407929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/409/" ]
407,934
<p>What's the best way to put the "debugger;" statement inside the __doPostBack method or a way to step in the method?</p>
[ { "answer_id": 407968, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 1, "selected": true, "text": "iexplore.exe" } ]
2009/01/02
[ "https://Stackoverflow.com/questions/407934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5232/" ]
407,935
<p>My kindergarten SQL Server taught me that a trigger may be fired with multiple rows in the inserted and deleted pseudo tables. I mostly write my trigger code with this in mind, often resulting in some cursor based cludge. Now I'm really only able to test them firing for a single row at a time. How can I generate a m...
[ { "answer_id": 408381, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 3, "selected": false, "text": "-- BAD Trigger code following:\n\nCREATE TRIGGER trg_Table1 \nON Table1 \nFor UPDATE\nAS\nDECLARE @var1 int, @var2 var...
2009/01/02
[ "https://Stackoverflow.com/questions/407935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13219/" ]
407,947
<p>I have seen different ways to retrieve a string field from SQL. Is there a "right" way, and what are the differences</p> <pre><code> SqlDataReader rdr; 1. String field = (String) rdr["field"]; 2. String field = rdr["field"].ToString(); 3. String field = rdr["field"] As String; </code></pre> <p>Thanks!</p...
[ { "answer_id": 407997, "author": "JoshBerke", "author_id": 26160, "author_profile": "https://Stackoverflow.com/users/26160", "pm_score": 3, "selected": false, "text": "int ordinal=rdr.GetOrdinal(\"stringField\");\nif (rdr.IsDBNull(ordinal))\n{\n return string.Empty; //Or null or howev...
2009/01/02
[ "https://Stackoverflow.com/questions/407947", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37955/" ]