qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
285,775
<p>One of my columns is called <code>from</code>. I can't change the name because I didn't make it. Am I allowed to do something like <code>SELECT from FROM TableName</code> or is there a special syntax to avoid the SQL Server being confused?</p>
[ { "answer_id": 285777, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 10, "selected": true, "text": "from select [from] from table;\n select table.[from] from table;\n" }, { "answer_id": 285783, "author": "Jo...
2008/11/12
[ "https://Stackoverflow.com/questions/285775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25645/" ]
285,782
<p>I have been using git for several months in a project developed only by myself. I have a local repository and push it regularly to github for backup purposes.</p> <p>I want to add another developer to this project, however I will have the responsibility of integrating the whole project.</p> <p>What is the recommen...
[ { "answer_id": 285803, "author": "Chris Vest", "author_id": 13251, "author_profile": "https://Stackoverflow.com/users/13251", "pm_score": 3, "selected": false, "text": "git format-patch" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14755/" ]
285,790
<pre><code>while (xxx) { timeout.tv_sec=TIMEOUT; timeout.tv_usec=0; FD_ZERO(&amp;set); FD_SET(sd,&amp;set); switch (select(FD_SETSIZE,&amp;set,NULL,NULL,&amp;timeout)) xxxxx } </code></pre> <p>works fine, however</p> <pre><code>FD_ZERO(&amp;set); FD_SET(sd,&amp;set); while (xxx) { time...
[ { "answer_id": 286231, "author": "DGentry", "author_id": 4761, "author_profile": "https://Stackoverflow.com/users/4761", "pm_score": 5, "selected": true, "text": "switch (select((sd + 1),&set,NULL,NULL,&timeout))\n FD_SET(sd,&set);\nif (sd > max) max = sd;\n... repeat many times...\n\nsw...
2008/11/12
[ "https://Stackoverflow.com/questions/285790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37169/" ]
285,793
<p>Eclipse issues warnings when a <code>serialVersionUID</code> is missing. </p> <blockquote> <p>The serializable class Foo does not declare a static final serialVersionUID field of type long</p> </blockquote> <p>What is <code>serialVersionUID</code> and why is it important? Please show an example where missing...
[ { "answer_id": 285809, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 12, "selected": true, "text": "java.io.Serializable serialVersionUID serialVersionUID InvalidClassException serialVersionUID serialVersionUID long ANY-...
2008/11/12
[ "https://Stackoverflow.com/questions/285793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33203/" ]
285,816
<p>I want to add items in a LaTeX-document. Say for example, that I want add hints to the document. I create a command, so I can call something similar to this:</p> <pre><code>\hint{foocareful}{Be careful with foo!}{foo is a very precious item and can easily be broken. Be careful, especially don't throw foo.} </code><...
[ { "answer_id": 286165, "author": "Will Robertson", "author_id": 4161, "author_profile": "https://Stackoverflow.com/users/4161", "pm_score": 4, "selected": true, "text": "float floatrow float \\documentclass{article}\n\\usepackage{float}\n\n\\floatstyle{boxed}\n\\newfloat{hintbox}{H}{hnt}...
2008/11/12
[ "https://Stackoverflow.com/questions/285816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21005/" ]
285,818
<p>With Java Version 1.5.0_06 on both Windows and Ubuntu Linux :</p> <p>Whenever I add minutes to the date "2008/10/05 00:00:00" , it seems that an extra hour is wrongly added.</p> <p>ie: adding 360 minutes to 2008/10/05 00:00:00 at midnight should arrive at 2008/10/05 06:00:00</p> <p>But it is arriving at 2008/10/0...
[ { "answer_id": 68963768, "author": "Ole V.V.", "author_id": 5772882, "author_profile": "https://Stackoverflow.com/users/5772882", "pm_score": 0, "selected": false, "text": "private static final DateTimeFormatter PARSER\n = DateTimeFormatter.ofPattern(\"yyyy/MM/dd HH:mm:ss\", Local...
2008/11/12
[ "https://Stackoverflow.com/questions/285818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27262/" ]
285,829
<p>I'd like to use the DataGridView control as a list with columns. Sort of like ListView in Details mode but I want to keep the DataGridView flexibility.</p> <p><strong>ListView</strong> (with <em>Details</em> view and <em>FullRowSelect</em> enabled) highlights the whole line and shows the focus mark around the whole...
[ { "answer_id": 331438, "author": "Tomas Sedovic", "author_id": 2239, "author_profile": "https://Stackoverflow.com/users/2239", "pm_score": 7, "selected": true, "text": "dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;\ndgv.MultiSelect = false;\ndgv.RowPrePaint +=new DataGridV...
2008/11/12
[ "https://Stackoverflow.com/questions/285829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2239/" ]
285,837
<p>My company is in the process of rewriting our software from scratch, and I'm the one who is going to be doing most of the work in rewriting the Mac client (The core of our software is Windows based, and the Mac client communicates with it through a webservice).</p> <p>This isn't a real heavy app, mainly does some b...
[ { "answer_id": 285878, "author": "Kornel", "author_id": 27009, "author_profile": "https://Stackoverflow.com/users/27009", "pm_score": 1, "selected": false, "text": "NSTask NSPipe .nib -(id)init\n{\n BOOL tiger = floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_4; \n NSString nib...
2008/11/12
[ "https://Stackoverflow.com/questions/285837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1512/" ]
285,860
<p>Using Java, how can I test that a URL is contactable, and returns a valid response?</p> <pre><code>http://stackoverflow.com/about </code></pre>
[ { "answer_id": 285862, "author": "brasskazoo", "author_id": 6340, "author_profile": "https://Stackoverflow.com/users/6340", "pm_score": 7, "selected": true, "text": "public void testURL() throws Exception {\n String strUrl = \"http://stackoverflow.com/about\";\n\n try {\n UR...
2008/11/12
[ "https://Stackoverflow.com/questions/285860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6340/" ]
285,866
<p>I want to create an Ant buildfile, that includes some files as a sort of plugin.</p> <p>So if I want to activate a feature in a project - say pmd-checking - I copy a pmd.xml in a directory and the build.xml get on the start the idea, that pmd.xml exists and imports it, so that new targets can be available to the bu...
[ { "answer_id": 285951, "author": "Miguel Ping", "author_id": 22992, "author_profile": "https://Stackoverflow.com/users/22992", "pm_score": 2, "selected": false, "text": "<ant antfile=\"plugins/pmd.xml\" target=\"${pmd-target}\"/>\n" }, { "answer_id": 286008, "author": "sblund...
2008/11/12
[ "https://Stackoverflow.com/questions/285866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21005/" ]
285,869
<p>Does anyone know how to use the <a href="http://msdn.microsoft.com/en-us/library/ms645543(VS.85).aspx" rel="nofollow noreferrer">Raw Input</a> facility on Windows from a WX Python application?</p> <p>What I need to do is be able to differentiate the input from multiple keyboards. So if there is another way to achie...
[ { "answer_id": 307018, "author": "joeforker", "author_id": 36330, "author_profile": "https://Stackoverflow.com/users/36330", "pm_score": 3, "selected": true, "text": ">>> import ctypes\n>>> ctypes.windll.user32.RegisterRawInputDevices\n<_FuncPtr object at 0x01FCFDC8>\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10286/" ]
285,886
<p>I'm not talking about a pointer to an instance, I want a pointer to a class itself.</p>
[ { "answer_id": 285894, "author": "CesarB", "author_id": 28258, "author_profile": "https://Stackoverflow.com/users/28258", "pm_score": 5, "selected": true, "text": "type_info" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/285886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37181/" ]
285,889
<p>I want to create a file on the webserver dynamically in PHP.</p> <p>First I create a directory to store the file. THIS WORKS</p> <pre><code>// create the users directory and index page $dirToCreate = "..".$_SESSION['s_USER_URL']; mkdir($dirToCreate, 0777, TRUE); // create the directory for the user </code></pre> ...
[ { "answer_id": 285905, "author": "Tom Haigh", "author_id": 22224, "author_profile": "https://Stackoverflow.com/users/22224", "pm_score": 4, "selected": true, "text": "$dirToCreate = \"..\".$_SESSION['s_USER_URL']; \n $ourFileName = $_SESSION['s_USER_URL'].\"/\".\"index.php\";\n $ourFileN...
2008/11/13
[ "https://Stackoverflow.com/questions/285889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,928
<pre><code> private void activateRecords(long[] stuff) { ... api.activateRecords(Arrays.asList(specIdsToActivate)); } </code></pre> <p>Shouldn't this call to Arrays.asList return a list of <code>Long</code>s? Instead it is returning a <code>List&lt;long[]&gt;</code></p> <pre><code>public static &lt;T&gt; ...
[ { "answer_id": 285969, "author": "Stephen", "author_id": 37193, "author_profile": "https://Stackoverflow.com/users/37193", "pm_score": 3, "selected": false, "text": "private List<Long> array(final long[] lngs) {\n List<Long> list = new ArrayList<Long>();\n for (long l : lngs) {\n ...
2008/11/13
[ "https://Stackoverflow.com/questions/285928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/402777/" ]
285,937
<p>Is it possible to insert a row, but only if one of the values already in the table does not exist?</p> <p>I'm creating a <em>Tell A Friend</em> with referral points for an ecommerce system, where I need to insert the friend's email into the database table, but only if it doesn't already exist in the table. This is ...
[ { "answer_id": 285953, "author": "José Leal", "author_id": 37190, "author_profile": "https://Stackoverflow.com/users/37190", "pm_score": 1, "selected": false, "text": "try {\n mysql_query($sql);\n}\ncatch(Exception $e) {\n\n}\n" }, { "answer_id": 285957, "author": "victoriah...
2008/11/13
[ "https://Stackoverflow.com/questions/285937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31671/" ]
285,938
<p>Given an HTML link like</p> <pre><code>&lt;a href="urltxt" class="someclass" close="true"&gt;texttxt&lt;/a&gt; </code></pre> <p>how can I isolate the url and the text? </p> <p><strong>Updates</strong></p> <p>I'm using Beautiful Soup, and am unable to figure out how to do that. </p> <p>I did </p> <pre><code>sou...
[ { "answer_id": 285941, "author": "Harley Holcombe", "author_id": 1057, "author_profile": "https://Stackoverflow.com/users/1057", "pm_score": 4, "selected": true, "text": "soup = BeautifulSoup.BeautifulSoup(urllib.urlopen(url).read())\n import urlparse, urllib\nfrom BeautifulSoup import B...
2008/11/13
[ "https://Stackoverflow.com/questions/285938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19731/" ]
285,955
<p>Does anybody have a snippet of Java that can return the newest file in a directory (or knowledge of a library that simplifies this sort of thing)?</p>
[ { "answer_id": 285987, "author": "OscarRyz", "author_id": 20654, "author_profile": "https://Stackoverflow.com/users/20654", "pm_score": 1, "selected": false, "text": "import java.io.File;\nimport java.util.Arrays;\nimport java.util.Comparator;\n\n\npublic class Newest {\n public stati...
2008/11/13
[ "https://Stackoverflow.com/questions/285955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,960
<p>The <code>equals()</code> method of the URL class in the Java class library makes a DNS request to get the IP for the hostname, to check the two IP's for equality. This happens even for URLs that are created from the same <code>String</code>. Is there a way to avoid this internet access?</p>
[ { "answer_id": 285967, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 1, "selected": false, "text": "equals" }, { "answer_id": 285975, "author": "Rick", "author_id": 14138, "author_profile": "https://Stack...
2008/11/13
[ "https://Stackoverflow.com/questions/285960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21005/" ]
285,990
<p>In .Net, I found this great library, <a href="http://www.codeplex.com/htmlagilitypack" rel="noreferrer">HtmlAgilityPack</a> that allows you to easily parse non-well-formed HTML using XPath. I've used this for a couple years in my .Net sites, but I've had to settle for more painful libraries for my Python, Ruby and...
[ { "answer_id": 289167, "author": "Aaron Maenpaa", "author_id": 2603, "author_profile": "https://Stackoverflow.com/users/2603", "pm_score": 4, "selected": true, "text": ">>> from elementtidy.TidyHTMLTreeBuilder import TidyHTMLTreeBuilder as TB\n>>> tb = TB()\n>>> tb.feed(\"<p>Hello world\...
2008/11/13
[ "https://Stackoverflow.com/questions/285990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30529/" ]
286,004
<p>There seem to be a decent number of <code>mod_rewrite</code> threads floating around lately with a bit of confusion over how certain aspects of it work. As a result I've compiled a few notes on common functionality, and perhaps a few annoying nuances.</p> <p>What other features / common issues have you run across u...
[ { "answer_id": 286005, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 8, "selected": false, "text": "mod_rewrite httpd.conf .htaccess httpd.conf .htaccess httpd.conf <Virtual Host> # logs can't be enabled from .htaccess\n# logle...
2008/11/13
[ "https://Stackoverflow.com/questions/286004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4853/" ]
286,007
<p>I need to configure Tomcat memory settings as part of a larger installation, so manually configuring tomcat with the configuration app after the fact is out of the question. I thought I could just throw the JVM memory settings into the JAVA_OPTS environment variable, but I'm testing that with jconsole to see if it w...
[ { "answer_id": 286011, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 3, "selected": false, "text": "CATALINA_OPTS" }, { "answer_id": 286415, "author": "kgiannakakis", "author_id": 24054, "author_profile": ...
2008/11/13
[ "https://Stackoverflow.com/questions/286007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1282409/" ]
286,021
<p>We have YouTube videos on a site and want to detect if it is likely that they will not be able to view them due to (mostly likely) company policy or otherwise.</p> <p>We have two sites:</p> <p>1) Flex / Flash 2) HTML</p> <p>I think with Flex I can attempt to download <a href="http://youtube.com/crossdomain.xml" r...
[ { "answer_id": 286055, "author": "Tristan Havelick", "author_id": 30529, "author_profile": "https://Stackoverflow.com/users/30529", "pm_score": 3, "selected": false, "text": "<html>\n\n<head>\n <script src=\"http://www.youtube.com/js/account.js\"></script>\n <script>\n funct...
2008/11/13
[ "https://Stackoverflow.com/questions/286021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16940/" ]
286,031
<p>I am trying to share DTO's from my datalayer assembly between the client and WCF service. This works using svcutil, but doesn't work when using VS2008. VS2008 generates it's own DTO objects whereas svcutil uses the shared data type.</p> <p>The svcutil parameters I used are:</p> <pre><code>"C:\Program Files\Micro...
[ { "answer_id": 397970, "author": "oefe", "author_id": 49793, "author_profile": "https://Stackoverflow.com/users/49793", "pm_score": 2, "selected": false, "text": "ClientFactory<T>" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/286031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24681/" ]
286,039
<p>Is there a way to get the count of rows in all tables in a MySQL database without running a <code>SELECT count()</code> on each table?</p>
[ { "answer_id": 286047, "author": "gpojd", "author_id": 28071, "author_profile": "https://Stackoverflow.com/users/28071", "pm_score": 8, "selected": false, "text": "SELECT table_name, table_rows\nFROM INFORMATION_SCHEMA.TABLES\nWHERE TABLE_SCHEMA = '**YOUR SCHEMA**';\n" }, { "answ...
2008/11/13
[ "https://Stackoverflow.com/questions/286039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37204/" ]
286,058
<p>If I have a key set of 1000, what is a suitable size for my Hash table, and how is that determined?</p>
[ { "answer_id": 286063, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 1, "selected": false, "text": "Hashtable" }, { "answer_id": 286079, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "...
2008/11/13
[ "https://Stackoverflow.com/questions/286058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36545/" ]
286,060
<p>ASP.Net 3.5 running under IIS 7 doesn't seem to allow this out of the box.</p> <pre><code> if (!EventLog.SourceExists("MyAppLog")) EventLog.CreateEventSource("MyAppLog", "Application"); EventLog myLog = new EventLog(); myLog.Source = "MyAppLog"; myLog.WriteEntry("Message"...
[ { "answer_id": 7848414, "author": "Chris S", "author_id": 21574, "author_profile": "https://Stackoverflow.com/users/21574", "pm_score": 5, "selected": false, "text": "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\services\\eventlog\\Application\\MY-AWESOME-APP EventMessageFile EventLog....
2008/11/13
[ "https://Stackoverflow.com/questions/286060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25372/" ]
286,061
<p>I seem to be losing a lot of precision with floats.</p> <p>For example I need to solve a matrix:</p> <pre><code>4.0x -2.0y 1.0z =11.0 1.0x +5.0y -3.0z =-6.0 2.0x +2.0y +5.0z =7.0 </code></pre> <p>This is the code I use to import the matrix from a text file:</p> <pre><code>f = open('gauss.dat') lines = f.readlin...
[ { "answer_id": 286064, "author": "Jeremy", "author_id": 1114, "author_profile": "https://Stackoverflow.com/users/1114", "pm_score": 5, "selected": true, "text": "EDIT: >>> import decimal\n>>> print(decimal.Decimal(\"1.2\") ** 2)\n1.44\n decimal.Decimal" }, { "answer_id": 286119, ...
2008/11/13
[ "https://Stackoverflow.com/questions/286061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/338360/" ]
286,062
<p>How would I go about creating a Google map that allows the user to zoom beyond the default zoom levels for the map? Would I have to create a new map type that has a greater maximum zoom? Are there any tutorials out there that show how to do this?</p>
[ { "answer_id": 286064, "author": "Jeremy", "author_id": 1114, "author_profile": "https://Stackoverflow.com/users/1114", "pm_score": 5, "selected": true, "text": "EDIT: >>> import decimal\n>>> print(decimal.Decimal(\"1.2\") ** 2)\n1.44\n decimal.Decimal" }, { "answer_id": 286119, ...
2008/11/13
[ "https://Stackoverflow.com/questions/286062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
286,076
<p>My question is a lot like <a href="https://stackoverflow.com/questions/80721/">this one</a>. However I'm on MySQL and I'm looking for the "lowest tech" solution that I can find. </p> <p>The situation is that I have 2 databases that should have the same data in them but they are updated primarily when they are not a...
[ { "answer_id": 288523, "author": "BCS", "author_id": 1343, "author_profile": "https://Stackoverflow.com/users/1343", "pm_score": 1, "selected": true, "text": "INSERT...SELECT...ON DUPLICATE UPDATE" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/286076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
286,081
<p>When I access a wrong call to a sql server data into my application in classical ASP I get this message in my entire site: Service Unavailable. It stopped. My site is in a remote host. Don´t know what to do. What can I tell to the "support team" of them to fix that?</p>
[ { "answer_id": 286292, "author": "Cyril Gupta", "author_id": 33052, "author_profile": "https://Stackoverflow.com/users/33052", "pm_score": 1, "selected": false, "text": "Run IIS\nRight click on the node 'Application Pools' in your left sidebar.\nClick on the tab 'Health'\nRemove the chec...
2008/11/13
[ "https://Stackoverflow.com/questions/286081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22869/" ]
286,085
<p>I've installed Subversion on Ubuntu following the guide <em><a href="http://alephzarro.com/blog/2007/01/07/installation-of-subversion-on-ubuntu-with-apache-ssl-and-basicauth" rel="nofollow noreferrer">Installation of Subversion on Ubuntu, with Apache, SSL, and BasicAuth.</a></em>.</p> <p>It works, and I was able co...
[ { "answer_id": 286127, "author": "ala", "author_id": 37198, "author_profile": "https://Stackoverflow.com/users/37198", "pm_score": -1, "selected": false, "text": "<domain>\\<user>" }, { "answer_id": 293726, "author": "tommym", "author_id": 37607, "author_profile": "ht...
2008/11/13
[ "https://Stackoverflow.com/questions/286085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32424/" ]
286,090
<p>The question is actually about stack overflows in C. I have an assigment that I can not get done for the life of me, I've looked at everything in the gdb and I just cant figure it.</p> <p>The question is the following:</p> <pre><code>int i,n; void confused() { printf("who called me"); exit(0); } void sh...
[ { "answer_id": 292514, "author": "Nicola Bonelli", "author_id": 19630, "author_profile": "https://Stackoverflow.com/users/19630", "pm_score": 1, "selected": false, "text": "main() shell_call() victim_func() leave" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/286090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
286,091
<p>I am not a fan of using SQL*PLUS as an interface to Oracle. I usually use <a href="http://sourceforge.net/projects/yasql/" rel="noreferrer">yasql</a>, but it hasn't been updated since 2005 and can do with some improvements. A quick <a href="http://www.google.com/search?q=sql*plus+replacement" rel="noreferrer">Goog...
[ { "answer_id": 7433988, "author": "Николай Мишин", "author_id": 937070, "author_profile": "https://Stackoverflow.com/users/937070", "pm_score": 1, "selected": false, "text": "alias sqr='sqlsh -d DBI:Oracle:MYSERVER.COM -u USER -p PASSWORD'\n" }, { "answer_id": 54116222, "auth...
2008/11/13
[ "https://Stackoverflow.com/questions/286091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28071/" ]
286,093
<p>I want to assert that a method is called exactly one time. I'm using RhinoMocks 3.5.</p> <p>Here's what I thought would work:</p> <pre class="lang-cs prettyprint-override"><code>[Test] public void just_once() { var key = "id_of_something"; var source = MockRepository.GenerateStub&lt;ISomeDataSource&gt;(...
[ { "answer_id": 286125, "author": "Christopher Bennage", "author_id": 6855, "author_profile": "https://Stackoverflow.com/users/6855", "pm_score": 2, "selected": false, "text": "[Test]\npublic void just_once()\n{\n var key = \"id_of_something\";\n\n var source = MockRepository.Genera...
2008/11/13
[ "https://Stackoverflow.com/questions/286093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6855/" ]
286,096
<pre><code>typedef struct { nat id; char *data; } element_struct; typedef element_struct * element; void push(element e, queue s) { nat lt = s-&gt;length; if (lt == max_length - 1) { printf("Error in push: Queue is full.\n"); return; } ...
[ { "answer_id": 286108, "author": "David Norman", "author_id": 34502, "author_profile": "https://Stackoverflow.com/users/34502", "pm_score": 2, "selected": false, "text": "element elem = malloc(sizeof(element_struct));\nif (elem == NULL) {\n /* Handle error. */\n}\n\nelem->id = somethi...
2008/11/13
[ "https://Stackoverflow.com/questions/286096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31549/" ]
286,103
<p>Our Windows Forms application by default saves data files in a user's 'My Documents' folder (on XP) or 'Documents' folder (on Vista). We look up this location by calling:</p> <pre><code>Environment.GetFolderPath( Environment.SpecialFolder.Personal ) </code></pre> <p>We know for sure this works great for users whos...
[ { "answer_id": 286131, "author": "Jon Norton", "author_id": 4797, "author_profile": "https://Stackoverflow.com/users/4797", "pm_score": 1, "selected": false, "text": "Environment.GetFolderPath SHGetSpecialFolderPath" }, { "answer_id": 286147, "author": "JaredPar", "author...
2008/11/13
[ "https://Stackoverflow.com/questions/286103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17966/" ]
286,104
<p>Before anybody asks, I am not doing any kind of screenscraping.</p> <p>I'm trying to parse an html string to find a div with a certain id. I cannot for the life of me get this to work. The following expression worked in one instance, but not in another. I'm not sure if it has to do with extra elements in the htm...
[ { "answer_id": 287758, "author": "pro3carp3", "author_id": 7899, "author_profile": "https://Stackoverflow.com/users/7899", "pm_score": 4, "selected": true, "text": "(?<text>\n(<div\\s*?id=(\\\"|&quot;|&\\#34;)content(\\\"|&quot;|&\\#34;).*?>)\n\n (?>\n .*?</div>\n |\n .*?<d...
2008/11/13
[ "https://Stackoverflow.com/questions/286104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8534/" ]
286,105
<p>I have a C library with numerous math routines for dealing with vectors, matrices, quaternions and so on. It needs to remain in C because I often use it for embedded work and as a Lua extension. In addition, I have C++ class wrappers to allow for more convenient object management and operator overloading for math op...
[ { "answer_id": 286143, "author": "CesarB", "author_id": 28258, "author_profile": "https://Stackoverflow.com/users/28258", "pm_score": 2, "selected": false, "text": "-S -save-temps" }, { "answer_id": 286617, "author": "peterchen", "author_id": 31317, "author_profile": ...
2008/11/13
[ "https://Stackoverflow.com/questions/286105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1491/" ]
286,117
<p>I work on a team with about 10 developers. Some of the developers have very exacting formatting needs. I would like to find a pretty printer that I could configure to these specifications and then add to the build processes. In this way no matter how badly other people mess up the format when it is pulled down from ...
[ { "answer_id": 286293, "author": "Ben McNiel", "author_id": 1455, "author_profile": "https://Stackoverflow.com/users/1455", "pm_score": 1, "selected": false, "text": "ServiceLocator.Logger.WriteDefault(string.format(\"{0}{1}\"\n ,foo\n ...
2008/11/13
[ "https://Stackoverflow.com/questions/286117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1455/" ]
286,123
<p>I have to read a txt file with lines formated like this:</p> <pre> 1: (G, 2), (F, 3) 2: (G, 2), (F, 3) 3: (F, 4), (G, 5) 4: (F, 4), (G, 5) 5: (F, 6), (c, w) 6: (p, f), (G, 7) 7: (G, 7), (G, 7) w: (c, w), (c, w) </pre> <p>Each line will feed a struct with its data (the 5 numbers or letters in it).<br> What's the be...
[ { "answer_id": 286138, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 2, "selected": false, "text": "fgets() #include <stdio.h>\n\nint main(void)\n{\n char line[256];\n while(fgets(line, sizeof(line), stdin) != NULL...
2008/11/13
[ "https://Stackoverflow.com/questions/286123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9835/" ]
286,124
<p>How can I test <code>Controller.ViewData.ModelState</code>? I would prefer to do it without any mock framework. </p>
[ { "answer_id": 589350, "author": "Scott Hanselman", "author_id": 6380, "author_profile": "https://Stackoverflow.com/users/6380", "pm_score": 7, "selected": true, "text": "// Test for required \"FirstName\".\n controller.ViewData.ModelState.Clear();\n\n newCustomer = new Customer\n ...
2008/11/13
[ "https://Stackoverflow.com/questions/286124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32173/" ]
286,132
<p>I have developed a simple mechanism for my mvc website to pull in html via jquery which then populates a specified div. All is well and it looks cool.<br> My problem is that i'm now creating html markup inside of my controller (Which is very easy to do in VB.net btw) I'd rather not mix up the sepparation of concern...
[ { "answer_id": 286177, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 0, "selected": false, "text": "render :partial => 'yourfilename' RenderPartial" }, { "answer_id": 286381, "author": "Christian Dalager", ...
2008/11/13
[ "https://Stackoverflow.com/questions/286132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30576/" ]
286,141
<p>How do I remove all attributes which are <code>undefined</code> or <code>null</code> in a JavaScript object?</p> <p>(Question is similar to <a href="https://stackoverflow.com/questions/208105/how-to-remove-a-property-from-a-javascript-object">this one</a> for Arrays)</p>
[ { "answer_id": 286145, "author": "yfeldblum", "author_id": 12349, "author_profile": "https://Stackoverflow.com/users/12349", "pm_score": 4, "selected": false, "text": "delete var obj = { };\nobj.theProperty = 1;\ndelete obj.theProperty;\n" }, { "answer_id": 286162, "author": ...
2008/11/13
[ "https://Stackoverflow.com/questions/286141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33581/" ]
286,149
<p>I'm trying to disable a button when a user submits a payment form and the code to post the form is causing a double post in firefox. This problem does not occur when the code is removed, and does not occur in any browser other than firefox.</p> <p>Any idea how to prevent the double post here?</p> <pre><code>Syste...
[ { "answer_id": 286154, "author": "Jeromy Irvine", "author_id": 8223, "author_profile": "https://Stackoverflow.com/users/8223", "pm_score": 2, "selected": false, "text": "btnSubmit Page.GetPostBackEventReference Page_Load function disableOnSubmit(target)\n{\n if (typeof(Page_ClientVali...
2008/11/13
[ "https://Stackoverflow.com/questions/286149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36798/" ]
286,150
<p>So I'm using python to do some parsing of web pages and I want to split the full web address into two parts. Say I have the address <a href="http://www.stackoverflow.com/questions/ask">http://www.stackoverflow.com/questions/ask</a>. I would need the protocol and domain (e.g. <a href="http://www.stackoverflow.com">ht...
[ { "answer_id": 286155, "author": "Cybis", "author_id": 32998, "author_profile": "https://Stackoverflow.com/users/32998", "pm_score": -1, "selected": false, "text": "import re\nurl = \"http://stackoverflow.com/questions/ask\"\nprotocol, domain = re.match(r\"(http://[^/]*)(.*)\", url).grou...
2008/11/13
[ "https://Stackoverflow.com/questions/286150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2128/" ]
286,161
<p>example:</p> <p>I want to see if <code>array[5]</code> holds a value or is empty.</p>
[ { "answer_id": 286163, "author": "Rob Kennedy", "author_id": 33732, "author_profile": "https://Stackoverflow.com/users/33732", "pm_score": 3, "selected": false, "text": "Object null" }, { "answer_id": 286167, "author": "Bill the Lizard", "author_id": 1288, "author_pro...
2008/11/13
[ "https://Stackoverflow.com/questions/286161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36545/" ]
286,184
<p>I have a c# winforms program and it opens up a serial port. The problem happens when the end user unplugs the usb cable and then the device disappears. After this the program will crash and want to report the error to microsoft. </p> <p>Is there a way to capture this event and shut down gracefully? </p>
[ { "answer_id": 1327400, "author": "MrHIDEn", "author_id": 160581, "author_profile": "https://Stackoverflow.com/users/160581", "pm_score": 2, "selected": false, "text": "Windows Registry Editor Version 5.00\nHKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\SERIALCOMM]\n\"Winachsf0\"=\"COM10\"\n\"...
2008/11/13
[ "https://Stackoverflow.com/questions/286184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32958/" ]
286,187
<p>I'm developing an object-oriented PHP website right now and am trying to determine the best way to abstract database functionality from the rest of the system. Right now, I've got a DB class that manages all the connections and queries that the system uses (it's pretty much an interface to MDB2). However, when using...
[ { "answer_id": 287478, "author": "Dave Sherohman", "author_id": 18914, "author_profile": "https://Stackoverflow.com/users/18914", "pm_score": 2, "selected": false, "text": "$user->check_password($entered_password) check_password check_password" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/286187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33212/" ]
286,190
<p>My present contract engagement is at a large E-Commerce company. Their code base which has origins going back to .Net 1.0 has caught me by surprise to contain many issues that raise the level of smell beyond the last crap I took. </p> <p>That notwithstanding and trying to diffuse my level of distraction from it, I ...
[ { "answer_id": 286217, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 3, "selected": true, "text": "List<T>" }, { "answer_id": 286244, "author": "hwiechers", "author_id": 5883, "author_profile": "htt...
2008/11/13
[ "https://Stackoverflow.com/questions/286190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4814/" ]
286,191
<p>I have this query statement and want to only get records that has a certain column empty (<code>volunteers_2009.venue_id</code>)</p> <p>Table is <code>volunteers_2009</code>, column I am looking to see if it is empty: <code>venue_id</code></p> <p>Here is the current query:</p> <pre><code>SELECT volunteers_2009.id...
[ { "answer_id": 286201, "author": "Vincent Ramdhanie", "author_id": 27439, "author_profile": "https://Stackoverflow.com/users/27439", "pm_score": 2, "selected": false, "text": "venue_id is WHERE volunteers_2009.venue_id is null\n" }, { "answer_id": 286215, "author": "Joel Coeh...
2008/11/13
[ "https://Stackoverflow.com/questions/286191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26130/" ]
286,206
<p>I'm writing an app for Blackberry that was originally implemented in standard J2ME. The network connection was done using <code>Connector.open("socket://...:80/...")</code> instead of <code>http://</code></p> <p>Now, I've implemented the connection using both methods, and it seems like some times, the socket metho...
[ { "answer_id": 286933, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 4, "selected": true, "text": "http https socket TCP socket deviceside=true deviceside=false http" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/286206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36007/" ]
286,207
<p>I am showing an addressbook view to the user and letting them click on a contact and select a phone number. If they select a phone number, I want to get the phone number as an integer and the contact's name as an NSString. </p> <p>I've tried doing it with the following code: </p> <pre><code> //printf("%s\n",[[(...
[ { "answer_id": 286281, "author": "Jason Coco", "author_id": 34218, "author_profile": "https://Stackoverflow.com/users/34218", "pm_score": 4, "selected": false, "text": "switch( propertyType ) {\n case kABMultiStringPropertyType:\n // this is the phone number, do something\n break;...
2008/11/13
[ "https://Stackoverflow.com/questions/286207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23695/" ]
286,219
<p>I'm trying to run a freshly created ASP.NET Website using C#, however when I do so it launches FireFox and attempts to connect to <a href="http://localhost:1295/WebSite1/Default.aspx" rel="nofollow noreferrer">http://localhost:1295/WebSite1/Default.aspx</a> (for example), but after about 10-15 seconds it displays a ...
[ { "answer_id": 5347747, "author": "JollySwagman", "author_id": 633298, "author_profile": "https://Stackoverflow.com/users/633298", "pm_score": 3, "selected": false, "text": "System.Web.HttpException (0x80004005): Maximum request length exceeded.\n <system.web>\n <httpRuntime maxRequestL...
2008/11/13
[ "https://Stackoverflow.com/questions/286219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30598/" ]
286,238
<p>is it possible to throw a custom error message to a ThrowActivity, in windows workflow foundation?</p> <p>eg. Imagine i want to throw this exception, in my WF :-</p> <pre><code>CutomException("This is my custom error message", myNumber, myObect); </code></pre> <p>cheers :)</p>
[ { "answer_id": 287159, "author": "Panos", "author_id": 8049, "author_profile": "https://Stackoverflow.com/users/8049", "pm_score": 3, "selected": true, "text": "Fault ThrowActivity throwActivity1.Fault = new CustomException(\"This is my custom error message\", myNumber, myObect);\n" },...
2008/11/13
[ "https://Stackoverflow.com/questions/286238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
286,250
<p>If I am evaluating two variables and not two method calls does it matter weather I use "&amp;&amp;" or "&amp;"</p> <pre><code>//some logic that sets bool values boolean X = true; boolean Y = true; if (X &amp; Y){ // perform some operation } if (X &amp;&amp; Y){ // perform some operation } </code></pre> <p...
[ { "answer_id": 286258, "author": "vfilby", "author_id": 24279, "author_profile": "https://Stackoverflow.com/users/24279", "pm_score": 3, "selected": false, "text": "true && true == true\n 00101001 & 00100001 = 00100001\n" }, { "answer_id": 286259, "author": "jpoh", "autho...
2008/11/13
[ "https://Stackoverflow.com/questions/286250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35585/" ]
286,257
<p>I am currently refactoring an application that prints its status to the console window. At the moment I am doing something like this:</p> <pre><code> Console.Write("Print some status.....") //some code Console.WriteLine("Done!") </code></pre> <p>Now while this works fine, all the logic is hidden between consol...
[ { "answer_id": 288836, "author": "Jamie Penney", "author_id": 68230, "author_profile": "https://Stackoverflow.com/users/68230", "pm_score": 1, "selected": false, "text": "log4net.Config.BasicConfigurator.Configure(new log4net.Appender.ConsoleAppender());\n private static readonly log4net...
2008/11/13
[ "https://Stackoverflow.com/questions/286257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6335/" ]
286,270
<p>What is the best way to password protect quicktime streaming videos using php/.htaccess. They are being streamed using rtsp, but I can use other formats if necessary.</p> <p>I know how to do authentication with php, but I'm not sure how to setup authentication so that will protect the streaming files urls so that a...
[ { "answer_id": 286307, "author": "cmptrgeekken", "author_id": 33212, "author_profile": "https://Stackoverflow.com/users/33212", "pm_score": 0, "selected": false, "text": "RewriteEngine On\nRewriteCond %{HTTP_REFERER} !^$\nRewriteCond %{HTTP_COOKIE} obscurename=obscurevalue [NC]\nRewriteC...
2008/11/13
[ "https://Stackoverflow.com/questions/286270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
286,274
<p>Given two 3D vectors A and B, I need to derive a rotation matrix which rotates from A to B.</p> <p>This is what I came up with:</p> <ol> <li>Derive cosine from <strike>acos</strike>(A . B)</li> <li>Derive sine from <strike>asin</strike>(|A x B| / (|A| * |B|))</li> <li>Use A x B as axis of rotation</li> <li>Use mat...
[ { "answer_id": 286299, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 2, "selected": false, "text": "D3DXMatrixRotationAxis()" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/286274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45603/" ]
286,275
<p>What's the best way (if any) to make an image appear "grayed out" with CSS (i.e., without loading a separate, grayed out version of the image)?</p> <p>My context is that I have rows in a table that all have buttons in the right most cell and some rows need to look lighter than others. So I can make the font lighter...
[ { "answer_id": 286279, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 9, "selected": true, "text": "<div> <div id=\"wrapper\">\n <img id=\"myImage\" src=\"something.jpg\" />\n</div>\n #myImage {\n opacity: 0.4;\n filter...
2008/11/13
[ "https://Stackoverflow.com/questions/286275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26842/" ]
286,282
<p>How can I make cookies in my Flash application using ActionScript 2.0?</p>
[ { "answer_id": 286349, "author": "chews", "author_id": 33966, "author_profile": "https://Stackoverflow.com/users/33966", "pm_score": 0, "selected": false, "text": "// Javascript Function\nfunction setCookie(c_name,value,expiredays)\n{\n var exdate=new Date();\n exdate.setDate(exdat...
2008/11/13
[ "https://Stackoverflow.com/questions/286282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
286,297
<p>I have a suspicion that I'm using the <code>finally</code> block incorrectly, and that I don't understand the fundamentals of its purpose...</p> <pre><code> function myFunc() { try { if (true) { throw "An error"; } } catch (e) { alert (e); retu...
[ { "answer_id": 286306, "author": "Gilean", "author_id": 6305, "author_profile": "https://Stackoverflow.com/users/6305", "pm_score": 7, "selected": true, "text": "finally true try function myFunc() {\n try {\n if (true) {\n throw \"An error\";\n }\n ...
2008/11/13
[ "https://Stackoverflow.com/questions/286297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
286,316
<p>I authenticate users through Radius, and I have the option to assign Radius attributes through SQL statements, but I can't for the life of me find any documentation on this. Anyone know the proper syntax?</p>
[ { "answer_id": 292110, "author": "kylex", "author_id": 36545, "author_profile": "https://Stackoverflow.com/users/36545", "pm_score": 2, "selected": true, "text": "SELECT 'attribute', value FROM table WHERE username ='$u' SELECT 'Ascend-Data-Rate', hsbrate.rate FROM hsbrate, customer WHER...
2008/11/13
[ "https://Stackoverflow.com/questions/286316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36545/" ]
286,321
<p>I would like to make my application somewhat REST compliant. I am using Rails on the backend and <a href="https://developers.google.com/web-toolkit/" rel="noreferrer">GWT</a> on the frontend. I would like to do updates and deletes. I realize I can do something like mydomain.com/:id/delete (GET) and accomplish the...
[ { "answer_id": 286463, "author": "Christian Lescuyer", "author_id": 341, "author_profile": "https://Stackoverflow.com/users/341", "pm_score": 4, "selected": true, "text": "rails jp\ncd jp\n./script/generate scaffold RequestBuilder name:string\nrake db:migrate\n./script/server \n <form ac...
2008/11/13
[ "https://Stackoverflow.com/questions/286321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10333/" ]
286,332
<p>I have subclassed the UITableView control, and the style is grouped, but I do not need the cell separators. I tried setting my table view's separatorStyle to none, but it doesn't work. Can any one help me out?</p>
[ { "answer_id": 456945, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 6, "selected": false, "text": "tableView.separatorStyle = UITableViewCellSeparatorStyleNone;" }, { "answer_id": 1661079, "author": "Akshay Shah",...
2008/11/13
[ "https://Stackoverflow.com/questions/286332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
286,334
<p>I have a table of events, I need to find all tail events of type 1 and all head events of type 1. </p> <p>So, for the set of events in this order [1, 1], 3, 1 ,4, 5, [1,1,1] the brackets denote head and tail events of type 1. </p> <p>This is much better illustrated in SQL:</p> <pre><code>drop table #event go cre...
[ { "answer_id": 286343, "author": "Robert Wagner", "author_id": 10784, "author_profile": "https://Stackoverflow.com/users/10784", "pm_score": 0, "selected": false, "text": ";WITH Ranked AS (\n SELECT \n *,\n Row_Number() OVER (ORDER BY date) as 'rnk'\n FROM #event\n)\n...
2008/11/13
[ "https://Stackoverflow.com/questions/286334", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17174/" ]
286,354
<p>I am trying to wrap my head around this. I am making a business specific messaging application, it is going to connect between 5000 and 10,000 machines back to our datacenter via WCF (no vpns, all over the net). It is mainly for alerts and I need to be able to send message direclty to specific clients, and WCF allo...
[ { "answer_id": 286398, "author": "stephbu", "author_id": 12702, "author_profile": "https://Stackoverflow.com/users/12702", "pm_score": 2, "selected": false, "text": "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\n\nTcpTimedWaitDelay = 30\nMaxUserPort = 65534 ...
2008/11/13
[ "https://Stackoverflow.com/questions/286354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29466/" ]
286,375
<p>Hi i am encountering problems trying to post a WebRequest under Https. </p> <p>i received the following errors</p> <h1>1.-The underlying connection was closed: Unable to connect to the remote server.</h1> <h1>2.-the operation TimeOut</h1> <h1>3-The underlying connection was closed: Could not establish secure cha...
[ { "answer_id": 286393, "author": "Sani Singh Huttunen", "author_id": 26742, "author_profile": "https://Stackoverflow.com/users/26742", "pm_score": 0, "selected": false, "text": "// .NET 2.0+\n...\nServicePointManager.ServerCertificateValidationCallback += MyValidationCallback\n...\npubli...
2008/11/13
[ "https://Stackoverflow.com/questions/286375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14440/" ]
286,392
<p>How to use batch file to check if an application still running or not? If the application still running, this process will loop again and again. Else, there will be error message.</p> <p>Thank you very much</p>
[ { "answer_id": 286453, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "@echo off\n\nCommandYouWillRun.exe\n\nrem waiting for the process to start\n:startcmd\nsleep 1\nc:\\path\\to\\pslist.exe Comma...
2008/11/13
[ "https://Stackoverflow.com/questions/286392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
286,399
<p>I want to build two-dimentional array of strings where length of one dimention is 2. Similar to this</p> <pre><code>string[,] array = new string[,] { {"a", "b"}, {"c", "d"}, {"e", "f"}, {"g", "h"} } </code></pre> <p>Doing</p> <pre><code>List&lt;string[]&gt; list = new List&lt;string[]&gt;(); list...
[ { "answer_id": 286420, "author": "Andrew Kennan", "author_id": 22506, "author_profile": "https://Stackoverflow.com/users/22506", "pm_score": 0, "selected": false, "text": "List<string[]> string[,] string[]" }, { "answer_id": 286428, "author": "Robert Wagner", "author_id":...
2008/11/13
[ "https://Stackoverflow.com/questions/286399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11256/" ]
286,402
<p>I have a couple of array's:</p> <pre><code>const string a_strs[] = {"cr=1", "ag=2", "gnd=U", "prl=12", "av=123", "sz=345", "rc=6", "pc=12345"}; const string b_strs[] = {"cr=2", "sz=345", "ag=10", "gnd=M", "prl=11", "rc=6", "cp=34", "cv=54", "av=654", "ct=77", "pc=12345"}; </code></pre> <p>which i then need to pars...
[ { "answer_id": 286450, "author": "qrdl", "author_id": 28494, "author_profile": "https://Stackoverflow.com/users/28494", "pm_score": 3, "selected": false, "text": "key value if-else-if-else ... if (!strcmp(key, \"cr\"))\n my_struct.cr = value;\nelse if (!strcmp(key, \"ag\"))\n my_stru...
2008/11/13
[ "https://Stackoverflow.com/questions/286402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35416/" ]
286,419
<p>Is it possible to build a .dmg file (for distributing apps) from a non-Mac platform? And if yes, how?</p>
[ { "answer_id": 3776463, "author": "jstck", "author_id": 88979, "author_profile": "https://Stackoverflow.com/users/88979", "pm_score": 5, "selected": false, "text": "dd if=/dev/zero of=/tmp/foo.dmg bs=1M count=64\nmkfs.hfsplus -v ThisIsFoo /tmp/foo.dmg\n mount -o loop /tmp/foo.dmg /mnt/fo...
2008/11/13
[ "https://Stackoverflow.com/questions/286419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15173/" ]
286,426
<p>I have a page P1 loading from site S1 which contains an iframe. That iframe loads a page P2 from another site S2. At some point P2 would like to close the browser window, which contains P1 loaded from S1. Of course, since P2 is loaded from another site, it can't just do parent.close().</p> <p>I have full control ov...
[ { "answer_id": 286472, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": true, "text": "<iframe name = \"frame1\" src = \"http://yoursite\">\n</iframe>\n\n<script type = \"text/javascript\">\n alert(window.frames...
2008/11/13
[ "https://Stackoverflow.com/questions/286426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5295/" ]
286,427
<p>Inspired by this <a href="https://stackoverflow.com/questions/283561/extracting-leaf-paths-from-n-ary-tree-in-f">question</a> and <a href="https://stackoverflow.com/questions/283561/extracting-leaf-paths-from-n-ary-tree-in-f#283638">answer</a>, how do I create a generic permutations algorithm in F#? Google doesn't ...
[ { "answer_id": 286544, "author": "Benjol", "author_id": 11410, "author_profile": "https://Stackoverflow.com/users/11410", "pm_score": 1, "selected": false, "text": "//mini-extension to List for removing 1 element from a list\nmodule List = \n let remove n lst = List.filter (fun x -> x...
2008/11/13
[ "https://Stackoverflow.com/questions/286427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11410/" ]
286,441
<pre><code>from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( options = {'py2exe': {'bundle_files': 1}}, windows = [{'script': "single.py"}], zipfile = None, ) </code></pre> <p>in this setup file for py2exe where it says single.py is that where I place the name of my...
[ { "answer_id": 286495, "author": "Denes Tarjan", "author_id": 17617, "author_profile": "https://Stackoverflow.com/users/17617", "pm_score": 3, "selected": false, "text": "<UNPACKED_FILES_DIR> python Makespec.py -F -p <PYTHON_LIB_PATH> <PYTHON_SCRIPT>\n -F: Produce a single file deployme...
2008/11/13
[ "https://Stackoverflow.com/questions/286441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
286,459
<p>I'm using VB .NET 2005 and Exchange Server 2003 installed I have found some code which gives me the ability to connect in an Exchange Server and create an appointment. The thing is that I cannot find the CDO. Appointment. Where can I find it and make the below code to work ? I have tried all the examples with CDO a...
[ { "answer_id": 293360, "author": "Patrick de Kleijn", "author_id": 33221, "author_profile": "https://Stackoverflow.com/users/33221", "pm_score": 0, "selected": false, "text": "cdoex.dll" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/286459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
286,468
<p>I've got a VB.NET module that reads from a resource file to display text in the correct language. Here's my problem - this code is shared between a web application and a non-web application, In the web application, I'm using System.Web.HttpContext to determine the user's preferred language, but now my Windows app wo...
[ { "answer_id": 286574, "author": "Davy Landman", "author_id": 11098, "author_profile": "https://Stackoverflow.com/users/11098", "pm_score": 1, "selected": false, "text": "public interface IPreferredLanguage\n{\n String PeferredLanguage { get; set; }\n}\n public class WebPeferredLangu...
2008/11/13
[ "https://Stackoverflow.com/questions/286468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8114/" ]
286,475
<p>It looks like the run-time compiler doesn't support the same language as the command-line compiler so if you want to use lambda expressions, extensions methods or LINQ, well, you're stuck.</p> <p>There's more detail here:</p> <p><a href="http://metadatalabs.com/blog/" rel="nofollow noreferrer">http://metadatalabs....
[ { "answer_id": 286509, "author": "Jamie Penney", "author_id": 68230, "author_profile": "https://Stackoverflow.com/users/68230", "pm_score": 2, "selected": false, "text": "CodeDomProvider provider = new CSharpCodeProvider(new Dictionary<string, string> { { \"CompilerVersion\", \"v3.5\" } ...
2008/11/13
[ "https://Stackoverflow.com/questions/286475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37263/" ]
286,481
<p>I was always wondering why such a simple and basic operation like swapping the contents of two variables is not built-in for many languages.</p> <p>It is one of the most basic programming exercises in computer science classes; it is heavily used in many algorithms (e.g. sorting); every now and then one needs it and...
[ { "answer_id": 286560, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 3, "selected": false, "text": "#include <algorithm>\n#include <cassert>\n\nint\nmain()\n{\n using std::swap;\n int a(3), b(5);\n swap(a, b);\n ...
2008/11/13
[ "https://Stackoverflow.com/questions/286481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26070/" ]
286,486
<p>In relation to <a href="https://stackoverflow.com/questions/283431/why-would-an-command-not-recognized-error-occur-only-when-a-window-is-populated">another question</a>, how do you account for paths that may change? For example, if a program is calling a file in the same directory as the program, you can simply use ...
[ { "answer_id": 286499, "author": "TheObserver", "author_id": 20879, "author_profile": "https://Stackoverflow.com/users/20879", "pm_score": 0, "selected": false, "text": "def _isInProductionMode():\n \"\"\" returns True when running the exe, \n False when running from a script, ...
2008/11/13
[ "https://Stackoverflow.com/questions/286486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18676/" ]
286,493
<p>I use db2 v.9.1 on windows 2003 server so it can not use LPAD or RPAD functions scalar. because that functions support only z/OS right?</p> <p>Now, I use this way for pad zero when COLUMN1 type is VARCHAR</p> <pre><code> RIGHT('0000' || COLUMN1 ,4) AS RPAD LEFT('0000' || COLUMN1 ,4) AS LPAD </code></pre> <p>...
[ { "answer_id": 61216244, "author": "JOHN HOUZOURIS", "author_id": 13315027, "author_profile": "https://Stackoverflow.com/users/13315027", "pm_score": 0, "selected": false, "text": "REPEAT('0',4) || column_name\n RIGHT varchar(10) RIGHT(REPEAT('0',4) || column_name, 10)" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/286493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24550/" ]
286,496
<p>I am developing an iOS application, and trying to zip the file I have created in the application, is there any built in function able to do this?</p>
[ { "answer_id": 8969690, "author": "nlg", "author_id": 973043, "author_profile": "https://Stackoverflow.com/users/973043", "pm_score": 2, "selected": false, "text": "-(IBAction)Zip{\nself.fileManager = [NSFileManager defaultManager];\nNSArray *paths = NSSearchPathForDirectoriesInDomains(N...
2008/11/13
[ "https://Stackoverflow.com/questions/286496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35405/" ]
286,508
<p>I've looked at the ReaderWriterLock in .NET 2.0 and the ReaderWriterLockSlim in .NET 3.5, and the slim version doesn't use kernel objects for the locking. For my context, which can potentially generate a large (but not huge) amount of objects, this sounds better.</p> <p>But the code I write needs to be used in both...
[ { "answer_id": 286520, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "ReaderWriterLockSlim ReaderWriterLockSlim ReaderWriterLock ReaderWriterLockSlim" }, { "answer_id": 720653, "a...
2008/11/13
[ "https://Stackoverflow.com/questions/286508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/267/" ]
286,533
<p>I'm testing how the classes FileStream and StreamReader work togheter. Via a Console application. I'm trying to go in a file and read the lines and print them on the console.</p> <p>I've been able to do it with a while-loop, but I want to try it with a foreach loop.</p> <pre><code>using System; using System.Collec...
[ { "answer_id": 286539, "author": "TcKs", "author_id": 20382, "author_profile": "https://Stackoverflow.com/users/20382", "pm_score": 2, "selected": false, "text": "foreach(string line in file)\n{\n Console.WriteLine(line);\n}\n" }, { "answer_id": 286541, "author": "Mikael S...
2008/11/13
[ "https://Stackoverflow.com/questions/286533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11795/" ]
286,534
<p>I want to enumerate all available drive letters (which aren't already taken) in Windows using VC++.</p> <p>How can I do this?</p>
[ { "answer_id": 286550, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 3, "selected": false, "text": "GetLogicalDriveStrings GetVolumeInformation" }, { "answer_id": 286555, "author": "JTeagle", "author_id": 162...
2008/11/13
[ "https://Stackoverflow.com/questions/286534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7891/" ]
286,543
<p>I have a checkbox in GridViewColumn which i use for show/change database value. The click event for the checkbox is used for change value in the database. For handling the state of property "IsChecked" I'm using datatrigger and a setter, se xaml code below:</p> <pre><code>&lt;Style TargetType="CheckBox"&gt; &lt...
[ { "answer_id": 286918, "author": "Pop Catalin", "author_id": 4685, "author_profile": "https://Stackoverflow.com/users/4685", "pm_score": 3, "selected": true, "text": "<Style TargetType=\"CheckBox\">\n <Style TargetType=\"{x:Type CheckBox}\">\n <Style TargetType=\"{x:Type CheckBox}\"...
2008/11/13
[ "https://Stackoverflow.com/questions/286543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37271/" ]
286,549
<p>Can PL/SQL procedure in Oracle know it's own name?</p> <p>Let me explain:</p> <pre><code>CREATE OR REPLACE procedure some_procedure is v_procedure_name varchar2(32); begin v_procedure_name := %%something%%; end; </code></pre> <p>After <code>%%something%%</code> executes, variable <code>v_procedure_name</c...
[ { "answer_id": 286569, "author": "cagcowboy", "author_id": 19629, "author_profile": "https://Stackoverflow.com/users/19629", "pm_score": 6, "selected": true, "text": "v_procedure_name := $$PLSQL_UNIT;\n" }, { "answer_id": 18705074, "author": "T. L. Jones", "author_id": 27...
2008/11/13
[ "https://Stackoverflow.com/questions/286549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23220/" ]
286,564
<p>Does Ruby have any tools along the lines of <a href="http://pypi.python.org/pypi/pylint" rel="noreferrer">pylint</a> for analyzing source code for errors and simple coding standards?</p> <p>It would be nice if it could be integrated with <a href="http://cruisecontrolrb.thoughtworks.com/" rel="noreferrer">cruisecont...
[ { "answer_id": 310940, "author": "Atiaxi", "author_id": 2555346, "author_profile": "https://Stackoverflow.com/users/2555346", "pm_score": 2, "selected": false, "text": "ruby -w\n" }, { "answer_id": 892656, "author": "Community", "author_id": -1, "author_profile": "htt...
2008/11/13
[ "https://Stackoverflow.com/questions/286564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2761/" ]
286,565
<p>I'm using a QTableWidget to display several rows. Some of these rows should reflect an error and their text color is changed :</p> <p>Rows reflecting that there is no error are displayed with a default color (black text on white background on my computer).<br> Rows reflecting that there is an error are displayed wi...
[ { "answer_id": 287660, "author": "Caleb Huitt - cjhuitt", "author_id": 9876, "author_profile": "https://Stackoverflow.com/users/9876", "pm_score": 0, "selected": false, "text": "QAbstractItemDelegate" }, { "answer_id": 298160, "author": "Jérôme", "author_id": 2796, "a...
2008/11/13
[ "https://Stackoverflow.com/questions/286565", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2796/" ]
286,570
<p>I have several init.d scripts that I'm using to start some daemons. Most of these scripts I've found on the internet and they all use start-stop-daemon. My understanding is that "start-stop-daemon" is a command that is specific to Linux or BSD distros and is not available on Solaris.</p> <p>What is the best way to ...
[ { "answer_id": 286673, "author": "Anders Westrup", "author_id": 36845, "author_profile": "https://Stackoverflow.com/users/36845", "pm_score": 4, "selected": true, "text": "svcs svccfg svcadm" }, { "answer_id": 674955, "author": "Community", "author_id": -1, "author_pr...
2008/11/13
[ "https://Stackoverflow.com/questions/286570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35341/" ]
286,571
<p>As the title really, I'm in one part of my code and I would like to invoke any methods that have been added to the Button.Click handler.</p> <p>How can I do this?</p>
[ { "answer_id": 286595, "author": "Lars Mæhlum", "author_id": 960, "author_profile": "https://Stackoverflow.com/users/960", "pm_score": 1, "selected": false, "text": " private EventHandler ButtonClick;\n\n protected override void CreateChildControls()\n {\n base.CreateChil...
2008/11/13
[ "https://Stackoverflow.com/questions/286571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26081/" ]
286,583
<p>I want to print styled html pages with their images from a script. Can anyone suggest an open-source solution?</p> <p>I'm using linux (Ubuntu 8.04) but would be also be interested in solutions for other operating systems.</p>
[ { "answer_id": 286698, "author": "Tader", "author_id": 30700, "author_profile": "https://Stackoverflow.com/users/30700", "pm_score": 4, "selected": true, "text": "sudo aptitude install html2ps lpr html2ps \\\n http://stackoverflow.com/questions/286583 \\\n |lpr\n html2ps \\\n ht...
2008/11/13
[ "https://Stackoverflow.com/questions/286583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20074/" ]
286,584
<p>I need a member of my class to be a Control, and for it to implement an interface we define.</p> <p>If I declare it like this...</p> <pre><code>public class MyClass { public Control MyMember; } </code></pre> <p>... then I don't get the interface methods, but if I declare it like this...</p> <pre><code>public...
[ { "answer_id": 286591, "author": "VVS", "author_id": 21038, "author_profile": "https://Stackoverflow.com/users/21038", "pm_score": -1, "selected": false, "text": "public interface IMyInterface : Control\n{\n ..\n}\n public interface IMyInterface \n{\n Control Control { get; }\n\n [..r...
2008/11/13
[ "https://Stackoverflow.com/questions/286584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15371/" ]
286,589
<p>I'm writing a ruby program that executes some external command-line utilities. How could I mock the filesystem from my rspec tests so that I could easily setup some file hierarchy and verify it after testing. It would also be best to be implemented in ram so that tests would run quickly. </p> <p>I realize that I ma...
[ { "answer_id": 286796, "author": "Adam Byrtek", "author_id": 36656, "author_profile": "https://Stackoverflow.com/users/36656", "pm_score": 4, "selected": true, "text": "File.exist? File.directory?" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/286589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30958/" ]
286,594
<p>I normally work on single threaded applications and have generally never really bothered with dealing with threads. My understanding of how things work - which certainly, may be wrong - is that as long as we're always dealing with single threaded code (i.e. no forks or anything like that) it will always be executed ...
[ { "answer_id": 286664, "author": "Marco M.", "author_id": 28375, "author_profile": "https://Stackoverflow.com/users/28375", "pm_score": 3, "selected": true, "text": "void AssertSingleThread()\n{\n if (m_ThreadId < 0) m_ThreadId = Thread.CurrentThread.ManagedThreadId;\n Debug.Assert(m...
2008/11/13
[ "https://Stackoverflow.com/questions/286594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4368/" ]
286,603
<p>I have an application that uses <code>Ajax.Request</code> and its <code>onSuccess</code> event handler in lots of places.</p> <p>I need to call a function (that will check the response) before all these <code>onSuccess</code> events fire. I tried using <code>Ajax.Responders.register</code> with <code>onComplete</c...
[ { "answer_id": 286672, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 2, "selected": false, "text": "Ajax.Request onCreate onUninitialized onLoading onLoaded onInteractive onXYZ onSuccess onFailure onComplete onLoading onLo...
2008/11/13
[ "https://Stackoverflow.com/questions/286603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25768/" ]
286,605
<p>I am trying to create a Key Listener in java however when I try </p> <pre><code>KeyListener listener = new KeyListener(); </code></pre> <p>Netbeans is telling me that KeyListener is abstract;cannot be instantiated. I know that I am missing some other piece of this key listener, but since this is my first time usin...
[ { "answer_id": 286613, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "KeyListener KeyListener listener = new SomeKeyListenerImplementation();\n KeyListener listener = new KeyListener()\n{\n ...
2008/11/13
[ "https://Stackoverflow.com/questions/286605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29326/" ]
286,606
<p>In the application there is a dialog where only numeric string entries are valid. Therefore I would like to set the numeric keyboard layout.</p> <p>Does anyone know how to simulate key press on the keyboard or any other method to change the keyboard layout?</p> <p>Thanks!</p>
[ { "answer_id": 286785, "author": "kgiannakakis", "author_id": 24054, "author_profile": "https://Stackoverflow.com/users/24054", "pm_score": 0, "selected": false, "text": "InputModeEditor.SetInputMode(textBox1,InputMode.Numeric);\n" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/286606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22996/" ]
286,614
<p>I'm developing an application with a team in .Net (C++) and provide a COM interface to interact with python and other languages.</p> <p>What we've found is that pushing data through COM turns out to be pretty slow.</p> <p>I've considered several alternatives:</p> <ul> <li>dumping data to a file and sending the fi...
[ { "answer_id": 286738, "author": "gimel", "author_id": 6491, "author_profile": "https://Stackoverflow.com/users/6491", "pm_score": 4, "selected": true, "text": "win32pipe r'\\\\.\\pipe\\mypipe' ovpipe win32event.WaitForMultipleObjects rc = win32event.WaitForMultipleObjects(\n eventlis...
2008/11/13
[ "https://Stackoverflow.com/questions/286614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24718/" ]
286,619
<p>I am using a .Net <code>HtmlTextWriter</code> to generate HTML.</p> <pre><code>try { htw.RenderBeginTag( HtmlTextWriterTag.Span ); htw.Write(myObject.GenerateHtml()); htw.RenderEndTag( ); } catch (Exception e) { GenerateHtmlErrorMessage(htw); } </code></pre> <p>In this example, if an error exception ...
[ { "answer_id": 286661, "author": "Mikael Söderström", "author_id": 36944, "author_profile": "https://Stackoverflow.com/users/36944", "pm_score": -1, "selected": false, "text": "if (myHTML != null)\n{\n htw.RenderBeginTag( HtmlTextWriterTag.Span );\n htw.Write(myHtml) \n htw.Ren...
2008/11/13
[ "https://Stackoverflow.com/questions/286619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18107/" ]
286,624
<p>I am reading log files but not all lines want to be processed straight away. I am using a queue / buffer to store the lines while they wait to be processed.</p> <p>This queue is regularly scanned for particular lines - when they are found, they are removed from the queue (they can be anywhere in it). When there isn...
[ { "answer_id": 286874, "author": "James Camfield", "author_id": 35033, "author_profile": "https://Stackoverflow.com/users/35033", "pm_score": 1, "selected": false, "text": "HashMap<String,LinkedList<String>>\n" }, { "answer_id": 287172, "author": "Bill Michell", "author_i...
2008/11/13
[ "https://Stackoverflow.com/questions/286624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35033/" ]