qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
380,287
<p>I'd like to play mp3 files (b/c they compress smaller than .wav's) from a vb6 app but without needing any other player installed.</p> <p>Any suggestions?</p>
[ { "answer_id": 389909, "author": "Kris Erickson", "author_id": 3798, "author_profile": "https://Stackoverflow.com/users/3798", "pm_score": 4, "selected": true, "text": "Declare Function mciSendString Lib \"winmm\" Alias \"mciSendStringA\" (ByVal _\n lpstrCommand As String, ByVal lpstr...
2008/12/19
[ "https://Stackoverflow.com/questions/380287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4906/" ]
380,321
<p>Is there a plain API to access Mercurial repositories from Java?</p> <p>There are plugins for Netbeans and Eclipse, but unlike their Subversion counterparts, they do not use a common lower-level library but bring their own wrappers to call out to the Mercurial binary. Calling the binary would be okay (for now), but...
[ { "answer_id": 7981412, "author": "Martin Geisler", "author_id": 110204, "author_profile": "https://Stackoverflow.com/users/110204", "pm_score": 4, "selected": false, "text": "public void commitTest() throws IOException {\n Repository repo = getTestRepository();\n writeFile(\"x\", ...
2008/12/19
[ "https://Stackoverflow.com/questions/380321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14955/" ]
380,324
<p>Im using vs2008 and Im also using the autogenerated object model / entity classes from linq to sql (.dbml).</p> <p>Is it possible / recommended to change the autogenerated .cs file. Eg change the behaviour of Equals (in the partical class Courses)?</p> <p>I do know that Equals should be reflexive, symmetric, trans...
[ { "answer_id": 380328, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 4, "selected": true, "text": "partial" }, { "answer_id": 380377, "author": "Rune Grimstad", "author_id": 30366, "author_profile": "https:...
2008/12/19
[ "https://Stackoverflow.com/questions/380324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148909/" ]
380,338
<p>I am divided between using a C# implementation and a pure SQL 2005/2008 implementation. I need to determine the length of usage based on timestamps of their last actions. My table contains "friendID" (uniqueIdentifier) and "lastAction" datetime. Here is an example:</p> <pre> Bob, 1:00 PM Bob, 1:01 PM Bob, 1:20...
[ { "answer_id": 778796, "author": "Bruce", "author_id": 94464, "author_profile": "https://Stackoverflow.com/users/94464", "pm_score": 1, "selected": false, "text": "select friendId, max(lastAction) 'lastAction'\n from myTable\n where lastAction >= dateadd(day, -1, getdate())\n -- d...
2008/12/19
[ "https://Stackoverflow.com/questions/380338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
380,341
<p>I have a bash file that contains wget commands to download over 100,000 files totaling around 20gb of data.</p> <p>The bash file looks something like:</p> <p>wget <a href="http://something.com/path/to/file.data" rel="nofollow noreferrer">http://something.com/path/to/file.data</a></p> <p>wget <a href="http://somet...
[ { "answer_id": 380347, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 1, "selected": false, "text": "screen" }, { "answer_id": 380348, "author": "Jonas Elfström", "author_id": 44620, "author_profile": "https...
2008/12/19
[ "https://Stackoverflow.com/questions/380341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10821/" ]
380,379
<p>I'd like to yank a line in a register: <code>"{register}y</code> but without overwriting what was previously in the register. I often need to copy non-contiguous lines in a register, and I'd like to use sometimes the registers like a stack.</p> <p>Example:</p> <pre><code>line1 line2 line3 </code></pre> <p>I want ...
[ { "answer_id": 382182, "author": "Rob Wells", "author_id": 2974, "author_profile": "https://Stackoverflow.com/users/2974", "pm_score": 4, "selected": false, "text": "ma (entered in command mode, i.e. no colon)\n" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/380379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28165/" ]
380,380
<p>I have a Windows form application written in C#. I update the title of the form frequently, but there's a substantial lag between the title changing and the title dislayed in the taskbar being updated. </p> <p>What's a clean way to force an update / redraw of the task bar's entry for my program? Failing that, ho...
[ { "answer_id": 380407, "author": "Jonas Elfström", "author_id": 44620, "author_profile": "https://Stackoverflow.com/users/44620", "pm_score": 2, "selected": false, "text": " this.Invalidate();\n this.Update();\n Application.DoEvents();\n" }, { "answer_id": 38...
2008/12/19
[ "https://Stackoverflow.com/questions/380380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1388/" ]
380,381
<p>Details are as follows:</p> <p>Environment:</p> <p>SSRS 2008 Server, SQL Server 2008 for database, Report Developed in SQL Server Business Intelligence Devlopment Studio - Reporting Project</p> <p>Error Messages: </p> <p>"An error occurred during client rendering." "An error has occurred during report processing...
[ { "answer_id": 380407, "author": "Jonas Elfström", "author_id": 44620, "author_profile": "https://Stackoverflow.com/users/44620", "pm_score": 2, "selected": false, "text": " this.Invalidate();\n this.Update();\n Application.DoEvents();\n" }, { "answer_id": 38...
2008/12/19
[ "https://Stackoverflow.com/questions/380381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3535708/" ]
380,403
<p>I do not have problem as such but I am quite new to Ruby. I have the following 3 repeatable bits of code in one method and I would like to know how a true Rubyist would first of all remove the duplication and secondly make it more reusable.</p> <p>Here is the code in question:</p> <pre><code>file = File.new( dest...
[ { "answer_id": 380907, "author": "Bkkbrad", "author_id": 44476, "author_profile": "https://Stackoverflow.com/users/44476", "pm_score": 3, "selected": true, "text": "[\"add\", \"connectionStrings/plans\"].each do |elt_name|\n doc.elements.each(\"configuration/#{elt_name}\").do |elt|\n ...
2008/12/19
[ "https://Stackoverflow.com/questions/380403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11755/" ]
380,406
<p>If I have an inner class, like this:</p> <pre><code>public class Test { public class Inner { // code ... } public static void main(String[] args) { // code ... } } </code></pre> <p>When I compile it, I expect it should generate two files:</p> <pre><code>Test.class Test$Inn...
[ { "answer_id": 380468, "author": "Jean", "author_id": 7898, "author_profile": "https://Stackoverflow.com/users/7898", "pm_score": 2, "selected": false, "text": "public class Foo{\n public void printMe(){\n System.out.println(\"redefine me!\");\n }\n}\n\n\npublic class Bar {\n pub...
2008/12/19
[ "https://Stackoverflow.com/questions/380406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11347/" ]
380,414
<p>If you have some directories from different version control systems (cvs, svn...), how do you find out what type of repository each came from?</p>
[ { "answer_id": 380433, "author": "Kurt", "author_id": 31056, "author_profile": "https://Stackoverflow.com/users/31056", "pm_score": 4, "selected": true, "text": "$ svn info\n\nPath: .\nURL: https://example.org/svn/project/space/\nRepository Root: https://example.org/svn/project/\nReposit...
2008/12/19
[ "https://Stackoverflow.com/questions/380414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47090/" ]
380,423
<p>When I use link_to :method=>:delete, what rails has generated is a javascript click, which is not nice if you do come across situation your client just have javascript disabled. That seems a bad idea to me. Any chance to get around this?</p>
[ { "answer_id": 380452, "author": "mat", "author_id": 42083, "author_profile": "https://Stackoverflow.com/users/42083", "pm_score": 1, "selected": false, "text": "<a href=\"\">" }, { "answer_id": 381693, "author": "Starr Horne", "author_id": 37708, "author_profile": "h...
2008/12/19
[ "https://Stackoverflow.com/questions/380423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16371/" ]
380,424
<p>Assume I allow the user to input a arbitrary numerical expression that allows usage of the explicit set of functions and predefined variables.</p> <p>Interpreting this is pretty straight forward but what if performance is a critical factor?</p> <p>I need a way to compile (in runtime) a string with a expression int...
[ { "answer_id": 380432, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 1, "selected": false, "text": "Microsoft.JScript" }, { "answer_id": 380434, "author": "Marc Gravell", "author_id": 23354, "author_profile...
2008/12/19
[ "https://Stackoverflow.com/questions/380424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40939/" ]
380,438
<p>The question is simple: I cannot understand the <a href="http://en.wikipedia.org/wiki/Zipper_(data_structure)" rel="noreferrer">Zipper</a> data structure.</p> <p>My question is related to its uses with a Tree.</p> <p>I want to understand how can I change the tree node using zipper. And how not to copy the whole tr...
[ { "answer_id": 380498, "author": "namin", "author_id": 34596, "author_profile": "https://Stackoverflow.com/users/34596", "pm_score": 7, "selected": true, "text": "(1 2 3 4 5 6)" }, { "answer_id": 70818942, "author": "Mohan Radhakrishnan", "author_id": 1234909, "author...
2008/12/19
[ "https://Stackoverflow.com/questions/380438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20514/" ]
380,442
<p>Let's say I have some pointers called:</p> <pre><code>char * pChar; int * pInt; </code></pre> <p>I know they both simply hold memory addresses that point to some other location, and that the types declare how big the memory location is pointed to by the particular pointer. So for example, a char might be the size ...
[ { "answer_id": 380448, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 2, "selected": false, "text": "pChar+2; // increment the address pointed to by pChar by 2 bytes\npInt+2; // increment the address pointed to by pI...
2008/12/19
[ "https://Stackoverflow.com/questions/380442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29482/" ]
380,451
<p>I'm getting the error below when trying to loop through a listbox and then remove the item.</p> <blockquote> <p>List that this enumerator is bound to has been modified. An enumerator can only be used if the list does not change.</p> </blockquote> <pre><code>foreach (string s in listBox1.Items) { MessageBox.S...
[ { "answer_id": 380461, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 5, "selected": false, "text": "foreach" }, { "answer_id": 380469, "author": "Community", "author_id": -1, "author_profile": "htt...
2008/12/19
[ "https://Stackoverflow.com/questions/380451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
380,454
<p>How does operating system know what filesystem a partition is using? In other words, how are FAT16/32, NTFS, ext2/3 etc. distinguished from each other?</p>
[ { "answer_id": 380489, "author": "benlumley", "author_id": 39161, "author_profile": "https://Stackoverflow.com/users/39161", "pm_score": 0, "selected": false, "text": "* File system type\n* Size\n* Status\n* Information about other metadata structures\n" }, { "answer_id": 380508,...
2008/12/19
[ "https://Stackoverflow.com/questions/380454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47701/" ]
380,455
<p>I am looking for a clear definition of what a "tokenizer", "parser" and "lexer" are and how they are related to each other (e.g., does a parser use a tokenizer or vice versa)? I need to create a program will go through c/h source files to extract data declaration and definitions. </p> <p>I have been looking for exa...
[ { "answer_id": 686819, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 5, "selected": false, "text": "int x = 1;\n" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/380455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35733/" ]
380,458
<p>One of the most common dilemmas I have when commenting code is how to mark-up argument names. I'll explain what I mean:</p> <pre><code>def foo(vector, widht, n=0): """ Transmogrify vector to fit into width. No more than n elements will be transmogrified at a time """ </code></pre> <p>Now, my problem wit...
[ { "answer_id": 380575, "author": "Abgan", "author_id": 46308, "author_profile": "https://Stackoverflow.com/users/46308", "pm_score": 0, "selected": false, "text": "def foo(vector, width, n=0):\n \"\"\" Transmogrify 'vector' to fit into 'width'. No more than 'n' \n elements will be ...
2008/12/19
[ "https://Stackoverflow.com/questions/380458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
380,482
<p>I'm writing a search &amp; replace function in a kind of spreadsheet program. What I want is that if you search for a string, the program shows a table with the element that has been found.</p> <p>So far so good, but I cannot get the element to obtain the focus, with the cursor in it so you can immediately start ty...
[ { "answer_id": 380577, "author": "Peter", "author_id": 26483, "author_profile": "https://Stackoverflow.com/users/26483", "pm_score": 0, "selected": false, "text": " /**\n * Returns true.\n * @param anEvent an event object\n * @return true\n */\n public boolean shou...
2008/12/19
[ "https://Stackoverflow.com/questions/380482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26387/" ]
380,507
<p>I am adding a custom background for my UINavigationBar. It works fine as long as the phone is in portrait mode. As soon as I switch to landscape mode, half the bar appears blue (the default navbar color) and half of it has my image</p> <p>How can I stretch the image for landscape mode and make it small again for po...
[ { "answer_id": 381067, "author": "Ben Gottlieb", "author_id": 6694, "author_profile": "https://Stackoverflow.com/users/6694", "pm_score": 3, "selected": true, "text": "UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight" }, { "answer_id": 796390, "author": "Iva...
2008/12/19
[ "https://Stackoverflow.com/questions/380507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46297/" ]
380,509
<p>I'm writing Add-inn Application A in VB.Net and DLL B in C language. Application A pass callback method to dll B. When certain event occur the dll invoke the callback from A. Whole works fine on my PC but when I move it to Notebook I get an error:</p> <p><em>Run-Time Check Failure #0 - The value of ESP was not pro...
[ { "answer_id": 380526, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 0, "selected": false, "text": "typedef void (__cdecl * OFFICE_PTR)();\nvoid TAPIClient::tapiCallBack(\nDWORD hDevice,\nDWORD dwMessage,\nDWORD dw...
2008/12/19
[ "https://Stackoverflow.com/questions/380509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
380,529
<pre><code>#include&lt;iostream&gt; using namespace std; class A { int a; int b; public: void eat() { cout&lt;&lt;"A::eat()"&lt;&lt;endl; } }; class B: public A { public: void eat() { cout&lt;&lt;"B::eat()"&lt;&lt;endl; } }; class C: public A { public: void eat() ...
[ { "answer_id": 380542, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 2, "selected": false, "text": "static_cast" }, { "answer_id": 380546, "author": "e.James", "author_id": 33686, "author_profile...
2008/12/19
[ "https://Stackoverflow.com/questions/380529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39615/" ]
380,568
<p>I'm working on a project that has a rich object model with various sets of aggregate roots. </p> <p>We're using the <strong>Castle</strong> stack (Monorail through to nHibernate with ActiveRecord).</p> <p>We have marked the aggregate roots as lazy <code>[ActiveRecord(Lazy = true)]</code> and have customized 'eager...
[ { "answer_id": 382043, "author": "user47393", "author_id": 47393, "author_profile": "https://Stackoverflow.com/users/47393", "pm_score": 1, "selected": false, "text": "\"from Account a inner join fetch a.Order where a.ID = ?\"\n" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/380568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32027/" ]
380,570
<p>This is nice thing you have done. Could you please explain: How to use PhotoLibrary's CameraController without jailbreak. Actually I 've downloaded class-dump and tried dumping PhotoLibrary but did not work out well. It is giving: </p> <pre><code>/* * Generated by class-dump 3.1.2. * * class-dump is Copy...
[ { "answer_id": 382043, "author": "user47393", "author_id": 47393, "author_profile": "https://Stackoverflow.com/users/47393", "pm_score": 1, "selected": false, "text": "\"from Account a inner join fetch a.Order where a.ID = ?\"\n" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/380570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
380,588
<p>Suppose you store instances of a class in a relational table. How would you go about persisting a static attribute of that class? For example:</p> <pre><code>class WebSiteUser { private static $common_homepage_content; private $username; private $password_hash; ... } </code></pre> <p>Corresponding ...
[ { "answer_id": 380610, "author": "bruno conde", "author_id": 31136, "author_profile": "https://Stackoverflow.com/users/31136", "pm_score": 2, "selected": true, "text": "static" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/380588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6430/" ]
380,595
<p>I need an equivalent to c++'s <code>std::multimap&lt;K, V, Comp, Alloc&gt;</code> in C-sharp. Does it exist in the standard library?</p>
[ { "answer_id": 380601, "author": "Frans Bouma", "author_id": 44991, "author_profile": "https://Stackoverflow.com/users/44991", "pm_score": 7, "selected": true, "text": "//////////////////////////////////////////////////////////////////////\n// Algorithmia is (c) 2008 Solutions Design. Al...
2008/12/19
[ "https://Stackoverflow.com/questions/380595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148909/" ]
380,603
<p>That is, all text and subtags, without the tag of an element itself?</p> <p>Having</p> <pre><code>&lt;p&gt;blah &lt;b&gt;bleh&lt;/b&gt; blih&lt;/p&gt; </code></pre> <p>I want </p> <pre><code>blah &lt;b&gt;bleh&lt;/b&gt; blih </code></pre> <p>element.text returns "blah " and etree.tostring(element) returns:</p> ...
[ { "answer_id": 380717, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 4, "selected": false, "text": "\"\".join( [ \"\" if t.text is None else t.text ] + [ xml.tostring(e) for e in t.getchildren() ] )\n" }, { "answer_...
2008/12/19
[ "https://Stackoverflow.com/questions/380603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6068/" ]
380,626
<p>I am parsing XML file. In this file there is one tag containing date string <code>"2008-11-10T05:51:33Z"</code> and I want convert this string in to <code>java.util.Date object.</code></p> <p>How can this be done?</p>
[ { "answer_id": 380633, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": false, "text": "DateTimeFormatter fmt = DateTimeFormat.forPattern(\"yyyyMMdd'T'HH:mm:ssZ\");\nDateTime dt = fmt.parse(\"2008-11-10T05:51...
2008/12/19
[ "https://Stackoverflow.com/questions/380626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25778/" ]
380,628
<p>I’ve just found out that the execution plan performance between the following two select statements are massively different:</p> <pre><code>select * from your_large_table where LEFT(some_string_field, 4) = '2505' select * from your_large_table where some_string_field like '2505%' </code></pre> <p>The execution pl...
[ { "answer_id": 380640, "author": "Dan Sydner", "author_id": 43988, "author_profile": "https://Stackoverflow.com/users/43988", "pm_score": 3, "selected": false, "text": "like" }, { "answer_id": 380643, "author": "hamishmcn", "author_id": 3590, "author_profile": "https:...
2008/12/19
[ "https://Stackoverflow.com/questions/380628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5884/" ]
380,632
<p>I am doing the following statements in Java,</p> <pre><code>Obj t[] = new Obj[10]; Obj a = new Obj("a"); t[0] = a; a = new Obj("b"); t[1] = a; </code></pre> <p>Why in java, when i access t[0] , it returns me "a", rather than "b"? Is this because of the GC? and can i believe it is safe to do such an operation</p>...
[ { "answer_id": 380646, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "Object a = new Object(\"a\");\nObject b = new Object(\"b\");\n\na = b;\nb = new Object(\"c\");\n\n// At this point, a = \"b\"\...
2008/12/19
[ "https://Stackoverflow.com/questions/380632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
380,639
<p>I need your expertise once again. I have a java class that searches a directory for xml files (displays the files it finds in the eclipse console window), applies the specified xslt to these and sends the output to a directory.</p> <p>What I want to do now is create an xml containing the file names and file format ...
[ { "answer_id": 380652, "author": "Vinze", "author_id": 26859, "author_profile": "https://Stackoverflow.com/users/26859", "pm_score": 0, "selected": false, "text": "StringBuilder builder = new StringBuilder();\nfor(File f : files) {\n builder.append(\"<file>\\n\\t<fileName>\").append(f...
2008/12/19
[ "https://Stackoverflow.com/questions/380639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44649/" ]
380,658
<p>I have created an asp.net website that connects to a SQL server database. Currently on my development machine I have the connection set to a SQL server express database with the file residing in the App_Data file of the website.</p> <p>I now need to upload the site to my host of which I have an SQL server database ...
[ { "answer_id": 380661, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 2, "selected": false, "text": "Server=mssql.mydomain.com;uid=user_id_goes_here;pwd=password_goes_here\n" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/380658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
380,660
<p>Stuggling a little bit with the RegEx, I've got 4 codes in a string</p> <p>CODE4:CODE3:CODE2:CODE1</p> <p>each code is optional apart from CODE1</p> <p>So I could have ab:bc:de:fg</p> <p>or</p> <p>bc::fg</p> <p>of </p> <p>ab:::fg</p> <p>In each case of the above CODE1 = fg dnd for the dear life of me I can't...
[ { "answer_id": 380682, "author": "Gareth", "author_id": 31582, "author_profile": "https://Stackoverflow.com/users/31582", "pm_score": 3, "selected": true, "text": "/(\\w*:){0,3}\\w+/\n" }, { "answer_id": 380684, "author": "Avi", "author_id": 1605, "author_profile": "h...
2008/12/19
[ "https://Stackoverflow.com/questions/380660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32336/" ]
380,665
<p>I am looking at nServiceBus and came over this interface</p> <pre><code>namespace NServiceBus { public interface IMessage { } } </code></pre> <p>What is the use of an empty interface?</p>
[ { "answer_id": 380689, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": false, "text": "<this>" }, { "answer_id": 380696, "author": "André", "author_id": 9683, "author_profile": "https://S...
2008/12/19
[ "https://Stackoverflow.com/questions/380665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29519/" ]
380,694
<p>anyone able to tell me how often a materialized view is set to refresh with the following setting plz?</p> <p>REFRESH FORCE ON DEMAND START WITH sysdate+0 NEXT (round(sysdate) + 1/24) + 1</p> <p>i think i read it as every hour but i'm not sure</p>
[ { "answer_id": 380711, "author": "tuinstoel", "author_id": 43901, "author_profile": "https://Stackoverflow.com/users/43901", "pm_score": 4, "selected": true, "text": "SQL> alter session set nls_date_format = 'yyyy-mm-dd :hh24:mi:ss';\n\nSession changed.\n\nSQL> select sysdate from dual;\...
2008/12/19
[ "https://Stackoverflow.com/questions/380694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21180/" ]
380,708
<p>Closed as exact duplicate of <a href="https://stackoverflow.com/questions/145856">this question</a>.</p> <p>I have an array/list of elements. I want to convert it to a string, separated by a custom delimitator. For example:</p> <pre><code>[1,2,3,4,5] =&gt; "1,2,3,4,5" </code></pre> <p>What's the shortest/esiest w...
[ { "answer_id": 380712, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 8, "selected": true, "text": "String.Join(\",\", arr.Select(p=>p.ToString()).ToArray())\n" }, { "answer_id": 380715, "author": "David Schmitt", ...
2008/12/19
[ "https://Stackoverflow.com/questions/380708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23824/" ]
380,709
<p>I am working with a generic data structure, say <code>MyGeneric&lt;Type&gt;</code>. There is a case where I have to iterate over all the values it holds </p> <p>The code I am trying to do.</p> <pre><code>for ( all the keys in myGeneric ) { // do lot of stuff here } </code></pre> <p>Now the generic can hold b...
[ { "answer_id": 380723, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 4, "selected": true, "text": "OfType<T>" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/380709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41968/" ]
380,720
<p>In the following code doesn't work as </p> <pre><code>public void Foo() { CompanyDataContext db = new CompanyDataContext(); Client client = (select c from db.Clients ....).Single(); Bar(client); } public void Bar(Client client) { CompanyDataContext db = new CompanyDataContext(); db.Client.Attach(cli...
[ { "answer_id": 380753, "author": "AndreasN", "author_id": 24821, "author_profile": "https://Stackoverflow.com/users/24821", "pm_score": 0, "selected": false, "text": "public class ClientDataLogic\n{\n private DataContext _db = new DataContext();\n\n public Client GetClient(int id) ...
2008/12/19
[ "https://Stackoverflow.com/questions/380720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40939/" ]
380,724
<p>What is the Action Design Pattern, I haven't heard of it before? I am suspecting it is the same as the <a href="http://en.wikipedia.org/wiki/Command_pattern" rel="noreferrer">Command Design pattern</a> [wikipedia] but I can't find any resources on it.</p>
[ { "answer_id": 33538966, "author": "Mangu Singh Rajpurohit", "author_id": 2393267, "author_profile": "https://Stackoverflow.com/users/2393267", "pm_score": 1, "selected": false, "text": "public interface Action{\n public void do();\n public void undo();\n public void do(int iNoOfTimes...
2008/12/19
[ "https://Stackoverflow.com/questions/380724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42303/" ]
380,734
<p>I have nested dictionaries:</p> <pre><code>{'key0': {'attrs': {'entity': 'p', 'hash': '34nj3h43b4n3', 'id': '4130'}, u'key1': {'attrs': {'entity': 'r', 'hash': '34njasd3h43b4n3', 'id': '4130-1'}, u'key2': {'attrs': {'entity': '...
[ { "answer_id": 380769, "author": "Mapad", "author_id": 28165, "author_profile": "https://Stackoverflow.com/users/28165", "pm_score": 4, "selected": false, "text": "def traverse_tree(dictionary, id=None):\n for key, value in dictionary.items():\n if key == 'id':\n if ...
2008/12/19
[ "https://Stackoverflow.com/questions/380734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33612/" ]
380,755
<p>What do you guys think about this for a generic singleton?</p> <pre><code>using System; using System.Reflection; // Use like this /* public class Highlander : Singleton&lt;Highlander&gt; { private Highlander() { Console.WriteLine("There can be only one..."); } } */ public class Singleton&lt;T&...
[ { "answer_id": 380761, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": false, "text": "T" }, { "answer_id": 380771, "author": "AndreasN", "author_id": 24821, "author_profile": "https:/...
2008/12/19
[ "https://Stackoverflow.com/questions/380755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5884/" ]
380,772
<p>I have been trying for quite a while to figure out how to encrypt Application blocks that are stored in an external file called dev_entlib.config</p> <p>I can see in entlib (4.1) that it's possible to use the default protection providers to encrypt the blocks but, I really need to deploy this Application on differe...
[ { "answer_id": 8058923, "author": "E. Sambo", "author_id": 523368, "author_profile": "https://Stackoverflow.com/users/523368", "pm_score": 2, "selected": true, "text": "Failed to encrypt the section 'connectionStrings' using provider 'RsaProtectedConfigurationProvider'. Error message fro...
2008/12/19
[ "https://Stackoverflow.com/questions/380772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5197/" ]
380,773
<p>I have a situation in which I parse a body of text and replace certain phrases with links. I then need to re-parse the string to replace a second set of phrases with links. The problem arises at this point, where certain words or phrases in the second set can be substrings of phrases already replaced in the first pa...
[ { "answer_id": 380844, "author": "PEZ", "author_id": 44639, "author_profile": "https://Stackoverflow.com/users/44639", "pm_score": 1, "selected": false, "text": "$string = preg_replace('/([^>]|^)grand canyon\\b/','$1<a href=#>grand canyon</a>',$string);\n" }, { "answer_id": 38100...
2008/12/19
[ "https://Stackoverflow.com/questions/380773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
380,775
<p>I have an NHibernate Dao..lets call it MyClassDao for want of a better name.</p> <p>I am writing the following code.</p> <pre><code>MyClassDao myDao = new MyClassDao(); var values = myDao.GetByCriteria(Restrictions.Eq("Status", someStatusValue)); </code></pre> <p>I am using this in a Unit Test to pull back value...
[ { "answer_id": 9372244, "author": "CrazyCoderz", "author_id": 619583, "author_profile": "https://Stackoverflow.com/users/619583", "pm_score": 0, "selected": false, "text": "public IQueryable<T> SelectWithLimit<T>(int maxResults) where T : class\n {\n ICriteria criteria = Sessio...
2008/12/19
[ "https://Stackoverflow.com/questions/380775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39532/" ]
380,813
<p>Upcasting is allowed in Java, however downcasting gives a compile error. </p> <p>The compile error can be removed by adding a cast but would anyway break at the runtime. </p> <p>In this case why Java allows downcasting if it cannot be executed at the runtime?<br> Is there any practical use for this concept? </p> ...
[ { "answer_id": 380828, "author": "Joachim Sauer", "author_id": 40342, "author_profile": "https://Stackoverflow.com/users/40342", "pm_score": 9, "selected": true, "text": "Object o = getSomeObject(),\nString s = (String) o; // this is allowed because o could reference a String\n" }, {...
2008/12/19
[ "https://Stackoverflow.com/questions/380813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40933/" ]
380,817
<p>Suppose you have a file that contains IP addresses, one address in each line:</p> <pre><code>10.0.10.1 10.0.10.1 10.0.10.3 10.0.10.2 10.0.10.1 </code></pre> <p>You need a shell script that counts for each IP address how many times it appears in the file. For the previous input you need the following output:</p> <...
[ { "answer_id": 380824, "author": "Francois Wolmarans", "author_id": 47755, "author_profile": "https://Stackoverflow.com/users/47755", "pm_score": 6, "selected": false, "text": "cat ip_addresses | sort -n | uniq -c" }, { "answer_id": 380832, "author": "Joachim Sauer", "aut...
2008/12/19
[ "https://Stackoverflow.com/questions/380817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/686/" ]
380,846
<p>I am using Dojo 1.2 to implement some functionality on my customer's webpage. One of the widgets I use is the <code>dijit.layout.TabContainer</code>, which inherits <code>StackContainer</code>. The <code>StackContainer</code> subscribes on keyboard events and creates a few hotkeys, like arrow left to move one tab to...
[ { "answer_id": 561439, "author": "Heath Borders", "author_id": 9636, "author_profile": "https://Stackoverflow.com/users/9636", "pm_score": 0, "selected": false, "text": "com/stackoverflow/KeyPresslessTabContainer.js" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/380846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3999/" ]
380,855
<p>What is the correct syntax to create objects in javascript that will work across the majority of web browsers (by that I mean : IE 6+, Firefox 2+, Opera 9+ )</p> <p>Is this valid</p> <pre><code>var a = { "class": "Person", "name": "William Shakespeare", "birthday": -12802392000000, "nickname": "Bill" }; </...
[ { "answer_id": 380860, "author": "AndreasN", "author_id": 24821, "author_profile": "https://Stackoverflow.com/users/24821", "pm_score": 3, "selected": false, "text": "string : value\n" }, { "answer_id": 380868, "author": "Gareth", "author_id": 31582, "author_profile":...
2008/12/19
[ "https://Stackoverflow.com/questions/380855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32582/" ]
380,870
<p>Is there a Pythonic way to have only one instance of a program running? </p> <p>The only reasonable solution I've come up with is trying to run it as a server on some port, then second program trying to bind to same port - fails. But it's not really a great idea, maybe there's something more lightweight than this? ...
[ { "answer_id": 380943, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 3, "selected": false, "text": "import os, os.path\npidfilePath = \"\"\"/path/to/pidfile\"\"\"\nif os.path.exists(pidfilePath):\n pidfile = open(...
2008/12/19
[ "https://Stackoverflow.com/questions/380870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37141/" ]
380,875
<p>It seems like more and more OS X apps these days are doing all kinds of fancy drawing stuff for custom controls. Apps like Twitterific, Things, EventBox, Versions just to name a few....</p> <p>So basically I'm looking for any information on how to get started doing this kind of thing. Not sure if it is just done by...
[ { "answer_id": 381011, "author": "Dirk Stoop", "author_id": 24051, "author_profile": "https://Stackoverflow.com/users/24051", "pm_score": 6, "selected": true, "text": "+ (Class) cellClass\n{\n return [OurButtonCell class];\n}\n\n- (void)drawRect:(NSRect)rect \n{\n // first get the ...
2008/12/19
[ "https://Stackoverflow.com/questions/380875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47761/" ]
380,885
<p>One for the mathematicians. This has gone around the office and we want to see who can come up with a better optimised version.</p> <pre><code>(((a+p) &lt;= b) &amp;&amp; (a == 0 || a &gt; 1) &amp;&amp; (b &gt;= p)) &amp;&amp; ((b - (a + p) == 0) || (b - (a + p) &gt; 1)) </code></pre> <p><strong>Edit</strong>: ...
[ { "answer_id": 380898, "author": "Brian Genisio", "author_id": 36687, "author_profile": "https://Stackoverflow.com/users/36687", "pm_score": 1, "selected": false, "text": "uint sum = a + p;\nreturn ((sum <= b) && (a != 1) && (b >= p)) && (b - sum != 1);\n" }, { "answer_id": 38091...
2008/12/19
[ "https://Stackoverflow.com/questions/380885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17540/" ]
380,889
<p>Below is a stored procedure to check if there is a duplicate entry in the database based upon checking all the fields individually (don't ask why I should do this, it just has to be this way). </p> <p>It sounds perfectly straightforward but the SP fails. The problem is that some parameters passed into the SP may ha...
[ { "answer_id": 380902, "author": "n8wrl", "author_id": 37710, "author_profile": "https://Stackoverflow.com/users/37710", "pm_score": 4, "selected": true, "text": "AND (aCode = @aCode OR (aCode IS NULL AND @aCode IS NULL))\n" }, { "answer_id": 380963, "author": "Eric Sabine", ...
2008/12/19
[ "https://Stackoverflow.com/questions/380889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
380,911
<p>I'm parsing big XML file with XPathExpression selection for some nodes existing at various depth levels.</p> <p>What is the easiest way to export selected nodes to separate XML file, preserving all direct-ancestors nodes (and their attributes)? C# is preferred.</p> <p>Example source XML :</p> <pre><code>&lt;a&gt;...
[ { "answer_id": 380955, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": true, "text": "string xml = @\"<xml>\n <a>\n <x/>\n <b>\n <c/>\n <z/>\n </b>\n <c/>\n</a>\n<c/>\n<d><e/></d></xml>\";\n ...
2008/12/19
[ "https://Stackoverflow.com/questions/380911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7162/" ]
380,917
<p>Our Flex app automatically resizes with the browser window, we've addressed a whole bunch of scaling issues quite easily but one that remains is tooltips. They show in the wrong location on screen, not being scaled properly based on the window size. Since tooltips are positioned automatically, how can we address thi...
[ { "answer_id": 382961, "author": "cliff.meyers", "author_id": 41754, "author_profile": "https://Stackoverflow.com/users/41754", "pm_score": 0, "selected": false, "text": "ToolTipManager" }, { "answer_id": 403779, "author": "Christian Nunciato", "author_id": 32129, "au...
2008/12/19
[ "https://Stackoverflow.com/questions/380917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13220/" ]
380,919
<p>Obviously I can do and <code>DateTime.Now.After</code> - <code>DateTime.Now.Before</code> but there must be something more sophisticated.</p> <p>Any tips appreciated.</p>
[ { "answer_id": 380931, "author": "tafa", "author_id": 22186, "author_profile": "https://Stackoverflow.com/users/22186", "pm_score": 6, "selected": false, "text": "System.Diagnostics.Stopwatch" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/380919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31765/" ]
380,921
<p>I've got a question about renaming a file after it's been uploaded in Zend. I don't know where to put the Rename Filter. Here's what I've got. I've tried moving things around, but I'm lost. Currently it does upload the file to my photos folder, but it doesn't rename it. Thanks for any help!</p> <pre><code>if($this-...
[ { "answer_id": 509439, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "if(isset($_FILES['file1'])){\n $ext = pathinfo($_FILES['file1']['name']);\n $_FILES['file1']['name'] = 'image_'. $userid .'....
2008/12/19
[ "https://Stackoverflow.com/questions/380921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38241/" ]
380,922
<p>As a "look under the covers" tutorial for myself I am building a PHP script to gather emails from a POP3 mailbox. While attempting to make use of binary attachments I am stuck trying to figure out what to do with the attachment information.</p> <p>Given a string that would be gathered from an email:</p> <blockquo...
[ { "answer_id": 568217, "author": "Mike Boers", "author_id": 66502, "author_profile": "https://Stackoverflow.com/users/66502", "pm_score": 3, "selected": false, "text": "$fh = fopen('where_you_are_writing', 'wb');\nstream_filter_append($fh, 'convert.base64-decode');\n\n// Do a lot of writ...
2008/12/19
[ "https://Stackoverflow.com/questions/380922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
380,924
<p>How can i change database encoding for a PostgreSQL database using sql or phpPgAdmin?</p>
[ { "answer_id": 380956, "author": "rombarcz", "author_id": 47267, "author_profile": "https://Stackoverflow.com/users/47267", "pm_score": 7, "selected": true, "text": "pg_dump your_database > your_database.sql" }, { "answer_id": 32022221, "author": "user1941407", "author_id...
2008/12/19
[ "https://Stackoverflow.com/questions/380924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9789/" ]
380,944
<p>I'm looking for a method that can round a number <em>up</em> to the nearest multiple of another. This is similar Quantization.</p> <p>Eg. If I want to round 81 up to the nearest multiple of 20, it should return 100.</p> <p>Is there a method built-in method in the .NET framework I can use for this?</p> <p>The re...
[ { "answer_id": 380961, "author": "LeppyR64", "author_id": 16592, "author_profile": "https://Stackoverflow.com/users/16592", "pm_score": 3, "selected": false, "text": "public static int RoundUp(int num, int multiple)\n{\n if (multiple == 0)\n return 0;\n int add = multiple / Math.Abs...
2008/12/19
[ "https://Stackoverflow.com/questions/380944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9825/" ]
380,952
<p>I have a method <code>fetchObjects(String)</code> that is expected to return an array of <code>Contract</code> business objects. The <code>className</code> parameter tells me what kind of business objects I should return (of course this doesn't make sense in this construed case because I already said I will return <...
[ { "answer_id": 380972, "author": "Dennis C", "author_id": 40214, "author_profile": "https://Stackoverflow.com/users/40214", "pm_score": 4, "selected": true, "text": " static <T extends Contract> T[] buildArray(Class<T> clazz){\n ArrayList<T> l=new ArrayList<T>();\n return l.toA...
2008/12/19
[ "https://Stackoverflow.com/questions/380952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45018/" ]
380,962
<p>I am new to unittesting and currently have a problem with finding a decent way to test methods that contain branches. </p> <p>I created a small demo method I hope could be used to explain the problem.</p> <pre><code>public void ExportAccounts() { int emptyAccounts = 0; int nonEmptyAccounts = 0; int ...
[ { "answer_id": 380972, "author": "Dennis C", "author_id": 40214, "author_profile": "https://Stackoverflow.com/users/40214", "pm_score": 4, "selected": true, "text": " static <T extends Contract> T[] buildArray(Class<T> clazz){\n ArrayList<T> l=new ArrayList<T>();\n return l.toA...
2008/12/19
[ "https://Stackoverflow.com/questions/380962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32313/" ]
381,016
<p>am having trouble with visible attribute of an asp.net panel. Basically I have a page that calls a database table and returns the results in a detailsview. However, some of the values that are returned are null and if so I need to hide the image thats next to it. </p> <p>I am using a panel to determine whether to h...
[ { "answer_id": 381035, "author": "Greg Dean", "author_id": 1200558, "author_profile": "https://Stackoverflow.com/users/1200558", "pm_score": 2, "selected": false, "text": "> visible='<%# GetIsVisible(Eval(\"addr1\")) %>'\n" }, { "answer_id": 381044, "author": "Christopher Ed...
2008/12/19
[ "https://Stackoverflow.com/questions/381016", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
381,020
<p>I have been working on standardizing the source control structure for our Team Foundation Server rollout for the new year. I have started by using the <a href="http://www.codeplex.com/BranchingGuidance" rel="noreferrer">Microsoft Team Foundation Server Branching Guidance</a> documentation available on CodePlex.</p>...
[ { "answer_id": 381058, "author": "Micah", "author_id": 17744, "author_profile": "https://Stackoverflow.com/users/17744", "pm_score": 2, "selected": false, "text": "Development/\n Trunk/\n Binaries/ -- Shared libraries\n Source/\n Test/\n Docs/ -- Documentation...
2008/12/19
[ "https://Stackoverflow.com/questions/381020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15906/" ]
381,037
<p>I was reading the Math.random() javadoc and saw that random is only psuedorandom. </p> <p>Is there a library (specifically java) that generates random numbers according to random variables like environmental temperature, CPU temperature/voltage, or anything like that?</p>
[ { "answer_id": 381046, "author": "Joachim Sauer", "author_id": 40342, "author_profile": "https://Stackoverflow.com/users/40342", "pm_score": 3, "selected": false, "text": "/dev/random" }, { "answer_id": 381570, "author": "Ken Gentle", "author_id": 8709, "author_profil...
2008/12/19
[ "https://Stackoverflow.com/questions/381037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47690/" ]
381,049
<p>From a <a href="https://stackoverflow.com/questions/29040/linq-to-sql-can-i-eager-load-only-one-field-in-a-joined-table">previous question</a>, I learn that Linq to SQL is not able to eager load only certain files of foreingKey tables.</p> <p>So I'm asking what .net ORM can support including this type of statement ...
[ { "answer_id": 381084, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": true, "text": "select new {Order = order, ProductName = order.Product.Name,\n CustomerName = order.Customer.Name,\n ...
2008/12/19
[ "https://Stackoverflow.com/questions/381049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385/" ]
381,055
<p>I'm trying to save the contents of a particular registry key to a file using the RegSaveKey() API:</p> <pre><code>HKEY key; LRESULT result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\MyProduct", 0, KEY_ACCESS_ALL, &amp;key); result = RegSaveKey(key, L"c:\\temp\\saved.reg", NULL); </code></pre> <p>However, RegSa...
[ { "answer_id": 382039, "author": "reuben", "author_id": 41646, "author_profile": "https://Stackoverflow.com/users/41646", "pm_score": 3, "selected": false, "text": "HANDLE ProcessToken;\n\nif (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &ProcessToken)) {\...
2008/12/19
[ "https://Stackoverflow.com/questions/381055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2459/" ]
381,063
<p>I need fire a filter method with all string in GET or POST value from http request before it was bind into controller action</p> <p>Can i do it in Global.asax.cs? and if yes, can u give me more details or example (great) about this?</p>
[ { "answer_id": 404289, "author": "Haacked", "author_id": 598, "author_profile": "https://Stackoverflow.com/users/598", "pm_score": 2, "selected": false, "text": "protected void Application_BeginRequest(object sender, EventArgs e) {\n //Look at HttpContext.Current.Request to grab reques...
2008/12/19
[ "https://Stackoverflow.com/questions/381063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44533/" ]
381,066
<p>In a project we have text files looking like this:</p> <pre><code>mv A, R3 mv R2, B mv R1, R3 mv B, R4 add A, R1 add B, R1 add R1, R2 add R3, R3 add R21, X add R12, Y mv X, R2 </code></pre> <p>I need to replace the strings according to the following, but I am looking for a more general solution.</p> <pre><code>R1...
[ { "answer_id": 381080, "author": "kgiannakakis", "author_id": 24054, "author_profile": "https://Stackoverflow.com/users/24054", "pm_score": -1, "selected": false, "text": "Map<String, String> map = new HashMap<String, String>();\nmap.put(\"R1\", \"R2\");\nmap.put(\"R2\", \"R3\");\n\nfor(...
2008/12/19
[ "https://Stackoverflow.com/questions/381066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11827/" ]
381,070
<p>I need help with the best practice to localize asp mvc apps, I saw Oxite having a base method named Localize in the BaseController, but is the Localization a task for the view or the Controller? Or should I use resx files / or use db tables?</p>
[ { "answer_id": 381334, "author": "Ihar Voitka", "author_id": 46313, "author_profile": "https://Stackoverflow.com/users/46313", "pm_score": 5, "selected": true, "text": "<%= Html.Resource(\"Name\") %>" }, { "answer_id": 12936708, "author": "kbvishnu", "author_id": 438624, ...
2008/12/19
[ "https://Stackoverflow.com/questions/381070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25240/" ]
381,072
<p>DataGridView.CellContentClick is not firing if I mouse click a DataGridViewCheckBoxCell very fast. How can I solve this? I need to know when CheckBox's check state changes</p>
[ { "answer_id": 381130, "author": "BFree", "author_id": 15861, "author_profile": "https://Stackoverflow.com/users/15861", "pm_score": 3, "selected": false, "text": "bool b = (bool)this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;\nthis.dataGridView1.Rows[e.RowIndex].Cells[e....
2008/12/19
[ "https://Stackoverflow.com/questions/381072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45624/" ]
381,077
<p>I've just added one of the new (MFC Feature Pack) CVSListBox controls to a project. The list of items in the control is tracked by some other objects in my application, so I need to take lots of notifications from the list-box when anything changes so that I can update other stuff. For those that don't know the co...
[ { "answer_id": 12028602, "author": "Albertino80", "author_id": 554499, "author_profile": "https://Stackoverflow.com/users/554499", "pm_score": 0, "selected": false, "text": "class my_lbox : public CVSListBox\n{\n protected:\n\n BOOL OnBeforeRemoveItem(int what_item)\n {\...
2008/12/19
[ "https://Stackoverflow.com/questions/381077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/987/" ]
381,088
<p>We host a rather large (self written) ASP.NET website for our customers. It consists of a web service, a web site and a image serving web site, all three in their own virtual directory. The three virtual directories are together in one application pool. The pool has both memory limits (maximum virtual memory and max...
[ { "answer_id": 381124, "author": "Andrew Rollings", "author_id": 40410, "author_profile": "https://Stackoverflow.com/users/40410", "pm_score": 2, "selected": false, "text": "Dispose()" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/381088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5043/" ]
381,100
<p>I'm using a bookmarklet that inserts a script tag into the current web page.</p> <p>This script has some UI and an "<code>input type=submit....</code>" tag in it.</p> <p>Web page A has chosen not to style "<code>input type=submit..</code>" tags whereas web page B has styled them.</p> <p>This results in the bookma...
[ { "answer_id": 381135, "author": "Martijn Laarman", "author_id": 47020, "author_profile": "https://Stackoverflow.com/users/47020", "pm_score": 3, "selected": false, "text": "background-color:grey !important;\n" }, { "answer_id": 1140512, "author": "Community", "author_id"...
2008/12/19
[ "https://Stackoverflow.com/questions/381100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
381,134
<p>How can I test my website in multiple versions of firefox? I have v2 installed. Now no matter where or how many times I install FF3, it always executes ff2..</p> <p>I checked the interweb and it seems there used to be a MultiFireFox tool that could run several versions. It was for apple and I'm on windows. Furtherm...
[ { "answer_id": 381159, "author": "Joachim Sauer", "author_id": 40342, "author_profile": "https://Stackoverflow.com/users/40342", "pm_score": 2, "selected": false, "text": "-no-remote" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/381134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
381,138
<p>I'm trying to come up with a way to determine how "hot" certain threads are in a forum. What criteria would you use and why? How would these come together to give a hotness score?</p> <p>The criteria I'm thinking of include:</p> <ul> <li>how many replies</li> <li>how long since the last reply</li> <li>average time...
[ { "answer_id": 381418, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 0, "selected": false, "text": "log10($numOfReplies * 20000 / pow($timeSinceLastPost, 1.3))\n" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/381138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
381,145
<p>I'm trying to select more than 80,000 record in SQL Server in a table that has millions of records. The issue is that I've the correct Index, but it takes more than 15 minutes to return the recordset.</p> <p>I'm using MS SQL Server 2000, I found a pagination method using stored procedures but it uses a temporal tab...
[ { "answer_id": 381328, "author": "Charles Bretana", "author_id": 32632, "author_profile": "https://Stackoverflow.com/users/32632", "pm_score": 4, "selected": true, "text": "Create Procedure GetPagedData\n@Page Integer = 1,\n@PageSize Integer = 100,\n@UsersFilteringCOnditions,\n@UsersSort...
2008/12/19
[ "https://Stackoverflow.com/questions/381145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
381,157
<pre><code> $rowfetch =~ s/['-]//g; #All chars inside the [ ] will be filtered out. $rowfetch =~ m/(\w+), ?(.)/; printf $fh lc($2.$1); </code></pre> <p>I got help building this regular expression yesterday, but I don't fully understand it.<br><br>It takes a name like Parisi, Kenneth and prints out kparisi<B...
[ { "answer_id": 381175, "author": "Ed Guiness", "author_id": 4200, "author_profile": "https://Stackoverflow.com/users/4200", "pm_score": 5, "selected": false, "text": "YAPE::Regex::Explain" }, { "answer_id": 381188, "author": "tvanfosson", "author_id": 12950, "author_p...
2008/12/19
[ "https://Stackoverflow.com/questions/381157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42229/" ]
381,161
<p>I have just installed boost for the first time on my Intel Mac, and it works fine in general, as long as I use only boost's header files.</p> <p>But when I try to use a lib, in my case the regex lib, my app links and launches fine, but then it soon crashes in a regex related destructor.</p> <p>This even happens wi...
[ { "answer_id": 381175, "author": "Ed Guiness", "author_id": 4200, "author_profile": "https://Stackoverflow.com/users/4200", "pm_score": 5, "selected": false, "text": "YAPE::Regex::Explain" }, { "answer_id": 381188, "author": "tvanfosson", "author_id": 12950, "author_p...
2008/12/19
[ "https://Stackoverflow.com/questions/381161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43615/" ]
381,164
<p>I see in a header that I didn't write myself the following: </p> <pre><code>class MonitorObjectString: public MonitorObject { // some other declarations friend inline bool operator==(MonitorObjectString&amp; lhs, MonitorObjectString&amp; rhs) { return(lhs.fVal==rhs.fVal); } </code></pre> <p>I can't understan...
[ { "answer_id": 381183, "author": "pyon", "author_id": 46571, "author_profile": "https://Stackoverflow.com/users/46571", "pm_score": 3, "selected": false, "text": "friend" }, { "answer_id": 382077, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile...
2008/12/19
[ "https://Stackoverflow.com/questions/381164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20986/" ]
381,167
<p>I am big into code generation for the service/data layer of my apps. What I would really love to do is generate some basic WPF Controls, Data Templates, or some other XAML code based on the metadata I use to generate my service/data layer. EDIT: This generation is done before compile time.</p> <p>What I envision i...
[ { "answer_id": 771071, "author": "Sauron", "author_id": 88096, "author_profile": "https://Stackoverflow.com/users/88096", "pm_score": 2, "selected": false, "text": "Grid.SetColumn( UIElement, value )" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/381167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47752/" ]
381,169
<h1>Problem</h1> <p>At work we have a department wiki (running <a href="http://www.mediawiki.org/" rel="noreferrer">Mediawiki</a>). Unfortunately several persons edit without logging in, and that makes it very difficult to track down editors to ask questions about the content.</p> <p>There are two strategies to impro...
[ { "answer_id": 381194, "author": "George Stocker", "author_id": 16587, "author_profile": "https://Stackoverflow.com/users/16587", "pm_score": 4, "selected": false, "text": "$wgDisableAnonEdit = true;\n" }, { "answer_id": 563606, "author": "DLJessup", "author_id": 14382, ...
2008/12/19
[ "https://Stackoverflow.com/questions/381169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23118/" ]
381,171
<p>I usually do not have difficulty to read JavaScript code but for this one I can’t figure out the logic. The code is from an exploit that has been published 4 days ago. You can find it at <a href="https://web.archive.org/web/20100412164007/http://www.milw0rm.com/exploits/7477" rel="nofollow noreferrer">milw0rm</a>.</...
[ { "answer_id": 381205, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 9, "selected": true, "text": "spray" }, { "answer_id": 49589277, "author": "Community", "author_id": -1, "author_profile": "https://Stack...
2008/12/19
[ "https://Stackoverflow.com/questions/381171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13913/" ]
381,204
<p>One of the web pages on our site is extremely long. Although the page itself does not call any javascript or jquery functions, its base page registers the JQuery source script (jquery-1.2.6.js) and this seems to cause IE7 to display the "A script on this page is causing Internet Explorer to run slowly." message when...
[ { "answer_id": 423962, "author": "Ariel", "author_id": 24654, "author_profile": "https://Stackoverflow.com/users/24654", "pm_score": 0, "selected": false, "text": "//cache any jQuery objects that are used frequently\n$myObj = $(\".someClass\");\n...\n" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/381204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1127460/" ]
381,208
<p>Is there a problem with using <code>IEnumerable&lt;T&gt;</code> as a return type? FxCop complains about returning <code>List&lt;T&gt;</code> (it advises returning <code>Collection&lt;T&gt;</code> instead).</p> <p>Well, I've always been guided by a rule "accept the least you can, but return the maximum."</p> <p>Fro...
[ { "answer_id": 381218, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 5, "selected": false, "text": "IEnumerable<T>" }, { "answer_id": 382001, "author": "Daniel Earwicker", "author_id": 27423, "auth...
2008/12/19
[ "https://Stackoverflow.com/questions/381208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/430254/" ]
381,214
<h2>Some Context</h2> <p>From <a href="http://books.google.com/books?id=VOS6IlCsuU4C" rel="nofollow noreferrer">Javascript: The Definitive Guide</a>:</p> <blockquote> <p>When <code>regexp</code> is a global regular expression, however, <code>exec()</code> behaves in a slightly more complex way. It begins searching...
[ { "answer_id": 381236, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 4, "selected": true, "text": "^(.*)$\n" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/381214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/208/" ]
381,216
<p>Does the functional spec help or hinder your expectations? Do programmers who practice the waterfall methodology, are they open to functional specs? I'm a web designer/developer working with a team of 5 programmers and would like to write a functional spec to explain what we need, so that when I begin my work - I kn...
[ { "answer_id": 381297, "author": "Ates Goral", "author_id": 23501, "author_profile": "https://Stackoverflow.com/users/23501", "pm_score": 1, "selected": false, "text": "<p style=\"tongue: in-cheek\">" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/381216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28454/" ]
381,224
<p>Do T-SQL queries in SQL Server support short-circuiting?</p> <p>For instance, I have a situation where I have two database and I'm comparing data between the two tables to match and copy some info across. In one table, the "ID" field will always have leading zeros (such as "000000001234"), and in the other table, ...
[ { "answer_id": 381239, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 1, "selected": false, "text": "select * from table1 where table1.ID LIKE '%1234'\n" }, { "answer_id": 381309, "author": "Tom H", "au...
2008/12/19
[ "https://Stackoverflow.com/questions/381224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146/" ]
381,226
<p>I don't want to discuss the merits of this approach, just if it is possible. I believe the answer to be "no". But maybe someone will surprise me!</p> <p>Imagine you have a core widget class. It has a method <code>calculateHeight()</code>, that returns a height. The height is too big - this result in buttons (say) t...
[ { "answer_id": 381252, "author": "Rolf Rander", "author_id": 47402, "author_profile": "https://Stackoverflow.com/users/47402", "pm_score": 0, "selected": false, "text": "class MyWidget implements IWidget {\n private IWidget delegate;\n public MyWidget(IWidget d) {\n this.del...
2008/12/19
[ "https://Stackoverflow.com/questions/381226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4596/" ]
381,231
<p>I enjoyed the answers and questions about <a href="https://stackoverflow.com/questions/121243/hidden-features-of-sql-server">hidden features in sql server</a> </p> <p>What can you tell us about Oracle?<br> Hidden tables, inner workings of ..., secret stored procs, package that has good utils...</p>
[ { "answer_id": 381268, "author": "Peter Gfader", "author_id": 35693, "author_profile": "https://Stackoverflow.com/users/35693", "pm_score": 1, "selected": false, "text": "declare cursor PCK_UTILS.typ_cursor; \n\nbegin \n PCK_UTILS.spc_get_encodedstring( \n 'U', \n 1...
2008/12/19
[ "https://Stackoverflow.com/questions/381231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35693/" ]
381,244
<p>Admittedly I don't get it. Say you have a memory with a memory word of length of 1 byte. Why can't you access a 4 byte long variable in a single memory access on an unaligned address(i.e. not divisible by 4), as it's the case with aligned addresses?</p>
[ { "answer_id": 381368, "author": "joshperry", "author_id": 30587, "author_profile": "https://Stackoverflow.com/users/30587", "pm_score": 9, "selected": false, "text": "struct mystruct {\n char c; // one byte\n int i; // four bytes\n short s; // two bytes\n}\n" }, { "a...
2008/12/19
[ "https://Stackoverflow.com/questions/381244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42803/" ]
381,253
<p>So, I want to use jquery to set the text of a button, depending on the value of a property in the current row of a repeater.</p> <p>I need to call a function in the code-behind to map the value to the text the button should have. So, I need to pass to my foo function, the string value of the UserStatus property for...
[ { "answer_id": 381312, "author": "bdukes", "author_id": 2688, "author_profile": "https://Stackoverflow.com/users/2688", "pm_score": 1, "selected": false, "text": "<%# ... %>" } ]
2008/12/19
[ "https://Stackoverflow.com/questions/381253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35086/" ]
381,259
<p>I was just browsing a forum and someone asked about a PHP file they had found on the web. It has several spots like this in the code:</p> <p><code>if ($REMOTE_ADDR == "") $ip = "no ip"; else $ip = getHostByAddr($REMOTE_ADDR);</code></p> <p>I have always thought brackets are needed to enclose what you want to do i...
[ { "answer_id": 381274, "author": "Jacco", "author_id": 22674, "author_profile": "https://Stackoverflow.com/users/22674", "pm_score": 7, "selected": true, "text": "<?php\nif ($something) {\n echo 'one conditional line of code';\n echo 'another conditional line of code';\n}\n\n\nif ($s...
2008/12/19
[ "https://Stackoverflow.com/questions/381259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27620/" ]
381,265
<p>Since PHP is a dynamic language what's the best way of checking to see if a provided field is empty? </p> <p>I want to ensure that:</p> <ol> <li>null is considered an empty string</li> <li>a white space only string is considered empty</li> <li>that "0" is not considered empty</li> </ol> <p>This is what I've got ...
[ { "answer_id": 381275, "author": "Michael Haren", "author_id": 29, "author_profile": "https://Stackoverflow.com/users/29", "pm_score": 9, "selected": true, "text": "// Function for basic field validation (present and neither empty nor only white space\nfunction IsNullOrEmptyString($str){...
2008/12/19
[ "https://Stackoverflow.com/questions/381265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2443/" ]
381,267
<p>Simple question; what's better and why?</p> <pre><code> out.resize( in.size() ); T1::iterator outit = out.begin(); for( inIt = in.begin() to end, ++inIt, ++outIt ) *outit = *inIt OR out.erase(); for( inIt = in.begin() to end, ++inIt ) out.push_back( inIt ); </code></pre> <p>I...
[ { "answer_id": 381430, "author": "Matt Cruikshank", "author_id": 8643, "author_profile": "https://Stackoverflow.com/users/8643", "pm_score": 1, "selected": false, "text": "out = in;\n" }, { "answer_id": 381449, "author": "Eclipse", "author_id": 8701, "author_profile":...
2008/12/19
[ "https://Stackoverflow.com/questions/381267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38892/" ]
381,300
<p>I want to read an XML file into a <code>char *buffer</code> using C.</p> <p>What is the best way to do this?</p> <p>How should I get started?</p>
[ { "answer_id": 381329, "author": "Baget", "author_id": 34369, "author_profile": "https://Stackoverflow.com/users/34369", "pm_score": 2, "selected": false, "text": "struct stat file_status;\nchar *buf = NULL;\nFILE * pFile;\n\nstat(\"tmp.xml\", &file_status);\nbuf = (char*)malloc(file_sta...
2008/12/19
[ "https://Stackoverflow.com/questions/381300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41795/" ]
381,323
<p>I have a column that has fields such as C5, C6, C3, CC, CA, CD, etc. </p> <p>I want to be able to find all the columns that have a letter and then a number such as C5 and C6.</p> <p>I know if I do:</p> <pre><code>SELECT * FROM TABLE WHERE FIELD LIKE 'C%' </code></pre> <p>It will return CC,CA,CD as well, but I d...
[ { "answer_id": 381339, "author": "spittman", "author_id": 47810, "author_profile": "https://Stackoverflow.com/users/47810", "pm_score": 3, "selected": true, "text": "SELECT * FROM TABLE WHERE FIELD LIKE 'C[0-9]%'" }, { "answer_id": 1765504, "author": "priyanka.sarkar", "a...
2008/12/19
[ "https://Stackoverflow.com/questions/381323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33690/" ]
381,324
<p>I <a href="https://stackoverflow.com/questions/381164">this post</a>, I've seen this:</p> <pre><code>class MonitorObjectString: public MonitorObject { // some other declarations friend inline bool operator==(/*const*/ MonitorObjectString&amp; lhs, /*const*/ MonitorObjectStr...
[ { "answer_id": 381344, "author": "Andrew Rollings", "author_id": 40410, "author_profile": "https://Stackoverflow.com/users/40410", "pm_score": 3, "selected": false, "text": "const" }, { "answer_id": 381539, "author": "Drew Dormann", "author_id": 16287, "author_profile...
2008/12/19
[ "https://Stackoverflow.com/questions/381324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46571/" ]
381,363
<p>I'm so sick of the pass-callback-data-as-void*-struct anti-pattern. Boost bind solves it nicely, but is an unacceptable dependency. What's a lightweight alternative? How would I write it myself as simply as possible?</p>
[ { "answer_id": 381412, "author": "eduffy", "author_id": 7536, "author_profile": "https://Stackoverflow.com/users/7536", "pm_score": 3, "selected": true, "text": "#include <iostream>\n\nvoid foo (int const& x) {\n std::cout << \"x = \" << x << std::endl;\n}\n\nvoid bar (std::string con...
2008/12/19
[ "https://Stackoverflow.com/questions/381363", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20003/" ]
381,366
<p>I've used the <a href="http://msdn.microsoft.com/en-us/library/8bch7bkk.aspx" rel="nofollow noreferrer"><code>setargv.obj</code> linking for Expanding Wildcard Arguments</a> in the past for a number of C and C++ apps, but I can't find any similar mention for .net applications.</p> <p><strong>Is there a standard way ...
[ { "answer_id": 381471, "author": "BenAlabaster", "author_id": 40650, "author_profile": "https://Stackoverflow.com/users/40650", "pm_score": 2, "selected": false, "text": "var Dirs = Directory.GetDirectories(@\"C:\\Windows\", \"sys*\", \nSearchOption.TopDirectoryOnly).ToList();\nvar Files...
2008/12/19
[ "https://Stackoverflow.com/questions/381366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1441/" ]