qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
119,929
<p>I need to convert SAS data tables into flat files (or "ASCII files" as they were called once, as opposed to binary files). And only one flat file for each original SAS table. The challenging thing is that I want the flat file to contain some structural information of the original SAS table also, specifically:</p> <...
[ { "answer_id": 539422, "author": "Rog", "author_id": 65338, "author_profile": "https://Stackoverflow.com/users/65338", "pm_score": 2, "selected": false, "text": "proc sql;\ndescribe table sashelp.class;\nquit;\n NOTE: SQL table SASHELP.CLASS was created like:\n\ncreate table SASHELP.CLAS...
2008/09/23
[ "https://Stackoverflow.com/questions/119929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18968/" ]
119,941
<p>I want to create variables inside function from dictionary.</p> <p>Lets say I have a dictionary</p> <pre><code>bar = {'a': 1, 'b': 2, 'c': 3} </code></pre> <p>and function</p> <pre><code>def foo(): pass </code></pre> <p>What I want to do is to create inside function "foo" variables with names of each dictiona...
[ { "answer_id": 119964, "author": "Brian", "author_id": 9493, "author_profile": "https://Stackoverflow.com/users/9493", "pm_score": 1, "selected": false, "text": "some_code = ' return a+b+c'\nexec \"def foo():\\n \" + '\\n '.join('%s = %s' for k,v in bar.items()) + '\\n' + some_code\n ...
2008/09/23
[ "https://Stackoverflow.com/questions/119941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20955/" ]
119,961
<p>Normally you can do this:</p> <pre><code>&lt;select size="3"&gt; &lt;option&gt;blah&lt;/option&gt; &lt;option&gt;blah&lt;/option&gt; &lt;option&gt;blah&lt;/option&gt; &lt;/select&gt; </code></pre> <p>And it would render as a selectionbox where all three options are visible (without dropping down)<br> I...
[ { "answer_id": 122357, "author": "scunliffe", "author_id": 6144, "author_profile": "https://Stackoverflow.com/users/6144", "pm_score": 4, "selected": true, "text": "size = options.length;\n" }, { "answer_id": 971690, "author": "Community", "author_id": -1, "author_pro...
2008/09/23
[ "https://Stackoverflow.com/questions/119961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
119,980
<p>Is there a javascript function I can use to detect whether a specific silverlight version is installed in the current browser?</p> <p>I'm particularly interested in the Silverlight 2 Beta 2 version. I don't want to use the default method of having an image behind the silverlight control which is just shown if the S...
[ { "answer_id": 119992, "author": "Domenic", "author_id": 3191, "author_profile": "https://Stackoverflow.com/users/3191", "pm_score": 5, "selected": true, "text": "Silverlight.isInstalled(\"4.0\")" }, { "answer_id": 120638, "author": "pcorcoran", "author_id": 15992, "a...
2008/09/23
[ "https://Stackoverflow.com/questions/119980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/986/" ]
119,994
<p>We run full re-indexes every 7 days (i.e. creating the index from scratch) on our Lucene index and incremental indexes every 2 hours or so. Our index has around 700,000 documents and a full index takes around 17 hours (which isn't a problem).</p> <p>When we do incremental indexes, we only index content that has cha...
[ { "answer_id": 120376, "author": "Matt Quail", "author_id": 15790, "author_profile": "https://Stackoverflow.com/users/15790", "pm_score": 5, "selected": true, "text": "optimize() optimize() optimize() optimize() optimize()" }, { "answer_id": 390533, "author": "James Brady", ...
2008/09/23
[ "https://Stackoverflow.com/questions/119994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6282/" ]
119,999
<p>How can I setup a shared ccache without falling into a permissions problem?</p> <p>I would like to run a nightly or CI build with latest changes and share all created binaries throughout the R&amp;D using a large ccache repository.</p>
[ { "answer_id": 3099439, "author": "Joel Rosdahl", "author_id": 331771, "author_profile": "https://Stackoverflow.com/users/331771", "pm_score": 4, "selected": false, "text": "CCACHE_DIR CCACHE_UMASK CCACHE_BASEDIR" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1656532/" ]
120,000
<p>I had recently a problem with oom-killer starting to kill processes after some time. I could see that the memory was consumed, but by the time I got to the server it wasn't clear anymore what consumed it. Is there a good non-obvious place to get more info about oom-killer? E.g. detailed info about processes at the t...
[ { "answer_id": 120063, "author": "Thorsten79", "author_id": 19734, "author_profile": "https://Stackoverflow.com/users/19734", "pm_score": 1, "selected": false, "text": "malloc(3) echo 2 > /proc/sys/vm/overcommit_memory\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/120000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20022/" ]
120,001
<p>I am looking for a free tool to load Excel data sheet into an Oracle database. I tried the Oracle SQL developer, but it keeps throwing a NullPointerException. Any ideas?</p>
[ { "answer_id": 120021, "author": "Galwegian", "author_id": 3201, "author_profile": "https://Stackoverflow.com/users/3201", "pm_score": 4, "selected": false, "text": "CREATE TABLE load data\ninfile theFile.csv\nreplace\ninto table theTable\nfields terminated by ','\n(x,y,z)\n % sqlload us...
2008/09/23
[ "https://Stackoverflow.com/questions/120001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1233512/" ]
120,016
<p>I have the following XML structure:</p> <pre><code>&lt;?xml version="1.0" ?&gt; &lt;course xml:lang="nl"&gt; &lt;body&gt; &lt;item id="787900813228567" view="12000" title="0x|Beschrijving" engtitle="0x|Description"&gt;&lt;![CDATA[Dit college leert studenten hoe ze een onderzoek kunn$ &lt;item id="54531166...
[ { "answer_id": 120069, "author": "Marc Gear", "author_id": 6563, "author_profile": "https://Stackoverflow.com/users/6563", "pm_score": 2, "selected": false, "text": "echo $description[0];\n $str = (string) $description[0];\n" }, { "answer_id": 120070, "author": "Eric_WVGG", ...
2008/09/23
[ "https://Stackoverflow.com/questions/120016", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18922/" ]
120,033
<p>In C++, it's not possible to initialize array members in the initialization list, thus member objects should have default constructors and they should be properly initialized in the constructor. Is there any (reasonable) workaround for this apart from not using arrays?</p> <p>[Anything that can be initialized using...
[ { "answer_id": 120084, "author": "Suma", "author_id": 16673, "author_profile": "https://Stackoverflow.com/users/16673", "pm_score": 3, "selected": true, "text": " class Foo\n {\n private:\n char inst[3*sizeof(OtherClass)]; // Array size fixed. OtherClass has no default ctor.\n\n ...
2008/09/23
[ "https://Stackoverflow.com/questions/120033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20957/" ]
120,054
<p>I am selecting rows from a table, but some of the columns are a text type, but they always have numeric data in them. How can I format them as numbers?</p> <p>e.g. column quantity heading 'Quantity' format 999,999</p> <p>However, since the column in the table is text, the numeric formatting is ignored.</p>
[ { "answer_id": 120136, "author": "cagcowboy", "author_id": 19629, "author_profile": "https://Stackoverflow.com/users/19629", "pm_score": 1, "selected": false, "text": "to_char(to_number(quantity), '999,999')\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/120054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4834/" ]
120,059
<p>I am releasing a database build to SQL Server 2000 via a batch file using isql. The batch file is used so multiple files are released consistently to different SQL Servers (development, test, live).</p> <p>The SQL Server uses ANSI code page 1252 (from sp_helpsort) but isql is an OEM client using code page 437. This...
[ { "answer_id": 120257, "author": "Mike Dimmick", "author_id": 6970, "author_profile": "https://Stackoverflow.com/users/6970", "pm_score": 3, "selected": true, "text": "isql osql sqlcmd" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/120059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5096/" ]
120,061
<p>I try to fetch a Wikipedia article with Python's urllib:</p> <pre><code>f = urllib.urlopen("http://en.wikipedia.org/w/index.php?title=Albert_Einstein&amp;printable=yes") s = f.read() f.close() </code></pre> <p>However instead of the html page I get the following response: Error - Wikimedia Foundation:</...
[ { "answer_id": 120118, "author": "Florian Bösch", "author_id": 19435, "author_profile": "https://Stackoverflow.com/users/19435", "pm_score": 7, "selected": true, "text": "import urllib2\nopener = urllib2.build_opener()\nopener.addheaders = [('User-agent', 'Mozilla/5.0')]\ninfile = opener...
2008/09/23
[ "https://Stackoverflow.com/questions/120061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20999/" ]
120,065
<p>Assume that we have N erlang nodes, running same application. I want to share an mnesia table T1 with all N nodes, which I see no problem. However, I want to share another mnesia table T2 with pairs of nodes. I mean the contents of T2 will be identical and replicated to/with only sharing pair. In another words, I wa...
[ { "answer_id": 120987, "author": "uwiger", "author_id": 6834, "author_profile": "https://Stackoverflow.com/users/6834", "pm_score": 3, "selected": false, "text": "mnesia_frag_hash" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/120065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21000/" ]
120,071
<p>I have a string of arbitrary length, and starting at position p0, I need to find the first occurrence of one of three 3-letter patterns.</p> <p>Assume the string contain only letters. I need to find the count of triplets starting at position p0 and jumping forward in triplets until the first occurrence of either 'a...
[ { "answer_id": 120094, "author": "Mike G.", "author_id": 18901, "author_profile": "https://Stackoverflow.com/users/18901", "pm_score": 4, "selected": false, "text": "$string=~/^ # from the start of the string\n (?:.{$p0}) # skip (don't capture) \"$p0\" occurrences of any cha...
2008/09/23
[ "https://Stackoverflow.com/questions/120071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15161/" ]
120,083
<p>Is there a way to alter the precision of an existing decimal column in Microsoft SQL Server?</p>
[ { "answer_id": 120821, "author": "VanSkalen", "author_id": 7367, "author_profile": "https://Stackoverflow.com/users/7367", "pm_score": 9, "selected": true, "text": "ALTER TABLE Testing ALTER COLUMN TestDec decimal(16,1)\n decimal(precision, scale)" }, { "answer_id": 22895155, ...
2008/09/23
[ "https://Stackoverflow.com/questions/120083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12767/" ]
120,102
<p>My stored procedure is called as below from an SQL instegartion package within SQL Server 2005</p> <p>EXEC ? = Validation.PopulateFaultsFileDetails ? , 0</p> <p>Though i'm not sure what the ? means</p>
[ { "answer_id": 120231, "author": "AJ.", "author_id": 7211, "author_profile": "https://Stackoverflow.com/users/7211", "pm_score": 2, "selected": true, "text": "dim result\nSQL = \"EXEC ? = Validation.PopulateFaultsFileDetails ? , 0\"\nSQL.execute(result, 99) // pass in 99 to the stored...
2008/09/23
[ "https://Stackoverflow.com/questions/120102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21004/" ]
120,114
<p>I am using following PHP code to connect to MS Access database:</p> <pre><code>$odb_conn = new COM("ADODB.Connection"); $connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". $db_path.";"; $odb_conn-&gt;open($connstr); </code></pre> <p>How can I retrieve database catalog/metadata from the mdb file?</p> <p><...
[ { "answer_id": 120195, "author": "Abbas", "author_id": 4714, "author_profile": "https://Stackoverflow.com/users/4714", "pm_score": 0, "selected": false, "text": "MSysObjects SELECT NAME\nFROM MSysObjects\nWHERE Type In (1,4,6) AND Left([Name],4)<>\"MSYS\"\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/120114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6561/" ]
120,116
<p>I have been tasked with implementing a PKI library in C# for a company project, and have been unable to find a good implementation of it. There appear to be multiple libraries, and many broken links pointing to MSDN libraries that have been removed. I've seen people using Crypt32.dll, people building their own libra...
[ { "answer_id": 120230, "author": "Alan Mendelevich", "author_id": 19546, "author_profile": "https://Stackoverflow.com/users/19546", "pm_score": 0, "selected": false, "text": "RSACryptoServiceProvider rscp = new RSACryptoServiceProvider();\nrscp.FromXmlString(\"<RSAKeyValue><Modulus>key d...
2008/09/23
[ "https://Stackoverflow.com/questions/120116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21002/" ]
120,158
<p>We have a discussion going on in my team at the moment, and I'd be interested in other views. Suppose we have a RESTful web service whose role is to annotate documents by applying a variety of analysis algorithms and services. The basic interaction in clear: we have a resource which is the document collection; the ...
[ { "answer_id": 120337, "author": "Matt Quail", "author_id": 15790, "author_profile": "https://Stackoverflow.com/users/15790", "pm_score": 2, "selected": false, "text": "GET {docURI}/metadata Expires ETag Expires ETag ETag 304 Not Modified" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/120158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6716/" ]
120,170
<p>I'm doing some testing on Firefox toolbars for the sake of learning and I can't find out any information on how to store the contents of a "search" drop-down inside the user's profile.</p> <p>Is there any tutorial on how to sort this out?</p>
[ { "answer_id": 121358, "author": "Gustavo Carreno", "author_id": 8167, "author_profile": "https://Stackoverflow.com/users/8167", "pm_score": 2, "selected": true, "text": "<textbox id=\"search_with_history\" />\n <textbox id=\"search_with_history\" type=\"autocomplete\"\n autocompletes...
2008/09/23
[ "https://Stackoverflow.com/questions/120170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8167/" ]
120,180
<p>I'm looking for a way to do query auto-completion/suggestions in Lucene. I've Googled around a bit and played around a bit, but all of the examples I've seen seem to be setting up filters in Solr. We don't use Solr and aren't planning to move to using Solr in the near future, and Solr is obviously just wrapping arou...
[ { "answer_id": 121456, "author": "Mat Mannion", "author_id": 6282, "author_profile": "https://Stackoverflow.com/users/6282", "pm_score": 6, "selected": true, "text": "import java.io.IOException;\nimport java.io.Reader;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java....
2008/09/23
[ "https://Stackoverflow.com/questions/120180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6282/" ]
120,189
<p>As a temporary quick fix to mitigate the major risk while working on the permanent fix for XSS Vulnerability in a very large code base, I'm looking for a pre-existing XSS prevention blacklist that does a reasonable job of protecting against XSS.</p> <p>Preferably a set of Regular Expressions. I'm aware of plenty of...
[ { "answer_id": 121262, "author": "tduehr", "author_id": 20486, "author_profile": "https://Stackoverflow.com/users/20486", "pm_score": 1, "selected": false, "text": "&lt; &quot;" }, { "answer_id": 122066, "author": "Chris Kite", "author_id": 9573, "author_profile": "ht...
2008/09/23
[ "https://Stackoverflow.com/questions/120189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7106/" ]
120,191
<p>So you've created a ruby library.</p> <p>How do you create and publish your rubygem? And what common pitfalls and gotchas are there pertaining to creating and publishing rubygems?</p>
[ { "answer_id": 122913, "author": "Clinton Dreisbach", "author_id": 6262, "author_profile": "https://Stackoverflow.com/users/6262", "pm_score": 4, "selected": true, "text": "bones <my_project_name> lib bin Rakefile load 'tasks/setup.rb'\n\nensure_in_path 'lib'\nrequire 'friend-feed'\n\nta...
2008/09/23
[ "https://Stackoverflow.com/questions/120191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8683/" ]
120,201
<p>I want to upload and then process a file in a Ruby on Rails app. The file upload is usually quite short, but the server-side processing can take some time (more than 20 seconds) so I want to give the user some indicator - something better than a meaningless 'processing...' screen.</p> <p>I'm trying to use the foll...
[ { "answer_id": 120317, "author": "liangzan", "author_id": 11927, "author_profile": "https://Stackoverflow.com/users/11927", "pm_score": 3, "selected": true, "text": "periodically_call_remote() div xmlhttp" }, { "answer_id": 121201, "author": "Ian Terrell", "author_id": 92...
2008/09/23
[ "https://Stackoverflow.com/questions/120201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6106/" ]
120,206
<p>The problem is not about randomness itself (we have rand), but in cryptographically secure PRNG. What can be used on Linux, or ideally POSIX? Does NSS have something useful?</p> <p><strong>Clarification</strong>: I know about /dev/random, but it may run out of entropy pool. And I'm not sure whether /dev/urandom is ...
[ { "answer_id": 120209, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "/dev/random" }, { "answer_id": 120223, "author": "Armin Ronacher", "author_id": 19990, "author_profil...
2008/09/23
[ "https://Stackoverflow.com/questions/120206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9403/" ]
120,212
<p>I am using VMware Server 1.0.7 on Windows XP SP3 at the moment to test software in virtual machines.</p> <p>I have also tried Microsoft Virtual PC (do not remeber the version, could be 2004 or 2007) and VMware was way faster at the time.</p> <p>I have heard of Parallels and VirtualBox but I did not have the time t...
[ { "answer_id": 120209, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "/dev/random" }, { "answer_id": 120223, "author": "Armin Ronacher", "author_id": 19990, "author_profil...
2008/09/23
[ "https://Stackoverflow.com/questions/120212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17469/" ]
120,226
<p>I have just installed Windows Server 2003 Standard Edition and therefore IIS6 (comes as standard). I have also install the windows component that enable the administration of IIS from the browser (<a href="https://server:8098/" rel="nofollow noreferrer">https://server:8098/</a>). The problem I have is that I have to...
[ { "answer_id": 648790, "author": "Shalom Craimer", "author_id": 54491, "author_profile": "https://Stackoverflow.com/users/54491", "pm_score": 0, "selected": false, "text": "gpedit.msc Computer Configuration\n Windows Settings\n Security Settings\n Local Policies\n Accounts: Limit l...
2008/09/23
[ "https://Stackoverflow.com/questions/120226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
120,228
<p>I have a site on my webhotel I would like to run some scheduled tasks on. What methods of achieving this would you recommend?</p> <p>What I’ve thought out so far is having a script included in the top of every page and then let this script check whether it’s time to run this job or not.</p> <p>This is just a quick...
[ { "answer_id": 120236, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 5, "selected": false, "text": "man crontab" }, { "answer_id": 120258, "author": "Zebra North", "author_id": 17440, "author_pro...
2008/09/23
[ "https://Stackoverflow.com/questions/120228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15214/" ]
120,240
<p>I am trying to optimize some stored procedures on a SQL Server 2000 database and when I try to use SQL Profiler I get an error message "In order to run a trace against SQL Server you have to be a member of sysadmin fixed server role.". It seems that only members of the sysadmin role can run traces on the server (som...
[ { "answer_id": 120236, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 5, "selected": false, "text": "man crontab" }, { "answer_id": 120258, "author": "Zebra North", "author_id": 17440, "author_pro...
2008/09/23
[ "https://Stackoverflow.com/questions/120240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11471/" ]
120,244
<p>I'm trying to put together a selector in SASS that will operate on the visted, hovered state of a link, but I can't quite seem to get the markup right, can someone enlighten me? I was writing it like this:</p> <pre><code> &amp;:visited:hover attribute: foo </code></pre>
[ { "answer_id": 120515, "author": "user6325", "author_id": 6325, "author_profile": "https://Stackoverflow.com/users/6325", "pm_score": 1, "selected": false, "text": "a\n &:visited:hover\n :attribute foo\n" }, { "answer_id": 6929064, "author": "crispy", "author_id": 2315...
2008/09/23
[ "https://Stackoverflow.com/questions/120244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2977/" ]
120,250
<p>Python allocates integers automatically based on the underlying system architecture. Unfortunately I have a huge dataset which needs to be fully loaded into memory. </p> <p>So, is there a way to force Python to use only 2 bytes for some integers (equivalent of C++ 'short')?</p>
[ { "answer_id": 120256, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 5, "selected": false, "text": "from array import array\na = array(\"h\") # h = signed short, H = unsigned short\n" }, { "answer_id": 12044...
2008/09/23
[ "https://Stackoverflow.com/questions/120250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21029/" ]
120,262
<p>Say for instance I was writing a function that was designed to accept multiple argument types:</p> <pre><code>var overloaded = function (arg) { if (is_dom_element(arg)) { // Code for DOM Element argument... } }; </code></pre> <p>What's the best way to implement <strong><code>is_dom_element</code></...
[ { "answer_id": 120275, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 2, "selected": false, "text": "node instanceof HTMLElement\n typeof x.nodeType != 'undefined'" }, { "answer_id": 120280, "author": "Ji...
2008/09/23
[ "https://Stackoverflow.com/questions/120262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10942/" ]
120,266
<p>In my database, I have a model which has a field which should be selected from one of a list of options. As an example, consider a model which needs to store a measurement, such as 5ft or 13cm or 12.24m3. The obvious way to achieve this is to have a decimal field and then some other field to store the unit of measur...
[ { "answer_id": 120318, "author": "Hank Gay", "author_id": 4203, "author_profile": "https://Stackoverflow.com/users/4203", "pm_score": 1, "selected": false, "text": "name UnitOfMeasure UnitOfMeasurement" }, { "answer_id": 120524, "author": "Ben Scofield", "author_id": 6478...
2008/09/23
[ "https://Stackoverflow.com/questions/120266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
120,283
<p>I am wanting to find the distance between two different points. This I know can be accomplished with the great circle distance. <a href="http://www.meridianworlddata.com/Distance-calculation.asp" rel="noreferrer">http://www.meridianworlddata.com/Distance-calculation.asp</a></p> <p>Once done, with a point and distan...
[ { "answer_id": 123305, "author": "Sean", "author_id": 5446, "author_profile": "https://Stackoverflow.com/users/5446", "pm_score": 7, "selected": false, "text": "public static double distFrom(double lat1, double lng1, double lat2, double lng2) {\n double earthRadius = 3958.75; // miles...
2008/09/23
[ "https://Stackoverflow.com/questions/120283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8633/" ]
120,295
<p>I'd like to find a good object oriented C++ (as opposed to C) wrapper for sqlite. What do people recommend? If you have several suggestions please put them in separate replies for voting purposes. Also, please indicate whether you have any experience of the wrapper you are suggesting and how you found it to use.</p>...
[ { "answer_id": 387834, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "try\n{\n\n CppSQLite3DB db;\n\n db.open(asFileName.c_str());\n\n db.execDML(\"Update data set hrx = 0\");\n\n} // try...
2008/09/23
[ "https://Stackoverflow.com/questions/120295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17493/" ]
120,296
<p>This is obviously a stupid question. I am coding in Eclipse both on Mac and Linux, but I mixed up and used the Mac shortcut to window tabbing (<kbd>Ctrl</kbd>-<kbd>Cmd</kbd>-<kbd>F6</kbd>), but I was using the Linux on uni and screen went black. I've done this before, but this time I can't get back to my desktop. <k...
[ { "answer_id": 122827, "author": "duffbeer703", "author_id": 21292, "author_profile": "https://Stackoverflow.com/users/21292", "pm_score": 2, "selected": false, "text": "init 3\n init 5\n" }, { "answer_id": 61402330, "author": "Alex_Gofman", "author_id": 7560180, "aut...
2008/09/23
[ "https://Stackoverflow.com/questions/120296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6371/" ]
120,315
<p>Once I've created a variable in the immediate window in C# (VS2008), is there any way to delete it so I can create a new variable with the same name but a different type? Apart from restarting the program that is.</p> <p>The reason would be to keep the immediate window's namespace clean, since it's difficult to kee...
[ { "answer_id": 788476, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "public void LolFunction() {\n {\n int main = 0;\n Console.Writeline(main);\n }\n {\n string main...
2008/09/23
[ "https://Stackoverflow.com/questions/120315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/161040/" ]
120,334
<p>I currentyl have no clue on how to sort an array which contains UTF-8 encoded strings in PHP. The array comes from a LDAP server so sorting via a database (would be no problem) is no solution. The following does not work on my windows development machine (although I'd think that this should be at least a possible s...
[ { "answer_id": 120388, "author": "Huppie", "author_id": 1830, "author_profile": "https://Stackoverflow.com/users/1830", "pm_score": 0, "selected": false, "text": "$array=array('Birnen', 'Äpfel', 'Ungetüme', 'Apfel', 'Ungetiere', 'Österreich');\n$oldLocal=setlocale(LC_COLLATE, \"0\");\nva...
2008/09/23
[ "https://Stackoverflow.com/questions/120334", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11354/" ]
120,380
<p>Is there anyway in Java to delete data (e.g., a variable value, object) and be sure it can't be recovered from memory? Does assigning <code>null</code> to a variable in Java delete the value from memory? Any ideas? Answers applicable to other languages are also acceptable.</p>
[ { "answer_id": 121798, "author": "erickson", "author_id": 3474, "author_profile": "https://Stackoverflow.com/users/3474", "pm_score": 3, "selected": false, "text": "String KeyStore.load char[] finally KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\nInputStream is = …\ncha...
2008/09/23
[ "https://Stackoverflow.com/questions/120380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15474/" ]
120,395
<p>I'm looking for non-web-based tools to view IIS logs. I've been using <a href="http://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx" rel="nofollow noreferrer">LogParser</a> but I was hoping for something with an interface. It doesn't need to do any fancy reports or charts -- just a list with ...
[ { "answer_id": 120464, "author": "Liam", "author_id": 18333, "author_profile": "https://Stackoverflow.com/users/18333", "pm_score": 1, "selected": false, "text": "findstr \"404\" logfilename > out.txt\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/120395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4925/" ]
120,420
<p>I would like to have information about the icons which are displayed alongside the site URLs on a web browser. Is this some browser specific feature? Where do we specify the icon source, ie, is it in some tag on the web page itself ?</p>
[ { "answer_id": 120428, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "https://Stackoverflow.com/users/3153", "pm_score": 7, "selected": true, "text": "<head profile=\"http://www.w3.org/2005/10/profile\">\n<link rel=\"icon\" \n type=\"image/png\" \n href=\"/so...
2008/09/23
[ "https://Stackoverflow.com/questions/120420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11614/" ]
120,422
<p>How do I iterate over a set of records in RPG(LE) with embedded SQL?</p>
[ { "answer_id": 120993, "author": "Mike Wills", "author_id": 2535, "author_profile": "https://Stackoverflow.com/users/2535", "pm_score": 5, "selected": true, "text": " //***********************************************************************\n // Main - Main Processing Routine\n beg...
2008/09/23
[ "https://Stackoverflow.com/questions/120422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
120,438
<p>What's the difference between "Layers" and "Tiers"?</p>
[ { "answer_id": 20674120, "author": "TryinHard", "author_id": 2776146, "author_profile": "https://Stackoverflow.com/users/2776146", "pm_score": 4, "selected": false, "text": "Tier Layer" }, { "answer_id": 35970802, "author": "Yash", "author_id": 5081877, "author_profil...
2008/09/23
[ "https://Stackoverflow.com/questions/120438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18722/" ]
120,467
<p>I would like to confirm that the following analysis is correct:</p> <p>I am building a web app in RoR. I have a data structure for my postgres db designed (around 70 tables; this design may need changes and additions during development to reflect Rails ways of doing things. EG, I designed some user and role tables ...
[ { "answer_id": 120494, "author": "Ben Scofield", "author_id": 6478, "author_profile": "https://Stackoverflow.com/users/6478", "pm_score": 4, "selected": true, "text": "def self.up\n create_table :users do |t|\n t.column :department_id, :integer, :references => :departments\n end\nen...
2008/09/23
[ "https://Stackoverflow.com/questions/120467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6941/" ]
120,470
<p>I'm using nhibernate to store some user settings for an app in a SQL Server Compact Edition table.</p> <p>This is an excerpt the mapping file:</p> <pre><code>&lt;property name="Name" type="string" /&gt; &lt;property name="Value" type="string" /&gt; </code></pre> <p>Name is a regular string/nvarchar(50), and Value...
[ { "answer_id": 120560, "author": "Jimmeh", "author_id": 20749, "author_profile": "https://Stackoverflow.com/users/20749", "pm_score": 0, "selected": false, "text": "<property name=\"Value\" type=\"string\" />\n <column name=\"Value\" sql-type=\"StringClob\" />\n</property>\n" }, { ...
2008/09/23
[ "https://Stackoverflow.com/questions/120470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21033/" ]
120,497
<p>I've noticed that Internet Explorer adds a number in square brackets to files downloaded from the internet (usually [1]). This creates a big problem with downloading Excel spreadsheets as square brackets are not a valid filename character inside Excel worksheet name. That problem is IE specific, others browsers are ...
[ { "answer_id": 120569, "author": "Seb Nilsson", "author_id": 2429, "author_profile": "https://Stackoverflow.com/users/2429", "pm_score": 0, "selected": false, "text": "Response.AppendHeader(\"content-disposition\", \"attachment;filename=file.xls\");\nResponse.ContentType = \"application/...
2008/09/23
[ "https://Stackoverflow.com/questions/120497", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3122/" ]
120,503
<p>I'm trying to populate a TDBGrid with the results of the following TQuery against the file Journal.db:</p> <pre><code>select * from Journal where Journal.where = "RainPump" </code></pre> <p>I've tried both <code>Journal."Where"</code> and <code>Journal.[Where]</code> to no avail.</p> <p>I've also tried: <code>se...
[ { "answer_id": 120518, "author": "Johan Bresler", "author_id": 3535708, "author_profile": "https://Stackoverflow.com/users/3535708", "pm_score": 0, "selected": false, "text": "select * from Journal where Journal.\"where\" = \"RainPump\"\n" }, { "answer_id": 120519, "author": ...
2008/09/23
[ "https://Stackoverflow.com/questions/120503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11781/" ]
120,504
<p>I'm trying to run the following SQL statement in Oracle, and it takes ages to run:</p> <pre><code>SELECT orderID FROM tasks WHERE orderID NOT IN (SELECT DISTINCT orderID FROM tasks WHERE engineer1 IS NOT NULL AND engineer2 IS NOT NULL) </code></pre> <p>If I run just the sub-part that is in the IN clause, that ru...
[ { "answer_id": 120516, "author": "Georgi", "author_id": 13209, "author_profile": "https://Stackoverflow.com/users/13209", "pm_score": 2, "selected": false, "text": "SELECT orderID FROM tasks WHERE orderID NOT EXISTS \n (SELECT DISTINCT orderID FROM tasks WHERE\n engineer1 IS N...
2008/09/23
[ "https://Stackoverflow.com/questions/120504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7261/" ]
120,561
<p>We have a vxWorks design which requires one task to process both high and low priority messages sent over two message queues.<br> The messages for a given priority have to be processed in FIFO order. </p> <p>For example, process all the high priority messages in the order they were received, then process the low p...
[ { "answer_id": 120788, "author": "Benoit", "author_id": 10703, "author_profile": "https://Stackoverflow.com/users/10703", "pm_score": 1, "selected": false, "text": "\nMSG_Q_ID lowQ, hiQ;\n\nvoid Init() {\n// Task Initialization Code. This should be called from the task that will\n// be ...
2008/09/23
[ "https://Stackoverflow.com/questions/120561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10703/" ]
120,578
<p>Take any social website like <a href="http://en.wikipedia.org/wiki/Digg" rel="nofollow noreferrer">Digg</a> or Stack&nbsp;Overflow that somehow lets users reward points for stories, questions, etc..</p> <p>What happens is quite similar to the process that lead to the rise of tabloid newspapers that feed only headli...
[ { "answer_id": 158898, "author": "eaolson", "author_id": 23669, "author_profile": "https://Stackoverflow.com/users/23669", "pm_score": -1, "selected": false, "text": "OBSCURE_TASK LANGUAGE TOOLKIT" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/120578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19435/" ]
120,579
<p>What would be the best way to expose certain functionality in a Dotnet VSTO Excel add-in to VBA, without requiring the user to be a local administrator (i.e. no COM registration, <a href="http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic49734.aspx" rel="nofollow noreferrer">no HttpListener</...
[ { "answer_id": 120925, "author": "Joe", "author_id": 13087, "author_profile": "https://Stackoverflow.com/users/13087", "pm_score": 1, "selected": false, "text": "Private m_objMyFactory As Object\n\nPublic Sub RegisterFactory(MyFactory As Object)\n\n On Error GoTo ErrHandler\n Set m...
2008/09/23
[ "https://Stackoverflow.com/questions/120579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6022/" ]
120,584
<p>In a <a href="http://www.pygame.org/" rel="nofollow noreferrer">pyGame</a> application, I would like to render resolution-free GUI widgets described in SVG.</p> <p>How can I achieve this?</p> <p>(I like the <a href="http://ocemp.sourceforge.net/gui.html" rel="nofollow noreferrer">OCEMP GUI</a> toolkit but it seems t...
[ { "answer_id": 121653, "author": "Pierre-Jean Coudert", "author_id": 8450, "author_profile": "https://Stackoverflow.com/users/8450", "pm_score": 2, "selected": false, "text": "import cairo\nimport rsvg\n\nWIDTH, HEIGHT = 256, 256\nsurface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH,...
2008/09/23
[ "https://Stackoverflow.com/questions/120584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8450/" ]
120,587
<p>I would like to trash the mail received by a single qmail alias. I don't want any mail delivery errors, and I want qmail to be happy about having delivered the mail.</p> <p>How can I do this, preferably without adding another local email account?</p>
[ { "answer_id": 120771, "author": "Roman Odaisky", "author_id": 21055, "author_profile": "https://Stackoverflow.com/users/21055", "pm_score": 2, "selected": false, "text": "|cat >/dev/null\n Unable_to_write_/dev/null" }, { "answer_id": 655324, "author": "drench", "author_i...
2008/09/23
[ "https://Stackoverflow.com/questions/120587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15992/" ]
120,588
<p>I'm using Hibernate for ORM of my Java app to an Oracle database (not that the database vendor matters, we may switch to another database one day), and I want to retrieve objects from the database according to user-provided strings. For example, when searching for people, if the user is looking for people who live i...
[ { "answer_id": 120622, "author": "Richard", "author_id": 20038, "author_profile": "https://Stackoverflow.com/users/20038", "pm_score": 2, "selected": false, "text": "select f.name from f where TO_UPPER(f.name) like '%FRAN%'\n" }, { "answer_id": 120641, "author": "Cowan", ...
2008/09/23
[ "https://Stackoverflow.com/questions/120588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2819/" ]
120,607
<p>I am trying to separate some asp logic out into a separate page. For now, I am trying to call a simple function. </p> <p>Here is the simple index page that I am using</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Calling a webservice from classic ASP&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;% If Reques...
[ { "answer_id": 120619, "author": "Matthias Meid", "author_id": 17713, "author_profile": "https://Stackoverflow.com/users/17713", "pm_score": 1, "selected": false, "text": "doStuff\n" }, { "answer_id": 120632, "author": "ConroyP", "author_id": 2287, "author_profile": "...
2008/09/23
[ "https://Stackoverflow.com/questions/120607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11612/" ]
120,618
<p>What logging solutions exist for j2me? </p> <p>I'm specifically interested in easily excluding logging for "release" version, to have a smaller package &amp; memory footprint. </p>
[ { "answer_id": 121077, "author": "JaanusSiim", "author_id": 706, "author_profile": "https://Stackoverflow.com/users/706", "pm_score": 5, "selected": true, "text": "public class Log {\n public static void debug(final String message) {\n //#if !release.build\n System.out.println(mes...
2008/09/23
[ "https://Stackoverflow.com/questions/120618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6827/" ]
120,621
<p>Is Eclipse at all theme-able? I would like to install a dark color scheme for it, since I much prefer white text on dark background than the other way around.</p>
[ { "answer_id": 3587514, "author": "TEHEK", "author_id": 295253, "author_profile": "https://Stackoverflow.com/users/295253", "pm_score": 0, "selected": false, "text": "!!ARBfp1.0\nTEMP temp, neg;\n\n# Dunno what's this... but every other filter starts with this :) ;\nTEX temp, fragment.te...
2008/09/23
[ "https://Stackoverflow.com/questions/120621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/985/" ]
120,625
<p>I got this error when I checked out my database from source control. It might sounds weird to check in the sql server database, but this was what I have done because this is just a personal project.</p> <p>Anyone knows how to fix this?</p>
[ { "answer_id": 120643, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 1, "selected": false, "text": "ATTACH_REBUILD_LOG" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/120625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
120,627
<p>I would like to replace the default malloc at link time to use a custom malloc. But when I try to redefine malloc in my program, I get this error:</p> <pre><code>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _malloc already defined in test.lib(test.obj) </code></pre> <p>This works perfectly on any Unix, and it works on...
[ { "answer_id": 4216966, "author": "Alex", "author_id": 512381, "author_profile": "https://Stackoverflow.com/users/512381", "pm_score": 1, "selected": false, "text": "my_memory.c\n#undef malloc\n#undef calloc\n...\nvoid *_custom_malloc(int size) { return jmalloc(size); }\nvoid *_custom_ca...
2008/09/23
[ "https://Stackoverflow.com/questions/120627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14443/" ]
120,628
<p>This is a real issue that applies on tagging items in general (and yes, this applies to StackOverflow too, and no, it is not a question about StackOverflow).</p> <p>The whole tagging issue helps cluster similar items, whatever items they may be (jokes, blog posts, so questions etc). However, there (usually but not ...
[ { "answer_id": 120694, "author": "tzot", "author_id": 6899, "author_profile": "https://Stackoverflow.com/users/6899", "pm_score": 2, "selected": false, "text": "[Tags]\ntagID integer primary key\ntagName text\n\n[TagRelations]\ntagID integer # first part of two-field key\ntagID_parent in...
2008/09/23
[ "https://Stackoverflow.com/questions/120628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6899/" ]
120,646
<p>If you call javascript window.open and pass a url to a .xls file it open on some machines in the browser window. How can you force it into Excel?</p>
[ { "answer_id": 120709, "author": "pcorcoran", "author_id": 15992, "author_profile": "https://Stackoverflow.com/users/15992", "pm_score": 2, "selected": false, "text": "<a href=\"foo.xls\"> application/x-excel application/x-msexcel" }, { "answer_id": 120761, "author": "MB.", ...
2008/09/23
[ "https://Stackoverflow.com/questions/120646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19494/" ]
120,648
<p>I use Assert.Fail a lot when doing TDD. I'm usually working on one test at a time but when I get ideas for things I want to implement later I quickly write an empty test where the name of the test method indicates what I want to implement as sort of a todo-list. To make sure I don't forget I put an Assert.Fail() in ...
[ { "answer_id": 120670, "author": "Jimmeh", "author_id": 20749, "author_profile": "https://Stackoverflow.com/users/20749", "pm_score": 3, "selected": false, "text": "[Test]\n[Ignore]\npublic void YourTest()\n{ } \n" }, { "answer_id": 120679, "author": "Matt Howells", "auth...
2008/09/23
[ "https://Stackoverflow.com/questions/120648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3320/" ]
120,656
<p>How do I get a list of all files (and directories) in a given directory in Python?</p>
[ { "answer_id": 120676, "author": "rslite", "author_id": 15682, "author_profile": "https://Stackoverflow.com/users/15682", "pm_score": 9, "selected": false, "text": "os.listdir(path)\n" }, { "answer_id": 120692, "author": "curtisk", "author_id": 17651, "author_profile"...
2008/09/23
[ "https://Stackoverflow.com/questions/120656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17693/" ]
120,657
<p>I'm currently having a major issue with a python script. The script runs arbitrary commands through a handler to convert incorrect error reporting into correct error reporting.</p> <p>The issue I'm having is getting the script to work correctly on windows with a command that contains ampersands in it's path. I've a...
[ { "answer_id": 120706, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 4, "selected": true, "text": "subprocess.Popen(['command', 'argument1', 'argument2'], shell=False)\n" }, { "answer_id": 120708, "autho...
2008/09/23
[ "https://Stackoverflow.com/questions/120657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16035/" ]
120,662
<p>I'm trying to run SQuirreL SQL.<br> I've downloaded it and installed it, but when I try to run it I get this error message: </p> <blockquote> <p>Java Virtual Machine Launcher.<br> Could not find the main class.<br> Program will exit. </p> </blockquote> <p>I get the gist of this, but I have not idea how to f...
[ { "answer_id": 120729, "author": "MB.", "author_id": 11961, "author_profile": "https://Stackoverflow.com/users/11961", "pm_score": 5, "selected": true, "text": "squirrel-sql.jar java -jar squirrel-sql.jar\n" }, { "answer_id": 121552, "author": "18Rabbit", "author_id": 126...
2008/09/23
[ "https://Stackoverflow.com/questions/120662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7211/" ]
120,693
<p>I've got a function that runs a user generated Regex. However, if the user enters a regex that won't run then it stops and falls over. I've tried wrapping the line in a Try/Catch block but alas nothing happens.</p> <p>If it helps, I'm running jQuery but the code below does not have it as I'm guessing that it's a li...
[ { "answer_id": 120716, "author": "rslite", "author_id": 15682, "author_profile": "https://Stackoverflow.com/users/15682", "pm_score": 3, "selected": false, "text": "var grep = new RegExp('gr[');\n alert(e.message);\n" }, { "answer_id": 120743, "author": "Paul Whelan", "au...
2008/09/23
[ "https://Stackoverflow.com/questions/120693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1384652/" ]
120,702
<p>Using Scala's command line REPL:</p> <pre><code>def foo(x: Int): Unit = {} def foo(x: String): Unit = {println(foo(2))} </code></pre> <p>gives</p> <pre><code>error: type mismatch; found: Int(2) required: String </code></pre> <p>It seems that you can't define overloaded recursive methods in the REPL. I thought th...
[ { "answer_id": 122338, "author": "Daniel Spiewak", "author_id": 9815, "author_profile": "https://Stackoverflow.com/users/9815", "pm_score": 5, "selected": true, "text": "test def test(x: Int) = x + x\n test def test(ls: List[Int]) = (0 /: ls) { _ + _ }\n test test Int List[Int] test(1 ::...
2008/09/23
[ "https://Stackoverflow.com/questions/120702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15627/" ]
120,731
<p>Let's assume you have one massive table with three columns as shown below:</p> <pre><code>[id] INT NOT NULL, [date] SMALLDATETIME NOT NULL, [sales] FLOAT NULL </code></pre> <p>Also assume you are limited to one physical disk and one filegroup (PRIMARY). You expect this table to hold sales for 10,000,000+ ids, a...
[ { "answer_id": 120882, "author": "Amy B", "author_id": 8155, "author_profile": "https://Stackoverflow.com/users/8155", "pm_score": 3, "selected": false, "text": "CREATE TABLE Narrow\n(\n [id] INT NOT NULL,\n [date] SMALLDATETIME NOT NULL,\n [sales] FLOAT NULL,\n PRIMARY KEY(id, date)...
2008/09/23
[ "https://Stackoverflow.com/questions/120731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4391/" ]
120,751
<p>I have been trying to use routes.rb for creating a URL /similar-to-:product (where product is dynamic) for my website. The issue is that routes.rb readily supports URLs like /:product-similar but doesn't support the former because it requires :product to be preceded with a separator ('/' is a separator but '-' isn't...
[ { "answer_id": 1385217, "author": "Leonid Shevtsov", "author_id": 6678, "author_profile": "https://Stackoverflow.com/users/6678", "pm_score": 2, "selected": true, "text": "- map.similar_product '/similar-to-*product', :controller => 'products', :action => 'similar'\n @product = Product.f...
2008/09/23
[ "https://Stackoverflow.com/questions/120751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17494/" ]
120,755
<p>Is the Entity Framework aware of identity columns? </p> <p>I am using SQL Server 2005 Express Edition and have several tables where the primary key is an identity column. when I use these tables to create an entity model and use the model in conjunction with an entity datasource bond to a formview in order to creat...
[ { "answer_id": 388515, "author": "biozinc", "author_id": 30698, "author_profile": "https://Stackoverflow.com/users/30698", "pm_score": 6, "selected": false, "text": "CreateYourEntityHere SaveChanges()" }, { "answer_id": 6282096, "author": "John West", "author_id": 761580,...
2008/09/23
[ "https://Stackoverflow.com/questions/120755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
120,763
<p>I have a helper class pulling a string from an XML file. That string is a file path (so it has backslashes in it). I need to use that string as it is... How can I use it like I would with the literal command?</p> <p>Instead of this:</p> <pre><code>string filePath = @"C:\somepath\file.txt"; </code></pre> <p>I want...
[ { "answer_id": 120785, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 2, "selected": false, "text": "helper.getFilePath() \"c:\\somepath\\file.txt\" @ c:\\somepath\\file.txt c:\\somepath\\file.txt c:\\somepath\\file.txt" }...
2008/09/23
[ "https://Stackoverflow.com/questions/120763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14777/" ]
120,766
<p>I have several &lt;li> elements with different id's on ASP.NET page:</p> <pre><code>&lt;li id="li1" class="class1"&gt; &lt;li id="li2" class="class1"&gt; &lt;li id="li3" class="class1"&gt; </code></pre> <p>and can change their class using JavaScript like this:</p> <pre><code>li1.className="class2" </code></pre> ...
[ { "answer_id": 120774, "author": "stefano m", "author_id": 19261, "author_profile": "https://Stackoverflow.com/users/19261", "pm_score": 2, "selected": false, "text": "<li id=\"li1\" runat=\"server\">stuff</li>\n" }, { "answer_id": 120777, "author": "naspinski", "author_i...
2008/09/23
[ "https://Stackoverflow.com/questions/120766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11256/" ]
120,783
<p>Currently I have this (edited after reading advice):</p> <pre><code>struct Pair&lt;T, K&gt; : IEqualityComparer&lt;Pair&lt;T, K&gt;&gt; { readonly private T _first; readonly private K _second; public Pair(T first, K second) { _first = first; _second = second; } public T Fi...
[ { "answer_id": 120843, "author": "TcKs", "author_id": 20382, "author_profile": "https://Stackoverflow.com/users/20382", "pm_score": 2, "selected": false, "text": "bool result = ( x._hashCode == y._hashCode );\nif ( result ) { result = ( x._first == y._first && x._second == y._second ); }...
2008/09/23
[ "https://Stackoverflow.com/questions/120783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9825/" ]
120,797
<p>Many times, a Java app needs to connect to the Internet. The most common example happens when it is reading an XML file and needs to download its schema.</p> <p>I am behind a proxy server. How can I set my JVM to use the proxy ?</p>
[ { "answer_id": 120802, "author": "Leonel", "author_id": 15649, "author_profile": "https://Stackoverflow.com/users/15649", "pm_score": 10, "selected": true, "text": "http.proxyHost http.proxyPort JAVA_FLAGS=-Dhttp.proxyHost=10.0.0.100 -Dhttp.proxyPort=8800\njava ${JAVA_FLAGS} ...\n -Dhttp...
2008/09/23
[ "https://Stackoverflow.com/questions/120797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15649/" ]
120,804
<p>I am going through John Resig's excellent <a href="http://ejohn.org/apps/learn/#47" rel="noreferrer">Advanced javascript tutorial</a> and I do not thoroughly understand what's the difference between the following calls: (please note that 'arguments' is a builtin javascript word and is not exactly an array hence the ...
[ { "answer_id": 121054, "author": "ujh", "author_id": 4936, "author_profile": "https://Stackoverflow.com/users/4936", "pm_score": 3, "selected": false, "text": "Array().slice.call\n [].slice.call\n" }, { "answer_id": 121120, "author": "cllpse", "author_id": 20946, "aut...
2008/09/23
[ "https://Stackoverflow.com/questions/120804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21075/" ]
120,836
<p>How can one load custom (not an image, nor a sound file) resource file from /res within .jar using MIDP 2.0?</p>
[ { "answer_id": 1224490, "author": "kgutteridge", "author_id": 131410, "author_profile": "https://Stackoverflow.com/users/131410", "pm_score": 0, "selected": false, "text": "getResourceAsStream(\"/res/yourresource\");\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/120836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1596171/" ]
120,851
<p>We are creating an XBAP application that we need to have rounded corners in various locations in a single page and we would like to have a WPF Rounded Corner container to place a bunch of other elements within. Does anyone have some suggestions or sample code on how we can best accomplish this? Either with styles...
[ { "answer_id": 120895, "author": "kobusb", "author_id": 1620, "author_profile": "https://Stackoverflow.com/users/1620", "pm_score": 9, "selected": true, "text": "<Border BorderBrush=\"#FF000000\" BorderThickness=\"1\" CornerRadius=\"8\">\n <Grid/>\n</Border>\n <Grid/>" }, { "an...
2008/09/23
[ "https://Stackoverflow.com/questions/120851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21096/" ]
120,858
<p>Is it possible to, for instance, replace and free a TEdit with a subclassed component instantiated (conditionally) at runtime? If so, how and when it should be done? I've tried to set the parent to nil and to call free() in the form constructor and AfterConstruction methods but in both cases I got a runtime error.</...
[ { "answer_id": 121091, "author": "Loesje", "author_id": 17559, "author_profile": "https://Stackoverflow.com/users/17559", "pm_score": 3, "selected": false, "text": "var Edit2: TEdit;\nbegin\n Edit2 := TEdit.Create(self);\n Edit2.Left := Edit1.Left;\n Edit2.Top := Edit2.Top;\n Edit1.P...
2008/09/23
[ "https://Stackoverflow.com/questions/120858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16120/" ]
120,865
<p>Our application has a file format similar to the OpenDocument file format (see <a href="http://en.wikipedia.org/wiki/OpenDocument" rel="noreferrer">http://en.wikipedia.org/wiki/OpenDocument</a>) - i.e. zipped with a manifest file, a thumbnail image, etc.</p> <p>I notice that OpenOffice files have a preview image of...
[ { "answer_id": 1795641, "author": "gamma", "author_id": 153678, "author_profile": "https://Stackoverflow.com/users/153678", "pm_score": 2, "selected": false, "text": "#include <Cocoa/Cocoa.h>\n#include <Foundation/Foundation.h>\n\nOSStatus GenerateThumbnailForURL(void *thisInterface, QLT...
2008/09/23
[ "https://Stackoverflow.com/questions/120865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6583/" ]
120,876
<p>What are the C++ rules for calling the base class constructor from a derived class?</p> <p>For example, I know in Java, you must do it as the first line of the subclass constructor (and if you don't, an implicit call to a no-arg super constructor is assumed - giving you a compile error if that's missing).</p>
[ { "answer_id": 120916, "author": "luke", "author_id": 16434, "author_profile": "https://Stackoverflow.com/users/16434", "pm_score": 11, "selected": true, "text": "class SuperClass\n{\n public:\n\n SuperClass(int foo)\n {\n // do something with foo\n }\n...
2008/09/23
[ "https://Stackoverflow.com/questions/120876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4465/" ]
120,886
<p>Suppose we have an iterator (an infinite one) that returns lists (or finite iterators), for example one returned by</p> <pre><code>infinite = itertools.cycle([[1,2,3]]) </code></pre> <p>What is a good Python idiom to get an iterator (obviously infinite) that will return each of the elements from the first iterator, ...
[ { "answer_id": 120905, "author": "Thomas Wouters", "author_id": 17624, "author_profile": "https://Stackoverflow.com/users/17624", "pm_score": 4, "selected": false, "text": "(item for it in infinite for item in it)\n" }, { "answer_id": 120910, "author": "Torsten Marek", "a...
2008/09/23
[ "https://Stackoverflow.com/questions/120886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12166/" ]
120,889
<p>When running all my tests in Eclipse (Eclipse 3.4 'Ganymede'), one test is listed under "Unrooted Tests". I'm using Junit 3.8 and this particular test extends TestCase. I do not see any difference between this test and the other tests. I don't remember seeing this occur in Eclipse 3.3 (Europa).</p> <p>Clarification...
[ { "answer_id": 803487, "author": "ra9r", "author_id": 88916, "author_profile": "https://Stackoverflow.com/users/88916", "pm_score": 4, "selected": false, "text": "import static org.junit.Assert.*; // Notice the use of \"static\" here\nimport org.junit.Before;\nimport org.junit.Test;\n\np...
2008/09/23
[ "https://Stackoverflow.com/questions/120889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18995/" ]
120,900
<p>I'm working on databases that have moving tables auto-generated by some obscure tools. By the way, we have to track information changes in the table via some triggers. And, of course, it occurs that some changes in the table structure broke some triggers, by removing a column or changing its type, for example.</p> ...
[ { "answer_id": 120911, "author": "cagcowboy", "author_id": 19629, "author_profile": "https://Stackoverflow.com/users/19629", "pm_score": 5, "selected": true, "text": "SELECT *\nFROM ALL_OBJECTS\nWHERE OBJECT_NAME = trigger_name\nAND OBJECT_TYPE = 'TRIGGER'\nAND STATUS <> 'VALID'...
2008/09/23
[ "https://Stackoverflow.com/questions/120900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9396/" ]
120,907
<p>This is a scenario I've seen in multiple places over the years; I'm wondering if anyone else has run across a better solution than I have...</p> <p>My company sells a relatively small number of products, however the products we sell are highly specialized (i.e. in order to select a given product, a significant numb...
[ { "answer_id": 121044, "author": "Chris Cudmore", "author_id": 18907, "author_profile": "https://Stackoverflow.com/users/18907", "pm_score": 2, "selected": false, "text": "Table Product ( id PK, name, price, units_per_package)\nTable Product_Attribs (id FK ref Product, AttribName, Attrib...
2008/09/23
[ "https://Stackoverflow.com/questions/120907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7388/" ]
120,908
<p>I try to open and excel reference in LabVIEW and then close it after sometime. But the LabVIEW keeps holding the reference and does not release it unless I close the VI. Why is this happening? Is there anyway to force it to release the Reference?</p> <p>I am checking the error out for any errors. But it is not thro...
[ { "answer_id": 121044, "author": "Chris Cudmore", "author_id": 18907, "author_profile": "https://Stackoverflow.com/users/18907", "pm_score": 2, "selected": false, "text": "Table Product ( id PK, name, price, units_per_package)\nTable Product_Attribs (id FK ref Product, AttribName, Attrib...
2008/09/23
[ "https://Stackoverflow.com/questions/120908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13440/" ]
120,914
<p>I want my WPF application to be skinnable, by applying a certain XAML template, and the changes to be application wide, even for dynamic controls or controls that aren't even in the visual/logical tree. </p> <p>What can I use to accomplish this type of functionality? Are there any good resources or tutorials that s...
[ { "answer_id": 126578, "author": "Pop Catalin", "author_id": 4685, "author_profile": "https://Stackoverflow.com/users/4685", "pm_score": 2, "selected": false, "text": " <Application.Resources>\n <Style x:Key=\"{x:Type Button}\" TargetType=\"{x:Type Button}\">\n <Setter Property...
2008/09/23
[ "https://Stackoverflow.com/questions/120914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4685/" ]
120,917
<p>How to create a database using T SQL script on a specified location? Let's say, I want to create a SQL server database on <code>D:\temp\dbFolder</code>. How to do this?</p>
[ { "answer_id": 120940, "author": "Leah", "author_id": 5506, "author_profile": "https://Stackoverflow.com/users/5506", "pm_score": 6, "selected": true, "text": "USE [master]\nGO\n\n CREATE DATABASE [AdventureWorks] ON PRIMARY \n ( NAME = N'AdventureWorks_Data', FILENAME = N'C:\\Pro...
2008/09/23
[ "https://Stackoverflow.com/questions/120917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
120,926
<p>I see on Stack Overflow and <a href="http://www.python.org/dev/peps/pep-0008/" rel="noreferrer">PEP 8</a> that the recommendation is to use spaces only for indentation in Python programs. I can understand the need for consistent indentation and I have felt that pain.</p> <p>Is there an underlying reason for spaces...
[ { "answer_id": 121126, "author": "Rod Daunoravicius", "author_id": 20989, "author_profile": "https://Stackoverflow.com/users/20989", "pm_score": 0, "selected": false, "text": ":set expandtab" }, { "answer_id": 144096, "author": "Brian", "author_id": 9493, "author_prof...
2008/09/23
[ "https://Stackoverflow.com/questions/120926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4834/" ]
120,928
<p>I have a web part that I've developed, and if I manually install the web part it is fine.</p> <p>However when I have packaged the web part following the instructions on this web site as a guide: <a href="http://www.theartofsharepoint.com/2007/05/how-to-build-solution-pack-wsp.html" rel="noreferrer">http://www.thear...
[ { "answer_id": 121883, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<webParts>\n <webPart xmlns=\"http://schemas.microsoft.com/WebPart/v3\">\n <met...
2008/09/23
[ "https://Stackoverflow.com/questions/120928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
120,936
<p>I can add custom version strings to a C++ DLL in Visual Studio by editing the .rc file by hand. For example, if I add to the VersionInfo section of the .rc file</p> <pre><code>VALUE "BuildDate", "2008/09/19 15:42:52" </code></pre> <p>Then that date is visible in the file explorer, in the DLL's properties, under t...
[ { "answer_id": 120958, "author": "Khoth", "author_id": 20686, "author_profile": "https://Stackoverflow.com/users/20686", "pm_score": 2, "selected": false, "text": "[assembly: System.Reflection.AssemblyInformationalVersion(\"whatever you want\")]\n" }, { "answer_id": 122055, "...
2008/09/23
[ "https://Stackoverflow.com/questions/120936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15371/" ]
120,937
<p>After reading the Test-and-Set <a href="http://en.wikipedia.org/wiki/Test-and-set" rel="noreferrer">Wikipedia entry</a>, I am still left with the question "What would a Test-and-Set be used for?"</p> <p>I realize that you can use it to implement Mutex (as described in wikipedia), but what other uses does it have?</...
[ { "answer_id": 120999, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 4, "selected": false, "text": "a = a + 1 a 100 a 100 101 a a 101 100 a 101" }, { "answer_id": 71088489, "author": "Chen Li", "author_id...
2008/09/23
[ "https://Stackoverflow.com/questions/120937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10703/" ]
120,941
<p>I am building a small website for fun/learning using a fairly standard Web/Service/Data Access layered design.</p> <p>For the Data Access Layer, what is the best way to handle creating Connection objects to call my SQL stored procedures and why? Bearing in mind I am writing a lot of the code by hand (I know I could...
[ { "answer_id": 120999, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 4, "selected": false, "text": "a = a + 1 a 100 a 100 101 a a 101 100 a 101" }, { "answer_id": 71088489, "author": "Chen Li", "author_id...
2008/09/23
[ "https://Stackoverflow.com/questions/120941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
120,951
<p>I'd like to know do I normalize a URL in python. </p> <p>For example, If I have a url string like : "<a href="http://www.example.com/foo" rel="noreferrer">http://www.example.com/foo</a> goo/bar.html"</p> <p>I need a library in python that will transform the extra space (or any other non normalized character) to a ...
[ { "answer_id": 120959, "author": "tzot", "author_id": 6899, "author_profile": "https://Stackoverflow.com/users/6899", "pm_score": 3, "selected": false, "text": "from urllib.parse import urlparse, urlunparse, quote\ndef myquote(url):\n parts = urlparse(url)\n return urlunparse(parts...
2008/09/23
[ "https://Stackoverflow.com/questions/120951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13523/" ]
120,952
<p>I have an SP that takes 10 seconds to run about 10 times (about a second every time it is ran). The platform is asp .net, and the server is SQL Server 2005. I have indexed the table (not on the PK also), and that is not the issue. Some caveats:</p> <ul> <li>usp_SaveKeyword is not the issue. I commented out that en...
[ { "answer_id": 121094, "author": "ConcernedOfTunbridgeWells", "author_id": 15401, "author_profile": "https://Stackoverflow.com/users/15401", "pm_score": 3, "selected": true, "text": "top 1 @SearchID max (SearchID) where exists top SELECT TOP 1 @SearchID = SearchID \n FROM tblSearches...
2008/09/23
[ "https://Stackoverflow.com/questions/120952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7952/" ]
120,957
<p>What features of C++ should be avoided in embedded systems?</p> <p>Please classify the answer by reason such as:</p> <ul> <li>memory usage </li> <li>code size</li> <li>speed</li> <li>portability</li> </ul> <p>EDIT: Lets' use an ARM7TDMI with 64k ram as a target to control the scope of the answers.</p>
[ { "answer_id": 121633, "author": "Richard Corden", "author_id": 11698, "author_profile": "https://Stackoverflow.com/users/11698", "pm_score": 1, "selected": false, "text": "// foo.h\ntemplate <typename T> void foo () { /* some relatively large definition */ }\n\n// b1.cc\n#include \"foo....
2008/09/23
[ "https://Stackoverflow.com/questions/120957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/445087/" ]
120,966
<p>I was writing a (seemingly) straight-forward SQL snippet that drops a column after it makes sure the column exists.<br> The problem: if the column does NOT exist, the code <em>inside</em> the IF clause complains that it can't find the column! Well, <em>doh</em>, that's why it's inside the IF clause!<br> So my questi...
[ { "answer_id": 120985, "author": "TcKs", "author_id": 20382, "author_profile": "https://Stackoverflow.com/users/20382", "pm_score": 4, "selected": true, "text": "IF exists (select * from syscolumns\n WHERE id=object_id('Table_MD') and name='timeout')\nBEGIN\n DECLARE @SQL nvarchar(...
2008/09/23
[ "https://Stackoverflow.com/questions/120966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11545/" ]
120,977
<p>I understand the mantra of "don't roll your own" when it comes to site security frameworks.</p> <p>For most cases anyway.</p> <p>I'm going to be collaborating on a site that integrates text-messaging into the system.</p> <p>I'd like to use an existing, well-tested security framework to protect the users data, but...
[ { "answer_id": 4090666, "author": "aek", "author_id": 496368, "author_profile": "https://Stackoverflow.com/users/496368", "pm_score": 1, "selected": false, "text": "$context = new substrate_Context(\n './path/to/hole-security/hole-security-config.php'\n);\n\n$context->execute();\n\n$h...
2008/09/23
[ "https://Stackoverflow.com/questions/120977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9094/" ]
120,997
<p>I'm just getting started with Custom User Controls in C# and I'm wondering if there are any examples out there of how to write one which accepts nested tags?</p> <p>For example, when you create an <code>asp:repeater</code> you can add a nested tag for <code>itemtemplate</code>.</p>
[ { "answer_id": 121007, "author": "Rob", "author_id": 7872, "author_profile": "https://Stackoverflow.com/users/7872", "pm_score": 5, "selected": true, "text": "<Abc:CustomControlUno runat=\"server\" ID=\"Control1\">\n <Children>\n <Abc:Control1Child IntegerProperty=\"1\" />\n ...
2008/09/23
[ "https://Stackoverflow.com/questions/120997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11508/" ]
121,000
<p>I'm trying to create an Extension Method for MVC's htmlHelper. The purpose is to enable or disable an ActionLink based on the AuthorizeAttribute set on the controller/action. Borrowing from the <a href="http://blog.maartenballiauw.be/post/2008/08/29/Building-an-ASPNET-MVC-sitemap-provider-with-security-trimming.aspx...
[ { "answer_id": 121353, "author": "Ben Scheirman", "author_id": 3381, "author_profile": "https://Stackoverflow.com/users/3381", "pm_score": 0, "selected": false, "text": "<%= this.SecurityLink(text, demandRole, controller, action, values) %>" }, { "answer_id": 227890, "author"...
2008/09/23
[ "https://Stackoverflow.com/questions/121000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3396/" ]