qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
6,110
<p>I've been handed a table with about 18000 rows. Each record describes the location of one customer. The issue is, that when the person created the table, they did not add a field for "Company Name", only "Location Name," and one company can have many locations.</p> <p>For example, here are some records that describ...
[ { "answer_id": 6119, "author": "Neall", "author_id": 619, "author_profile": "https://Stackoverflow.com/users/619", "pm_score": 1, "selected": false, "text": "SELECT count(*) AS repcount, \"Location Name\" FROM mytable\n WHERE \"Company Name\" IS NULL\n GROUP BY \"Location Name\"\n ORDER ...
2008/08/08
[ "https://Stackoverflow.com/questions/6110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/754/" ]
6,113
<p>The application my team is currently developing has a DLL that is used to perform all database access. The application can not use a trusted connection because the database is behind a firewall and the domain server is not. So it appears that the connection string needs to have a DB username and password. The DLL...
[ { "answer_id": 6123, "author": "Kev", "author_id": 419, "author_profile": "https://Stackoverflow.com/users/419", "pm_score": 0, "selected": false, "text": "web.config" }, { "answer_id": 6176, "author": "Brian Childress", "author_id": 721, "author_profile": "https://St...
2008/08/08
[ "https://Stackoverflow.com/questions/6113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/702/" ]
6,126
<p>It's something that's bugged me in every language I've used, I have an if statement but the conditional part has so many checks that I have to split it over multiple lines, use a nested if statement or just accept that it's ugly and move on with my life.</p> <p>Are there any other methods that you've found that mig...
[ { "answer_id": 6131, "author": "abyx", "author_id": 573, "author_profile": "https://Stackoverflow.com/users/573", "pm_score": 3, "selected": false, "text": "== true" }, { "answer_id": 6132, "author": "TimM", "author_id": 32, "author_profile": "https://Stackoverflow.co...
2008/08/08
[ "https://Stackoverflow.com/questions/6126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1384652/" ]
6,130
<p>I'm using subclipse in Flex Builder 3, and recently received this error when trying to commit:</p> <p><code>svn: Checksum mismatch for '/Users/redacted/Documents/Flex Builder 3/path/to/my/file.mxml'; expected: 'f8cb275de72776657406154dd3c10348', actual: 'null'</code></p> <p>I worked around it by:</p> <ol> <li>Com...
[ { "answer_id": 6509, "author": "Polsonby", "author_id": 137, "author_profile": "https://Stackoverflow.com/users/137", "pm_score": 3, "selected": false, "text": "svn update\n" }, { "answer_id": 1771570, "author": "jsh", "author_id": 132408, "author_profile": "https://S...
2008/08/08
[ "https://Stackoverflow.com/questions/6130", "https://Stackoverflow.com", "https://Stackoverflow.com/users/763/" ]
6,134
<p>I have a problem with some zombie-like processes on a certain server that need to be killed every now and then. How can I best identify the ones that have run for longer than an hour or so?</p>
[ { "answer_id": 6145, "author": "Mark Harrison", "author_id": 116, "author_profile": "https://Stackoverflow.com/users/116", "pm_score": 5, "selected": false, "text": "ps aux\n USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND\nroot 1 0.0 0.0 7200 308 ?...
2008/08/08
[ "https://Stackoverflow.com/questions/6134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726/" ]
6,155
<p>What kinds of hook scripts are people using for Subversion? Just general ideas but code would be great too!</p>
[ { "answer_id": 68850, "author": "Philibert Perusse", "author_id": 7984, "author_profile": "https://Stackoverflow.com/users/7984", "pm_score": 6, "selected": false, "text": "pre-revprop-change pre-revprop-change.bat post-revprop-change.cmd snv:log FIND.EXE /b exit /b @ECHO OFF\n\nset repo...
2008/08/08
[ "https://Stackoverflow.com/questions/6155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/204/" ]
6,173
<p>I'm looking for a .NET regular expression extract all the URLs from a webpage but haven't found one to be comprehensive enough to cover all the different ways you can specify a link. </p> <p>And a side question:</p> <p>Is there <strong>one regex to rule them all</strong>? Or am I better off using a series of less ...
[ { "answer_id": 6179, "author": "Kevin", "author_id": 40, "author_profile": "https://Stackoverflow.com/users/40", "pm_score": 0, "selected": false, "text": "%href=\"(.[\"]*)\"%" }, { "answer_id": 6181, "author": "Neall", "author_id": 619, "author_profile": "https://Sta...
2008/08/08
[ "https://Stackoverflow.com/questions/6173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/322/" ]
6,184
<p>When you subscribe to an event on an object from within a form, you are essentially handing over control of your callback method to the event source. You have no idea whether that event source will choose to trigger the event on a different thread.</p> <p>The problem is that when the callback is invoked, you cannot...
[ { "answer_id": 6189, "author": "Simon Gillbee", "author_id": 756, "author_profile": "https://Stackoverflow.com/users/756", "pm_score": 4, "selected": false, "text": "private delegate void EventArgsDelegate(object sender, EventArgs ea);\n\nvoid SomethingHappened(object sender, EventArgs e...
2008/08/08
[ "https://Stackoverflow.com/questions/6184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/756/" ]
6,209
<p>Given a string like this:</p> <blockquote> <p>a,"string, with",various,"values, and some",quoted</p> </blockquote> <p>What is a good algorithm to split this based on commas while ignoring the commas inside the quoted sections?</p> <p>The output should be an array:</p> <blockquote> <p>[ "a", "string, with", "...
[ { "answer_id": 6215, "author": "Pat", "author_id": 238, "author_profile": "https://Stackoverflow.com/users/238", "pm_score": 2, "selected": false, "text": "Loop on the string letter by letter.\n If current_letter == quote : \n toggle inside_quote variable.\n Else if (current...
2008/08/08
[ "https://Stackoverflow.com/questions/6209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
6,301
<p>Why is <code>Array.Length</code> an int, and not a <code>uint</code>. This bothers me (just a bit) because a length value can never be negative. </p> <p>This also forced me to use an int for a length-property on my own class, because when you specify an int-value, this needs to be cast explicitly...</p> <p>So the...
[ { "answer_id": 6320, "author": "Kev", "author_id": 419, "author_profile": "https://Stackoverflow.com/users/419", "pm_score": 7, "selected": true, "text": "UInt" } ]
2008/08/08
[ "https://Stackoverflow.com/questions/6301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56/" ]
6,326
<p>I have the following html.erb code that I'm looking to move to Haml:</p> <pre><code>&lt;span class="&lt;%= item.dashboardstatus.cssclass %&gt;" &gt;&lt;%= item.dashboardstatus.status %&gt;&lt;/span&gt; </code></pre> <p>What it does is associate the CSS class of the currently assigned status to the span.</p> <p>Ho...
[ { "answer_id": 6355, "author": "Christian Lescuyer", "author_id": 341, "author_profile": "https://Stackoverflow.com/users/341", "pm_score": 5, "selected": true, "text": "%span{:class => item.dashboardstatus.cssclass }= item.dashboardstatus.status\n" }, { "answer_id": 46319782, ...
2008/08/08
[ "https://Stackoverflow.com/questions/6326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/722/" ]
6,340
<p>I've got a table that is supposed to track days and costs for shipping product from one vendor to another. We (brilliantly :p) stored both the shipping vendors (FedEx, UPS) with the product handling vendors (Think... Dunder Mifflin) in a "VENDOR" table. So, I have three columns in my SHIPPING_DETAILS table that all ...
[ { "answer_id": 6349, "author": "Christian Lescuyer", "author_id": 341, "author_profile": "https://Stackoverflow.com/users/341", "pm_score": 5, "selected": true, "text": "CREATE TABLE SHIPPING_GRID( \n id INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'Unique ID for each row', \n ...
2008/08/08
[ "https://Stackoverflow.com/questions/6340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58/" ]
6,369
<p>So I have a Sybase stored proc that takes 1 parameter that's a comma separated list of strings and runs a query with in in an IN() clause:</p> <pre><code>CREATE PROCEDURE getSomething @keyList varchar(4096) AS SELECT * FROM mytbl WHERE name IN (@keyList) </code></pre> <p>How do I call my stored proc with more than...
[ { "answer_id": 6377, "author": "Brian Childress", "author_id": 721, "author_profile": "https://Stackoverflow.com/users/721", "pm_score": 0, "selected": false, "text": "DECLARE @idoc int\nDECLARE @doc varchar(1000)\nSET @doc ='\n<ROOT>\n<Customer CustomerID=\"VINET\" ContactName=\"Paul He...
2008/08/08
[ "https://Stackoverflow.com/questions/6369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/779/" ]
6,371
<p>I've had a hard time trying to find good examples of how to manage database schemas and data between development, test, and production servers.</p> <p>Here's our setup. Each developer has a virtual machine running our app and the MySQL database. It is their personal sandbox to do whatever they want. Currently, deve...
[ { "answer_id": 775948, "author": "Yordan Georgiev", "author_id": 65706, "author_profile": "https://Stackoverflow.com/users/65706", "pm_score": 3, "selected": false, "text": "dev_<<db>> , tst_<<db>> , stg_<<db>> , prd_<<db>>" } ]
2008/08/08
[ "https://Stackoverflow.com/questions/6371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/763/" ]
6,373
<p>There are two popular closure styles in javascript. The first I call <em>anonymous constructor</em>:</p> <pre><code>new function() { var code... } </code></pre> <p>and the <em>inline executed function</em>:</p> <pre><code>(function() { var code... })(); </code></pre> <p>are there differences in behaviour be...
[ { "answer_id": 6387, "author": "doekman", "author_id": 56, "author_profile": "https://Stackoverflow.com/users/56", "pm_score": 3, "selected": false, "text": "function Blah() {\n alert('blah');\n}\nnew Bla();\n" }, { "answer_id": 6424, "author": "olliej", "author_id": 7...
2008/08/08
[ "https://Stackoverflow.com/questions/6373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56/" ]
6,392
<p>I am running a Tomcat application, and I need to display some time values. Unfortunately, the time is coming up an hour off. I looked into it and discovered that my default TimeZone is being set to:</p> <pre><code>sun.util.calendar.ZoneInfo[id="GMT-08:00", offset=-28800000, ...
[ { "answer_id": 6496, "author": "Jason Day", "author_id": 737, "author_profile": "https://Stackoverflow.com/users/737", "pm_score": 6, "selected": true, "text": "# sudo cp /etc/localtime /etc/localtime.dist\n# sudo ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime\n" }, { ...
2008/08/08
[ "https://Stackoverflow.com/questions/6392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122/" ]
6,406
<p>Is it possible to access an element on a Master page from the page loaded within the <code>ContentPlaceHolder</code> for the master?</p> <p>I have a ListView that lists people's names in a navigation area on the Master page. I would like to update the ListView after a person has been added to the table that the Lis...
[ { "answer_id": 6411, "author": "Brandon Wood", "author_id": 423, "author_profile": "https://Stackoverflow.com/users/423", "pm_score": -1, "selected": false, "text": "(Master as MyMaster).PeopleListView.DataBind();\n" }, { "answer_id": 6413, "author": "Kev", "author_id": 4...
2008/08/08
[ "https://Stackoverflow.com/questions/6406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/576/" ]
6,414
<p>In a C# (feel free to answer for other languages) loop, what's the difference between <code>break</code> and <code>continue</code> as a means to leave the structure of the loop, and go to the next iteration?</p> <p>Example:</p> <pre><code>foreach (DataRow row in myTable.Rows) { if (someConditionEvalsToTrue) ...
[ { "answer_id": 6415, "author": "palmsey", "author_id": 521, "author_profile": "https://Stackoverflow.com/users/521", "pm_score": 5, "selected": false, "text": "break foreach continue DataRow" }, { "answer_id": 6417, "author": "Michael Stum", "author_id": 91, "author_p...
2008/08/08
[ "https://Stackoverflow.com/questions/6414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/357/" ]
6,430
<p>I'm suddenly back to WinForms, after years of web development, and am having trouble with something that should be simple. I have an <code>ArrayList</code> of business objects bound to a Windows Forms <code>DataGrid</code>. I'd like the user to be able to edit the cells, and when finished, press a Save button. ...
[ { "answer_id": 6435, "author": "NotMyself", "author_id": 303, "author_profile": "https://Stackoverflow.com/users/303", "pm_score": 4, "selected": true, "text": "foreach(var row in DataGrid1.Rows)\n{\n DoStuff(row);\n}\n//Or --------------------------------------------- \nforeach(DataG...
2008/08/08
[ "https://Stackoverflow.com/questions/6430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/785/" ]
6,441
<p>The following code works great in IE, but not in FF or Safari. I can't for the life of me work out why. The code is <em>supposed</em> to disable radio buttons if you select the &quot;Disable 2 radio buttons&quot; option. It should enable the radio buttons if you select the &quot;Enable both radio buttons&quot; op...
[ { "answer_id": 6456, "author": "Polsonby", "author_id": 137, "author_profile": "https://Stackoverflow.com/users/137", "pm_score": 2, "selected": false, "text": "document.getElementById('whatever') Line 27: <form name=\"frm\" id=\"f\" ...\n\nLine 6: var frmTemp = document.getElementById('...
2008/08/08
[ "https://Stackoverflow.com/questions/6441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/232/" ]
6,467
<p>I need to do date arithmetic in Unix shell scripts that I use to control the execution of third party programs. </p> <p>I'm using a function to increment a day and another to decrement: </p> <pre><code>IncrementaDia(){ echo $1 | awk ' BEGIN { diasDelMes[1] = 31 diasDelMes[2] = 28 diasDelMes...
[ { "answer_id": 6468, "author": "abyx", "author_id": 573, "author_profile": "https://Stackoverflow.com/users/573", "pm_score": 6, "selected": false, "text": "date --date='1 days ago' '+%a'\n" }, { "answer_id": 6471, "author": "ggasp", "author_id": 527, "author_profile"...
2008/08/08
[ "https://Stackoverflow.com/questions/6467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/527/" ]
6,475
<p>In a machine with AIX without <code>PERL</code> I need to filter records that will be considered duplicated if they have the same id and if they were registered between a period of four hours. </p> <p>I implemented this filter using <code>AWK</code> and work pretty well but I need a solution much faster: </p> <pre...
[ { "answer_id": 7210, "author": "AnotherHowie", "author_id": 923, "author_profile": "https://Stackoverflow.com/users/923", "pm_score": 1, "selected": false, "text": "sort -k 8 < input.txt > output.txt\n" }, { "answer_id": 7756, "author": "jj33", "author_id": 430, "auth...
2008/08/08
[ "https://Stackoverflow.com/questions/6475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/527/" ]
6,484
<p><a href="http://www.google.com/search?q=how%20to%20mock%20sealed%20class" rel="noreferrer">Mocking sealed classes</a> can be quite a pain. I currently favor an <a href="http://en.wikipedia.org/wiki/Adapter_pattern" rel="noreferrer">Adapter pattern</a> to handle this, but something about just keeps feels weird. </p...
[ { "answer_id": 2587888, "author": "Adam Lenda", "author_id": 104846, "author_profile": "https://Stackoverflow.com/users/104846", "pm_score": 1, "selected": false, "text": " [TestMethod]\n public void Test()\n {\n Queue<Message> messages = new Queue<Message>();\n Ac...
2008/08/09
[ "https://Stackoverflow.com/questions/6484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307/" ]
6,499
<p>There are a few ways to get class-like behavior in javascript, the most common seem to be prototype based like this:</p> <pre><code>function Vector(x, y, x) { this.x = x; this.y = y; this.z = z; return this; } Vector.prototype.length = function () { return Math.sqrt(this.x * this.x ... ); } </code>...
[ { "answer_id": 6516, "author": "Patrick", "author_id": 429, "author_profile": "https://Stackoverflow.com/users/429", "pm_score": 2, "selected": false, "text": "function Vector(x, y, z) {\n function length() {\n return Math.sqrt(x * x + ...);\n }\n}\n" }, { "answer_id": 6533,...
2008/08/09
[ "https://Stackoverflow.com/questions/6499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/784/" ]
6,512
<p>I'm working on a Scheme interpreter written in C. Currently it uses the C runtime stack as its own stack, which is presenting a minor problem with implementing continuations. My current solution is manual copying of the C stack to the heap then copying it back when needed. Aside from not being standard C, this solut...
[ { "answer_id": 31951, "author": "Thomas Vander Stichele", "author_id": 2900, "author_profile": "https://Stackoverflow.com/users/2900", "pm_score": 3, "selected": false, "text": "setjmp longjmp" }, { "answer_id": 46927339, "author": "alinsoar", "author_id": 1419272, "a...
2008/08/09
[ "https://Stackoverflow.com/questions/6512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658/" ]
6,547
<p>One of those classic programming interview questions...</p> <p>You are given two marbles, and told that they will break when dropped from some certain height (and presumably suffer no damage if dropped from below that height). You’re then taken to a 100 story building (presumably higher than the certain height), an...
[ { "answer_id": 21133595, "author": "herohuyongtao", "author_id": 2589776, "author_profile": "https://Stackoverflow.com/users/2589776", "pm_score": 4, "selected": false, "text": "N M" } ]
2008/08/09
[ "https://Stackoverflow.com/questions/6547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/797/" ]
6,557
<p>It seems that a List object cannot be stored in a List variable in C#, and can't even be explicitly cast that way.</p> <pre><code>List&lt;string&gt; sl = new List&lt;string&gt;(); List&lt;object&gt; ol; ol = sl; </code></pre> <p>results in Cannot implicitly convert type <code>System.Collections.Generic.List&lt;str...
[ { "answer_id": 6559, "author": "Rex M", "author_id": 67, "author_profile": "https://Stackoverflow.com/users/67", "pm_score": 4, "selected": false, "text": "List<> List<string>() ListString()" }, { "answer_id": 6567, "author": "Mike Stone", "author_id": 122, "author_pr...
2008/08/09
[ "https://Stackoverflow.com/questions/6557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/797/" ]
6,578
<p>I'm just beginning to have a look at Objective-C and Cocoa with a view to playing with the iPhone SDK. I'm reasonably comfortable with C's <code>malloc</code> and <code>free</code> concept, but Cocoa's references counting scheme has me rather confused. I'm told it's very elegant once you understand it, but I'm just ...
[ { "answer_id": 6592, "author": "Ecton", "author_id": 457, "author_profile": "https://Stackoverflow.com/users/457", "pm_score": 3, "selected": false, "text": "id myVar = [someObject someMessage];\n.... do something ....;\n[myVar release];\nreturn someValue;\n id myVar = [[someObject someM...
2008/08/09
[ "https://Stackoverflow.com/questions/6578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/797/" ]
6,594
<p>What are some good steps to follow for a smooth migration from PHP4 to PHP5. What are some types of code that are likely to break?</p>
[ { "answer_id": 6625, "author": "Akira", "author_id": 795, "author_profile": "https://Stackoverflow.com/users/795", "pm_score": 2, "selected": false, "text": "error_reporting( E_ALL );\n" } ]
2008/08/09
[ "https://Stackoverflow.com/questions/6594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796/" ]
6,607
<p>I'm a new Windows programmer and I'm not sure where I should store user configurable application settings. I understand the need to provide a user friendly means for the user to change application settings, like an Edit | Settings form or similar. But where should I store the values after the user hits the Apply b...
[ { "answer_id": 6622, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "GetPrivateProfileString WritePrivateProfileString" }, { "answer_id": 6757, "author": "deadtime", "author_id": ...
2008/08/09
[ "https://Stackoverflow.com/questions/6607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27687/" ]
6,612
<p>On a recent Java project, we needed a free Java based real-time data plotting utility. After much searching, we found this tool called the <a href="http://www.epic.noaa.gov/java/sgt/" rel="noreferrer">Scientific Graphics Toolkit or SGT</a> from NOAA. It seemed pretty robust, but we found out that it wasn't terribl...
[ { "answer_id": 11265300, "author": "Bob Weigel", "author_id": 1491619, "author_profile": "https://Stackoverflow.com/users/1491619", "pm_score": 1, "selected": false, "text": "&filePollUpdates=1&tail=100" } ]
2008/08/09
[ "https://Stackoverflow.com/questions/6612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27687/" ]
6,623
<p>After changing the output directory of a visual studio project it started to fail to build with an error very much like: </p> <pre><code>C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\sgen.exe /assembly:C:\p4root\Zantaz\trunk\EASDiscovery\EASDiscoveryCaseManagement\obj\Release\EASDiscoveryCaseManagement....
[ { "answer_id": 27317, "author": "sphereinabox", "author_id": 2775, "author_profile": "https://Stackoverflow.com/users/2775", "pm_score": 4, "selected": true, "text": "<Target Name=\"GenerateSerializationAssembliesForAllTypes\"\n DependsOnTargets=\"AssignTargetPaths;Compile;ResolveKeySou...
2008/08/09
[ "https://Stackoverflow.com/questions/6623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/361/" ]
6,628
<p>What is the difference, if any, between these methods of indexing into a PHP array:</p> <pre><code>$array[$index] $array[&quot;$index&quot;] $array[&quot;{$index}&quot;] </code></pre> <p>I'm interested in both the performance and functional differences.</p> <h3>Update:</h3> <p>(In response to @Jeremy) I'm not sure t...
[ { "answer_id": 6637, "author": "ejunker", "author_id": 796, "author_profile": "https://Stackoverflow.com/users/796", "pm_score": -1, "selected": false, "text": "$str = \"this is my string {$array[\"$index\"]}\";\n" }, { "answer_id": 6646, "author": "Paige Ruten", "author_...
2008/08/09
[ "https://Stackoverflow.com/questions/6628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103/" ]
6,633
<p>I have inherited some legacy PHP code what was written back when it was standard practice to use <a href="http://php.net/register_globals" rel="nofollow noreferrer"><code>register_globals</code></a> (As of PHP 4.2.0, this directive defaults to off, released 22. Apr 2002).</p> <p>We know now that it is bad for secur...
[ { "answer_id": 13758, "author": "Eric Goodwin", "author_id": 1430, "author_profile": "https://Stackoverflow.com/users/1430", "pm_score": 2, "selected": false, "text": "// Detect bad global variables\n$bad_global_list = array('GLOBALS', '_SESSION', 'HTTP_SESSION_VARS', '_GET', 'HTTP_GET_...
2008/08/09
[ "https://Stackoverflow.com/questions/6633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796/" ]
6,639
<p>How should I load files into my Java application?</p>
[ { "answer_id": 6640, "author": "Will", "author_id": 816, "author_profile": "https://Stackoverflow.com/users/816", "pm_score": 6, "selected": false, "text": "Class.getResource(String) Class.getResourceAsStream(String) InputStream inputStream = YourClass.class.getResourceAsStream(\"image.j...
2008/08/09
[ "https://Stackoverflow.com/questions/6639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/816/" ]
6,642
<p>I was trying to add a favicon to a website earlier and looked for a better way to implement this than to dump a <code>favicon.ico</code> file in the root of the website.</p> <p>I found this nice little guide: <a href="http://www.w3.org/2005/10/howto-favicon" rel="noreferrer">How to Add a Favicon</a>. However, the p...
[ { "answer_id": 6643, "author": "Brandon Wood", "author_id": 423, "author_profile": "https://Stackoverflow.com/users/423", "pm_score": 0, "selected": false, "text": "<link rel=\"shortcut icon\" href=\"/favicon.ico\" />\n" }, { "answer_id": 6644, "author": "mbillard", "auth...
2008/08/09
[ "https://Stackoverflow.com/questions/6642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/810/" ]
6,658
<p>At work we are currently still using JUnit 3 to run our tests. We have been considering switching over to JUnit 4 for <strong>new</strong> tests being written but I have been keeping an eye on TestNG for a while now. What experiences have you all had with either JUnit 4 or TestNG, and which seems to work better for ...
[ { "answer_id": 430893, "author": "Denis Bazhenov", "author_id": 53658, "author_profile": "https://Stackoverflow.com/users/53658", "pm_score": 3, "selected": false, "text": "assertEquals(operation.getStatus(), Operation.Status.Active);\n assertThat(operation, isActive());\n" }, { ...
2008/08/09
[ "https://Stackoverflow.com/questions/6658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/782/" ]
6,661
<p>I'm aware of things like <code>onchange</code>, <code>onmousedown</code> and <code>onmouseup</code> but is there a good reference somewhere that lists all of them complete with possibly a list of the elements that they cover?</p>
[ { "answer_id": 6686, "author": "GateKiller", "author_id": 383, "author_profile": "https://Stackoverflow.com/users/383", "pm_score": 2, "selected": false, "text": "$(\"#navigation a\").addEvent(\"click\", myFunc);\n" } ]
2008/08/09
[ "https://Stackoverflow.com/questions/6661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1384652/" ]
6,719
<p>I've just been learning about master pages in ASP.NET 2.0. </p> <p>They sound great, but how well do they work in practice? </p> <p>Does anybody have experience of using them for a large web site?</p>
[ { "answer_id": 6744, "author": "mbillard", "author_id": 810, "author_profile": "https://Stackoverflow.com/users/810", "pm_score": 3, "selected": false, "text": "<%@ Master ... %>\n\n<%-- HTML code --%>\n<asp:ContentPlaceHolder id=\"plhMainContent\" runat=\"server\" />\n<%-- HTML code --%...
2008/08/09
[ "https://Stackoverflow.com/questions/6719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133/" ]
6,765
<p>I'm going to start a new project - rewriting an existing system (PHP + SQL Server) from scratch because of some very serious limitations by design.</p> <p>We have some quite good knowledge of SQL Server (currently we're using SQL Server 2000 in existing system) and we would like to employ its newer version (2008 I ...
[ { "answer_id": 38664293, "author": "Jay", "author_id": 5641640, "author_profile": "https://Stackoverflow.com/users/5641640", "pm_score": 0, "selected": false, "text": "import java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\n...
2008/08/09
[ "https://Stackoverflow.com/questions/6765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/837/" ]
6,778
<p>This page from Adobe says to add a "wmode" parameter and set its value to "transparent": <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14201" rel="nofollow noreferrer">http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_1420</a></p> <p>This works flawlessly in IE. The background re...
[ { "answer_id": 16830, "author": "Shawn Miller", "author_id": 247, "author_profile": "https://Stackoverflow.com/users/247", "pm_score": 0, "selected": false, "text": "var parameters:Object = LoaderInfo(this.root.loaderInfo).parameters;\nopaqueBackground = parameters[\"background-color\"];...
2008/08/09
[ "https://Stackoverflow.com/questions/6778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247/" ]
6,785
<p>Suppose I have a stringbuilder in C# that does this:</p> <pre><code>StringBuilder sb = new StringBuilder(); string cat = "cat"; sb.Append("the ").Append(cat).(" in the hat"); string s = sb.ToString(); </code></pre> <p>would that be as efficient or any more efficient as having:</p> <pre><code>string cat = "cat"; s...
[ { "answer_id": 6786, "author": "GateKiller", "author_id": 383, "author_profile": "https://Stackoverflow.com/users/383", "pm_score": -1, "selected": false, "text": "String s = String.Format(\"Today is {0:dd-MMM-yyyy}.\", DateTime.Today);\n" }, { "answer_id": 6788, "author": "J...
2008/08/09
[ "https://Stackoverflow.com/questions/6785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/493/" ]
6,811
<p>Before reading anything else, please take time to read the <a href="https://stackoverflow.com/questions/1615/how-can-i-modify-xfdl-files-update-1">original thread</a>.</p> <p>Overview: a .xfdl file is a gzipped .xml file which has then been encoded in base64. I wish to de-encode the .xfdl into xml which I can the...
[ { "answer_id": 6852, "author": "CodingWithoutComments", "author_id": 25, "author_profile": "https://Stackoverflow.com/users/25", "pm_score": 0, "selected": false, "text": "H4sIAAAAAAAAC+19eZOiyNb3/34K3r4RT/WEU40ssvTtrhuIuKK44Bo3YoJdFAFZ3D79C6hVVhUq\ndsnUVN/qmIkSOLlwlt/JPCfJ/PGf9dwAlorj6p...
2008/08/09
[ "https://Stackoverflow.com/questions/6811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25/" ]
6,816
<p>I was hoping someone could help me out with a problem I'm having using the java search function in Eclipse on a particular project.</p> <p>When using the java search on one particular project, I get an error message saying <code>Class file name must end with .class</code> (see stack trace below). This does not seem...
[ { "answer_id": 1220707, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "<workspace>/.metadata/.plugins/org.eclipse.jdt.core/*.index <workspace>/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNam...
2008/08/09
[ "https://Stackoverflow.com/questions/6816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/797/" ]
6,847
<p>When writing code do you consciously program defensively to ensure high program quality and to avoid the possibility of your code being exploited maliciously, e.g. through buffer overflow exploits or code injection ?</p> <p>What's the "minimum" level of quality you'll always apply to your code ?</p>
[ { "answer_id": 10150, "author": "Andrew Grant", "author_id": 1043, "author_profile": "https://Stackoverflow.com/users/1043", "pm_score": 1, "selected": false, "text": "inline const Vector3 Normalize( Vector3arg vec )\n{\n const float len = Length(vec);\n ASSERTMSG(len > 0.0f \"Inva...
2008/08/09
[ "https://Stackoverflow.com/questions/6847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/381/" ]
6,890
<p>I have some code for starting a thread on the .NET CF 2.0:</p> <pre><code>ThreadStart tStart = new ThreadStart(MyMethod); Thread t = new Thread(tStart); t.Start(); </code></pre> <p>If I call this inside a loop the items completely out of order. How do introduce a wait after <code>t.Start()</code>, so that the work...
[ { "answer_id": 6935, "author": "Kev", "author_id": 419, "author_profile": "https://Stackoverflow.com/users/419", "pm_score": 2, "selected": false, "text": "t.Join();\n" }, { "answer_id": 7101, "author": "Dominic Cooney", "author_id": 878, "author_profile": "https://St...
2008/08/09
[ "https://Stackoverflow.com/questions/6890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/636/" ]
6,891
<p>I have come across the following type of code many a times, and I wonder if this is a good practice (from Performance perspective) or not:</p> <pre><code>try { ... // some code } catch (Exception ex) { ... // Do something throw new CustomException(ex); } </code></pre> <p>Basically, what the coder is do...
[ { "answer_id": 6912, "author": "ggasp", "author_id": 527, "author_profile": "https://Stackoverflow.com/users/527", "pm_score": 2, "selected": false, "text": "try {\n // something that will raise an exception almost half the time\n} catch( InsufficientFunds e) {\n // Inform ...
2008/08/09
[ "https://Stackoverflow.com/questions/6891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/380/" ]
6,899
<p>To illustrate, assume that I have two tables as follows:</p> <pre><code>VehicleID Name 1 Chuck 2 Larry LocationID VehicleID City 1 1 New York 2 1 Seattle 3 1 Vancouver 4 2 Los Angeles 5 2 Houston </code></pre> <p>...
[ { "answer_id": 6961, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 6, "selected": false, "text": "declare @s varchar(max)\nset @s = ''\nselect @s = @s + City + ',' from Locations\n\nselect @s\n" }, { "answer_id":...
2008/08/09
[ "https://Stackoverflow.com/questions/6899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/799/" ]
6,904
<p>I'm trying to use the CoreCon API in Visual Studio 2008 to programmatically launch device emulators. When I call <code>device.Connect()</code>, I inexplicably get a DirectoryNotFoundException. I get it if I try it in PowerShell or in C# Console Application. Here's the code I'm using:</p> <pre><code>static void Main...
[ { "answer_id": 2401184, "author": "PrateekSaluja", "author_id": 307989, "author_profile": "https://Stackoverflow.com/users/307989", "pm_score": 2, "selected": true, "text": "<systemdrive>:\\Program files\\Common Files\\Microsoft Shared\\CoreCon\\1.0\\Bin" } ]
2008/08/09
[ "https://Stackoverflow.com/questions/6904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/631/" ]
6,915
<p>Is there a way to implement a singleton object in C++ that is:</p> <ol> <li>Lazily constructed in a thread safe manner (two threads might simultaneously be the first user of the singleton - it should still only be constructed once).</li> <li>Doesn't rely on static variables being constructed beforehand (so the sing...
[ { "answer_id": 6943, "author": "Chris Hanson", "author_id": 714, "author_profile": "https://Stackoverflow.com/users/714", "pm_score": 4, "selected": false, "text": "pObj == NULL pObj int MySingleton *MySingleton::GetSingleton() {\n if (pObj == NULL) {\n // create a temporary in...
2008/08/09
[ "https://Stackoverflow.com/questions/6915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/755/" ]
6,932
<p>What is the best way to transcode audio and video to show on the web? </p> <p>I need to do it programmatically. I'd like to do something like YouTube or Google Video where users can upload whatever format they want, and I encode it to flv, mp3, and/or mp4. I could do it on our server, but I would rather use an E...
[ { "answer_id": 7186, "author": "masc", "author_id": 919, "author_profile": "https://Stackoverflow.com/users/919", "pm_score": 2, "selected": false, "text": "ffmpeg -hq -y -i $directory/$file -r 20 -s 300x200 -deinterlace -ar 22050 $directory/$file.flv 1>/dev/null 2>/dev/null\n" }, { ...
2008/08/09
[ "https://Stackoverflow.com/questions/6932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571/" ]
7,015
<p>I have a quad core machine and would like to write some code to parse a text file that takes advantage of all four cores. The text file basically contains one record per line.</p> <p>Multithreading isn't my forte so I'm wondering if anyone could give me some patterns that I might be able to use to parse the file in...
[ { "answer_id": 7023, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 1, "selected": false, "text": "Executors .newFixedThreadPool ExecutorService .submit System.Threading.ThreadPool" }, { "answer_id": 7045, "author...
2008/08/10
[ "https://Stackoverflow.com/questions/7015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/493/" ]
7,031
<p>I have been using PHP and JavaScript for building my dad's website. He wants to incorporate a login system into his website, and I have the design for the system using PHP. My problem is how do I show buttons if the person is logged in?­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­...
[ { "answer_id": 7466, "author": "grom", "author_id": 486, "author_profile": "https://Stackoverflow.com/users/486", "pm_score": 1, "selected": false, "text": "<?php\nrequire_once 'Auth.php';\n// output some html\nif (isLoggedIn()) {\n echo 'html for logged in user';\n}\n// rest of html\...
2008/08/10
[ "https://Stackoverflow.com/questions/7031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/876/" ]
7,034
<p>I have a data structure that represents a directed graph, and I want to render that dynamically on an HTML page. These graphs will usually be just a few nodes, maybe ten at the very upper end, so my guess is that performance isn't going to be a big deal. Ideally, I'd like to be able to hook it in with jQuery so tha...
[ { "answer_id": 2366237, "author": "Johann Philipp Strathausen", "author_id": 284708, "author_profile": "https://Stackoverflow.com/users/284708", "pm_score": 11, "selected": true, "text": "var g = new Graph();\ng.addEdge(\"strawberry\", \"cherry\");\ng.addEdge(\"cherry\", \"apple\");\ng.a...
2008/08/10
[ "https://Stackoverflow.com/questions/7034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/404/" ]
7,035
<p>I'm writing a few little bash scripts under Ubuntu linux. I want to be able to run them from the GUI without needing a terminal window to enter any input or view any output.</p> <p>So far the only input required is a password for sudo - and gksudo handles that fine. But I haven't found an easy way to show a message...
[ { "answer_id": 7043, "author": "Mark Harrison", "author_id": 116, "author_profile": "https://Stackoverflow.com/users/116", "pm_score": 3, "selected": false, "text": "#!/usr/bin/wish\npack [label .msg -text [lindex $argv 0]]\npack [entry .ent]\nbind .ent <KeyPress-Return> { puts [.ent get...
2008/08/10
[ "https://Stackoverflow.com/questions/7035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
7,074
<p>What are the differences between these two and which one should I use?</p> <pre><code>string s = &quot;Hello world!&quot;; String s = &quot;Hello world!&quot;; </code></pre>
[ { "answer_id": 7077, "author": "Derek Park", "author_id": 872, "author_profile": "https://Stackoverflow.com/users/872", "pm_score": 14, "selected": true, "text": "string System.String int System.Int32 string string place = \"world\";\n String string greet = String.Format(\"Hello {0}!\", ...
2008/08/10
[ "https://Stackoverflow.com/questions/7074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571/" ]
7,084
<p>I've worked on a number of different embedded systems. They have all used <code>typedef</code>s (or <code>#defines</code>) for types such as <code>UINT32</code>.</p> <p>This is a good technique as it drives home the size of the type to the programmer and makes you more conscious of chances for overflow etc.</p> <...
[ { "answer_id": 7117, "author": "Chris Hanson", "author_id": 714, "author_profile": "https://Stackoverflow.com/users/714", "pm_score": 3, "selected": false, "text": "<stdint.h> distance_t mass_t meter_t gram_t" }, { "answer_id": 7515, "author": "Bernard", "author_id": 61, ...
2008/08/10
[ "https://Stackoverflow.com/questions/7084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/888/" ]
7,089
<p>How can I create rounded corners using CSS?</p>
[ { "answer_id": 7098, "author": "Yaakov Ellis", "author_id": 51, "author_profile": "https://Stackoverflow.com/users/51", "pm_score": 8, "selected": true, "text": "border-radius border-radius" }, { "answer_id": 7099, "author": "Jeff Atwood", "author_id": 1, "author_prof...
2008/08/10
[ "https://Stackoverflow.com/questions/7089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/889/" ]
7,095
<p>In other words, is this Singleton implementation thread safe:</p> <pre><code>public class Singleton { private static Singleton instance; private Singleton() { } static Singleton() { instance = new Singleton(); } public static Singleton Instance { get { return instance;...
[ { "answer_id": 7105, "author": "Zooba", "author_id": 891, "author_profile": "https://Stackoverflow.com/users/891", "pm_score": 9, "selected": true, "text": "public class Singleton\n{\n private static Singleton instance;\n // Added a static mutex for synchronising use of instance.\n...
2008/08/10
[ "https://Stackoverflow.com/questions/7095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373/" ]
7,118
<p>Currently, I don't really have a good method of debugging JavaScript in Internet&nbsp;Explorer and <a href="http://en.wikipedia.org/wiki/Safari_%28web_browser%29" rel="noreferrer">Safari</a>. In Firefox, you can use <a href="http://en.wikipedia.org/wiki/Firebug" rel="noreferrer">Firebug's</a> <a href="http://getfire...
[ { "answer_id": 7129, "author": "Dominic Cooney", "author_id": 878, "author_profile": "https://Stackoverflow.com/users/878", "pm_score": 5, "selected": true, "text": "$ defaults write com.apple.Safari IncludeDebugMenu 1\n" } ]
2008/08/10
[ "https://Stackoverflow.com/questions/7118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/889/" ]
7,209
<p>I'm trying to alpha blend sprites and backgrounds with <a href="http://www.devkitpro.org/" rel="noreferrer">devkitPro</a> (including libnds, libarm, etc).</p> <p>Does anyone know how to do this?</p>
[ { "answer_id": 10527, "author": "Cristián Romo", "author_id": 1256, "author_profile": "https://Stackoverflow.com/users/1256", "pm_score": 2, "selected": false, "text": "REG_BLDMOD REG_COLV REG_COLY REG_BLDMOD_SUB REG_COLV_SUB REG_COLY_SUB" }, { "answer_id": 119880, "author": ...
2008/08/10
[ "https://Stackoverflow.com/questions/7209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/209/" ]
7,211
<p>I currently have a relatively small (4 or 5 tables, 5000 rows) MySQL database that I would like to convert to an sqlite database. As I'd potentially have to do this more than once, I'd be grateful if anyone could recommend any useful tools, or at least any easily-replicated method.</p> <p>(I have complete admin ac...
[ { "answer_id": 7218, "author": "Terry G Lorber", "author_id": 809, "author_profile": "https://Stackoverflow.com/users/809", "pm_score": 2, "selected": false, "text": " tgl@moto~$ mysqldump old-database > old-database-dump.sql\n tgl@moto~$ sqlite3 -init old-database-dump.sql new-database\...
2008/08/10
[ "https://Stackoverflow.com/questions/7211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/916/" ]
7,212
<p>What I'd like to do is something like the following:</p> <pre><code>FooClass.prototype.method = function():String { return "Something"; } var foo:FooClass = new FooClass(); foo.method(); </code></pre> <p>Which is to say, I'd like to extend a generated class with a single method, not via inheritance but via th...
[ { "answer_id": 8886, "author": "aib", "author_id": 1088, "author_profile": "https://Stackoverflow.com/users/1088", "pm_score": 3, "selected": true, "text": "foo[\"method\"]();\n foo.method();\n" }, { "answer_id": 9958, "author": "Theo", "author_id": 1109, "author_prof...
2008/08/10
[ "https://Stackoverflow.com/questions/7212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/266/" ]
7,231
<p>Can anyone recommend software or a .NET library that will check for bounced emails and the reason for the bounce? I get bounced emails into a pop3 account that I can read then.</p> <p>I need it to keep my user database clean from invalid email addresses and want to automate this (mark user as invalid email).</p>
[ { "answer_id": 7249, "author": "Robert Ellison", "author_id": 2521991, "author_profile": "https://Stackoverflow.com/users/2521991", "pm_score": 2, "selected": false, "text": "TcpClient tcpClient = new TcpClient();\ntcpClient.Connect(POP3Server, POP3Port);\nNetworkStream stream = tcpClien...
2008/08/10
[ "https://Stackoverflow.com/questions/7231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/925/" ]
7,237
<p>Our software must be able to run on SQL Server 2000 and 2005. To simplify development, we're running our SQL Server 2005 databases in compatibility level 80. However, database performance seems slower on SQL 2005 than on SQL 2000 in some cases (we have not confirmed this using benchmarks yet). Would upgrading the...
[ { "answer_id": 7242, "author": "SQLMenace", "author_id": 740, "author_profile": "https://Stackoverflow.com/users/740", "pm_score": 1, "selected": false, "text": "(*= and =*)" } ]
2008/08/10
[ "https://Stackoverflow.com/questions/7237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/799/" ]
7,244
<p>What I want to do is something like this: I have enums with combined flagged values.</p> <pre><code>public static class EnumExtension { public static bool IsSet&lt;T&gt;( this T input, T matchTo ) where T:enum //the constraint I want that doesn't exist in C#3 { return (input &amp; match...
[ { "answer_id": 7385, "author": "Ronnie", "author_id": 193, "author_profile": "https://Stackoverflow.com/users/193", "pm_score": 4, "selected": false, "text": "public static bool IsSet( this Enum input, Enum matchTo )\n{\n return ( Convert.ToUInt32( input ) & Convert.ToUInt32( matchTo ...
2008/08/10
[ "https://Stackoverflow.com/questions/7244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/905/" ]
7,245
<p>What's the most efficient algorithm to find the rectangle with the largest area which will fit in the empty space?</p> <p>Let's say the screen looks like this ('#' represents filled area):</p> <pre><code>.................... ..............###### ##.................. .................### .................### #####....
[ { "answer_id": 7250, "author": "Mark Renouf", "author_id": 758, "author_profile": "https://Stackoverflow.com/users/758", "pm_score": 2, "selected": false, "text": " // 4. Outer double-for-loop to consider all possible positions \n // for topleft corner. \n for (int i=0; i < M...
2008/08/10
[ "https://Stackoverflow.com/questions/7245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/758/" ]
7,260
<p>How do I setup Public-Key Authentication for SSH?</p>
[ { "answer_id": 9095, "author": "dbr", "author_id": 745, "author_profile": "https://Stackoverflow.com/users/745", "pm_score": 8, "selected": true, "text": "ssh-keygen\n id_rsa id_rsa.pub ~/.ssh/authorized_keys id_rsa.pub chmod 600 id_rsa* chmod 600 ~/.ssh/id_rsa*\n ~/.ssh/authorized_keys ...
2008/08/10
[ "https://Stackoverflow.com/questions/7260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/889/" ]
7,272
<p>Alright, so maybe I shouldn't have shrunk this question sooo much... I have seen the post on <a href="https://stackoverflow.com/questions/622/most-efficient-code-for-the-first-10000-prime-numbers">the most efficient way to find the first 10000 primes</a>. I'm looking for <strong>all possible ways</strong>. The goa...
[ { "answer_id": 7476, "author": "goric", "author_id": 940, "author_profile": "https://Stackoverflow.com/users/940", "pm_score": 2, "selected": false, "text": "//Assuming theInteger is the number to be tested for primality.\n// Check if theInteger is divisible by 2. If not, run this loop....
2008/08/10
[ "https://Stackoverflow.com/questions/7272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/145/" ]
7,277
<p>I'm generating some XML documents and when it comes to the address part I have fragments that look like this:</p> <pre><code>&lt;Address&gt;15 Sample St Example Bay Some Country&lt;/Address&gt; </code></pre> <p>The XSLT that I have for converting this to XHTML has some funky recursive template to convert newline c...
[ { "answer_id": 7282, "author": "Derek Park", "author_id": 872, "author_profile": "https://Stackoverflow.com/users/872", "pm_score": 2, "selected": false, "text": "<Something>\n <Contains>\n <An>\n <Address>15 Sample St\nExample Bay\nSome Country</Address>\n </...
2008/08/10
[ "https://Stackoverflow.com/questions/7277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/755/" ]
7,284
<p>What does the expression "Turing Complete" mean? </p> <p>Can you give a simple explanation, without going into too many theoretical details?</p>
[ { "answer_id": 1610655, "author": "Gordon Gustafson", "author_id": 89989, "author_profile": "https://Stackoverflow.com/users/89989", "pm_score": 7, "selected": false, "text": "+ - * / push pop ( ) ( ) ( ) [ ] ([)] ([]] () []" } ]
2008/08/10
[ "https://Stackoverflow.com/questions/7284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198/" ]
7,287
<p>Lately I had to change some code on older systems where not all of the code has unit tests.<br> Before making the changes I want to write tests, but each class created a lot of dependencies and other anti-patterns which made testing quite hard.<br> Obviously, I wanted to refactor the code to make it easier to test, ...
[ { "answer_id": 7296, "author": "Mike Stone", "author_id": 122, "author_profile": "https://Stackoverflow.com/users/122", "pm_score": 4, "selected": true, "text": "public class MyClass {\n public MyClass() {\n // undesirable DB logic\n }\n}\n public class MyClass {\n public...
2008/08/10
[ "https://Stackoverflow.com/questions/7287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/573/" ]
7,348
<p>My requirements:</p> <ul> <li>Support .NET Compact Framework 2.0 and Windows Mobile 6.0 devices.</li> <li>Only need to unzip the contents to a directory on a storage card. Creation of zip files is not required.</li> <li>Must be able to use in corporate/commercial software.</li> <li>Can be open source, but not have ...
[ { "answer_id": 388253, "author": "Cheeso", "author_id": 48082, "author_profile": "https://Stackoverflow.com/users/48082", "pm_score": 3, "selected": false, "text": " try\n {\n using (var zip1 = Ionic.Zip.ZipFile.Read(zipToUnpack))\n {\n foreach (var entry in zip1)\n ...
2008/08/10
[ "https://Stackoverflow.com/questions/7348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/636/" ]
7,364
<p>Does anyone know of a good method for editing PDFs in PHP? Preferably open-source/zero-license cost methods. :)</p> <p>I am thinking along the lines of opening a PDF file, replacing text in the PDF and then writing out the modified version of the PDF?</p> <p>On the front-end</p>
[ { "answer_id": 7455, "author": "grom", "author_id": 486, "author_profile": "https://Stackoverflow.com/users/486", "pm_score": 7, "selected": true, "text": "<?php\nrequire_once 'Zend/Pdf.php';\n\n$pdf = Zend_Pdf::load('blank.pdf');\n$page = $pdf->pages[0];\n$font = Zend_Pdf_Font::fontWith...
2008/08/10
[ "https://Stackoverflow.com/questions/7364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277/" ]
7,398
<p>I haven't seen any questions relating to GNU autoconf/automake builds, but I'm hoping at least some of you out there are familiar with it. Here goes:</p> <p>I have a project (I'll call it myproject) that includes another project (vendor). The vendor project is a standalone project maintained by someone else. Inc...
[ { "answer_id": 9214, "author": "David Joyner", "author_id": 1146, "author_profile": "https://Stackoverflow.com/users/1146", "pm_score": 2, "selected": false, "text": "config.h sed -e 's/.*PACKAGE_.*//' < config.h > config.h.sed && mv config.h.sed config.h\n" }, { "answer_id": 112...
2008/08/10
[ "https://Stackoverflow.com/questions/7398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/737/" ]
7,470
<p>After a couple of hours fighting with the <a href="http://gallery.menalto.com/" rel="nofollow noreferrer">Gallery2</a> <a href="http://codex.gallery2.org/Gallery2:Modules:rss" rel="nofollow noreferrer">RSS module</a> and getting only the message, "no feeds have yet been defined", I gave up. Based on <a href="http:/...
[ { "answer_id": 7471, "author": "ESV", "author_id": 150, "author_profile": "https://Stackoverflow.com/users/150", "pm_score": 1, "selected": false, "text": "#!/usr/bin/python\n\"\"\"A CGI script to produce an RSS feed of top-level Gallery2 albums.\"\"\"\n\n#import cgi\n#import cgitb; cgit...
2008/08/11
[ "https://Stackoverflow.com/questions/7470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150/" ]
7,472
<p>Can anyone point me to a good resource (or throw me a clue) to show me how to do DataBinding to controls (ComboBox, ListBox, etc.) in WPF? I'm at a bit of a loss when all my WinForms niceities are taken away from me, and I'm not all that bright to start with...</p>
[ { "answer_id": 7475, "author": "Leon Bambrick", "author_id": 49, "author_profile": "https://Stackoverflow.com/users/49", "pm_score": 2, "selected": false, "text": "private void OnInit(object sender, EventArgs e)\n{\n //myDataSet is some IEnumerable \n\n // myListBox is a ListBox contro...
2008/08/11
[ "https://Stackoverflow.com/questions/7472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/856/" ]
7,477
<p>I'm currently working on an internal sales application for the company I work for, and I've got a form that allows the user to change the delivery address.</p> <p>Now I think it would look much nicer, if the textarea I'm using for the main address details would just take up the area of the text in it, and automatic...
[ { "answer_id": 7523, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 7, "selected": true, "text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n ...
2008/08/11
[ "https://Stackoverflow.com/questions/7477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/841/" ]
7,489
<p>I've made many different seperate parts of a GUI system for the Nintendo DS, like buttons and textboxes and select boxes, but I need a way of containing these classes in one Gui class, so that I can draw everything to the screen all at once, and check all the buttons at once to check if any are being pressed. My que...
[ { "answer_id": 13384, "author": "thing2k", "author_id": 3180, "author_profile": "https://Stackoverflow.com/users/3180", "pm_score": 3, "selected": true, "text": "class uiElement()\n{\n ...\n virtual void Update() = 0;\n virtual void Draw() = 0;\n ...\n}\n\nclass uiButton() pu...
2008/08/11
[ "https://Stackoverflow.com/questions/7489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/813/" ]
7,492
<p>In the past, I used Microsoft Web Application Stress Tool and Pylot to stress test web applications. I'd written a simple home page, login script, and site walkthrough (in an ecommerce site adding a few items to a cart and checkout).</p> <p>Just hitting the homepage hard with a handful of developers would almost al...
[ { "answer_id": 3546467, "author": "Ben Li", "author_id": 423840, "author_profile": "https://Stackoverflow.com/users/423840", "pm_score": 3, "selected": false, "text": "ab -c n -t 30 url\n\nsiege -b -c n -t 30s url\n /usr/local/etc/siegerc" }, { "answer_id": 33876200, "author"...
2008/08/11
[ "https://Stackoverflow.com/questions/7492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/556/" ]
7,503
<p>I know almost nothing about linq.</p> <p>I'm doing this:</p> <pre><code>var apps = from app in Process.GetProcesses() where app.ProcessName.Contains( "MyAppName" ) &amp;&amp; app.MainWindowHandle != IntPtr.Zero select app; </code></pre> <p>Which gets me all the running processes which match that criteria....
[ { "answer_id": 7509, "author": "FryHard", "author_id": 231, "author_profile": "https://Stackoverflow.com/users/231", "pm_score": 0, "selected": false, "text": "var apps = from app in Process.GetProcesses()\nwhere app.ProcessName.Contains( \"MyAppName\" ) && app.MainWindowHandle != IntPtr...
2008/08/11
[ "https://Stackoverflow.com/questions/7503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/234/" ]
7,517
<p>Is there a simple way to drop a group of interrelated tables in SQL Server? Ideally I'd like to avoid having to worry about what order they're being dropped in since I know the entire group will be gone by the end of the process.</p>
[ { "answer_id": 7537, "author": "Derek Park", "author_id": 872, "author_profile": "https://Stackoverflow.com/users/872", "pm_score": 0, "selected": false, "text": "DROP TABLE IF EXISTS table1, table2, table3 CASCADE;\n" }, { "answer_id": 25719, "author": "Matt Sheppard", "...
2008/08/11
[ "https://Stackoverflow.com/questions/7517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/797/" ]
7,525
<p>So, I need some help. I am working on a project in C++. However, I think I have somehow managed to corrupt my heap. This is based on the fact that I added an <code>std::string</code> to a class and assigning it a value from another <code>std::string</code>:</p> <pre><code>std::string hello = "Hello, world.\n"; /* e...
[ { "answer_id": 7559, "author": "Bernard", "author_id": 61, "author_profile": "https://Stackoverflow.com/users/61", "pm_score": 1, "selected": false, "text": " this->map = new Area*[largestY + 1];\n for (int i = 0; i < largestY + 1; i++) {\n this->map[i] = new Area[largestX + 1];\n }\...
2008/08/11
[ "https://Stackoverflow.com/questions/7525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61/" ]
7,535
<p>What is the best way to use SQL Server 2008 as a development database, but ensure that the database is compatible with SQL Server 2005?</p>
[ { "answer_id": 7547, "author": "vzczc", "author_id": 224, "author_profile": "https://Stackoverflow.com/users/224", "pm_score": 5, "selected": true, "text": "ALTER DATABASE <database> \nSET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }\n" } ]
2008/08/11
[ "https://Stackoverflow.com/questions/7535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/708/" ]
7,539
<p>Recently I tried understanding the use of <strong>java.math.MathContext</strong> but failed to understand properly. Is it used for rounding in <code>java.math.BigDecimal</code>. If yes why does not it round the decimal digits but even mantissa part.</p> <p>From API docs, I came to know that it follows the standard ...
[ { "answer_id": 7550, "author": "Derek Park", "author_id": 872, "author_profile": "https://Stackoverflow.com/users/872", "pm_score": 3, "selected": false, "text": "System.out.println(new BigDecimal(\"1234567890.123456789\",\n new MathContext(20)));\n\nSystem.out.println(...
2008/08/11
[ "https://Stackoverflow.com/questions/7539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/959/" ]
7,551
<p>When designing a REST API or service are there any established best practices for dealing with security (Authentication, Authorization, Identity Management) ?</p> <p>When building a SOAP API you have WS-Security as a guide and much literature exists on the topic. I have found less information about securing REST en...
[ { "answer_id": 24807288, "author": "Archimedes Trajano", "author_id": 242042, "author_profile": "https://Stackoverflow.com/users/242042", "pm_score": 2, "selected": false, "text": "userPrincipal HttpServletRequest ServiceSecurityContext.Current" }, { "answer_id": 47189047, "a...
2008/08/11
[ "https://Stackoverflow.com/questions/7551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/541/" ]
7,558
<p>I am displaying a list of items using a SAP ABAP column tree model, basically a tree of folder and files, with columns.</p> <p>I want to load the sub-nodes of folders dynamically, so I'm using the EXPAND_NO_CHILDREN event which is firing correctly.</p> <p>Unfortunately, after I add the new nodes and items to the tre...
[ { "answer_id": 63251, "author": "tomdemuyt", "author_id": 7602, "author_profile": "https://Stackoverflow.com/users/7602", "pm_score": 0, "selected": false, "text": "ADD_NODES_AND_ITEMS EXPAND_NODE" } ]
2008/08/11
[ "https://Stackoverflow.com/questions/7558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
7,579
<p>In the SSW rules to better SQL Server Database there is an example of a full database maintenance plan: <a href="http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterSQLServerDatabases.aspx#MaintenancePlan" rel="noreferrer">SSW</a>. In the example they run both a Reorganize Index and then a Rebuild Index and then ...
[ { "answer_id": 7635, "author": "GateKiller", "author_id": 383, "author_profile": "https://Stackoverflow.com/users/383", "pm_score": 3, "selected": false, "text": "EXEC [sp_MSforeachtable] @command1=\"RAISERROR('DBCC DBREINDEX(''?'') ...',10,1) WITH NOWAIT DBCC DBREINDEX('?')\"\n" }, ...
2008/08/11
[ "https://Stackoverflow.com/questions/7579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/961/" ]
7,586
<p>I was trying to get my head around XAML and thought that I would try writing some code. </p> <p>Trying to add a grid with 6 by 6 column definitions then add a text block into one of the grid cells. I don't seem to be able to reference the cell that I want. There is no method on the grid that I can add the text blo...
[ { "answer_id": 7590, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 4, "selected": true, "text": "<TextBlock Grid.Row=\"0\" Grid.Column=\"0\" />\n g.Children.Add(tb);\nGrid.SetRow(tb, 0);\nGrid.SetColumn(tb, 0);\n" }, ...
2008/08/11
[ "https://Stackoverflow.com/questions/7586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
7,592
<p>I want to create a client side mail creator web page. I know the problems of using the mailto action in an html form (not standard, no default mail appication set on the client). But the web page isn't very important, and they don't care very much.</p> <p>The mail created by the mailto action has the syntax:</p> <...
[ { "answer_id": 7643, "author": "Vincent Robert", "author_id": 268, "author_profile": "https://Stackoverflow.com/users/268", "pm_score": 5, "selected": true, "text": "var addresses = \"\";//between the speech mark goes the receptient. Seperate addresses with a ;\nvar body = \"\"//write th...
2008/08/11
[ "https://Stackoverflow.com/questions/7592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518/" ]
7,596
<p>First of all, I know how to build a Java application. But I have always been puzzled about where to put my classes. There are proponents for organizing the packages in a strictly domain oriented fashion, others separate by tier.</p> <p>I myself have always had problems with </p> <ul> <li>naming, </li> <li>placing<...
[ { "answer_id": 7610, "author": "Kieron", "author_id": 588, "author_profile": "https://Stackoverflow.com/users/588", "pm_score": 2, "selected": false, "text": "com.domain.subdomain FileStorageStrategy com.domain.subdomain.myapp.storage com.domain.subdomain.myapp.storage.file com.domain.su...
2008/08/11
[ "https://Stackoverflow.com/questions/7596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917/" ]
7,614
<p>What is the best way of testing a function that throws on failure? Or testing a function that is fairly immune to failure?</p> <p>For instance; I have a <code>I/O Completion Port</code> class that throws in the constructor if it can't initialise the port correctly. This uses the <code>Win32</code> function of <code...
[ { "answer_id": 7624, "author": "Mike Stone", "author_id": 122, "author_profile": "https://Stackoverflow.com/users/122", "pm_score": 2, "selected": false, "text": "public class MyClass {\n public MyClass() throws MyClassException {\n // Whatever, including a call to invokeCreate...
2008/08/11
[ "https://Stackoverflow.com/questions/7614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/342/" ]
7,622
<p>In C, are the shift operators (<code>&lt;&lt;</code>, <code>&gt;&gt;</code>) arithmetic or logical?</p>
[ { "answer_id": 7632, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 7, "selected": false, "text": "signed int x1 = 5;\nassert((x1 >> 1) == 2);\nsigned int x2 = -5;\nassert((x2 >> 1) == -3);\nunsigned int x3 = (unsigned int...
2008/08/11
[ "https://Stackoverflow.com/questions/7622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/973/" ]
7,642
<p>Is there an official convention for naming private fields in VB.NET? For example, if I have a property called 'Foo', I normally call the private field '_Foo'. This seems to be frowned upon in the <a href="http://msdn.microsoft.com/en-us/library/ms229012.aspx" rel="noreferrer">Offical Guidelines</a>:</p> <p>"Do no...
[ { "answer_id": 8092, "author": "Lance Fisher", "author_id": 571, "author_profile": "https://Stackoverflow.com/users/571", "pm_score": 0, "selected": false, "text": "Public Class Class1\n\n Private _foo As String\n Public Property Foo() As String\n Get\n Return _fo...
2008/08/11
[ "https://Stackoverflow.com/questions/7642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133/" ]
7,651
<p>I have an array in Perl:</p> <pre><code>my @my_array = ("one","two","three","two","three"); </code></pre> <p>How do I remove the duplicates from the array?</p>
[ { "answer_id": 7657, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 8, "selected": true, "text": "sub uniq {\n my %seen;\n grep !$seen{$_}++, @_;\n}\n\nmy @array = qw(one two three two three);\nmy @filtered = uniq(@a...
2008/08/11
[ "https://Stackoverflow.com/questions/7651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/381/" ]
7,661
<p>Searching for some sample code for converting a point in WGS84 coordinate system to a map position in Google Maps (pixel position), also supporting zoom levels. </p> <p>If the codes is well commented, then it can also be in some other language.</p> <p>You can also point me to a open source Java project :)</p> <p>...
[ { "answer_id": 2373697, "author": "Ro.", "author_id": 103446, "author_profile": "https://Stackoverflow.com/users/103446", "pm_score": 2, "selected": false, "text": "function toMercator (lon, lat) {\n var x = lon * 20037508.34 / 180;\n var y = Math.log(Math.tan((90 + lat) * Math.PI / 36...
2008/08/11
[ "https://Stackoverflow.com/questions/7661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706/" ]
7,662
<p>Whenever I design a database, I always wonder if there is a best way of naming an item in my database. Quite often I ask myself the following questions:</p> <ol> <li>Should table names be plural?</li> <li>Should column names be singular?</li> <li>Should I prefix tables or columns?</li> <li>Should I use any case in ...
[ { "answer_id": 7667, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 7, "selected": false, "text": "SELECT person.Name\nFROM People person\n" }, { "answer_id": 7678, "author": "Keith", "author_id": 905, ...
2008/08/11
[ "https://Stackoverflow.com/questions/7662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383/" ]
7,664
<p>I am wrapping existing C++ code from a <strong>BSD</strong> project in our own custom wrapper and I want to integrate it to our code with as few changes as possible. This code uses <code>fprintf</code> to print to <strong>stderr</strong> in order to log / report errors.</p> <p>I want to redirect this to an alternat...
[ { "answer_id": 7669, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 4, "selected": true, "text": "DWORD CALLBACK DoDebugThread(void *)\n{\n AllocConsole();\n SetConsoleTitle(\"Copilot Debugger\");\n // The followi...
2008/08/11
[ "https://Stackoverflow.com/questions/7664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/912/" ]
7,665
<p>Given an absolute or relative path (in a Unix-like system), I would like to determine the full path of the target after resolving any intermediate symlinks. Bonus points for also resolving ~username notation at the same time.</p> <p>If the target is a directory, it might be possible to chdir() into the directory an...
[ { "answer_id": 7666, "author": "kauppi", "author_id": 964, "author_profile": "https://Stackoverflow.com/users/964", "pm_score": 8, "selected": true, "text": "pwd -P char *getcwd(char *buf, size_t size) unistd.h" }, { "answer_id": 7673, "author": "Hugo", "author_id": 972, ...
2008/08/11
[ "https://Stackoverflow.com/questions/7665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/893/" ]
7,685
<p>I was recently brushing up on some fundamentals and found merge sorting a linked list to be a pretty good challenge. If you have a good implementation then show it off here.</p>
[ { "answer_id": 3032462, "author": "Dave Gamble", "author_id": 133758, "author_profile": "https://Stackoverflow.com/users/133758", "pm_score": 3, "selected": false, "text": "\ntypedef struct _aList {\n struct _aList* next;\n struct _aList* prev; // Optional.\n // some data\n} ...
2008/08/11
[ "https://Stackoverflow.com/questions/7685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/608/" ]