qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
1,042
<p>For instance, my query is like the following using SQL Server 2005:</p> <pre><code>SELECT * FROM Table WHERE FREETEXT(SearchField, 'c#') </code></pre> <p>I have a full text index defined to use the column SearchField which returns results when using:</p> <pre><code>SELECT * FROM Table WHERE SearchField LIKE '%c#...
[ { "answer_id": 1047, "author": "Ishmaeel", "author_id": 227, "author_profile": "https://Stackoverflow.com/users/227", "pm_score": 1, "selected": false, "text": "MSSQL" } ]
2008/08/04
[ "https://Stackoverflow.com/questions/1042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2/" ]
1,053
<p>Most mathematicians agree that:</p> <blockquote> <p>e<sup>πi</sup> + 1 = 0</p> </blockquote> <p>However, most floating point implementations disagree. How well can we settle this dispute?</p> <p>I'm keen to hear about different languages and implementations, and various methods to make the result as close to ze...
[ { "answer_id": 1054, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 3, "selected": false, "text": "(+ 1 (make-polar 1 (atan 0 -1)))" }, { "answer_id": 26026, "author": "dmckee --- ex-moderator kitten", "author...
2008/08/04
[ "https://Stackoverflow.com/questions/1053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13/" ]
1,064
<p>I'd like to display 100 floating cubes using <code>DirectX</code> or <code>OpenGL</code>.</p> <p>I'm looking for either some sample source code, or a description of the technique. I have trouble getting more one cube to display correctly.</p> <p>I've combed the net for a good series of tutorials and although they...
[ { "answer_id": 1096, "author": "Redbaron", "author_id": 41, "author_profile": "https://Stackoverflow.com/users/41", "pm_score": 4, "selected": true, "text": "void DrawCube()\n{\n //code to draw the cube\n}\n\nvoid DisplayCubes()\n{\n for(int i = 0; i < 10; ++i)\n { \n ...
2008/08/04
[ "https://Stackoverflow.com/questions/1064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
1,069
<p>I'm working on a <strong>multithreaded</strong> C++ application that is corrupting the heap. The usual tools to locate this corruption seem to be inapplicable. Old builds (18 months old) of the source code exhibit the same behaviour as the most recent release, so this has been around for a long time and just wasn'...
[ { "answer_id": 1073, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 6, "selected": true, "text": "low-level alloc API" }, { "answer_id": 3329, "author": "Michal Sznajder", "author_id": 501, "author_profile":...
2008/08/04
[ "https://Stackoverflow.com/questions/1069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/257/" ]
1,070
<p>What is the correct way to get the process size on <code>Solaris, HP-UX</code> and <code>AIX</code>? Should we use <code>top</code> or <code>ps -o vsz</code> or something else?</p>
[ { "answer_id": 1082, "author": "Mark Harrison", "author_id": 116, "author_profile": "https://Stackoverflow.com/users/116", "pm_score": 2, "selected": false, "text": "ps u" }, { "answer_id": 1773, "author": "John Siracusa", "author_id": 164, "author_profile": "https://...
2008/08/04
[ "https://Stackoverflow.com/questions/1070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236/" ]
1,104
<p>Exceptions in C++ don't need to be caught (no compile time errors) by the calling function. So it's up to developer's judgment whether to catch them using try/catch (unlike in Java).</p> <p>Is there a way one can ensure that the exceptions thrown are always caught using try/catch by the calling function?</p>
[ { "answer_id": 1454, "author": "shsteimer", "author_id": 292, "author_profile": "https://Stackoverflow.com/users/292", "pm_score": 2, "selected": false, "text": "c[++]" }, { "answer_id": 126184, "author": "Scott Langham", "author_id": 11898, "author_profile": "https:/...
2008/08/04
[ "https://Stackoverflow.com/questions/1104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236/" ]
1,108
<p>Given that indexing is so important as your data set increases in size, can someone explain how indexing works at a database-agnostic level?</p> <p>For information on queries to index a field, check out <a href="https://stackoverflow.com/questions/1156/">How do I index a database column</a>.</p>
[ { "answer_id": 1130, "author": "Xenph Yan", "author_id": 264, "author_profile": "https://Stackoverflow.com/users/264", "pm_score": 13, "selected": true, "text": "(N+1)/2" }, { "answer_id": 16302431, "author": "Der U", "author_id": 2331665, "author_profile": "https://S...
2008/08/04
[ "https://Stackoverflow.com/questions/1108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/264/" ]
1,145
<p>I've tried to write a string replace function in C, which works on a <code>char *</code>, which has been allocated using <code>malloc()</code>. It's a little different in that it will find and replace strings, rather than characters in the starting string.</p> <p>It's trivial to do if the search and replace string...
[ { "answer_id": 1149, "author": "John Downey", "author_id": 200, "author_profile": "https://Stackoverflow.com/users/200", "pm_score": 3, "selected": false, "text": "input = realloc(input, strlen(input) + delta);\n" }, { "answer_id": 1154, "author": "Vincent Robert", "autho...
2008/08/04
[ "https://Stackoverflow.com/questions/1145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/188/" ]
1,156
<p>Hopefully, I can get answers for each database server.</p> <p>For an outline of how indexing works check out: <a href="https://stackoverflow.com/questions/1108/how-does-database-indexing-work">How does database indexing work?</a></p>
[ { "answer_id": 1157, "author": "John Downey", "author_id": 200, "author_profile": "https://Stackoverflow.com/users/200", "pm_score": 7, "selected": true, "text": "CREATE INDEX [index name] ON [table name] ( [column name] )\n" }, { "answer_id": 9853, "author": "Eric Z Beard", ...
2008/08/04
[ "https://Stackoverflow.com/questions/1156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/264/" ]
1,160
<p>I am using CCNET on a sample project with SVN as my source control. CCNET is configured to create a build on every check in. CCNET uses MSBuild to build the source code.</p> <p>I would like to use the latest revision number to generate <code>AssemblyInfo.cs</code> while compiling. How can I retrieve the latest revi...
[ { "answer_id": 1168, "author": "hitec", "author_id": 120, "author_profile": "https://Stackoverflow.com/users/120", "pm_score": 2, "selected": false, "text": "CCNET" }, { "answer_id": 1169, "author": "lubos hasko", "author_id": 275, "author_profile": "https://Stackover...
2008/08/04
[ "https://Stackoverflow.com/questions/1160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/120/" ]
1,171
<p>I need to be able to manipulate a large (10^7 nodes) graph in python. The data corresponding to each node/edge is minimal, say, a small number of strings. What is the most efficient, in terms of <strong><em>memory and speed</em></strong>, way of doing this? </p> <p>A dict of dicts is more flexible and simpler to im...
[ { "answer_id": 28705, "author": "Ryan Cox", "author_id": 620, "author_profile": "https://Stackoverflow.com/users/620", "pm_score": 7, "selected": true, "text": "\n\"\"\"\nCreate an G{n,m} random graph with n nodes and m edges\nand report some properties.\n\nThis graph is sometimes called...
2008/08/04
[ "https://Stackoverflow.com/questions/1171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/280/" ]
1,180
<p>I am looking to allow users to control of subdomain of an app I am toying with, much like Basecamp where it is <code>customusername.seework.com</code>.</p> <p>What is required on the <code>DNS</code> end to allow these to be created dynamically and be available instantly. </p> <p>And how do you recommend dealing w...
[ { "answer_id": 1187, "author": "lubos hasko", "author_id": 275, "author_profile": "https://Stackoverflow.com/users/275", "pm_score": 3, "selected": false, "text": "*.YOURDOMAIN.COM A 123.123.123.123\n" }, { "answer_id": 1232, "author": "Mat", "author_id": 48, "author_...
2008/08/04
[ "https://Stackoverflow.com/questions/1180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/281/" ]
1,237
<p>I have a file in the following format:</p> <pre> Data Data Data [Start] Data I want [End] Data </pre> <p>I'd like to grab the <code>Data I want</code> from between the <code>[Start]</code> and <code>[End]</code> tags using a Regex. Can anyone show me how this might be done?</p>
[ { "answer_id": 1240, "author": "Karl Seguin", "author_id": 34, "author_profile": "https://Stackoverflow.com/users/34", "pm_score": 6, "selected": false, "text": "\\[start\\](.*?)\\[end\\]\n" }, { "answer_id": 1243, "author": "Xenph Yan", "author_id": 264, "author_prof...
2008/08/04
[ "https://Stackoverflow.com/questions/1237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230/" ]
1,284
<p>I am looking for a tool that can detect malicious requests (such as obvious SQL injection gets or posts) and will immediately ban the IP address of the requester/add to a blacklist. I am aware that in an ideal world our code should be able to handle such requests and treat them accordingly, but there is a lot of val...
[ { "answer_id": 1317, "author": "Mat", "author_id": 48, "author_profile": "https://Stackoverflow.com/users/48", "pm_score": 3, "selected": false, "text": " DROP TABLE users;\n" } ]
2008/08/04
[ "https://Stackoverflow.com/questions/1284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
1,292
<p>I have a Queue&lt;T&gt; object that I have initialised to a capacity of 2, but obviously that is just the capacity and it keeps expanding as I add items. Is there already an object that automatically dequeues an item when the limit is reached, or is the best solution to create my own inherited class?</p>
[ { "answer_id": 1297, "author": "CodingWithoutComments", "author_id": 25, "author_profile": "https://Stackoverflow.com/users/25", "pm_score": 2, "selected": false, "text": "Queue<T>" }, { "answer_id": 1305, "author": "tags2k", "author_id": 192, "author_profile": "https...
2008/08/04
[ "https://Stackoverflow.com/questions/1292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192/" ]
1,304
<p>Is there any way to check whether a file is locked without using a try/catch block? </p> <p>Right now, the only way I know of is to just open the file and catch any <code>System.IO.IOException</code>.</p>
[ { "answer_id": 1309, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 8, "selected": true, "text": "if not locked then\n open and update file\n" }, { "answer_id": 3202085, "author": "DixonD", "author_i...
2008/08/04
[ "https://Stackoverflow.com/questions/1304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/121/" ]
1,313
<p><a href="https://stackoverflow.com/questions/180/function-for-creating-color-wheels">Original Question</a></p> <p>I am looking for a function that attempts to quantify how "distant" (or distinct) two colors are. This question is really in two parts: </p> <ol> <li>What color space best represents human vision?</li>...
[ { "answer_id": 74033, "author": "DarenW", "author_id": 10468, "author_profile": "https://Stackoverflow.com/users/10468", "pm_score": 7, "selected": true, "text": "a" }, { "answer_id": 19416874, "author": "Community", "author_id": -1, "author_profile": "https://Stackov...
2008/08/04
[ "https://Stackoverflow.com/questions/1313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089740/" ]
1,323
<p><a href="https://stackoverflow.com/questions/180/function-for-creating-color-wheels">Original Question</a></p> <p>If you are given N maximally distant colors (and some associated distance metric), can you come up with a way to sort those colors into some order such that the first M are also reasonably close to bein...
[ { "answer_id": 1342, "author": "Nick Berardi", "author_id": 17, "author_profile": "https://Stackoverflow.com/users/17", "pm_score": 1, "selected": false, "text": "XX XX XX\nRR GG BB\n\n00 00 00 = black\nff ff ff = white\nff 00 00 = red\n00 ff 00 = green\n00 00 ff = blue\n" }, { "...
2008/08/04
[ "https://Stackoverflow.com/questions/1323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089740/" ]
1,329
<p>I need to copy hundreds of gigs of random files around on my computer and am pretty leery of using the vanilla file copy built into Windows.</p> <p>I don't want it to hang on a "Are you sure?", "Are you really sure?", "Even zip files?", "Surely not read-only files too!" loop as soon as I step away.</p> <p>I don't ...
[ { "answer_id": 1331, "author": "huseyint", "author_id": 39, "author_profile": "https://Stackoverflow.com/users/39", "pm_score": 6, "selected": false, "text": "xcopy /?\n" }, { "answer_id": 1339, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Sta...
2008/08/04
[ "https://Stackoverflow.com/questions/1329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83/" ]
1,376
<p>I need the name of the current logged in user in my <strong>Air/Flex</strong> application. The application will only be deployed on Windows machines. I think I could attain this by regexing the User directory, but am open to other ways.</p>
[ { "answer_id": 1380, "author": "Shawn", "author_id": 26, "author_profile": "https://Stackoverflow.com/users/26", "pm_score": 1, "selected": false, "text": "public static function GetCurrentOSUser():String{\n // XP & Vista only.\n var userDirectory:String = File.userDirectory.resolv...
2008/08/04
[ "https://Stackoverflow.com/questions/1376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26/" ]
1,383
<p>I saw many questions asking 'how' to unit test in a specific language, but no question asking 'what', 'why', and 'when'.</p> <ul> <li>What is it?</li> <li>What does it do for me?</li> <li>Why should I use it?</li> <li>When should I use it (also when not)?</li> <li>What are some common pitfalls and misconceptions</l...
[ { "answer_id": 2443027, "author": "AndiDog", "author_id": 245706, "author_profile": "https://Stackoverflow.com/users/245706", "pm_score": 2, "selected": false, "text": "Assert.AreEqual(expectedValue, actualValue, \"some description\")" } ]
2008/08/04
[ "https://Stackoverflow.com/questions/1383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314/" ]
1,390
<p>I'm setting up a dedicated SQL Server 2005 box on Windows Server 2008 this week, and would like to pare it down to be as barebones as possible while still being fully functional.</p> <p>To that end, the "Server Core" option sounds appealing, but I'm not clear about whether or not I can run SQL Server on that SKU. ...
[ { "answer_id": 15209, "author": "benjaminperdomo", "author_id": 295, "author_profile": "https://Stackoverflow.com/users/295", "pm_score": 2, "selected": false, "text": ".net" } ]
2008/08/04
[ "https://Stackoverflow.com/questions/1390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60/" ]
1,401
<p>I have a custom validation function in JavaScript in a user control on a .Net 2.0 web site which checks to see that the fee paid is not in excess of the fee amount due. </p> <p>I've placed the validator code in the <code>ascx</code> file, and I have also tried using <code>Page.ClientScript.RegisterClientScriptBlock...
[ { "answer_id": 1405, "author": "brendan", "author_id": 225, "author_profile": "https://Stackoverflow.com/users/225", "pm_score": 3, "selected": false, "text": "ScriptManager.RegisterClientScriptBlock\n" }, { "answer_id": 1418, "author": "Greg Hurlman", "author_id": 35, ...
2008/08/04
[ "https://Stackoverflow.com/questions/1401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149/" ]
1,408
<p>Is it possible to configure <a href="http://www.apachefriends.org/en/xampp.html" rel="noreferrer">xampp</a> to serve up a file outside of the <code>htdocs</code> directory?</p> <p>For instance, say I have a file located as follows:</p> <p><code>C:\projects\transitCalculator\trunk\TransitCalculator.php</code></p> ...
[ { "answer_id": 1421, "author": "cmcculloh", "author_id": 58, "author_profile": "https://Stackoverflow.com/users/58", "pm_score": 10, "selected": true, "text": "NameVirtualHost *:80" }, { "answer_id": 2471, "author": "pix0r", "author_id": 72, "author_profile": "https:/...
2008/08/04
[ "https://Stackoverflow.com/questions/1408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58/" ]
1,451
<p>I often encounter the following scenario where I need to offer many different types of permissions. I primarily use ASP.NET / VB.NET with SQL Server 2000.</p> <p><strong>Scenario</strong></p> <p>I want to offer a dynamic permission system that can work on different parameters. Let's say that I want to give either a ...
[ { "answer_id": 1466, "author": "tags2k", "author_id": 192, "author_profile": "https://Stackoverflow.com/users/192", "pm_score": 0, "selected": false, "text": "new PermissionToken()\n{\n Target = PermissionTokenTarget.Application,\n Action = PermissionTokenAction.View,\n Value = ...
2008/08/04
[ "https://Stackoverflow.com/questions/1451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/106/" ]
1,453
<p>I'm trying to do this (which produces an unexpected T_VARIABLE error):</p> <pre><code>public function createShipment($startZip, $endZip, $weight = $this-&gt;getDefaultWeight()){} </code></pre> <p>I don't want to put a magic number in there for weight since the object I am using has a <code>"defaultWeight"</code> ...
[ { "answer_id": 1456, "author": "Kevin", "author_id": 40, "author_profile": "https://Stackoverflow.com/users/40", "pm_score": 5, "selected": true, "text": "public function createShipment($startZip, $endZip, $weight=null){\n $weight = !$weight ? $this->getDefaultWeight() : $weight;\n}\n...
2008/08/04
[ "https://Stackoverflow.com/questions/1453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58/" ]
1,457
<p>I'm writing an AJAX app, but as the user moves through the app, I'd like the URL in the address bar to update despite the lack of page reloads. Basically, I'd like for them to be able to bookmark at any point and thereby return to the current state. </p> <p>How are people handling maintaining RESTfulness in AJAX ap...
[ { "answer_id": 1465, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": false, "text": "var encodedState = base64(json(state));\nvar newLocation = oldLocationWithoutFragment + \"#\" + encodedState;\n\ndocument.locati...
2008/08/04
[ "https://Stackoverflow.com/questions/1457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/331/" ]
1,476
<p>How do you express an integer as a binary number with Python literals?</p> <p>I was easily able to find the answer for hex:</p> <pre><code>&gt;&gt;&gt; 0x12AF 4783 &gt;&gt;&gt; 0x100 256 </code></pre> <p>and octal:</p> <pre><code>&gt;&gt;&gt; 01267 695 &gt;&gt;&gt; 0100 64 </code></pre> <p><strong>How do you us...
[ { "answer_id": 1484, "author": "Louis Brandy", "author_id": 2089740, "author_profile": "https://Stackoverflow.com/users/2089740", "pm_score": 6, "selected": false, "text": ">>> print int('01010101111',2)\n687\n>>> print int('11111111',2)\n255\n" }, { "answer_id": 13107, "auth...
2008/08/04
[ "https://Stackoverflow.com/questions/1476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92/" ]
1,496
<p>For those of us that like to use the graphical version of Vim or Emacs, instead of the console version, which version do you recommend?</p> <p>For Vim, there's <a href="http://sourceforge.net/projects/macosxvim/" rel="nofollow noreferrer">Mac OS X Vim</a>, <a href="http://code.google.com/p/macvim/" rel="nofollow no...
[ { "answer_id": 29905, "author": "Alotor", "author_id": 2937, "author_profile": "https://Stackoverflow.com/users/2937", "pm_score": 1, "selected": false, "text": "sudo port install emacs\n" } ]
2008/08/04
[ "https://Stackoverflow.com/questions/1496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136/" ]
1,528
<p>I'm looking for some way to effectively hide inherited members. I have a library of classes which inherit from common base classes. Some of the more recent descendant classes inherit dependency properties which have become vestigial and can be a little confusing when using <em>IntelliSense</em> or using the classes...
[ { "answer_id": 1533, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 4, "selected": false, "text": "Using System.ComponentModel;\n\n[EditorBrowsable(EditorBrowsableState.Never)]\nprivate string MyHiddenString = \"Muahahahahah...
2008/08/04
[ "https://Stackoverflow.com/questions/1528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/93/" ]
1,535
<p>I've never been completely happy with the way exception handling works, there's a lot exceptions and try/catch brings to the table (stack unwinding, etc.), but it seems to break a lot of the OO model in the process.</p> <p>Anyway, here's the problem:</p> <p>Let's say you have some class which wraps or includes net...
[ { "answer_id": 1554, "author": "Chris Marasti-Georg", "author_id": 96, "author_profile": "https://Stackoverflow.com/users/96", "pm_score": 2, "selected": false, "text": " public delegate void IoOperation(params string[] parameters);\n\n public void FileDeleteOperation(params string...
2008/08/04
[ "https://Stackoverflow.com/questions/1535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/332/" ]
1,598
<p>I'm not sure what the correct size should be.</p> <p>Many sites seem to repeat that the apple-touch-icon should be 57x57 pixels but cite a broken link as their source.</p> <p><a href="http://www.hanselman.com/blog/MakeYourWebsiteMobileAndIPhoneFriendlyAddHomeScreenIPhoneIconsAndAdjustTheViewPort.aspx" rel="norefer...
[ { "answer_id": 19934092, "author": "felipep", "author_id": 2046846, "author_profile": "https://Stackoverflow.com/users/2046846", "pm_score": 0, "selected": false, "text": "<link rel=\"apple-touch-icon\" href=\"touch-icon-iphone.png\">\n<link rel=\"apple-touch-icon\" sizes=\"76x76\" href=...
2008/08/04
[ "https://Stackoverflow.com/questions/1598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83/" ]
1,600
<p>When I want to make a copy of a database, I always create a new empty database, and then restore a backup of the existing database into it. However, I'm wondering if this is really the least error-prone, least complicated, and most efficient way to do this?</p>
[ { "answer_id": 1646, "author": "brendan", "author_id": 225, "author_profile": "https://Stackoverflow.com/users/225", "pm_score": 2, "selected": false, "text": "\nDeclare @OldDB varchar(100)\nDeclare @NewDB varchar(100)\nDeclare @vchBackupPath varchar(255)\nDeclare @query varchar(8000)\n\...
2008/08/04
[ "https://Stackoverflow.com/questions/1600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230/" ]
1,607
<p>What are the best methods for tracking and/or automating DB schema changes? Our team uses Subversion for version control and we've been able to automate some of our tasks this way (pushing builds up to a staging server, deploying tested code to a production server) but we're still doing database updates manually. ...
[ { "answer_id": 6226, "author": "Fabio Gomes", "author_id": 727, "author_profile": "https://Stackoverflow.com/users/727", "pm_score": 3, "selected": false, "text": "RegisterUpgrade(1, 'ALTER TABLE XX ADD XY CHAR(1) NOT NULL;');" }, { "answer_id": 22535, "author": "rix0rrr", ...
2008/08/04
[ "https://Stackoverflow.com/questions/1607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/72/" ]
1,610
<p>If I'm adding a column to a table in Microsoft SQL Server, can I control where the column is displayed logically in queries?</p> <p>I don't want to mess with the physical layout of columns on disk, but I would like to logically group columns together when possible so that tools like SQL Server Management Studio lis...
[ { "answer_id": 3571, "author": "Otto", "author_id": 519, "author_profile": "https://Stackoverflow.com/users/519", "pm_score": 3, "selected": false, "text": "SELECT * FROM TABLE" }, { "answer_id": 26786408, "author": "Steven", "author_id": 4224071, "author_profile": "h...
2008/08/04
[ "https://Stackoverflow.com/questions/1610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/328/" ]
1,615
<p>The <code>.XFDL</code> file extension identifies <code>XFDL</code> Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications.</p> <p>I know how to view XF...
[ { "answer_id": 1628, "author": "saniul", "author_id": 52, "author_profile": "https://Stackoverflow.com/users/52", "pm_score": 4, "selected": true, "text": "application/vnd.xfdl;content-encoding=\"base64-gzip\"\n" }, { "answer_id": 3375, "author": "Federico Builes", "autho...
2008/08/04
[ "https://Stackoverflow.com/questions/1615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25/" ]
1,644
<p>Yes, Podcasts, those nice little Audiobooks I can listen to on the way to work. With the current amount of Podcasts, it's like searching a needle in a haystack, except that the haystack happens to be the Internet and is filled with too many of these &quot;Hot new Gadgets&quot; stuff :(</p> <p>Now, even though <stron...
[ { "answer_id": 28336, "author": "Craig", "author_id": 2894, "author_profile": "https://Stackoverflow.com/users/2894", "pm_score": 0, "selected": false, "text": " .NET Rocks!\n RunAs Radio\n TWiT\n Stack Overflow (but then again, we wouldn't be in Beta if we didn't)\n Channel 9\n Ha...
2008/08/04
[ "https://Stackoverflow.com/questions/1644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91/" ]
1,669
<p><em>Preferred languages</em>: C/C++, Java, and Ruby.</p> <p>I am looking for some helpful books/tutorials on how to write your own compiler simply for educational purposes. I am most familiar with C/C++, Java, and Ruby, so I prefer resources that involve one of those three, but any good resource is acceptable.</p>
[ { "answer_id": 6695987, "author": "timaschew", "author_id": 736518, "author_profile": "https://Stackoverflow.com/users/736518", "pm_score": 3, "selected": false, "text": "public String maxAsString(int a, int b) {\n if (a > b) {\n return Integer.valueOf(a).toString();\n } els...
2008/08/04
[ "https://Stackoverflow.com/questions/1669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340/" ]
1,709
<p>My dilemma is, basically, how to share an enumeration between two applications.</p> <p>The users upload documents through a front-end application that is on the web. This application calls a web service of the back-end application and passes the document to it. The back-end app saves the document and inserts a row ...
[ { "answer_id": 1733, "author": "lubos hasko", "author_id": 275, "author_profile": "https://Stackoverflow.com/users/275", "pm_score": 3, "selected": false, "text": "public enum DocumentType\n{\n Invoice,\n Contract,\n WorkOrder,\n SignedWorkOrder\n}\n\n[WebMethod]\npublic void UploadD...
2008/08/04
[ "https://Stackoverflow.com/questions/1709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/349/" ]
1,746
<p>I am trying to grab the capital letters of a couple of words and wrap them in span tags. I am using <a href="http://php.net/manual/en/function.preg-replace.php" rel="noreferrer">preg_replace</a> for extract and wrapping purposes, but it's not outputting anything.</p> <pre><code>preg_replace("/[A-Z]/", "&lt;span cla...
[ { "answer_id": 1749, "author": "Polsonby", "author_id": 137, "author_profile": "https://Stackoverflow.com/users/137", "pm_score": 7, "selected": true, "text": "/([A-Z])/" }, { "answer_id": 31874, "author": "John Douthat", "author_id": 2774, "author_profile": "https://...
2008/08/05
[ "https://Stackoverflow.com/questions/1746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/137/" ]
1,762
<p>I am trying to set a flag to show or hide a page element, but it always displays even when the expression is false. </p> <pre><code>$canMerge = ($condition1 &amp;&amp; $condition2) ? 'true' : 'false'; ... &lt;?php if ($canMerge) { ?&gt;Stuff&lt;?php } ?&gt; </code></pre> <p>What's up?</p>
[ { "answer_id": 1764, "author": "Polsonby", "author_id": 137, "author_profile": "https://Stackoverflow.com/users/137", "pm_score": 1, "selected": false, "text": "$canMerge = ($condition1 && $condition2) ? true : false;\n" }, { "answer_id": 1771, "author": "Rudd Zwolinski", ...
2008/08/05
[ "https://Stackoverflow.com/questions/1762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/137/" ]
1,790
<p>Is it possible to create "federated" Subversion servers? As in one server at location A and another at location B that sync up their local versions of the repository automatically. That way when someone at either location interacts with the repository they are accessing their respective local server and therefore h...
[ { "answer_id": 60893155, "author": "bahrep", "author_id": 761095, "author_profile": "https://Stackoverflow.com/users/761095", "pm_score": 0, "selected": false, "text": "SVK" } ]
2008/08/05
[ "https://Stackoverflow.com/questions/1790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194/" ]
1,829
<p>I've got a menu in Python. That part was easy. I'm using <code>raw_input()</code> to get the selection from the user. </p> <p>The problem is that <code>raw_input</code> (and input) require the user to press <kbd>Enter</kbd> after they make a selection. Is there any way to make the program act immediately upon a key...
[ { "answer_id": 1852, "author": "Mark Harrison", "author_id": 116, "author_profile": "https://Stackoverflow.com/users/116", "pm_score": 4, "selected": true, "text": "import msvcrt\nanswer=msvcrt.getch()\n" }, { "answer_id": 1870, "author": "Grant", "author_id": 30, "au...
2008/08/05
[ "https://Stackoverflow.com/questions/1829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30/" ]
1,836
<p>OK. This is a bit of a vanity app, but I had a situation today at work where I was in a training class and the machine was set to lock every 10 minutes. Well, if the trainers got excited about talking - as opposed to changing slides - the machine would lock up.</p> <p>I'd like to write a teeny app that has nothing...
[ { "answer_id": 1843, "author": "lubos hasko", "author_id": 275, "author_profile": "https://Stackoverflow.com/users/275", "pm_score": 6, "selected": true, "text": "using System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nstatic class Program\n{\n static void Main()\n {\n...
2008/08/05
[ "https://Stackoverflow.com/questions/1836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/172/" ]
1,854
<p>What do I need to look at to see whether I'm on Windows or Unix, etc?</p>
[ { "answer_id": 1857, "author": "Louis Brandy", "author_id": 2089740, "author_profile": "https://Stackoverflow.com/users/2089740", "pm_score": 11, "selected": true, "text": ">>> import os\n>>> os.name\n'posix'\n>>> import platform\n>>> platform.system()\n'Linux'\n>>> platform.release()\n'...
2008/08/05
[ "https://Stackoverflow.com/questions/1854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/116/" ]
1,873
<p>How do I delimit a Javascript data-bound string parameter in an anchor <code>OnClick</code> event?</p> <ul> <li>I have an anchor tag in an ASP.NET Repeater control.</li> <li>The <code>OnClick</code> event of the anchor contains a call to a Javascript function.</li> <li>The Javascript function takes a string for its ...
[ { "answer_id": 1875, "author": "Grant", "author_id": 30, "author_profile": "https://Stackoverflow.com/users/30", "pm_score": 2, "selected": false, "text": "value = value + \"\"\n" }, { "answer_id": 1881, "author": "Shawn", "author_id": 26, "author_profile": "https://S...
2008/08/05
[ "https://Stackoverflow.com/questions/1873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242/" ]
1,898
<p>What's the best way to import a CSV file into a strongly-typed data structure?</p>
[ { "answer_id": 1912, "author": "Mike Stone", "author_id": 122, "author_profile": "https://Stackoverflow.com/users/122", "pm_score": 0, "selected": false, "text": "String[] values = myString.Split(',');\nmyObject.StringField = values[0];\nmyObject.IntField = Int32.Parse(values[1]);\n" }...
2008/08/05
[ "https://Stackoverflow.com/questions/1898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/81/" ]
1,908
<p>I have a bunch of latitude/longitude pairs that map to known x/y coordinates on a (geographically distorted) map.</p> <p>Then I have one more latitude/longitude pair. I want to plot it on the map as best is possible. How do I go about doing this?</p> <p>At first I decided to create a system of linear equations for...
[ { "answer_id": 1945, "author": "fastcall", "author_id": 328, "author_profile": "https://Stackoverflow.com/users/328", "pm_score": 4, "selected": true, "text": "estimate-latitude-longitude (x, y)\n\n numerator-latitude := 0\n numerator-longitude := 0\n denominator := 0\n\n for...
2008/08/05
[ "https://Stackoverflow.com/questions/1908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/79/" ]
1,936
<p>Using ASP.NET MVC there are situations (such as form submission) that may require a <code>RedirectToAction</code>. </p> <p>One such situation is when you encounter validation errors after a form submission and need to redirect back to the form, but would like the URL to reflect the URL of the form, not the action ...
[ { "answer_id": 1940, "author": "Matt Mitchell", "author_id": 364, "author_profile": "https://Stackoverflow.com/users/364", "pm_score": 7, "selected": true, "text": "public ActionResult Send()\n{\n TempData[\"form\"] = Request.Form;\n return this.RedirectToAction(a => a.Form());\n}\...
2008/08/05
[ "https://Stackoverflow.com/questions/1936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364/" ]
1,949
<p>In order to fully use LinqToSql in an ASP.net 3.5 application, it is necessary to create <a href="http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.aspx" rel="noreferrer">DataContext</a> <a href="http://dotnetslackers.com/articles/csharp/InsideTheLINQToSQLDataContextClass.aspx" rel="noreferrer">cl...
[ { "answer_id": 5310, "author": "Evan", "author_id": 667, "author_profile": "https://Stackoverflow.com/users/667", "pm_score": 6, "selected": true, "text": "Should be used very carefully after\nany SumbitChanges() operation.\n" } ]
2008/08/05
[ "https://Stackoverflow.com/questions/1949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51/" ]
1,983
<p>In many places, <code>(1,2,3)</code> (a tuple) and <code>[1,2,3]</code> (a list) can be used interchangeably.</p> <p>When should I use one or the other, and why?</p>
[ { "answer_id": 1987, "author": "sparkes", "author_id": 269, "author_profile": "https://Stackoverflow.com/users/269", "pm_score": 5, "selected": false, "text": "[1,2,3]" }, { "answer_id": 4595, "author": "HS.", "author_id": 618, "author_profile": "https://Stackoverflow...
2008/08/05
[ "https://Stackoverflow.com/questions/1983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/116/" ]
1,988
<p>I have read a lot that LISP can redefine syntax on the fly, presumably with macros. I am curious how far does this actually go? Can you redefine the language structure so much that it borderline becomes a compiler for another language? For example, could you change the functional nature of LISP into a more object...
[ { "answer_id": 63737, "author": "Eric Normand", "author_id": 7492, "author_profile": "https://Stackoverflow.com/users/7492", "pm_score": 6, "selected": true, "text": "(loop for x from 0 below 100\n when (even x)\n collect x)\n" }, { "answer_id": 74199, "author": "Je...
2008/08/05
[ "https://Stackoverflow.com/questions/1988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122/" ]
1,994
<p>When you data bind in C#, the thread that changes the data causes the control to change too. But if this thread is not the one on which the control was created, you'll get an Illegal Cross Thread Operation exception.</p> <p>Is there anyway to prevent this?</p>
[ { "answer_id": 1998, "author": "Mike Stone", "author_id": 122, "author_profile": "https://Stackoverflow.com/users/122", "pm_score": 3, "selected": false, "text": "if (control.InvokeRequired)\n{\n control.Invoke(delegateWithMyCode);\n}\nelse\n{\n delegateWithMyCode();\n}\n" }, {...
2008/08/05
[ "https://Stackoverflow.com/questions/1994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/195/" ]
1,995
<p>I have values stored as strings in a <code>DataTable</code> where each value could really represent an <code>int</code>, <code>double</code>, or <code>string</code> (they were all converted to strings during an import process from an external data source). I need to test and see what type each value really is.</p> ...
[ { "answer_id": 7257, "author": "Keith", "author_id": 905, "author_profile": "https://Stackoverflow.com/users/905", "pm_score": 3, "selected": false, "text": "object o;\n\n//checking with is\no is int\n\n//check type\no.GetType() != typeof( int )\n\n//cast and catch exception\ntry{ int j ...
2008/08/05
[ "https://Stackoverflow.com/questions/1995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51/" ]
2,027
<p>When learning a new programming language, one of the possible roadblocks you might encounter is the question whether the language is, by default, <em>pass-by-value or pass-by-reference</em>.</p> <p>So here is my question to all of you, in your favorite language, <em>how</em> is it actually done? And what are the <e...
[ { "answer_id": 2028, "author": "sven", "author_id": 46, "author_profile": "https://Stackoverflow.com/users/46", "pm_score": 5, "selected": false, "text": "public void swap(int x, int y)\n{\n int tmp = x;\n x = y;\n y = tmp;\n}\n" }, { "answer_id": 2554, "author": "sven", ...
2008/08/05
[ "https://Stackoverflow.com/questions/2027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46/" ]
2,034
<p>What do the result codes in SVN mean? I need a quick reference.</p>
[ { "answer_id": 13418, "author": "Matt Miller", "author_id": 763, "author_profile": "https://Stackoverflow.com/users/763", "pm_score": 7, "selected": false, "text": "U filename.1\n U filename.2 \nUU filename.3\n" }, { "answer_id": 6028405, "author": "Taryn East", "aut...
2008/08/05
[ "https://Stackoverflow.com/questions/2034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/137/" ]
2,041
<p>How do I create a branch in SVN?</p>
[ { "answer_id": 2042, "author": "sparkes", "author_id": 269, "author_profile": "https://Stackoverflow.com/users/269", "pm_score": 9, "selected": false, "text": "svn copy" }, { "answer_id": 2310, "author": "Ronnie", "author_id": 193, "author_profile": "https://Stackover...
2008/08/05
[ "https://Stackoverflow.com/questions/2041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/269/" ]
2,046
<p>As a novice in practicing test-driven development, I often end up in a quandary as to how to unit test persistence to a database.</p> <p>I know that technically this would be an integration test (not a unit test), but I want to find out the best strategies for the following:</p> <ol> <li>Testing queries. </li> <li...
[ { "answer_id": 2096, "author": "Rytmis", "author_id": 266, "author_profile": "https://Stackoverflow.com/users/266", "pm_score": 2, "selected": false, "text": "NHibernate" }, { "answer_id": 2099, "author": "Dan", "author_id": 230, "author_profile": "https://Stackoverfl...
2008/08/05
[ "https://Stackoverflow.com/questions/2046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/372/" ]
2,056
<p>When looking beyond the <a href="https://en.wikipedia.org/wiki/Rapid_application_development" rel="noreferrer">RAD</a> (drag-drop and configure) way of building user interfaces that many tools encourage you are likely to come across three design patterns called <a href="http://en.wikipedia.org/wiki/Model%E2%80%93vie...
[ { "answer_id": 5712, "author": "Jonas Follesø", "author_id": 1199387, "author_profile": "https://Stackoverflow.com/users/1199387", "pm_score": 5, "selected": false, "text": "public class CustomerView : ICustomerView\n{\n public string Name\n { \n get { return txtName.Text; }...
2008/08/05
[ "https://Stackoverflow.com/questions/2056", "https://Stackoverflow.com", "https://Stackoverflow.com/users/358/" ]
2,092
<p>Looking for books or other references that discuss actually <em>how</em> to write a code coverage tool in Java; some of the various techniques or tricks - source vs. byte code instrumentation. </p> <p>This is for a scripting language that generates Java byte code under the hood.</p>
[ { "answer_id": 7076, "author": "Dominic Cooney", "author_id": 878, "author_profile": "https://Stackoverflow.com/users/878", "pm_score": 3, "selected": false, "text": "class com.foo.Bar.class" } ]
2008/08/05
[ "https://Stackoverflow.com/questions/2092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
2,120
<p>I want to get the MD5 Hash of a string value in SQL Server 2005. I do this with the following command:</p> <pre><code>SELECT HashBytes('MD5', 'HelloWorld') </code></pre> <p>However, this returns a VarBinary instead of a VarChar value. If I attempt to convert <code>0x68E109F0F40CA72A15E05CC22786F8E6</code> into a V...
[ { "answer_id": 2382, "author": "GateKiller", "author_id": 383, "author_profile": "https://Stackoverflow.com/users/383", "pm_score": 8, "selected": true, "text": "SELECT SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5', 'HelloWorld')), 3, 32)\n" }, { "answer_id": 4585246, ...
2008/08/05
[ "https://Stackoverflow.com/questions/2120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383/" ]
2,123
<p><code>Checkboxes</code> in <code>HTML</code> forms don't have implicit <em>labels</em> with them. Adding an explicit label (some text) next to it doesn't toggle the <code>checkbox</code>.</p> <p><strong>How do I make a checkbox toggle from clicking on the text label as well?</strong></p>
[ { "answer_id": 2133, "author": "GateKiller", "author_id": 383, "author_profile": "https://Stackoverflow.com/users/383", "pm_score": 6, "selected": false, "text": "<label for=\"surname\">Surname</label>\n<input type=\"checkbox\" name=\"surname\" id=\"surname\" />\n" }, { "answer_i...
2008/08/05
[ "https://Stackoverflow.com/questions/2123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193/" ]
2,134
<p>I have come across a lot of optimization tips which say that you should mark your classes as sealed to get extra performance benefits.</p> <p>I ran some tests to check the performance differential and found none. Am I doing something wrong? Am I missing the case where sealed classes will give better results?</p> <...
[ { "answer_id": 390627, "author": "Cameron MacFarland", "author_id": 3820, "author_profile": "https://Stackoverflow.com/users/3820", "pm_score": 7, "selected": false, "text": "call" }, { "answer_id": 1769457, "author": "Jason Orendorff", "author_id": 94977, "author_pro...
2008/08/05
[ "https://Stackoverflow.com/questions/2134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/380/" ]
2,138
<p>Can a LINQ enabled app run on a machine that only has the .NET 2.0 runtime installed?</p> <p>In theory, LINQ is nothing more than syntactic sugar, and the resulting IL code should look the same as it would have in .NET 2.0.</p> <p>How can I write LINQ without using the .NET 3.5 libraries? Will it run on .NET 2.0?<...
[ { "answer_id": 193090, "author": "Scott Wisniewski", "author_id": 1737192, "author_profile": "https://Stackoverflow.com/users/1737192", "pm_score": 3, "selected": false, "text": "dim q = from x in xs where x > 2 select x*4;\n" }, { "answer_id": 883745, "author": "Lucas", ...
2008/08/05
[ "https://Stackoverflow.com/questions/2138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373/" ]
2,155
<p>The web applications I develop often require co-dependent configuration settings and there are also settings that have to change as we move between each of our environments.</p> <p>All our settings are currently simple key-value pairs but it would be useful to create custom config sections so that it is obvious when...
[ { "answer_id": 2219, "author": "Ishmaeel", "author_id": 227, "author_profile": "https://Stackoverflow.com/users/227", "pm_score": 4, "selected": false, "text": "public class MyStuffSection : ConfigurationSection\n{\n ConfigurationProperty _MyStuffElement;\n\n public MyStuffSection(...
2008/08/05
[ "https://Stackoverflow.com/questions/2155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/371/" ]
2,158
<p>Is there a way to create a <code>JButton</code> with your own button graphic and not just with an image inside the button? </p> <p>If not, is there another way to create a custom <code>JButton</code> in java?</p>
[ { "answer_id": 2181, "author": "John Downey", "author_id": 200, "author_profile": "https://Stackoverflow.com/users/200", "pm_score": 3, "selected": false, "text": "javax.swing.AbstractButton" }, { "answer_id": 2210, "author": "rjohnston", "author_id": 246, "author_pro...
2008/08/05
[ "https://Stackoverflow.com/questions/2158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340/" ]
2,209
<p>I specifically want to add the style of <code>background-color</code> to the <code>&lt;body&gt;</code> tag of a master page, from the code behind (C#) of a content page that uses that master page. </p> <p>I have different content pages that need to make the master page has different colors depending on which conte...
[ { "answer_id": 2233, "author": "Adhip Gupta", "author_id": 384, "author_profile": "https://Stackoverflow.com/users/384", "pm_score": 4, "selected": true, "text": "<body runat=\"server\" id=\"masterpageBody\">\n" }, { "answer_id": 2291, "author": "Bryan Denny", "author_id"...
2008/08/05
[ "https://Stackoverflow.com/questions/2209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396/" ]
2,222
<p>I'm currently working on an application with a frontend written in Adobe Flex 3. I'm aware of <a href="http://code.google.com/p/as3flexunitlib/" rel="noreferrer">FlexUnit</a> but what I'd really like is a unit test runner for Ant/NAnt and a runner that integrates with the Flex Builder IDE (AKA Eclipse). Does one exi...
[ { "answer_id": 8753, "author": "Theo", "author_id": 1109, "author_profile": "https://Stackoverflow.com/users/1109", "pm_score": 4, "selected": true, "text": "<target name=\"run-tests\" depends=\"compile-tests\">\n <flexunit swf=\"${build.home}/tests.swf\" failonerror=\"true\"/>\n</targe...
2008/08/05
[ "https://Stackoverflow.com/questions/2222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/266/" ]
2,232
<p>How do I call shell commands from inside of a Ruby program? How do I then get output from these commands back into Ruby?</p>
[ { "answer_id": 2280, "author": "Steve Willard", "author_id": 402, "author_profile": "https://Stackoverflow.com/users/402", "pm_score": 5, "selected": false, "text": "$ irb \nsystem \"echo Hi\"\nHi\n=> true\n" }, { "answer_id": 2334, "author": "Rufo Sanchez", "author_id": ...
2008/08/05
[ "https://Stackoverflow.com/questions/2232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25/" ]
2,256
<p>Is there a way of mapping data collected on a stream or array to a data structure or vice-versa? In C++ this would simply be a matter of casting a pointer to the stream as a data type I want to use (or vice-versa for the reverse) eg: in C++</p> <pre><code>Mystruct * pMyStrct = (Mystruct*)&amp;SomeDataStream; pMyStr...
[ { "answer_id": 2322, "author": "Antonio Haley", "author_id": 390, "author_profile": "https://Stackoverflow.com/users/390", "pm_score": 2, "selected": false, "text": "public virtual bool SetMessageBytes(byte[] message)\n {\n MemberInfo[] members = FormatterServices.GetSerializab...
2008/08/05
[ "https://Stackoverflow.com/questions/2256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/379/" ]
2,262
<p>How do I rewrite a URL in ASP.NET?</p> <p>I would like users to be able to go to</p> <pre><code>http://www.website.com/users/smith </code></pre> <p>instead of</p> <pre><code>http://www.website.com/?user=smith </code></pre>
[ { "answer_id": 2268, "author": "Nick Berardi", "author_id": 17, "author_profile": "https://Stackoverflow.com/users/17", "pm_score": 6, "selected": true, "text": "# clean up old rules and forward to new URL\nRewriteRule ^/?user=(.*) /users/$1 [NC,R=301]\n\n# rewrite the rule internally\n...
2008/08/05
[ "https://Stackoverflow.com/questions/2262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383/" ]
2,267
<p>I am building a web page to show a customer what software they purchased and to give them a link to download said software. Unfortunately, the data on what was purchased and the download information are in separate databases so I can't just take care of it with joins in an SQL query.</p> <p>The common item is SKU....
[ { "answer_id": 2324, "author": "Yaakov Ellis", "author_id": 51, "author_profile": "https://Stackoverflow.com/users/51", "pm_score": 2, "selected": false, "text": "select p.Date,\n p.Amount,\n d.SoftwareName,\n d.DownloadLink\nfrom PurchaseDB.dbo.Purchases as p\njoin ...
2008/08/05
[ "https://Stackoverflow.com/questions/2267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111/" ]
2,300
<p>I want to be able to do:</p> <pre><code>For Each thing In things End For </code></pre> <p>CLASSIC ASP - NOT .NET!</p>
[ { "answer_id": 7725, "author": "svandragt", "author_id": 997, "author_profile": "https://Stackoverflow.com/users/997", "pm_score": 4, "selected": false, "text": "dim cars(2),x\ncars(0)=\"Volvo\"\ncars(1)=\"Saab\"\ncars(2)=\"BMW\"\n\nFor Each x in cars\n response.write(x & \"<br />\")\nN...
2008/08/05
[ "https://Stackoverflow.com/questions/2300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193/" ]
2,308
<p>I see in the Stack Overflow footer that the SVN Revision number is displayed. Is this automated and if so, how does one implement it in ASP.NET?</p> <p><em>(Solutions in other languages are acceptable)</em></p>
[ { "answer_id": 2320, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 4, "selected": true, "text": "vn:keywords \"Rev Id\"" }, { "answer_id": 8159, "author": "David A Gibson", "author_id": 982, "author_prof...
2008/08/05
[ "https://Stackoverflow.com/questions/2308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383/" ]
2,311
<p>I have created a PHP-script to update a web server that is live inside a local directory. I'm migrating the script into Python. It works fine for the most part, but after a PUT command, the size of the file appears to change. Thus, the size of the file is different from that of the file on the server. </p> <p>Once ...
[ { "answer_id": 2316, "author": "David Sykes", "author_id": 259, "author_profile": "https://Stackoverflow.com/users/259", "pm_score": 5, "selected": true, "text": "rb" } ]
2008/08/05
[ "https://Stackoverflow.com/questions/2311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/394/" ]
2,328
<p>I have a problem with maintaining state in an ASP.NET AJAX page. Short version: I need some way to update the page ViewState after an async callback has been made, to reflect any state changes the server made during the async call. </p> <p>This seems to be a common problem, but I will describe my scenario to help e...
[ { "answer_id": 5640, "author": "Rex M", "author_id": 67, "author_profile": "https://Stackoverflow.com/users/67", "pm_score": 0, "selected": false, "text": "RadAjaxManager" } ]
2008/08/05
[ "https://Stackoverflow.com/questions/2328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67/" ]
2,348
<p>In the code below</p> <pre><code>For i = LBound(arr) To UBound(arr) </code></pre> <p>What is the point in asking using <code>LBound</code>? Surely that is always 0.</p>
[ { "answer_id": 2378, "author": "huseyint", "author_id": 39, "author_profile": "https://Stackoverflow.com/users/39", "pm_score": 2, "selected": false, "text": "Option Base 1\n" }, { "answer_id": 2393, "author": "Chris Farmer", "author_id": 404, "author_profile": "https...
2008/08/05
[ "https://Stackoverflow.com/questions/2348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193/" ]
2,349
<p>In Windows, in any windows form or web browser, you can use the tab button to switch focus through all of the form fields. </p> <p>It will stop on textboxes, radiobuttons, checkboxes, dropdown menus, etc. </p> <p>However, in Mac OSX, tab skips dropdown menus. Is there anyway to change this behavior, or access the ...
[ { "answer_id": 21210, "author": "James A. Rosen", "author_id": 1190, "author_profile": "https://Stackoverflow.com/users/1190", "pm_score": 1, "selected": false, "text": "accessibility.tabfocus" } ]
2008/08/05
[ "https://Stackoverflow.com/questions/2349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26/" ]
2,384
<p>I'm trying to read binary data using C#. I have all the information about the layout of the data in the files I want to read. I'm able to read the data "chunk by chunk", i.e. getting the first 40 bytes of data converting it to a string, get the next 40 bytes.</p> <p>Since there are at least three slightly different...
[ { "answer_id": 2436, "author": "urini", "author_id": 373, "author_profile": "https://Stackoverflow.com/users/373", "pm_score": 0, "selected": false, "text": "using (FileStream stream = new FileStream(fileName, FileMode.Open))\n{\n BinaryFormatter formatter = new BinaryFormatter();\n ...
2008/08/05
[ "https://Stackoverflow.com/questions/2384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/143/" ]
2,472
<p>What is the best way to record statistics on the number of visitors visiting my site that have set their browser to block ads?</p>
[ { "answer_id": 2478, "author": "Jonathan Works", "author_id": 309844, "author_profile": "https://Stackoverflow.com/users/309844", "pm_score": 3, "selected": false, "text": "<img src=\"./ads/viagra.jpg?{user.id}\"/>\n" }, { "answer_id": 4187, "author": "Michal Sznajder", "...
2008/08/05
[ "https://Stackoverflow.com/questions/2472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/116/" ]
2,481
<p>I've been able to find details on several self-balancing <code>BST</code>s through several sources, but I haven't found any good descriptions detailing which one is best to use in different situations (or if it really doesn't matter). </p> <p>I want a <code>BST</code> that is optimal for storing in excess of ten m...
[ { "answer_id": 2498, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "BST" }, { "answer_id": 33692, "author": "jmbucknall", "author_id": 806, "author_profile": "https://Stackover...
2008/08/05
[ "https://Stackoverflow.com/questions/2481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/152/" ]
2,483
<p>What is actually the difference between these two casts?</p> <pre><code>SomeClass sc = (SomeClass)SomeObject; SomeClass sc2 = SomeObject as SomeClass; </code></pre> <p>Normally, shouldn't they both be explicit casts to the specified type?</p>
[ { "answer_id": 2522, "author": "denny", "author_id": 27, "author_profile": "https://Stackoverflow.com/users/27", "pm_score": 5, "selected": false, "text": "double d = 5.34;\nint i = d as int;\n" }, { "answer_id": 2614, "author": "Nick Berardi", "author_id": 17, "autho...
2008/08/05
[ "https://Stackoverflow.com/questions/2483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91/" ]
2,509
<p>Test Driven Development has been the rage in the .NET community for the last few years. Recently, I have heard grumblings in the ALT.NET community about BDD. What is it? What makes it different from TDD?</p>
[ { "answer_id": 2548, "author": "Christian Lescuyer", "author_id": 341, "author_profile": "https://Stackoverflow.com/users/341", "pm_score": 8, "selected": true, "text": "Story: User logging in\n As a user\n I want to login with my details\n So that I can get access to the site\n\nScen...
2008/08/05
[ "https://Stackoverflow.com/questions/2509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/303/" ]
2,518
<p>I have 2 SQLite databases, one downloaded from a server (<code>server.db</code>), and one used as storage on the client (<code>client.db</code>). I need to perform various sync queries on the client database, using data from the server database.</p> <p>For example, I want to delete all rows in the <code>client.db t...
[ { "answer_id": 8783, "author": "Theo", "author_id": 1109, "author_profile": "https://Stackoverflow.com/users/1109", "pm_score": 2, "selected": false, "text": "ATTACH DATABASE path/to/other.db AS otherDb" }, { "answer_id": 10020, "author": "Theo", "author_id": 1109, "a...
2008/08/05
[ "https://Stackoverflow.com/questions/2518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26/" ]
2,524
<p>I get the following error pretty regularly when compiling in Visual Studio and running my web application:</p> <p>"Unable to start debugging on the web server. The web server did not respond in a timely manner. This may be because another debugger is already attached to the web server."</p> <p>Normally this is af...
[ { "answer_id": 27973753, "author": "Alberto Montellano", "author_id": 2848629, "author_profile": "https://Stackoverflow.com/users/2848629", "pm_score": 5, "selected": false, "text": "iisreset /restart" }, { "answer_id": 34310844, "author": "Reg Edit", "author_id": 1657610...
2008/08/05
[ "https://Stackoverflow.com/questions/2524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417/" ]
2,525
<p>My product has several components: ASP.NET, Windows Forms App and Windows Service. 95% or so of the code is written in VB.NET.</p> <p>For Intellectual Property reasons, I need to obfuscate the code, and until now I have been using a version of dotfuscator which is now over 5 years old. I'm thinking it is time to mo...
[ { "answer_id": 8739, "author": "Keith", "author_id": 905, "author_profile": "https://Stackoverflow.com/users/905", "pm_score": 7, "selected": true, "text": "var" } ]
2008/08/05
[ "https://Stackoverflow.com/questions/2525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350/" ]
2,527
<p>How can I find out which node in a tree list the context menu has been activated? For instance right-clicking a node and selecting an option from the menu. </p> <p>I can't use the TreeViews' <code>SelectedNode</code> property because the node is only been right-clicked and not selected.</p>
[ { "answer_id": 2546, "author": "Jonesinator", "author_id": 152, "author_profile": "https://Stackoverflow.com/users/152", "pm_score": 8, "selected": true, "text": "void treeView1MouseUp(object sender, MouseEventArgs e)\n{\n if(e.Button == MouseButtons.Right)\n {\n // Select t...
2008/08/05
[ "https://Stackoverflow.com/questions/2527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428/" ]
2,530
<p>How do you disable autocomplete in the major browsers for a specific input (or form field)?</p>
[ { "answer_id": 2531, "author": "nlucaroni", "author_id": 157, "author_profile": "https://Stackoverflow.com/users/157", "pm_score": 12, "selected": true, "text": "autocomplete=\"off\"" }, { "answer_id": 2537, "author": "brendan", "author_id": 225, "author_profile": "ht...
2008/08/05
[ "https://Stackoverflow.com/questions/2530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307/" ]
2,550
<p>A quick glance at the present-day internet would seem to indicate that Adobe Flash is the obvious choice for embedding video in a web page. Is this accurate, or are they other effective choices? Does the choice of ASP.NET as a platform influence this decision?</p>
[ { "answer_id": 922247, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "<object width=\"660\" height=\"525\"><param name=\"movie\" value=\"http://www.youtube.com/v/WAQUskZuXhQ&hl=en&fs=1&color1=0x00...
2008/08/05
[ "https://Stackoverflow.com/questions/2550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/308/" ]
2,630
<p>I just found /n softwares free Powershell NetCmdlets, and after playing with them I love the functionality they bring to the command line. So it raises the question what are your favorite Cmdlets, and how do you use them?</p>
[ { "answer_id": 4692, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 2, "selected": false, "text": "cd" }, { "answer_id": 5498, "author": "Leon Bambrick", "author_id": 49, "author_profile": "https://Sta...
2008/08/05
[ "https://Stackoverflow.com/questions/2630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17/" ]
2,647
<p>Using SQL Server, how do I split a string so I can access item x?</p> <p>Take a string "Hello John Smith". How can I split the string by space and access the item at index 1 which should return "John"?</p>
[ { "answer_id": 2657, "author": "Jonesinator", "author_id": 152, "author_profile": "https://Stackoverflow.com/users/152", "pm_score": 9, "selected": true, "text": "Declare @products varchar(200) = '1|20|3|343|44|6|8765'\nDeclare @individual varchar(20) = null\n\nWHILE LEN(@products) > 0\n...
2008/08/05
[ "https://Stackoverflow.com/questions/2647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383/" ]
2,649
<p>When writing a T-SQL script that I plan on re-running, often times I use temporary tables to store temporary data. Since the temp table is created on the fly, I'd like to be able to drop that table only if it exists (before I create it).</p> <p>I'll post the method that I use, but I'd like to see if there is a bet...
[ { "answer_id": 2652, "author": "Nathan Bedford", "author_id": 434, "author_profile": "https://Stackoverflow.com/users/434", "pm_score": 4, "selected": false, "text": "IF OBJECT_ID('tempdb..#t1', 'U') IS NOT NULL\n DROP TABLE #t1\n\nCREATE TABLE #t1\n(\n id INT IDENTITY(1,1),\n msg VAR...
2008/08/05
[ "https://Stackoverflow.com/questions/2649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434/" ]
2,658
<p>I need to implement version control, even for just the developing I do at home. I have read about how great subversion is for the past couple of years and was about to dedicate myself to learning this on the side until I heard about Git being the up and coming version control system.</p> <p>Given the situation, sho...
[ { "answer_id": 2668, "author": "Jonathan Works", "author_id": 309844, "author_profile": "https://Stackoverflow.com/users/309844", "pm_score": 7, "selected": true, "text": "cvs<->svn<->git<->hg\n" }, { "answer_id": 10774, "author": "Orion Edwards", "author_id": 234, "a...
2008/08/05
[ "https://Stackoverflow.com/questions/2658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/406/" ]
2,688
<p>When you execute a SQL query, you have to clean your strings or users can execute malicious SQL on your website.</p> <p>I usually just have a function escape_string(blah), which:</p> <ul> <li>Replaces escapes (<code>\</code>) with double escapes (<code>\\</code>).</li> <li>Replaces single quotes (<code>'</code>) w...
[ { "answer_id": 2691, "author": "GateKiller", "author_id": 383, "author_profile": "https://Stackoverflow.com/users/383", "pm_score": 2, "selected": false, "text": "--\n" }, { "answer_id": 2727, "author": "TiTi", "author_id": 435, "author_profile": "https://Stackoverflo...
2008/08/05
[ "https://Stackoverflow.com/questions/2688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432/" ]
2,702
<p>I know I need to have (although I don't know why) a <code>GROUP BY</code> clause on the end of a SQL query that uses any aggregate functions like <code>count</code>, <code>sum</code>, <code>avg</code>, etc:</p> <pre><code>SELECT count(userID), userName FROM users GROUP BY userName </code></pre> <p>When else would ...
[ { "answer_id": 2704, "author": "GateKiller", "author_id": 383, "author_profile": "https://Stackoverflow.com/users/383", "pm_score": 2, "selected": false, "text": "SELECT TagName, Count(*)\nAS TimesUsed\nFROM Tags\nGROUP BY TagName ORDER TimesUsed\n" }, { "answer_id": 2736, "a...
2008/08/05
[ "https://Stackoverflow.com/questions/2702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/357/" ]
2,714
<p>I think most people know how to do this via the GUI (right click table, properties), but doing this in T-SQL totally rocks.</p>
[ { "answer_id": 2721, "author": "brendan", "author_id": 225, "author_profile": "https://Stackoverflow.com/users/225", "pm_score": 0, "selected": false, "text": "\nselect *\nfrom pubs.sys.database_files\n" } ]
2008/08/05
[ "https://Stackoverflow.com/questions/2714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434/" ]
2,732
<p>Can anyone explain this behavior? Running:</p> <pre><code>#!/bin/sh echo "hello world" | read var1 var2 echo $var1 echo $var2 </code></pre> <p>results in nothing being ouput, while:</p> <pre><code>#!/bin/sh echo "hello world" &gt; test.file read var1 var2 &lt; test.file echo $var1 echo $var2 </code></pre> <p>pro...
[ { "answer_id": 2764, "author": "Mark Harrison", "author_id": 116, "author_profile": "https://Stackoverflow.com/users/116", "pm_score": 3, "selected": false, "text": "$ echo $$;cat | read a\n10637\n" }, { "answer_id": 2777, "author": "num1", "author_id": 306, "author_p...
2008/08/05
[ "https://Stackoverflow.com/questions/2732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/75/" ]
2,742
<p>I'm interested in looking at Erlang and want to follow the path of least resistance in getting up and running.</p> <p>At present, I'm planning on installing <a href="http://www.erlang.org/download.html" rel="noreferrer">Erlang R12B-3</a> and <a href="http://erlide.sourceforge.net/" rel="noreferrer">Erlide</a> (<a h...
[ { "answer_id": 380599, "author": "Juve", "author_id": 8986, "author_profile": "https://Stackoverflow.com/users/8986", "pm_score": 3, "selected": false, "text": "sudo aptitude install erlang" } ]
2008/08/05
[ "https://Stackoverflow.com/questions/2742", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304/" ]
2,750
<p>I'm wondering if it's a good idea to make <strong>verifications</strong> in <strong>getters</strong> and <strong>setters</strong>, or elsewhere in the code.</p> <p>This might surprise you be when it comes to <strong>optimizations</strong> and <strong>speeding</strong> up the code, I think you should not make verifi...
[ { "answer_id": 2757, "author": "Seibar", "author_id": 357, "author_profile": "https://Stackoverflow.com/users/357", "pm_score": 2, "selected": false, "text": "public string Name\n{\n get\n {\n return _name;\n }\n set\n {\n _name = value;\n }\n}\n" } ]
2008/08/05
[ "https://Stackoverflow.com/questions/2750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435/" ]
2,770
<p>When working on ASP.NET 1.1 projects I always used the Global.asax to catch all errors. I'm looking for a similar way to catch all exceptions in a Windows Forms user control, which ends up being a hosted IE control. What is the proper way to go about doing something like this?</p>
[ { "answer_id": 2779, "author": "Chris Leon", "author_id": 289, "author_profile": "https://Stackoverflow.com/users/289", "pm_score": 6, "selected": true, "text": "System.Windows.Forms.Application.ThreadException" }, { "answer_id": 2817, "author": "Orion Edwards", "author_i...
2008/08/05
[ "https://Stackoverflow.com/questions/2770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/447/" ]