qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
134,845
<p>The following are two methods of building a link that has the sole purpose of running JavaScript code. Which is better, in terms of functionality, page load speed, validation purposes, etc.?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false"> <div class="snippet-co...
[ { "answer_id": 134853, "author": "Adam Tuttle", "author_id": 751, "author_profile": "https://Stackoverflow.com/users/751", "pm_score": 8, "selected": false, "text": "'#' void(0) javascript:; javascript:void(0);" }, { "answer_id": 134865, "author": "Zach", "author_id": 912...
2008/09/25
[ "https://Stackoverflow.com/questions/134845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8018/" ]
134,858
<p>I have some code I've written in PHP for consuming our simple webservice, which I'd also like to provide in Perl for users who may prefer that language. What's the simplest method of making a HTTP request to do that? In PHP I can do it in one line with <code>file_get_contents()</code>.</p> <p>Here's the entire code...
[ { "answer_id": 134889, "author": "Kevin Crumley", "author_id": 1818, "author_profile": "https://Stackoverflow.com/users/1818", "pm_score": 7, "selected": true, "text": "use LWP::Simple;\n$contents = get(\"http://YOUR_URL_HERE\");\n" }, { "answer_id": 134911, "author": "Barry ...
2008/09/25
[ "https://Stackoverflow.com/questions/134858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14569/" ]
134,866
<p>I have a mindmp file from a target's application crash. Is it possible for me to rebuild the dll/pdb files for a version of software and have windbg load symbols correctly? </p> <p>My problem is that our pdb files are only kept for major releases (unfortunately). This is a daily build, which I can rebuild myself, b...
[ { "answer_id": 160818, "author": "SteveMan", "author_id": 5994, "author_profile": "https://Stackoverflow.com/users/5994", "pm_score": 4, "selected": false, "text": "chkmatch -m OriginalExecutable.exe RebuiltPDB.pdb\n" }, { "answer_id": 21099781, "author": "Dan K", "author...
2008/09/25
[ "https://Stackoverflow.com/questions/134866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8123/" ]
134,882
<p>How do I easily undo a git rebase? A lengthy manual method is:</p> <ol> <li>checkout the commit parent to both of the branches</li> <li>create and checkout a temporary branch</li> <li>cherry-pick all commits by hand</li> <li>reset the faulty rebased branch to point to the temporary branch</li> </ol> <p>In my current...
[ { "answer_id": 135614, "author": "CB Bailey", "author_id": 19563, "author_profile": "https://Stackoverflow.com/users/19563", "pm_score": 13, "selected": true, "text": "git reflog\n --hard HEAD@{2} git reset --hard HEAD@{2}\n git reset --hard \"HEAD@{2}\"\n git log HEAD@{2} git log \"HEAD...
2008/09/25
[ "https://Stackoverflow.com/questions/134882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6349/" ]
134,885
<p>I'm looking to use a VBScript variable within a reference to a DOM element for a web-app I'm building. Here's a brief excerpt of the affected area of code:</p> <pre><code>dim num num = CInt(document.myform.i.value) dim x x = 0 dim orders(num) For x = 0 To num orders(x) = document.getElementById("order" &amp; x...
[ { "answer_id": 134927, "author": "Dan Williams", "author_id": 4230, "author_profile": "https://Stackoverflow.com/users/4230", "pm_score": 0, "selected": false, "text": "orders(x) = document.getElementById(\"order\" & x).value\nobjFile.writeLine(orders(x))\n orders(x) = document.getElemen...
2008/09/25
[ "https://Stackoverflow.com/questions/134885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
134,887
<p>After making it through the major parts of an introductory Lisp book, I still couldn't understand what the special operator <code>(quote)</code> (or equivalent <code>'</code>) function does, yet this has been all over Lisp code that I've seen. </p> <p>What does it do?</p>
[ { "answer_id": 134908, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 6, "selected": false, "text": "(print '(+ 3 4)) (print (+ 3 4))" }, { "answer_id": 134924, "author": "Kyle Burton", "author_id": 19...
2008/09/25
[ "https://Stackoverflow.com/questions/134887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1256/" ]
134,905
<p>What is the best way to return XML from a controller's action in ASP.NET MVC? There is a nice way to return JSON, but not for XML. Do I really need to route the XML through a View, or should I do the not-best-practice way of Response.Write-ing it?</p>
[ { "answer_id": 134982, "author": "Luke Smith", "author_id": 5556, "author_profile": "https://Stackoverflow.com/users/5556", "pm_score": 8, "selected": true, "text": "public class XmlResult : ActionResult\n{\n private object objectToSerialize;\n\n /// <summary>\n /// Initializes ...
2008/09/25
[ "https://Stackoverflow.com/questions/134905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22299/" ]
134,906
<p>Is there a command or an existing script that will let me view all of a *NIX system's scheduled cron jobs at once? I'd like it to include all of the user crontabs, as well as <code>/etc/crontab</code>, and whatever's in <code>/etc/cron.d</code>. It would also be nice to see the specific commands run by <code>run-par...
[ { "answer_id": 134944, "author": "Kyle Burton", "author_id": 19784, "author_profile": "https://Stackoverflow.com/users/19784", "pm_score": 10, "selected": false, "text": "for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done\n echo $user for user in $(cut -f1 -d: /etc/pass...
2008/09/25
[ "https://Stackoverflow.com/questions/134906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726/" ]
134,917
<p>We will need to call out to a 3rd party to retrieve a value using REST, however if we do not receive a response within 10ms, I want to use a default value and continue processing.</p> <p>I'm leaning towards using an asynchronous WebRequest do to this, but I was wondering if there was a trick to doing it using a syn...
[ { "answer_id": 135004, "author": "Philip Rieck", "author_id": 12643, "author_profile": "https://Stackoverflow.com/users/12643", "pm_score": 2, "selected": false, "text": "WebRequest request = WebRequest.Create(\"http://something.somewhere/url\");\nWebResponse response = null;\nrequest.Ti...
2008/09/25
[ "https://Stackoverflow.com/questions/134917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
134,934
<p>How do I display a leading zero for all numbers with less than two digits?</p> <pre class="lang-none prettyprint-override"><code>1 → 01 10 → 10 100 → 100 </code></pre>
[ { "answer_id": 134942, "author": "nosklo", "author_id": 17160, "author_profile": "https://Stackoverflow.com/users/17160", "pm_score": 6, "selected": false, "text": "x = [1, 10, 100]\nfor i in x:\n print '%02d' % i\n 01\n10\n100\n" }, { "answer_id": 134951, "author": "Jack ...
2008/09/25
[ "https://Stackoverflow.com/questions/134934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22306/" ]
134,956
<p>Is it even possible to perform address (physical, not e-mail) validation? It seems like the sheer number of address formats, even in the US alone, would make this a fairly difficult task. On the other hand it seems like a task that would be necessary for several business requirements.</p>
[ { "answer_id": 13351246, "author": "Xeoncross", "author_id": 99923, "author_profile": "https://Stackoverflow.com/users/99923", "pm_score": 1, "selected": false, "text": "$address = urlencode('1600 Pennsylvania Avenue, Washington, DC');\n$json = json_decode(file_get_contents(\"http://wher...
2008/09/25
[ "https://Stackoverflow.com/questions/134956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
134,958
<p>How would I be able to get N results for several groups in an oracle query.</p> <p>For example, given the following table:</p> <pre><code>|--------+------------+------------| | emp_id | name | occupation | |--------+------------+------------| | 1 | John Smith | Accountant | | 2 | Jane Doe | Engin...
[ { "answer_id": 135046, "author": "billjamesdev", "author_id": 13824, "author_profile": "https://Stackoverflow.com/users/13824", "pm_score": 1, "selected": false, "text": "select *\nfrom people p1\n join people p2\n on p1.occupation = p2.occupation\n join people p3\n o...
2008/09/25
[ "https://Stackoverflow.com/questions/134958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9435/" ]
134,962
<p>I've been trying this a couple of different ways, but it's not working for some reason. Is it even possible?</p>
[ { "answer_id": 39594411, "author": "Richard", "author_id": 269537, "author_profile": "https://Stackoverflow.com/users/269537", "pm_score": 0, "selected": false, "text": "GetVaryByCustomString(HttpContext context, string custom) custom VaryByCustom <%@ OutputCache Duration=\"86400\" VaryB...
2008/09/25
[ "https://Stackoverflow.com/questions/134962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5469/" ]
134,969
<p>In Ruby, is there the equivalent of the <code>__str__()</code> method that you can define on Python classes? </p>
[ { "answer_id": 134978, "author": "Kyle Burton", "author_id": 19784, "author_profile": "https://Stackoverflow.com/users/19784", "pm_score": 3, "selected": false, "text": "irb(main):001:0> puts \"array is: #{[1,2,3].inspect}\"\narray is: [1, 2, 3]\n=> nil\nirb(main):002:0> puts \"array is:...
2008/09/25
[ "https://Stackoverflow.com/questions/134969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
134,988
<ol> <li>Is it possible to secure only the Login.aspx page (and the postback) and not the whole site in IIS?</li> <li>We are looking to do this specifically with a SharePoint site running Forms Based Authentication against our Active Directory.</li> <li>Links to this will be helpful.</li> </ol> <p>This is what we have...
[ { "answer_id": 153918, "author": "Abs", "author_id": 1245, "author_profile": "https://Stackoverflow.com/users/1245", "pm_score": 0, "selected": false, "text": "/_layouts Properties File Security Edit... Secure communications Require secure channel (SSL)" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/134988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21586/" ]
135,000
<p>When generating XML from XmlDocument in .NET, a blank <code>xmlns</code> attribute appears the first time an element <em>without</em> an associated namespace is inserted; how can this be prevented?</p> <p>Example:</p> <pre><code>XmlDocument xml = new XmlDocument(); xml.AppendChild(xml.CreateElement("root", "wh...
[ { "answer_id": 135027, "author": "JeniT", "author_id": 6739, "author_profile": "https://Stackoverflow.com/users/6739", "pm_score": 4, "selected": false, "text": "<loner> xmlns whatever:name-space-1.0 xml.CreateElement(\"loner\", \"whatever:name-space-1.0\")\n <loner> xmlns" }, { ...
2008/09/25
[ "https://Stackoverflow.com/questions/135000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9642/" ]
135,010
<p>I have a problem with stopping a service and starting it again and want to be notified when the process runs and let me know what the result is. </p> <p>Here's the scenario, I have a text file output of an "sc" command. I want to send that file but not as an attachment. Also, I want to see the initial status quic...
[ { "answer_id": 135027, "author": "JeniT", "author_id": 6739, "author_profile": "https://Stackoverflow.com/users/6739", "pm_score": 4, "selected": false, "text": "<loner> xmlns whatever:name-space-1.0 xml.CreateElement(\"loner\", \"whatever:name-space-1.0\")\n <loner> xmlns" }, { ...
2008/09/25
[ "https://Stackoverflow.com/questions/135010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/730/" ]
135,020
<p>When creating a class that has internal private methods, usually to reduce code duplication, that don't require the use of any instance fields, are there performance or memory advantages to declaring the method as static?</p> <p>Example:</p> <pre><code>foreach (XmlElement element in xmlDoc.DocumentElement.SelectNo...
[ { "answer_id": 135023, "author": "Kent Boogaart", "author_id": 5380, "author_profile": "https://Stackoverflow.com/users/5380", "pm_score": 4, "selected": false, "text": "this static" }, { "answer_id": 36888316, "author": "sara", "author_id": 2622234, "author_profile":...
2008/09/25
[ "https://Stackoverflow.com/questions/135020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6146/" ]
135,035
<p>In ruby the library path is provided in <code>$:</code>, in perl it's in <code>@INC</code> - how do you get the list of paths that Python searches for modules when you do an import?</p>
[ { "answer_id": 135050, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 3, "selected": false, "text": "import sys\nsys.path\n" }, { "answer_id": 135051, "author": "Jack M.", "author_id": 3421, "author_...
2008/09/25
[ "https://Stackoverflow.com/questions/135035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19784/" ]
135,041
<p>Why or why not?</p>
[ { "answer_id": 135070, "author": "Dan Udey", "author_id": 21450, "author_profile": "https://Stackoverflow.com/users/21450", "pm_score": 4, "selected": false, "text": "xrange() xrange()" }, { "answer_id": 135074, "author": "Thomas Wouters", "author_id": 17624, "author_...
2008/09/25
[ "https://Stackoverflow.com/questions/135041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18446/" ]
135,057
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/574463">Running Internet Explorer 6, Internet Explorer 7, and Internet Explorer 8 on the same machine</a> </p> </blockquote> <p>Is there a way to have Internet Explorer 8 and Internet Explorer 6 side by side wi...
[ { "answer_id": 179126, "author": "Carl Camera", "author_id": 12804, "author_profile": "https://Stackoverflow.com/users/12804", "pm_score": 4, "selected": false, "text": "mshtml.dll" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13275/" ]
135,069
<p>This may be a matter of style, but there's a bit of a divide in our dev team and I wondered if anyone else had any ideas on the matter...</p> <p>Basically, we have some debug print statements which we turn off during normal development. Personally I prefer to do the following:</p> <pre><code>//---- SomeSourceFile....
[ { "answer_id": 135077, "author": "Martin Beckett", "author_id": 10897, "author_profile": "https://Stackoverflow.com/users/10897", "pm_score": 3, "selected": false, "text": "#if #define DEBUG 1" }, { "answer_id": 135089, "author": "Jim Buck", "author_id": 2666, "author...
2008/09/25
[ "https://Stackoverflow.com/questions/135069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15369/" ]
135,076
<p>I am <strong>losing hair</strong> on this one ... it seems that when I fix width an HTML SELECT control it renders its width differently depending on the browser. </p> <p>Any idea how to to standardize this without having to turn to multiple style sheets?</p> <p>Here is what I am working with:</p> <pre><code>.co...
[ { "answer_id": 135085, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 2, "selected": false, "text": "font-size min-width max-width" }, { "answer_id": 135764, "author": "mattruma", "author_id": 1768, ...
2008/09/25
[ "https://Stackoverflow.com/questions/135076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768/" ]
135,105
<p>We'd like to override DataGridView's default behavior when using a mouse wheel with this control. By default, the DataGridView scrolls a number of rows equal the SystemInformation.MouseWheelScrollLines setting. What we'd like to do is scroll just one item at a time. </p> <p>(We display images in the DataGridView...
[ { "answer_id": 135516, "author": "ZeroBugBounce", "author_id": 11314, "author_profile": "https://Stackoverflow.com/users/11314", "pm_score": 1, "selected": false, "text": "public partial class MyDataGridView : DataGridView\n protected override void WndProc(ref Message m)\n{\n if (m.Ms...
2008/09/25
[ "https://Stackoverflow.com/questions/135105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7357/" ]
135,121
<p>So in my documentation it says:</p> <blockquote> <p>public event TreeViewPlusNodeCheckedEventHandler NodeChecked()</p> <p>You can use this event to run cause a method to run whenever the check-box for a node is checked on the tree.</p> </blockquote> <p>So how do I add a method to my code behind file that ...
[ { "answer_id": 135138, "author": "Max Schmeling", "author_id": 3226, "author_profile": "https://Stackoverflow.com/users/3226", "pm_score": 2, "selected": false, "text": "myTreeView.NodeChecked += new TreeViewPlusNodeCheckedEventHandler(TOCNodeCheckedServer);\n myTreeView.NodeChecked += T...
2008/09/25
[ "https://Stackoverflow.com/questions/135121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5234/" ]
135,129
<p>I seem to be seeing more 'for' loops over iterators in questions &amp; answers here than I do for_each(), transform(), and the like. Scott Meyers suggests that <a href="http://www.ddj.com/cpp/184401446" rel="noreferrer">stl algorithms are preferred</a>, or at least he did in 2001. Of course, using them often means...
[ { "answer_id": 135196, "author": "Maximilian", "author_id": 1733, "author_profile": "https://Stackoverflow.com/users/1733", "pm_score": 2, "selected": false, "text": "for (int i = 0; i < some_vector.size(); i++)\n if (some_vector[i] == NULL) some_other_vector[i]++;\n" }, { "an...
2008/09/25
[ "https://Stackoverflow.com/questions/135129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10077/" ]
135,132
<p>I'm really baffled by this - I know how to do this in VB, unmanaged C++ and C# but for some reason I can't accept a ref variable of a managed type in C++. I'm sure there's a simple answer, really - but here's the C# equivalent:</p> <pre><code>myClass.myFunction(ref variableChangedByfunction); </code></pre> <p>I've...
[ { "answer_id": 2280477, "author": "rotti2", "author_id": 207620, "author_profile": "https://Stackoverflow.com/users/207620", "pm_score": 1, "selected": false, "text": "^ ref out %" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
135,149
<p>I'm trying to confirm a user a unplugged my embedded device from a network before performing some maintenance. I'm considering "ping"ing all IP address on my sub-net, but that sounds crude. Is there a broadcast/ARP method that might work better?</p>
[ { "answer_id": 135172, "author": "bmdhacks", "author_id": 14032, "author_profile": "https://Stackoverflow.com/users/14032", "pm_score": 2, "selected": false, "text": "ping -b 255.255.255.255\n" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15797/" ]
135,151
<p>The .NET web system I'm working on allows the end user to input HTML formatted text in some situations. In some of those places, we want to leave all the tags, but strip off any trailing break tags (but leave any breaks inside the body of the text.)</p> <p>What's the best way to do this? (I can think of ways to d...
[ { "answer_id": 135165, "author": "Max Schmeling", "author_id": 3226, "author_profile": "https://Stackoverflow.com/users/3226", "pm_score": 2, "selected": false, "text": "while (myHtmlString.EndsWith(\"<br>\"))\n{\n myHtmlString = myHtmlString.SubString(0, myHtmlString.Length - 4);\n}\...
2008/09/25
[ "https://Stackoverflow.com/questions/135151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19074/" ]
135,173
<p>I have a table that holds only two columns - a ListID and PersonID. When a person is merged with another in the system, I was to update all references from the "source" person to be references to the "destination" person.</p> <p>Ideally, I would like to call something simple like</p> <pre><code>UPDATE MailingList...
[ { "answer_id": 135252, "author": "Amy B", "author_id": 8155, "author_profile": "https://Stackoverflow.com/users/8155", "pm_score": 3, "selected": true, "text": "--out with the bad\nDELETE\nFROM MailingListSubscription\nWHERE PersonId = @SourcePerson\n and ListID in (SELECT ListID FROM M...
2008/09/25
[ "https://Stackoverflow.com/questions/135173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3259/" ]
135,186
<p>I have a project at work the requires me to be able to enter information into a web page, read the next page I get redirected to and then take further action. A simplified real-world example would be something like going to google.com, entering "Coding tricks" as search criteria, and reading the resulting page.</p>...
[ { "answer_id": 135460, "author": "Chris Lawlor", "author_id": 21245, "author_profile": "https://Stackoverflow.com/users/21245", "pm_score": 3, "selected": false, "text": " string uri = \"http://www.google.com/search\";\n HttpWebRequest request = (HttpWebRequest)WebRequest.Create(u...
2008/09/25
[ "https://Stackoverflow.com/questions/135186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
135,203
<p>I have always wondered WHaT tHE <em>HecK?!?</em> is the difference between JScript and JavaScript.</p>
[ { "answer_id": 35795222, "author": "Shiraz", "author_id": 422663, "author_profile": "https://Stackoverflow.com/users/422663", "pm_score": 2, "selected": false, "text": "\"string\".substr(-1) \"string\".substr(-1) \"string\"[0] \"string\"[0]" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3208/" ]
135,234
<p>What is the difference between <code>ref</code> and <code>out</code> parameters in .NET? What are the situations where one can be more useful than the other? What would be a code snippet where one can be used and another can't?</p>
[ { "answer_id": 135255, "author": "bdukes", "author_id": 2688, "author_profile": "https://Stackoverflow.com/users/2688", "pm_score": 1, "selected": false, "text": "out ref out ref" }, { "answer_id": 135257, "author": "Khoth", "author_id": 20686, "author_profile": "http...
2008/09/25
[ "https://Stackoverflow.com/questions/135234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1909/" ]
135,243
<p>Haven't done ASP.NET development since VS 2003, so I'd like to save some time and learn from other's mistakes.</p> <p>Writing a web services app, but not a WSDL/SOAP/etc. -- more like REST + XML. </p> <p>Which of the many "New Item" options (Web Form, Generic Handler, ASP.NET Handler, etc.) makes the most sense i...
[ { "answer_id": 135467, "author": "NerdFury", "author_id": 6146, "author_profile": "https://Stackoverflow.com/users/6146", "pm_score": 1, "selected": false, "text": "public enum HttpVerb\n{\n GET, POST, PUT, DELETE\n}\n [AttributeUsage(AttributeTargets.Method, AllowMultiple=false, Inhe...
2008/09/25
[ "https://Stackoverflow.com/questions/135243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
135,246
<p>I'm attempting to write a Python C extension that reads packed binary data (it is stored as structs of structs) and then parses it out into Python objects. Everything works as expected on a 32 bit machine (the binary files are always written on 32bit architecture), but not on a 64 bit box. Is there a "preferred" ...
[ { "answer_id": 135267, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 1, "selected": false, "text": "int32_t int" }, { "answer_id": 135311, "author": "Dan Udey", "author_id": 21450, "author_profile":...
2008/09/25
[ "https://Stackoverflow.com/questions/135246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16363/" ]
135,262
<p>I'm programming in C for RAM limited embedded microcontroller with RTOS.</p> <p>I regularly break my code to short functions, but every function calling require to more stack memory. Every task needs his stack, and this is one of the significant memory consumers in the project.</p> <p>Is there an alternative to ke...
[ { "answer_id": 135282, "author": "Derek Park", "author_id": 872, "author_profile": "https://Stackoverflow.com/users/872", "pm_score": 3, "selected": false, "text": "inline" }, { "answer_id": 135294, "author": "John Millikin", "author_id": 3560, "author_profile": "http...
2008/09/25
[ "https://Stackoverflow.com/questions/135262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22249/" ]
135,296
<p>I frequently come across Windows programs that bundle in MSVCRT (or their more current equivalents) with the program executables. On a typical PC, I would find many copies of the same .DLL's. My understanding is that MSVCRT is the C runtime library, somewhat analogous to glibc/libc.so under *nix.</p> <p>Why do Wi...
[ { "answer_id": 6442130, "author": "cHao", "author_id": 319403, "author_profile": "https://Stackoverflow.com/users/319403", "pm_score": 4, "selected": false, "text": "kernel32" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22329/" ]
135,303
<p>In C# I could easily write the following:</p> <pre><code>string stringValue = string.IsNullOrEmpty( otherString ) ? defaultString : otherString; </code></pre> <p>Is there a quick way of doing the same thing in Python or am I stuck with an 'if' statement?</p>
[ { "answer_id": 135318, "author": "Thomas Wouters", "author_id": 17624, "author_profile": "https://Stackoverflow.com/users/17624", "pm_score": 6, "selected": true, "text": "A if C else B\n stringValue = otherString or defaultString\n" }, { "answer_id": 135342, "author": "Dan U...
2008/09/25
[ "https://Stackoverflow.com/questions/135303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20133/" ]
135,314
<p>What is the fastest list implementation (in java) in a scenario where the list will be created one element at a time then at a later point be read one element at a time? The reads will be done with an iterator and then the list will then be destroyed.<br> I know that the Big O notation for get is O(1) and add is O(1...
[ { "answer_id": 135358, "author": "Daniel Spiewak", "author_id": 9815, "author_profile": "https://Stackoverflow.com/users/9815", "pm_score": 3, "selected": false, "text": "LinkedList List<Object> list = new LinkedList<Object>();\nfor (int i = 0; i < list.size(); i++) {\n list.get(i);\n...
2008/09/25
[ "https://Stackoverflow.com/questions/135314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13491/" ]
135,317
<p>When running a CherryPy app it will send server name tag something like CherryPy/version. Is it possible to rename/overwrite that from the app without modifying CherryPy so it will show something else? </p> <p>Maybe something like MyAppName/version (CherryPy/version) </p>
[ { "answer_id": 135644, "author": "Jay", "author_id": 20840, "author_profile": "https://Stackoverflow.com/users/20840", "pm_score": 2, "selected": false, "text": "def __init__(self):\n self.status = None\n self.header_list = None\n self._body = []\n self.time = time.time()\n\n self.h...
2008/09/25
[ "https://Stackoverflow.com/questions/135317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9789/" ]
135,330
<p>Does anybody know if there is a built-in function in Mathematica for getting the lhs of downvalue rules (without any holding)? I know how to write the code to do it, but it seems basic enough for a built-in</p> <p>For example:</p> <pre><code>a[1]=2; a[2]=3; </code></pre> <p><code>BuiltInIDoNotKnowOf[a]</code> re...
[ { "answer_id": 138033, "author": "Will Robertson", "author_id": 4161, "author_profile": "https://Stackoverflow.com/users/4161", "pm_score": 4, "selected": true, "text": "a[1] = 2\na[2] = 3\na[3] = 5\na[6] = 8\nPart[DownValues[a], All, 1, 1, 1]\n" }, { "answer_id": 154704, "au...
2008/09/25
[ "https://Stackoverflow.com/questions/135330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/279/" ]
135,339
<p>Within an n-tier app that makes use of a WCF service to interact with the database, what is the best practice way of making use of LinqToSql classes throughout the app?</p> <p>I've seen it done a couple of different ways but they seemed like they burned a lot of hours creating extra interfaces, message classes, and...
[ { "answer_id": 138033, "author": "Will Robertson", "author_id": 4161, "author_profile": "https://Stackoverflow.com/users/4161", "pm_score": 4, "selected": true, "text": "a[1] = 2\na[2] = 3\na[3] = 5\na[6] = 8\nPart[DownValues[a], All, 1, 1, 1]\n" }, { "answer_id": 154704, "au...
2008/09/25
[ "https://Stackoverflow.com/questions/135339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1860358/" ]
135,347
<p>When should you NOT use a singleton class although it might be very tempting to do so? It would be very nice if we had a list of most common instances of 'singletonitis' that we should take care to avoid.</p>
[ { "answer_id": 135389, "author": "Doug T.", "author_id": 8123, "author_profile": "https://Stackoverflow.com/users/8123", "pm_score": 0, "selected": false, "text": "// Its our database! We'll never need another\nclass Database\n{\n};\n Database ourDb;\nDatabase otherDb;\n // Copy-pasted f...
2008/09/25
[ "https://Stackoverflow.com/questions/135347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1909/" ]
135,373
<p>I've always struggled with how to best include classes into my php code. Pathing is usually an issue but a few minutes ago i found <a href="https://stackoverflow.com/questions/4369/how-to-include-php-files-that-require-an-absolute-path">this question</a> which dramatically helps that. Now I'm reading about __autoloa...
[ { "answer_id": 135867, "author": "Mez", "author_id": 20010, "author_profile": "https://Stackoverflow.com/users/20010", "pm_score": 1, "selected": false, "text": "function __autoload($classname)\n{\n try\n {\n if (class_exists($classname, false) OR interface_exists($classname...
2008/09/25
[ "https://Stackoverflow.com/questions/135373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7018/" ]
135,375
<p>I have a <code>ListBox</code> <code>DataTemplate</code> in WPF. I want one item to be tight against the left side of the <code>ListBox</code> and another item to be tight against the right side, but I can't figure out how to do this.</p> <p>So far I have a <code>Grid</code> with three columns, the left and right on...
[ { "answer_id": 135741, "author": "Joel B Fant", "author_id": 22211, "author_profile": "https://Stackoverflow.com/users/22211", "pm_score": 1, "selected": false, "text": "Grid ListBox ItemsPanel VirtualizingStackPanel ListBox.ItemsPanel ColumnDefinition \"*\" HorizontalAlignment=\"Left\" ...
2008/09/25
[ "https://Stackoverflow.com/questions/135375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/100/" ]
135,412
<p>I need to build a prototype for an intranet website, and I want to focus on usability (layout, navigability, etc) and leave the theme for later (I have very bad taste, so this will probably be done by someone else)</p> <p>I know about ASP.NET's capability of switching themes instantly, but how do I have to design t...
[ { "answer_id": 136239, "author": "Herb Caudill", "author_id": 239663, "author_profile": "https://Stackoverflow.com/users/239663", "pm_score": 2, "selected": false, "text": " <div class=\"ButtonContainer\">\n <asp:linkbutton runat=\"Server\" cssclass=\"Button Cancel\" command=\"...
2008/09/25
[ "https://Stackoverflow.com/questions/135412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1782/" ]
135,443
<p>There are a group of private methods in my class, and I need to call one dynamically based on an input value. Both the invoking code and the target methods are in the same instance. The code looks like this:</p> <pre><code>MethodInfo dynMethod = this.GetType().GetMethod("Draw_" + itemType); dynMethod.Invoke(this, n...
[ { "answer_id": 135455, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 2, "selected": false, "text": "BindingFlags.NonPublic GetMethod" }, { "answer_id": 135482, "author": "wprl", "author_id": 17847, ...
2008/09/25
[ "https://Stackoverflow.com/questions/135443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8223/" ]
135,445
<p>I tried to use DriveInfo.IsReady, but it returns false if an unformatted floppy is in the drive.</p>
[ { "answer_id": 135763, "author": "Jonas Engström", "author_id": 7634, "author_profile": "https://Stackoverflow.com/users/7634", "pm_score": 3, "selected": true, "text": "SetLastError(0);\nHANDLE h = CreateFile(\"\\\\\\\\.\\\\A:\", ...);\nif (!ReadFile(h, buf, 512, &bytes_read, 0))\n{\n ...
2008/09/25
[ "https://Stackoverflow.com/questions/135445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
135,448
<p>How do I check if an object has a specific property in JavaScript?</p> <p>Consider:</p> <pre><code>x = {'key': 1}; if ( x.hasOwnProperty('key') ) { //Do this } </code></pre> <p>Is that the best way to do it?</p>
[ { "answer_id": 135466, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 4, "selected": false, "text": "Object.prototype.hasOwnProperty.call(x, 'key') x hasOwnProperty typeof x.foo != 'undefined'" }, { "answer_i...
2008/09/25
[ "https://Stackoverflow.com/questions/135448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4915/" ]
135,451
<p>I want to create a list of methods to execute. Each method has the same signature. I thought about putting delegates in a generic collection, but I keep getting this error:</p> <blockquote> <p>'method' is a 'variable' but is used like a 'method'</p> </blockquote> <p>In theory, here is what I would like to do:</...
[ { "answer_id": 135453, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 0, "selected": false, "text": "class Example\n{\n public delegate int AddDelegate(int x, int y);\n\n public List<AddDelegate> methods = new Lis...
2008/09/25
[ "https://Stackoverflow.com/questions/135451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8797/" ]
135,458
<p>Suppose I have the following code:</p> <pre><code>while(TRUE) { pthread_t *thread = (pthread_t *) malloc(sizeof(pthread_t)); pthread_create(thread, NULL, someFunction, someArgument); pthread_detach(*thread); sleep(10); } </code></pre> <p>Will the detached thread free the memory allocated by malloc, or is t...
[ { "answer_id": 135922, "author": "Commodore Jaeger", "author_id": 4659, "author_profile": "https://Stackoverflow.com/users/4659", "pm_score": 4, "selected": true, "text": "pthread_t thread;\npthread_create(&thread, NULL, someFunction, someArgument);\n" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/542226/" ]
135,474
<p>For example:</p> <pre><code>char * myString = malloc(sizeof(char)*STRING_BUFFER_SIZE); free(myString); free(myString); </code></pre> <p>Are there any adverse side effects of doing this? </p>
[ { "answer_id": 135486, "author": "Khoth", "author_id": 20686, "author_profile": "https://Stackoverflow.com/users/20686", "pm_score": 2, "selected": false, "text": "free" }, { "answer_id": 135492, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https...
2008/09/25
[ "https://Stackoverflow.com/questions/135474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2064/" ]
135,478
<p>I have an ASP.NET web service which does some heavy lifting, like say,some file operations, or generating Excel Sheets from a bunch of crystal reports. I don't want to be blocked by calling this web service, so i want to make the web service call asynchronous. Also, I want to call this web service from a web page, a...
[ { "answer_id": 135502, "author": "Dan Udey", "author_id": 21450, "author_profile": "https://Stackoverflow.com/users/21450", "pm_score": 3, "selected": true, "text": "http://yourserver.com/app/jobstatus/4133/ text/plain" }, { "answer_id": 135592, "author": "Carra", "author...
2008/09/25
[ "https://Stackoverflow.com/questions/135478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1909/" ]
135,518
<p>In WPF, we are creating custom controls that inherit from button with completely drawn-from-scratch xaml graphics. We have a border around the entire button xaml and we'd like to use that as the location for updating the background when MouseOver=True in a trigger. What we need to know is how do we update the back...
[ { "answer_id": 135638, "author": "Joel B Fant", "author_id": 22211, "author_profile": "https://Stackoverflow.com/users/22211", "pm_score": 3, "selected": true, "text": "ControlTemplate Border Name Button <Style\n TargetType=\"{x:Type Button}\">\n <Setter\n Property=\"Templat...
2008/09/25
[ "https://Stackoverflow.com/questions/135518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21096/" ]
135,530
<p>I have an index on columns A, B, C, D of table T</p> <p>I have a query that pulls from T with A, B, C in the WHERE clause.</p> <p>Will the index be used or will a separate index be needed that only includes A, B, C?</p>
[ { "answer_id": 135570, "author": "Amy B", "author_id": 8155, "author_profile": "https://Stackoverflow.com/users/8155", "pm_score": 3, "selected": false, "text": "WHERE A like '%x%'\n and B = 1\n and C = 1\n//\nWHERE A = 1\n OR B = 1\n OR C = 1\n//\nWHERE DateAdd(dd, 1, A) = '2008-01-...
2008/09/25
[ "https://Stackoverflow.com/questions/135530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11780/" ]
135,535
<p>I'm a PHPer, and am not writing object-oriented code.</p> <p>What are the advantages of OO over procedural code, and where can I learn how to apply these ideas to PHP?</p>
[ { "answer_id": 135656, "author": "Dan Udey", "author_id": 21450, "author_profile": "https://Stackoverflow.com/users/21450", "pm_score": 3, "selected": false, "text": "Poll::Display()" }, { "answer_id": 135805, "author": "moffdub", "author_id": 10759, "author_profile":...
2008/09/25
[ "https://Stackoverflow.com/questions/135535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16511/" ]
135,573
<p>I have a project containing at least one DLL along with the executable output. I have added a Deployment Project to this solution, which asked me for a name and working directory upon creation like all projects.</p> <p>I named this "MyProduc_Installer" and have been able to modify all aspects of the installation p...
[ { "answer_id": 5468352, "author": "CooPzZ", "author_id": 323806, "author_profile": "https://Stackoverflow.com/users/323806", "pm_score": 0, "selected": false, "text": "<ProductName>xyz wrong name</ProductName>" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/414107/" ]
135,591
<p>I've seen several products that will track the sales rank of an item on Amazon. Does Amazon have any web-services published that I can use to get the sales rank of a particular item? </p> <p>I've looked through the AWS and didn't see anything of that nature.</p>
[ { "answer_id": 135627, "author": "Adam Hughes", "author_id": 3863, "author_profile": "https://Stackoverflow.com/users/3863", "pm_score": 4, "selected": true, "text": "http://ecs.amazonaws.com/onca/xml?\nService=AWSECommerceService&\nAWSAccessKeyId=[AWS Access Key ID]&\nOperation=ItemLook...
2008/09/25
[ "https://Stackoverflow.com/questions/135591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4244/" ]
135,600
<p>When I download my program from my website to my windows 2003 machine, it has a block on it and you have to right click on the exe, then properties, then select the button "Unblock".</p> <p>I would like to add detection in my installer for when the file is blocked and hence doesn't have enough permissions. </p> <...
[ { "answer_id": 135924, "author": "HitScan", "author_id": 9490, "author_profile": "https://Stackoverflow.com/users/9490", "pm_score": 5, "selected": true, "text": "[ZoneTransfer]\nZoneId=3\n [ZoneTransfer]\nZoneId=3\n more Zone.Identifier.txt > file.exe:Zone.Identifier\n" }, { "an...
2008/09/25
[ "https://Stackoverflow.com/questions/135600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
135,634
<p>In the (otherwise) excellent book <a href="http://www.gotw.ca/publications/c++cs.htm" rel="nofollow noreferrer">C++ Coding Standards</a>, Item 44, titled <strong>"Prefer writing nonmember nonfriend functions"</strong>, Sutter and Alexandrescu recommend that only functions that really need access to the members of a ...
[ { "answer_id": 135684, "author": "Derek Park", "author_id": 872, "author_profile": "https://Stackoverflow.com/users/872", "pm_score": 3, "selected": true, "text": "foo() Bar foo() bar() foo() Bar Bar" }, { "answer_id": 135712, "author": "Lou Franco", "author_id": 3937, ...
2008/09/25
[ "https://Stackoverflow.com/questions/135634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2095/" ]
135,653
<p>I have some tables that I build as a part of my report rollup. I don't need them afterwards at all. Someone mentioned to truncate them as it would be faster. </p>
[ { "answer_id": 2591131, "author": "Sasikiran", "author_id": 310790, "author_profile": "https://Stackoverflow.com/users/310790", "pm_score": 1, "selected": false, "text": "DELETE TRUNCATE TABLE WHERE DELETE TRUNCATE DELETE TRUNCATE TABLE DELETE TRUNCATE TABLE DELETE RESEED TRUNCATE RESEED...
2008/09/25
[ "https://Stackoverflow.com/questions/135653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3208/" ]
135,661
<p>Let's collect some tips for evaluating the appropriate use of global.asax.</p>
[ { "answer_id": 850158, "author": "Slim", "author_id": 29774, "author_profile": "https://Stackoverflow.com/users/29774", "pm_score": 0, "selected": false, "text": "Session_Start" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337/" ]
135,664
<p>For example, how much memory is required to store a list of one million (32-bit) integers?</p> <pre><code>alist = range(1000000) # or list(range(1000000)) in Python 3.0 </code></pre>
[ { "answer_id": 135718, "author": "Dan Lenski", "author_id": 20789, "author_profile": "https://Stackoverflow.com/users/20789", "pm_score": 5, "selected": false, "text": "array" }, { "answer_id": 136083, "author": "jfs", "author_id": 4279, "author_profile": "https://Sta...
2008/09/25
[ "https://Stackoverflow.com/questions/135664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4279/" ]
135,670
<p>This post is similar to <a href="https://stackoverflow.com/questions/16829/structure-of-projects-in-version-control">this previously asked question.</a> I really want to set up my SVN repository in TTB format, but when creating a project in Visual Studio 2008 (ASP.NET/VB.NET), the structure created tends to be inco...
[ { "answer_id": 135806, "author": "RS Conley", "author_id": 7890, "author_profile": "https://Stackoverflow.com/users/7890", "pm_score": 0, "selected": false, "text": "/tag\n\n/core_library\n /branch\n /main\n\n/business_logic\n /branch\n /main\n\n/report_library\n /branch\n /main\...
2008/09/25
[ "https://Stackoverflow.com/questions/135670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18009/" ]
135,688
<p>What is the proper way to modify environment variables like PATH in OS&nbsp;X?</p> <p>I've looked on Google a little bit and found three different files to edit:</p> <ul> <li>/etc/paths</li> <li>~/.profile</li> <li>~/.tcshrc</li> </ul> <p>I don't even have some of these files, and I'm pretty sure that <em>.tcshrc...
[ { "answer_id": 135697, "author": "tim_yates", "author_id": 6509, "author_profile": "https://Stackoverflow.com/users/6509", "pm_score": 7, "selected": false, "text": "~/.MacOSX/environment.plist\n .bash_profile .profile launchd launchctl" }, { "answer_id": 135702, "author": "J...
2008/09/25
[ "https://Stackoverflow.com/questions/135688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85/" ]
135,730
<p>What are the different types of indexes, what are the benefits of each?</p> <p>I heard of covering and clustered indexes, are there more? Where would you use them?</p>
[ { "answer_id": 136272, "author": "dland", "author_id": 18625, "author_profile": "https://Stackoverflow.com/users/18625", "pm_score": 3, "selected": false, "text": "create index i on customers (id, name, whatever) where is_active is true;\n select name from customers where is_active is tr...
2008/09/25
[ "https://Stackoverflow.com/questions/135730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3208/" ]
135,734
<p>I am trying to learn Emacs and trying to find best keyboard layout for me. One thing is really annoying me. I have added following lines to .emacs</p> <pre class="lang-lisp prettyprint-override"><code>(global-set-key "\C-y" 'scroll-up) (global-set-key "\M-y" 'scroll-down) </code></pre> <p>When I hold <kbd>Control<...
[ { "answer_id": 293829, "author": "jfs", "author_id": 4279, "author_profile": "https://Stackoverflow.com/users/4279", "pm_score": 3, "selected": false, "text": "C-v M-v C-y M-y" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/438025/" ]
135,745
<p>I have a simple web service, it takes 2 parameters one is a simple xml security token, the other is usually a long xml string. It works with short strings but longer strings give a 400 error message. maxMessageLength did nothing to allow for longer strings.</p>
[ { "answer_id": 135809, "author": "Yuval Peled", "author_id": 20257, "author_profile": "https://Stackoverflow.com/users/20257", "pm_score": 2, "selected": false, "text": " NetTcpBinding binding = new NetTcpBinding(SecurityMode.None, true);\n\n // Allow big arguments on messa...
2008/09/25
[ "https://Stackoverflow.com/questions/135745", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22367/" ]
135,754
<p>It is typical to have something like this in your cshrc file for setting the path:</p> <pre><code>set path = ( . $otherpath $path ) </code></pre> <p>but, the path gets duplicated when you source your cshrc file multiple times, how do you prevent the duplication?</p> <p>EDIT: This is one unclean way of doing it:</...
[ { "answer_id": 135783, "author": "Andrew Stein", "author_id": 13029, "author_profile": "https://Stackoverflow.com/users/13029", "pm_score": 0, "selected": false, "text": "set path = (. ~/bin /bin /usr/bin /usr/ucb /usr/bin/X11)\n set path = ($otherPath $path)\n" }, { "answer_id":...
2008/09/25
[ "https://Stackoverflow.com/questions/135754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18415/" ]
135,755
<p>How do you find the version of an installed Perl module?</p> <p>This is in an answer down at the bottom, but I figure it important enough to live up here. With these suggestions, I create a function in my <code>.bashrc</code></p> <pre><code>function perlmodver { perl -M$1 -e 'print "Version " . $ARGV[0]-&gt;V...
[ { "answer_id": 135760, "author": "zigdon", "author_id": 4913, "author_profile": "https://Stackoverflow.com/users/4913", "pm_score": 6, "selected": false, "text": "perl -MSome::Module -le 'print $Some::Module::VERSION'\n" }, { "answer_id": 135773, "author": "Jon Ericson", ...
2008/09/25
[ "https://Stackoverflow.com/questions/135755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17339/" ]
135,759
<p>Why can't I create a <code>class</code> in <code>VB.NET</code> that <code>inherits</code> <code>System.IO.Directory</code>? According to Lutz Roeder, it is <em>not</em> declared as <code>NotInheritable</code>!</p> <p>I want to create a <code>utility class</code> that adds functionality to the <code>Directory class...
[ { "answer_id": 135772, "author": "David Basarab", "author_id": 2469, "author_profile": "https://Stackoverflow.com/users/2469", "pm_score": 5, "selected": true, "text": "namespace System.IO\n{\n // Summary:\n // Exposes static methods for creating, moving, and enumerating throug...
2008/09/25
[ "https://Stackoverflow.com/questions/135759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54420/" ]
135,777
<h2>Seeking a method to:</h2> <h2>Take whitespace separated tokens in a String; return a suggested Word</h2> <p><br> <strong>ie:</strong><br> Google Search can take <em>"fonetic wrd nterpreterr"</em>,<br> and atop of the result page it shows <em>"Did you mean: phonetic word interpreter"</em></p> <p><em>A solution in...
[ { "answer_id": 707323, "author": "Jonathan C Dickinson", "author_id": 24064, "author_profile": "https://Stackoverflow.com/users/24064", "pm_score": 2, "selected": false, "text": "startup()\n{\n set the spelling engines word suggestion limit to 1\n}\n\noption 1()\n{\n int currentPosit...
2008/09/25
[ "https://Stackoverflow.com/questions/135777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4857/" ]
135,782
<p>A lot of my C# code follows this pattern:</p> <pre><code>void foo(string param1, string param2, string param3) { try { // do something... } catch(Exception ex) { LogError(String.Format("Error in foo(param1={0}, param2={1}, param3={2}), exception={3}", param1, param2, param3, ex....
[ { "answer_id": 135813, "author": "David Basarab", "author_id": 2469, "author_profile": "https://Stackoverflow.com/users/2469", "pm_score": 1, "selected": false, "text": "public class LogArgs\n{\n\n public string MethodName { get; set; }\n public string ClassName { get; set; }\n ...
2008/09/25
[ "https://Stackoverflow.com/questions/135782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463/" ]
135,799
<p>I've been using the macro from <a href="http://weblogs.asp.net/koenv/archive/2008/02/14/quick-attach-and-detach-debugger.aspx" rel="nofollow noreferrer">this blog entry</a> for attaching the Visual Studio debugger to an already running instance of the Web Application I'm currently working on. However, if I have more...
[ { "answer_id": 226484, "author": "Annagram", "author_id": 29324, "author_profile": "https://Stackoverflow.com/users/29324", "pm_score": 2, "selected": false, "text": "Sub GetWebProjectPorts()\n Dim ports As String\n\n For Each prj As Project In DTE.Solution.Projects\n For Ea...
2008/09/25
[ "https://Stackoverflow.com/questions/135799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7872/" ]
135,801
<p>I am using prototype and I can't find any built in extensions to set or retrieve cookies. After googling for a little bit, I see a few different ways to go about it. I was wondering what you think is the best approach for getting a cookie in JavaScript?</p>
[ { "answer_id": 135855, "author": "Diodeus - James MacFarlane", "author_id": 12579, "author_profile": "https://Stackoverflow.com/users/12579", "pm_score": -1, "selected": false, "text": "function getCookie(c_name) {\nif (document.cookie.length>0)\n {\n c_start=document.cookie.indexOf(c_...
2008/09/25
[ "https://Stackoverflow.com/questions/135801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6350/" ]
135,802
<p>I'm looking for the concept to <strong>spawn a process</strong> such that:</p> <ul> <li>it has only access to certain libraries/APIs</li> <li>it cannot acess the file system or only specific parts</li> <li>it can <strong>do least harm should malicious code run in it</strong></li> </ul> <p>This concept is known as ...
[ { "answer_id": 153111, "author": "Trance Diviner", "author_id": 7365, "author_profile": "https://Stackoverflow.com/users/7365", "pm_score": 4, "selected": false, "text": "(allow process-exec (regex #\"^/usr/sbin/portmap$\"))\n(allow file-read-data file-read-metadata (regex\n #\"^/etc\...
2008/09/25
[ "https://Stackoverflow.com/questions/135802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19435/" ]
135,803
<blockquote> <p>System.InvalidOperationException: DragDrop registration did not succeed. ---> System.Threading.ThreadStateException:</p> </blockquote> <p>What does this exception mean? I get it at this line trying to add a panel to a panel at runtime...</p> <pre><code>splitReport.Panel1.Controls.Add(ChartPanel);...
[ { "answer_id": 160867, "author": "Charlie", "author_id": 18529, "author_profile": "https://Stackoverflow.com/users/18529", "pm_score": 5, "selected": false, "text": "[STAThread] Thread.CurrentThread.SetApartmentState( ApartmentState.STA ) Thread ApartmentState System.Threading [STAThread...
2008/09/25
[ "https://Stackoverflow.com/questions/135803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
135,826
<p>I am looking for some stats on current browsers for how long it takes to render a table using plain HTML versus a hacked-up CSS puritan method that avoids using actual <code>TABLE</code>, <code>TR</code>, <code>TD</code> etc. tags.</p> <p><strong>I am not looking for what's proper, only for what's faster</strong>, ...
[ { "answer_id": 135860, "author": "Dan Udey", "author_id": 21450, "author_profile": "https://Stackoverflow.com/users/21450", "pm_score": 0, "selected": false, "text": "<thead> <tfoot>" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16777/" ]
135,834
<p>In python, under what circumstances is SWIG a better choice than ctypes for calling entry points in shared libraries? Let's assume you don't already have the SWIG interface file(s). <br><br>What are the performance metrics of the two?</p>
[ { "answer_id": 4892651, "author": "MajesticRa", "author_id": 548894, "author_profile": "https://Stackoverflow.com/users/548894", "pm_score": 7, "selected": false, "text": "CppCamelStyleFunctions() looks_more_pythonish" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14028/" ]
135,835
<p>I am trying to load a small sample of records from a large database into a test database.</p> <p>How do you tell mysqldump to only give you n records out of 8 million?</p> <p>Thanks</p>
[ { "answer_id": 135900, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 8, "selected": false, "text": "mysqldump --opt --where=\"1 limit 1000000\" database\n" }, { "answer_id": 19830993, "author": "Casper An...
2008/09/25
[ "https://Stackoverflow.com/questions/135835", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
135,841
<p>As just stated in a recent <a href="https://stackoverflow.com/questions/135759/why-cant-i-inherit-iodirectory">question</a> and <a href="https://stackoverflow.com/questions/135759/why-cant-i-inherit-iodirectory#135772">answer</a>, you can't inherit from a static class. How does one enforce the rules that go along w...
[ { "answer_id": 135852, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 8, "selected": true, "text": "NotInheritable Shared Module" }, { "answer_id": 16497226, "author": "Mentor", "author_id": 1520418, ...
2008/09/25
[ "https://Stackoverflow.com/questions/135841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8505/" ]
135,845
<p>A colleague of mine states that <strong>booleans as method arguments are not acceptable</strong>. They shall be replaced by enumerations. At first I did not see any benefit, but he gave me an example.</p> <p>What's easier to understand?</p> <pre><code>file.writeData( data, true ); </code></pre> <p>Or</p> <pre><c...
[ { "answer_id": 135882, "author": "Jesse C. Slicer", "author_id": 3312, "author_profile": "https://Stackoverflow.com/users/3312", "pm_score": 2, "selected": false, "text": "KeepWritingData (DataAvailable());\n bool DataAvailable()\n{\n return true; //data is ALWAYS available!\n}\n\nvoi...
2008/09/25
[ "https://Stackoverflow.com/questions/135845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2012356/" ]
135,849
<p>I'm trying to host a python script using an apache web server, but the server tries to run the script instead of just offering it for download.</p> <p>I do not have direct access to server, and adding the line</p> <pre><code>AddType text/plain .py </code></pre> <p>to .htaccess in the root folder does not appear t...
[ { "answer_id": 135890, "author": "Mez", "author_id": 20010, "author_profile": "https://Stackoverflow.com/users/20010", "pm_score": 0, "selected": false, "text": "<IfModule mime_module>\n <Files *.py>\n ForceType text/plain\n </Files>\n</IfModule>\n" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/135849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30/" ]
135,896
<p>Does anyone know of a web site where I can find a list of 32-bit MIPS instructions/opcodes, with the following features:</p> <ul> <li>Clearly distinguishes between real opcodes and assembly-language macros (pseudo-instructions)</li> <li>Describes the instruction behavior including differences depending on privilege ...
[ { "answer_id": 136240, "author": "Benoit", "author_id": 10703, "author_profile": "https://Stackoverflow.com/users/10703", "pm_score": 0, "selected": false, "text": "nor" }, { "answer_id": 47432637, "author": "Peter Cordes", "author_id": 224132, "author_profile": "http...
2008/09/25
[ "https://Stackoverflow.com/questions/135896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20789/" ]
135,909
<p>I run into this occasionally and always forget how to do it.</p> <p>One of those things that pop up ever so often.</p> <p>Also, what's the formula to convert angles expressed in radians to degrees and back again?</p>
[ { "answer_id": 135927, "author": "thesmallprint", "author_id": 12765, "author_profile": "https://Stackoverflow.com/users/12765", "pm_score": 3, "selected": false, "text": "function convert($type, $num) {\n if ($type == \"rads\") {\n $result = $num*180/pi();\n }\n\n ...
2008/09/25
[ "https://Stackoverflow.com/questions/135909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8683/" ]
135,919
<p>I haven't been able to find an adequate answer to what exactly the following error means:</p> <p><code>java.net.SocketException: Software caused connection abort: recv failed</code> </p> <p>Notes:</p> <ul> <li>This error is infrequent and unpredictable; although getting this error means that all future requests f...
[ { "answer_id": 10246311, "author": "Michael J. Gray", "author_id": 468904, "author_profile": "https://Stackoverflow.com/users/468904", "pm_score": 1, "selected": false, "text": "shutdownInput shutdownOutput" }, { "answer_id": 25479748, "author": "Sergio", "author_id": 397...
2008/09/25
[ "https://Stackoverflow.com/questions/135919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12815/" ]
135,929
<p>I'd like to just put in a comment in the block of my if-statement, but I get an error when I try. I want to be more like Steve McConnell.</p> <pre><code>declare @ConstraintName varchar(255) set @ConstraintName = 'PK_Whatever' IF LEFT(@ConstraintName, 2) = 'PK' BEGIN --can't drop primary keys END </code></pre> ...
[ { "answer_id": 135962, "author": "Dave Costa", "author_id": 6568, "author_profile": "https://Stackoverflow.com/users/6568", "pm_score": 2, "selected": false, "text": "BEGIN\n -- This is a comment\n NULL;\nEND\n" }, { "answer_id": 139140, "author": "Even Mien", "author_i...
2008/09/25
[ "https://Stackoverflow.com/questions/135929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73794/" ]
135,934
<p>I need to show a camera capture dialog in a compact framework 3.7 application by pinvoking SHCameraCapture from the dll Aygshell.dll. I cannont use the managed object CameraCaptureDialog because of limitations with the technology I'm working with. Instead, I need to access it by Pinvoking it.</p> <p>See <a href="...
[ { "answer_id": 138398, "author": "Grokys", "author_id": 6448, "author_profile": "https://Stackoverflow.com/users/6448", "pm_score": 0, "selected": false, "text": "struct SHCAMERACAPTURE {\n public Int32 cbSize;\n public IntPtr hwndOwner;\n\n [MarshalAs(UnmanagedType.ByValTStr, SizeCon...
2008/09/25
[ "https://Stackoverflow.com/questions/135934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12497/" ]
135,938
<p>It's not a matter of life or death but I wonder if this could be possible:</p> <p>I got a couple of events from one type of custom event (FormEvent) now I got a FormListener that listens to all those events and handles them according to the event type. Instead of adding one eventListener at the time I wish to add a...
[ { "answer_id": 136258, "author": "Matt Dillard", "author_id": 863, "author_profile": "https://Stackoverflow.com/users/863", "pm_score": 0, "selected": false, "text": "private function addMultipleEventListeners( evts:Array, callback:function ):void\n{\n for each( var evt:Event in evts ...
2008/09/25
[ "https://Stackoverflow.com/questions/135938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18671/" ]
135,944
<p>Stored procs in SQL Server sometimes finish with a return code, as opposed to a recordset of data. I've seen ASP code that's able to get this return code, but I can't figure out how to get this code with PHP's mssql driver.</p> <p>mssql_get_last_message() always returns nothing, and I'm thinking it's because it on...
[ { "answer_id": 135963, "author": "Matt Rogish", "author_id": 2590, "author_profile": "https://Stackoverflow.com/users/2590", "pm_score": 3, "selected": true, "text": "DECLARE @return_code INT\nEXEC @return_code = your_stored_procedure 1123\nSELECT @return_code\n" }, { "answer_id"...
2008/09/25
[ "https://Stackoverflow.com/questions/135944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12308/" ]
135,971
<p>If you have two jars in your classpath that contain different versions of the same class, the classpath order becomes critical.</p> <p>I am looking for a tool that can detect and flag such potential conflicts in a given classpath or set of folders.</p> <p>Certainly a script that starts:</p> <pre><code>classes=`mk...
[ { "answer_id": 136292, "author": "OscarRyz", "author_id": 20654, "author_profile": "https://Stackoverflow.com/users/20654", "pm_score": 2, "selected": false, "text": "import java.io.*;\nimport java.util.zip.*;\n\n\npublic class ListZipContent{\n public static void main( String [] args...
2008/09/25
[ "https://Stackoverflow.com/questions/135971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5309/" ]
135,995
<p>So, I want to define a singleton method for an object, but I want to do it using a closure.</p> <p>For example,</p> <pre><code>def define_say(obj, msg) def obj.say puts msg end end o = Object.new define_say o, "hello world!" o.say </code></pre> <p>This doesn't work because defining a singleton method via...
[ { "answer_id": 136194, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 4, "selected": true, "text": "def define_say(obj, msg)\n # Get a handle to the singleton class of obj\n metaclass = class << obj; self; end \n\n # a...
2008/09/25
[ "https://Stackoverflow.com/questions/135995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122/" ]
136,033
<p>I despise the PHP language, and I'm quite certain that I'm not alone. But the great thing about PHP is the way that mod_php takes and hides the gory details of integrating with the apache runtime, and achieves CGI-like request isolation and decent performance.</p> <p>What's the shortest-distance approach to gettin...
[ { "answer_id": 137293, "author": "Zed", "author_id": 19202, "author_profile": "https://Stackoverflow.com/users/19202", "pm_score": 2, "selected": false, "text": "<html> <body> <p>The value of 2+2 is: <?php echo 2+2; ?></p> </body></html> The value of 2+2 is: 4 <html><body><p>The value of...
2008/09/25
[ "https://Stackoverflow.com/questions/136033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22369/" ]
136,034
<p>I've looked around for a good example of this, but I haven't run into one yet. I want to pass a custom string array from java to oracle and back, using the IBATIS framework. Does anyone have a good link to an example? I'm calling stored procs from IBATIS.</p> <p>Thanks</p>
[ { "answer_id": 137693, "author": "bsanders", "author_id": 22200, "author_profile": "https://Stackoverflow.com/users/22200", "pm_score": 2, "selected": false, "text": "TypeHandler TypeHandlerCallback Connection public class ArrayTypeHandler implements TypeHandler {\n\n public void setP...
2008/09/25
[ "https://Stackoverflow.com/questions/136034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22365/" ]
136,035
<p>It is discouraged to simply catch <code>System.Exception</code>. Instead, only the &quot;known&quot; exceptions should be caught.</p> <p>Now, this sometimes leads to unnecessary repetitive code, for example:</p> <pre><code>try { WebId = new Guid(queryString[&quot;web&quot;]); } catch (FormatException) { WebI...
[ { "answer_id": 136038, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 3, "selected": false, "text": "catch (Exception ex)\n{\n switch (ex.GetType().Name)\n {\n case \"System.FormatException\":\n case \"Sy...
2008/09/25
[ "https://Stackoverflow.com/questions/136035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91/" ]
136,050
<p>Is there a way to prevent VS2008 creating browse info file files for C++ projects.<br> I rarely use the class browser and it isn't worth the time it takes to recreate it after every build, especially since it runs even if the build failed.</p> <p>EDIT - it's also needed for go to declaration/definition</p>
[ { "answer_id": 1910905, "author": "Adisak", "author_id": 14904, "author_profile": "https://Stackoverflow.com/users/14904", "pm_score": 3, "selected": true, "text": "[HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0\\Languages\\Language Services\\C/C++] \"IntellisenseOptions\"=dw...
2008/09/25
[ "https://Stackoverflow.com/questions/136050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10897/" ]
136,052
<p>I'm trying to send an email in Java but when I read the body of the email in Outlook, it's gotten rid of all my linebreaks. I'm putting \n at the ends of the lines but is there something special I need to do other than that? The receivers are always going to be using Outlook. </p> <p>I found a page on microsoft.com...
[ { "answer_id": 136061, "author": "EBGreen", "author_id": 1358, "author_profile": "https://Stackoverflow.com/users/1358", "pm_score": 0, "selected": false, "text": "\\r\\c \\n \\r\\n" }, { "answer_id": 136095, "author": "Robert Wilkinson", "author_id": 2184, "author_pr...
2008/09/25
[ "https://Stackoverflow.com/questions/136052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3098/" ]
136,067
<p>I am working on a web app that uses Perl and I need to look into speeding up portions of the app. </p> <p>I thought I'd start profiling the particular calls for the portion I wish to investigate. I've done some searching on profiling Perl code, but unfortunately most of what I find says that I should run my perl ...
[ { "answer_id": 136402, "author": "Sam Kington", "author_id": 6832, "author_profile": "https://Stackoverflow.com/users/6832", "pm_score": 3, "selected": false, "text": "\nhttp://example.com/scripts/example.pl?action=browse&search=grommet&restrict=blah\n \nperl -d:NYTProf documentroot/scri...
2008/09/25
[ "https://Stackoverflow.com/questions/136067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22390/" ]
136,097
<p>What is the difference between a function decorated with <a href="http://docs.python.org/library/functions.html#staticmethod" rel="noreferrer"><code>@staticmethod</code></a> and one decorated with <a href="http://docs.python.org/library/functions.html#classmethod" rel="noreferrer"><code>@classmethod</code></a>?</p>
[ { "answer_id": 136138, "author": "Thomas Wouters", "author_id": 17624, "author_profile": "https://Stackoverflow.com/users/17624", "pm_score": 10, "selected": false, "text": "dict.fromkeys() >>> class DictSubclass(dict):\n... def __repr__(self):\n... return \"DictSubclass\"\n....
2008/09/25
[ "https://Stackoverflow.com/questions/136097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4766/" ]
136,098
<p>Browsing to a dynamic web page built using Grails version 1.0.3 the console log shows the following errors for each page request:</p> <pre><code>[Fatal Error] :-1:-1: Premature end of file. </code></pre> <p>How do I stop this error from appearing for each request?</p>
[ { "answer_id": 158386, "author": "Josh", "author_id": 16175, "author_profile": "https://Stackoverflow.com/users/16175", "pm_score": 3, "selected": true, "text": "grails.mime.types = [ html: ['text/html','application/xhtml+xml'],\nxml: ['text/xml', 'application/xml'], ...\n" } ]
2008/09/25
[ "https://Stackoverflow.com/questions/136098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16175/" ]