qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
49,596
<p>What is the difference between</p> <pre><code>char str1[32] = "\0"; </code></pre> <p>and </p> <pre><code>char str2[32] = ""; </code></pre>
[ { "answer_id": 49620, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 6, "selected": true, "text": "char a[] = \"a\\0\";\nchar b[] = \"a\";\n\nprintf(\"%i %i\\n\", sizeof(a), sizeof(b));\n 3 2\n" }, { "answer_id": 59...
2008/09/08
[ "https://Stackoverflow.com/questions/49596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/123/" ]
49,599
<p>Jquery has a great language construct that looks like this:</p> <pre><code>$(document).ready(function() { $("a").click(function() { alert("Hello world!"); }); }); </code></pre> <p>As you might guess this, once the document has loaded, binds a custom function to the onClick event of all <strong><em>...
[ { "answer_id": 49618, "author": "David McLaughlin", "author_id": 3404, "author_profile": "https://Stackoverflow.com/users/3404", "pm_score": 1, "selected": false, "text": "Event.observe(window, 'load', function() { \n Event.observe(element, 'click', function() { \n alert(\"He...
2008/09/08
[ "https://Stackoverflow.com/questions/49599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305/" ]
49,601
<p>I'm trying to find a source control for my own personal use that's as simple as possible. The main feature I need is being able to read/pull a past version of my code. I am the only developer. I've looked at a lot of different version control systems, but they all seem way more complicated than I need. I need on...
[ { "answer_id": 49750, "author": "Bmore", "author_id": 5211, "author_profile": "https://Stackoverflow.com/users/5211", "pm_score": 2, "selected": false, "text": "$ bzr commit -m \"Added first line of text\" bzr update" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/49601", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5198/" ]
49,602
<p>In Oracle, the number of rows returned in an arbitrary query can be limited by filtering on the "virtual" <code>rownum</code> column. Consider the following example, which will return, at most, 10 rows.</p> <pre>SELECT * FROM all_tables WHERE rownum &lt;= 10</pre> <p>Is there a simple, generic way to do something ...
[ { "answer_id": 49604, "author": "Tnilsson", "author_id": 4165, "author_profile": "https://Stackoverflow.com/users/4165", "pm_score": 4, "selected": true, "text": "Select First 10 * from myTable\n" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/49602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5193/" ]
49,630
<p>I'm using JavaScript to hide an image and show some text thats hidden under it. But, when the text is shown if you scroll over it, it fires the mouseout event on the container, that then hides the text and shows the image again, and it just goes into a weird loop.</p> <p>The html looks like this:</p> <pre><code>&l...
[ { "answer_id": 49645, "author": "Ryan Lanciaux", "author_id": 1385358, "author_profile": "https://Stackoverflow.com/users/1385358", "pm_score": -1, "selected": false, "text": "if (bWasHoverIn){\n ...\n}\n" }, { "answer_id": 49687, "author": "SpoonMeiser", "author_id": 1...
2008/09/08
[ "https://Stackoverflow.com/questions/49630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/550/" ]
49,652
<p>Can someone suggest some good automated test suite framework for Perl?</p>
[ { "answer_id": 70367, "author": "Ovid", "author_id": 8003, "author_profile": "https://Stackoverflow.com/users/8003", "pm_score": 6, "selected": true, "text": "use Test::More tests => 2;\n\nis 3, 3, 'basic equality should work';\nok !0, '... and zero should be false';\n prove --verbose t/...
2008/09/08
[ "https://Stackoverflow.com/questions/49652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4406/" ]
49,662
<p>My company is looking to start distributing some software we developed and would like to be able to let people try the software out before buying. We'd also like to make sure it can't be copied and distributed to our customers' customers.</p> <p>One model we've seen is tying a license to a MAC address so the softw...
[ { "answer_id": 49666, "author": "Matt Sheppard", "author_id": 797, "author_profile": "https://Stackoverflow.com/users/797", "pm_score": 4, "selected": true, "text": "# License key for XYZZY\nexpiry-date=2009-01-01\nother-info=blah\nkey=[md5 has of MAC address, expiry date, other-info]\n"...
2008/09/08
[ "https://Stackoverflow.com/questions/49662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5106/" ]
49,668
<p>I need to find out time taken by a function in my application. Application is a MS VIsual Studio 2005 solution, all C code. </p> <p>I used thw windows API GetLocalTime(SYSTEMTIME *) to get the current system time before and after the function call which I want to measure time of. But this has shortcoming that it lo...
[ { "answer_id": 49767, "author": "gabr", "author_id": 4997, "author_profile": "https://Stackoverflow.com/users/4997", "pm_score": 3, "selected": false, "text": "function QueryPerfCounterAsUS: int64; \nbegin\n if QueryPerformanceCounter(Result) and\n QueryPerformanceFrequency(perf...
2008/09/08
[ "https://Stackoverflow.com/questions/49668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2759376/" ]
49,699
<p>I have been looking at the new <a href="http://cappuccino.org/" rel="noreferrer">Objective-J / Cappuccino</a> javascript framework from <a href="http://280north.com/" rel="noreferrer">280North</a>. They provide plug-ins for SubEthaEdit and TextMate to handle syntax highlighting, but I primarily use vi. Does anyone...
[ { "answer_id": 49769, "author": "Claes Mogren", "author_id": 4992, "author_profile": "https://Stackoverflow.com/users/4992", "pm_score": 1, "selected": false, "text": " augroup objective-j\n au! BufRead,BufNewFile *.j set filetype=objective-j\n au! Syntax objective-j source /usr/sh...
2008/09/08
[ "https://Stackoverflow.com/questions/49699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3078/" ]
49,724
<p>Is it possible to extract all of the VBA code from a Word 2007 "docm" document using the API?</p> <p>I have found how to insert VBA code at runtime, and how to delete all VBA code, but not pull the actual code out into a stream or string that I can store (and insert into other documents in the future).</p> <p>Any ...
[ { "answer_id": 49773, "author": "Aardvark", "author_id": 3655, "author_profile": "https://Stackoverflow.com/users/3655", "pm_score": 5, "selected": true, "text": "Sub GetCode()\n\n Dim prj As VBProject\n Dim comp As VBComponent\n Dim code As CodeModule\n Dim composedFile As S...
2008/09/08
[ "https://Stackoverflow.com/questions/49724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2194/" ]
49,737
<p>Recently I was talking to a co-worker about C++ and lamented that there was no way to take a string with the name of a class field and extract the field with that name; in other words, it lacks reflection. He gave me a baffled look and asked when anyone would ever need to do such a thing.</p> <p>Off the top of my ...
[ { "answer_id": 49760, "author": "jrcs3", "author_id": 3819, "author_profile": "https://Stackoverflow.com/users/3819", "pm_score": 2, "selected": false, "text": "string src = MethodInfo.GetCurrentMethod().ToString();\nstring msg = \"Big Mistake\";\nException newEx = new Exception(msg, ex)...
2008/09/08
[ "https://Stackoverflow.com/questions/49737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1694/" ]
49,757
<p>So if I have a method of parsing a text file and returning a <strong>list</strong> <em>of a</em> <strong>list</strong> <em>of</em> <strong>key value pairs</strong>, and want to create objects from the kvps returned (each list of kvps represents a different object), what would be the best method?</p> <p>The first met...
[ { "answer_id": 49782, "author": "David Schmitt", "author_id": 4918, "author_profile": "https://Stackoverflow.com/users/4918", "pm_score": 2, "selected": false, "text": "public class DataObject {\n [Column(\"name\")]\n public string Name { get; set; }\n\n [Column(\"prefix\")]\n public...
2008/09/08
[ "https://Stackoverflow.com/questions/49757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61/" ]
49,790
<p>In my specific example, I'm dealing with a drop-down, e.g.:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select name="foo" id="bar"&gt; &lt;option disabled=...
[ { "answer_id": 49814, "author": "Glenn Slaven", "author_id": 2975, "author_profile": "https://Stackoverflow.com/users/2975", "pm_score": 2, "selected": false, "text": "<option>" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/49790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5058/" ]
49,799
<p>I am sure a responsive UI is something that everyone strives for and the reccomended way to do stuff is to use the BackgroundWorker for this. </p> <p>Do you find it easy to work with ? Do you use it often ? Or do you have your own frameworks for lengthy tasks and reporting process.</p> <p>I have found that I am us...
[ { "answer_id": 49836, "author": "DonkeyMaster", "author_id": 5178, "author_profile": "https://Stackoverflow.com/users/5178", "pm_score": 3, "selected": true, "text": "void ThreadStart()" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/49799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4694/" ]
49,806
<p>In my application I have a window which I popup with small messages on it (think similar to tooltip). This window uses the layered attributes to draw alpha backgrounds etc.</p> <p>If I have several of these windows open at once, and I click one with my mouse, when they disappear they cause my application to lose fo...
[ { "answer_id": 49836, "author": "DonkeyMaster", "author_id": 5178, "author_profile": "https://Stackoverflow.com/users/5178", "pm_score": 3, "selected": true, "text": "void ThreadStart()" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/49806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/986/" ]
49,824
<p>Besides the dynamic nature of Python (and the syntax), what are some of the major features of the Python language that Java doesn't have, and vice versa?</p>
[ { "answer_id": 49837, "author": "David Webb", "author_id": 3171, "author_profile": "https://Stackoverflow.com/users/3171", "pm_score": 3, "selected": false, "text": ";" }, { "answer_id": 49953, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https:/...
2008/09/08
[ "https://Stackoverflow.com/questions/49824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4223/" ]
49,883
<p>Say I have this given XML file:</p> <pre><code>&lt;root&gt; &lt;node&gt;x&lt;/node&gt; &lt;node&gt;y&lt;/node&gt; &lt;node&gt;a&lt;/node&gt; &lt;/root&gt; </code></pre> <p>And I want the following to be displayed:</p> <pre><code>ayx </code></pre> <p>Using something similar to:</p> <pre><code>&lt;xsl...
[ { "answer_id": 49887, "author": "Pierre Spring", "author_id": 1532, "author_profile": "https://Stackoverflow.com/users/1532", "pm_score": 2, "selected": false, "text": "xsl:sort data-type=\"number\" <xsl:template match=\"/\">\n <xsl:apply-templates select=\"root/node\">\n <xsl:...
2008/09/08
[ "https://Stackoverflow.com/questions/49883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532/" ]
49,890
<p>I created a few mediawiki custom tags, using the guide found here</p> <p><a href="http://www.mediawiki.org/wiki/Manual:Tag_extensions" rel="nofollow noreferrer">http://www.mediawiki.org/wiki/Manual:Tag_extensions</a></p> <p>I will post my code below, but the problem is after it hits the first custom tag in the pag...
[ { "answer_id": 49887, "author": "Pierre Spring", "author_id": 1532, "author_profile": "https://Stackoverflow.com/users/1532", "pm_score": 2, "selected": false, "text": "xsl:sort data-type=\"number\" <xsl:template match=\"/\">\n <xsl:apply-templates select=\"root/node\">\n <xsl:...
2008/09/08
[ "https://Stackoverflow.com/questions/49890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/673/" ]
49,896
<p>When connecting to remote hosts via ssh, I frequently want to bring a file on that system to the local system for viewing or processing. Is there a way to copy the file over without (a) opening a new terminal/pausing the ssh session (b) authenticating again to either the local or remote hosts which works (c) even w...
[ { "answer_id": 49945, "author": "Ryan Ahearn", "author_id": 75, "author_profile": "https://Stackoverflow.com/users/75", "pm_score": 0, "selected": false, "text": "#!/bin/bash\n\nssh-agent sh -c 'ssh-add < /dev/null && bash'\n scp file_to_send.txt your.domain.name:~/\n" }, { "answ...
2008/09/08
[ "https://Stackoverflow.com/questions/49896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5222/" ]
49,900
<p>We have an Apache ANT script to build our application, then check in the resulting JAR file into version control (VSS in this case). However, now we have a change that requires us to build 2 JAR files for this project, then check both into VSS.</p> <p>The current target that checks the original JAR file into VSS d...
[ { "answer_id": 49920, "author": "Chris Dail", "author_id": 5077, "author_profile": "https://Stackoverflow.com/users/5077", "pm_score": 4, "selected": false, "text": "<antcall target=\"reusable\">\n <param name=\"some.variable\" value=\"var1\"/>\n</antcall>\n\n<target name=\"reusable\"...
2008/09/08
[ "https://Stackoverflow.com/questions/49900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1471/" ]
49,908
<p>I know I've seen this in the past, but I can't seem to find it now.</p> <p>Basically I want to create a page that I can host on a <a href="http://www.codeplex.com/dasblog" rel="nofollow noreferrer">dasBlog</a> instance that contains the layout from my theme, but the content of the page I control.</p> <p>Ideally th...
[ { "answer_id": 172280, "author": "Nick", "author_id": 22407, "author_profile": "https://Stackoverflow.com/users/22407", "pm_score": 3, "selected": true, "text": "<add matchExpression=\"(?&lt;basedir&gt;.*?)/Static\\.aspx\\?=(?&lt;value&gt;.+)\" mapTo=\"{basedir}/FormatPage.aspx?path=cont...
2008/09/08
[ "https://Stackoverflow.com/questions/49908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3381/" ]
49,919
<p>I am looking for a Regular expression to match only if a date is in the first 28 days of the month. This is for my validator control in ASP.NET</p>
[ { "answer_id": 49938, "author": "Simon Johnson", "author_id": 854, "author_profile": "https://Stackoverflow.com/users/854", "pm_score": 5, "selected": true, "text": "DateTime parsedDate;\n\nif ( DateTime.TryParse( dateString, out parsedDate) && parsedDate.Day <= 28 )\n{\n // logic goes h...
2008/09/08
[ "https://Stackoverflow.com/questions/49919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3208/" ]
49,925
<p>What is the difference between <code>UNION</code> and <code>UNION ALL</code>?</p>
[ { "answer_id": 49928, "author": "Jim Harte", "author_id": 4544, "author_profile": "https://Stackoverflow.com/users/4544", "pm_score": 12, "selected": true, "text": "UNION UNION ALL UNION UNION ALL SELECT 'foo' AS bar UNION SELECT 'foo' AS bar\n +-----+\n| bar |\n+-----+\n| foo |\n+-----+...
2008/09/08
[ "https://Stackoverflow.com/questions/49925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3208/" ]
49,926
<p>Is there an open-source alternative to MATLAB's <a href="https://www.mathworks.com/help/optim/index.html;jsessionid=95cd06964ab253598de29e7d0a80" rel="nofollow noreferrer"><code>fmincon</code></a> function for constrained linear optimization? I'm rewriting a MATLAB program to use Python / <a href="https://numpy.org/...
[ { "answer_id": 70798, "author": "WalkingRandomly", "author_id": 1856916, "author_profile": "https://Stackoverflow.com/users/1856916", "pm_score": 4, "selected": false, "text": " Constrained Optimizers (multivariate)\n\n fmin_l_bfgs_b -- Zhu, Byrd, and Nocedal's L-BFGS-B constrained o...
2008/09/08
[ "https://Stackoverflow.com/questions/49926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3002/" ]
49,950
<p>Is it necessary to set large objects to <code>null</code> when implementing a <code>Dispose()</code> method?</p>
[ { "answer_id": 49957, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 3, "selected": false, "text": "using(DisposableClass dc = new DisposableClass()) \n{ \n dc.PerformActionOnUmanagedResources(); \n dc.PerformAnotherActionOn...
2008/09/08
[ "https://Stackoverflow.com/questions/49950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4770/" ]
49,962
<p>Had an interesting discussion with some colleagues about the best scheduling strategies for realtime tasks, but not everyone had a good understanding of the common or useful scheduling strategies.</p> <p>For your answer, please choose one strategy and go over it in some detail, rather than giving a little info on s...
[ { "answer_id": 50056, "author": "Sean", "author_id": 4919, "author_profile": "https://Stackoverflow.com/users/4919", "pm_score": 4, "selected": true, "text": "Repeat forever {\n if tasks are waiting to be scheduled {\n Sort deadlines in ascending order\n Schedule task wi...
2008/09/08
[ "https://Stackoverflow.com/questions/49962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2915/" ]
49,964
<p>Each cell contains some text and a background color. So I have some cells that are blue and some that are red. What function do I use to count the number of red cells?</p> <p>I have tried <code>=COUNTIF(D3:D9,CELL("color",D3))</code> with no success (Where <code>D3</code> is red).</p>
[ { "answer_id": 49983, "author": "Sean", "author_id": 4919, "author_profile": "https://Stackoverflow.com/users/4919", "pm_score": 3, "selected": false, "text": "=SUMCOLOR(B11:B17,B11:B17,3,FALSE)" }, { "answer_id": 50462, "author": "Graham", "author_id": 1826, "author_...
2008/09/08
[ "https://Stackoverflow.com/questions/49964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453046/" ]
49,966
<p>When I turn an image (<code>&lt;img&gt;</code>) into a hyperlink (by wrapping it in <code>&lt;a&gt;</code>), Firefox adds a black border around the image. Safari does not display the same border. </p> <p>What CSS declaration would be best to eliminate the border?</p>
[ { "answer_id": 49975, "author": "George Mauer", "author_id": 5056, "author_profile": "https://Stackoverflow.com/users/5056", "pm_score": 2, "selected": false, "text": "a img {\n border-width: 0;\n}\n" }, { "answer_id": 49977, "author": "pilif", "author_id": 5083, "...
2008/09/08
[ "https://Stackoverflow.com/questions/49966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4540/" ]
49,988
<p>Occasionally a program on a Windows machine goes crazy and just hangs. So I'll call up the task manager and hit the "End Process" button for it. However, this doesn't always work; if I try it enough times then it'll usually die eventually, but I'd really like to be able to just kill it immediately. On Linux I cou...
[ { "answer_id": 49990, "author": "JosephStyons", "author_id": 672, "author_profile": "https://Stackoverflow.com/users/672", "pm_score": 8, "selected": false, "text": "taskkill /im myprocess.exe /f\n taskkill /pid 1234 /f\n" }, { "answer_id": 50011, "author": "pilif", "auth...
2008/09/08
[ "https://Stackoverflow.com/questions/49988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1694/" ]
50,005
<p>I have a weird bug involving Flash text and hyperlinks, htmlText in a TextField with <code>&lt;a&gt;</code> tags seem to truncate surrounding space:</p> <p><a href="https://i.stack.imgur.com/FDA7a.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FDA7a.gif" alt="output"></a></p> <p>Once I place my...
[ { "answer_id": 51590, "author": "Jon Cram", "author_id": 5343, "author_profile": "https://Stackoverflow.com/users/5343", "pm_score": 0, "selected": false, "text": "<p> ... &nbsp;<a ... >Link text</a>&nbsp; ... </p>\n" }, { "answer_id": 1827708, "author": "Sandro", "author...
2008/09/08
[ "https://Stackoverflow.com/questions/50005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1306/" ]
50,033
<p>The .Net generated code for a form with the "DefaultButton" attribute set contains poor javascript that allows the functionality to work in IE but not in other browsers (Firefox specifcially). </p> <p>Hitting enter key does submit the form with all browsers but Firefox cannot disregard the key press when it happens...
[ { "answer_id": 50039, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 1, "selected": false, "text": "function WebForm_FireDefaultButton(event, target) {\nif (!__defaultFired && event.keyCode == 13 && !(event.srcElement && \n(even...
2008/09/08
[ "https://Stackoverflow.com/questions/50033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3617/" ]
50,064
<p>This is pretty simple, I come from a swing/awt background.</p> <p>I'm just wondering what the proper way to set the background color for a SWT widget is?</p> <p>I've been trying:</p> <pre><code>widget.setBackground( ); </code></pre> <p>Except I have no idea how to create the color Object in SWT?</p>
[ { "answer_id": 50128, "author": "jodonnell", "author_id": 4223, "author_profile": "https://Stackoverflow.com/users/4223", "pm_score": 7, "selected": true, "text": "Device device = Display.getCurrent ();\nColor red = new Color (device, 255, 0, 0);\n" }, { "answer_id": 75509, "...
2008/09/08
[ "https://Stackoverflow.com/questions/50064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3415/" ]
50,096
<p>I know it is not recommended, but is it at all possible to pass the user's password to scp?</p> <p>I'd like to copy a file via scp as part of a batch job and the receiving server does, of course, need a password and, no, I cannot easily change that to key-based authentication.</p>
[ { "answer_id": 50113, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 3, "selected": false, "text": "expect sub copyover {\n $scp = Expect->spawn(\"/usr/bin/scp ${srcpath}/$file $who:${destpath}/$file\");\n $scp->expect(30,...
2008/09/08
[ "https://Stackoverflow.com/questions/50096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2992/" ]
50,097
<p>I would like to use an add-in like simple-modal or the dialog add-in in the UI kit. However, how do I use these or any other and get a result back. Basically I want the modal to do some AJAX interaction with the server and return the result for the calling code to do some stuff with.</p>
[ { "answer_id": 50172, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 3, "selected": false, "text": "$(document).ready(function () {\n $('#confirmDialog input:eq(0)').click(function (e) {\n e.preventDefault();\n\n // examp...
2008/09/08
[ "https://Stackoverflow.com/questions/50097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5236/" ]
50,098
<p>I would like to compare two collections (in C#), but I'm not sure of the best way to implement this efficiently.</p> <p>I've read the other thread about <a href="https://stackoverflow.com/questions/43500/is-there-a-built-in-method-to-compare-collections-in-c">Enumerable.SequenceEqual</a>, but it's not exactly what ...
[ { "answer_id": 50154, "author": "Daniel Jennings", "author_id": 3641, "author_profile": "https://Stackoverflow.com/users/3641", "pm_score": 5, "selected": false, "text": " private bool SetEqual (List<int> left, List<int> right) {\n\n if (left.Count != right.Count)\n ...
2008/09/08
[ "https://Stackoverflow.com/questions/50098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/810/" ]
50,106
<p>If any of you have worked with a cool tool for viewing/querying the SQL Transaction logs, please let me know. This should show all the transactional sql statements which are committed or rolled back.</p> <p>For Database files, if it has some additional graphical capabilities like showing the internal Binary Tree st...
[ { "answer_id": 19081981, "author": "Ardalan Shahgholi", "author_id": 2063547, "author_profile": "https://Stackoverflow.com/users/2063547", "pm_score": 1, "selected": false, "text": "Select * from ::fn_dblog(null,null)\n" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/50106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4337/" ]
50,114
<p>I understand the value of the three-part service/host/client model offered by WCF. But is it just me or does it seem like WCF took something pretty direct and straightforward (the ASMX model) and made a mess out of it? </p> <p>Is there an alternative to using SvcUtil's command line step back in time to generate the...
[ { "answer_id": 50139, "author": "Dave Ward", "author_id": 60, "author_profile": "https://Stackoverflow.com/users/60", "pm_score": 2, "selected": false, "text": "[ServiceContract]\n[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]\npublic cl...
2008/09/08
[ "https://Stackoverflow.com/questions/50114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536/" ]
50,115
<p>So my site uses <a href="http://mjijackson.com/shadowbox/" rel="nofollow noreferrer">shadowbox</a> to do display some dynamic text. Problem is I need the user to be able to copy and paste that text. </p> <p>Right-clicking and selecting copy works but <kbd>Ctrl</kbd>+<kbd>C</kbd> doesn't (no keyboard shortcuts do)...
[ { "answer_id": 58198, "author": "Prestaul", "author_id": 5628, "author_profile": "https://Stackoverflow.com/users/5628", "pm_score": 3, "selected": true, "text": "var handleKey=function(e){\n var code=SL.keyCode(e);\n SL.preventDefault(e);\n if(code==81||code==88||code==27){\n ...
2008/09/08
[ "https://Stackoverflow.com/questions/50115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5234/" ]
50,120
<p>What options exist for accessing different databases from C++? Put differently, what alternatives are there to ADO? What are the pros and cons?</p>
[ { "answer_id": 10654970, "author": "herzbube", "author_id": 1054378, "author_profile": "https://Stackoverflow.com/users/1054378", "pm_score": 1, "selected": false, "text": "QtSql QtSql QString" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/50120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5237/" ]
50,148
<p>I know that it does in PHP, and I'm pretty sure it does in Java. I haven't used the latest versions of .NET, so I won't speak for them. It seems very awkward, but I was wondering if there was an underlying reason for this.</p>
[ { "answer_id": 50173, "author": "georgebrock", "author_id": 5168, "author_profile": "https://Stackoverflow.com/users/5168", "pm_score": 1, "selected": false, "text": "file_exists() is_file() is_dir() is_link()" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/50148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
50,149
<p>I wrote a SQL function to convert a datetime value in SQL to a friendlier "n Hours Ago" or "n Days Ago" etc type of message. And I was wondering if there was a better way to do it. </p> <p>(Yes I know "don't do it in SQL" but for design reasons I have to do it this way).</p> <p>Here is the function I've written:</...
[ { "answer_id": 50193, "author": "ConroyP", "author_id": 2287, "author_profile": "https://Stackoverflow.com/users/2287", "pm_score": 4, "selected": true, "text": "CASE\n WHEN compare_date between date_sub(now(), INTERVAL 60 minute) and now() \n THEN concat(minute(TIMEDIFF(now(),...
2008/09/08
[ "https://Stackoverflow.com/questions/50149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1980/" ]
50,151
<p>I have several wpf pages with update/delete/add buttons. I want to display to the user messages like "successful delete", etc. How can I best implement this so the message is defined in a single place (similar to an asp.net master page) and I can update this message from anywhere?</p>
[ { "answer_id": 50214, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 1, "selected": false, "text": "MyAppUserSettings.StatusMessage = \"You just deleted the administrator!\" \n" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/50151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3047/" ]
50,159
<p>I'd like to know which libraries are used by executables on my system. More specifically, I'd like to rank which libraries are used the most, along with the binaries that use them. How can I do this?</p>
[ { "answer_id": 50166, "author": "pilif", "author_id": 5083, "author_profile": "https://Stackoverflow.com/users/5083", "pm_score": 6, "selected": false, "text": "ldd path/to/the/tool\n" }, { "answer_id": 50218, "author": "John Vasileff", "author_id": 5076, "author_prof...
2008/09/08
[ "https://Stackoverflow.com/questions/50159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3756/" ]
50,169
<p>I have a query that looks like this:</p> <pre><code>public IList&lt;Post&gt; FetchLatestOrders(int pageIndex, int recordCount) { DatabaseDataContext db = new DatabaseDataContext(); return (from o in db.Orders orderby o.CreatedDate descending select o) .Skip(pageIndex * re...
[ { "answer_id": 56966505, "author": "Bharat Kumar", "author_id": 3471489, "author_profile": "https://Stackoverflow.com/users/3471489", "pm_score": 0, "selected": false, "text": "context.Cars\n .OrderBy(x => x.Id)\n .Skip(50000)\n .Take(1000)\n .ToList();\n select * from [Cars] order b...
2008/09/08
[ "https://Stackoverflow.com/questions/50169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4269/" ]
50,170
<p>I can't be sure if my code is sucking, or if it's just that the browsers haven't caught up with the spec yet.</p> <p>My goal is to simulate list markers using generated content, so as to get e.g. continuation of the counters from list to list in pure CSS.</p> <p>So the code below, which I <em>think</em> is correct...
[ { "answer_id": 50271, "author": "Domenic", "author_id": 3191, "author_profile": "https://Stackoverflow.com/users/3191", "pm_score": 1, "selected": false, "text": "inline-block li:before\n{\n content: counter(myCounter)\". \";\n display: inline-block;\n width: 2em;\n padding-r...
2008/09/08
[ "https://Stackoverflow.com/questions/50170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3191/" ]
50,182
<p>Is there a good library to use for gathering user input in Linux from the mouse/keyboard/joystick that doesn't force you to create a visible window to do so? SDL lets you get user input in a reasonable way, but seems to force you to create a window, which is troublesome if you have abstracted control so the control...
[ { "answer_id": 50220, "author": "Brian Gianforcaro", "author_id": 3415, "author_profile": "https://Stackoverflow.com/users/3415", "pm_score": 2, "selected": false, "text": "/dev" }, { "answer_id": 52266, "author": "Thomas Kammeyer", "author_id": 4410, "author_profile"...
2008/09/08
[ "https://Stackoverflow.com/questions/50182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5070/" ]
50,194
<p>I've got a number of non-technical users that all share a set of project files. It would be ideal to have them using version control, but I think that both subversion and git are too technical for non-technical office staff.</p> <p>Is there any distributed source control software that would work well for normal pe...
[ { "answer_id": 50258, "author": "Anders Sandvig", "author_id": 1709, "author_profile": "https://Stackoverflow.com/users/1709", "pm_score": 1, "selected": false, "text": "svn cvs" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/50194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4767/" ]
50,223
<p>We're using Mercurial where I work and I want to have a setup similar to how I used SVN:</p> <ul> <li>Trunk</li> <li>Tags <ul> <li>Production</li> </ul></li> <li>Branches</li> </ul> <p>Since Mercurial supports branches natively, I know how to create a named branch, but I can't find any documentation on how to rep...
[ { "answer_id": 50239, "author": "nlucaroni", "author_id": 157, "author_profile": "https://Stackoverflow.com/users/157", "pm_score": 2, "selected": false, "text": "hg transplant" }, { "answer_id": 50475, "author": "Erin Dees", "author_id": 3462, "author_profile": "http...
2008/09/08
[ "https://Stackoverflow.com/questions/50223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/956/" ]
50,236
<p>Often time I need to add a control to a dialog after the dialog has been generated via dialog template and CreateDialogIndirect. In these cases the tab order is set by the dialog template and there is no obvious way to change the tab order by including a newly created control.</p>
[ { "answer_id": 50241, "author": "Karim", "author_id": 2494, "author_profile": "https://Stackoverflow.com/users/2494", "pm_score": 5, "selected": true, "text": "SetWindowPos(hNewControl, hOldControl, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); \n" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/50236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2494/" ]
50,251
<p>I'm stuck trying to create a dynamic linq extension method that returns a string in JSON format - I'm using System.Linq.Dynamic and Newtonsoft.Json and I can't get the Linq.Dynamic to parse the "cell=new object[]" part. Perhaps too complex? Any ideas? : </p> <p><strong>My Main method:</strong></p> <pre><code>stat...
[ { "answer_id": 50592, "author": "Scott Nichols", "author_id": 4299, "author_profile": "https://Stackoverflow.com/users/4299", "pm_score": 0, "selected": false, "text": "static void Main(string[] args)\n{\n NorthwindDataContext db = new NorthwindDataContext();\n var query = db.Custo...
2008/09/08
[ "https://Stackoverflow.com/questions/50251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3396/" ]
50,255
<p>I've been reading a lot lately about the next release of Java possibly supporting <a href="http://en.wikipedia.org/wiki/Closure_%28computer_science%29" rel="noreferrer">closures</a>. I feel like I have a pretty firm grasp on what closures are, but I can't think of a solid example of how they would make an Object-Or...
[ { "answer_id": 54180, "author": "Pop Catalin", "author_id": 4685, "author_profile": "https://Stackoverflow.com/users/4685", "pm_score": 3, "selected": false, "text": "// Example #1 with closures\npublic IList<Customer> GetFilteredCustomerList(string filter) {\n //Here a closure is cre...
2008/09/08
[ "https://Stackoverflow.com/questions/50255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1288/" ]
50,280
<p>I have a site I made really fast that uses floats to display different sections of content. The floated content and the content that has an additional margin both appear fine in FF/IE, but on safari one of the divs is completely hidden. I've tried switching to <code>padding</code> and <code>position:relative</code>,...
[ { "answer_id": 50302, "author": "Mike H", "author_id": 4563, "author_profile": "https://Stackoverflow.com/users/4563", "pm_score": 1, "selected": false, "text": "#right_content{\n float: right;\n margin-top: 20px;\n width: 400px;\n}\n" }, { "answer_id": 50309, "author": "S...
2008/09/08
[ "https://Stackoverflow.com/questions/50280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385358/" ]
50,312
<p>I'm running some <a href="http://jakarta.apache.org/jmeter/" rel="noreferrer">JMeter</a> tests against a Java process to determine how responsive a web application is under load (500+ users). JMeter will give the response time for each web request, and I've written a script to ping the Tomcat Manager every X seconds...
[ { "answer_id": 50334, "author": "Ben Collins", "author_id": 3279, "author_profile": "https://Stackoverflow.com/users/3279", "pm_score": 5, "selected": true, "text": "top -b" }, { "answer_id": 14520547, "author": "mighq", "author_id": 1242724, "author_profile": "https:...
2008/09/08
[ "https://Stackoverflow.com/questions/50312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4249/" ]
50,315
<p>I have a couple of solutions, but none of them work perfectly.</p> <p><strong>Platform</strong></p> <ol> <li>ASP.NET / VB.NET / .NET 2.0</li> <li>IIS 6</li> <li>IE6 (primarily), with some IE7; Firefox not necessary, but useful</li> </ol> <p><em>Allowed 3rd Party Options</em></p> <ol> <li>Flash</li> <li>ActiveX (...
[ { "answer_id": 240321, "author": "EndangeredMassa", "author_id": 106, "author_profile": "https://Stackoverflow.com/users/106", "pm_score": 1, "selected": true, "text": "Dim uploads As HttpFileCollection = HttpContext.Current.Request.Files\nIf uploads.Count > 0 Then\n UploadFiles(uploa...
2008/09/08
[ "https://Stackoverflow.com/questions/50315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/106/" ]
50,316
<p>I'm developing a website. I'm using a single-page web-app style, so all of the different parts of the site are AJAX'd into index.php. When a user logs in and tells Firefox to remember his username and password, all input boxes on the site get auto-filled with that username and password. This is a problem on the form...
[ { "answer_id": 50320, "author": "Ryan Lanciaux", "author_id": 1385358, "author_profile": "https://Stackoverflow.com/users/1385358", "pm_score": 6, "selected": true, "text": "<form name=\"form1\" id=\"form1\" method=\"post\" autocomplete=\"off\"\n action=\"http://www.example.com/form.cgi...
2008/09/08
[ "https://Stackoverflow.com/questions/50316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3757/" ]
50,332
<p>I'm trying to implement Drag &amp; Drop functionality with source being a TreeView control. When I initiate a drag on a node, I'm getting:</p> <p><em>Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV_E_FORMATETC))</em></p> <p>The ItemDrag handler (where the exception takes place), looks like:</p>...
[ { "answer_id": 52030, "author": "Stradas", "author_id": 5410, "author_profile": "https://Stackoverflow.com/users/5410", "pm_score": 1, "selected": false, "text": "FORMATETC FORMATETC DV DV_E_FORMATETC FORMATETC typedef struct tagFORMATETC\n{\n CLIPFORMAT cfFormat;\n DVTARGETDEVICE...
2008/09/08
[ "https://Stackoverflow.com/questions/50332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4398/" ]
50,373
<p>I'm trying to mixin the <code>MultiMap</code> trait with a <code>HashMap</code> like so:</p> <pre><code>val children:MultiMap[Integer, TreeNode] = new HashMap[Integer, Set[TreeNode]] with MultiMap[Integer, TreeNode] </code></pre> <p>The definition for the <code>MultiMap</code> trait is:</p> <pre><code>trait ...
[ { "answer_id": 50420, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 6, "selected": true, "text": "scala.collection.mutable.Set HashMap[Integer, Set[TreeNode]] scala.collection.Set scala.collection. mutable .Set" }, { ...
2008/09/08
[ "https://Stackoverflow.com/questions/50373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4893/" ]
50,384
<p>I'm using <a href="http://en.wikipedia.org/wiki/Windows_Script_Host#Usage" rel="noreferrer">WScript</a> to automate some tasks, by using WScript.Shell to call external programs.</p> <p>However, right now it does not wait for the external program to finish, and instead moves on. This causes issues because I have som...
[ { "answer_id": 50395, "author": "Guy Starbuck", "author_id": 2194, "author_profile": "https://Stackoverflow.com/users/2194", "pm_score": 3, "selected": false, "text": "Dim WshShell, oExec\nSet WshShell = CreateObject(\"WScript.Shell\")\n\nSet oExec = WshShell.Exec(ZipCommand)\n\nDo While...
2008/09/08
[ "https://Stackoverflow.com/questions/50384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
50,394
<p>I'm trying to get a webservice up and running that actually requires to check whois databases. What I'm doing right now is ugly and I'd like to avoid it as much as I can: I call gwhois command and parse its output. Ugly.</p> <p>I did some search to try to find a pythonic way to do this task. Generally I got quite m...
[ { "answer_id": 50413, "author": "Justin Standard", "author_id": 92, "author_profile": "https://Stackoverflow.com/users/92", "pm_score": 0, "selected": false, "text": "urllib2 whois whois" }, { "answer_id": 55385, "author": "cdleary", "author_id": 3594, "author_profile...
2008/09/08
[ "https://Stackoverflow.com/questions/50394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4172/" ]
50,417
<p>When I use Emacs I want to be able to easily display and navigate through a list of files I worked on from not just the current session but from previous sessions. (BTW, running Emacs 22.2 on Windows)</p>
[ { "answer_id": 50422, "author": "Ben Collins", "author_id": 3279, "author_profile": "https://Stackoverflow.com/users/3279", "pm_score": 6, "selected": true, "text": ";; recentf stuff\n(require 'recentf)\n(recentf-mode 1)\n(setq recentf-max-menu-items 25)\n(global-set-key \"\\C-x\\ \\C-r\...
2008/09/08
[ "https://Stackoverflow.com/questions/50417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872/" ]
50,426
<p>I have a few controls that inherit from <code>ASP.NET buttons</code> and use <code>onserverclick</code>.</p> <p>If the user clicks twice, the button fires two server side events. How can I prevent this?</p> <p>I tried setting <code>this.disabled='true'</code> after the click (in the <code>onclick</code> attribute)...
[ { "answer_id": 11466704, "author": "Andreas Krohn", "author_id": 1521232, "author_profile": "https://Stackoverflow.com/users/1521232", "pm_score": 2, "selected": false, "text": "<script type=\"text/javascript\">\n // Using that prm reference, hook _initializeRequest\n Sys.WebForms....
2008/09/08
[ "https://Stackoverflow.com/questions/50426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1782/" ]
50,450
<p>This has been driving me crazy for a few days. Why doesn't the following work?</p> <blockquote> <pre><code> Dim arr(3, 3) As Integer For y As Integer = 0 To arr.GetLength(0) - 1 For x As Integer = 0 To arr.GetLength(y) - 1 arr(y, x) = y + x Next Next </code></pre> </blockquo...
[ { "answer_id": 50454, "author": "harpo", "author_id": 4525, "author_profile": "https://Stackoverflow.com/users/4525", "pm_score": 2, "selected": false, "text": "arr.GetLength(y) arr.GetLength(1)" }, { "answer_id": 50508, "author": "Akira", "author_id": 795, "author_pr...
2008/09/08
[ "https://Stackoverflow.com/questions/50450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/795/" ]
50,467
<p>Is there a good way to adjust the size of a <code>UITextView</code> to conform to its content? Say for instance I have a <code>UITextView</code> that contains one line of text:</p> <pre><code>"Hello world" </code></pre> <p>I then add another line of text:</p> <pre><code>"Goodbye world" </code></pre> <p>Is there ...
[ { "answer_id": 50608, "author": "Mike McMaster", "author_id": 544, "author_profile": "https://Stackoverflow.com/users/544", "pm_score": 4, "selected": false, "text": "[textView sizeThatFits:textView.bounds] [textView sizeToFit]" }, { "answer_id": 107364, "author": "Code Addic...
2008/09/08
[ "https://Stackoverflow.com/questions/50467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1967/" ]
50,499
<p>I have scripts calling other script files but I need to get the filepath of the file that is currently running within the process. </p> <p>For example, let's say I have three files. Using <a href="http://docs.python.org/library/functions.html#execfile" rel="noreferrer">execfile</a>:</p> <ul> <li><code>script_1.py<...
[ { "answer_id": 50502, "author": "Blair Conrad", "author_id": 1199, "author_profile": "https://Stackoverflow.com/users/1199", "pm_score": 4, "selected": false, "text": "sys.argv[0]" }, { "answer_id": 50505, "author": "Pat Notz", "author_id": 825, "author_profile": "htt...
2008/09/08
[ "https://Stackoverflow.com/questions/50499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872/" ]
50,524
<p>From the Java 6 <a href="http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html" rel="noreferrer">Pattern</a> documentation:</p> <blockquote> <p>Special constructs (non-capturing)</p> <p><code>(?:</code><i>X</i><code>)</code>&nbsp;&nbsp;&nbsp;<i>X</i>, as a non-capturing group</p> <p>…</p> ...
[ { "answer_id": 394291, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "foo(?>(co)*)co" }, { "answer_id": 28663993, "author": "beibichunai", "author_id": 4434482, "author_profile...
2008/09/08
[ "https://Stackoverflow.com/questions/50524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4265/" ]
50,525
<p>Let's take the code</p> <pre><code>int a, b, c; ... if ((a + b) &gt; C) </code></pre> <p>If we add the values of a and b and the sum exceeds the maximum value of an int, will the integrity of the comparison be compromised? I was thinking that there might be an implicit up cast or overflow bit check and that will ...
[ { "answer_id": 51038, "author": "Rob Pilkington", "author_id": 1623, "author_profile": "https://Stackoverflow.com/users/1623", "pm_score": 2, "selected": false, "text": "#include <stdio.h>\n\nint main()\n{\n int a, b, c;\n\n a = 2000000000;\n b = 2000000000;\n c = 2100000000;...
2008/09/08
[ "https://Stackoverflow.com/questions/50525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2064/" ]
50,528
<p>So I was reading those Windows Vista UI guidelines someone linked to in another question, and they mentioned that you should be able to survive a switch to 120 DPI. Well, I fire up my handy VM with my app installed, and what do we get... AAAAGH!!! MASSIVE UI FAIL!</p> <p>Everything's all jumbled: some containers ar...
[ { "answer_id": 50729, "author": "OwenP", "author_id": 2547, "author_profile": "https://Stackoverflow.com/users/2547", "pm_score": 5, "selected": true, "text": "TableLayoutPanel TableLayoutPanel" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/50528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3191/" ]
50,532
<p>How do I format a number in Java?<br /> What are the &quot;Best Practices&quot;?</p> <p>Will I need to round a number before I format it?</p> <blockquote> <p><code>32.302342342342343</code> =&gt; <code>32.30</code></p> <p><code>.7323</code> =&gt; <code>0.73</code></p> </blockquote> <p>etc.</p>
[ { "answer_id": 50543, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 8, "selected": true, "text": "double r = 5.1234;\nSystem.out.println(r); // r is 5.1234\n\nint decimalPlaces = 2;\nBigDecimal bd = new BigDecimal(r);\n\n// set...
2008/09/08
[ "https://Stackoverflow.com/questions/50532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310/" ]
50,539
<p>One of the guys I work with needs a custom control that would work like a multiline ddl since such a thing does not exist as far as we have been able to discover</p> <p>does anyone have any ideas or have created such a thing before<br> we have a couple ideas but they involve to much database usage </p> <p>We pref...
[ { "answer_id": 50543, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 8, "selected": true, "text": "double r = 5.1234;\nSystem.out.println(r); // r is 5.1234\n\nint decimalPlaces = 2;\nBigDecimal bd = new BigDecimal(r);\n\n// set...
2008/09/08
[ "https://Stackoverflow.com/questions/50539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2486/" ]
50,558
<p>I have a two dimensional array that I need to load data into. I know the width of the data (22 values) but I do not know the height (estimated around 4000 records, but variable).</p> <p>I have it declared as follows: </p> <pre><code>float[,] _calibrationSet; .... int calibrationRow = 0; While (recordsToRead)...
[ { "answer_id": 50581, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 4, "selected": true, "text": "List<float[]> _calibrationSet = new List<float[]>();\n\n// ...\n\nwhile (recordsToRead)\n{\n float[] record = new float[SensorC...
2008/09/08
[ "https://Stackoverflow.com/questions/50558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048/" ]
50,561
<p>Is it possible at runtime to programmatically check the name of the Thread that is holding the lock of a given object?</p>
[ { "answer_id": 50573, "author": "erickson", "author_id": 3474, "author_profile": "https://Stackoverflow.com/users/3474", "pm_score": 6, "selected": true, "text": "Thread.holdsLock(Object) ReentrantLock" }, { "answer_id": 51620, "author": "Chris Kimpton", "author_id": 4831...
2008/09/08
[ "https://Stackoverflow.com/questions/50561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220/" ]
50,576
<p>I need to come up with an analysis of simultaneus events, when having only starttime and duration of each event.</p> <p><strong>Details</strong></p> <p>I've a standard CDR call detail record, that contains among others:</p> <ul> <li>calldate (timedate of each call start</li> <li>duration (int, seconds of call dur...
[ { "answer_id": 53327, "author": "Pablo Alsina", "author_id": 2295, "author_profile": "https://Stackoverflow.com/users/2295", "pm_score": 0, "selected": false, "text": "SELECT temp.second, count(call.id)\nFROM call, temp\nWHERE temp.second between (call.start and call.start + call.duratio...
2008/09/08
[ "https://Stackoverflow.com/questions/50576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2295/" ]
50,579
<p>I'm having a strange problem.</p> <p>I have to use <code>GetPostBackEventRefence</code> to force a Postback, but it works the first time, after the first postback, the .NET function is not rendered... any ideas?</p> <p>This is what I'm missing after the postback:</p> <pre><code>&lt;script language="javascript" ty...
[ { "answer_id": 50593, "author": "Haydar", "author_id": 288, "author_profile": "https://Stackoverflow.com/users/288", "pm_score": 3, "selected": true, "text": "Page.ClientScript.GetPostBackClientHyperlink(controlName, \"\")\n" }, { "answer_id": 50663, "author": "juan", "au...
2008/09/08
[ "https://Stackoverflow.com/questions/50579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1782/" ]
50,585
<p>How do you capture the mouse events, move and click over top of a Shockwave Director Object (not flash) in Firefox, via JavaScript. The code works in IE but not in FF. </p> <p>The script works on the document body of both IE and Moz, but mouse events do not fire when mouse is over a shockwave director object embed....
[ { "answer_id": 1839458, "author": "luna1999", "author_id": 2573986, "author_profile": "https://Stackoverflow.com/users/2573986", "pm_score": 3, "selected": true, "text": "on mouseDown me\n gotoNetPage \"javascript:function('\" & argument & \"')\"\nend\n property pMouseLock\n\non begins...
2008/09/08
[ "https://Stackoverflow.com/questions/50585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/567/" ]
50,605
<p>Suppose I have the following C code.</p> <pre><code>unsigned int u = 1234; int i = -5678; unsigned int result = u + i; </code></pre> <p>What implicit conversions are going on here, and is this code safe for all values of <code>u</code> and <code>i</code>? (Safe, in the sense that even though <em>result</em> in th...
[ { "answer_id": 50632, "author": "Ozgur Ozcitak", "author_id": 976, "author_profile": "https://Stackoverflow.com/users/976", "pm_score": 9, "selected": true, "text": "i UINT_MAX + 1 result u i u i i i UINT_MAX + 1 UINT_MAX #include <stdio.h>\n\nint main(void)\n{\n unsigned int plus_one =...
2008/09/08
[ "https://Stackoverflow.com/questions/50605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4828/" ]
50,618
<p>Syntax aside, what is the difference between</p> <pre><code>try { } catch() { } finally { x = 3; } </code></pre> <p>and </p> <pre><code>try { } catch() { } x = 3; </code></pre> <p>edit: in .NET 2.0?</p> <hr> <p>so</p> <pre><code>try { throw something maybe x = 3 } catch (...) { x = 3 } </code...
[ { "answer_id": 50649, "author": "crashmstr", "author_id": 1441, "author_profile": "https://Stackoverflow.com/users/1441", "pm_score": 0, "selected": false, "text": "catch(...) finally catch" }, { "answer_id": 50665, "author": "Mats Fredriksson", "author_id": 2973, "au...
2008/09/08
[ "https://Stackoverflow.com/questions/50618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5278/" ]
50,702
<p>If I have 2 query sources how do I find ones that are in one that are not in the other?</p> <p>example of join to find items in both:</p> <pre><code>var results = from item1 in qs1.Items join item2 in qs2 on item1.field1 equals item2.field2 select item1; </code></pre> <p>So what would the linq code be to re...
[ { "answer_id": 50719, "author": "Bramha Ghosh", "author_id": 3268, "author_profile": "https://Stackoverflow.com/users/3268", "pm_score": 2, "selected": false, "text": "NorthwindDataContext dc = new NorthwindDataContext();\ndc.Log = Console.Out;\nvar query =\n from c in dc.Customers\n ...
2008/09/08
[ "https://Stackoverflow.com/questions/50702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1215/" ]
50,704
<p>I'm designing an application which includes the need to log all incoming messages I receive from a Telnet connection. The text is largely plain though can include ANSI tags that provide text colour and formatting (16 colours, bold, underline, etc).</p> <p>I'm would like to format my logs to store the text with form...
[ { "answer_id": 50827, "author": "bmb", "author_id": 5298, "author_profile": "https://Stackoverflow.com/users/5298", "pm_score": 0, "selected": false, "text": "ls\ncd www\nls\nvi index.html\n/copyright 2007\nllllllllllllr8:wq\nexit\n" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/50704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/483/" ]
50,723
<p>I was browsing <a href="https://stackoverflow.com/questions/5119/what-are-the-best-rss-feeds-for-programmersdevelopers">this thread</a>, which has good recommendation but a bit too general for me.</p> <p>So, if anyone has a collection of nice game programming feeds,please share them. :)</p> <p>(both general and sp...
[ { "answer_id": 50827, "author": "bmb", "author_id": 5298, "author_profile": "https://Stackoverflow.com/users/5298", "pm_score": 0, "selected": false, "text": "ls\ncd www\nls\nvi index.html\n/copyright 2007\nllllllllllllr8:wq\nexit\n" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/50723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5196/" ]
50,737
<p>Is there a way to have TortoiseSVN (or any other tool) auto-add any new .cs files I create within a directory to my working copy so I don't have to remember which files I created at the end of the day?</p>
[ { "answer_id": 50826, "author": "Blorgbeard", "author_id": 369, "author_profile": "https://Stackoverflow.com/users/369", "pm_score": 3, "selected": true, "text": "dir /b /S *.cs > allcsfiles.txt\nsvn add --targets allcsfiles.txt\n" }, { "answer_id": 5710241, "author": "Jet", ...
2008/09/08
[ "https://Stackoverflow.com/questions/50737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
50,744
<p>What's the simplest way of blocking a thread until a file has been unlocked and is accessible for reading and renaming? For example, is there a WaitOnFile() somewhere in the .NET Framework?</p> <p>I have a service that uses a FileSystemWatcher to look for files that are to be transmitted to an FTP site, but the <em...
[ { "answer_id": 50800, "author": "Eric Z Beard", "author_id": 1219, "author_profile": "https://Stackoverflow.com/users/1219", "pm_score": 7, "selected": true, "text": " /// <summary>\n /// Blocks until the file is not locked any more.\n /// </summary>\n /// <param name=\"fullP...
2008/09/08
[ "https://Stackoverflow.com/questions/50744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5548/" ]
50,746
<p>We are using VS 2008 Team System with the automated test suite, and upon running tests the test host "randomly" locks up. I actually have to kill the VSTestHost process and re-run the tests to get something to happen, otherwise all tests sit in a "pending" state.</p> <p>Has anyone experience similar behavior and kn...
[ { "answer_id": 51063, "author": "Cory Foy", "author_id": 4083, "author_profile": "https://Stackoverflow.com/users/4083", "pm_score": 2, "selected": false, "text": "ntsd -p <PID>\n.dump C:\\mydump.dmp\n" }, { "answer_id": 888372, "author": "Tim Long", "author_id": 98516, ...
2008/09/08
[ "https://Stackoverflow.com/questions/50746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5289/" ]
50,762
<p>I need to programmatically determine out how many sectors, heads, and cylinders are on a physical disk from Windows XP. Does anyone know the API for determining this? Where might Windows expose this information?</p>
[ { "answer_id": 1724560, "author": "µBio", "author_id": 9796, "author_profile": "https://Stackoverflow.com/users/9796", "pm_score": 1, "selected": false, "text": "using( ManagementClass driveClass = new ManagementClass( \"Win32_DiskDrive\" ) )\n{\n using( ManagementObjectCollection phy...
2008/09/08
[ "https://Stackoverflow.com/questions/50762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2171/" ]
50,786
<p>How do I get ms-access to connect (through ODBC) to an ms-sql database as a different user than their Active Directory ID? </p> <p>I don't want to specify an account in the ODBC connection, I want to do it on the ms-access side to hide it from my users. Doing it in the ODBC connection would put me right back in to ...
[ { "answer_id": 73412, "author": "Philippe Grondier", "author_id": 11436, "author_profile": "https://Stackoverflow.com/users/11436", "pm_score": 0, "selected": false, "text": "Table_Blablabla View_Table_Blablabla form_Open" }, { "answer_id": 85064, "author": "BIBD", "autho...
2008/09/08
[ "https://Stackoverflow.com/questions/50786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/685/" ]
50,794
<p>How does unix handle full path name with space and arguments ?<br> In windows we quote the path and add the command-line arguments after, how is it in unix?</p> <pre><code> "c:\foo folder with space\foo.exe" -help </code></pre> <p><strong>update:</strong></p> <p>I meant how do I recognize a path from the command ...
[ { "answer_id": 50798, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 4, "selected": false, "text": "/Applications/Image\\ Capture.app/Contents/MacOS/Image\\ Capture\n\n\"/Applications/Image Capture.app/Contents/MacOS/Image ...
2008/09/08
[ "https://Stackoverflow.com/questions/50794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2566/" ]
50,801
<p>How would you find the fractional part of a floating point number in PHP?</p> <p>For example, if I have the value <code>1.25</code>, I want to return <code>0.25</code>.</p>
[ { "answer_id": 50806, "author": "nlucaroni", "author_id": 157, "author_profile": "https://Stackoverflow.com/users/157", "pm_score": 7, "selected": true, "text": "$x = $x - floor($x)\n" }, { "answer_id": 50817, "author": "Paige Ruten", "author_id": 813, "author_profile...
2008/09/08
[ "https://Stackoverflow.com/questions/50801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4925/" ]
50,814
<p>How does Google manage to properly align the second column <em>(i.e. the ticker name)</em> in the "Get Quotes" search box suggestion drop-down in <a href="http://finance.google.com" rel="nofollow noreferrer">google finance url</a></p> <p><strong>Example:</strong> If you enter <code>iii</code> - the second column is...
[ { "answer_id": 51245, "author": "travis", "author_id": 1414, "author_profile": "https://Stackoverflow.com/users/1414", "pm_score": 0, "selected": false, "text": "span" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/50814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
50,819
<p>Do any editors honer C #line directives with regards to goto line features?</p> <p><em>Context:</em> I'm working on a code generator and need to jump to a line of the output but the line is specified relative to the the #line directives I'm adding. I can drop them but then finding the input line is even a worse pai...
[ { "answer_id": 50852, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 0, "selected": false, "text": "#line .c .i .gch" } ]
2008/09/08
[ "https://Stackoverflow.com/questions/50819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
50,824
<p>I wrote a simple tool to generate a DBUnit XML dataset using queries that the user enters. I want to include each query entered in the XML as a comment, but the DBUnit API to generate the XML file doesn't support inserting the comment where I would like it (above the data it generates), so I am resorting to putting...
[ { "answer_id": 50832, "author": "Anonymoose", "author_id": 2391, "author_profile": "https://Stackoverflow.com/users/2391", "pm_score": 5, "selected": true, "text": "document ::= prolog element Misc* prolog prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? Misc Misc ...
2008/09/08
[ "https://Stackoverflow.com/questions/50824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122/" ]
50,829
<p>This is a bit hypothetical and grossly simplified but...</p> <p>Assume a program that will be calling functions written by third parties. These parties can be assumed to be non-hostile but can't be assumed to be "competent". Each function will take some arguments, have side effects and return a value. They have no ...
[ { "answer_id": 50842, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 2, "selected": false, "text": "malloc() free() #define" }, { "answer_id": 60252131, "author": "Ruslan", "author_id": 673852, "author...
2008/09/08
[ "https://Stackoverflow.com/questions/50829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
50,853
<p>I have a relationship between two entities (e1 and e2) and e1 has a collection of e2, however I have a similar relationship set up between (e2 and e3), yet e2 does not contain a collection of e3's, any reason why this would happen? Anything I can post to make this easier to figure out?</p> <p>Edit: I just noticed t...
[ { "answer_id": 175736, "author": "KyleLanser", "author_id": 12923, "author_profile": "https://Stackoverflow.com/users/12923", "pm_score": 2, "selected": false, "text": "DataClasses1DataContext db = new DataClasses1DataContext();\n\nvar results = from threes in db.tableThrees\n join tw...
2008/09/08
[ "https://Stackoverflow.com/questions/50853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5236/" ]
50,900
<p>So I have about 10 short css files that I use with mvc app. There are like error.css login.css etc... Just some really short css files that make updating and editing easy (At least for me). What I want is something that will optimize the if else branch and not incorporate it within the final bits. I want to do somet...
[ { "answer_id": 50921, "author": "jdelator", "author_id": 438, "author_profile": "https://Stackoverflow.com/users/438", "pm_score": 3, "selected": false, "text": "#if DEBUG\n Console.WriteLine(\"Debug mode.\") \n#else \n Console.WriteLine(\"Release mode.\") \n#endif \n" }, { ...
2008/09/08
[ "https://Stackoverflow.com/questions/50900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/438/" ]
50,931
<p>I'm using <a href="http://www.helicontech.com/isapi_rewrite/" rel="nofollow noreferrer">Helicon's ISAPI Rewrite 3</a>, which basically enables .htaccess in IIS. I need to redirect a non-www URL to the www version, i.e. example.com should redirect to www.example.com. I used the following rule from the examples but ...
[ { "answer_id": 50937, "author": "zigdon", "author_id": 4913, "author_profile": "https://Stackoverflow.com/users/4913", "pm_score": 0, "selected": false, "text": "RewriteCond %{HTTP:Host} ^example\\.com(.*) [NC]\n" }, { "answer_id": 50948, "author": "Vinko Vrsalovic", "aut...
2008/09/08
[ "https://Stackoverflow.com/questions/50931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2614/" ]
50,945
<p>If I had 20 directories under trunk/ with lots of files in each and only needed 3 of those directories, would it be possible to do a Subversion checkout with only those 3 directories under trunk?</p>
[ { "answer_id": 50956, "author": "Rob Walker", "author_id": 3631, "author_profile": "https://Stackoverflow.com/users/3631", "pm_score": -1, "selected": false, "text": "svn co file:///.../trunk/foo file:///.../trunk/bar file:///.../trunk/hum\n" }, { "answer_id": 50980, "author"...
2008/09/08
[ "https://Stackoverflow.com/questions/50945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
50,983
<p>I liked the discussion at <a href="https://stackoverflow.com/questions/31693/differences-in-generics">Differences in Generics</a>, and was wondering whether there were any languages that used this feature particularly well.</p> <p>I really dislike Java's <code>List&lt;? extends Foo&gt;</code> for a <code>List</code...
[ { "answer_id": 50997, "author": "Kibbee", "author_id": 1862, "author_profile": "https://Stackoverflow.com/users/1862", "pm_score": 1, "selected": false, "text": "Dim Cars as List(Of Car)\nDim Car as Car\n\nFor Each Car in Cars\n...\nNext\n" }, { "answer_id": 51014, "author": ...
2008/09/08
[ "https://Stackoverflow.com/questions/50983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1190/" ]
50,995
<p>I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me.</p> <p>I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument</p> <p>I have 2 questions, the second regarding a workaround...
[ { "answer_id": 51312, "author": "Frank Krueger", "author_id": 338, "author_profile": "https://Stackoverflow.com/users/338", "pm_score": -1, "selected": false, "text": "<dict>\n <key>Author</key>\n <string>William Shakespeare</string>\n <key>Title</key>\n <string>Romeo et</str...
2008/09/09
[ "https://Stackoverflow.com/questions/50995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5302/" ]
51,007
<p>One of the things I miss the most in ActionScript is the lack of operator overloading, in particular ==. I kind of work around this issue by adding a "Compare" method to my classes, but that doesn't help in many cases, like when you want to use things like the built in Dictionary.</p> <p>Is there a good way to work...
[ { "answer_id": 51310, "author": "Theo", "author_id": 1109, "author_profile": "https://Stackoverflow.com/users/1109", "pm_score": 5, "selected": true, "text": "equals == ===" } ]
2008/09/09
[ "https://Stackoverflow.com/questions/51007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1815/" ]
51,010
<p>I have 2 time values which have the type <code>datetime.time</code>. I want to find their difference. The obvious thing to do is t1 - t2, but this doesn't work. It works for objects of type <code>datetime.datetime</code> but not for <code>datetime.time</code>. So what is the best way to do this?</p>
[ { "answer_id": 51023, "author": "chryss", "author_id": 5169, "author_profile": "https://Stackoverflow.com/users/5169", "pm_score": 3, "selected": false, "text": ">>> import datetime as dt\n>>> t1 = dt.time(23, 5, 5, 5)\n>>> t2 = dt.time(10, 5, 5, 5)\n>>> dt1 = dt.timedelta(hours=t1.hour,...
2008/09/09
[ "https://Stackoverflow.com/questions/51010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5304/" ]
51,013
<p>I have some HTML that is generated via a Rich Text Editor outside of my Flex application but would like to display it inside Flex. </p> <p>The HTML is simple HTML tags, things like styles, anchors, and possibly image tags, is there a control that would let me render this HTML in flex or am I going to have to roll u...
[ { "answer_id": 51302, "author": "Theo", "author_id": 1109, "author_profile": "https://Stackoverflow.com/users/1109", "pm_score": 1, "selected": false, "text": "mx.controls.Label flash.text.TextField Text Label TextField Text htmlText <img> Label align=\"left\"" }, { "answer_id": ...
2008/09/09
[ "https://Stackoverflow.com/questions/51013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
51,017
<p>How can you determine the performance consequences of your PHP code if you are not familiar with the internals? Are there ways to figure out how your code is being executed (besides simply load testing it)? I am looking for things like memory usage, the execution time for algorithms.</p> <p>Perhaps Joel would say, ...
[ { "answer_id": 2227253, "author": "StasM", "author_id": 214196, "author_profile": "https://Stackoverflow.com/users/214196", "pm_score": 0, "selected": false, "text": "microtime() memory_get_usage() -T php-cgi -T 100 yourscript.php" } ]
2008/09/09
[ "https://Stackoverflow.com/questions/51017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/577/" ]