qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
99,211
<p>I am trying to get Haml to work with my Ruby on Rails project. I am new to Ruby on Rails and I really like it. However, when I attempt to add an <code>aplication.html.haml</code> or <code>index.html.haml</code> for a view, I just receive errors.</p> <p>I am using NetBeans as my IDE.</p>
[ { "answer_id": 105542, "author": "Ryan McGeary", "author_id": 8985, "author_profile": "https://Stackoverflow.com/users/8985", "pm_score": 5, "selected": false, "text": "Gemfile gem \"haml\"\n bundle install `-- app\n `-- views\n |-- layouts\n | `-- application.html.ham...
2008/09/19
[ "https://Stackoverflow.com/questions/99211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
99,242
<p>For RMI on server-side, do we need to start <code>rmiregistry</code> program, or just call <code>LocateRegistry.createRegistry</code>? If both are possible, what are the advantages and disadvantages?</p>
[ { "answer_id": 99286, "author": "user17250", "author_id": 17250, "author_profile": "https://Stackoverflow.com/users/17250", "pm_score": 4, "selected": true, "text": "rmiregistry LocateRegistry.createRegistry rmiregistry createRegistry" }, { "answer_id": 985871, "author": "Wil...
2008/09/19
[ "https://Stackoverflow.com/questions/99242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11238/" ]
99,279
<p>I want to parse a web page in Groovy and extract all of the href links and the associated text with it.</p> <p>If the page contained these links:</p> <pre><code>&lt;a href="http://www.google.com"&gt;Google&lt;/a&gt;&lt;br /&gt; &lt;a href="http://www.apple.com"&gt;Apple&lt;/a&gt; </code></pre> <p>the output would...
[ { "answer_id": 99362, "author": "J D OConal", "author_id": 17023, "author_profile": "https://Stackoverflow.com/users/17023", "pm_score": 0, "selected": false, "text": "(html =~ /<a.*href='(.*?)'.*>(.*?)<\\/a>/).each { url, text -> \n // do something with url and text\n}\n" }, { ...
2008/09/19
[ "https://Stackoverflow.com/questions/99279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
99,297
<p>We all know what virtual functions are in C++, but how are they implemented at a deep level?</p> <p>Can the vtable be modified or even directly accessed at runtime?</p> <p>Does the vtable exist for all classes, or only those that have at least one virtual function? </p> <p>Do abstract classes simply have a NULL f...
[ { "answer_id": 99739, "author": "Andrew Stein", "author_id": 13029, "author_profile": "https://Stackoverflow.com/users/13029", "pm_score": 0, "selected": false, "text": "class B { ~B() = 0; }; // Abstract Base class\nclass D : public B { ~D() {} }; // Concrete Derived class\n\nD* pD = ne...
2008/09/19
[ "https://Stackoverflow.com/questions/99297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
99,299
<p>For example, referencing something as System.Data.Datagrid as opposed to just Datagrid. Please provide examples and explanation. Thanks.</p>
[ { "answer_id": 99329, "author": "Statement", "author_id": 2166173, "author_profile": "https://Stackoverflow.com/users/2166173", "pm_score": 2, "selected": false, "text": "using Datagrid = System.Data.Datagrid;\n" }, { "answer_id": 99335, "author": "Orion Adrian", "author_...
2008/09/19
[ "https://Stackoverflow.com/questions/99299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13578/" ]
99,302
<p>Would it be useful to include the class name and variable name in any NullPointerException message? I know that it might not always be possible because of changes made by a JIT but is seems like the info should be available often (class members, etc).</p> <p>From: <a href="http://jamesjava.blogspot.com/2005/04/wha...
[ { "answer_id": 99360, "author": "Soumitra", "author_id": 10844, "author_profile": "https://Stackoverflow.com/users/10844", "pm_score": -1, "selected": false, "text": "NullPointerException null Log4J" }, { "answer_id": 99512, "author": "Roy Tang", "author_id": 18494, "...
2008/09/19
[ "https://Stackoverflow.com/questions/99302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6770/" ]
99,315
<p>What if a Java allow both static and dynamic types. That might allow the best of both worlds. i.e.:</p> <pre><code>String str = "Hello"; var temp = str; temp = 10; temp = temp * 5; </code></pre> <ol> <li>Would that be possible?</li> <li>Would that be beneficial?</li> <li>Do any languages currently support both and...
[ { "answer_id": 99333, "author": "jon", "author_id": 12215, "author_profile": "https://Stackoverflow.com/users/12215", "pm_score": 1, "selected": false, "text": "String str = \"Hello\";\nObject temp = str;\ntemp = 10;\n" }, { "answer_id": 99376, "author": "Lou Franco", "au...
2008/09/19
[ "https://Stackoverflow.com/questions/99315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6770/" ]
99,318
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/1217088/what-does-mapname-mean-in-ruby">What does map(&amp;:name) mean in Ruby?</a> </p> </blockquote> <p>I was watching a railscast and saw this code.</p> <pre><code>[Category, Product].(&amp;:delete_all) </c...
[ { "answer_id": 99336, "author": "Alex M", "author_id": 9652, "author_profile": "https://Stackoverflow.com/users/9652", "pm_score": 5, "selected": true, "text": "class Symbol\n def to_proc\n proc { |obj, *args| obj.send(self, *args) }\n end\nend\n ActiveSupport" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/99318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9450/" ]
99,350
<p>Is there an easy way to marshal a PHP associative array to and from XML? For example, I have the following array:</p> <pre><code>$items = array("1", "2", array( "item3.1" =&gt; "3.1", "item3.2" =&gt; "3.2" "isawesome" =&gt; true ) ); </code></pre> <p>How would I turn it into somethi...
[ { "answer_id": 100287, "author": "DreamWerx", "author_id": 15487, "author_profile": "https://Stackoverflow.com/users/15487", "pm_score": 2, "selected": false, "text": "<items>\n <item id=\"1\"/>\n <item id=\"2\"/>\n <item id=\"3\">\n <subitems> \n <item id=\"3.1\"/>\n <item...
2008/09/19
[ "https://Stackoverflow.com/questions/99350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15004/" ]
99,353
<p>How to test if a line segment intersects an axis-aligned rectange in 2D? The segment is defined with its two ends: p1, p2. The rectangle is defined with top-left and bottom-right points.</p>
[ { "answer_id": 99568, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 0, "selected": false, "text": "y = (Point2.Y - Point1.Y) / (Point2.X - Point1.X)\n X1 <= x <= X2 & \nY1 <= y <= Y2\n" }, { "answer_id": 100165, "a...
2008/09/19
[ "https://Stackoverflow.com/questions/99353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14385/" ]
99,391
<p>When I commit I get this error from Subversion:</p> <pre><code>bash-2.05b$ svn commit -m "testing subversion, still" Adding baz svn: Commit failed (details follow): svn: MKCOL of '/viper/!svn/wrk/6b9bcd38-b2fe-0310-95ff-9d1a44098866/sandboxes/ohammersmith/trunk/baz': 405 Method Not Allowed (http://svn.examp...
[ { "answer_id": 99413, "author": "Otto", "author_id": 9594, "author_profile": "https://Stackoverflow.com/users/9594", "pm_score": 8, "selected": true, "text": "svn up bash-2.05b$ svn up\nsvn: Failed to add directory 'baz': object of the same name already exists\n svn update svn update" ...
2008/09/19
[ "https://Stackoverflow.com/questions/99391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9594/" ]
99,395
<p>How to check if a folder (directory) exists in Cocoa using Objective-C?</p>
[ { "answer_id": 99438, "author": "Matt Dillard", "author_id": 863, "author_profile": "https://Stackoverflow.com/users/863", "pm_score": 7, "selected": true, "text": "NSFileManager fileExistsAtPath:isDirectory:" }, { "answer_id": 99465, "author": "lajos", "author_id": 3740,...
2008/09/19
[ "https://Stackoverflow.com/questions/99395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3740/" ]
99,419
<p>An obvious answer is "an internal wiki". What are the pros and cons of a wiki used for software documentation? Any other suggestions? What are you using for your software documentation?</p> <p><a href="https://stackoverflow.com/users/6436/loren-segal">Loren Segal</a> - Unfortunately we don't have support for any do...
[ { "answer_id": 99462, "author": "Loren Segal", "author_id": 6436, "author_profile": "https://Stackoverflow.com/users/6436", "pm_score": 4, "selected": true, "text": "docs/" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/99419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8934/" ]
99,468
<p>I am retrieving multiple rows into a listview control from an ODBC source. For simple SELECTs it seems to work well with a statement attribute of SQL_SCROLLABLE. How do I do this with a UNION query (with two selects)?</p> <p>The most likely server will be MS SQL Server (probably 2005). The code is C for the Win3...
[ { "answer_id": 99628, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 1, "selected": false, "text": "select some_fields from table1\nunion\nselect same_fields from table2\n" }, { "answer_id": 146031, "author...
2008/09/19
[ "https://Stackoverflow.com/questions/99468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3137/" ]
99,479
<p>My C(++) program, written and compiled using Visual C(++)/Visual Studio, runs fine on my own machine, but refuses to run on another machine. The error message I get is "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."</p>
[ { "answer_id": 108198, "author": "Scott", "author_id": 12451, "author_profile": "https://Stackoverflow.com/users/12451", "pm_score": 1, "selected": false, "text": "\\Program Files\\Microsoft Visual Studio 8\\SDK\\v2.0\\BootStrapper\\Packages\\vcredist_x86\n" }, { "answer_id": 197...
2008/09/19
[ "https://Stackoverflow.com/questions/99479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14637/" ]
99,488
<p>If I'm writing an application that wants to communicate some information through the use of color, how can I change the background and foreground colors of a given widget? I would like to know how to do this in glade if it's possible, as well as programmatically (to a computed color).</p> <p>I want to know how to ...
[ { "answer_id": 100266, "author": "Tometzky", "author_id": 15862, "author_profile": "https://Stackoverflow.com/users/15862", "pm_score": 4, "selected": true, "text": "#include <gtk/gtk.h>\n\nstatic void on_destroy(GtkWidget* widget, gpointer data)\n{\n gtk_main_quit ();\n}\n\nint m...
2008/09/19
[ "https://Stackoverflow.com/questions/99488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13564/" ]
99,497
<p>I'm not looking so much for language-specific answers, just general models for implementing a plugin system (if you want to know, I'm using Python). I have my own idea (register callbacks, and that's about it), but I know others exist. What's normally used, and what else is reasonable?</p> <blockquote> <p>What do...
[ { "answer_id": 99534, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 1, "selected": false, "text": "setuptools pkg_resources" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/99497", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18515/" ]
99,510
<p>Does having several levels of base classes slow down a class? A derives B derives C derives D derives F derives G, ...</p> <p>Does multiple inheritance slow down a class?</p>
[ { "answer_id": 99531, "author": "Statement", "author_id": 2166173, "author_profile": "https://Stackoverflow.com/users/2166173", "pm_score": 0, "selected": false, "text": "// F is-a E,\n// E is-a D and so on\n\nA* aObject = new F(); \naObject->CallAVirtual();\n" }, { "answer_id": ...
2008/09/19
[ "https://Stackoverflow.com/questions/99510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
99,535
<p>What tools do you use for Automated Builds / Automated Deployments? Why?</p> <p>What tools do you recommend?</p>
[ { "answer_id": 99601, "author": "BCS", "author_id": 1343, "author_profile": "https://Stackoverflow.com/users/1343", "pm_score": 2, "selected": false, "text": "make bash make cmd" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/99535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18475/" ]
99,542
<p>How do I correct for floating point error in the following physical simulation:</p> <ul> <li>Original point (x, y, z),</li> <li>Desired point (x', y', z') after forces are applied.</li> <li>Two triangles (A, B, C) and (B, C, D), who share edge BC</li> </ul> <p>I am using this method for collision detection:</p> <...
[ { "answer_id": 168377, "author": "user4891", "author_id": 4891, "author_profile": "https://Stackoverflow.com/users/4891", "pm_score": 0, "selected": false, "text": "double Distance(double x0, double y0, double x1, double y1)\n{\n double a, b, dx, dy;\n\n dx = abs(x1 - x0);\n dy = abs(...
2008/09/19
[ "https://Stackoverflow.com/questions/99542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2581/" ]
99,546
<p>I read this <a href="http://smartprogrammer.blogspot.com/2006/04/15-exercises-for-learning-new.html" rel="nofollow noreferrer">article</a> and try to do the exercise in D Programming Language, but encounter a problem in the first exercise.</p> <blockquote> <p>(1) Display series of numbers (1,2,3,4, 5....etc) in...
[ { "answer_id": 100380, "author": "Brian Hsu", "author_id": 242644, "author_profile": "https://Stackoverflow.com/users/242644", "pm_score": 0, "selected": false, "text": "import tango.io.Stdout;\nimport tango.core.Thread;\n\n// Prototype for used ncurses library function.\nextern(C)\n{\n ...
2008/09/19
[ "https://Stackoverflow.com/questions/99546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242644/" ]
99,552
<p>I sometimes notice programs that crash on my computer with the error: "pure virtual function call".</p> <p>How do these programs even compile when an object cannot be created of an abstract class?</p>
[ { "answer_id": 99575, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 8, "selected": true, "text": "class Base\n{\npublic:\n Base() { reallyDoIt(); }\n void reallyDoIt() { doIt(); } // DON'T DO THIS\n virtual ...
2008/09/19
[ "https://Stackoverflow.com/questions/99552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
99,560
<p>I am working on a Rails application that needs to handle dates and times in users' time zones. We have recently migrated it to Rails 2.1 and added time zone support, but there are numerous situations in which we use Time#utc and then compare against that time. Wouldn't that be the same as comparing against the origi...
[ { "answer_id": 99942, "author": "nikz", "author_id": 3977, "author_profile": "https://Stackoverflow.com/users/3977", "pm_score": 4, "selected": true, "text": "config.time_zone = 'UTC'\n" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/99560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7717/" ]
99,623
<p>I'd like to be able to do some drawing to the right of the menu bar, in the nonclient area of a window. </p> <p>Is this possible, using C++ / MFC?</p>
[ { "answer_id": 99679, "author": "Charlie", "author_id": 18529, "author_profile": "https://Stackoverflow.com/users/18529", "pm_score": 2, "selected": false, "text": "case WM_NCPAINT:\n{\n HDC hdc;\n hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN);\n // Paint into this DC\n ...
2008/09/19
[ "https://Stackoverflow.com/questions/99623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
99,642
<p>I was curious if anyone had any problems creating unit tests around using the ResourceManager. I am using Visual Studio test edition and it appears that the satellite assemblies don't get loaded during the test. When I try to get a resource for another culture, the test always fails and the resource manager always...
[ { "answer_id": 62429661, "author": "jackomo", "author_id": 2393063, "author_profile": "https://Stackoverflow.com/users/2393063", "pm_score": 1, "selected": false, "text": "[DeploymentItem( @\"de-DE\\AssemblyName.resources.dll\", \"de-DE\")]\n" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/99642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10874/" ]
99,643
<p>After applying a CSS reset, I want to get back to 'normal' behavior for html elements like: p, h1..h6, strong, ul and li.</p> <p>Now when I say normal I mean e.g. the p element adds spacing or a carriage return like result when used, or the size of the font and boldness for a h1 tag, along with the spacing.</p> <p...
[ { "answer_id": 99646, "author": "da5id", "author_id": 14979, "author_profile": "https://Stackoverflow.com/users/14979", "pm_score": 3, "selected": false, "text": "* {\n padding: 0;\n margin: 0;\n}\n\nh1, h2, h3, h4, h5, h6, p, blockquote, form, label, ul, ol, dl, fieldset, address ...
2008/09/19
[ "https://Stackoverflow.com/questions/99643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
99,683
<p>My question is what do most developers prefer for error handling, Exceptions or Error Return Codes. Please be language(or language family) specific and why you prefer one over the other.</p> <p>I'm asking this out of curiosity. Personally I prefer Error Return Codes since they are less explosive and don't force use...
[ { "answer_id": 99728, "author": "SCdF", "author_id": 1666, "author_profile": "https://Stackoverflow.com/users/1666", "pm_score": 1, "selected": false, "text": "doFoo()" }, { "answer_id": 99740, "author": "Robert Gould", "author_id": 15124, "author_profile": "https://S...
2008/09/19
[ "https://Stackoverflow.com/questions/99683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15124/" ]
99,684
<p>The most basic task in an object oriented environment is executing a method on an object. To do this, you have to have a reference to the object on which you are invoking the method. Is the proper way to establish this reference to pass the object as a parameter to the constructor (or initializer method) of the call...
[ { "answer_id": 99921, "author": "xanadont", "author_id": 1886, "author_profile": "https://Stackoverflow.com/users/1886", "pm_score": 0, "selected": false, "text": "foo = new Foo();\nbar = Foo.Poop();\n\nfunction Foo::Poop()\n{\n bar = new Bar(this);\n myChildren.Add(bar);\n retu...
2008/09/19
[ "https://Stackoverflow.com/questions/99684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8092/" ]
99,686
<p>From <a href="http://en.wikipedia.org/wiki/Generic_programming" rel="noreferrer">Wikipedia</a>: </p> <blockquote> <p>Generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types pr...
[ { "answer_id": 99712, "author": "Francis B.", "author_id": 17067, "author_profile": "https://Stackoverflow.com/users/17067", "pm_score": 3, "selected": false, "text": "List<MyObject>" }, { "answer_id": 126278, "author": "Amy B", "author_id": 8155, "author_profile": "h...
2008/09/19
[ "https://Stackoverflow.com/questions/99686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18475/" ]
99,688
<p>One of the biggest advantages of object-oriented programming is encapsulation, and one of the "truths" we've (or, at least, I've) been taught is that members should always be made private and made available via accessor and mutator methods, thus ensuring the ability to verify and validate the changes.</p> <p>I'm cu...
[ { "answer_id": 99703, "author": "SCdF", "author_id": 1666, "author_profile": "https://Stackoverflow.com/users/1666", "pm_score": 0, "selected": false, "text": "private Foo foo;\npublic Foo getFoo() {}\npublic void setFoo(Foo foo) {}\n" }, { "answer_id": 99751, "author": "Mike...
2008/09/19
[ "https://Stackoverflow.com/questions/99688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18210/" ]
99,732
<p>Using reflection in .Net, what is the differnce between:</p> <pre><code> if (foo.IsAssignableFrom(typeof(IBar))) </code></pre> <p>And</p> <pre><code> if (foo.GetInterface(typeof(IBar).FullName) != null) </code></pre> <p>Which is more appropriate, why?<br></p> <p>When could one or the other fail?</p>
[ { "answer_id": 45838091, "author": "Holf", "author_id": 169334, "author_profile": "https://Stackoverflow.com/users/169334", "pm_score": 1, "selected": false, "text": "public interface IFoo\n{\n} \n\ninternal class Foo: IFoo\n{\n}\n var types = typeof(IFoo).Assembly.GetTypes()\n ...
2008/09/19
[ "https://Stackoverflow.com/questions/99732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14484/" ]
99,755
<p>When working on a linx CShell u get the option to press the up / down arrows to select the last command/s typed or the Command Buffer. This even works on Windows.</p> <p>However this is not functional when working on Solaris, to which i recently switched. I am guessing that the shell is also a CShell. </p> <p>Plea...
[ { "answer_id": 100729, "author": "Hank Gay", "author_id": 4203, "author_profile": "https://Stackoverflow.com/users/4203", "pm_score": 2, "selected": false, "text": "sh csh tcsh root sh root passwd -e /path/to/shell_of_your_choice <loginname> passwd -e /bin/csh <loginname>" }, { "...
2008/09/19
[ "https://Stackoverflow.com/questions/99755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
99,781
<p>I have a client that is asking me to give them a listing of every file and folder in the source code (and then a brief explanation of the source tree). Is there an easy way to create some sort of decently formatted list like this from a subversion repository?</p>
[ { "answer_id": 99797, "author": "Thomas", "author_id": 14637, "author_profile": "https://Stackoverflow.com/users/14637", "pm_score": 1, "selected": false, "text": "cd" }, { "answer_id": 99810, "author": "Alan Storm", "author_id": 4668, "author_profile": "https://Stack...
2008/09/19
[ "https://Stackoverflow.com/questions/99781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1486/" ]
99,807
<p>Macs are renowned (or bemoaned) for having an extensive number of shortcuts. However, OS X itself pales in comparison to the shortcut lists in <a href="http://macromates.com/" rel="noreferrer">TextMate</a> and its bundles.</p> <p>What are some useful keyboard shortcuts you use?</p>
[ { "answer_id": 100528, "author": "Matt", "author_id": 15368, "author_profile": "https://Stackoverflow.com/users/15368", "pm_score": 3, "selected": false, "text": "if⇥" }, { "answer_id": 2646864, "author": "Agos", "author_id": 107613, "author_profile": "https://Stackov...
2008/09/19
[ "https://Stackoverflow.com/questions/99807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1167846/" ]
99,827
<p>I'm interested in tracing database calls made by LINQ to SQL back to the .NET code that generated the call. For instance, a DBA might have a concern that a particular cached execution plan is doing poorly. If for example a DBA were to tell a developer to address the following code...</p> <pre><code>exec sp_executes...
[ { "answer_id": 100528, "author": "Matt", "author_id": 15368, "author_profile": "https://Stackoverflow.com/users/15368", "pm_score": 3, "selected": false, "text": "if⇥" }, { "answer_id": 2646864, "author": "Agos", "author_id": 107613, "author_profile": "https://Stackov...
2008/09/19
[ "https://Stackoverflow.com/questions/99827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1360388/" ]
99,866
<p>I'm at the beginning/middle of a project that we chose to implement using GWT. Has anyone encountered any major pitfalls in using GWT (and GWT-EXT) that were unable to be overcome? How about from a performance perspective?</p> <p>A couple things that we've seen/heard already include:</p> <ul> <li>Google not being ...
[ { "answer_id": 99977, "author": "rustyshelf", "author_id": 6044, "author_profile": "https://Stackoverflow.com/users/6044", "pm_score": 9, "selected": true, "text": "<set-property name=\"user.agent\" value=\"gecko1_8\" />\n" }, { "answer_id": 104641, "author": "jgindin", "...
2008/09/19
[ "https://Stackoverflow.com/questions/99866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18402/" ]
99,876
<p>I just wanted some opinions from people that have run Selenium (<a href="http://selenium.openqa.org" rel="nofollow noreferrer">http://selenium.openqa.org</a>) I have had a lot of experience with WaTiN and even wrote a recording suite for it. I had it producing some well-structured code but being only maintained by m...
[ { "answer_id": 99965, "author": "marcospereira", "author_id": 4600, "author_profile": "https://Stackoverflow.com/users/4600", "pm_score": 6, "selected": true, "text": "public class GoogleTest {\n\n private Selenium selenium;\n\n @Before\n public void setUp() throws Exception {\n...
2008/09/19
[ "https://Stackoverflow.com/questions/99876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13688/" ]
99,880
<p>I need to write a function that generates an id that is unique for a given machine running a Windows OS.</p> <p>Currently, I'm using WMI to query various hardware parameters and concatenate them together and hash them to derive the unique id. My question is, what are the suggested parameters I should use? Currentl...
[ { "answer_id": 114949, "author": "Jonas Engström", "author_id": 7634, "author_profile": "https://Stackoverflow.com/users/7634", "pm_score": 6, "selected": true, "text": "EnumSystemFirmwareEntries EnumSystemFirmwareTables GetSystemFirmwareTable" }, { "answer_id": 289806, "auth...
2008/09/19
[ "https://Stackoverflow.com/questions/99880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/618/" ]
99,907
<ol> <li>In the application we have something about 30 types of objects that are created repeatedly. </li> <li>Some of them have long life (hours) some have short (milliseconds). </li> <li>Objects could be created in one thread and destroyed in another.</li> </ol> <p>Does anybody have any clue what could be good pooli...
[ { "answer_id": 100204, "author": "Mladen Janković", "author_id": 6300, "author_profile": "https://Stackoverflow.com/users/6300", "pm_score": 0, "selected": false, "text": "Object* ObjectPool::AcquireObject()\n{\n Object* object = 0;\n lock( _stackLock );\n if( _stackIndex )\n ...
2008/09/19
[ "https://Stackoverflow.com/questions/99907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18547/" ]
99,912
<p>I am trying to use directory services to add a directory entry to an openldap server. The examples I have seen look pretty simple, but I keep getting the error "There is an naming violation". What does this message mean? How do I resolve it?</p> <p>I have included the code, ldif file used to create the person cont...
[ { "answer_id": 104942, "author": "Michael", "author_id": 13379, "author_profile": "https://Stackoverflow.com/users/13379", "pm_score": 1, "selected": false, "text": "SetADProperty(newUser, \"objectClass\", \"top\")\n organizationalPerson person" }, { "answer_id": 1195895, "au...
2008/09/19
[ "https://Stackoverflow.com/questions/99912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
99,917
<p>So I was reading these Asp.Net <a href="http://www.hanselman.com/blog/ASPNETInterviewQuestions.aspx" rel="nofollow noreferrer">interview questions</a> at Scott Hanselman's blog and I came across this question. Can anyone shed some light of what he's talking about.</p>
[ { "answer_id": 100102, "author": "WebDude", "author_id": 15360, "author_profile": "https://Stackoverflow.com/users/15360", "pm_score": 0, "selected": false, "text": "ClientScript System.Web.UI.Page GetPostBackEventReference __doPostBack" }, { "answer_id": 100431, "author": "s...
2008/09/19
[ "https://Stackoverflow.com/questions/99917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1688440/" ]
99,927
<p>Can someone provide an explanation of variable scope in JS as it applies to objects, functions and closures? </p>
[ { "answer_id": 101089, "author": "AnthonyWJones", "author_id": 17516, "author_profile": "https://Stackoverflow.com/users/17516", "pm_score": 6, "selected": true, "text": "var x = 1;\n window.x = 1;\n function fn()\n{\n var x = 1;\n}\n fn x fn function fnSequence()\n{\n var x = 1;\n...
2008/09/19
[ "https://Stackoverflow.com/questions/99927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56663/" ]
100,003
<p>What are metaclasses? What are they used for?</p>
[ { "answer_id": 100037, "author": "Jerub", "author_id": 14648, "author_profile": "https://Stackoverflow.com/users/14648", "pm_score": 9, "selected": false, "text": "class type(object)\n | type(object) -> the object's type\n | type(name, bases, dict) -> a new type\n class ThisIsTheName...
2008/09/19
[ "https://Stackoverflow.com/questions/100003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9951/" ]
100,007
<p>When logging with Log4Net it's very easy to put class that called the log into the log file. I've found in the past that this makes it very easy to trace through the code and see the flow through the classes. In Log4Net I use the %logger property in the conversion pattern like so: </p> <pre><code>&lt;conversionPa...
[ { "answer_id": 100075, "author": "Tom Carr", "author_id": 14954, "author_profile": "https://Stackoverflow.com/users/14954", "pm_score": 1, "selected": false, "text": " StackTrace trace = new StackTrace(ex, true);\n StackFrame frame = trace.GetFrame(0);\n" }, { "answer_id": 100961...
2008/09/19
[ "https://Stackoverflow.com/questions/100007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11908/" ]
100,038
<p>How can I make a Facebook RSS application that autoupdates from the provided RSS feeds. Of course doing this is trivial for canvas applications, but I need this for showing on the Facebook Page. All the RSS apps I've taken a look at either dont update or dont work on Facebook Pages. </p> <p>Especially now that inf...
[ { "answer_id": 100598, "author": "Josh", "author_id": 10902, "author_profile": "https://Stackoverflow.com/users/10902", "pm_score": 0, "selected": false, "text": "fb:ref" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/100038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18219/" ]
100,045
<p>What is a good regular expression that can validate a text string to make sure it is a valid Windows filename? (AKA not have <code>\/:*?"&lt;&gt;|</code> characters).</p> <p>I'd like to use it like the following:</p> <pre><code>// Return true if string is invalid. if (Regex.IsMatch(szFileName, "&lt;your regex stri...
[ { "answer_id": 100066, "author": "Isak Savo", "author_id": 8521, "author_profile": "https://Stackoverflow.com/users/8521", "pm_score": 7, "selected": true, "text": "if (proposedFilename.IndexOfAny(System.IO.Path.GetInvalidFileNameChars()) != -1)\n{\n MessageBox.Show(\"The filename is in...
2008/09/19
[ "https://Stackoverflow.com/questions/100045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13115/" ]
100,048
<p>I have two unsorted lists and I need to produce another list which is sorted and where all the elements are unique.</p> <p>The elements can occur multiple times in both lists and they are originally unsorted.</p> <p>My function looks like this:</p> <pre><code>(defun merge-lists (list-a list-b sort-fn) "Merges...
[ { "answer_id": 100109, "author": "Antti Rasinen", "author_id": 8570, "author_profile": "https://Stackoverflow.com/users/8570", "pm_score": 5, "selected": true, "text": "(defun merge-lists (list-a list-b sort-fn test-fn)\n (sort (remove-duplicates (append list-a list-b) :test test-fn) ...
2008/09/19
[ "https://Stackoverflow.com/questions/100048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7780/" ]
100,068
<p>I'd like to know if there's an easier way to insert a record if it doesn't already exist in a table. I'm still trying to build my LINQ to SQL skills. </p> <p>Here's what I've got, but it seems like there should be an easier way.</p> <pre><code>public static TEntity InsertIfNotExists&lt;TEntity&gt; ( DataContex...
[ { "answer_id": 100496, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 5, "selected": true, "text": "public static void InsertIfNotExists<TEntity>\n (this Table<TEntity> table,\n TEnt...
2008/09/19
[ "https://Stackoverflow.com/questions/100068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11574/" ]
100,081
<p>I have the following C# singleton pattern, is there any way of improving it? </p> <pre><code> public class Singleton&lt;T&gt; where T : class, new() { private static object _syncobj = new object(); private static volatile T _instance = null; public static T Instance { ...
[ { "answer_id": 100093, "author": "EggyBach", "author_id": 15475, "author_profile": "https://Stackoverflow.com/users/15475", "pm_score": 3, "selected": false, "text": "// Singleton PatternJudith Bishop Nov 2007\n// Generic version\n\npublic class Singleton<T> where T : class, new()\n{\n...
2008/09/19
[ "https://Stackoverflow.com/questions/100081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17174/" ]
100,104
<p>I've written a small hello world test app in Silverlight which i want to host on a Linux/Apache2 server. I want the data to come from MySQL (or some other linux compatible db) so that I can databind to things in the db.</p> <p>I've managed to get it working by using the <a href="http://www.mysql.com/products/connec...
[ { "answer_id": 5463132, "author": "angularsen", "author_id": 134761, "author_profile": "https://Stackoverflow.com/users/134761", "pm_score": 2, "selected": false, "text": "<ListBox x:Name=\"TestList\" Width=\"100\" />\n public partial class Home : Page\n{\n public Home()\n {\n ...
2008/09/19
[ "https://Stackoverflow.com/questions/100104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8521/" ]
100,106
<pre><code>sub foo {[$#{$_[!$||$|]}*@{$_[!!$_^!$_]}?@{$_[!$..!!$.]}[$_[@--@+]% @{$_[$==~/(?=)//!$`]}..$#{$_[$??!!$?:!$?]},($)?!$):!!$))..$_[$--$-]%@{ $_[$]/$]]}-(!!$++!$+)]:@{$_[!!$^^^!$^^]}]} </code></pre> <p>update: I thought the word "puzzle" would imply this, but: <em>I</em> know what it does - I wrote it. If the...
[ { "answer_id": 100503, "author": "nohat", "author_id": 3101, "author_profile": "https://Stackoverflow.com/users/3101", "pm_score": 3, "selected": false, "text": "sub foo {\n my ($list1, $list2) = @_;\n my @output;\n if (@$list2 > 0) {\n my $split = $list1 % @$list2;\n ...
2008/09/19
[ "https://Stackoverflow.com/questions/100106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17389/" ]
100,107
<p>I'm investigating the following <code>java.lang.VerifyError</code></p> <pre><code>java.lang.VerifyError: (class: be/post/ehr/wfm/application/serviceorganization/report/DisplayReportServlet, method: getMonthData signature: (IILjava/util/Collection;Ljava/util/Collection;Ljava/util/HashMap;Ljava/util/Collection;Ljava/...
[ { "answer_id": 100134, "author": "p3t0r", "author_id": 16685, "author_profile": "https://Stackoverflow.com/users/16685", "pm_score": 5, "selected": false, "text": "java.lang.VerifyError utf-8" }, { "answer_id": 101364, "author": "Alex Miller", "author_id": 7671, "auth...
2008/09/19
[ "https://Stackoverflow.com/questions/100107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15490/" ]
100,123
<p>I would like to create an application wide keyboard shortcut for a Java Swing application. Looping over all components and adding the shortcut on each, has focus related side effects, and seems like a brute force solution.</p> <p>Anyone has a cleaner solution?</p>
[ { "answer_id": 100754, "author": "Tom Hawtin - tackline", "author_id": 4725, "author_profile": "https://Stackoverflow.com/users/4725", "pm_score": 5, "selected": false, "text": "JComponent.registerKeyboardAction WHEN_IN_FOCUSED_WINDOW JComponent.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(ke...
2008/09/19
[ "https://Stackoverflow.com/questions/100123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18591/" ]
100,161
<p>I was happily using Eclipse 3.2 (or as happy as one can be using Eclipse) when for a forgotten reason I decided to upgrade to 3.4. I'm primarily using PyDev, Aptana, and Subclipse, very little Java development.</p> <p>I've noticed 3.4 tends to really give my laptop a hernia compared to 3.2 (vista, core2duo, 2G). Is...
[ { "answer_id": 100180, "author": "Drejc", "author_id": 6482, "author_profile": "https://Stackoverflow.com/users/6482", "pm_score": 2, "selected": false, "text": "-vmargs -XX:MaxPermSize=1024M -Xms256M -Xmx1024M\n" }, { "answer_id": 101164, "author": "VonC", "author_id": 6...
2008/09/19
[ "https://Stackoverflow.com/questions/100161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13055/" ]
100,170
<p>I have a folder on my server to which I had a number of symbolic links pointing. I've since created a new folder and I want to change all those symbolic links to point to the new folder. I'd considered replacing the original folder with a symlink to the new folder, but it seems that if I continued with that practice...
[ { "answer_id": 100200, "author": "skymt", "author_id": 18370, "author_profile": "https://Stackoverflow.com/users/18370", "pm_score": 7, "selected": true, "text": "find . -lname /particular/folder\n /particular/folder find . -lname '*folder'\n" }, { "answer_id": 100203, "autho...
2008/09/19
[ "https://Stackoverflow.com/questions/100170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
100,196
<p>What is the difference between the <a href="https://msdn.microsoft.com/en-us/library/z883w3dc(v=vs.110).aspx" rel="noreferrer">AddRange</a> and <a href="https://msdn.microsoft.com/en-us/library/bb302894(v=vs.110).aspx" rel="noreferrer">Concat</a> functions on a generic List? Is one recommended over the other?</p>
[ { "answer_id": 100239, "author": "AnthonyWJones", "author_id": 17516, "author_profile": "https://Stackoverflow.com/users/17516", "pm_score": 6, "selected": false, "text": "AddRange Concat Concat IEnumerable<T> IEnumerable<T> .ToList() AddRange IEnumerable<T> Concat .ToList Concat" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/100196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5302/" ]
100,210
<p>Given a <code>datetime.time</code> value in Python, is there a standard way to add an integer number of seconds to it, so that <code>11:34:59</code> + 3 = <code>11:35:02</code>, for example?</p> <p>These obvious ideas don't work:</p> <pre><code>&gt;&gt;&gt; datetime.time(11, 34, 59) + 3 TypeError: unsupported oper...
[ { "answer_id": 100250, "author": "Nick Johnson", "author_id": 12030, "author_profile": "https://Stackoverflow.com/users/12030", "pm_score": 0, "selected": false, "text": "datetime.datetime datetime.timedelta time() datetime.datetime" }, { "answer_id": 100345, "author": "paxdi...
2008/09/19
[ "https://Stackoverflow.com/questions/100210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5536/" ]
100,211
<p>I just installed Glassfish V2 on my local machine just to play around with it.</p> <p>I was wondering if there is a way to retrieve a param passed in by the GET HTTP method.</p> <p>For instance,</p> <pre><code>http://localhost:8080/HelloWorld/resources/helloWorld?name=ABC </code></pre> <p>How do I retrieve the "...
[ { "answer_id": 100396, "author": "tgdavies", "author_id": 11002, "author_profile": "https://Stackoverflow.com/users/11002", "pm_score": 3, "selected": true, "text": "@Path(\"/helloWorld\")\n@Consumes({\"application/xml\", \"application/json\"})\n@Produces({\"application/xml\", \"applicat...
2008/09/19
[ "https://Stackoverflow.com/questions/100211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4004/" ]
100,216
<p>I'm trying to integrate running Fitnesse tests from MSBuild im my nightly build on TFS.</p> <p>In an attempt to make it self contained I would like to start the seleniumRC server only when it's needed from fitness.</p> <p>I've seen that there is a "Command Line Fixture" but it's written in java can I use that?</p>...
[ { "answer_id": 100647, "author": "Martin Woodward", "author_id": 6438, "author_profile": "https://Stackoverflow.com/users/6438", "pm_score": 2, "selected": true, "text": "Process process = Process.GetProcessById(ProcessId);\nprocess.Kill();\n" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/100216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11434/" ]
100,221
<p>Whilst refactoring some old code I realised that a particular header file was full of function declarations for functions long since removed from the .cpp file. Does anyone know of a tool that could find (and strip) these automatically?</p>
[ { "answer_id": 647548, "author": "zhaorufei", "author_id": 64469, "author_profile": "https://Stackoverflow.com/users/64469", "pm_score": 2, "selected": false, "text": "void foo(int );\n\nint main()\n{\n return 0;\n}\n" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/100221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
100,228
<p>I'm trying to set up part of a schema that's like a "Sequence" where all child elements are optional, but at least one of the elements <strong>must</strong> be present, and there could be more than one of them.</p> <p>I tried doing the following, but XMLSpy complains that "The content model contains the elements &l...
[ { "answer_id": 100313, "author": "gizmo", "author_id": 9396, "author_profile": "https://Stackoverflow.com/users/9396", "pm_score": 6, "selected": true, "text": "<xs:choice>\n <xs:sequence>\n <xs:element name=\"Elem1\" />\n <xs:element name=\"Elem2\" minOccurs=\"0\" />\n <xs:ele...
2008/09/19
[ "https://Stackoverflow.com/questions/100228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18603/" ]
100,235
<p>For an open source project I am looking for a good, simple implementation of a Dictionary that is backed by a file. Meaning, if an application crashes or restarts the dictionary will keep its state. I would like it to update the underlying file every time the dictionary is touched. (Add a value or remove a value). A...
[ { "answer_id": 176561, "author": "Omer van Kloeten", "author_id": 4979, "author_profile": "https://Stackoverflow.com/users/4979", "pm_score": 0, "selected": false, "text": "BinaryWriter Dictionary<TKey, TValue>" }, { "answer_id": 482984, "author": "lubos hasko", "author_i...
2008/09/19
[ "https://Stackoverflow.com/questions/100235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17174/" ]
100,236
<p>How can I insert ASCII special characters (e.g. with the ASCII value 0x01) into a string?</p> <p>I ask because I am using the following:</p> <pre><code>str.Replace( "&lt;TAG1&gt;", Convert.ToChar(0x01).ToString() ); </code></pre> <p>and I feel that there must be a better way than this. Any Ideas?</p> <p>Update:<...
[ { "answer_id": 100244, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 4, "selected": true, "text": "\\uXXXX using System;\nclass Uxxxx {\n public static void Main() {\n Console.WriteLine(\"\\u20AC\");\n }\n}\n" ...
2008/09/19
[ "https://Stackoverflow.com/questions/100236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1816/" ]
100,242
<p>You can use </p> <p>SelectFolder() to get a folder</p> <p>or </p> <p>GetOpenFolderitem(filter as string) to get files</p> <p>but can you select either a folder or file? ( or for that matter selecting multiple files )</p>
[ { "answer_id": 170102, "author": "Philip Regan", "author_id": 11976, "author_profile": "https://Stackoverflow.com/users/11976", "pm_score": 4, "selected": true, "text": "OpenDialogMBS.AllowFolderSelection as Boolean\nproperty, Navigation, MBS Util Plugin (OpenDialog), class OpenDialogMBS...
2008/09/19
[ "https://Stackoverflow.com/questions/100242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10472/" ]
100,247
<p>I'm using C# in .Net 2.0, and I want to read in a PNG image file and check for the first row and first column that has non-transparent pixels. </p> <p>What assembly and/or class should I use?</p>
[ { "answer_id": 100293, "author": "Pavel Chuchuva", "author_id": 14131, "author_profile": "https://Stackoverflow.com/users/14131", "pm_score": 6, "selected": true, "text": "Bitmap bitmap = new Bitmap(@\"C:\\image.png\");\nColor clr = bitmap.GetPixel(0, 0);\n" }, { "answer_id": 320...
2008/09/19
[ "https://Stackoverflow.com/questions/100247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18494/" ]
100,248
<p>AFAIK one of the objectives of Stack Overflow is to make sure anyone can come here and find <b>good</b> answers to her Perl related questions. Certainly beginners would ask what is the <a href="https://stackoverflow.com/questions/70573/best-online-%0Asource-to-learn-perl">best online source to learn Perl</a> but oth...
[ { "answer_id": 105094, "author": "Drew Stephens", "author_id": 17339, "author_profile": "https://Stackoverflow.com/users/17339", "pm_score": 3, "selected": false, "text": "pd pm" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/100248", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11827/" ]
100,280
<p>Has any one done this before? It would seem to me that there should be a webservice but i can't find one. I am writing an application for personal use that would just show basic info from IMDB.</p>
[ { "answer_id": 109478, "author": "Nescio", "author_id": 14484, "author_profile": "https://Stackoverflow.com/users/14484", "pm_score": 3, "selected": false, "text": "private const string UglyMovieRegex = \"(?<=5>|3>)(Cast|Director:|Fun\\\\sStuff|Genre:|Plot:|Runtime:|Tagline:|Writers:)\"\...
2008/09/19
[ "https://Stackoverflow.com/questions/100280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5235/" ]
100,284
<p>I'm using the .NET TWAIN code from <a href="http://www.codeproject.com/KB/dotnet/twaindotnet.aspx?msg=1007385#xx1007385xx" rel="nofollow noreferrer">http://www.codeproject.com/KB/dotnet/twaindotnet.aspx?msg=1007385#xx1007385xx</a> in my application. When I try to scan an image when the scanner is not plugged in, th...
[ { "answer_id": 156690, "author": "Veldmuis", "author_id": 18826, "author_profile": "https://Stackoverflow.com/users/18826", "pm_score": 2, "selected": false, "text": "enum AcquireResult\n{\n OK = 0,\n InitFailed = 1,\n DeviceIDFailed = 2,\n CapabilityFailed = 3,\n UserInte...
2008/09/19
[ "https://Stackoverflow.com/questions/100284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17465/" ]
100,291
<p>Imagine I have an function which goes through one million/billion strings and checks smth in them.</p> <p>f.ex:</p> <pre><code>foreach (String item in ListOfStrings) { result.add(CalculateSmth(item)); } </code></pre> <p>it consumes lot's of time, because CalculateSmth is very time consuming function.</p> <p>...
[ { "answer_id": 100307, "author": "Tobi", "author_id": 5422, "author_profile": "https://Stackoverflow.com/users/5422", "pm_score": 5, "selected": true, "text": "Parallel.Foreach (ListOfStrings, (item) => \n result.add(CalculateSmth(item));\n);\n" }, { "answer_id": 100352, "...
2008/09/19
[ "https://Stackoverflow.com/questions/100291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5369/" ]
100,298
<p>I have a large source repository split across multiple projects. I would like to produce a report about the health of the source code, identifying problem areas that need to be addressed.</p> <p>Specifically, I'd like to call out routines with a high cyclomatic complexity, identify repetition, and perhaps run some ...
[ { "answer_id": 14793812, "author": "Dave Halter", "author_id": 552671, "author_profile": "https://Stackoverflow.com/users/552671", "pm_score": 5, "selected": false, "text": "radon pip pip install radon" }, { "answer_id": 39937878, "author": "Asclepius", "author_id": 83223...
2008/09/19
[ "https://Stackoverflow.com/questions/100298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14648/" ]
100,304
<p>I'm facing a problem on the Win32 API. I have a program that, when it handles <code>WM_PAINT</code> messages, it calls <code>BeginPaint</code> to clip the region and validate the update region, but the <code>BeginPaint</code> function is always generating a <code>WM_NCPAINT</code> message with the same update region...
[ { "answer_id": 100340, "author": "prakash", "author_id": 123, "author_profile": "https://Stackoverflow.com/users/123", "pm_score": 0, "selected": false, "text": "WM_NCPAINT" }, { "answer_id": 100412, "author": "Edwin Jarvis", "author_id": 18623, "author_profile": "htt...
2008/09/19
[ "https://Stackoverflow.com/questions/100304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18623/" ]
100,332
<p>I'm trying to decide on the best way to store event times in a MySQL database. These should be as flexible as possible and be able to represent "single events" (starts at a certain time, does not necessarily need an end time), "all day" and "multi day" events, repeating events, repeating all day events, possibly "3r...
[ { "answer_id": 100453, "author": "boes", "author_id": 17746, "author_profile": "https://Stackoverflow.com/users/17746", "pm_score": 1, "selected": false, "text": "create table repeatevent (\nid int not null auto_increment, \ntype int, // 0: daily, 1:weekly, 2: monthly, ....\nstarttime da...
2008/09/19
[ "https://Stackoverflow.com/questions/100332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/476/" ]
100,333
<p>How can you programmatically measure per-process (or better, per-thread) CPU usage under windows 95, windows 98 and windows ME?</p> <p>If it requires the DDK, where can you obtain that?</p> <p>Please note the <strong>Win9x requirement</strong>. It's easy on NT.</p> <p>EDIT: I tried installing the <a href="http://...
[ { "answer_id": 100453, "author": "boes", "author_id": 17746, "author_profile": "https://Stackoverflow.com/users/17746", "pm_score": 1, "selected": false, "text": "create table repeatevent (\nid int not null auto_increment, \ntype int, // 0: daily, 1:weekly, 2: monthly, ....\nstarttime da...
2008/09/19
[ "https://Stackoverflow.com/questions/100333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15069/" ]
100,365
<p>In cake 1.2 there is a feature that allows the developer to no have to create models, but rather have cake do the detective work at run time and create the model for you. This process happens each time and is neat but in my case very hazardous. I read about this somewhere and now I'm experiencing the bad side of thi...
[ { "answer_id": 100442, "author": "Mladen Mihajlovic", "author_id": 11421, "author_profile": "https://Stackoverflow.com/users/11421", "pm_score": 1, "selected": false, "text": "var $useTable = false;\n" }, { "answer_id": 106985, "author": "SeanDowney", "author_id": 5261, ...
2008/09/19
[ "https://Stackoverflow.com/questions/100365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5261/" ]
100,376
<p>Anyone know how to do picture overlay or appear on top of each other in HTML? The effect will be something like the marker/icon appear on Google Map where the user can specify the coordinate of the second picture appear on the first picture.</p> <p>Thanks.</p>
[ { "answer_id": 100417, "author": "Johannes Hädrich", "author_id": 18246, "author_profile": "https://Stackoverflow.com/users/18246", "pm_score": 6, "selected": true, "text": "<div> <div style=\"position: absolute; z-index:100\">This is in background</div> \n<div style=\"position: absolute...
2008/09/19
[ "https://Stackoverflow.com/questions/100376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14790/" ]
100,411
<p>I have two webapplication, one is a simple authenticationsite which can authenticate the logged in user and <strong>redirects</strong> him then to another site.</p> <p>Therefore I have to pass ther userId (GUID) to the second application. Currently this is done via the URL but i would like to hide this id.</p> <p>...
[ { "answer_id": 144624, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 2, "selected": false, "text": "using System;\nusing System.Web;\nusing System.Web.Services;\nusing System.Web.Services.Protocols;\n\n[WebService(Namespace ...
2008/09/19
[ "https://Stackoverflow.com/questions/100411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17558/" ]
100,415
<p>I'm looking for an open source, cross platform (Windows &amp; Linux at least) command line tool to take some code (C++, but multiple languages would be sweet), and spit out valid a XHTML representation of that code, with syntax highlighting included.</p> <p>Ideally the XHTML should just wrap the code with <code>&lt...
[ { "answer_id": 900463, "author": "Martin Geisler", "author_id": 110204, "author_profile": "https://Stackoverflow.com/users/110204", "pm_score": 4, "selected": true, "text": "<span> from pygments import highlight\nfrom pygments.lexers import PythonLexer\nfrom pygments.formatters import Ht...
2008/09/19
[ "https://Stackoverflow.com/questions/100415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1304/" ]
100,416
<p>In SQL Server 2000/2005,</p> <p>Is it possible to force the default value to be written to already existing rows when adding a new column to a table <strong>without</strong> using NOT NULL on the new column?</p>
[ { "answer_id": 100560, "author": "chrisb", "author_id": 8262, "author_profile": "https://Stackoverflow.com/users/8262", "pm_score": 1, "selected": false, "text": "UPDATE MyTable SET NullCol = N'some_value' WHERE NullCol IS NULL\nALTER TABLE MyTable ALTER COLUMN NullCOl NVARCHAR(20) NOT N...
2008/09/19
[ "https://Stackoverflow.com/questions/100416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7241/" ]
100,420
<p>Visual Studio is such a massively big product that even after years of working with it I sometimes stumble upon a new/better way to do things or things I didn't even know were possible.</p> <p>For instance-</p> <ul> <li><p><kbd>Crtl</kbd> + <kbd>R</kbd>, <kbd>Ctrl</kbd> + <kbd>W</kbd> to show white spaces. Essenti...
[ { "answer_id": 100445, "author": "Mark Glorie", "author_id": 952, "author_profile": "https://Stackoverflow.com/users/952", "pm_score": 6, "selected": false, "text": "CTRL-K, CTRL-D\n" }, { "answer_id": 100457, "author": "Aaron Powell", "author_id": 11388, "author_prof...
2008/09/19
[ "https://Stackoverflow.com/questions/100420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9611/" ]
100,435
<p>I'm using a ASP.NET menu control. I'd like the menu to look like this, where link 1 through 10 are in one sitemap file and link 11 through 20 in another. </p> <pre><code>root --link 1 (...) --link 10 --link 11 (...) --link 20 </code></pre> <p>However, sitemap file MUST have a root which I cannot seem to suppress....
[ { "answer_id": 849136, "author": "Tim Scarborough", "author_id": 432226, "author_profile": "https://Stackoverflow.com/users/432226", "pm_score": 2, "selected": false, "text": "SiteMapDataSource ds = new SiteMapDataSource();\nds.SiteMapProvider = \"providername\";\nds.ShowStartingNode = f...
2008/09/19
[ "https://Stackoverflow.com/questions/100435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6399/" ]
100,444
<p>I'm trying to automate a gdb session using the <code>--command</code> flag. I'm trying to set a breakpoint on a function in a shared library (the Unix equivalent of a DLL) . My cmds.gdb looks like this:</p> <pre><code>set args /home/shlomi/conf/bugs/kde/font-break.txt b IA__FcFontMatch r </code></pre> <p>However, ...
[ { "answer_id": 100501, "author": "Shlomi Fish", "author_id": 7709, "author_profile": "https://Stackoverflow.com/users/7709", "pm_score": 8, "selected": true, "text": "cmds.gdb set breakpoint pending on\nbreak <source file name>:<line number>\n" }, { "answer_id": 1123235, "aut...
2008/09/19
[ "https://Stackoverflow.com/questions/100444", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7709/" ]
100,454
<p>Does anybody know the logic behind making DataSourceSelectArguments sealed?</p> <p>I've implemented a custom DataSource (and related classes) for some custom business objects and custom WebControls. When thinking in filters (like in a grid) I discovered that the DataSourceSelectArguments is sealed. Surely, I'm miss...
[ { "answer_id": 148825, "author": "paudirac", "author_id": 15554, "author_profile": "https://Stackoverflow.com/users/15554", "pm_score": 1, "selected": false, "text": "ListView PerformSelect DataSourceView ExecuteSelect DataSourceSelectArguments ListView DataSourceView" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/100454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15554/" ]
100,480
<p>I am looking for different ways to pause and resume programmatically a particular process via its process ID under Windows XP.</p> <p><a href="http://www.codeproject.com/KB/threads/pausep.aspx" rel="noreferrer">Process suspend/resume tool</a> does it with <code>SuspendThread</code> / <code>ResumeThread</code> but w...
[ { "answer_id": 102214, "author": "bk1e", "author_id": 8090, "author_profile": "https://Stackoverflow.com/users/8090", "pm_score": 3, "selected": false, "text": "logger.exe windbg.exe SuspendThread() ResumeThread()" }, { "answer_id": 14053933, "author": "Hanan N.", "author...
2008/09/19
[ "https://Stackoverflow.com/questions/100480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18648/" ]
100,504
<p>Say I have a table called myTable. What is the SQL command to return all of the field names of this table? If the answer is database specific then I need SQL Server right now but would be interested in seeing the solution for other database systems as well.</p>
[ { "answer_id": 100513, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 7, "selected": true, "text": "desc tablename\n show fields from tablename\n select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS \nwhere TABLE_NAME =...
2008/09/19
[ "https://Stackoverflow.com/questions/100504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1856916/" ]
100,533
<p>Is it possible to do like this:</p> <pre><code>interface IDBBase { DataTable getDataTableSql(DataTable curTable,IDbCommand cmd); ... } class DBBase : IDBBase { public DataTable getDataTableSql(DataTable curTable, SqlCommand cmd) { ... } } </code></pre> <p>I want to use the interface t...
[ { "answer_id": 100562, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 2, "selected": false, "text": "interface IDBClass<T> where T:IDbCommand\n{\n void Test(T cmd);\n}\n\nclass DBClass:IDBClass<SqlCommand>\n{\n public void ...
2008/09/19
[ "https://Stackoverflow.com/questions/100533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
100,543
<p>On a class library project, I set the "Start Action" on the Debug tab of the project properties to "Start external program" (<a href="http://en.wikipedia.org/wiki/NUnit" rel="noreferrer">NUnit</a> in this case). I want to set an environment variable in the environment this program is started in. How do I do that? (I...
[ { "answer_id": 1140232, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "_putenv() main() #if defined DEBUG_MODE / #endif _putenv(\"MYANSWER=42\");\n os.putenv('MYANSWER', '42');\n" }, { "an...
2008/09/19
[ "https://Stackoverflow.com/questions/100543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5422/" ]
100,624
<p>How to wait for multiple child processes in Python on Windows, without active wait (polling)? Something like this <em>almost</em> works for me:</p> <pre><code>proc1 = subprocess.Popen(['python','mytest.py']) proc2 = subprocess.Popen(['python','mytest.py']) proc1.wait() print "1 finished" proc2.wait() print "2 f...
[ { "answer_id": 100886, "author": "tzot", "author_id": 6899, "author_profile": "https://Stackoverflow.com/users/6899", "pm_score": 5, "selected": true, "text": "import Queue, thread, subprocess\n\nresults= Queue.Queue()\ndef process_waiter(popen, description, que):\n try: popen.wait()\...
2008/09/19
[ "https://Stackoverflow.com/questions/100624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12166/" ]
100,631
<p>After our Ruby on Rails application has run for a while, it starts throwing 500s with "MySQL server has gone away". Often this happens overnight. It's started doing this recently, with no obvious change in our server configuration.</p> <pre><code> Mysql::Error: MySQL server has gone away: SELECT * FROM `widgets` </...
[ { "answer_id": 100703, "author": "Z99", "author_id": 18307, "author_profile": "https://Stackoverflow.com/users/18307", "pm_score": 1, "selected": false, "text": "mysql> show status;\n" }, { "answer_id": 101250, "author": "Laurie Young", "author_id": 7473, "author_prof...
2008/09/19
[ "https://Stackoverflow.com/questions/100631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18666/" ]
100,633
<p>Why is it bad practice to declare variables on one line?</p> <p>e.g.</p> <pre><code>private String var1, var2, var3 </code></pre> <p>instead of: </p> <pre><code>private String var1; private String var2; private String var3; </code></pre>
[ { "answer_id": 100662, "author": "David Pierre", "author_id": 18296, "author_profile": "https://Stackoverflow.com/users/18296", "pm_score": 4, "selected": false, "text": "int * i, j;\n" }, { "answer_id": 100664, "author": "Vinko Vrsalovic", "author_id": 5190, "author_...
2008/09/19
[ "https://Stackoverflow.com/questions/100633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15352/" ]
100,645
<p>Are there any tools available for calculating Cyclomatic Complexity in Javascript? </p> <p>I've found it a very helpful metric in the past while working on server side code, and would like to be able to use it for the client side Javascript I write.</p>
[ { "answer_id": 13453464, "author": "Phil Booth", "author_id": 47348, "author_profile": "https://Stackoverflow.com/users/47348", "pm_score": 5, "selected": false, "text": "npm i -g complexity-report\n" }, { "answer_id": 15815677, "author": "SavoryBytes", "author_id": 13194...
2008/09/19
[ "https://Stackoverflow.com/questions/100645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2932/" ]
100,661
<p>Are there any tools available for calculating the <strong>average number of lines of code per method</strong>?</p> <p>I want to know the average size of each method, not just the total number of lines in the project. The per method count will allow me to measure how simple each method is.</p> <p>This will be calcu...
[ { "answer_id": 100866, "author": "Marius", "author_id": 1585, "author_profile": "https://Stackoverflow.com/users/1585", "pm_score": 1, "selected": false, "text": "function calculateMethodSize(obj){\n var fcount = 0;\n var fsize = 0;\n for(i in obj){\n if(obj[i] instanceof Function)...
2008/09/19
[ "https://Stackoverflow.com/questions/100661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2932/" ]
100,678
<pre><code>LRESULT result = ::SendMessage(hWnd, s_MaxGetTaskInterface, (WPARAM)&amp;pUnkReturn, 0); </code></pre> <p>The value of result after the call is 0</p> <p>I expect it to return with a valid value of pUnkReturn , but it returns with a NULL value .</p> <p>Necessary Information before this call :</p> <pre><c...
[ { "answer_id": 100692, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 0, "selected": false, "text": "NI:Max:GetTaskInterface hWnd NI:Max:GetTaskInterface" }, { "answer_id": 100979, "author": "Alan", "author_id...
2008/09/19
[ "https://Stackoverflow.com/questions/100678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
100,689
<p>I have a problem that confuses my users, being that although an item is highlighted (by the hover style) when the user mouses over it, they have to mouse over the actual item text, sometimes quite small compared to the item. Is there a way to make the whole item clickable?</p>
[ { "answer_id": 100706, "author": "David Heggie", "author_id": 4309, "author_profile": "https://Stackoverflow.com/users/4309", "pm_score": 3, "selected": true, "text": "a {\n display: block;\n width: 100%;\n}\n" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/100689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8741/" ]
100,705
<p>I recently heard of WSDL.Exe, but I am not sure where to find this program. Does anyone know where I can find or download it?</p>
[ { "answer_id": 100787, "author": "David Bick", "author_id": 4914, "author_profile": "https://Stackoverflow.com/users/4914", "pm_score": 5, "selected": true, "text": "C:\\program files\\Microsoft Visual Studio 8\\SDK\\v2.0\\Bin" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/100705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
100,707
<p>I'm wondering, how expensive it is to have many threads in waiting state in java 1.6 x64.</p> <p>To be more specific, I'm writing application which runs across many computers and sends/receives data from one to another. I feel more comfortable to have separate thread for each connected machine and task, like 1) sen...
[ { "answer_id": 100994, "author": "Bill Michell", "author_id": 7938, "author_profile": "https://Stackoverflow.com/users/7938", "pm_score": 1, "selected": false, "text": "ThreadPoolExecutor" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/100707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5507/" ]
100,721
<p>I am using <code>DirectoryInfo.GetDirectories()</code> recursively to find the all the sub-directories under a given path. However, I want to exclude the System folders and there is no clear way for that. In FindFirstFile/FindNextFile things were clearer with the attributes.</p>
[ { "answer_id": 100822, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 4, "selected": true, "text": "static IEnumerable<string> GetNonSystemDirs(string path)\n{\n var dirs = from d in Directory.GetDirectories(path)\n ...
2008/09/19
[ "https://Stackoverflow.com/questions/100721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
100,732
<p>I've seen several examples of code like this:</p> <pre><code>if not someobj: #do something </code></pre> <p>But I'm wondering why not doing:</p> <pre><code>if someobj == None: #do something </code></pre> <p>Is there any difference? Does one have an advantage over the other?</p>
[ { "answer_id": 100762, "author": "Sylvain Defresne", "author_id": 5353, "author_profile": "https://Stackoverflow.com/users/5353", "pm_score": 9, "selected": true, "text": "bool __nonzero__ int float bool int False __len__ list dict set tuple False True None False None __eq__ bool if __cm...
2008/09/19
[ "https://Stackoverflow.com/questions/100732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10708/" ]
100,774
<p>The following JavaScript supposes to read the popular tags from an XML file and applies the XSL Stylesheet and output to the browser as HTML.</p> <pre><code>function ShowPopularTags() { xml = XMLDocLoad("http://localhost/xml/tags/popular.xml?s=94987898"); xsl = XMLDocLoad("http://localhost/xml/xsl/popular-tag...
[ { "answer_id": 101048, "author": "Twan", "author_id": 6702, "author_profile": "https://Stackoverflow.com/users/6702", "pm_score": 1, "selected": false, "text": "<BODY onLoad=\"ShowPopularTags();\">\n" }, { "answer_id": 110853, "author": "Twan", "author_id": 6702, "aut...
2008/09/19
[ "https://Stackoverflow.com/questions/100774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17074/" ]
100,808
<p>I want to receive the following <code>HTTP</code> request in <code>PHP:</code></p> <pre><code>Content-type: multipart/form-data;boundary=main_boundary --main_boundary Content-type: text/xml &lt;?xml version='1.0'?&gt; &lt;content&gt; Some content goes here &lt;/content&gt; --main_boundary Content-type: multipart/...
[ { "answer_id": 100874, "author": "pilsetnieks", "author_id": 6615, "author_profile": "https://Stackoverflow.com/users/6615", "pm_score": 3, "selected": true, "text": "$HTTP_GET_VARS $HTTP_POST_VARS $_GET $_POST $_FILES $_POST always_populate_raw_post_data $HTTP_RAW_POST_DATA" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/100808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7891/" ]
100,812
<p>Not for the first time, I've accidentally done "svn switch" from somewhere below the root of my project. This switches that subdirectory only, but how do I undo this?</p> <p>If I try switching the subdirectory back to the original branch I get:</p> <pre><code>"svn: Directory 'subdir\_svn' containing working copy a...
[ { "answer_id": 100870, "author": "Dan", "author_id": 17121, "author_profile": "https://Stackoverflow.com/users/17121", "pm_score": -1, "selected": false, "text": "svn revert <dir>\n" }, { "answer_id": 101176, "author": "Palmin", "author_id": 5949, "author_profile": "h...
2008/09/19
[ "https://Stackoverflow.com/questions/100812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17641/" ]