qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
167,502
<p>This is the page that I'm having. But the resize part in the section does not seem to be working. I copied most of the code from the <a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/UpdatePanelAnimation/UpdatePanelAnimation.aspx" rel="nofollow noreferrer">Ajax site</a>. I placed a alert() in the tag (li...
[ { "answer_id": 167501, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 5, "selected": false, "text": "DECLARE @MyDate datetime\n\n-- ... set your datetime's initial value ...'\n\nDATEADD(d, 1, @MyDate)\n" }, { "a...
2008/10/03
[ "https://Stackoverflow.com/questions/167502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2894/" ]
167,509
<p>I have a GridView where one column is bound to an object property containing a nullable integer. I set SortExpression to the name of the property, and sorting works perfectly as long as all rows contain a value. If any rows contain null, however, I get an exception:</p> <p>System.InvalidOperationException : Failed ...
[ { "answer_id": 167519, "author": "Seth Petry-Johnson", "author_id": 23632, "author_profile": "https://Stackoverflow.com/users/23632", "pm_score": 3, "selected": true, "text": "gridview.Sorting += new GridViewSortEventHandler(gridView_Sorting);\n\nprotected void gridView_Sorting(object se...
2008/10/03
[ "https://Stackoverflow.com/questions/167509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23632/" ]
167,533
<p>We have some raw voice audio that we need to distribute over the internet. We need decent quality, but it doesn't need to be of musical quality. Our main concern is usability by the consumer (i.e. what and where they can play it) and size of the download. My experience has shown that mp3s do not produce the best com...
[ { "answer_id": 25394260, "author": "hochl", "author_id": 589206, "author_profile": "https://Stackoverflow.com/users/589206", "pm_score": 3, "selected": false, "text": "ffmpeg -i x.wav -b:a 32k x.opus\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7819/" ]
167,542
<p>I'm trying to create a table with two columns comprising the primary key in MySQL, but I can't figure out the syntax. I understand single-column PKs, but the syntax isn't the same to create a primary key with two columns.</p>
[ { "answer_id": 167553, "author": "Galwegian", "author_id": 3201, "author_profile": "https://Stackoverflow.com/users/3201", "pm_score": 1, "selected": false, "text": " CREATE TABLE `synthesis`.`INV_MasterItemList` (\n `MasterItemList_ID` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,\n `Cu...
2008/10/03
[ "https://Stackoverflow.com/questions/167542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1266/" ]
167,562
<p>How can I know if a device is supported on a running Linux and if so, which device driver controls it? For instance, <code>lspci</code> on a server (PowerEdge 2900) gives:</p> <pre class="lang-none prettyprint-override"><code>00:00.0 Host bridge: Intel Corporation 5000X Chipset Memory Controller Hub (rev 12) 00:02....
[ { "answer_id": 167606, "author": "Alex B", "author_id": 23643, "author_profile": "https://Stackoverflow.com/users/23643", "pm_score": 2, "selected": false, "text": "nvidia agpgart usbhid usbcore usbhid" }, { "answer_id": 168731, "author": "ypnos", "author_id": 21974, ...
2008/10/03
[ "https://Stackoverflow.com/questions/167562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8013/" ]
167,567
<p>I have been asked to write a testing application that needs to test a new stored procedure on multiple rows in a database, in essence I want to do something like this:</p> <pre><code>[Test] public void TestSelect() { foreach(id in ids) { DataTable old = Database.call(&quot;old_stored_proc&quot;,id); ...
[ { "answer_id": 167598, "author": "Ilya Kochetov", "author_id": 15329, "author_profile": "https://Stackoverflow.com/users/15329", "pm_score": 1, "selected": false, "text": "Assert.Greater" }, { "answer_id": 167619, "author": "akmad", "author_id": 1314, "author_profile"...
2008/10/03
[ "https://Stackoverflow.com/questions/167567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
167,576
<p>I would like this to be the ultimate discussion on how to check if a table exists in SQL Server 2000/2005 using SQL Statements.</p> <p>Here are two possible ways of doing it. Which one is the standard/best way of doing it?</p> <p>First way:</p> <pre><code>IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLE...
[ { "answer_id": 167610, "author": "Bob King", "author_id": 6897, "author_profile": "https://Stackoverflow.com/users/6897", "pm_score": 8, "selected": false, "text": "OBJECT_ID IF OBJECT_ID('*objectName*', 'U') IS NOT NULL \n" }, { "answer_id": 167680, "author": "akmad", "a...
2008/10/03
[ "https://Stackoverflow.com/questions/167576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1508/" ]
167,577
<p>I am working on a project that requires reliable access to historic feed entries which are not necessarily available in the current feed of the website. I have found several ways to access such data, but none of them give me all the characteristics I need.</p> <p>Look at this as a brainstorm. I will tell you how mu...
[ { "answer_id": 167610, "author": "Bob King", "author_id": 6897, "author_profile": "https://Stackoverflow.com/users/6897", "pm_score": 8, "selected": false, "text": "OBJECT_ID IF OBJECT_ID('*objectName*', 'U') IS NOT NULL \n" }, { "answer_id": 167680, "author": "akmad", "a...
2008/10/03
[ "https://Stackoverflow.com/questions/167577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24461/" ]
167,587
<p>I'm trying to load assemblies in a separate app domain, but am running into a very strange problem. Here's some code:</p> <pre><code> public static void LoadAssembly(string assemblyPath) { string pathToDll = Assembly.GetCallingAssembly().CodeBase; AppDomainSetup domainSetup = new AppDomainSe...
[ { "answer_id": 167658, "author": "TheXenocide", "author_id": 8543, "author_profile": "https://Stackoverflow.com/users/8543", "pm_score": 0, "selected": false, "text": "AssemblyLoader loader = (AssemblyLoader)newDomain.CreateInstanceFromAndUnwrap(\n typeof(AssemblyLoader).Assembly....
2008/10/03
[ "https://Stackoverflow.com/questions/167587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15861/" ]
167,602
<p>I have a class which implements UserControl. In .NET 2005, a Dispose method is automatically created in the MyClass.Designer.cs partial class file that looks like this:</p> <pre><code> protected override void Dispose(bool disposing) { if (disposing &amp;&amp; (components != null)) { components....
[ { "answer_id": 167627, "author": "akmad", "author_id": 1314, "author_profile": "https://Stackoverflow.com/users/1314", "pm_score": 3, "selected": false, "text": "Dispose" }, { "answer_id": 167642, "author": "Michael Damatov", "author_id": 23372, "author_profile": "htt...
2008/10/03
[ "https://Stackoverflow.com/questions/167602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22252/" ]
167,622
<p>What are the major difference between bindable LINQ and continuous LINQ?</p> <p>•Bindable LINQ: www.codeplex.com/bindablelinq</p> <p>•Continuous LINQ: www.codeplex.com/clinq</p> <p>One more project was added basing on the provided feedback:</p> <p>•Obtics: obtics.codeplex.com</p>
[ { "answer_id": 174924, "author": "KyleLanser", "author_id": 12923, "author_profile": "https://Stackoverflow.com/users/12923", "pm_score": 6, "selected": true, "text": "from item in theSource select item ;\n from item in theSource.AsBindable() select item ;\n var theSource = new Continuou...
2008/10/03
[ "https://Stackoverflow.com/questions/167622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19268/" ]
167,628
<p>We are managing our development with Subversion over HTTPS, Bugzilla, and Mediawiki. Some of our developers have expressed an interest in migrating to Trac, so I have to evaluate what the cost of doing so would be. </p> <p>For both the wiki and bugzilla, we would need to either migrate the existing data into Trac...
[ { "answer_id": 174924, "author": "KyleLanser", "author_id": 12923, "author_profile": "https://Stackoverflow.com/users/12923", "pm_score": 6, "selected": true, "text": "from item in theSource select item ;\n from item in theSource.AsBindable() select item ;\n var theSource = new Continuou...
2008/10/03
[ "https://Stackoverflow.com/questions/167628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9940/" ]
167,635
<p>Let's say I 've added a library foo.so.1.1.1 to a path that is included in <code>/etc/ld.so.conf</code> When I run ldconfig on the system I get the links foo.so.1.1 and foo.so.1 to foo.so.1.1.1</p> <p>How can I change the behavior to also get the foo.so link to foo.so.1.1.1?</p>
[ { "answer_id": 167702, "author": "bmdhacks", "author_id": 14032, "author_profile": "https://Stackoverflow.com/users/14032", "pm_score": 3, "selected": false, "text": "ln -s /usr/lib/foo.so.1.1.1 /usr/lib/foo.so\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6403/" ]
167,643
<p>How do I write the SQL code to INSERT (or UPDATE) an array of values (with probably an attendant array of fieldnames, or with a matrix with them both) without simple iteration?</p>
[ { "answer_id": 167738, "author": "Ilya Kochetov", "author_id": 15329, "author_profile": "https://Stackoverflow.com/users/15329", "pm_score": 1, "selected": false, "text": "INSERT SELECT INSERT recipient_table (field1, field2)\nSELECT field1_from, field2_from\nFROM donor_table\nWHERE fiel...
2008/10/03
[ "https://Stackoverflow.com/questions/167643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13295/" ]
167,657
<p>When IE8 is released, will the following code work to add a conditional stylesheet?</p> <pre><code>&lt;!--[if IE 8]&gt; &lt;link rel="stylesheet" type="text/css" href="ie-8.0.css" /&gt; &lt;![endif]--&gt; </code></pre> <p>I've read conflicting reports as to whether this works with the beta. I'm hoping someone c...
[ { "answer_id": 168131, "author": "scunliffe", "author_id": 6144, "author_profile": "https://Stackoverflow.com/users/6144", "pm_score": 5, "selected": false, "text": "http://127.0.0.1/mysite/mypage.php <-- IE8 by default (updated!)\nhttp://localhost/mysite/mypage.php <-- IE8 by default ...
2008/10/03
[ "https://Stackoverflow.com/questions/167657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13850/" ]
167,697
<p>We're working with a semi-centralized git repository here where I work. Each developer has their own subtree in the central git repository, so it looks something like this:</p> <pre>master alice/branch1 alice/branch2 bob/branch1 michael/feature release/1.0 release/1.1</pre> <p>Working locally in my tree I have <co...
[ { "answer_id": 169110, "author": "webmat", "author_id": 6349, "author_profile": "https://Stackoverflow.com/users/6349", "pm_score": 2, "selected": false, "text": "push = refs/heads/master:master\npush = refs/heads/topic/feature:michael/feature\n" }, { "answer_id": 169777, "au...
2008/10/03
[ "https://Stackoverflow.com/questions/167697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17688/" ]
167,705
<p>How do I load the edited <code>.emacs</code> file without restarting Emacs?</p>
[ { "answer_id": 7116603, "author": "tkf", "author_id": 264050, "author_profile": "https://Stackoverflow.com/users/264050", "pm_score": 3, "selected": false, "text": "*scratch* (load-file user-init-file)\n C-x C-e" }, { "answer_id": 9501113, "author": "Shantanu", "author_id...
2008/10/03
[ "https://Stackoverflow.com/questions/167705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8522/" ]
167,735
<p>I am looking for a pseudo random number generator which would be specialized to work fast when it is given a seed before generating each number. Most generators I have seen so far assume you set seed once and then generate a long sequence of numbers. The only thing which looks somewhat similar to I have seen so far ...
[ { "answer_id": 167764, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 5, "selected": true, "text": "uint32_t hash( uint32_t a)\n a = (a ^ 61) ^ (a >> 16);\n a = a + (a << 3);\n a = a ^ (a >> 4);\n a = a * 0x27d4eb2d...
2008/10/03
[ "https://Stackoverflow.com/questions/167735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16673/" ]
167,740
<p>I recently began profiling an osgi java application that I am writing using VisualVM. One thing I have noticed is that when the application starts sending data to a client (over JMS), the number of loaded classes starts increasing at a steady rate. The Heap size and the PermGen size remains constant, however. The...
[ { "answer_id": 167971, "author": "Kyle", "author_id": 3335, "author_profile": "https://Stackoverflow.com/users/3335", "pm_score": 4, "selected": true, "text": "JAXBContext context = JAXBContext.newInstance(this.getClass());\n" }, { "answer_id": 168056, "author": "ddimitrov", ...
2008/10/03
[ "https://Stackoverflow.com/questions/167740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3335/" ]
167,743
<p>What's a simple way to implement a c++ Win32 program to...<br /> - display an 800x600x24 uncompressed bitmap image<br /> - in a window without borders (the only thing visible is the image)<br /> - that closes after ten seconds<br /> - and doesn't use MFC</p>
[ { "answer_id": 167918, "author": "efotinis", "author_id": 12320, "author_profile": "https://Stackoverflow.com/users/12320", "pm_score": 2, "selected": false, "text": "_ _ _ _ _ _ _" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191808/" ]
167,746
<p>I am trying to write a Windows Form and ASP.NET C# front-end and MSAccess backend for a pretty small database concept I have. </p> <p>I have written this application once before in just MSAccess but I now need the app and database to be in different places. I have now figured out (thanks to a StackOverflow user) th...
[ { "answer_id": 167918, "author": "efotinis", "author_id": 12320, "author_profile": "https://Stackoverflow.com/users/12320", "pm_score": 2, "selected": false, "text": "_ _ _ _ _ _ _" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19802/" ]
167,752
<p>I would like to add a typing speed indicator just below the textarea we use on our contact form. It is just for fun and to give the user some interactivity with the page while they are completing the form.</p> <p>It should display the average speed while typing and keep the last average when the keystrokes are idle...
[ { "answer_id": 167828, "author": "Jared", "author_id": 1980, "author_profile": "https://Stackoverflow.com/users/1980", "pm_score": -1, "selected": false, "text": "var lastrun = new Date();\ntextarea.onkeyup = function() {\n var words = textarea.value.split(' ');\n var minutes_since...
2008/10/03
[ "https://Stackoverflow.com/questions/167752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3747/" ]
167,760
<p>I have a class holding complex scientific computations. It is set up to only allow a user to create a properly instantiated case. To properly test the code, however, requires setting internal state variables directly, since the reference documents supply this data in their test cases. Done improperly, however, it...
[ { "answer_id": 167767, "author": "cfeduke", "author_id": 5645, "author_profile": "https://Stackoverflow.com/users/5645", "pm_score": 4, "selected": false, "text": "DangerousSet internal public DangerousSet [assembly:InternalsVisibleTo(\"YourTestAssembly\")] [assembly:InternalsVisibleTo(\...
2008/10/03
[ "https://Stackoverflow.com/questions/167760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10722/" ]
167,761
<p>I'd like to be able to add a class to images that adds a border that makes them look like a stack of photos. Anyone know how to do this?</p> <p>Clarifications: Ideally something like the stack shown <a href="http://designreviver.com/tutorials/create-an-interactive-stack-of-photos/" rel="nofollow noreferrer">here</...
[ { "answer_id": 167798, "author": "Mikezx6r", "author_id": 5382, "author_profile": "https://Stackoverflow.com/users/5382", "pm_score": 0, "selected": false, "text": "<div class=\"img-shadow\"><img ...></div>\n\n.img-shadow {style.css (line 456)\nbackground-color:#505050;\nfloat:left;\nmar...
2008/10/03
[ "https://Stackoverflow.com/questions/167761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12842/" ]
167,772
<p>I have a Ruby on Rails application that I'm writing where a user has the option to edit an invoice. They need to be able to reassign the order of the rows. Right now I have an index column in the db which is used as the default sort mechanism. I just exposed that and allowed the user to edit it. </p> <p>This ...
[ { "answer_id": 167905, "author": "Ates Goral", "author_id": 23501, "author_profile": "https://Stackoverflow.com/users/23501", "pm_score": 2, "selected": false, "text": "sortables.addItems(node);\n" }, { "answer_id": 167993, "author": "Mark S.", "author_id": 13968, "au...
2008/10/03
[ "https://Stackoverflow.com/questions/167772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13968/" ]
167,808
<p>I have created a user control to handle adding comments to certain business entities, like contacts and customers. Works great ... except for one issue.</p> <p>I am using a ListView control to edit and delete comments, and a separate area, on the same user control to add a new comment. All of this is wrapped in a...
[ { "answer_id": 167832, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 0, "selected": false, "text": "Page.IsPostBack if(IsPostBack) {\n //do your data-saving code...\n}\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768/" ]
167,827
<p>Friends/family/etc ask me what I do and it always causes me pause while I think of how to explain it. They know what a software developer is but how can I explain what SCM is in 10 words?</p>
[ { "answer_id": 167992, "author": "John Ferguson", "author_id": 8312, "author_profile": "https://Stackoverflow.com/users/8312", "pm_score": 2, "selected": true, "text": "from many good parts:\none programme on your PC;\nlose track, get winter\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24881/" ]
167,844
<p>Disclaimer: I am new to Winforms.</p> <p>I need to declare a datatable that I can load with data when the main form loads. I then want to be able to reference the datatable from within events like when a button is clicked etc.</p> <p>Where/how should I declare this?</p>
[ { "answer_id": 168019, "author": "Saif Khan", "author_id": 23667, "author_profile": "https://Stackoverflow.com/users/23667", "pm_score": 0, "selected": false, "text": "Public \n\nClass Form3\n\nPrivate myTable as New DataTable\n\nPrivate Sub Button1_Click(ByVal sender As System.Object, B...
2008/10/03
[ "https://Stackoverflow.com/questions/167844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
167,852
<p>I am hosting a WCF service in a Windows Service on one of our servers. After making it work in basicHttpBinding and building a test client in .NET (which finally worked) I went along and try to access it from PHP using the SoapClient class. The final consumer will be a PHP site so I need to make it consumable in PHP...
[ { "answer_id": 167968, "author": "Kev", "author_id": 419, "author_profile": "https://Stackoverflow.com/users/419", "pm_score": 4, "selected": true, "text": "<system.serviceModel>\n <services>\n\n <service \n <!-- Namespace.ServiceClass implementation -->\n name=\"WcfService...
2008/10/03
[ "https://Stackoverflow.com/questions/167852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1796/" ]
167,862
<p>One of the vagaries of my development system (Codegear C++Builder) is that some of the auto-generated headers insist on having... </p> <pre><code>using namespace xyzzy </code></pre> <p>...statements in them, which impact on my code when I least want or expect it.</p> <p>Is there a way I can somehow cancel/overrid...
[ { "answer_id": 168007, "author": "jk.", "author_id": 21284, "author_profile": "https://Stackoverflow.com/users/21284", "pm_score": 6, "selected": false, "text": "using namespace {\n using namespace xyzzy;\n\n} // stop using namespace xyzzy here\n" }, { "answer_id": 168023, ...
2008/10/03
[ "https://Stackoverflow.com/questions/167862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1737/" ]
167,888
<p>I need to be able to GZip compress a file in an Excel VBA function. Specifically I need to be able to use the 'deflate' algorithm.</p> <p>Is there a way to do this without having to exec a command line application? With no dependency on external tools the code will be more robust.</p> <p>Ideally the code would mak...
[ { "answer_id": 167907, "author": "JPLemme", "author_id": 1019, "author_profile": "https://Stackoverflow.com/users/1019", "pm_score": 0, "selected": false, "text": "Sub main()\n ActiveWorkbook.Save\n Open \"macrotest.xls\" For Binary Access Read As #1\n Open \"newfile.zip\" For B...
2008/10/03
[ "https://Stackoverflow.com/questions/167888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4023/" ]
167,904
<p>Say there are two possible solutions to a problem: the first is quick but hacky; the second is preferable but would take longer to implement. You need to solve the problem fast, so you decide to get the hack in place as quickly as you can, planning to start work on the better solution afterwards. The trouble is, a...
[ { "answer_id": 169836, "author": "mm2001", "author_id": 19506, "author_profile": "https://Stackoverflow.com/users/19506", "pm_score": 1, "selected": false, "text": "HACK XXX HACK" }, { "answer_id": 205054, "author": "johnstok", "author_id": 27929, "author_profile": "h...
2008/10/03
[ "https://Stackoverflow.com/questions/167904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11575/" ]
167,909
<p>I hate Physics, but I love software development. When I go back to school after Thanksgiving, I'll be taking two more quarters of Physics before I'm done with the horrid thing. I am currently reading postings on the F# units of measurement feature, but I've never used a language like F#. Would it be suitable to writ...
[ { "answer_id": 168110, "author": "Chris Smith", "author_id": 322, "author_profile": "https://Stackoverflow.com/users/322", "pm_score": 5, "selected": true, "text": "let distance : float<meters> = gravity * 3.0<seconds>\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
167,916
<p>I have a few questions about optimizing this type of load.</p> <p>One builds a new table of data to be loaded into a partitioned table and then builds the indexes on this new table. </p> <ol> <li><p>Should you build the index with the COMPUTE STATISTICS option or use the Cascade option of the DBMS_Stats?</p></li> ...
[ { "answer_id": 168359, "author": "Adam Hawkes", "author_id": 6703, "author_profile": "https://Stackoverflow.com/users/6703", "pm_score": 0, "selected": false, "text": "DBMS_STATS COMPUTE STATISTICS" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
167,923
<p>This is a pretty straight forward attempt. I haven't been using python for too long. Seems to work but I am sure I have much to learn. Someone let me know if I am way off here. Needs to find patterns, write the first line which matches, and then add a summary message for remaining consecutive lines which match patte...
[ { "answer_id": 168009, "author": "tzot", "author_id": 6899, "author_profile": "https://Stackoverflow.com/users/6899", "pm_score": 2, "selected": true, "text": "def rematcher(re_str, iterable):\n\n matcher= re.compile(re_str)\n in_match= 0\n for item in iterable:\n if matc...
2008/10/03
[ "https://Stackoverflow.com/questions/167923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4527/" ]
167,927
<p>Can someone please provide an implementation of a C function that gets invoked to dump the current stack? It's for a x86 linux system. It can be invoked in 2 ways: explicitly by another function, or after a crash (probably as a trap/int handler). The output can be either to the screen or to a file, as indicated by...
[ { "answer_id": 2360876, "author": "jschmier", "author_id": 203667, "author_profile": "https://Stackoverflow.com/users/203667", "pm_score": 1, "selected": false, "text": "backtrace() backtrace() backtrace()" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8638/" ]
167,946
<p>As part of the base class for some extensive unit testing, I am writing a helper function which recursively compares the nodes of one XmlDocument object to another in C# (.NET). Some requirements of this:</p> <ul> <li>The first document is the <strong>source</strong>, e.g. what I want the XML document to look like...
[ { "answer_id": 30056490, "author": "Two Cents", "author_id": 4866984, "author_profile": "https://Stackoverflow.com/users/4866984", "pm_score": 3, "selected": false, "text": "public bool XMLCompare(XElement primary, XElement secondary)\n{\n if (primary.HasAttributes) {\n if (pri...
2008/10/03
[ "https://Stackoverflow.com/questions/167946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9642/" ]
167,952
<p>Null or empty string -- is one better than the other to represent no data in a table column? (I specifically use MySQL, but I'm thinking this is system-independent.) Are there major advantages/disadvantages to using one over the other, or is it simply programmer preference?</p>
[ { "answer_id": 167981, "author": "James Curran", "author_id": 12725, "author_profile": "https://Stackoverflow.com/users/12725", "pm_score": 1, "selected": false, "text": "select 1 from (select '' as col from dual) where col is null;\n" }, { "answer_id": 167986, "author": "Ad...
2008/10/03
[ "https://Stackoverflow.com/questions/167952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7596/" ]
167,954
<p>So I build an array of various dates. Birthdays, anniversaries, and holidays. I'd like to order the array by which one is happening next, essentially sort October to September (wrapping to next year)</p> <p>so if my array is </p> <pre><code>$a = ([0]=&gt;"1980-04-14", [1]=&gt;"2007-06-08", [2]=&gt;"2008-12-25",...
[ { "answer_id": 167995, "author": "cfeduke", "author_id": 5645, "author_profile": "https://Stackoverflow.com/users/5645", "pm_score": -1, "selected": false, "text": "$date1 = split(\"-\", $a);\n$date2 = split(\"-\", $b);\n$seconds1 = mktime(0,0,0,$date1[1],$date1[2],$date1[0]);\n$seconds2...
2008/10/03
[ "https://Stackoverflow.com/questions/167954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3800/" ]
167,990
<p>I am developing a small web app project (ColdFusion) and I am trying to keep my project split into multiple files during development, but deploy just one file on completion.</p> <p>I have references to external files, for instance:</p> <pre><code>&lt;script type="text/javascript" src="jquery-1.2.6.pack.js"&gt;&lt;...
[ { "answer_id": 169052, "author": "Peter Boughton", "author_id": 9360, "author_profile": "https://Stackoverflow.com/users/9360", "pm_score": 2, "selected": false, "text": "<property\n name=\"filename\"\n value=\"jquery-1.2.6.pack.js\"\n/>\n\n<loadfile\n property=\"contents\"\n ...
2008/10/03
[ "https://Stackoverflow.com/questions/167990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5918/" ]
168,017
<p>Does any one know how can I convert a BSTR to an int in VC++ 2008</p> <p>Thanks in advance.</p>
[ { "answer_id": 168021, "author": "Scott Hanselman", "author_id": 6380, "author_profile": "https://Stackoverflow.com/users/6380", "pm_score": 3, "selected": false, "text": "VarI4FromStr HRESULT VarI4FromStr(\n _In_ LPCOLESTR strIn,\n _In_ LCID lcid,\n _In_ ULONG dwFlags,\n _Out_...
2008/10/03
[ "https://Stackoverflow.com/questions/168017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24927/" ]
168,022
<p>I'm implementing a search algorithm (let's call it MyAlg) in a python package. Since the algorithm is super-duper complicated, the package has to contain an auxiliary class for algorithm options. Currently I'm developing the entire package by myself (and I'm not a programmer), however I expect 1-2 programmers to joi...
[ { "answer_id": 168085, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 2, "selected": false, "text": "Options open os Error from some_module import * open" }, { "answer_id": 168107, "author": "jblocksom", ...
2008/10/03
[ "https://Stackoverflow.com/questions/168022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
168,037
<p>I have an application that takes the quality results for a manufacturing process and creates graphs both to show Pareto charts of the bad, and also to show production throughput.</p> <p>To automate the task of testing these statistical procedures I would like to deterministically be able to add records into the da...
[ { "answer_id": 168075, "author": "albertein", "author_id": 23020, "author_profile": "https://Stackoverflow.com/users/23020", "pm_score": 0, "selected": false, "text": "Random rnd = new Random();\nList<int> orderedList = new List<int>();\nList<int> randomList = new List<int>();\nwhile (or...
2008/10/03
[ "https://Stackoverflow.com/questions/168037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12425/" ]
168,046
<p>I'm maintaining a library that contains compiled objects that need to be linked into a 3rd party executable. sometimes the executable has been compiled for Solaris, sometimes as a 32bit Linux Application, sometimes its a 64bit linux application. What I'd love to do is pass one "path" to the library, and have the a...
[ { "answer_id": 1005462, "author": "Steve K", "author_id": 121394, "author_profile": "https://Stackoverflow.com/users/121394", "pm_score": 0, "selected": false, "text": "LD_LIBRARY_PATH" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/168046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6314/" ]
168,073
<p>I'm currently writing a website that allows people to download Excel and text files. Is there a way to redirect to a different page when they click, so that we run javascript and do analytics (i.e. keep download count)? Currently, nothing prevents the user from simply right-clicking and saving. </p> <p>Edit: </p> ...
[ { "answer_id": 168121, "author": "Joe Skora", "author_id": 14057, "author_profile": "https://Stackoverflow.com/users/14057", "pm_score": 0, "selected": false, "text": "redirect(controller:\"book\",action:\"list\")\n" }, { "answer_id": 171574, "author": "mbrevoort", "autho...
2008/10/03
[ "https://Stackoverflow.com/questions/168073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6833/" ]
168,080
<p>I have a some JPA entities that inherit from one another and uses discriminator to determine what class to be created (untested as of yet).</p> <pre><code>@Entity(name="switches") @DiscriminatorColumn(name="type") @DiscriminatorValue(value="500") public class DmsSwitch extends Switch implements Serializable {} @Ma...
[ { "answer_id": 168728, "author": "extraneon", "author_id": 24582, "author_profile": "https://Stackoverflow.com/users/24582", "pm_score": 2, "selected": false, "text": "@Entity(name=\"switches\")\n@DiscriminatorColumn(name=\"type\")\n@DiscriminatorValue(value=\"400\")\npublic class Switch...
2008/10/03
[ "https://Stackoverflow.com/questions/168080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22763/" ]
168,084
<p>Usually pagination queries look like this. Is there a better way instead of making two almost equal methods, one of which executing "select *..." and the other one "count *..."?</p> <pre><code>public List&lt;Cat&gt; findCats(String name, int offset, int limit) { Query q = session.createQuery("from Cat where na...
[ { "answer_id": 168858, "author": "anjanb", "author_id": 11142, "author_profile": "https://Stackoverflow.com/users/11142", "pm_score": -1, "selected": false, "text": "Query q = sess.createQuery(\"from DomesticCat cat\");\nq.setFirstResult(20);\nq.setMaxResults(10);\nList cats = q.list();\...
2008/10/03
[ "https://Stackoverflow.com/questions/168084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20128/" ]
168,116
<p>Here's a link to Windows <a href="http://msdn.microsoft.com/en-us/library/ms683218(VS.85).aspx" rel="nofollow noreferrer">documentation</a>.</p> <p>Basically I would like to get similar data, but on Linux. If not all is possible, then at least some parts.</p>
[ { "answer_id": 168123, "author": "dmckee --- ex-moderator kitten", "author_id": 2509, "author_profile": "https://Stackoverflow.com/users/2509", "pm_score": 1, "selected": false, "text": "/proc/<PID>/ man 5 proc" }, { "answer_id": 168693, "author": "ypnos", "author_id": 21...
2008/10/03
[ "https://Stackoverflow.com/questions/168116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9403/" ]
168,119
<p>I have a pretty unusual problem (for me). I am writing an application that will allow a user to change their system time forward or back either by explicit date (change my date to 6/3/1955) or by increment using buttons (go forward 1 month).</p> <p>I'm writing this to help some of my users test some software that...
[ { "answer_id": 190434, "author": "user26293", "author_id": 26293, "author_profile": "https://Stackoverflow.com/users/26293", "pm_score": 3, "selected": false, "text": "procedure SetSystemDateTime(aDateTime: TDateTime);\nvar\n lSystemTime: TSystemTime;\n lTimeZone: TTimeZoneInformation;...
2008/10/03
[ "https://Stackoverflow.com/questions/168119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/172/" ]
168,150
<p>I've been trying to get up to speed on some of the newer features in C# and one of them that I haven't had occasion to use is anonymous types.</p> <p>I understand the usage as it pertains to LINQ queries and I looked at <a href="https://stackoverflow.com/questions/48668/how-should-anonymous-types-be-used-in-c">this...
[ { "answer_id": 168159, "author": "Giovanni Galbo", "author_id": 4050, "author_profile": "https://Stackoverflow.com/users/4050", "pm_score": 2, "selected": false, "text": "var x = new { a = 1, b = 2 };\n" }, { "answer_id": 172629, "author": "Bradley Grainger", "author_id":...
2008/10/03
[ "https://Stackoverflow.com/questions/168150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7862/" ]
168,169
<p>Has anyone else seen people do this:</p> <pre><code>private string _name; public string Name{ get{ return _name; } set{ _name = value;}}</code></pre> <p>I understand using accessors if you are going to exercise some sort of control over how it gets set or perform some sort of function on it when there is a get. B...
[ { "answer_id": 168221, "author": "Robert Rossney", "author_id": 19403, "author_profile": "https://Stackoverflow.com/users/19403", "pm_score": 6, "selected": true, "text": "public string Name { get; set; }\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/168169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19038/" ]
168,171
<p>Can someone provide a regular expression for parsing name/value pairs from a string? The pairs are separated by commas, and the value can optionally be enclosed in quotes. For example:</p> <pre><code>AssemblyName=foo.dll,ClassName="SomeClass",Parameters="Some,Parameters" </code></pre>
[ { "answer_id": 168196, "author": "Markus Jarderot", "author_id": 22364, "author_profile": "https://Stackoverflow.com/users/22364", "pm_score": 6, "selected": true, "text": "/([^=,]*)=(\"[^\"]*\"|[^,\"]*)/\n /((?:\"[^\"]*\"|[^=,])*)=((?:\"[^\"]*\"|[^=,])*)/\n\nkey=value,\"key with \"\" in...
2008/10/03
[ "https://Stackoverflow.com/questions/168171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2773/" ]
168,173
<p>I have a webpage that pulls information from a database, converts it to .csv format, and writes the file to the HTTPResponse. </p> <pre><code>string csv = GetCSV(); Response.Clear(); Response.ContentType = "text/csv"; Response.Write(csv); </code></pre> <p>This works fine, and the file is sent to the client with n...
[ { "answer_id": 168182, "author": "Joe Skora", "author_id": 14057, "author_profile": "https://Stackoverflow.com/users/14057", "pm_score": 5, "selected": true, "text": "Response.AddHeader(\"content-disposition\", \"attachment; filename=NewFileName.csv\");\n" }, { "answer_id": 16818...
2008/10/03
[ "https://Stackoverflow.com/questions/168173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21461/" ]
168,214
<p>What is the easiest way to encode a PHP string for output to a JavaScript variable?</p> <p>I have a PHP string which includes quotes and newlines. I need the contents of this string to be put into a JavaScript variable.</p> <p>Normally, I would just construct my JavaScript in a PHP file, à la:</p> <pre><code>&lt...
[ { "answer_id": 168255, "author": "Adam", "author_id": 1366, "author_profile": "https://Stackoverflow.com/users/1366", "pm_score": -1, "selected": false, "text": "<script>\n var myvar = {$MyVarValue};\n</script>\n" }, { "answer_id": 168265, "author": "Chris MacDonald", ...
2008/10/03
[ "https://Stackoverflow.com/questions/168214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13238/" ]
168,218
<p>I was considering creating a separate SQLite database for certain apps on a Django project.<br> However, I did not want to use direct SQLite access if possible. Django-style ORM access to these database would be ideal.<br> Is this possible?</p> <p>Thank you.</p>
[ { "answer_id": 170251, "author": "Jonny Buchanan", "author_id": 6760, "author_profile": "https://Stackoverflow.com/users/6760", "pm_score": 3, "selected": false, "text": "QuerySet Query __init__() QuerySet query django.db.models.sql.Query __init__() Query connection django.db.backends.Ba...
2008/10/03
[ "https://Stackoverflow.com/questions/168218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/143732/" ]
168,236
<p>I am trying to set attributes for an IFRAME html control from the code-behind aspx.cs file.</p> <p>I came across a <a href="https://web.archive.org/web/20210128094503/http://geekswithblogs.net/ranganh/archive/2005/04/25/37635.aspx" rel="nofollow noreferrer">post</a> that says you can use FindControl to find the non-...
[ { "answer_id": 168286, "author": "Joe Ratzer", "author_id": 4092, "author_profile": "https://Stackoverflow.com/users/4092", "pm_score": 1, "selected": false, "text": "this.Master.FindControl(\"ContentId\").FindControl(\"controlId\")\n" }, { "answer_id": 168306, "author": "Rya...
2008/10/03
[ "https://Stackoverflow.com/questions/168236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
168,249
<p>Let's say I have a multithreaded C++ program that handles requests in the form of a function call to <code>handleRequest(string key)</code>. Each call to <code>handleRequest</code> occurs in a separate thread, and there are an arbitrarily large number of possible values for <code>key</code>.</p> <p>I want the follo...
[ { "answer_id": 168282, "author": "coppro", "author_id": 16855, "author_profile": "https://Stackoverflow.com/users/16855", "pm_score": 2, "selected": false, "text": "std::map<std::string, MutexType> MutexType" }, { "answer_id": 169106, "author": "Constantin", "author_id": ...
2008/10/03
[ "https://Stackoverflow.com/questions/168249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24923/" ]
168,280
<p>I want to allow an Excel report to be viewed embedded in a WebPage... is there a way?</p> <ul> <li><p>I don't want to use an ActiveX, or OWC (Office Web Components), I just want to open an existing file from the internet explorer application.</p></li> <li><p>I don't want users to download and then open it.</p></li>...
[ { "answer_id": 168351, "author": "Diodeus - James MacFarlane", "author_id": 12579, "author_profile": "https://Stackoverflow.com/users/12579", "pm_score": -1, "selected": false, "text": "<iframe src=\"file:\\\\yourpath\\yourfile.xls\" width=\"100%\" height=\"500\"></iframe>\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/168280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1782/" ]
168,317
<p>We have a SmartClient built in C# that stubornly remains open when the PC its running on is being restarted. This halts the restart process unless the user first closes the SmartClient or there is some other manual intervention.</p> <p>This is causing problems when the infrastructure team remotely installs new sof...
[ { "answer_id": 168365, "author": "Vincent McNabb", "author_id": 16299, "author_profile": "https://Stackoverflow.com/users/16299", "pm_score": 4, "selected": true, "text": "...\nMicrosoft.Win32.SystemEvents.SessionEnded +=new\n Microsoft.Win32.SessionEndedEventHandler(shutdownHandler);\n...
2008/10/03
[ "https://Stackoverflow.com/questions/168317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24179/" ]
168,369
<p>After working for a few days with Eclipse Java I totally got addicted to pressing <kbd>Ctrl</kbd> and clicking on an identifier to go to its definition. Since then I've been looking for a way to achieve this in Visual Studio as well.</p> <p>I realize VS has right click, Go to definition, and that <kbd>F12</kbd> doe...
[ { "answer_id": 33536128, "author": "Se Song", "author_id": 3458608, "author_profile": "https://Stackoverflow.com/users/3458608", "pm_score": 6, "selected": false, "text": "Go To Definition TOOLS Extensions and Updates" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/168369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9611/" ]
168,396
<p>Is there a way to use .NET reflection to capture the values of all parameters/local variables?</p>
[ { "answer_id": 168425, "author": "RyanFetz", "author_id": 23776, "author_profile": "https://Stackoverflow.com/users/23776", "pm_score": 0, "selected": false, "text": "System.Diagnostics.StackTrace sTrace = new System.Diagnostics.StackTrace(true);\nfor (Int32 frameCount = 0; frameCount < ...
2008/10/03
[ "https://Stackoverflow.com/questions/168396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7529/" ]
168,402
<p>I have run across an XML Schema with the following definition:</p> <pre><code>&lt;xs:simpleType name="ClassRankType"&gt; &lt;xs:restriction base="xs:integer"&gt; &lt;xs:totalDigits value="4"/&gt; &lt;xs:minInclusive value="1"/&gt; &lt;xs:maxInclusive value="9999"/&gt; &lt;/xs:restric...
[ { "answer_id": 168466, "author": "ConroyP", "author_id": 2287, "author_profile": "https://Stackoverflow.com/users/2287", "pm_score": 4, "selected": true, "text": "minInclusive maxInclusive totalDigits <xsd:totalDigits>" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/168402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24954/" ]
168,408
<p>It looks like I had a fundamental misunderstanding about C++ :&lt;</p> <p>I like the polymorphic container solution. Thank you SO, for bringing that to my attention :)</p> <hr> <p>So, we have a need to create a relatively generic container type object. It also happens to encapsulate some business related logic. H...
[ { "answer_id": 168442, "author": "Lev", "author_id": 7224, "author_profile": "https://Stackoverflow.com/users/7224", "pm_score": 3, "selected": false, "text": "void push(T* new_element) void* Storable Storable* void* void push(Storable* new_element)" }, { "answer_id": 168451, ...
2008/10/03
[ "https://Stackoverflow.com/questions/168408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14621/" ]
168,409
<p>What is the best way to get a list of all files in a directory, sorted by date [created | modified], using python, on a windows machine?</p>
[ { "answer_id": 168424, "author": "Jay", "author_id": 20840, "author_profile": "https://Stackoverflow.com/users/20840", "pm_score": 8, "selected": false, "text": "import glob\nimport os\n\nsearch_dir = \"/mydir/\"\n# remove anything from the list that is not a file (directories, symlinks)...
2008/10/03
[ "https://Stackoverflow.com/questions/168409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24953/" ]
168,415
<p>For my current project, I need to request XML data over a tcp/ip socket connection. For this, I am using the TcpClient class:</p> <pre><code>Dim client As New TcpClient() client.Connect(server, port) Dim stream As NetworkStream = client.GetStream() stream.Write(request) stream.Read(buffer, 0, buffer.length) // O...
[ { "answer_id": 168418, "author": "Sunny Milenov", "author_id": 8220, "author_profile": "https://Stackoverflow.com/users/8220", "pm_score": 3, "selected": true, "text": "int bytes_read = 0;\nwhile (bytes_read < buffer.Length)\n bytes_read += stream.Read(buffer, bytes_read, buffer.length...
2008/10/03
[ "https://Stackoverflow.com/questions/168415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
168,423
<p>I have a personal wiki that I take notes on. The wiki's pages are in a subversion working copy directory, "pages", and I set their permissions to 664, owned by www-data:www-data. My username is in the "www-data" group, so I can checkin and mess with the pages manually.</p> <p>For a while, I had an issue because e...
[ { "answer_id": 178496, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 3, "selected": true, "text": "find -type d -exec chgrp www-data {} + \nfind -type d -exec chmod g+s {} + \n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/168423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16034/" ]
168,427
<p>Which of <a href="http://en.wikipedia.org/wiki/Crystal_Reports" rel="noreferrer">Crystal Reports</a> and <a href="http://en.wikipedia.org/wiki/SQL_Server_Reporting_Services" rel="noreferrer">SSRS</a> (SQL Server Reporting Services) is better to use?</p>
[ { "answer_id": 171536, "author": "Peter Wone", "author_id": 1715673, "author_profile": "https://Stackoverflow.com/users/1715673", "pm_score": 7, "selected": false, "text": "SELECT COUNT(*) FROM SOMETABLE WHERE 1=0" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/168427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14299/" ]
168,438
<p>I'm trying to parse objects to XML in Delphi, so I read about calling the object's ClassInfo method to get its RTTI info.</p> <p>The thing is, this apparently only works for TPersistent objects. Otherwise, I have to specifically add a compiler directive {$M+} to the source code for the compiler to generate RTTI inf...
[ { "answer_id": 168476, "author": "gabr", "author_id": 4997, "author_profile": "https://Stackoverflow.com/users/4997", "pm_score": 4, "selected": true, "text": "published" }, { "answer_id": 46253778, "author": "Edgar Pavão", "author_id": 8527033, "author_profile": "htt...
2008/10/03
[ "https://Stackoverflow.com/questions/168438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16732/" ]
168,455
<p>How do you post data to an iframe?</p>
[ { "answer_id": 168488, "author": "Dylan Beattie", "author_id": 5017, "author_profile": "https://Stackoverflow.com/users/5017", "pm_score": 10, "selected": true, "text": "target=\"\" <form /> <form action=\"do_stuff.aspx\" method=\"post\" target=\"my_iframe\">\n <input type=\"submit\" va...
2008/10/03
[ "https://Stackoverflow.com/questions/168455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24958/" ]
168,464
<p>Since <em>length</em> is a JavaScript property, does it matter whether I use</p> <pre><code>for( var i = 0; i &lt; myArray.length; i++ ) </code></pre> <p>OR</p> <pre><code>var myArrayLength = myArray.length; for( var i = 0; i &lt; myArrayLength ; i++ ) </code></pre> <p>­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­<...
[ { "answer_id": 168473, "author": "Grant Wagner", "author_id": 9254, "author_profile": "https://Stackoverflow.com/users/9254", "pm_score": 3, "selected": false, "text": "for(var i = 0, iLen = myArray.length; i < iLen; i++)\n" }, { "answer_id": 168479, "author": "AnthonyWJones"...
2008/10/03
[ "https://Stackoverflow.com/questions/168464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
168,486
<p>For my customer I occasionally do work in their live database in order to fix a problem they have created for themselves, or in order to fix bad data that my product's bugs created. Much like Unix root access, it's just dangerous. What lessons should I learn ahead of time?</p> <p>What is the #1 thing you do to be...
[ { "answer_id": 168508, "author": "bdukes", "author_id": 2688, "author_profile": "https://Stackoverflow.com/users/2688", "pm_score": 2, "selected": false, "text": "WHERE DELETE UPDATE" }, { "answer_id": 168529, "author": "Paul Tomblin", "author_id": 3333, "author_profi...
2008/10/03
[ "https://Stackoverflow.com/questions/168486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10906/" ]
168,528
<p>I know I can get this to technically work but I'd like to implement the cleanest possible solution. Here's the situation:</p> <p>I have a managed library which wraps an unmanaged C-style library. The C-style library functionality I'm currently wrapping does some processing involving a list of strings. The librar...
[ { "answer_id": 168604, "author": "Rob Walker", "author_id": 3631, "author_profile": "https://Stackoverflow.com/users/3631", "pm_score": 2, "selected": false, "text": "\n#pragma managed\npublic delegate string InvalidStringFilter(int lineNumber, string text);\n\n...\nstatic InvalidStringF...
2008/10/03
[ "https://Stackoverflow.com/questions/168528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24965/" ]
168,531
<p>I have a very large file that looks like this (see below). I have two basic choices of regex to use on it (I know there may be others but I'm really trying to compare Greedy and Negated Char Class) methods.</p> <pre><code>ftp: [^\D]{1,} ftp: (\d)+ ftp: \d+ </code></pre> <p><strong><em>Note: what if I took off the...
[ { "answer_id": 168563, "author": "Markus Jarderot", "author_id": 22364, "author_profile": "https://Stackoverflow.com/users/22364", "pm_score": 2, "selected": false, "text": "\\d+?\n" }, { "answer_id": 168570, "author": "thelsdj", "author_id": 163, "author_profile": "h...
2008/10/03
[ "https://Stackoverflow.com/questions/168531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/730/" ]
168,550
<p>How can I display a tooltip over a button using <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="noreferrer">Windows Forms</a>?</p>
[ { "answer_id": 168555, "author": "Fry", "author_id": 23553, "author_profile": "https://Stackoverflow.com/users/23553", "pm_score": -1, "selected": false, "text": "ToolTip t = new ToolTip();\n private void control_MouseHover(object sender, EventArgs e)\n{\n t.Show(\"Text\", (Control)send...
2008/10/03
[ "https://Stackoverflow.com/questions/168550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
168,559
<p><a href="http://www.python.org/doc/2.5.2/lib/module-tempfile.html" rel="noreferrer">tempfile.mkstemp()</a> returns:</p> <blockquote> <p>a tuple containing an OS-level handle to an open file (as would be returned by os.open()) and the absolute pathname of that file, in that order.</p> </blockquote> <p>How do I co...
[ { "answer_id": 168584, "author": "Peter Hoffmann", "author_id": 720, "author_profile": "https://Stackoverflow.com/users/720", "pm_score": 7, "selected": true, "text": "os.write(tup[0], \"foo\\n\")\n f = os.fdopen(tup[0], \"w\")\nf.write(\"foo\")\n" }, { "answer_id": 168705, "...
2008/10/03
[ "https://Stackoverflow.com/questions/168559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4766/" ]
168,560
<p>What is the best way to perform a couple of tasks together and if one task fails then the next tasks should not be completed? I know if it were the database operations then I should have used Transactions but I am talking about different types of operations like the following: </p> <p>All tasks must pass: </p> <p>...
[ { "answer_id": 168605, "author": "easeout", "author_id": 10906, "author_profile": "https://Stackoverflow.com/users/10906", "pm_score": 1, "selected": false, "text": "try {\n task1();\n task2();\n task3();\n ...\n taskN();\n}\ncatch (TaskFailureException e) {\n dealWith(...
2008/10/03
[ "https://Stackoverflow.com/questions/168560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3797/" ]
168,589
<p>I can do this:</p> <pre><code>$ find . . ./b ./b/foo ./c ./c/foo </code></pre> <p>And this:</p> <pre><code>$ find . -type f -exec cat {} \; This is in b. This is in c. </code></pre> <p>But not this:</p> <pre><code>$ find . -type f -exec cat &gt; out.txt {} \; </code></pre> <p>Why not?</p>
[ { "answer_id": 168595, "author": "Commodore Jaeger", "author_id": 4659, "author_profile": "https://Stackoverflow.com/users/4659", "pm_score": 6, "selected": true, "text": "$ find . -type f -exec cat {} \\; > out.txt\n $ find . -type f | xargs cat > out.txt\n $ find . -type f -print0 | xa...
2008/10/03
[ "https://Stackoverflow.com/questions/168589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22917/" ]
168,594
<p>I am creating some build scripts that interact with Perforce and I would like to mark for delete a few files. What exactly is the P4 syntax using the command line?</p>
[ { "answer_id": 168614, "author": "JR Lawhorne", "author_id": 22917, "author_profile": "https://Stackoverflow.com/users/22917", "pm_score": 4, "selected": true, "text": "p4 delete filename\n Opens a file that currently exists in the depot for deletion.\nIf the file is present on the clien...
2008/10/03
[ "https://Stackoverflow.com/questions/168594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872/" ]
168,596
<p>When an Event is triggered by a user in IE, it is set to the <code>window.event</code> object. The only way to see what triggered the event is by accessing the <code>window.event</code> object (as far as I know)</p> <p>This causes a problem in ASP.NET validators if an event is triggered programmatically, like when ...
[ { "answer_id": 371396, "author": "quark", "author_id": 46680, "author_profile": "https://Stackoverflow.com/users/46680", "pm_score": 3, "selected": false, "text": "jQuery.fn.extend({\n fire: function(evttype){ \n el = this.get(0);\n if (document.createEvent) {\n ...
2008/10/03
[ "https://Stackoverflow.com/questions/168596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/392/" ]
168,610
<p>I have a PHP web application on an intranet that can extract the IP and host name of the current user on that page, but I was wondering if there is a way to get/extract their Active Directory/Windows username as well. Is this possible?</p>
[ { "answer_id": 168626, "author": "Dylan Beattie", "author_id": 5017, "author_profile": "https://Stackoverflow.com/users/5017", "pm_score": 7, "selected": true, "text": "AUTH_USER AUTH_USER MYDOMAIN\\user.name" }, { "answer_id": 168675, "author": "hangy", "author_id": 1196...
2008/10/03
[ "https://Stackoverflow.com/questions/168610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10708/" ]
168,621
<p>I'm having trouble with my php code not indenting correctly...</p> <p>I would like my code to look like this</p> <pre><code>if (foo) { print "i am indented"; } </code></pre> <p>but it always looks like this:</p> <pre><code>if (foo) { print "i am not indented correctly"; } </code></pre> <p>I tired go...
[ { "answer_id": 171798, "author": "troelskn", "author_id": 18180, "author_profile": "https://Stackoverflow.com/users/18180", "pm_score": 1, "selected": false, "text": "(defun my-build-tab-stop-list (width)\n (let ((num-tab-stops (/ 80 width))\n (counter 1)\n (ls nil))\n ...
2008/10/03
[ "https://Stackoverflow.com/questions/168621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
168,639
<p>In Java, suppose I have a String variable S, and I want to search for it inside of another String T, like so:</p> <pre><code> if (T.matches(S)) ... </code></pre> <p>(note: the above line was T.contains() until a few posts pointed out that that method does not use regexes. My bad.)</p> <p>But now suppose S may ...
[ { "answer_id": 168662, "author": "Aaron", "author_id": 19130, "author_profile": "https://Stackoverflow.com/users/19130", "pm_score": 0, "selected": false, "text": " String S = \"\\\\[hi\"\n \\[hi\n if (T.indexOf(\"[hi\") != -1) {\n" }, { "answer_id": 168884, "author": "M...
2008/10/03
[ "https://Stackoverflow.com/questions/168639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24973/" ]
168,659
<p>I found this via google: <a href="http://www.mvps.org/access/api/api0008.htm" rel="nofollow noreferrer">http://www.mvps.org/access/api/api0008.htm</a></p> <pre class="lang-vb prettyprint-override"><code>'******************** Code Start ************************** ' This code was originally written by Dev Ashish. ' I...
[ { "answer_id": 168682, "author": "bugBurger", "author_id": 13337, "author_profile": "https://Stackoverflow.com/users/13337", "pm_score": 1, "selected": false, "text": "For Each strComputer In arrComputers\n Set objWMIService = GetObject(\"winmgmts:\\\\\" & strComputer & \"\\root\\cimv...
2008/10/03
[ "https://Stackoverflow.com/questions/168659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2462/" ]
168,661
<p>I have a table with one column and about ten rows. The first column has rows with text as row headers, "header 1", "header 2". The second column contains fields for the user to type data (<em>textboxes</em> and <em>checkboxes</em>). </p> <p>I want to have a button at the top labelled "<em>Add New...</em>", and h...
[ { "answer_id": 168670, "author": "Tom Ritter", "author_id": 8435, "author_profile": "https://Stackoverflow.com/users/8435", "pm_score": 2, "selected": false, "text": "function(table)\n{\n for(var i=0;i<table.rows.length;i++)\n {\n newcell = table.rows[i].cells[0].cloneNode(true);\n ...
2008/10/03
[ "https://Stackoverflow.com/questions/168661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
168,664
<p>Given a table or a temp table, I'd like to run a procedure that will output a SQL script (i.e. a bunch of INSERT statements) that would populate the table. Is this possible in MS SQL Server 2000?</p>
[ { "answer_id": 168670, "author": "Tom Ritter", "author_id": 8435, "author_profile": "https://Stackoverflow.com/users/8435", "pm_score": 2, "selected": false, "text": "function(table)\n{\n for(var i=0;i<table.rows.length;i++)\n {\n newcell = table.rows[i].cells[0].cloneNode(true);\n ...
2008/10/03
[ "https://Stackoverflow.com/questions/168664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17997/" ]
168,672
<p>I have a table on SQL2000 with a numeric column and I need the select to return a 01, 02, 03...</p> <p>It currently returns 1,2,3,...10,11...</p> <p>Thanks.</p>
[ { "answer_id": 168689, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 4, "selected": true, "text": "SELECT REPLACE(STR(mycolumn, 2), ' ', '0')\n" }, { "answer_id": 168739, "author": "Patrick Szalapski", ...
2008/10/03
[ "https://Stackoverflow.com/questions/168672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/212/" ]
168,691
<p>If I'm deep in a nest of loops I'm wondering which of these is more efficient:</p> <pre><code>if (!isset($array[$key])) $array[$key] = $val; </code></pre> <p>or</p> <pre><code>$array[$key] = $val; </code></pre> <p>The second form is much more desirable as far as readable code goes. In reality the names are longe...
[ { "answer_id": 168820, "author": "hangy", "author_id": 11963, "author_profile": "https://Stackoverflow.com/users/11963", "pm_score": 2, "selected": false, "text": "$array[$key] $array[$key] $val $array[$key] $val $array[$key]" }, { "answer_id": 168824, "author": "Robert K", ...
2008/10/03
[ "https://Stackoverflow.com/questions/168691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8722/" ]
168,727
<p>A lot of useful features in Python are somewhat "hidden" inside modules. Named tuples (new in <a href="http://docs.python.org/whatsnew/2.6.html" rel="nofollow noreferrer">Python 2.6</a>), for instance, are found in the <a href="http://docs.python.org/library/collections.html" rel="nofollow noreferrer">collections</a...
[ { "answer_id": 168768, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 4, "selected": false, "text": "multiprocessing threading Queue Lock" }, { "answer_id": 168795, "author": "Dan Lenski", "author_id":...
2008/10/03
[ "https://Stackoverflow.com/questions/168727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8669/" ]
168,732
<p>.NET has System.Uri for Uris and System.IO.FileInfo for file paths. I am looking for classes which are traditionally object oriented in that they specify both meaning and behavior for the string which is used in the object's construction. What other useful string encapsulation classes exist?</p> <p>Things such as r...
[ { "answer_id": 168782, "author": "hangy", "author_id": 11963, "author_profile": "https://Stackoverflow.com/users/11963", "pm_score": 2, "selected": false, "text": "using (System.Security.SecureString password = new System.Security.SecureString())\n{\n password.AppendChar('s');\n pa...
2008/10/03
[ "https://Stackoverflow.com/questions/168732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9251/" ]
168,736
<p>How do you set a default value for a MySQL Datetime column?</p> <p>In SQL Server it's <code>getdate()</code>. What is the equivalant for MySQL? I'm using MySQL 5.x if that is a factor.</p>
[ { "answer_id": 168832, "author": "sebthebert", "author_id": 24820, "author_profile": "https://Stackoverflow.com/users/24820", "pm_score": 11, "selected": true, "text": "mysql> create table test (str varchar(32), ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP);\nQuery OK, 0 rows affected (0.00 se...
2008/10/03
[ "https://Stackoverflow.com/questions/168736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3747/" ]
168,738
<p>I am building the diagram component in JavaScript. It has two layers rendered separately: foreground and background.</p> <p>To determine the required size of the background:</p> <ol> <li>render the foreground </li> <li>measure the height of the result</li> <li>render the foreground and the background together</li...
[ { "answer_id": 168767, "author": "Dan", "author_id": 17121, "author_profile": "https://Stackoverflow.com/users/17121", "pm_score": 2, "selected": false, "text": "setTimeout(renderBackground, 0)\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/168738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24451/" ]
168,798
<p>I've exposed several web services in our product using Java and WS-Security. One of our customers wants to consume the web service using ColdFusion. Does ColdFusion support WS-Security? Can I get around it by writing a Java client and using that in ColdFusion?</p> <p>(I don't know much about ColdFusion).</p>
[ { "answer_id": 178131, "author": "Jason", "author_id": 3242, "author_profile": "https://Stackoverflow.com/users/3242", "pm_score": 4, "selected": true, "text": "<cfset local.soapHeader = xmlNew()>\n<cfset local.soapHeader.TheSoapHeader = xmlElemNew(local.soapHeader, \"http://someurl.com/...
2008/10/03
[ "https://Stackoverflow.com/questions/168798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310/" ]
168,826
<p>In ASP.net 2.0, the PreviousPage property of a web page does not have a ViewState collection. I want to use this collection to transfer information between pages.</p>
[ { "answer_id": 168888, "author": "Keith Walton", "author_id": 22448, "author_profile": "https://Stackoverflow.com/users/22448", "pm_score": 0, "selected": false, "text": "<%@ previouspagetype virtualpath=\"~/firstpage.aspx\" %>\n If (Not MyBase.IsPostBack) Then\n\n _someValue = Me.Pre...
2008/10/03
[ "https://Stackoverflow.com/questions/168826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22448/" ]
168,833
<p>I wish to perform an experiment many different times. After every trial, I am left with a "large" set of output statistics -- let's say, 1000. I would like to store the outputs of my experiments in a table, but what's the best way...?</p> <h3>Option 1</h3> <p>Have a table with 1000 columns. Seems like a bad ide...
[ { "answer_id": 168850, "author": "matli", "author_id": 23896, "author_profile": "https://Stackoverflow.com/users/23896", "pm_score": 0, "selected": false, "text": "SELECT * FROM table WHERE Experiment = 5;" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/168833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10675/" ]
168,838
<p>I am trying to visualize some values on a form. They range from 0 to 200 and I would like the ones around 0 be green and turn bright red as they go to 200. </p> <p>Basically the function should return color based on the value inputted. Any ideas ?</p>
[ { "answer_id": 168846, "author": "Peter Parker", "author_id": 23264, "author_profile": "https://Stackoverflow.com/users/23264", "pm_score": 3, "selected": false, "text": "red = (float)val / 200 * 255;\n\ngreen = (float)(200 - val) / 200 * 255;\n\nblue = 0;\n\nreturn red << 16 + green << ...
2008/10/03
[ "https://Stackoverflow.com/questions/168838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4694/" ]
168,886
<p>I'm looking for a homegrown way to scramble production data for use in development and test. I've built a couple of scripts that make random social security numbers, shift birth dates, scramble emails, etc. But I've come up against a wall trying to scramble customer names. I want to keep real names so we can stil...
[ { "answer_id": 807426, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "DECLARE TABLE #Names \n(Id int IDENTITY(1,1),[Name] varchar(100))\n INSERT #Names\n SELECT LastName \n FROM Customer \n ORD...
2008/10/03
[ "https://Stackoverflow.com/questions/168886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24991/" ]
168,891
<p>If I have a sorted list (say quicksort to sort), if I have a lot of values to add, is it better to suspend sorting, and add them to the end, then sort, or use binary chop to place the items correctly while adding them. Does it make a difference if the items are random, or already more or less in order?</p>
[ { "answer_id": 168934, "author": "Ihar Bury", "author_id": 18001, "author_profile": "https://Stackoverflow.com/users/18001", "pm_score": 0, "selected": false, "text": "List<T>" }, { "answer_id": 169424, "author": "hazzen", "author_id": 5066, "author_profile": "https:/...
2008/10/03
[ "https://Stackoverflow.com/questions/168891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22712/" ]
168,897
<p>Is it more performant to have a bidimensional array (<code>type[,]</code>) or an array of arrays (<code>type[][]</code>) in C#?</p> <p>Particularly for initial allocation and item access</p>
[ { "answer_id": 169958, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 4, "selected": true, "text": "Size 1000, Repeat 1000\n int[,] set: 3460\n int[,] get: 4036 (chk=1304808064)\n int[][] set: 2441\n int[][...
2008/10/03
[ "https://Stackoverflow.com/questions/168897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1782/" ]
168,901
<pre><code>private IEnumerable&lt;string&gt; Tables { get { yield return "Foo"; yield return "Bar"; } } </code></pre> <p>Let's say I want iterate on those and write something like processing #n of #m. </p> <p>Is there a way I can find out the value of m without iterating before my main ite...
[ { "answer_id": 168922, "author": "Mendelt", "author_id": 3320, "author_profile": "https://Stackoverflow.com/users/3320", "pm_score": 10, "selected": true, "text": "IEnumerable IEnumerable ICollection<T> Count" }, { "answer_id": 168954, "author": "Joel Coehoorn", "author_i...
2008/10/03
[ "https://Stackoverflow.com/questions/168901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23893/" ]
168,912
<p>I need to show only one element at a time when a link is clicked on. Right now I'm cheating by hiding everything again and then toggling the element clicked on. This works, unless i want EVERYTHING to disappear again. Short of adding a "Hide All" button/link what can i do? I would like to be able to click on the lin...
[ { "answer_id": 169036, "author": "micahwittman", "author_id": 11181, "author_profile": "https://Stackoverflow.com/users/11181", "pm_score": 3, "selected": true, "text": "$(\"#linkgarykhit\").click(function(){\n if($(\"#infogarykhit\").css('display') != 'none'){\n $(\"#infogarykhit...
2008/10/03
[ "https://Stackoverflow.com/questions/168912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50/" ]