qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
163,760
<p>I have a Form being launched from another form on a different thread. Most of the time it works perfectly, but I get the below error from time to time. Can anyone help?</p> <pre><code>at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) at System.Drawing.Bitmap..ctor(Int32 width, Int32 heig...
[ { "answer_id": 167171, "author": "joek1975", "author_id": 4770, "author_profile": "https://Stackoverflow.com/users/4770", "pm_score": 0, "selected": false, "text": "Thread = New Thread(AddressOf ShowForm)\nThread.SetApartmentState(ApartmentState.STA)\nThread.IsBackground = True\n" }, ...
2008/10/02
[ "https://Stackoverflow.com/questions/163760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4770/" ]
163,761
<p>I have a hidden embedded QuickTime object on my page that I'm trying to control via JavaScript, but it's not working. The object looks like this:</p> <pre><code>&lt;object id="myPlayer" data="" type="audio/mpeg" pluginspage="http://www.apple.com/quicktime/download" width="0" height="0"&gt; &lt;param name="autoP...
[ { "answer_id": 429916, "author": "Kev", "author_id": 16777, "author_profile": "https://Stackoverflow.com/users/16777", "pm_score": 0, "selected": false, "text": "player.attributes.getNamedItem('data').value = 'http://yoururlhere';\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/163761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4287/" ]
163,783
<p>Here's the problem I'm having, I've got a set of logs that can grow fairly quickly. They're split into individual files every day, and the files can easily grow up to a gig in size. To help keep the size down, entries older than 30 days or so are cleared out.</p> <p>The problem is when I want to search these files ...
[ { "answer_id": 163806, "author": "changelog", "author_id": 5646, "author_profile": "https://Stackoverflow.com/users/5646", "pm_score": 3, "selected": false, "text": "grep" }, { "answer_id": 164317, "author": "Hank Gay", "author_id": 4203, "author_profile": "https://St...
2008/10/02
[ "https://Stackoverflow.com/questions/163783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4218/" ]
163,796
<p>I have a lot of XML files and I'd like to generate a report from them. The report should provide information such as:</p> <pre><code>root 100% a*1 90% b*1 80% c*5 40% </code></pre> <p>meaning that all documents have a root element, 90% have one <strong>a</strong> element in the root, 80% have one <strong>b</st...
[ { "answer_id": 164830, "author": "JeniT", "author_id": 6739, "author_profile": "https://Stackoverflow.com/users/6739", "pm_score": 4, "selected": false, "text": "$docs <xsl:for-each-group> <xsl:for-each-group select=\"$docs//*\" group-by=\"name()\">\n <xsl:sort select=\"current-group-ke...
2008/10/02
[ "https://Stackoverflow.com/questions/163796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6068/" ]
163,803
<p>I would like to override the use of the standard app.config by passing a command line parameter. How do I change the default application configuration file so that when I access ConfigurationManager.AppSettings I am accessing the config file specified on the command line?</p> <p>Edit:</p> <p>It turns out that the...
[ { "answer_id": 163829, "author": "Eric Schoonover", "author_id": 3957, "author_profile": "https://Stackoverflow.com/users/3957", "pm_score": 1, "selected": false, "text": "ConfigurationManager OpenExeConfiguration ConfigurationManager FileConfigurationSource FileConfigurationSource Micro...
2008/10/02
[ "https://Stackoverflow.com/questions/163803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6819/" ]
163,809
<p>I'm looking for an example algorithm of smart pagination. By smart, what I mean is that I only want to show, for example, 2 adjacent pages to the current page, so instead of ending up with a ridiculously long page list, I truncate it.</p> <p>Here's a quick example to make it clearer... this is what I have now:</p> ...
[ { "answer_id": 163825, "author": "changelog", "author_id": 5646, "author_profile": "https://Stackoverflow.com/users/5646", "pm_score": 6, "selected": true, "text": "[1] 2 3 4 5 6 ... 100\n1 [2] 3 4 5 6 ... 100\n...\n1 2 ... 14 15 [16] 17 18 ... 100\n...\n1 2 ... 97 [98] 99 100\n <?php\n\...
2008/10/02
[ "https://Stackoverflow.com/questions/163809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14981/" ]
163,823
<p>I have a <code>Person</code> model that has a foreign key relationship to <code>Book</code>, which has a number of fields, but I'm most concerned about <code>author</code> (a standard CharField).</p> <p>With that being said, in my <code>PersonAdmin</code> model, I'd like to display <code>book.author</code> using <c...
[ { "answer_id": 163968, "author": "Jonny Buchanan", "author_id": 6760, "author_profile": "https://Stackoverflow.com/users/6760", "pm_score": 5, "selected": false, "text": "__unicode__ 'book__author'" }, { "answer_id": 164631, "author": "imjoevasquez", "author_id": 24630, ...
2008/10/02
[ "https://Stackoverflow.com/questions/163823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10040/" ]
163,834
<p>What's the most elegant templating (preferably in pure PHP!) solution you've seen?</p> <p>Specifically i'm interested in handling:</p> <ol> <li>Detecting in a repeating block whether it's the first or last element</li> <li>Easy handling of odd/even cases, like a zebra striped table, or similar</li> <li>Other modul...
[ { "answer_id": 163860, "author": "Cruachan", "author_id": 7315, "author_profile": "https://Stackoverflow.com/users/7315", "pm_score": 3, "selected": false, "text": "$TBS->MergeBlock('blk1',$sqlconnect, \"SELECT name from people \");\n <ul>\n <li class=\"odd\">[blk.name;block=ul]</li>\...
2008/10/02
[ "https://Stackoverflow.com/questions/163834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20538/" ]
163,837
<p>I'm involved in building a donation form for non-profits. We recently got hit by a fast round of low dollar submissions. Many were invalid cards, but a few went through. Obviously someone wrote a script to check a bunch of card numbers for validity, possibly so they can sell them later.</p> <p>Any ideas on how to p...
[ { "answer_id": 1160012, "author": "tomjen", "author_id": 21133, "author_profile": "https://Stackoverflow.com/users/21133", "pm_score": 2, "selected": false, "text": "<noscript>" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/163837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3756/" ]
163,887
<p>Suppose I have a "tags" table with two columns: <strong>tagid</strong> and <strong>contentid</strong>. Each row represents a tag assigned to a piece of content. I want a query that will give me the contentid of every piece of content which is tagged with tagids 334, 338, and 342.</p> <p>The "easy" way to do this ...
[ { "answer_id": 163902, "author": "albertein", "author_id": 23020, "author_profile": "https://Stackoverflow.com/users/23020", "pm_score": 1, "selected": false, "text": "select a.contentid from tags a\ninner join tags b on a.contentid = b.contentid and b.tagid=334\ninner join tags c on a.c...
2008/10/02
[ "https://Stackoverflow.com/questions/163887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16034/" ]
163,900
<p>I'm putting together a little tool that some business people can run on their local filesystems, since we don't want to setup a host for it.</p> <p>Basically, its just HTML + Javascript (using jQuery) to pull some reports using REST from a 3rd party.</p> <p>The problem is, FF3 and IE don't allow the ajax call, I g...
[ { "answer_id": 163950, "author": "Greg", "author_id": 13009, "author_profile": "https://Stackoverflow.com/users/13009", "pm_score": -1, "selected": false, "text": "python -c “import SimpleHTTPServer;SimpleHTTPServer.test()”\n" }, { "answer_id": 166502, "author": "Morgan ARR A...
2008/10/02
[ "https://Stackoverflow.com/questions/163900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
163,917
<p>I have never clearly understood the usage of <code>MAXDOP</code>. I do know that it makes the query faster and that it is the last item that I can use for Query Optimization.</p> <p>However, my question is, when and where it is best suited to use in a query?</p>
[ { "answer_id": 167435, "author": "Jeremiah Peschka", "author_id": 11780, "author_profile": "https://Stackoverflow.com/users/11780", "pm_score": 5, "selected": false, "text": "MAXDOP(n) OPTION (FORCE ORDER) OPTION (FORCE PLAN) MAXDOP MAXDOP MAXDOP(8) MAXDOP" }, { "answer_id": 3650...
2008/10/02
[ "https://Stackoverflow.com/questions/163917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21968/" ]
163,938
<p>How many bytes would an int contain and how many would a long contain?</p> <p>Context:</p> <ul> <li>C++</li> <li>32 bit computer</li> <li>Any difference on a 64-bit computer?</li> </ul>
[ { "answer_id": 163976, "author": "Dave Turvey", "author_id": 18966, "author_profile": "https://Stackoverflow.com/users/18966", "pm_score": 1, "selected": false, "text": "int intBytes;\nlong longBytes;\nintBytes= sizeof(int);\nlongBytes = sizeof(long);\n" }, { "answer_id": 164013,...
2008/10/02
[ "https://Stackoverflow.com/questions/163938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
163,957
<p>I know that you can do this in SQL Server 2005, but I'm at a loss for 2000.</p>
[ { "answer_id": 166421, "author": "AJ.", "author_id": 7211, "author_profile": "https://Stackoverflow.com/users/7211", "pm_score": 0, "selected": false, "text": "SELECT crdate\nFROM sysobjects \nWHERE name = 'proc name here' \nAND type = 'P' \n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/163957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24602/" ]
163,962
<p>Up until now I have been using std::string in my C++ applications for embedded system (routers, switches, telco gear, etc.).</p> <p>For the next project, I am considering to switch from std::string to std::wstring for Unicode support. This would, for example, allow end-users to use Chinese characters in the command...
[ { "answer_id": 166421, "author": "AJ.", "author_id": 7211, "author_profile": "https://Stackoverflow.com/users/7211", "pm_score": 0, "selected": false, "text": "SELECT crdate\nFROM sysobjects \nWHERE name = 'proc name here' \nAND type = 'P' \n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/163962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21435/" ]
163,994
<p>I have a very large table (8gb) with information about files, and i need to run a report against it that would would look something like this:</p> <pre><code>(select * from fs_walk_scan where file_path like '\\\\server1\\groot$\\%' order by file_size desc limit 0,30) UNION ALL (select * from fs_walk_scan where file...
[ { "answer_id": 164009, "author": "warren", "author_id": 4418, "author_profile": "https://Stackoverflow.com/users/4418", "pm_score": 0, "selected": false, "text": "select * from fs_walk_scan where file_path like '\\\\\\\\server' and file_path like 'root$\\\\%' order by file_size desc \n" ...
2008/10/02
[ "https://Stackoverflow.com/questions/163994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17785/" ]
163,998
<p>Is there any built-in functionality for classical set operations on the java.util.Collection class? My specific implementation would be for ArrayList, but this sounds like something that should apply for all subclasses of Collection. I'm looking for something like:</p> <pre><code>ArrayList&lt;Integer&gt; setA ... A...
[ { "answer_id": 164145, "author": "Tom Hawtin - tackline", "author_id": 4725, "author_profile": "https://Stackoverflow.com/users/4725", "pm_score": 8, "selected": true, "text": "Collection.retainAll Collection.removeAll Collection.addAll Set List" }, { "answer_id": 34439881, "...
2008/10/02
[ "https://Stackoverflow.com/questions/163998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19147/" ]
164,002
<p>I am writing a C library that reads a file into memory. It skips the first 54 bytes of the file (header) and then reads the remainder as data. I use fseek to determine the length of the file, and then use fread to read in the file.</p> <p>The loop runs once and then ends because the EOF is reached (no errors). At t...
[ { "answer_id": 164012, "author": "Evan Teran", "author_id": 13430, "author_profile": "https://Stackoverflow.com/users/13430", "pm_score": 7, "selected": true, "text": "\"r+b\" \"rb\" \"r+b\" \"rb\"" }, { "answer_id": 24431357, "author": "Kumar Pushkar", "author_id": 37794...
2008/10/02
[ "https://Stackoverflow.com/questions/164002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17871/" ]
164,008
<p>Is there a connection limit on Sql Server 2005 Developers Edition. We have many threads grabbing connections, and I know ADO.NET does connection pooling, but I get OutOfMemory exceptions. We take out the db connections and it works fine. </p>
[ { "answer_id": 164016, "author": "MusiGenesis", "author_id": 14606, "author_profile": "https://Stackoverflow.com/users/14606", "pm_score": 2, "selected": false, "text": "using (SqlConnection conn = new SqlConnection(\"connectionstring\"))\n{\n conn.Open();\n\n // database access co...
2008/10/02
[ "https://Stackoverflow.com/questions/164008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11907/" ]
164,026
<p>I'd like to make sure that a thread is moved to a specific CPU core and can never be moved from it by the scheduler.</p> <p>There's a <code>SetThreadAffinityMask()</code> call but there's no <code>GetThreadAffinityMask()</code>.</p> <p>The reason I need this is because high resolution timers will get messed up if ...
[ { "answer_id": 165641, "author": "bk1e", "author_id": 8090, "author_profile": "https://Stackoverflow.com/users/8090", "pm_score": 2, "selected": false, "text": "SetThreadAffinityMask() RDTSC RDTSC QueryPerformanceCounter() QueryPerformanceCounter() QueryPerformanceCounter() RDTSC RDTSC Q...
2008/10/02
[ "https://Stackoverflow.com/questions/164026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1841/" ]
164,039
<p>How can I dock a CControlBar derived window to the middle of a splitter window (CSplitterWnd)? I would like the bar to be repositioned whenever the splitter is moved.</p> <p>To make it a little clearer as to what I'm after, imagine the vertical ruler in the Dialog Editor in Visual Studio (MFC only). It gets repos...
[ { "answer_id": 169239, "author": "Alf Zimmerman", "author_id": 24612, "author_profile": "https://Stackoverflow.com/users/24612", "pm_score": 0, "selected": false, "text": "m_wndSplitter.CreateStatic(this, 1, 3);\n\nm_wndLeftPane.Create(&m_wndSplitter,WS_CHILD|WS_VISIBLE,m_wndSplitter.IdF...
2008/10/02
[ "https://Stackoverflow.com/questions/164039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24612/" ]
164,048
<p>I'm about to start (with fellow programmers) a programming &amp; algorithms club in my high school. The language of choice is C++ - sorry about that, I can't change this. We can assume students have little to no experience in the aforementioned topics.</p> <p>What do you think are the most basic concepts I should f...
[ { "answer_id": 164470, "author": "m_pGladiator", "author_id": 446104, "author_profile": "https://Stackoverflow.com/users/446104", "pm_score": 1, "selected": false, "text": "1) Go to the Fridge \n2) Open the fridge door \n3) Search for eggs \n4) If there are no eggs - go to the shop to bu...
2008/10/02
[ "https://Stackoverflow.com/questions/164048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19082/" ]
164,053
<p>Should log classes open/close a log file stream on each write to the log file or should it keep the log file stream open throughout the application's lifetime until all logging is complete? </p> <p>I'm asking in context of a desktop application. I have seen people do it both ways and was wondering which approach ...
[ { "answer_id": 164770, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 4, "selected": false, "text": "fstat() st_nlink stat() open() fstat() O_SYNC O_DSYNC open() fflush() write() flockfile() dprintf() dprintf() wri...
2008/10/02
[ "https://Stackoverflow.com/questions/164053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20133/" ]
164,073
<p>I've been thinking about this problem for a while and have yet to come up with any stable/elegant ideas.</p> <p>I know with MyISAM tables, you can get the table def update time but thats not so true with InnoDB and I've found its not even reliable to look at the .frm file for an idea of when the definition might ha...
[ { "answer_id": 164318, "author": "Gary Richardson", "author_id": 2506, "author_profile": "https://Stackoverflow.com/users/2506", "pm_score": 2, "selected": false, "text": "mysqldump -d [gary.richardson@server ~]$ mysqldump -d -u root mysql user\n-- MySQL dump 10.11\n--\n-- Host: localhos...
2008/10/02
[ "https://Stackoverflow.com/questions/164073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9908/" ]
164,085
<p>I need to execute a callback when an IFRAME has finished loading. I have no control over the content in the IFRAME, so I can't fire the callback from there.</p> <p>This IFRAME is programmaticly created, and I need to pass its data as a variable in the callback, as well as destroy the iframe.</p> <p>Any ideas?</p> ...
[ { "answer_id": 204781, "author": "Pier Luigi", "author_id": 27789, "author_profile": "https://Stackoverflow.com/users/27789", "pm_score": 1, "selected": false, "text": "function xssRequest(url, callback)\n{\n var iFrameObj = document.createElement('IFRAME');\n iFrameObj.id = 'myUni...
2008/10/02
[ "https://Stackoverflow.com/questions/164085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
164,088
<p>When designing a collection class, is there any reason not to implement locking privately to make it thread safe? Or should I leave that responsibility up to the consumer of the collection?</p>
[ { "answer_id": 3798398, "author": "Ohad Schneider", "author_id": 67824, "author_profile": "https://Stackoverflow.com/users/67824", "pm_score": 3, "selected": false, "text": "static int GetFirstOrDefault(ThreadSafeList<int> list) {\n if (list.Count > 0) {\n return list[0];\n ...
2008/10/02
[ "https://Stackoverflow.com/questions/164088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11574/" ]
164,093
<p>in a C program I have an long* that I want to serialize (thus converting to chars). A long doesn't fit in a single char, and the size varies depending of the processor (can be 4 bytes or 8 bytes).</p> <p>Theres a good way to make the serialization and de-serialization? </p>
[ { "answer_id": 164115, "author": "warren", "author_id": 4418, "author_profile": "https://Stackoverflow.com/users/4418", "pm_score": 0, "selected": false, "text": "long list[MAX];\nchar *serial = list;\nint chunk = sizeof(long);\nint k;\nfor(k=0; k<(MAX*chunk); k++){\n // do something wi...
2008/10/02
[ "https://Stackoverflow.com/questions/164093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18403/" ]
164,095
<p>I'm writing a DSL in Ruby to control an Arduino project I'm working on; Bardino. It's a bar monkey that will be software controlled to serve drinks. The Arduino takes commands via the serial port to tell the Arduino what pumps to turn on and for how long.</p> <p>It currently reads a recipe (see below) and prints ...
[ { "answer_id": 164358, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 4, "selected": true, "text": "describe \"Long Island Iced Tea\" do\n serve_in 'Highball Glass'\n\n ingredients do\n half.ounce.of :vodka\n half...
2008/10/02
[ "https://Stackoverflow.com/questions/164095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23909/" ]
164,102
<p>For example, suppose I have a class:</p> <pre><code>class Foo { public: std::string&amp; Name() { m_maybe_modified = true; return m_name; } const std::string&amp; Name() const { return m_name; } protected: std::string m_name; bool m_maybe_modified; }; </code>...
[ { "answer_id": 164130, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 5, "selected": true, "text": "a const Foo *" }, { "answer_id": 164139, "author": "Lev", "author_id": 7224, "author_profile": "https://Sta...
2008/10/02
[ "https://Stackoverflow.com/questions/164102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9876/" ]
164,105
<p>I'm trying to write a Selenium test for a web page that uses an onbeforeunload event to prompt the user before leaving. Selenium doesn't seem to recognize the confirmation dialog that comes up, or to provide a way to hit OK or Cancel. Is there any way to do this? I'm using the Java Selenium driver, if that's relevan...
[ { "answer_id": 26787603, "author": "Louis", "author_id": 1906307, "author_profile": "https://Stackoverflow.com/users/1906307", "pm_score": 1, "selected": false, "text": "onbeforeunload driver.switch_to.alert.accept()\n driver.switchTo().alert().accept();\n NoAlertPresentException window....
2008/10/02
[ "https://Stackoverflow.com/questions/164105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13210/" ]
164,144
<p>I have two DataTables, <code>A</code> and <code>B</code>, produced from CSV files. I need to be able to check which rows exist in <code>B</code> that do not exist in <code>A</code>.</p> <p>Is there a way to do some sort of query to show the different rows or would I have to iterate through each row on each DataTab...
[ { "answer_id": 164200, "author": "MusiGenesis", "author_id": 14606, "author_profile": "https://Stackoverflow.com/users/14606", "pm_score": 3, "selected": false, "text": "A.Merge(B); // this will add to A any records that are in B but not A\nreturn A.GetChanges(); // returns records origi...
2008/10/02
[ "https://Stackoverflow.com/questions/164144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6486/" ]
164,147
<p>As far as I can tell there's no simple way of retrieving a character offset from a TextRange object in Internet Explorer. The W3C Range object has a node, and the offset into the text within that node. IE seems to just have pixel offsets. There are methods to create, extend and compare ranges, so it would be possibl...
[ { "answer_id": 164347, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 1, "selected": false, "text": "TextRange.text String.substring() function charOffset(textRange, parentTextRange)\n { var parentTxt = parentTextRange.te...
2008/10/02
[ "https://Stackoverflow.com/questions/164147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24618/" ]
164,154
<p>I want to tune a production SQL server. After making adjustments (such as changing the degree of parallelism) I want to know if it helped or hurt query execution times.</p> <p>This seems like an obvious performance counter, but for the last half hour I've been searching Google and the counter list in perfmon, and ...
[ { "answer_id": 6338261, "author": "Jason Jong", "author_id": 209254, "author_profile": "https://Stackoverflow.com/users/209254", "pm_score": 1, "selected": false, "text": "File Save As Trace Table select avg(duration) from dbo.[YourTableImportName] \n" }, { "answer_id": 60148054,...
2008/10/02
[ "https://Stackoverflow.com/questions/164154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15118/" ]
164,163
<p>When implementing Quicksort, one of the things you have to do is to choose a pivot. But when I look at pseudocode like the one below, it is not clear how I should choose the pivot. First element of list? Something else?</p> <pre><code> function quicksort(array) var list less, greater if length(array) ≤ 1 ...
[ { "answer_id": 237070, "author": "mindvirus", "author_id": 31455, "author_profile": "https://Stackoverflow.com/users/31455", "pm_score": 4, "selected": false, "text": "T(n) = O(n) (find the median) + O(n) (partition) + 2T(n/2) (recurse left and right)\n" }, { "answer_id": 5254733...
2008/10/02
[ "https://Stackoverflow.com/questions/164163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20032/" ]
164,167
<p>Warning: this is the actual code generated from my system:</p> <pre><code>;WITH RESULTS AS ( SELECT 1174 AS BatchRunID, 'STATINV' AS Program, m.APPL_CD, m.ALBASE, 'CountFocusRecords' AS Measure, COUNT(*) AS Value FROM [MISWork].[SX_FOCUS_NATIVE_200806] AS m WITH(NOLOCK) INNER JOIN MISProcess.SXProcessCatalog AS cat...
[ { "answer_id": 219012, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 0, "selected": false, "text": "<?xml version=\"1.0\"?>\n<ShowPlanXML xmlns=\"http://schemas.microsoft.com/sqlserver/2004/07/showplan\" Version=\"1.0\" ...
2008/10/02
[ "https://Stackoverflow.com/questions/164167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18255/" ]
164,168
<p>If I want to construct a std::string with a line like:</p> <pre><code>std::string my_string("a\0b"); </code></pre> <p>Where i want to have three characters in the resulting string (a, null, b), I only get one. What is the proper syntax?</p>
[ { "answer_id": 164185, "author": "17 of 26", "author_id": 2284, "author_profile": "https://Stackoverflow.com/users/2284", "pm_score": 4, "selected": false, "text": "std::string my_string(\"a\\0b\", 3);\n" }, { "answer_id": 164211, "author": "Jurney", "author_id": 2642, ...
2008/10/02
[ "https://Stackoverflow.com/questions/164168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17958/" ]
164,181
<p>How can I fetch images from a server?</p> <p>I've got this bit of code which allows me to draw some images on a canvas.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; function draw(){ var canvas = document.getElementById('canv'); var ctx = canvas.getConte...
[ { "answer_id": 164191, "author": "Eric Schoonover", "author_id": 3957, "author_profile": "https://Stackoverflow.com/users/3957", "pm_score": 6, "selected": true, "text": "myimage = new Image();\nmyimage.src = 'http://myserver/nextimage.cgi';\n myimage = new Image();\nmyimage.onload = fun...
2008/10/02
[ "https://Stackoverflow.com/questions/164181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/116/" ]
164,194
<p>The following code receives seg fault on line 2:</p> <pre><code>char *str = "string"; str[0] = 'z'; // could be also written as *str = 'z' printf("%s\n", str); </code></pre> <p>While this works perfectly well:</p> <pre><code>char str[] = "string"; str[0] = 'z'; printf("%s\n", str); </code></pre> <p>Tested with ...
[ { "answer_id": 164227, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": false, "text": "\"whatever\" const char *" }, { "answer_id": 164229, "author": "Greg Hewgill", "author_id": 893, "author_p...
2008/10/02
[ "https://Stackoverflow.com/questions/164194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24622/" ]
164,197
<p>I am working on an ASP.Net web application that must print dynamically created labels on standard Avery-style label sheets (one particular size, so only one overall layout). The labels have a variable number of lines (3-6) and may contain either lines of text or a graphic barcode image.</p> <p>Our first cut, that I...
[ { "answer_id": 33681423, "author": "Bill Rawlinson", "author_id": 7329, "author_profile": "https://Stackoverflow.com/users/7329", "pm_score": 2, "selected": false, "text": "LabelDefinition" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/164197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14894/" ]
164,282
<p>Specifically, we've got some external JavaScript tracking code on our sites that throws itself into an infinite loop each time an anchor is clicked on.</p> <p>We don't maintain the tracking code, so we don't know exactly how it works. Since the code causes the browser to lock up almost immediately, I was wondering...
[ { "answer_id": 33681423, "author": "Bill Rawlinson", "author_id": 7329, "author_profile": "https://Stackoverflow.com/users/7329", "pm_score": 2, "selected": false, "text": "LabelDefinition" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/164282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22468/" ]
164,284
<p>I would like to transfer a text file to a webserver using wininet as if the file was being transferred using a web form that posts the file to the server.</p> <p>Based on answers I've received I've tried the following code:</p> <pre><code> static TCHAR hdrs[] = "Content-Type: multipart/form-data\nContent-Length: 2...
[ { "answer_id": 164502, "author": "Gustavo Carreno", "author_id": 8167, "author_profile": "https://Stackoverflow.com/users/8167", "pm_score": 2, "selected": false, "text": "POST /file_upload.php HTTP/1.0\nContent-type: multipart/form-data\nContent-length: <calculated string's length: inte...
2008/10/02
[ "https://Stackoverflow.com/questions/164284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24628/" ]
164,305
<p>I'm using CodeSynthesis XSD C++/Tree Mapping utility to convert an existing xsd into c++ code we can populate the values in. This was we always make sure we follow the schema.</p> <p>After doing the conversion, I'm trying to get it to work so I can test it. Problem is, I'm not used to doing this in c++ and it's m...
[ { "answer_id": 168157, "author": "Max Lybbert", "author_id": 10593, "author_profile": "https://Stackoverflow.com/users/10593", "pm_score": 3, "selected": true, "text": "::xml_schema::time t();\n ::xml_schema::time t;\n ::xml_schema::time ABSTRACTNETWORKMODEL ::xml_schema::time t();\nABST...
2008/10/02
[ "https://Stackoverflow.com/questions/164305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23553/" ]
164,307
<p>With the MacPorts version of ImageMagick 6.4.4 installed, I'm getting an error installing the RMagick gem.</p> <pre><code>/opt/local/bin/ruby extconf.rb update rmagick checking for Ruby version &gt;= 1.8.2... yes checking for /usr/bin/gcc-4.0... yes checking for Magick-config... no Can't install RMagick 2.7.0. Can'...
[ { "answer_id": 165656, "author": "user6325", "author_id": 6325, "author_profile": "https://Stackoverflow.com/users/6325", "pm_score": 3, "selected": false, "text": "sudo port install tiff -macosx imagemagick +q8 +gs +wmf\n" }, { "answer_id": 1476485, "author": "ehaselwanter",...
2008/10/02
[ "https://Stackoverflow.com/questions/164307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11078/" ]
164,319
<p>I learned something simple about SQL the other day:</p> <pre><code>SELECT c FROM myTbl GROUP BY C </code></pre> <p>Has the same result as:</p> <pre><code>SELECT DISTINCT C FROM myTbl </code></pre> <p>What I am curious of, is there anything different in the way an SQL engine processes the command, or are they tru...
[ { "answer_id": 164329, "author": "Andru Luvisi", "author_id": 5922, "author_profile": "https://Stackoverflow.com/users/5922", "pm_score": 8, "selected": false, "text": "GROUP BY AVG MAX MIN SUM COUNT DISTINCT SELECT department, SUM(amount) FROM purchases GROUP BY department\n amount" }...
2008/10/02
[ "https://Stackoverflow.com/questions/164319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5836/" ]
164,324
<p>I need to get the Folder size and display the info on a report (SSRS). I need to do this for a number of Databases (loop!). These DB's are websites' backends.</p> <p>Are any samples available for this? Does xp_filesize and the like the right solution?</p>
[ { "answer_id": 179648, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 1, "selected": false, "text": "System.IO.Directory" }, { "answer_id": 186836, "author": "Meff", "author_id": 9647, "author_profile": ...
2008/10/02
[ "https://Stackoverflow.com/questions/164324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10385/" ]
164,335
<p>Any XPath like /NodeName/position() would give you the position of the Node w.r.t it's parent node.</p> <p>There is no method on the XElement (Linq to XML) object that can get the position of the Element. Is there?</p>
[ { "answer_id": 164444, "author": "Michael Damatov", "author_id": 23372, "author_profile": "https://Stackoverflow.com/users/23372", "pm_score": 0, "selected": false, "text": "static int Position(this XNode node) {\n var position = 0;\n foreach(var n in node.Parent.Nodes()) {\n if(n =...
2008/10/02
[ "https://Stackoverflow.com/questions/164335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1747/" ]
164,342
<p>I'm considering one of two IRepository interfaces, one that is a descendant of IQueryable and one that contains IQueryable. </p> <p>Like this:</p> <pre><code>public interface IRepository&lt;T&gt; : IQueryable&lt;T&gt; { T Save(T entity); void Delete(T entity); } </code></pre> <p>Or this:</p> <pre><code>p...
[ { "answer_id": 5319662, "author": "Pure.Krome", "author_id": 30674, "author_profile": "https://Stackoverflow.com/users/30674", "pm_score": 3, "selected": false, "text": "Repository Pattern IQueryable public interface IRepository<T>\n{\n IQueryable<T> Find();\n void Save(T entity);\...
2008/10/02
[ "https://Stackoverflow.com/questions/164342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3759/" ]
164,343
<p>I'm playing around with BCEL. I'm not using it to generate bytecode, but instead I'm trying to inspect the structure of existing compiled classes.</p> <p>I need to be able to point to an arbitrary .class file anywhere on my hard drive and load a <a href="http://jakarta.apache.org/bcel/apidocs/org/apache/bcel/class...
[ { "answer_id": 10858280, "author": "ILOVEPIE", "author_id": 1164259, "author_profile": "https://Stackoverflow.com/users/1164259", "pm_score": 2, "selected": false, "text": "new ClassParser(classfilebytearrayhere).parse()\n" }, { "answer_id": 32984765, "author": "JITHIN_PATHRO...
2008/10/02
[ "https://Stackoverflow.com/questions/164343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1247/" ]
164,344
<p>How can I make my <code>std::fstream</code> object start reading a text file from the second line?</p>
[ { "answer_id": 164353, "author": "Doug T.", "author_id": 8123, "author_profile": "https://Stackoverflow.com/users/8123", "pm_score": 5, "selected": false, "text": "ifstream stream(\"filename.txt\");\nstring dummyLine;\ngetline(stream, dummyLine);\n// Begin reading your stream here\nwhile...
2008/10/02
[ "https://Stackoverflow.com/questions/164344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
164,356
<p>For example, I'm writing a multi-threaded time-critical application that processes and streams audio in real-time. Interruptions in the audio are totally unacceptable. Does this mean I cannot use the STL because of the potential slow down when an exception is thrown? </p>
[ { "answer_id": 164423, "author": "Henk", "author_id": 4613, "author_profile": "https://Stackoverflow.com/users/4613", "pm_score": 1, "selected": false, "text": "std::vector::at() Project Properties -> C/C++ -> Code Generation -> Enable C++ Exceptions" }, { "answer_id": 1281627, ...
2008/10/02
[ "https://Stackoverflow.com/questions/164356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13760/" ]
164,369
<p>While I'm googling/reading for this answer I thought I would also ask here. </p> <p>I have a class that is a wrapper for a SDK. The class accepts an ILoader object and uses the ILoader object to create an ISBAObject which is cast into an ISmallBusinessInstance object. I am simply trying to mock this behavior usin...
[ { "answer_id": 169182, "author": "Trevor Abell", "author_id": 2916, "author_profile": "https://Stackoverflow.com/users/2916", "pm_score": 2, "selected": false, "text": "[TestMethod]\npublic void Test_Customer_GetByID()\n{\n var mock = new Mock<ILoader>();\n\n var sbainst = new Mock...
2008/10/02
[ "https://Stackoverflow.com/questions/164369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2916/" ]
164,382
<p>We've been creating banners using the getURL linking method (in a blank window). For many people, it works just fine. You click the banner and are taken to our site. For others (me included), clicking the flash object triggers a pop-up warning in FireFox (both 2 and 3, default settings). The weird thing is that it d...
[ { "answer_id": 615018, "author": "Pascal Immerzeel", "author_id": 1729, "author_profile": "https://Stackoverflow.com/users/1729", "pm_score": 0, "selected": false, "text": "private function click(event : MouseEvent) : void {\n getURL(LoaderInfo(root.loaderInfo).parameters.clic kTag);\...
2008/10/02
[ "https://Stackoverflow.com/questions/164382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24632/" ]
164,393
<p>In the quest for localization I need to find all the string literals littered amongst our source code. I was looking for a way to script this into a post-modification source repository check. (I.E. after some one checks something in have a box setup to check this stat) I'll probably use NAnt and CruiseControl or som...
[ { "answer_id": 164439, "author": "Duncan Smart", "author_id": 1278, "author_profile": "https://Stackoverflow.com/users/1278", "pm_score": 6, "selected": true, "text": ":q ((\\\".+?\\\")|('.+?'))" }, { "answer_id": 29919882, "author": "gleichdanke", "author_id": 715724, ...
2008/10/02
[ "https://Stackoverflow.com/questions/164393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13688/" ]
164,395
<p>I'm wondering if its possible to add new class data members at run-time in PHP?</p>
[ { "answer_id": 164418, "author": "Andru Luvisi", "author_id": 5922, "author_profile": "https://Stackoverflow.com/users/5922", "pm_score": 5, "selected": true, "text": "$prop = 'newname';\n$obj->$prop = 42;\n $obj->newname = 42;\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/164395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10708/" ]
164,397
<p>How can I print a message to the error console, preferably including a variable? </p> <p>For example, something like:</p> <pre><code>print('x=%d', x); </code></pre>
[ { "answer_id": 164408, "author": "Dan", "author_id": 17121, "author_profile": "https://Stackoverflow.com/users/17121", "pm_score": 10, "selected": true, "text": "console.log(...) console.debug(...)" }, { "answer_id": 3060267, "author": "Ivo Danihelka", "author_id": 101097...
2008/10/02
[ "https://Stackoverflow.com/questions/164397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/116/" ]
164,414
<p>I'm processing a file, line-by-line, and I'd like to do an inverse match. For instance, I want to match lines where there is a string of six letters, but only if these six letters are not '<em>Andrea</em>'. How should I do that?</p> <p>I'm using <a href="https://en.wikipedia.org/wiki/RegexBuddy" rel="noreferrer">Re...
[ { "answer_id": 164419, "author": "Dan", "author_id": 17121, "author_profile": "https://Stackoverflow.com/users/17121", "pm_score": 8, "selected": true, "text": "(?!Andrea).{6}\n [A-Za-z]{6} .{6}" }, { "answer_id": 164440, "author": "Vinko Vrsalovic", "author_id": 5190, ...
2008/10/02
[ "https://Stackoverflow.com/questions/164414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21384/" ]
164,425
<p>I am building a fun little app to determine if I should bike to work.</p> <p>I would like to test to see if it is either Raining or Thunderstorm(ing).</p> <pre><code>public enum WeatherType : byte { Sunny = 0, Cloudy = 1, Thunderstorm = 2, Raining = 4, Snowing = 8, MostlyCloudy = 16 } </code></pre> <p>I was think...
[ { "answer_id": 164455, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 5, "selected": true, "text": "if ((currentWeather.Type & _badWeatherTypes) == _badWeatherTypes)\n if ((currentWeather.Type & _badWeatherTypes) != 0)\n ...
2008/10/02
[ "https://Stackoverflow.com/questions/164425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18821/" ]
164,427
<p>I've made a Django site, but I've drank the Koolaid and I want to make an <em>IPhone</em> version. After putting much thought into I've come up with two options:</p> <ol> <li>Make a whole other site, like i.xxxx.com. Tie it into the same database using Django's sites framework.</li> <li>Find some time of middlewa...
[ { "answer_id": 3487254, "author": "Aneil Mallavarapu", "author_id": 305149, "author_profile": "https://Stackoverflow.com/users/305149", "pm_score": 4, "selected": false, "text": "import re\nMOBILE_AGENT_RE=re.compile(r\".*(iphone|mobile|androidtouch)\",re.IGNORECASE)\nclass MobileMiddlew...
2008/10/02
[ "https://Stackoverflow.com/questions/164427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24630/" ]
164,460
<p>The standalone flashplayer takes no arguments other than a .swf file when you launch it from the command line. I need the player to go full screen, no window borders and such. This can be accomplished by hitting ctrl+f once the program has started. I want to do this programmatically as I need it to launch into full ...
[ { "answer_id": 277865, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "nspluginplayer --fullscreen src=path/to/flashfile.swf\n" }, { "answer_id": 3994891, "author": "Daniel", "autho...
2008/10/02
[ "https://Stackoverflow.com/questions/164460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11176/" ]
164,468
<p>The IT department of a subsidiary of ours had a consulting company write them an ASP.NET application. Now it's having intermittent problems with mixing up who the current user is and has been known to show Joe some of Bob's data by mistake.</p> <p>The consultants were brought back to troubleshoot and we were invit...
[ { "answer_id": 164530, "author": "Duncan Smart", "author_id": 1278, "author_profile": "https://Stackoverflow.com/users/1278", "pm_score": 0, "selected": false, "text": "try..catch y ArgumentOutOfRangeException" }, { "answer_id": 164565, "author": "Mike Stone", "author_id"...
2008/10/02
[ "https://Stackoverflow.com/questions/164468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12260/" ]
164,496
<p>I've been reading about thread-safe singleton patterns here:</p> <p><a href="http://en.wikipedia.org/wiki/Singleton_pattern#C.2B.2B_.28using_pthreads.29" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Singleton_pattern#C.2B.2B_.28using_pthreads.29</a></p> <p>And it says at the bottom that the only safe way...
[ { "answer_id": 164534, "author": "Matthew Murdoch", "author_id": 4023, "author_profile": "https://Stackoverflow.com/users/4023", "pm_score": 4, "selected": false, "text": "// A critical section guard - create on the stack to provide \n// automatic locking/unlocking even in the face of un...
2008/10/02
[ "https://Stackoverflow.com/questions/164496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/986/" ]
164,520
<p><strong>Premise:</strong> Usually during preparation of a new Ruby on Rails App, I draw out models and relations regarding user navigations. Usually I hit a place where I need to ask myself, whether or not I should go beyond the usual "rule of thumb" of nesting no more 1 level deep. Sometimes I feel the need to nest...
[ { "answer_id": 164875, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 2, "selected": false, "text": "users/:user_id/companies/:company_id/locations/\n user_company_location_path( user_id, company_id, location_id )\n" },...
2008/10/02
[ "https://Stackoverflow.com/questions/164520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24393/" ]
164,527
<p>In .NET, if a class contains a member that is a class object, should that member be exposed as a property or with a method?</p>
[ { "answer_id": 164553, "author": "bdukes", "author_id": 2688, "author_profile": "https://Stackoverflow.com/users/2688", "pm_score": 5, "selected": false, "text": "public string Name\nget \n{\n return name;\n}\nset \n{\n name = value;\n}\n Type type = // Get a type.\nfor (int i = 0;...
2008/10/02
[ "https://Stackoverflow.com/questions/164527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19065/" ]
164,564
<p>Edit: Ryan raised a good point. I specifically want to be able to map to and from while still storing human-readable values in the database. That is, I don't want a bunch of enumeration integers in my database.</p>
[ { "answer_id": 214276, "author": "kͩeͣmͮpͥ ͩ", "author_id": 26479, "author_profile": "https://Stackoverflow.com/users/26479", "pm_score": 0, "selected": false, "text": "<property name=\"EnumProperty\" Type=\"string\" Length=\"50\" NotNull=\"true\" />\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/164564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
164,575
<p>I'm writing out XML files using the MSXML parser, with a wrapper I downloaded from here: <a href="http://www.codeproject.com/KB/XML/JW_CXml.aspx" rel="noreferrer">http://www.codeproject.com/KB/XML/JW_CXml.aspx</a>. Works great except that when I create a new document from code (so not load from file and modify), the...
[ { "answer_id": 164662, "author": "Torlack", "author_id": 5243, "author_profile": "https://Stackoverflow.com/users/5243", "pm_score": 3, "selected": true, "text": "#include <msxml2.h>\n\nbool FormatDOMDocument (IXMLDOMDocument *pDoc, IStream *pStream)\n{\n\n // Create the writer\n\n ...
2008/10/02
[ "https://Stackoverflow.com/questions/164575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11449/" ]
164,585
<p>I'm serializing an object in a C# VS2003 / .Net 1.1 application. I need it serialized without the processing instruction, however. The XmlSerializer class puts out something like this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-16" ?&gt; &lt;MyObject&gt; &lt;Property1&gt;Data&lt;/Property1&gt; &lt...
[ { "answer_id": 164604, "author": "harpo", "author_id": 4525, "author_profile": "https://Stackoverflow.com/users/4525", "pm_score": 0, "selected": false, "text": "XmlSerializer serializer = new XmlSerializer(typeof(MyObject));\nStringBuilder builder = new StringBuilder();\nXmlWriterSettin...
2008/10/02
[ "https://Stackoverflow.com/questions/164585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24222/" ]
164,594
<p>I have a c# application that interfaces with the database only through stored procedures. I have tried various techniques for calling stored procedures. At the root is the SqlCommand class, however I would like to achieve several things:</p> <ul> <li>make the interface between c# and sql smoother, so that procedure...
[ { "answer_id": 164637, "author": "Micky McQuade", "author_id": 12908, "author_profile": "https://Stackoverflow.com/users/12908", "pm_score": 2, "selected": false, "text": "Public Shared Function GetOrg(ByVal OrgID As Integer) As System.Data.DataSet\n Return db.ExecuteDataSet(\"dbo.cp_...
2008/10/02
[ "https://Stackoverflow.com/questions/164594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13855/" ]
164,597
<p>My server has both Subversion and Apache installed, and the Apache web directory is also a Subversion working copy. The reason for this is that the simple command <code>svn update /server/staging</code> will deploy the latest source to the staging server.</p> <p>Apache public web directory: <code>/server/staging</c...
[ { "answer_id": 164646, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 0, "selected": false, "text": "svnserve svn:// svn update /server/staging" }, { "answer_id": 164654, "author": "zappan", "author_id": 47...
2008/10/02
[ "https://Stackoverflow.com/questions/164597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326176/" ]
164,613
<p>I've heard the advice that you should avoid try catch blocks if possible since they're expensive.</p> <p>My question is specifically about the .NET platform: Why are try blocks expensive?</p> <p><strong>Summary of Responses:</strong></p> <p>There are clearly two camps on this issue: those that say that try blocks ar...
[ { "answer_id": 165352, "author": "Michael Petrotta", "author_id": 23897, "author_profile": "https://Stackoverflow.com/users/23897", "pm_score": 2, "selected": false, "text": "using System;\nusing System.Diagnostics;\n\nnamespace Test\n{\n class Program\n {\n static void Main...
2008/10/02
[ "https://Stackoverflow.com/questions/164613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/781/" ]
164,621
<p>I need to create reports in a C# .NET Windows app. I've got an SQL Server 2005 database, Visual Studio 2005 and am quite OK with creating stored procedures and datasets.</p> <p>Can someone please point me in the right direction for creating reports? I just can't seem work it out. Some examples would be a good start...
[ { "answer_id": 165003, "author": "SeaDrive", "author_id": 19267, "author_profile": "https://Stackoverflow.com/users/19267", "pm_score": 1, "selected": false, "text": "AcctStatement oRpt = new AcctStatement() ;\noRpt.Database.Tables[0].SetDataSource(dsRpt.Tables[0]);\noRpt.SetParameterVal...
2008/10/02
[ "https://Stackoverflow.com/questions/164621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18854/" ]
164,630
<p>My app open file in subdirectory of directory where it is executed, subdirectory is called <code>sample</code> and it contains files:</p> <ul> <li><code>example.raf</code> (example extension, non significant)</li> <li><code>background.gif</code></li> </ul> <p><code>example.raf</code> contains relative path to <cod...
[ { "answer_id": 164667, "author": "Bob King", "author_id": 6897, "author_profile": "https://Stackoverflow.com/users/6897", "pm_score": 1, "selected": false, "text": "string parentPath = Directory.GetParent(rafFilePath);\nstring imagePath = Path.Combine(parentPath, imageFileNameFromRaf);\n...
2008/10/02
[ "https://Stackoverflow.com/questions/164630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
164,642
<p>How do I create a grails war file so that it doesn't have the version number</p> <p>(e.g. foo-0.1.war) </p> <p>attached to the end when I execute the 'grails war' command?</p>
[ { "answer_id": 164702, "author": "Instantsoup", "author_id": 9861, "author_profile": "https://Stackoverflow.com/users/9861", "pm_score": 6, "selected": true, "text": "grails war foo.war\n" }, { "answer_id": 223603, "author": "Ken Gentle", "author_id": 8709, "author_pr...
2008/10/02
[ "https://Stackoverflow.com/questions/164642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
164,643
<p>In my C# source code I may have declared integers as:</p> <pre><code>int i = 5; </code></pre> <p>or</p> <pre><code>Int32 i = 5; </code></pre> <p>In the currently prevalent 32-bit world they are equivalent. However, as we move into a 64-bit world, am I correct in saying that the following will become the same?</p...
[ { "answer_id": 164650, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 7, "selected": true, "text": "int System.Int32" }, { "answer_id": 164692, "author": "Mark Cidade", "author_id": 1659, "author_profi...
2008/10/02
[ "https://Stackoverflow.com/questions/164643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463/" ]
164,645
<p>Is there any way that I can change how a Literal of a code snippet renders when it is used in the code that the snippet generates?</p> <p>Specifically I'd like to know if I can have a literal called say, $PropertyName$ and then get the snippet engine to render "_$PropertyName$ where the first character is made lowe...
[ { "answer_id": 18289183, "author": "fred", "author_id": 2692059, "author_profile": "https://Stackoverflow.com/users/2692059", "pm_score": 3, "selected": false, "text": "string m_$name$;\nstring $name$\n{\n get{return m_$name$;}\n set{m_$name$=value;}\n};\n" }, { "answer_id": 4778...
2008/10/02
[ "https://Stackoverflow.com/questions/164645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19452/" ]
164,697
<p>I am a little confused about null values and variables in .NET. (VB preferred)</p> <p>Is there any way to check the "nullness" of ANY given variable regardless of whether it was an object or a value type? Or does my null check have to always anticipate whether it's checking a value type (e.g. System.Integer) or an ...
[ { "answer_id": 164706, "author": "Bob King", "author_id": 6897, "author_profile": "https://Stackoverflow.com/users/6897", "pm_score": 2, "selected": false, "text": "Dim i as Nullable(Of Integer) = Nothing '.NET 2.0/3.0'\nDim j as Integer? = Nothing '.NET 3.5'\n" }, { "answer_id":...
2008/10/02
[ "https://Stackoverflow.com/questions/164697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17235/" ]
164,714
<p>I just want to know the best way to emulate a C# style enumeration in Ruby.</p>
[ { "answer_id": 164810, "author": "Ris Adams", "author_id": 15683, "author_profile": "https://Stackoverflow.com/users/15683", "pm_score": 2, "selected": false, "text": "class WindowState\n Open = 1\n Closed = 2\n Max = 3\n Min = 4\nend\n" }, { "answer_id": 164833, "author"...
2008/10/02
[ "https://Stackoverflow.com/questions/164714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20714/" ]
164,727
<p>How do you return values or structures from a Popup window in Powerbuilder 9.0? The CloseWithReturn is only valid for Response windows and thus is not available. When I set a value to the Message.PowerObjectParm, the value becomes null when the Popup window closes. I need to use a Popup window so the user can click ...
[ { "answer_id": 165584, "author": "Doug Porter", "author_id": 4311, "author_profile": "https://Stackoverflow.com/users/4311", "pm_score": 3, "selected": true, "text": "w_my_parent_window_name.istr_my_structure = lstr_my_structure\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/164727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4466/" ]
164,736
<p>I am trying to call php-cgi.exe from a .NET program. I use RedirectStandardOutput to get the output back as a stream but the whole thing is very slow.</p> <p>Do you have any idea on how I can make that faster? Any other technique?</p> <pre><code> Dim oCGI As ProcessStartInfo = New ProcessStartInfo() oCGI.Wo...
[ { "answer_id": 2268137, "author": "Jader Dias", "author_id": 48465, "author_profile": "https://Stackoverflow.com/users/48465", "pm_score": 4, "selected": false, "text": "private void Redirect(StreamReader input, TextBox output)\n{\n new Thread(a =>\n {\n var buffer = new cha...
2008/10/02
[ "https://Stackoverflow.com/questions/164736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1508/" ]
164,751
<p>I have a dialog that resizes. It also has a custom background which I paint in response to a WM_ERASEBKGND call (currently a simple call to FillSolidRect). </p> <p>When the dialog is resized, there is tremendous flickering going on. To try and reduce the flickering I enumerate all child windows and add them to t...
[ { "answer_id": 164766, "author": "Frank Krueger", "author_id": 338, "author_profile": "https://Stackoverflow.com/users/338", "pm_score": 2, "selected": false, "text": "CLIPCHILDREN" }, { "answer_id": 164977, "author": "Adam Pierce", "author_id": 5324, "author_profile"...
2008/10/02
[ "https://Stackoverflow.com/questions/164751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7442/" ]
164,767
<pre><code>$array = explode(&quot;.&quot;, $row[copy]); $a = $array.length -1; </code></pre> <p>I want to return the last element of this array but all i get from this is -1.</p>
[ { "answer_id": 164781, "author": "benzado", "author_id": 10947, "author_profile": "https://Stackoverflow.com/users/10947", "pm_score": 0, "selected": false, "text": "$index = count($array) - 1;\n$a = $array[$index];\n" }, { "answer_id": 164785, "author": "Jonathan Lonowski", ...
2008/10/02
[ "https://Stackoverflow.com/questions/164767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
164,789
<p>I am trying to do a Windows Forms application in an MVP style and - not having done much with threading before - am getting all confused.</p> <p>My UI is a set of very simple forms. Each of the forms implements an interface and contains a reference to a mediator class which lives in the Business Logic Layer and vi...
[ { "answer_id": 166782, "author": "McKenzieG1", "author_id": 3776, "author_profile": "https://Stackoverflow.com/users/3776", "pm_score": 0, "selected": false, "text": "Control.Invoke() Forms.Timer" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/164789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
164,792
<p>From the documentation, I would expect adModeShareDenyWrite to be the way, but it's not working right.</p> <p>I'm using an Access database via ADO. My connection string says Mode=8, which is adModeShareDenyWrite. But when I try to delete a row from a table, I get:</p> <p>Unspecified error, Description:Could no...
[ { "answer_id": 164900, "author": "Philippe Grondier", "author_id": 11436, "author_profile": "https://Stackoverflow.com/users/11436", "pm_score": 0, "selected": false, "text": "(where you have a user object with a '.role' property, or anything equivalent ...)\nif activeUser.role = \"admin...
2008/10/02
[ "https://Stackoverflow.com/questions/164792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9328/" ]
164,808
<p>I've got an issue when accessing a web site, I can access it by using the NetBIOS name, but when accessing with the FQDN i get an error. </p> <p>Any ideas on how to troubleshoot this?</p> <p>(There is no DNS configured yet, we have modified the Hosts file to enter the related names and IP.)</p>
[ { "answer_id": 164907, "author": "dragonmantank", "author_id": 204, "author_profile": "https://Stackoverflow.com/users/204", "pm_score": 0, "selected": false, "text": "192.168.100.5 othermachine othermachine.mydomain.local\n" }, { "answer_id": 1207527, "author": "Jason Musgro...
2008/10/02
[ "https://Stackoverflow.com/questions/164808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19159/" ]
164,839
<p>Every time I try to create a new project or solution in visual studio (2005 and 2008), I get an error saying, "Project Creation failed." I even tried running vs in administrative mode, but I still get the same answer. Anyone have any suggestions, in short of uninstalling all of VS and reinstalling it?</p>
[ { "answer_id": 164860, "author": "Forgotten Semicolon", "author_id": 1960, "author_profile": "https://Stackoverflow.com/users/1960", "pm_score": 1, "selected": false, "text": "devenv.exe /SafeMode\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/164839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21745/" ]
164,847
<p>Vi and Vim allow for really awesome customization, typically stored inside a <code>.vimrc</code> file. Typical features for a programmer would be syntax highlighting, smart indenting and so on.</p> <p><strong>What other tricks for productive programming have you got, hidden in your .vimrc?</strong></p> <p>I am mos...
[ { "answer_id": 164866, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 6, "selected": false, "text": "]p p" }, { "answer_id": 164867, "author": "Harley Holcombe", "author_id": 1057, "author_profile": "ht...
2008/10/02
[ "https://Stackoverflow.com/questions/164847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7028/" ]
164,855
<p>I have a an HTML form which contains the YAHOO rich text editor on it.</p> <p>When I display the form I want the YAHOO editor to have focus so that the cursor is ready to accept input without the user having to click on it or tab into it</p>
[ { "answer_id": 174050, "author": "pmg", "author_id": 25324, "author_profile": "https://Stackoverflow.com/users/25324", "pm_score": 0, "selected": false, "text": "window.onload id=\"yahoo_text_editor\" <body onload=\"document.getElementById('yahoo_text_editor').focus()\">\n" }, { ...
2008/10/02
[ "https://Stackoverflow.com/questions/164855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15352/" ]
164,858
<p>The following snippet of C# code:</p> <pre><code> int i = 1; string result = String.Format("{0},{1},{2}", i++, i++, i++); Console.WriteLine(result); </code></pre> <p>writes out: 1,2,3</p> <p>Before I tried this in the compiler I was expecting the assignments to take place and then the evaluations, so my expe...
[ { "answer_id": 164908, "author": "Jacob Krall", "author_id": 3140, "author_profile": "https://Stackoverflow.com/users/3140", "pm_score": 3, "selected": true, "text": "i++ i i ++ // assume this function is defined:\nint Inc(ref int i)\n{\n var old = i;\n i = i + 1;\n return old;\n}\n\n...
2008/10/02
[ "https://Stackoverflow.com/questions/164858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463/" ]
164,865
<p>Here at work, we are working on a newsletter system that our clients can use. As an intern one of my jobs is to help with the smaller pieces of the puzzle. In this case what I need to do is scan the logs of the email server for bounced messages and add the emails and the reason the email bounced to a "bad email data...
[ { "answer_id": 164892, "author": "zigdon", "author_id": 4913, "author_profile": "https://Stackoverflow.com/users/4913", "pm_score": 3, "selected": false, "text": "#!/ust/bin/perl -w\nuse strict;\n\nwhile (<>) {\n next unless / 550 /;\n my @tokens = split ' ', $_;\n my $addr = $tokens[...
2008/10/02
[ "https://Stackoverflow.com/questions/164865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2128/" ]
164,879
<p>How can I write from Java to the Windows Event Log?</p>
[ { "answer_id": 164898, "author": "Lou Franco", "author_id": 3937, "author_profile": "https://Stackoverflow.com/users/3937", "pm_score": 6, "selected": true, "text": "NTEventLogAppender" }, { "answer_id": 2215876, "author": "Andrew", "author_id": 242615, "author_profil...
2008/10/02
[ "https://Stackoverflow.com/questions/164879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8934/" ]
164,896
<p>In the installation documentation to RoR it mentions that there are many limitations to running Ruby on Rails on Windows, and in some cases, whole libraries do not work.</p> <p>How bad are these limitations, should I always default to Linux to code / run RoR, and is Iron Ruby expected to fix these limitations or ar...
[ { "answer_id": 166548, "author": "Charles Roper", "author_id": 1944, "author_profile": "https://Stackoverflow.com/users/1944", "pm_score": 8, "selected": true, "text": "gem install rails" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/164896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5302/" ]
164,901
<p>Currently I am hosting a Django app I developed myself for my clients, but I am now starting to look at selling it to people for them to host themselves.</p> <p>My question is this: How can I package up and sell a Django app, while protecting its code from pirating or theft? Distributing a bunch of .py files doesn'...
[ { "answer_id": 164987, "author": "dbr", "author_id": 745, "author_profile": "https://Stackoverflow.com/users/745", "pm_score": 7, "selected": true, "text": "#" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/164901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2592/" ]
164,903
<p>How can I capture enter keypresses anywhere on my form and force it to fire the submit button event?</p>
[ { "answer_id": 164917, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 8, "selected": false, "text": "Form AcceptButton Button Form KeyPreview true Form KeyDown Enter" }, { "answer_id": 16124122, "author": "san...
2008/10/02
[ "https://Stackoverflow.com/questions/164903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
164,926
<p>When displaying the value of a decimal currently with <code>.ToString()</code>, it's accurate to like 15 decimal places, and since I'm using it to represent dollars and cents, I only want the output to be 2 decimal places. </p> <p>Do I use a variation of <code>.ToString()</code> for this?</p>
[ { "answer_id": 164932, "author": "albertein", "author_id": 23020, "author_profile": "https://Stackoverflow.com/users/23020", "pm_score": 11, "selected": true, "text": "decimalVar.ToString(\"#.##\"); // returns \".5\" when decimalVar == 0.5m\n decimalVar.ToString(\"0.##\"); // returns \"0...
2008/10/02
[ "https://Stackoverflow.com/questions/164926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1692/" ]
164,927
<p>What is the best way to find out if a primary key with a certain value already exists in a table?</p> <p>I can think of:</p> <pre><code>SELECT key FROM table WHERE key = 'value'; </code></pre> <p>and count the results, or:</p> <pre><code>SELECT SQL_CALC_FOUND_ROWS key FROM table WHERE key = 'value' LIMIT 1; SELE...
[ { "answer_id": 164950, "author": "Brian", "author_id": 700, "author_profile": "https://Stackoverflow.com/users/700", "pm_score": 0, "selected": false, "text": "Select count(key) into :result from table where key = :theValue\n" }, { "answer_id": 164952, "author": "Brian Matthe...
2008/10/02
[ "https://Stackoverflow.com/questions/164927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3740/" ]
164,931
<p>I'm looking at introducing multi-lingual support to a mature CGI application written in Perl. I had originally considered rolling my own solution using a Perl hash (stored on disk) for translation files but then I came across a CPAN module which appears to do just what I want (<a href="http://search.cpan.org/~audre...
[ { "answer_id": 164970, "author": "pjf", "author_id": 19422, "author_profile": "https://Stackoverflow.com/users/19422", "pm_score": 5, "selected": true, "text": "Locale::Maketext" }, { "answer_id": 191130, "author": "EvdB", "author_id": 5349, "author_profile": "https:/...
2008/10/02
[ "https://Stackoverflow.com/questions/164931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20790/" ]
164,964
<p>I'm trying to determine the asymptotic run-time of one of my algorithms, which uses exponents, but I'm not sure of how exponents are calculated programmatically.</p> <p>I'm specifically looking for the pow() algorithm used for double-precision, floating point numbers.</p>
[ { "answer_id": 164972, "author": "Andru Luvisi", "author_id": 5922, "author_profile": "https://Stackoverflow.com/users/5922", "pm_score": 1, "selected": false, "text": "result = 1\nwhile b > 0\n if b is odd\n result *= a\n b -= 1\n b /= 2\n a = a * a\n result = 1\nwhile b > 0\n ...
2008/10/02
[ "https://Stackoverflow.com/questions/164964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/55/" ]
164,967
<p>I have an Excel application in which I want to present the user with a list of the Data Source Names (ie: DSN's), whereby s/he can choose what data source to use.</p> <p>Hopefully once I've got the list, I can easily access the DSN properties to connect to the appropriate database.</p> <p>Please note, I do <em>not...
[ { "answer_id": 165044, "author": "Jorge Ferreira", "author_id": 6508, "author_profile": "https://Stackoverflow.com/users/6508", "pm_score": 5, "selected": true, "text": " Option Explicit\n\n Private Declare Function RegOpenKeyEx Lib \"advapi32.dll\" _\n Alias \"RegOpenKeyExA\" _\n...
2008/10/02
[ "https://Stackoverflow.com/questions/164967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1354/" ]
164,979
<p>I'm after a regex that will validate a full complex UK postcode only within an input string. All of the uncommon postcode forms must be covered as well as the usual. For instance:</p> <p><strong>Matches</strong></p> <ul> <li>CW3 9SS</li> <li>SE5 0EG</li> <li>SE50EG</li> <li>se5 0eg</li> <li>WC2H 7LT</li> </ul> <p...
[ { "answer_id": 164992, "author": "Dan", "author_id": 230, "author_profile": "https://Stackoverflow.com/users/230", "pm_score": 5, "selected": false, "text": "^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$\n" }, { "answer_id":...
2008/10/02
[ "https://Stackoverflow.com/questions/164979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5777/" ]
164,981
<p>I have a PHP script that uses the <code>system()</code> call to execute other (potentially long-running) programs (for interest: NCBI BLAST, phrap, primer3 and other programs for doing DNA sequence analysis and assembly).</p> <p>I'm running under Windows XP, using the CLI version of PHP from a command prompt, or as...
[ { "answer_id": 164992, "author": "Dan", "author_id": 230, "author_profile": "https://Stackoverflow.com/users/230", "pm_score": 5, "selected": false, "text": "^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$\n" }, { "answer_id":...
2008/10/02
[ "https://Stackoverflow.com/questions/164981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
164,990
<p>This is a continuation question from a previous question <a href="https://stackoverflow.com/questions/142237/integrating-external-sources-in-a-build.">I have asked</a></p> <p>I now have a /externals directory in the root of my project tree. Inside this I have a reference to another project. I'm able to script the b...
[ { "answer_id": 164992, "author": "Dan", "author_id": 230, "author_profile": "https://Stackoverflow.com/users/230", "pm_score": 5, "selected": false, "text": "^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$\n" }, { "answer_id":...
2008/10/02
[ "https://Stackoverflow.com/questions/164990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1894/" ]