qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
284,904
<p>When I compile an application with VS2008 I sometimes end up with 2 identical config files:</p> <ul> <li>*.exe.config</li> <li>*.vshost.exe.config</li> </ul> <p>What is the latter one for?</p>
[ { "answer_id": 7253559, "author": "robvon", "author_id": 473704, "author_profile": "https://Stackoverflow.com/users/473704", "pm_score": 2, "selected": false, "text": "var s = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/284904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463/" ]
284,906
<p>What are some key UI design tips that every developer should know?</p> <p>While there are a number of UI resources for developers (for example, Joel Spolsky's <a href="https://rads.stackoverflow.com/amzn/click/com/1893115941" rel="noreferrer" rel="nofollow noreferrer">User Interface Design for Programmers</a>), I'm...
[ { "answer_id": 285044, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 0, "selected": false, "text": "[Ok, Please Cancel my subscription ], [ Please do not cancel my subscription ] \n Cancel my subscription?\n[ OK ] [ ...
2008/11/12
[ "https://Stackoverflow.com/questions/284906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2197/" ]
284,921
<p>I want to start using dependency injection in my WPF application, largely for better unit testability. My app is mostly constructed along the M-V-VM pattern. I'm looking at <a href="https://code.google.com/p/autofac/" rel="nofollow noreferrer">Autofac</a> for my IoC container, but I don't think that matters too much...
[ { "answer_id": 286024, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "public class MyDotNetcomponent<T> : SomeDotNetcomponent \n{\n // Inversion of Control Loader…\n // Next step add the Inv...
2008/11/12
[ "https://Stackoverflow.com/questions/284921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25201/" ]
284,939
<h1>UPDATE</h1> <p>So it turns out internet exploder's stranglehold on "security" to "make up" for being so bad at security was causing my problems. I should have checked that out first haha. Thanks everyone for the input, it has given me ideas on how to optimize my application :D</p> <hr> <p>I am writing a web ap...
[ { "answer_id": 285528, "author": "Moose", "author_id": 19032, "author_profile": "https://Stackoverflow.com/users/19032", "pm_score": 0, "selected": false, "text": "System.Net.WebClient wc = new System.Net.WebClient();\nbyte[] b;\nbyte[] res;\nstring formdata = \"text=test text&password=s...
2008/11/12
[ "https://Stackoverflow.com/questions/284939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25515/" ]
284,947
<p>Is there a simple way to retrieve the length of an associative array (implemented as an <code>Object</code>) in ActionScript 3.0?</p> <p>I understand that there are two primary ways of creating associative arrays in AS3:</p> <ol> <li>Use a <code>Dictionary</code> object; especially handy when the key does not need...
[ { "answer_id": 286647, "author": "Iain", "author_id": 11911, "author_profile": "https://Stackoverflow.com/users/11911", "pm_score": 3, "selected": false, "text": "var things:Array = [];\nthings.push(\"hi!\");\ntrace(things.length);\n// traces 1\ntrace(things);\n// traces hi!\n var things...
2008/11/12
[ "https://Stackoverflow.com/questions/284947", "https://Stackoverflow.com", "https://Stackoverflow.com/users/863/" ]
284,950
<p>I finally got my group to switch from SourceSafe to Subversion. Unfortunately, my manager still wants to use exclusive locks on every single file. So I set the svn:needs-lock property on every file and created a pre-commit hook to make sure the property stays set.</p> <p>We are running Subversion on a Linux serve...
[ { "answer_id": 284966, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 6, "selected": true, "text": "svnadmin lslocks svn:needs-lock" }, { "answer_id": 9785504, "author": "ashirley", "author_id": 6950, "...
2008/11/12
[ "https://Stackoverflow.com/questions/284950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37036/" ]
284,952
<p>I am working on an embedded application where the device is controlled through a command interface. I mocked the command dispatcher in VC and had it working to my satisfaction; but when I then moved the code over to the embedded environment, I found out that the compiler has a broken implementation of pointer-to-fu...
[ { "answer_id": 284987, "author": "xtofl", "author_id": 6610, "author_profile": "https://Stackoverflow.com/users/6610", "pm_score": 1, "selected": false, "text": "&getenv ; function call\npush [arg1]\npush [arg2]\ncall [command+8] ; at the 4th location, the setter is stored\nret\n extern ...
2008/11/12
[ "https://Stackoverflow.com/questions/284952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22329/" ]
284,984
<p>Let's say we have these tables;</p> <p>table user:<br> - id<br> - username<br> - email</p> <p>table user2group:<br> - userid<br> - groupid</p> <p>table group:<br> - id<br> - groupname</p> <p>How do I make one query that returns all users, and the groups they belong to (as an array in the resultset or something.....
[ { "answer_id": 284988, "author": "Eric Z Beard", "author_id": 1219, "author_profile": "https://Stackoverflow.com/users/1219", "pm_score": 3, "selected": false, "text": "select u.id, u.username, u.email, g.groupid, g.groupname\nfrom user u \njoin user2group ug on u.userid=ug.userid\njoin ...
2008/11/12
[ "https://Stackoverflow.com/questions/284984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
284,985
<p>I would like to do something like add a nice-to-Excel-functions <code>Name</code> property to the <code>WorkBook</code> class. Is there a good way to do this?</p> <p>More detailed problem: In VBA you can assign a formula to a range in an Excel worksheet. I want to do so, and I want my formula to refer to a second w...
[ { "answer_id": 285069, "author": "DJ.", "author_id": 10492, "author_profile": "https://Stackoverflow.com/users/10492", "pm_score": 1, "selected": false, "text": "WorksheetName = Replace(WB.Name, \"'\", \"''\")\n" }, { "answer_id": 285615, "author": "dbb", "author_id": 256...
2008/11/12
[ "https://Stackoverflow.com/questions/284985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15041/" ]
285,005
<p>I have to sort a number of integers, which can have values between 30.000.000 and 350.000.000. There will be between 0 and 65.535 integers, with the average count being 20.000. RAM usage is irrelevant and speed only is important.</p> <p>Later on i will also have to split them into groups, with the divide always bei...
[ { "answer_id": 285025, "author": "warren", "author_id": 4418, "author_profile": "https://Stackoverflow.com/users/4418", "pm_score": 0, "selected": false, "text": "while(morenumbers)\n sorted[[unsorted[number]]++\n number++\n" }, { "answer_id": 285038, "author": "Michael Car...
2008/11/12
[ "https://Stackoverflow.com/questions/285005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/145119/" ]
285,015
<p>I'm working on a Linux machine through SSH (Putty). I need to leave a process running during the night, so I thought I could do that by starting the process in background (with an ampersand at the end of the command) and redirecting stdout to a file.</p> <p>To my surprise, that doesn't work. As soon as I close the ...
[ { "answer_id": 285040, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 6, "selected": false, "text": "nohup disown -h > help disown\ndisown: disown [-h] [-ar] [jobspec ...]\n By default, removes each JOBSPEC argume...
2008/11/12
[ "https://Stackoverflow.com/questions/285015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25700/" ]
285,031
<p>It is possible to get stacktrace using System.Diagnostics.StackTrace, but thread has to be suspended. Suspend and Resume function are obsolete, so I expect that better way exists.</p>
[ { "answer_id": 285321, "author": "Michael Burr", "author_id": 12711, "author_profile": "https://Stackoverflow.com/users/12711", "pm_score": 2, "selected": false, "text": "http://blogs.msdn.com/jmstall/archive/2005/11/07/views_on_cordbg_and_mdbg.aspx http://geekswithblogs.net/johnsPerfBlo...
2008/11/12
[ "https://Stackoverflow.com/questions/285031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28912/" ]
285,042
<p>I'm trying to copy both an image from a file and text from a file to the clipboard. My intention is to then open a word document or an outlook email and paste both the text and the image in one standard paste command (CTRL-V for example). I can do both separately easily enough, but doing them both in one operation d...
[ { "answer_id": 61739796, "author": "Markus", "author_id": 1332129, "author_profile": "https://Stackoverflow.com/users/1332129", "pm_score": 0, "selected": false, "text": "// Load a bitmap without locking it.\nprivate Bitmap LoadBitmapUnlocked(string path)\n{\n using (Bitmap bm = new B...
2008/11/12
[ "https://Stackoverflow.com/questions/285042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9732/" ]
285,061
<p>Suppose I have a python object <code>x</code> and a string <code>s</code>, how do I set the attribute <code>s</code> on <code>x</code>? So:</p> <pre><code>&gt;&gt;&gt; x = SomeObject() &gt;&gt;&gt; attr = 'myAttr' &gt;&gt;&gt; # magic goes here &gt;&gt;&gt; x.myAttr 'magic' </code></pre> <p>What's the magic? The g...
[ { "answer_id": 285076, "author": "Ali Afshar", "author_id": 28380, "author_profile": "https://Stackoverflow.com/users/28380", "pm_score": 10, "selected": true, "text": "setattr(x, attr, 'magic')\n >>> help(setattr)\nHelp on built-in function setattr in module __builtin__:\n\nsetattr(...)...
2008/11/12
[ "https://Stackoverflow.com/questions/285061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5222/" ]
285,068
<p>Is there a way to make OpenGL transform a general vector I give it with the current modelview matrix and get the result back?</p> <p>The obvious way is to query the modelview matrix and do the multiplication myself but I am almost sure there should be a way to make OpenGL do this for me.</p>
[ { "answer_id": 285265, "author": "Judge Maygarden", "author_id": 1491, "author_profile": "https://Stackoverflow.com/users/1491", "pm_score": 2, "selected": false, "text": "float modelview[16];\nglGetFloatv(GL_MODELVIEW_MATRIX, modelview);\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9611/" ]
285,074
<p>I'm using the <a href="http://docs.jquery.com/UI/Sortables" rel="noreferrer">jQuery UI sortables</a> plugin to allow re-ordering of some list items. Inside each list item, I've got a couple of radio buttons which allow the item to be enabled or disabled.</p> <p>When the item is dragged, both radio buttons get dese...
[ { "answer_id": 290738, "author": "Ben Koehler", "author_id": 11996, "author_profile": "https://Stackoverflow.com/users/11996", "pm_score": 1, "selected": false, "text": "$('#itemlist').sortable();\n $('#itemlist').sortable({placeholder: \".items li\"});\n" }, { "answer_id": 29515...
2008/11/12
[ "https://Stackoverflow.com/questions/285074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/775/" ]
285,083
<p>I'm writing a custom JSP tag using the JSP 2 tag files. Inside my tag I would like to know which page called the tag in order to construct URLs. Is this possible with out passing it through an attribute?</p>
[ { "answer_id": 288438, "author": "timdisney", "author_id": 14481, "author_profile": "https://Stackoverflow.com/users/14481", "pm_score": 2, "selected": false, "text": "<form action=\"${pageContext.request.requestURI}\">\n <form action=\"<%=request.requestURI%>\">\n <form action=\"<%=page...
2008/11/12
[ "https://Stackoverflow.com/questions/285083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14481/" ]
285,095
<p>Given a week-day (1-7), how can I calculate what that week-day's last date was?</p> <p><strong>Example:</strong> Today is <strong>Wednesday</strong>, 2008/11/12, and I want to know what last <strong>Friday's</strong> date was.</p>
[ { "answer_id": 285113, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": true, "text": "today days_since_friday = (((today - 1) + 7) - (6 - 1)) % 7\n days_since_friday days_since_friday = ((today + 7) - 5) % 7\...
2008/11/12
[ "https://Stackoverflow.com/questions/285095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15884/" ]
285,104
<p>For some reason sql server 2008 is not allowing me to add columns to an existing table.</p> <p>The table is empty btw.</p> <p>Is there a setting that prevents modifying tables in sql 2008?</p>
[ { "answer_id": 285113, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": true, "text": "today days_since_friday = (((today - 1) + 7) - (6 - 1)) % 7\n days_since_friday days_since_friday = ((today + 7) - 5) % 7\...
2008/11/12
[ "https://Stackoverflow.com/questions/285104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,107
<p>Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different commands, is there an easy way similar to Directory.CreateDirectory()</p>
[ { "answer_id": 285131, "author": "George Mastros", "author_id": 1408129, "author_profile": "https://Stackoverflow.com/users/1408129", "pm_score": 4, "selected": true, "text": "Public Sub MakePath(ByVal Folder As String)\n\n Dim arTemp() As String\n Dim i As Long\n Dim FSO As Scr...
2008/11/12
[ "https://Stackoverflow.com/questions/285107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,139
<p>I'm trying to duplicate the effect used in the Firefox search box where, if the search field does not have focus ( the user has not clicked inside of it ), it just says <i>Google</i> in gray text. Then, when the user clicks in the box, the text is removed and they can fill in their search term.</p> <p>I want to use...
[ { "answer_id": 285173, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 4, "selected": true, "text": "<style type='text/css'>\n input #ghost { color: #CCC; }\n input #normal { color: #OOO; }\n</style>\n\n<script type=...
2008/11/12
[ "https://Stackoverflow.com/questions/285139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,148
<p>I've written a rails app that follows the regular directory structure (model code in models, controller code in controllers).</p> <p>But I'm now working on a new feature and for that I have written some (what I would call) "service" code.<br> The new feature is to import some data into the system, at the moment it'...
[ { "answer_id": 285152, "author": "Gareth", "author_id": 31582, "author_profile": "https://Stackoverflow.com/users/31582", "pm_score": 6, "selected": true, "text": "class MyFoo\nend\n lib/my_foo.rb MyFoo.new\n require 'my_foo'" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/151/" ]
285,154
<p>How can I access options that I set in a jQuery Datepicker?</p> <pre><code>$("#testDatePicker").datepicker({ minDate: new Date(2005, 0, 26), showOn: 'button', buttonImage: 'js/themes/default/images/calendar.gif', buttonImageOnly: true }); var minDate = $("#testDatePicker").?????; </code></pre>
[ { "answer_id": 285302, "author": "Mauricio Scheffer", "author_id": 21239, "author_profile": "https://Stackoverflow.com/users/21239", "pm_score": 2, "selected": true, "text": "var dpOptions = {minDate: new Date(2005, 0, 26), ...};\n$('#testDatePicker').datepicker(dpOptions);\n.\n.\n.\nvar...
2008/11/12
[ "https://Stackoverflow.com/questions/285154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10976/" ]
285,177
<p>Is it possible to call a constructor from another (within the same class, not from a subclass)? If yes how? And what could be the best way to call another constructor (if there are several ways to do it)?</p>
[ { "answer_id": 285184, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 13, "selected": true, "text": "public class Foo {\n private int x;\n\n public Foo() {\n this(1);\n }\n\n public Foo(int x) {\n ...
2008/11/12
[ "https://Stackoverflow.com/questions/285177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33203/" ]
285,197
<p>I have a database table (sql server 2008) that I want to view data for, what is the quickest way of displaying this data?</p> <p>(if it could have paging that would be perfect).</p> <p>Would it be a gridview or ?</p> <p>query: select * from testData</p>
[ { "answer_id": 285203, "author": "Kon", "author_id": 22303, "author_profile": "https://Stackoverflow.com/users/22303", "pm_score": 2, "selected": false, "text": "gridview.DataSource = yourDataTable;\ngridview.DataBind();\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,205
<p>We are looking to improve our marketing email list by preventing fake emails from entering in the first place. We want to confirm that an email address exists (and that there is actually a mailbox for that email address). </p> <p>Does anyone know of any services or components to validate an email address? </p>
[ { "answer_id": 285222, "author": "Adam Alexander", "author_id": 33164, "author_profile": "https://Stackoverflow.com/users/33164", "pm_score": 0, "selected": false, "text": "(\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,6})\n" }, { "answer_id": 2795881, "author": "Community", "author_id"...
2008/11/12
[ "https://Stackoverflow.com/questions/285205", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21579/" ]
285,214
<p>I'm embedding an IE control into my C++ application. The problem is that although system-wide, ClearType is disabled, IE7 has its own separate setting, and unless I specifically disable that too, text inside the IE control will be antialiased while the rest of the app will not.</p> <p>The same goes for IE7's font s...
[ { "answer_id": 285222, "author": "Adam Alexander", "author_id": 33164, "author_profile": "https://Stackoverflow.com/users/33164", "pm_score": 0, "selected": false, "text": "(\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,6})\n" }, { "answer_id": 2795881, "author": "Community", "author_id"...
2008/11/12
[ "https://Stackoverflow.com/questions/285214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9665/" ]
285,227
<p><strong>SQL Server 2000:</strong> Is there a way to find out server memory / CPU parameters in Query Analyzer?</p>
[ { "answer_id": 285798, "author": "Mladen Prajdic", "author_id": 31345, "author_profile": "https://Stackoverflow.com/users/31345", "pm_score": 0, "selected": false, "text": "perfmon" }, { "answer_id": 285806, "author": "Cade Roux", "author_id": 18255, "author_profile":...
2008/11/12
[ "https://Stackoverflow.com/questions/285227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,228
<p>We have a system where customers, mainly European enter texts (in UTF-8) that has to be distributed to different systems, most of them accepting UTF-8, but now we must also distribute the texts to a US system which only accepts US-Ascii 7-bit</p> <p>So now we'll need to translate all European characters to the near...
[ { "answer_id": 285247, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 0, "selected": false, "text": "CharsetEncoder nio String.getBytes(Charset) ByteArrayOutputStream" }, { "answer_id": 1483057, "author": "Rob", ...
2008/11/12
[ "https://Stackoverflow.com/questions/285228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30354/" ]
285,238
<p>Firstly I'm extending an existing class structure and cannot alter the original, with that caveat:</p> <p>I would like to do this:</p> <pre><code>class a { int val; ... // usual constructor, etc... public int displayAlteredValue(int inp) { return (val*inp); } } class b extends a { ... // ...
[ { "answer_id": 285258, "author": "Lou Franco", "author_id": 3937, "author_profile": "https://Stackoverflow.com/users/3937", "pm_score": 1, "selected": false, "text": "public int displayAlteredValue(int inp)\n{\n return super.displayAlteredValue(inp);\n}\n" }, { "answer_id": 2852...
2008/11/12
[ "https://Stackoverflow.com/questions/285238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,251
<p>I maintain the build system at my company, which is currently using CVS. This build system is used across multiple projects and multiple CVS repositories.</p> <p>Whenever we have a release milestone, we create a tag. In CVS, this is easy:</p> <pre><code>$ cvs tag TAG_NAME </code></pre> <p>That command works reg...
[ { "answer_id": 285411, "author": "bendin", "author_id": 33412, "author_profile": "https://Stackoverflow.com/users/33412", "pm_score": 3, "selected": false, "text": "svnurl .../PROJECTNAME/trunk\n tags\n branches\n svnurl -tl # gives a list of tags for the c...
2008/11/12
[ "https://Stackoverflow.com/questions/285251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/737/" ]
285,276
<p>SAP HR apparently has several models for describing the relationship between Position (S), Job (C), Organization (O) and Person (P) objects that the Organizational Management (OM) module is used to maintain.</p> <p>P (Person) objects are usually Holders of Positions (S).</p> <p>There is the S-S relationship model,...
[ { "answer_id": 397516, "author": "PATRY Guillaume", "author_id": 49804, "author_profile": "https://Stackoverflow.com/users/49804", "pm_score": 4, "selected": true, "text": "SELECT * from HRP1001 where OTYPE = 'S' \n AND RELAT = '012' \n and R...
2008/11/12
[ "https://Stackoverflow.com/questions/285276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32247/" ]
285,277
<p>I have some program settings that are currently stored in HKEY_LOCAL_MACHINE. Due to Vista and locked down users, some users don't have permission to HKEY_LOCAL_MACHINE, and those values don't really belong to HKEY_LOCAL_USER either (it has to be the same for all users), what's the best alternative location for stor...
[ { "answer_id": 286027, "author": "Rômulo Ceccon", "author_id": 23193, "author_profile": "https://Stackoverflow.com/users/23193", "pm_score": 6, "selected": true, "text": "HKEY_CURRENT_USER CSIDL_APPDATA CSIDL_LOCAL_APPDATA HKEY_LOCAL_MACHINE CSIDL_COMMON_APPDATA CSIDL_*" }, { "an...
2008/11/12
[ "https://Stackoverflow.com/questions/285277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26305/" ]
285,286
<p>I have a number of string arrays. The string in every array are ordered the same way, according the same criteria. However, some string may be missing from some arrays, and there may be no array that has a complete set of strings. Moreover, the criteria used to compare the strings is not available to me: outside of ...
[ { "answer_id": 285447, "author": "FallenAvatar", "author_id": 36965, "author_profile": "https://Stackoverflow.com/users/36965", "pm_score": 3, "selected": false, "text": "A B D\nA B C\nA C D\n A B D C\n enum Type\n{\n Unknown = 0,\n Greater = 1,\n Equal = 2,\n Less = 3,\n}\n ...
2008/11/12
[ "https://Stackoverflow.com/questions/285286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,289
<p>I got a message saying <code>script xyz.py returned exit code 0</code>. What does this mean?</p> <p>What do the exit codes in Python mean? How many are there? Which ones are important?</p>
[ { "answer_id": 285326, "author": "Dave Costa", "author_id": 6568, "author_profile": "https://Stackoverflow.com/users/6568", "pm_score": 9, "selected": true, "text": "sys.exit()" }, { "answer_id": 285451, "author": "Eigir", "author_id": 37007, "author_profile": "https:...
2008/11/12
[ "https://Stackoverflow.com/questions/285289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19731/" ]
285,290
<p>I'm having trouble sending out a simple HTTP request using Actionscript 3's Socket() object. My onConnect listener is below:</p> <pre><code>function sConnect(e:Event):void { trace('connected'); s.writeUTFBytes('GET /outernet/client/rss/reddit-feeds HTTP/1.1\r\n'); s.writeUTFBytes('Host: 208.43.71.50:808...
[ { "answer_id": 285350, "author": "Mike Keen", "author_id": 14182, "author_profile": "https://Stackoverflow.com/users/14182", "pm_score": 1, "selected": false, "text": "function sConnect(e:Event):void {\n trace('connected');\n s.writeUTFBytes('GET /outernet/client/rss/reddit-feeds H...
2008/11/12
[ "https://Stackoverflow.com/questions/285290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14182/" ]
285,292
<p>I have just started to look at .NET 3.5 so please forgive me if this type of question have been asked before. I am struggling with a decent usage for extension methods, in that I have just downloaded suteki shop an MVC ecommerce offering. In this project there is a pretty standard Repository pattern that extends IRe...
[ { "answer_id": 285368, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "IRepository<T> IRepository<Category> IRepository<Category>" }, { "answer_id": 285375, "author": "Sunlight", ...
2008/11/12
[ "https://Stackoverflow.com/questions/285292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/425/" ]
285,313
<p>I have a field in a database that is nearly unique: 98% of the time the values will be unique, but it may have a few duplicates. I won't be doing many searches on this field; say twice a month. The table currently has ~5000 records and will gain about 150 per month.</p> <p>Should this field have an index?</p> <p>I...
[ { "answer_id": 285342, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 4, "selected": true, "text": "select" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
285,314
<p>I'm building a tool that automates a process then runs some tests on it's own results then goes to do some other stuff.</p> <p>In trying to clean up my code I have created a separate file that just has the test cases class. Now before I can run these tests, I have to pass the class a couple of parameters/objects be...
[ { "answer_id": 285342, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 4, "selected": true, "text": "select" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37080/" ]
285,320
<p>I need your advice with converting plain text to an URL.</p> <p>The scenario will be this: The user will select some entry and then click a "convert to link" button. </p> <p>The entry text the user selected will convert to <code>(link: selected_text)</code>. I do it with JavaScript. And after that, when he clicks ...
[ { "answer_id": 286456, "author": "Serhat Ozgel", "author_id": 31505, "author_profile": "https://Stackoverflow.com/users/31505", "pm_score": 1, "selected": false, "text": "(link: here)\n (link: <a href=\"http://www.mysite.com?t=here\">here</a>)\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,323
<p>I have an <code>ICollection&lt;T&gt;</code> called <code>foos</code> in my class which I want to expose as read-only (see <a href="https://stackoverflow.com/questions/284090/how-to-get-a-readonlycollectiont-of-the-keys-in-a-dictionaryt-s">this question</a>). I see that the interface defines a property <code>.IsReadO...
[ { "answer_id": 285360, "author": "bruno conde", "author_id": 31136, "author_profile": "https://Stackoverflow.com/users/31136", "pm_score": 4, "selected": false, "text": "ReadOnlyCollection<T> readOnlyCollection = foos.ToList<T>().AsReadOnly();\n class FooContainer\n {\n pri...
2008/11/12
[ "https://Stackoverflow.com/questions/285323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6091/" ]
285,343
<p>I've got an SQL query that looks like this:</p> <pre><code>INSERT INTO DB..incident ( incident_number --nvarchar(10) ) VALUES ( N'I?' ) </code></pre> <p>What does the ? do in the value statement?</p> <p>EDIT:: Turns out there's some funny business via triggers and custom datatypes that occur on i...
[ { "answer_id": 285366, "author": "TGnat", "author_id": 25121, "author_profile": "https://Stackoverflow.com/users/25121", "pm_score": 4, "selected": true, "text": "DECLARE @TestTable TABLE (test NVARCHAR(10))\n\nINSERT INTO @TestTable (\n test\n) VALUES ( \n N'I?' ) \n\n\nSELECT * \...
2008/11/12
[ "https://Stackoverflow.com/questions/285343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33226/" ]
285,345
<p>This exception is consistently thrown on a SOAP Request which takes almost three minutes to receive and is 2.25 megs in size. </p> <p>When scouring the web I find all sorts of posts which all seem to be about setting headers on the Request, some want me to not send the "Expect:" header, some want me to send the "Ke...
[ { "answer_id": 285542, "author": "Robert Wagner", "author_id": 10784, "author_profile": "https://Stackoverflow.com/users/10784", "pm_score": 4, "selected": false, "text": "<system.serviceModel>\n <bindings>\n <basicHttpBinding>\n <binding name=\"BasicHttpBinding\" maxBuffe...
2008/11/12
[ "https://Stackoverflow.com/questions/285345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21909/" ]
285,372
<p>Is there a way to have the compile deduce the template parameter automatically?</p> <pre><code>template&lt;class T&gt; struct TestA { TestA(T v) {} }; template&lt;class T&gt; void TestB(T v) { } int main() { TestB (5); } </code></pre> <p>Test B works fine, however when i change it to TestA it will not c...
[ { "answer_id": 285380, "author": "Sunlight", "author_id": 33650, "author_profile": "https://Stackoverflow.com/users/33650", "pm_score": 5, "selected": true, "text": "make_ template<class T> TestA<T> make_TestA(T v)\n{\n return TestA<T>(v);\n}\n std::pair std::make_pair auto someVariab...
2008/11/12
[ "https://Stackoverflow.com/questions/285372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,383
<p>Given my current .htaccess file, how would I modify it to check for an additional URL path like '/src/pub/<em>' and rewrite it to '/</em>' without affecting the current rewrite?</p> <p>Here's the original .htaccess file:</p> <pre><code>RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FIL...
[ { "answer_id": 285420, "author": "TimB", "author_id": 4193, "author_profile": "https://Stackoverflow.com/users/4193", "pm_score": 4, "selected": true, "text": "RewriteRule ^/src/pub/(.*)$ /$1 [R,L]\n" }, { "answer_id": 285433, "author": "Owen", "author_id": 4853, "aut...
2008/11/12
[ "https://Stackoverflow.com/questions/285383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5291/" ]
285,400
<p>The Win32 API call <a href="http://msdn.microsoft.com/en-us/library/ms221570.aspx" rel="noreferrer">RegisterTypeLib()</a> is used to create the registry keys necessary to register a type library.</p> <p>Unfortunatly, on Windows XP, it tries to write those registry key entries to </p> <pre><code>HKEY_CLASSES_ROOT\T...
[ { "answer_id": 285454, "author": "Michael Burr", "author_id": 12711, "author_profile": "https://Stackoverflow.com/users/12711", "pm_score": 4, "selected": true, "text": "RegOverridePredefKey() HKEY_CLASSES_ROOT HKEY_CURRENT_USER\\Software\\Classes http://msdn.microsoft.com/en-us/library/...
2008/11/12
[ "https://Stackoverflow.com/questions/285400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
285,408
<p>I'm looking for a Python module that would take an arbitrary block of text, search it for something that looks like a date string, and build a DateTime object out of it. Something like <a href="http://search.cpan.org/~sartak/Date-Extract-0.03/lib/Date/Extract.pm" rel="noreferrer">Date::Extract</a> in Perl</p> <p>T...
[ { "answer_id": 285677, "author": "Brian", "author_id": 9493, "author_profile": "https://Stackoverflow.com/users/9493", "pm_score": 5, "selected": true, "text": ">>> from dateutil.parser import parse\n>>> parse(\"Wed, Nov 12\")\ndatetime.datetime(2008, 11, 12, 0, 0)\n >>> parse(\"the date...
2008/11/12
[ "https://Stackoverflow.com/questions/285408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37089/" ]
285,421
<p>I've asked a few <a href="https://stackoverflow.com/questions/150513/html-input-style-to-hide-the-box-but-show-the-contents">other questions</a> here about this system, so I'll try to avoid repeating a lot of detail.</p> <p>The short version is that I have many html pages, each with a form that accepts input, but n...
[ { "answer_id": 285677, "author": "Brian", "author_id": 9493, "author_profile": "https://Stackoverflow.com/users/9493", "pm_score": 5, "selected": true, "text": ">>> from dateutil.parser import parse\n>>> parse(\"Wed, Nov 12\")\ndatetime.datetime(2008, 11, 12, 0, 0)\n >>> parse(\"the date...
2008/11/12
[ "https://Stackoverflow.com/questions/285421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043/" ]
285,422
<p>When editing really long code blocks (which should definitely be refactored anyway, but that's beyond the scope of this question), I often long for the ability to collapse statement blocks like one can collapse function blocks. That is to say, it would be great if the minus icon appeared on the code outline for eve...
[ { "answer_id": 285430, "author": "Kon", "author_id": 22303, "author_profile": "https://Stackoverflow.com/users/22303", "pm_score": 4, "selected": false, "text": "foreach (Item i in Items)\n{\n #region something big happening here\n ...\n #endregion\n\n #region something big happening...
2008/11/12
[ "https://Stackoverflow.com/questions/285422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12975/" ]
285,428
<p>I am trying to make the <a href="http://docs.jquery.com/Plugins/Validation" rel="nofollow noreferrer">Validation plugin</a> work. It works fine for individual fields, but when I try to include the demo code for the error container that contains all of the errors, I have an issue. The problem is that it shows the con...
[ { "answer_id": 285799, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": -1, "selected": false, "text": "<div id=\"container\" style=\"display:none;\"></div>\n jQuery('#formId').onsubmit(function() {\n // This will be called be...
2008/11/12
[ "https://Stackoverflow.com/questions/285428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13913/" ]
285,429
<p>Under normal circumstances, a VB.NET application of mine can check the ClientName environmental variable to get the name of the workstation the user is connecting from.</p> <p>So when WorkstationX RDPs into ServerA:</p> <ul> <li>ComputerName=ServerA</li> <li>ClientName=WorkstationX</li> </ul> <p>That works fine.<...
[ { "answer_id": 732558, "author": "Dan Ports", "author_id": 88885, "author_profile": "https://Stackoverflow.com/users/88885", "pm_score": 2, "selected": false, "text": "New Cassia.TerminalServicesManager().CurrentSession.ClientName\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3743/" ]
285,440
<p>In a .NET CF application I wrote, one of the features is to acquire frames from remote cameras. Frames are acquired as single jpeg images and displayed on the screen when available.</p> <p>It was a good enough solution, but I don't like the fact that the time needed to convert the stream into an <code>Image</code> ...
[ { "answer_id": 732558, "author": "Dan Ports", "author_id": 88885, "author_profile": "https://Stackoverflow.com/users/88885", "pm_score": 2, "selected": false, "text": "New Cassia.TerminalServicesManager().CurrentSession.ClientName\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36728/" ]
285,445
<p>Simple yes or no question, and I'm 90% sure that it is no... but I'm not sure.</p> <p>Can a Base64 string contain tabs?</p>
[ { "answer_id": 285457, "author": "James Curran", "author_id": 12725, "author_profile": "https://Stackoverflow.com/users/12725", "pm_score": 0, "selected": false, "text": "Convert.FromBase64String() string xxx = \"ABCD\\tDEFG\"; //simulated Base64 encoded string w/added tab\nConsole.Wri...
2008/11/12
[ "https://Stackoverflow.com/questions/285445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16794/" ]
285,446
<p>I've got a Windows Forms application with two ListBox controls on the same form. They both have their SelectionMode set to 'MultiExtended'. </p> <p>When I change the selection of one the selection of the other changes.</p> <p>Now I thought I'd done something stupid with my SelectedIndexChanged handlers so I remove...
[ { "answer_id": 285488, "author": "Shaun Bowe", "author_id": 1514, "author_profile": "https://Stackoverflow.com/users/1514", "pm_score": 0, "selected": false, "text": "public partial class Form1 : Form\n{\npublic Form1()\n{\n InitializeComponent();\n}\n\nprivate class Thing\n{\n public ...
2008/11/12
[ "https://Stackoverflow.com/questions/285446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1741868/" ]
285,455
<p>I have some global variables in a Python script. Some functions in that script call into C - is it possible to set one of those variables while in C and if so, how?</p> <p>I appreciate that this isn't a very nice design in the first place, but I need to make a small change to existing code, I don't want to embark o...
[ { "answer_id": 285498, "author": "Sherm Pendley", "author_id": 27631, "author_profile": "https://Stackoverflow.com/users/27631", "pm_score": 5, "selected": true, "text": "PyObject *m = PyImport_AddModule(\"__main__\");\nPyObject *v = PyObject_GetAttrString(m,\"foobar\");\n\nint foobar = ...
2008/11/12
[ "https://Stackoverflow.com/questions/285455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22517/" ]
285,456
<p>Given the following, how could I insert rows in my db? (Or what should I correct in my schema?)</p> <p>Models:</p> <pre><code>class Item &lt; ActiveRecord::Base has_many :tran_items has_many :transactions, :through =&gt; :tran_items end class TranItem &lt; ActiveRecord::Base ...
[ { "answer_id": 285471, "author": "tamersalama", "author_id": 7693, "author_profile": "https://Stackoverflow.com/users/7693", "pm_score": 1, "selected": false, "text": "item = Item.new(:name => \"item\")\nitem.transactions.build(:name => \"transaction\")\nitem.save!\n" }, { "answe...
2008/11/12
[ "https://Stackoverflow.com/questions/285456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25167/" ]
285,465
<p>Hi Guys I'm very new to regex, can you help me with this.</p> <p>I have a string like this <code>"&lt;input attribute='value' &gt;"</code> where <code>attribute='value'</code> could be anything and I want to get do a <code>preg_replace</code> to get just <code>&lt;input /&gt;</code></p> <p>How do I specify a wild...
[ { "answer_id": 285479, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 3, "selected": false, "text": ".*\n [^>]+\n .*?\n <foo attr=\">\"> \n '<foo attr=\" ' with following text of '\">' \n `<[a-zA-Z]+( [a-zA-Z]+=['\"]...
2008/11/12
[ "https://Stackoverflow.com/questions/285465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,474
<p>If I have 2 DataTables (dtOne and dtTwo) and I want to merge them and put them in another DataTable (dtAll). How can I do this in C#? I tried the Merge statement on the datatable, but this returns void. Does Merge preserve the data? For example, if I do:</p> <pre><code> dtOne.Merge(dtTwo); </code></pre> <p>Doe...
[ { "answer_id": 285500, "author": "Jeromy Irvine", "author_id": 8223, "author_profile": "https://Stackoverflow.com/users/8223", "pm_score": 8, "selected": true, "text": "Merge dtAll = dtOne.Copy();\ndtAll.Merge(dtTwo);\n" }, { "answer_id": 454453, "author": "Community", "a...
2008/11/12
[ "https://Stackoverflow.com/questions/285474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33690/" ]
285,477
<p>This is something that comes up so often I almost stopped thinking about it but I'm almost certain that I'm not doing this the best way.</p> <p>The question: Suppose you have the following table</p> <pre><code>CREATE TABLE TEST_TABLE ( ID INTEGER, TEST_VALUE NUMBER, UPDATED DATE, FOREIGN_KEY...
[ { "answer_id": 285485, "author": "George Mauer", "author_id": 5056, "author_profile": "https://Stackoverflow.com/users/5056", "pm_score": 1, "selected": false, "text": "SELECT TEST_VALUE\nFROM TEST_TABLE\nWHERE ID = (\n SELECT ID\n FROM (\n SELECT ID\n FROM TEST_TABLE\n WHERE ...
2008/11/12
[ "https://Stackoverflow.com/questions/285477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
285,482
<p>We've got an app with some legacy printer "setup" code that we are still using <code><a href="http://msdn.microsoft.com/en-us/library/ms646940(VS.85).aspx" rel="nofollow noreferrer">PrintDlg</a></code> for. We use a custom template to allow the user to select which printer to use for various types of printing tasks ...
[ { "answer_id": 453486, "author": "AZDean", "author_id": 12058, "author_profile": "https://Stackoverflow.com/users/12058", "pm_score": 0, "selected": false, "text": "using System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Printing;\nusing System.Print...
2008/11/12
[ "https://Stackoverflow.com/questions/285482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1441/" ]
285,495
<p>I am binding an SPGridView to a SPList. As code samples suggest, I am using the following code to create a dataview based on the list. </p> <pre><code>dim data as DataView = myList.Items.GetDataTable.DefaultView grid.DataSource = data etc... </code></pre> <p>What I am finding is that the column names in the result...
[ { "answer_id": 285590, "author": "Abs", "author_id": 1245, "author_profile": "https://Stackoverflow.com/users/1245", "pm_score": 3, "selected": true, "text": "GetDataTable internalName staticName Title GetDataTable internalName" }, { "answer_id": 470181, "author": "Community"...
2008/11/12
[ "https://Stackoverflow.com/questions/285495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10552/" ]
285,502
<p>This code works in Firefox, Internet Explorer, not in Safari/Chrome:</p> <pre><code>&lt;head&gt; &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery-ui.js"&gt;&lt;/script&gt; &lt;script&gt; function newDiv() { var div = $...
[ { "answer_id": 474619, "author": "jacobangel", "author_id": 31318, "author_profile": "https://Stackoverflow.com/users/31318", "pm_score": 2, "selected": false, "text": " <script>\n function newDiv() {\n var divs = \n $(unescape('%3Cdiv class=\"divNew\" s...
2008/11/12
[ "https://Stackoverflow.com/questions/285502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37122/" ]
285,521
<p>I am making a post from a .NET console app to a .NET web service. I know that the timeout on the server side is 20 min, but if my client takes more than 100 seconds to post my data to that service then I get a timeout exception. How would I tell my client to wait the available 20 min to timeout?</p>
[ { "answer_id": 285536, "author": "lomaxx", "author_id": 493, "author_profile": "https://Stackoverflow.com/users/493", "pm_score": 3, "selected": false, "text": "myServiceInstance.Timeout = 1200000\n" }, { "answer_id": 285547, "author": "Vin", "author_id": 1747, "autho...
2008/11/12
[ "https://Stackoverflow.com/questions/285521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13593/" ]
285,522
<p>Let's say I have an html form. Each input/select/textarea will have a corresponding <code>&lt;label&gt;</code> with the <code>for</code> attribute set to the id of it's companion. In this case, I know that each input will only have a single label.</p> <p>Given an input element in javascript &mdash; via an onkeyup ...
[ { "answer_id": 285560, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 4, "selected": false, "text": "var labels = document.getElementsByTagName(\"LABEL\"),\n lookup = {},\n i, label;\n\nfor (i = 0; i < labels.length; ...
2008/11/12
[ "https://Stackoverflow.com/questions/285522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043/" ]
285,523
<p>Is there a way to determine if the loop is iterating for the last time. My code looks something like this:</p> <pre><code>int[] array = {1, 2, 3...}; StringBuilder builder = new StringBuilder(); for(int i : array) { builder.append("" + i); if(!lastiteration) builder.append(","); } </code></pre> <p...
[ { "answer_id": 285530, "author": "Dinah", "author_id": 356, "author_profile": "https://Stackoverflow.com/users/356", "pm_score": 5, "selected": false, "text": "StringBuilder deleteCharAt(int index) length() - 1" }, { "answer_id": 285534, "author": "sblundy", "author_id": ...
2008/11/12
[ "https://Stackoverflow.com/questions/285523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36858/" ]
285,524
<p>With the following code:</p> <pre><code>Dim x As System.Xml.Linq.XElement = _ &lt;div&gt; &lt;%= message.ToString() %&gt; &lt;/div&gt; Dim m = x.ToString() </code></pre> <p>...if message is HTML, then the &lt; and > characters get converted to <code>&amp;lt;</code> and <code>&amp;rt;</code>. </p> <p>How can I fo...
[ { "answer_id": 805559, "author": "CoderDennis", "author_id": 69527, "author_profile": "https://Stackoverflow.com/users/69527", "pm_score": 4, "selected": true, "text": "message message XElement .ToString Dim x As System.Xml.Linq.XElement = _\n <div>\n <%= message %>\n </div>...
2008/11/12
[ "https://Stackoverflow.com/questions/285524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337/" ]
285,551
<p>I have a data acquisition program written in C++ (Visual Studio 6.0). Some clients would like to control the software from their own custom software or LabView. I would like to come up with a simple API with a dll I can distribute to them and would like some tips on how to get started. This is going to be VERY ba...
[ { "answer_id": 286745, "author": "MSalters", "author_id": 15416, "author_profile": "https://Stackoverflow.com/users/15416", "pm_score": 2, "selected": false, "text": "stdcall" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6320/" ]
285,553
<p>I need to be able to store a date (year/month/day) with no time component. It's an abstract concept of a date, such as a birthday - I need to represent a date in the year and not a particular instant in time.</p> <p>I am using Java to parse the date from some input text, and need to store in a MySQL database. No ma...
[ { "answer_id": 285656, "author": "Ben Noland", "author_id": 32899, "author_profile": "https://Stackoverflow.com/users/32899", "pm_score": 2, "selected": false, "text": "public static Date truncateDate(Date date)\n {\n GregorianCalendar cal = getGregorianCalendar();\n cal...
2008/11/12
[ "https://Stackoverflow.com/questions/285553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37134/" ]
285,572
<p>I've previously encountered the suggestion to call System.Threading.Thread.Sleep(0); in tights loops in C# to prevent CPU hogging and used it to good effect.</p> <p>I have a PowerShell script that has a tight loop and I'm wondering whether I should be calling [Thread]::Sleep(0) or Start-Sleep 0 or whether the PS en...
[ { "answer_id": 288453, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 4, "selected": true, "text": "[Thread]::CurrentThread.ThreadPriority = System.Threading.ThreadPriority.Lowest\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20819/" ]
285,573
<p>I have googled quite a bit and I cannot find the answer. So how many characters can be stored in a Windows Installer property value. If you give an answer can you provide the source of the answer?</p>
[ { "answer_id": 286037, "author": "saschabeaumont", "author_id": 592, "author_profile": "https://Stackoverflow.com/users/592", "pm_score": 2, "selected": false, "text": "Property Property Value Value Text" }, { "answer_id": 286072, "author": "Brody", "author_id": 17131, ...
2008/11/12
[ "https://Stackoverflow.com/questions/285573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2768/" ]
285,579
<p>I'm fairly new to c# so that's why I'm asking this here.</p> <p>I am consuming a web service that returns a long string of XML values. Because this is a string all the attributes have escaped double quotes</p> <pre><code>string xmlSample = "&lt;root&gt;&lt;item att1=\"value\" att2=\"value2\" /&gt;&lt;/root&gt;" </...
[ { "answer_id": 285603, "author": "Markus Jarderot", "author_id": 22364, "author_profile": "https://Stackoverflow.com/users/22364", "pm_score": 2, "selected": false, "text": "\\ \\ \" Regex rgx = new Regex(\"\\\\\\\\\\\"\");\nstring strip = rgx.Replace(xmlSample, \"\\\"\");\n @ Regex rgx ...
2008/11/12
[ "https://Stackoverflow.com/questions/285579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30408/" ]
285,584
<p>I am currently stuck on an ASP.NET error when trying to access a .aspx page through localhost. This is the error:</p> <p><strong>OCIEnvCreate failed with return code -1 but error message text was not available.</strong></p> <p><strong>Description</strong>: An unhandled exception occurred during the execution of th...
[ { "answer_id": 36290730, "author": "AnisNoorAli", "author_id": 5977038, "author_profile": "https://Stackoverflow.com/users/5977038", "pm_score": 0, "selected": false, "text": "\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5 System.Data.OracleClient....
2008/11/12
[ "https://Stackoverflow.com/questions/285584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37140/" ]
285,586
<p>I have a script that constantly segfaults - the problem that I can't solve as segfault is in python libxml bindings - didn't write those. Ok, so in Linux I used to run an inf.loop so that when script dies - it restarts, like so:</p> <pre><code>#!/bin/bash while [ 1 ] do nice -n 19 python server.py sleep 1 done </co...
[ { "answer_id": 285609, "author": "David Thornley", "author_id": 14148, "author_profile": "https://Stackoverflow.com/users/14148", "pm_score": 1, "selected": false, "text": "type bash type bash type sh" }, { "answer_id": 285610, "author": "Evan Teran", "author_id": 13430, ...
2008/11/12
[ "https://Stackoverflow.com/questions/285586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37141/" ]
285,591
<p>Is it possible to use the __unused attribute macro on Objective-C object method parameters? I've tried placing it in various positions around the parameter declaration but it either causes a compilation error or seems to be ignored (i.e., the compiler still generates unused parameter warnings when compiling with -Wa...
[ { "answer_id": 285702, "author": "Louis Gerbarg", "author_id": 30506, "author_profile": "https://Stackoverflow.com/users/30506", "pm_score": 2, "selected": false, "text": "- (NSString *) test:(__unused NSString *)test {\n return nil;\n}\n Phoenix-VI:CouchPusher louis$ cc -c Pusher.m -...
2008/11/12
[ "https://Stackoverflow.com/questions/285591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34218/" ]
285,614
<p>Every night I need to trim back a table to only contain the latest 20,000 records. I could use a subquery:</p> <pre><code>delete from table WHERE id NOT IN (select TOP 20000 ID from table ORDER BY date_added DESC) </code></pre> <p>But that seems inefficient, especially if we later decide to keep 50,000 records. ...
[ { "answer_id": 285851, "author": "Borzio", "author_id": 36215, "author_profile": "https://Stackoverflow.com/users/36215", "pm_score": 2, "selected": false, "text": "select top 20000 * into #myTempTable from MyTable ORDER BY DateAdded DESC\n truncate table MyTable \n insert into MyTable s...
2008/11/12
[ "https://Stackoverflow.com/questions/285614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10876/" ]
285,617
<p>I'd like to call svn up from an asp.net page so people can hit the page to update a repository. (BTW: I'm using Beanstalk.com svn hosting which doesn't allow post-commit hooks, which is why I am doing it this way). </p> <p>See what I've got below. The process starts (it shows up in Processes in Task Manager) and ex...
[ { "answer_id": 286989, "author": "Bert Huijben", "author_id": 2094, "author_profile": "https://Stackoverflow.com/users/2094", "pm_score": 0, "selected": false, "text": "using(SvnClient client = new SvnClient())\n{\n client.Update(Request[\"path\"]);\n}\n" }, { "answer_id": 4943...
2008/11/12
[ "https://Stackoverflow.com/questions/285617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,618
<p>Another angle: how do I browse all the XUL for a given chrome path, e.g.</p> <p><a href="http://kb.mozillazine.org/Dev_:_Firefox_Chrome_URLs" rel="nofollow noreferrer">http://kb.mozillazine.org/Dev_:_Firefox_Chrome_URLs</a> has a listing but seems to be out of date.</p>
[ { "answer_id": 476769, "author": "Jason S", "author_id": 44330, "author_profile": "https://Stackoverflow.com/users/44330", "pm_score": 1, "selected": false, "text": "chrome:// {where you installed Firefox}/chrome/browser.jar\n {your profile directory}/extensions/{extension id}/chrome/con...
2008/11/12
[ "https://Stackoverflow.com/questions/285618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34594/" ]
285,619
<p>I have an input String say <code>Please go to http://stackoverflow.com</code>. The url part of the String is detected and an anchor <code>&lt;a href=""&gt;&lt;/a&gt;</code> is automatically added by many browser/IDE/applications. So it becomes <code>Please go to &lt;a href='http://stackoverflow.com'&gt;http://stacko...
[ { "answer_id": 285667, "author": "Jason Coco", "author_id": 34218, "author_profile": "https://Stackoverflow.com/users/34218", "pm_score": 3, "selected": false, "text": "String originalString = \"Please go to http://www.stackoverflow.com\";\nString newString = originalString.replaceAll(\"...
2008/11/12
[ "https://Stackoverflow.com/questions/285619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37144/" ]
285,649
<p>I have a web application that is using a data store that has it's own built in paging. The PagedResult class tells me the number of total pages. What I would like to do it (after binding my ASP.NET GridView) do this:</p> <pre><code>MyGridView.PageCount = thePageCount; </code></pre> <p>And then have the GridView ma...
[ { "answer_id": 1725048, "author": "Randi", "author_id": 209916, "author_profile": "https://Stackoverflow.com/users/209916", "pm_score": 0, "selected": false, "text": " Dim myCount as Integer = 1 'this sets the page count to 1 \n While (oreader.Read())\n myCount += ...
2008/11/12
[ "https://Stackoverflow.com/questions/285649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11917/" ]
285,658
<p>Is there a way in FreeBSD to (being root) run a command as unprivileged user, like nobody? Kind of like reverse of sudo. Oh and considering that 'nobody' has /usr/sbin/nologin as shell - so <b>su</b> is not an option.</p>
[ { "answer_id": 285693, "author": "DrStalker", "author_id": 17007, "author_profile": "https://Stackoverflow.com/users/17007", "pm_score": 6, "selected": true, "text": "sudo -u nobody <command>\n" }, { "answer_id": 3234272, "author": "Brad Ackerman", "author_id": 113222, ...
2008/11/12
[ "https://Stackoverflow.com/questions/285658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37141/" ]
285,660
<p>In Vim I can <code>:set wrapscan</code> so that when I do an incremental search, the cursor jumps to the first match whether the first match is above or below the cursor.</p> <p>In Emacs, if I start a search via <code>C-s</code>, the search fails saying <em>Failing I-search</em> if the first match is above the curs...
[ { "answer_id": 287067, "author": "link0ff", "author_id": 23952, "author_profile": "https://Stackoverflow.com/users/23952", "pm_score": 5, "selected": true, "text": "(defadvice isearch-repeat (after isearch-no-fail activate)\n (unless isearch-success\n (ad-disable-advice 'isearch-repe...
2008/11/12
[ "https://Stackoverflow.com/questions/285660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23070/" ]
285,662
<pre><code>some_var = foo() another_var = bar() </code></pre> <p>or</p> <pre><code>some_var = foo() another_var = bar() </code></pre> <p>Including changing the whitespace as lines are added or removed to keep them lined up. Does this really look good? Is it worth the mucking up of the diff?</p>
[ { "answer_id": 285678, "author": "Patrick Szalapski", "author_id": 7453, "author_profile": "https://Stackoverflow.com/users/7453", "pm_score": 1, "selected": false, "text": "some_var[ 1] = \"foo\";\nsome_var[100] = \"bar\";\n @some_var varchar(25) = NULL\n@another_var varchar(1000) = ''...
2008/11/12
[ "https://Stackoverflow.com/questions/285662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19687/" ]
285,666
<p>I need to know how to return a default row if no rows exist in a table. What would be the best way to do this? I'm only returning a single column from this particular table to get its value. </p> <p>Edit: This would be SQL Server. </p>
[ { "answer_id": 285699, "author": "Jason Anderson", "author_id": 1530166, "author_profile": "https://Stackoverflow.com/users/1530166", "pm_score": 1, "selected": false, "text": "select '' as columnA, '' as columnB, '' as columnC from #tempTable\n" }, { "answer_id": 285701, "au...
2008/11/12
[ "https://Stackoverflow.com/questions/285666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26923/" ]
285,674
<p>In firefox, the error messages display as should. Just to the right of the element being validated. In IE. No matter what I do with the sizing of the labels/elements/errors, the error is always posted below the element, causing every other element to be pushed down.</p> <pre><code>&lt;p&gt; &lt;label for="han...
[ { "answer_id": 285699, "author": "Jason Anderson", "author_id": 1530166, "author_profile": "https://Stackoverflow.com/users/1530166", "pm_score": 1, "selected": false, "text": "select '' as columnA, '' as columnB, '' as columnC from #tempTable\n" }, { "answer_id": 285701, "au...
2008/11/12
[ "https://Stackoverflow.com/questions/285674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26121/" ]
285,680
<p>I understand that BigDecimal is recommended best practice for representing monetary values in Java. What do you use? Is there a better library that you prefer to use instead?</p>
[ { "answer_id": 285707, "author": "ninesided", "author_id": 1030, "author_profile": "https://Stackoverflow.com/users/1030", "pm_score": 7, "selected": true, "text": "BigDecimal Cash Money BigDecimal BigDecimal.ROUND_HALF_EVEN BigDecimal" }, { "answer_id": 285709, "author": "Ke...
2008/11/12
[ "https://Stackoverflow.com/questions/285680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32595/" ]
285,685
<p>Here is a nice underhand lob pitch to you guys.</p> <p>So basically I've got my content table with unique primary key IDs and I've got my tag table with unique primary key IDs. </p> <p>I've got a table that has an identity column as a primary key but the two other columes are the contentID and tagID. What do I ne...
[ { "answer_id": 285697, "author": "John Lemp", "author_id": 12915, "author_profile": "https://Stackoverflow.com/users/12915", "pm_score": 2, "selected": false, "text": "ALTER TABLE ContentTag ADD CONSTRAINT\n IX_ContentID_TagID_Unique UNIQUE NONCLUSTERED ( contentID, tagID ) \nGO\n" ...
2008/11/12
[ "https://Stackoverflow.com/questions/285685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37154/" ]
285,687
<p>I would like to edit XHTML files using Emacs' <a href="http://www.emacswiki.org/emacs/NxmlMode" rel="nofollow noreferrer">nxml-mode</a> which can use <a href="http://infohost.nmt.edu/tcc/help/pubs/rnc/" rel="nofollow noreferrer">rnc</a> schemas for on the fly validation. This is all built in to newer Emacs versions....
[ { "answer_id": 285697, "author": "John Lemp", "author_id": 12915, "author_profile": "https://Stackoverflow.com/users/12915", "pm_score": 2, "selected": false, "text": "ALTER TABLE ContentTag ADD CONSTRAINT\n IX_ContentID_TagID_Unique UNIQUE NONCLUSTERED ( contentID, tagID ) \nGO\n" ...
2008/11/12
[ "https://Stackoverflow.com/questions/285687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,700
<p>i'm looking for a way to programatically convert word documents in docx format to doc format without using ole automation. i already have a windows service that does this but it means installing office on a server and it is a little unreliable and not supported. i am aware of the aspose.words product, and i will t...
[ { "answer_id": 320854, "author": "Dirk Vollmar", "author_id": 40347, "author_profile": "https://Stackoverflow.com/users/40347", "pm_score": 4, "selected": false, "text": "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Shared Tools\\Text Converters\\Import\\Word12 \n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3142/" ]
285,710
<p>Some of the platforms that I develop on, don't have profiling tools. I am looking for suggestions/techniques that you have personally used to help you identify hotspots, without the use of a profiler.</p> <p>The target language is C++.</p> <p>I am interested in what you have personally used.</p>
[ { "answer_id": 285926, "author": "Andreas Magnusson", "author_id": 5811, "author_profile": "https://Stackoverflow.com/users/5811", "pm_score": 4, "selected": true, "text": "#ifdef PROFILING\n# define PROFILE_CALL(x) do{ \\\n const DWORD t1 = timeGetTime(); \\\n x; \\\n const DWO...
2008/11/12
[ "https://Stackoverflow.com/questions/285710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7734/" ]
285,712
<p>I have a file (called "number.txt") which I want to read to an array in Java. How exactly do I go ahead and do this? It is a straight-forward "1-dimensional" file, containing 100 numbers.</p> <p>The problem is that I get an exception every time. Apparently it can't find it (I am sure its spelled correctly). When lo...
[ { "answer_id": 285745, "author": "toolkit", "author_id": 3295, "author_profile": "https://Stackoverflow.com/users/3295", "pm_score": 6, "selected": false, "text": "package com.acme;\n\nimport java.io.BufferedReader;\nimport java.io.FileReader;\nimport java.io.IOException;\nimport java.ut...
2008/11/12
[ "https://Stackoverflow.com/questions/285712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37161/" ]
285,715
<h2>Background</h2> <p>We are developing some in-house utilities using ASP.NET 2.0. One of which is extracting some information from databases and building an Excel workbook containing a number of spreadsheets with data based on queries into the database.</p> <h2>Problem</h2> <p>The proof-of-concept prototype (a sim...
[ { "answer_id": 285745, "author": "toolkit", "author_id": 3295, "author_profile": "https://Stackoverflow.com/users/3295", "pm_score": 6, "selected": false, "text": "package com.acme;\n\nimport java.io.BufferedReader;\nimport java.io.FileReader;\nimport java.io.IOException;\nimport java.ut...
2008/11/12
[ "https://Stackoverflow.com/questions/285715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23234/" ]
285,716
<p>I have written a program that gets input from a usb second keyboard (actually a barcode scanner). The problem is that if another window is active the data is input there rather than in my program. Could someone give me advice on what I'm doing wrong?</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;string.h&gt;...
[ { "answer_id": 21819422, "author": "admiralswan", "author_id": 3317403, "author_profile": "https://Stackoverflow.com/users/3317403", "pm_score": 2, "selected": false, "text": "xinput list HID Keyboard Device HID Keyboard Device id=13 [slave keyboard (3)] xinput float 13 SUBSYSTEM==\...
2008/11/12
[ "https://Stackoverflow.com/questions/285716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37163/" ]
285,717
<p>What's the best way to run scheduled tasks in a Rails environment? Script/runner? Rake? I would like to run the task every few minutes.</p>
[ { "answer_id": 287107, "author": "webmat", "author_id": 6349, "author_profile": "https://Stackoverflow.com/users/6349", "pm_score": 4, "selected": false, "text": "# from ~\n/path/to/ruby /path/to/app/script/runner -e development \"MyClass.class_method\"\n/path/to/ruby /path/to/rake -f /p...
2008/11/12
[ "https://Stackoverflow.com/questions/285717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13195/" ]
285,718
<p>I'm using MediaTemple's (dv) hosting service. How do I determine what mail-server is installed? Should I use the shell? If so, what command would be used?</p>
[ { "answer_id": 285739, "author": "Adam Pierce", "author_id": 5324, "author_profile": "https://Stackoverflow.com/users/5324", "pm_score": 4, "selected": false, "text": "telnet <hostname> 25\n 220 example.com ESMTP Exim 4.69 Thu, 13 Nov 2008 10:06:01 +1100\n dig -t MX example.com\n" }, ...
2008/11/12
[ "https://Stackoverflow.com/questions/285718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
285,723
<p>I'm a .NET developer, and worked with VB6 before that. I've become very familiar with those environments, and working in the context of garbage collected languages. However, I now wish to bolster my skillset with native C++ and find myself a bit overwhelmed. Ironically, it's not what I'd imagine is the usual stum...
[ { "answer_id": 285819, "author": "jalf", "author_id": 33213, "author_profile": "https://Stackoverflow.com/users/33213", "pm_score": 9, "selected": true, "text": "List<T> std::vector<T> void foo() {\n\n // declare a vector *without* using new. We want it allocated on the stack, not\n //...
2008/11/12
[ "https://Stackoverflow.com/questions/285723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5416/" ]
285,730
<p>I'm attempting to bind a <code>DependancyProperty</code> in one of my usercontrols to the <code>Width</code> property of a <code>Column</code> in a <code>Grid</code>. </p> <p>I have code similar to this:</p> <pre><code>&lt;Grid x:Name="MyGridName"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition...
[ { "answer_id": 286695, "author": "Ian Oakes", "author_id": 21606, "author_profile": "https://Stackoverflow.com/users/21606", "pm_score": 2, "selected": false, "text": "<ColumnDefinition \n x:Name=\"TitleSection\" \n Width=\"{Binding \n Path=TitleWidth, \n ...
2008/11/12
[ "https://Stackoverflow.com/questions/285730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31128/" ]
285,731
<p>I have two C DLLs that I need to access in the same executable. I have header files and .LIB files for both libraries. Unfortunately a subset of the functions that I need to access have the exact same names. The best solution I have been able to come up with so far is to use LoadLibrary to load one of the DLLs and e...
[ { "answer_id": 285758, "author": "Michael Burr", "author_id": 12711, "author_profile": "https://Stackoverflow.com/users/12711", "pm_score": 3, "selected": true, "text": "LoadLibrary()/GetProcAddress()" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/285731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37155/" ]
285,733
<p>I've tried the following, but I was unsuccessful:</p> <pre><code>ALTER TABLE person ALTER COLUMN dob POSITION 37; </code></pre>
[ { "answer_id": 285740, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 8, "selected": true, "text": "attnum pg_attribute VIEW" }, { "answer_id": 27886259, "author": "marcopolo", "author_id": 4442083, ...
2008/11/12
[ "https://Stackoverflow.com/questions/285733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10040/" ]
285,754
<p>So, let's say I want to write a class that operates on different kinds of numbers, but I don't a priori know what kind of numbers (i.e. ints, doubles, etc.) I will be operating on.</p> <p>I would like to use generics to create a general class for this scenario. Something like:</p> <pre><code> Adder&lt;Double&gt; ...
[ { "answer_id": 285773, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 4, "selected": true, "text": "Double double add(double, double) float add(float, fload) BigDecimal add(BigDecimal, BigDecimal)" }, { "answer_id": 2...
2008/11/12
[ "https://Stackoverflow.com/questions/285754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10675/" ]
285,760
<p>I need to spawn a child process that is a console application, and capture its output.</p> <p>I wrote up the following code for a method:</p> <pre><code>string retMessage = String.Empty; ProcessStartInfo startInfo = new ProcessStartInfo(); Process p = new Process(); startInfo.CreateNoWindow = true; startInfo.Redi...
[ { "answer_id": 285841, "author": "Judah Gabriel Himango", "author_id": 536, "author_profile": "https://Stackoverflow.com/users/536", "pm_score": 8, "selected": false, "text": "process.StartInfo.UseShellExecute = false;\nprocess.StartInfo.RedirectStandardOutput = true;\nprocess.OutputData...
2008/11/12
[ "https://Stackoverflow.com/questions/285760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]