qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
38,238
<p>I'm teaching myself Python and my most recent lesson was that <a href="http://dirtsimple.org/2004/12/python-is-not-java.html" rel="noreferrer">Python is not Java</a>, and so I've just spent a while turning all my Class methods into functions.</p> <p>I now realise that I don't need to use Class methods for what I wo...
[ { "answer_id": 38276, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 9, "selected": true, "text": "MyClass classmethod" }, { "answer_id": 38303, "author": "Wayne Werner", "author_id": 4080, "author_p...
2008/09/01
[ "https://Stackoverflow.com/questions/38238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3171/" ]
38,288
<p>Specifically, what commands do I run from the terminal?</p>
[ { "answer_id": 38289, "author": "quackingduck", "author_id": 3624, "author_profile": "https://Stackoverflow.com/users/3624", "pm_score": 8, "selected": true, "text": "sudo useradd myuser\n sudo useradd -m myuser\n sudo passwd myuser\n sudo usermod -s /bin/bash myuser\n" }, { "ans...
2008/09/01
[ "https://Stackoverflow.com/questions/38288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3624/" ]
38,302
<p>I'm currently working on a ray-tracer in C# as a hobby project. I'm trying to achieve a decent rendering speed by implementing some tricks from a c++ implementation and have run into a spot of trouble.</p> <p>The objects in the scenes which the ray-tracer renders are stored in a KdTree structure and the tree's node...
[ { "answer_id": 38584, "author": "Morten Christiansen", "author_id": 4055, "author_profile": "https://Stackoverflow.com/users/4055", "pm_score": 0, "selected": false, "text": "Marshal.AllocHGlobal" } ]
2008/09/01
[ "https://Stackoverflow.com/questions/38302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4055/" ]
38,345
<p>I recently "needed" a zip function in Perl 5 (while I was thinking about <a href="https://stackoverflow.com/questions/11/how-do-i-calculate-relative-time">How do I calculate relative time?</a>), i.e. a function that takes two lists and "zips" them together to one list, interleaving the elements.</p> <p>(Pseudo)exam...
[ { "answer_id": 38365, "author": "Jason Navarrete", "author_id": 3920, "author_profile": "https://Stackoverflow.com/users/3920", "pm_score": 5, "selected": false, "text": "use List::MoreUtils qw(zip);\n\nmy @numbers = (1, 2, 3);\nmy @fruit = ('apple', 'orange', 'grape');\n\nmy @zipped = z...
2008/09/01
[ "https://Stackoverflow.com/questions/38345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2905/" ]
38,352
<p>I need to store contact information for users. I want to present this data on the page as an <a href="http://en.wikipedia.org/wiki/Hcard" rel="nofollow noreferrer">hCard</a> and downloadable as a <a href="http://en.wikipedia.org/wiki/VCard" rel="nofollow noreferrer">vCard</a>. I'd also like to be able to search the ...
[ { "answer_id": 61103, "author": "Alan", "author_id": 5878, "author_profile": "https://Stackoverflow.com/users/5878", "pm_score": 4, "selected": true, "text": "People (pid, prefix, firstName, lastName, suffix, DOB, ... primaryAddressTag )\n\nAddressBook (pid, tag, address1, address2, city...
2008/09/01
[ "https://Stackoverflow.com/questions/38352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/521/" ]
38,357
<p>If I get an error code result from a Cocoa function, is there any easy way to figure out what it means (other than by grepping through all the .h files in the framework bundles)?</p>
[ { "answer_id": 38497, "author": "Chris Hanson", "author_id": 714, "author_profile": "https://Stackoverflow.com/users/714", "pm_score": 6, "selected": true, "text": "<Framework/FrameworkErrors.h> NSError code <Foundation/FoundationErrors.h> <AppKit/AppKitErrors.h> <CoreData/CoreDataErrors...
2008/09/01
[ "https://Stackoverflow.com/questions/38357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175/" ]
38,362
<p>I have 3 Linux machines, and want some way to keep the dotfiles in their home directories in sync. Some files, like .vimrc, are the same across all 3 machines, and some are unique to each machine.</p> <p>I've used SVN before, but all the buzz about DVCSs makes me think I should try one - is there a particular one t...
[ { "answer_id": 731430, "author": "hillu", "author_id": 72344, "author_profile": "https://Stackoverflow.com/users/72344", "pm_score": 0, "selected": false, "text": "git rebase .gitignore" } ]
2008/09/01
[ "https://Stackoverflow.com/questions/38362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2461/" ]
38,370
<p>I've to admin a small website for my alumni group which is hosted by my ISV. The url is something like www.myIsv.com/myWebSite/ which is quite ugly and very forgetable. The main admin of the webserver has registered a domain name www.mysmallwebsite.com and put a index.html with this content:</p> <pre><code>&lt;html...
[ { "answer_id": 38382, "author": "Alexandru Nedelcu", "author_id": 3280, "author_profile": "https://Stackoverflow.com/users/3280", "pm_score": 0, "selected": false, "text": "www.myIsv.com/myWebSite/?PHPSESSID=<?=session_id()?>\n" }, { "answer_id": 38417, "author": "Orion Edwar...
2008/09/01
[ "https://Stackoverflow.com/questions/38370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1578/" ]
38,408
<p>I'm using Flash to play an .flv movieclip on my site, but I want to have the .swf send trigger an event in my javascript when it start loading, starts playing and ends playing.</p> <p>What is the best way to do that in Flash CS3 using Actionscript 3.0 ?</p>
[ { "answer_id": 38515, "author": "David Crow", "author_id": 2783, "author_profile": "https://Stackoverflow.com/users/2783", "pm_score": 2, "selected": false, "text": "<script language=\"JavaScript\">\n function startsPlaying()\n {\n // do something when the FLV starts playing...
2008/09/01
[ "https://Stackoverflow.com/questions/38408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4112/" ]
38,409
<p>I would like to convert the following string into an array/nested array: </p> <pre><code>str = "[[this, is],[a, nested],[array]]" newarray = # this is what I need help with! newarray.inspect # =&gt; [['this','is'],['a','nested'],['array']] </code></pre>
[ { "answer_id": 38477, "author": "Ben Childs", "author_id": 2925, "author_profile": "https://Stackoverflow.com/users/2925", "pm_score": 0, "selected": false, "text": "base case (input doesn't begin with '[') return the input\nrecursive case:\n split the input on ',' (you will need to f...
2008/09/01
[ "https://Stackoverflow.com/questions/38409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4082/" ]
38,431
<p>Using MVC out of the box I found the generated URLs can be misleading and I wanted to know if this can be fixed or if my approach/understanding is wrong.</p> <p>Suppose I have a CreateEgg page, which has a form on it, and once the form is filled in and submitted the user is taken to a ListEggs page with the new egg...
[ { "answer_id": 43456, "author": "Dan", "author_id": 230, "author_profile": "https://Stackoverflow.com/users/230", "pm_score": 0, "selected": false, "text": "[AcceptVerbs(\"GET\")]\npublic object Create() {}\n[AcceptVerbs(\"POST\")]\npublic object Create(string productName, Decimal unitPr...
2008/09/01
[ "https://Stackoverflow.com/questions/38431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230/" ]
38,435
<p>Given an Oracle table created using the following:</p> <pre><code>CREATE TABLE Log(WhenAdded TIMESTAMP(6) WITH TIME ZONE); </code></pre> <p>Using the Python ODBC module from its <a href="http://www.python.org/download/windows/" rel="nofollow noreferrer">Win32 extensions</a> (from the win32all package), I tried the...
[ { "answer_id": 38442, "author": "Jason Etheridge", "author_id": 2193, "author_profile": "https://Stackoverflow.com/users/2193", "pm_score": 1, "selected": false, "text": "cursor.execute(\"SELECT TO_CHAR(WhenAdded, 'YYYY-MM-DD HH:MI:SSAM') FROM Log\")\n" }, { "answer_id": 38718, ...
2008/09/01
[ "https://Stackoverflow.com/questions/38435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2193/" ]
38,447
<p>Do any asynchronous connectors exist for Mysql that can be used within a C or C++ application? I'm looking for something that can be plugged into a <a href="http://en.wikipedia.org/wiki/Reactor_pattern" rel="noreferrer" title="reactor pattern">reactor pattern</a> written in <a href="http://www.boost.org/doc/libs/rel...
[ { "answer_id": 149326, "author": "Vlagged", "author_id": 6727, "author_profile": "https://Stackoverflow.com/users/6727", "pm_score": 2, "selected": false, "text": "libmysqlclient / mysqlclient.dll" } ]
2008/09/01
[ "https://Stackoverflow.com/questions/38447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4059/" ]
38,502
<p>Say you want a simple maze on an N by M grid, with one path through, and a good number of dead ends, but that looks "right" (i.e. like someone made it by hand without too many little tiny dead ends and all that). Is there a known way to do this?</p>
[ { "answer_id": 61666821, "author": "Sihat Afnan", "author_id": 11837247, "author_profile": "https://Stackoverflow.com/users/11837247", "pm_score": 2, "selected": false, "text": "Cell current = cells[0][0] , next;\n current.visited=true;\n do{\n next = getNeighbour(current);\...
2008/09/01
[ "https://Stackoverflow.com/questions/38502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4123/" ]
38,508
<p>I have a function where I need to do something to a string. I need the function to return a boolean indicating whether or not the operation succeeded, and I also need to return the modified string. </p> <p>In C#, I would use an out parameter for the string, but there is no equivalent in Python. I'm still very ne...
[ { "answer_id": 38514, "author": "rmmh", "author_id": 3694, "author_profile": "https://Stackoverflow.com/users/3694", "pm_score": 4, "selected": false, "text": "def f(x):\n # do stuff\n return (True, modified_string)\n\nsuccess, modified_string = f(something)\n" }, { "answer...
2008/09/01
[ "https://Stackoverflow.com/questions/38508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3880/" ]
38,549
<p>Also, how do <code>LEFT OUTER JOIN</code>, <code>RIGHT OUTER JOIN</code>, and <code>FULL OUTER JOIN</code> fit in?</p>
[ { "answer_id": 38565, "author": "Brian Boatright", "author_id": 3747, "author_profile": "https://Stackoverflow.com/users/3747", "pm_score": 7, "selected": false, "text": "SELECT Orders.OrderID, Orders.CustomerName\n FROM Orders \n INNER JOIN OrderDetails\n ON Orders.OrderID = OrderDe...
2008/09/01
[ "https://Stackoverflow.com/questions/38549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3836/" ]
38,561
<p>The <code>printf</code> function takes an argument type, such as <code>%d</code> or <code>%i</code> for a <code>signed int</code>. However, I don't see anything for a <code>long</code> value.</p>
[ { "answer_id": 38566, "author": "Rob Walker", "author_id": 3631, "author_profile": "https://Stackoverflow.com/users/3631", "pm_score": 4, "selected": false, "text": "%ld printf" }, { "answer_id": 38570, "author": "postfuturist", "author_id": 1892, "author_profile": "h...
2008/09/01
[ "https://Stackoverflow.com/questions/38561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
38,571
<p>I find myself doing this sort of thing all the time. I've been considering writing a macro/function to make this sort of thing easier, but it occurs to me that I'm probably reinventing the wheel.</p> <p>Is there an existing function that will let me accomplish this same sort of thing more succinctly?</p> <pre><co...
[ { "answer_id": 38594, "author": "Chris Hanson", "author_id": 714, "author_profile": "https://Stackoverflow.com/users/714", "pm_score": -1, "selected": false, "text": "(defun remove-low-words (word-list)\n (if (good-enough-score-p (car word-list))\n (list word (remove-low-words (cdr...
2008/09/01
[ "https://Stackoverflow.com/questions/38571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56456/" ]
38,592
<p>I'd like to be able to write a ruby program that can restart without dropping it's socket connections.</p>
[ { "answer_id": 38599, "author": "ryantm", "author_id": 823, "author_profile": "https://Stackoverflow.com/users/823", "pm_score": 2, "selected": true, "text": "#!/usr/bin/ruby\n#simple_connector.rb\nrequire 'socket'\n\nputs \"Started.\"\n\nif ARGV[0] == \"restart\"\n sock = IO.open(ARGV[...
2008/09/01
[ "https://Stackoverflow.com/questions/38592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/823/" ]
38,596
<p>What is the best way to keep a PHP script running as a daemon, and what's the best way to check if needs restarting.</p> <p>I have some scripts that need to run 24/7 and for the most part I can run them using <a href="http://en.wikipedia.org/wiki/Nohup" rel="noreferrer">nohup</a>. But if they go down, what's the b...
[ { "answer_id": 39609, "author": "Gary Richardson", "author_id": 2506, "author_profile": "https://Stackoverflow.com/users/2506", "pm_score": 2, "selected": false, "text": "* * * * * USER ps auxww | grep SCRIPTNAME > /dev/null || SCRIPTNAME\n /etc/cron.d/restart_php_daemon * */2 */5 cronta...
2008/09/01
[ "https://Stackoverflow.com/questions/38596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4133/" ]
38,598
<p>How are people unit testing their business applications? I've seen a lot of examples of unit testing with "simple to test" examples. Ex. a calculator. How are people unit testing data-heavy applications? How are you putting together your sample data? In many cases, data for one test may not work at all for another t...
[ { "answer_id": 38682, "author": "Jay Stramel", "author_id": 3547, "author_profile": "https://Stackoverflow.com/users/3547", "pm_score": 3, "selected": false, "text": "findCustomerByName()" } ]
2008/09/01
[ "https://Stackoverflow.com/questions/38598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3656/" ]
38,601
<p>How can I use the nifty JavaScript date and time widgets that the default admin uses with my custom view?</p> <p>I have looked through <a href="https://docs.djangoproject.com/en/dev/topics/forms/" rel="noreferrer">the Django forms documentation</a>, and it briefly mentions django.contrib.admin.widgets, but I don't ...
[ { "answer_id": 38916, "author": "Carl Meyer", "author_id": 3207, "author_profile": "https://Stackoverflow.com/users/3207", "pm_score": 8, "selected": true, "text": "ModelForm AdminDateWidget AdminTimeWidget AdminSplitDateTime from django import forms\n from my_app.models import Product\...
2008/09/01
[ "https://Stackoverflow.com/questions/38601", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2592/" ]
38,602
<p>I am attempting to set an asp.net textbox to a SQL 2005 money data type field, the initial result displayed to the user is 40.0000 instead of 40.00. In my asp.net textbox control I would like to only display the first 2 numbers after the decimal point e.g. 40.00</p> <p>What would be the best way to do this? My code...
[ { "answer_id": 38611, "author": "YonahW", "author_id": 3821, "author_profile": "https://Stackoverflow.com/users/3821", "pm_score": 3, "selected": true, "text": "this.txtPayment.Text = string.Format(\"{0:c}\", dr[Payment\"].ToString());\n" }, { "answer_id": 38613, "author": "J...
2008/09/01
[ "https://Stackoverflow.com/questions/38602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4096/" ]
38,612
<p>I have a asp.net 2.0 web site with numerous asp:DropDownList controls. The DropDownList control contains the standard info city, state, county etc... info. In addition to the standard codes the site also has custom codes that the users can configure themselves. For example a animal dropdown may contain the values Do...
[ { "answer_id": 38655, "author": "Josh Hinman", "author_id": 2527, "author_profile": "https://Stackoverflow.com/users/2527", "pm_score": 3, "selected": false, "text": "protected void ddSpecialty_PreRender(object sender, EventArgs e)\n{\n if (!ddSpecialty.Items.Contains(new ListItem(reg...
2008/09/01
[ "https://Stackoverflow.com/questions/38612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4096/" ]
38,635
<p>What tools are there available for static analysis against C# code? I know about FxCop and StyleCop. Are there others? I've run across NStatic before but it's been in development for what seems like forever - it's looking pretty slick from what little I've seen of it, so it would be nice if it would ever see the lig...
[ { "answer_id": 100350, "author": "Julien Hoarau", "author_id": 12248, "author_profile": "https://Stackoverflow.com/users/12248", "pm_score": 9, "selected": true, "text": "Program Files\\Microsoft SDKs\\Windows\\ [v7.1] \\Bin\\FXCop\\FxCopSetup.exe" } ]
2008/09/01
[ "https://Stackoverflow.com/questions/38635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3656/" ]
38,645
<p>I want to combine two structures with differing fields names.</p> <p>For example, starting with:</p> <pre><code>A.field1 = 1; A.field2 = 'a'; B.field3 = 2; B.field4 = 'b'; </code></pre> <p>I would like to have:</p> <pre><code>C.field1 = 1; C.field2 = 'a'; C.field3 = 2; C.field4 = 'b'; </code></pre> <p>Is there...
[ { "answer_id": 38659, "author": "pbh101", "author_id": 1266, "author_profile": "https://Stackoverflow.com/users/1266", "pm_score": 2, "selected": false, "text": "A.field1 = 1;\nA.field2 = 'a';\nA.field3 = struct B;\n C.A = struct A;\nC.B = struct B;\n C.A.field1;\nC.A.field2;\nC.B.field3...
2008/09/02
[ "https://Stackoverflow.com/questions/38645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4135/" ]
38,647
<p><strong>When using the Entity Framework, does ESQL perform better than Linq to Entities?</strong> </p> <p>I'd prefer to use Linq to Entities (mainly because of the strong-type checking), but some of my other team members are citing performance as a reason to use ESQL. I would like to get a full idea of the pro's/co...
[ { "answer_id": 356511, "author": "Royd Brayshay", "author_id": 35043, "author_profile": "https://Stackoverflow.com/users/35043", "pm_score": 5, "selected": true, "text": "ObjectQuery<DbDataRecord> query = DynamicQuery(context,\n \"Products\",\n \"it.ProductName = 'Chai'\",\...
2008/09/02
[ "https://Stackoverflow.com/questions/38647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/708/" ]
38,651
<p>Is there any way to have a binary compiled from an ActionScript 3 project print stuff to <em>stdout</em> when executed?</p> <p>From what I've gathered, people have been going around this limitation by writing hacks that rely on local socket connections and AIR apps that write to files in the local filesystem, but t...
[ { "answer_id": 324348, "author": "hasseg", "author_id": 4111, "author_profile": "https://Stackoverflow.com/users/4111", "pm_score": 1, "selected": false, "text": "test.as import avmplus.System;\nimport redtamarin.version;\n\ntrace( \"hello world\" );\ntrace( \"avmplus v\" + System.getAvm...
2008/09/02
[ "https://Stackoverflow.com/questions/38651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4111/" ]
38,661
<p>Is there any way in IIS to map requests to a particular URL with no extension to a given application.</p> <p>For example, in trying to port something from a Java servlet, you might have a URL like this...</p> <p><a href="http://[server]/MyApp/HomePage?some=parameter" rel="nofollow noreferrer">http://[server]/MyApp...
[ { "answer_id": 324348, "author": "hasseg", "author_id": 4111, "author_profile": "https://Stackoverflow.com/users/4111", "pm_score": 1, "selected": false, "text": "test.as import avmplus.System;\nimport redtamarin.version;\n\ntrace( \"hello world\" );\ntrace( \"avmplus v\" + System.getAvm...
2008/09/02
[ "https://Stackoverflow.com/questions/38661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/797/" ]
38,669
<p>I'm not sure I'm using all the correct terminology here so be forgiving.</p> <p>I just put up a site with a contact form that sends an email using the PHP mail() function. Simple enough. However the live site doesn't actually send the email, the test site does. So it's not my code. </p> <p>It's a shared host and w...
[ { "answer_id": 432807, "author": "user19471", "author_id": 19471, "author_profile": "https://Stackoverflow.com/users/19471", "pm_score": 1, "selected": false, "text": "mail() mail()" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/38669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/910/" ]
38,670
<p>Ok, so, my visual studio is broken. I say this NOT prematurely, as it was my first response to see where I had messed up in my code. When I add controls to the page I can't reference all of them in the code behind. Some of them I can, it seems that the first few I put on a page work, then it just stops. </p> <p>I f...
[ { "answer_id": 38688, "author": "Sean Lynch", "author_id": 4043, "author_profile": "https://Stackoverflow.com/users/4043", "pm_score": 4, "selected": false, "text": "<asp:Repeater ID=\"Repeater1\" runat=\"server\">\n <ItemTemplate>\n <asp:LinkButton ID=\"LinkButton1\" runat=\"s...
2008/09/02
[ "https://Stackoverflow.com/questions/38670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4140/" ]
38,680
<p>Feel free to edit the title if you know how to formulate the question better. (Tagging is a problem as well.) The problem may be too difficult in this general form, so let us consider a concrete example.</p> <p>You get a screenful of stackoverflow questions by requesting <code>/questions ?sort=newest</code> page. N...
[ { "answer_id": 38687, "author": "dmckee --- ex-moderator kitten", "author_id": 2509, "author_profile": "https://Stackoverflow.com/users/2509", "pm_score": 0, "selected": false, "text": "n n+displaynum" }, { "answer_id": 153722, "author": "AJ.", "author_id": 7211, "aut...
2008/09/02
[ "https://Stackoverflow.com/questions/38680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2515/" ]
38,691
<p>Hey so what I want to do is snag the content for the first paragraph. The string <code>$blog_post</code> contains a lot of paragraphs in the following format:</p> <pre><code>&lt;p&gt;Paragraph 1&lt;/p&gt;&lt;p&gt;Paragraph 2&lt;/p&gt;&lt;p&gt;Paragraph 3&lt;/p&gt; </code></pre> <p>The problem I'm running into is t...
[ { "answer_id": 38696, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 1, "selected": false, "text": " <p>\n </p>\n $paragraph_start = strpos($blog_post, '<p>');\n $paragraph_end = strpos($blog_post, '</p>', $paragraph_start...
2008/09/02
[ "https://Stackoverflow.com/questions/38691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428190/" ]
38,713
<p>I'm trying to pick up ruby by porting a medium-sized (non-OO) perl program. One of my personal idioms is to set options like this:</p> <pre><code>use Getopt::Std; our $opt_v; # be verbose getopts('v'); # and later ... $opt_v &amp;&amp; print "something interesting\n"; </code></pre> <p>In perl, I kind of grit my t...
[ { "answer_id": 38761, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 2, "selected": false, "text": "script/console" }, { "answer_id": 41033, "author": "Nathan Fritz", "author_id": 4142, "author_profile...
2008/09/02
[ "https://Stackoverflow.com/questions/38713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3979/" ]
38,729
<p>I decided to make a system for a client using <a href="https://web.archive.org/web/20080517021542/http://www.castleproject.org/activerecord/index.html" rel="nofollow noreferrer">Castle ActiveRecord</a>, everything went well until I found that the transactions do not work, for instance;</p> <pre><code> ...
[ { "answer_id": 38740, "author": "Ben Scheirman", "author_id": 3381, "author_profile": "https://Stackoverflow.com/users/3381", "pm_score": 3, "selected": false, "text": "using(new SessionScope())\n{\n a.Save();\n b.Save();\n c.Save();\n}\n" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/38729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130097/" ]
38,746
<p>Over at <a href="https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion">Can you modify text files when committing to subversion?</a> <a href="https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666">Grant</a> suggested that I...
[ { "answer_id": 39185, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 2, "selected": false, "text": "bash x=`tail -n 1 your_textfile`\nif [ \"$x\" == \"\" ]; then echo \"empty line\"; fi\n \\n \\n\\n vim \\n" }, { ...
2008/09/02
[ "https://Stackoverflow.com/questions/38746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
38,756
<p>I'm looking for a way of getting a <strong>concurrent collection</strong> in <strong>C#</strong> or at least a collection which supports a <strong>concurrent enumerator</strong>. Right now I'm getting an <code>InvalidOperationException</code> when the collection over which I'm iterating changes. </p> <p>I could j...
[ { "answer_id": 38765, "author": "Damian", "author_id": 3390, "author_profile": "https://Stackoverflow.com/users/3390", "pm_score": 4, "selected": true, "text": " List<string> theList = (List<String> )callingForm.Invoke(callingForm.delegateGetKillStrings);\n lock(theList.SyncRoot) {\...
2008/09/02
[ "https://Stackoverflow.com/questions/38756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/361/" ]
38,769
<p>I need to extract data from a .mpp file on the network and combine it with other data from several different databases. The application can be written in Perl, VB6, VB.net or C# but must be easily scheduled from a Windows based server.</p> <p>What would you recommend to extract the MS Project data with no user inte...
[ { "answer_id": 277232, "author": "Michael ", "author_id": 33427, "author_profile": "https://Stackoverflow.com/users/33427", "pm_score": 1, "selected": false, "text": "oConn.Open \"Provider=Microsoft.Project.OLEDB.9.0;\" & _\n \"Project Name=c:\\somepath\\myProject.mpp\"\n" } ...
2008/09/02
[ "https://Stackoverflow.com/questions/38769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4134/" ]
38,779
<p>I have a wcf application hosted in a windows service running a local windows account. Do I need to set an SPN for this account? If so, what's the protocol the SPN needs to be set under? I know how to do this for services over HTTP, but have never done it for net.tcp.</p>
[ { "answer_id": 71039, "author": "softveda", "author_id": 11711, "author_profile": "https://Stackoverflow.com/users/11711", "pm_score": 3, "selected": false, "text": "<identity>\n <serviceprincipalname value=\"fooservice/servermachinename\" />\n</identity>\n" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/38779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/781/" ]
38,784
<p>I use <strong>Delphi</strong> for many years, and although I have now moved on to Visual Studio I still fondly remember numbered bookmarks (<kbd>CTRL</kbd>+<kbd>K</kbd>+<kbd>1</kbd> to set bookmark 1, <kbd>CTRL</kbd>+<kbd>Q</kbd>+<kbd>1</kbd> to goto bookmark 1).</p> <p>Is there a <strong>Visual Studio</strong> equ...
[ { "answer_id": 62277725, "author": "AlainD", "author_id": 2377399, "author_profile": "https://Stackoverflow.com/users/2377399", "pm_score": 0, "selected": false, "text": "Delphi" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/38784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4149/" ]
38,791
<p>Which Database table Schema is more efficient and why?</p> <pre><code>"Users (UserID, UserName, CompamyId)" "Companies (CompamyId, CompanyName)" </code></pre> <p>OR</p> <pre><code>"Users (UserID, UserName)" "Companies (CompamyId, CompanyName)" "UserCompanies (UserID, CompamyId)" </code></pre> <p>Given the fact t...
[ { "answer_id": 38796, "author": "Kevin Lamb", "author_id": 3149, "author_profile": "https://Stackoverflow.com/users/3149", "pm_score": 1, "selected": false, "text": "SELECT userid, username, companyid, companyname\nFROM companies c, users u\nWHERE userid = companyid\n SELECT userid, user...
2008/09/02
[ "https://Stackoverflow.com/questions/38791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191/" ]
38,801
<p>What are the ways that you use to model and retrieve hierarchical info in a database? </p>
[ { "answer_id": 38804, "author": "Josh", "author_id": 3166, "author_profile": "https://Stackoverflow.com/users/3166", "pm_score": 4, "selected": false, "text": "create table person (\nperson_id integer autoincrement primary key,\nname varchar(255) not null,\ndob date,\nmother ...
2008/09/02
[ "https://Stackoverflow.com/questions/38801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2027/" ]
38,820
<p>Which class design is better and why?</p> <pre><code>public class User { public String UserName; public String Password; public String FirstName; public String LastName; } public class Employee : User { public String EmployeeId; public String EmployeeCode; public String DepartmentId; } ...
[ { "answer_id": 38905, "author": "liammclennan", "author_id": 2785, "author_profile": "https://Stackoverflow.com/users/2785", "pm_score": 4, "selected": false, "text": "myEmployee.UserInfo.UserName\n myEmployee.UserName\n" }, { "answer_id": 13124792, "author": "supercat", ...
2008/09/02
[ "https://Stackoverflow.com/questions/38820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191/" ]
38,842
<p>I need to do a simple mail merge in OpenOffice using C++, VBScript, VB.Net or C# via OLE or native API. Are there any good examples available?</p>
[ { "answer_id": 42760, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 4, "selected": true, "text": " Dim xContext As XComponentContext\n\n xContext = Bootstrap.bootstrap()\n\n Dim xFactory As XMul...
2008/09/02
[ "https://Stackoverflow.com/questions/38842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3146/" ]
38,846
<p>What are the fundamentals to accomplish data encryption with exactly two keys (which could be password-based), but needing only one (either one) of the two keys to decrypt the data?</p> <p>For example, data is encrypted with a user's password and his company's password, and then he or his company can decrypt the da...
[ { "answer_id": 38863, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "https://Stackoverflow.com/users/3153", "pm_score": 0, "selected": false, "text": "D = data to encrypt\nh1 = hash(userpassword)\nh2 = hash(companyPassword)\nk = h1 concat h2\n\nE = function to encrypt\...
2008/09/02
[ "https://Stackoverflow.com/questions/38846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
38,864
<p>Consider the following setup: A windows PC with a LAN interface and a WiFi interface (the standard for any new laptop). Each of the interfaces might be connected or disconnected from a network. I need a way to determine which one of the adapters is the one connected to the internet - specifically, in case they are b...
[ { "answer_id": 38872, "author": "Till", "author_id": 2859, "author_profile": "https://Stackoverflow.com/users/2859", "pm_score": 0, "selected": false, "text": "ipconfig /all" }, { "answer_id": 48460, "author": "quux", "author_id": 2383, "author_profile": "https://Stac...
2008/09/02
[ "https://Stackoverflow.com/questions/38864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1596/" ]
38,870
<p>I have the following tables in my database that have a many-to-many relationship, which is expressed by a connecting table that has foreign keys to the primary keys of each of the main tables:</p> <ul> <li>Widget: WidgetID (PK), Title, Price </li> <li>User: UserID (PK), FirstName, LastName</li> </ul> <p>Assume th...
[ { "answer_id": 39145, "author": "Guy", "author_id": 993, "author_profile": "https://Stackoverflow.com/users/993", "pm_score": 3, "selected": false, "text": "PRIMARY KEY PRIMARY KEY's" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/38870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51/" ]
38,875
<p>My website was recently attacked by, what seemed to me as, an innocent code:</p> <pre><code>&lt;?php if ( isset( $ _GET['page'] ) ) { include( $ _GET['page'] . ".php" ); } else { include("home.php"); } ?&gt; </code></pre> <p>There where no SQL calls, so I wasn't afraid for SQL Injection. But, apparen...
[ { "answer_id": 38884, "author": "Till", "author_id": 2859, "author_profile": "https://Stackoverflow.com/users/2859", "pm_score": 2, "selected": false, "text": "<?php\nif (isset($_GET['page']) && !empty($_GET['page'])) {\n $page = urldecode($_GET['page']);\n $page = basename($page);\n ...
2008/09/02
[ "https://Stackoverflow.com/questions/38875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2644/" ]
38,890
<p>Is there a way to enforce constraint checking in MSSQL only when inserting new rows? I.e. allow the constraints to be violated when removing/updating rows?</p> <p>Update: I mean FK constraint.</p>
[ { "answer_id": 38897, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 4, "selected": true, "text": "CREATE TRIGGER employee_insupd\nON employee\nFOR INSERT\nAS\n/* Get the range of level for this job type from the jobs table. */\...
2008/09/02
[ "https://Stackoverflow.com/questions/38890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
38,922
<p>I have a rails application where each user has a separate database. (taking Joel Spolsky's advice on this). I want to run DB migrations from the rails application to create a new database and tables for this user. </p> <p>What is the easiest way to do this? </p> <p>Maybe the db migration is not the best for this t...
[ { "answer_id": 40015, "author": "Jordi Bunster", "author_id": 4272, "author_profile": "https://Stackoverflow.com/users/4272", "pm_score": 2, "selected": true, "text": "require 'rake'\nload 'path/to/task.rake'\n\nRake::Task['foo:bar:baz'].invoke\n" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/38922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2737/" ]
38,934
<p>How to take screenshot programmically of desktop area in Mac OS X ?</p>
[ { "answer_id": 67833, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": false, "text": "NSTask *theProcess;\ntheProcess = [[NSTask alloc] init];\n\n[theProcess setLaunchPath:@\"/usr/sbin/screencapture\"];\n// use ar...
2008/09/02
[ "https://Stackoverflow.com/questions/38934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3911/" ]
38,940
<p>If I've got a table containing Field1 and Field2 can I generate a new field in the select statement? For example, a normal query would be:</p> <pre><code>SELECT Field1, Field2 FROM Table </code></pre> <p>And I want to also create Field3 and have that returned in the resultset... something along the lines of this ...
[ { "answer_id": 38942, "author": "Josh", "author_id": 257, "author_profile": "https://Stackoverflow.com/users/257", "pm_score": 5, "selected": true, "text": "SELECT Field1, Field2, 'Value' Field3 FROM Table\n SELECT Field1, Field2, 'Value' AS Field3 FROM Table\n" }, { "answer_id":...
2008/09/02
[ "https://Stackoverflow.com/questions/38940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/393028/" ]
38,948
<p>Can I use <a href="http://struts.apache.org/" rel="nofollow noreferrer">Struts</a> as a backend and PHP as front end for a web application? If yes, what may be the implications.</p>
[ { "answer_id": 43967, "author": "Sam McAfee", "author_id": 577, "author_profile": "https://Stackoverflow.com/users/577", "pm_score": 2, "selected": false, "text": "http://mydomain.com/rest/this-is-a-method-call?parameter1=foo\n" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/38948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
38,960
<p>I would like to test a string containing a path to a file for existence of that file (something like the <code>-e</code> test in Perl or the <code>os.path.exists()</code> in Python) in C#.</p>
[ { "answer_id": 38962, "author": "Daniel Jennings", "author_id": 3641, "author_profile": "https://Stackoverflow.com/users/3641", "pm_score": 9, "selected": true, "text": "File.Exists(path)\n" }, { "answer_id": 38971, "author": "Peter Hoffmann", "author_id": 720, "autho...
2008/09/02
[ "https://Stackoverflow.com/questions/38960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2260/" ]
38,987
<p>I want to merge two dictionaries into a new dictionary.</p> <pre><code>x = {'a': 1, 'b': 2} y = {'b': 3, 'c': 4} z = merge(x, y) &gt;&gt;&gt; z {'a': 1, 'b': 3, 'c': 4} </code></pre> <p>Whenever a key <code>k</code> is present in both dictionaries, only the value <code>y[k]</code> should be kept.</p>
[ { "answer_id": 38989, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 7, "selected": false, "text": "x = {'a':1, 'b': 2}\ny = {'b':10, 'c': 11}\nz = dict(x.items() + y.items())\nprint z\n" }, { "answer_id": 38990, ...
2008/09/02
[ "https://Stackoverflow.com/questions/38987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3207/" ]
38,993
<p>Here's a basic regex technique that I've never managed to remember. Let's say I'm using a fairly generic regex implementation (e.g., grep or grep -E). If I were to do a list of files and match any that end in either <code>.sty</code> or <code>.cls</code>, how would I do that?</p>
[ { "answer_id": 38994, "author": "Peter Hoffmann", "author_id": 720, "author_profile": "https://Stackoverflow.com/users/720", "pm_score": 2, "selected": false, "text": "egrep \"\\.sty$|\\.cls$\"\n" }, { "answer_id": 39004, "author": "David Webb", "author_id": 3171, "au...
2008/09/02
[ "https://Stackoverflow.com/questions/38993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4161/" ]
38,998
<p>I'm an Information Architect and JavaScript developer by trade nowadays, but recently I've been getting back into back-end coding again. And, whilst trying to get an HTML prototype integrated and working with our C#-based CMS, I've come to blows with our programmers over the HTML ID attributes being arbitrarily rew...
[ { "answer_id": 39012, "author": "Serhat Ozgel", "author_id": 31505, "author_profile": "https://Stackoverflow.com/users/31505", "pm_score": 2, "selected": false, "text": "public class MyTextBox : TextBox\n{\n public override string ClientID { get { return ID; } }\n public override s...
2008/09/02
[ "https://Stackoverflow.com/questions/38998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3212/" ]
39,003
<p>If I have interface IFoo, and have several classes that implement it, what is the best/most elegant/cleverest way to test all those classes against the interface?</p> <p>I'd like to reduce test code duplication, but still 'stay true' to the principles of Unit testing.</p> <p>What would you consider best practice? ...
[ { "answer_id": 39034, "author": "Spoike", "author_id": 3713, "author_profile": "https://Stackoverflow.com/users/3713", "pm_score": 5, "selected": true, "text": "public interface IFoo {\n\n public void CommonCode();\n\n public void SpecificCode();\n\n}\n public abstract class Abstra...
2008/09/02
[ "https://Stackoverflow.com/questions/39003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3024/" ]
39,059
<p>Large pages are available in <code>Windows Server 2003</code> and <code>Windows Vista</code>. </p> <p>But how do I enable large pages for my application? </p>
[ { "answer_id": 39069, "author": "Martin", "author_id": 770, "author_profile": "https://Stackoverflow.com/users/770", "pm_score": 1, "selected": false, "text": "Lock pages in memory" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/39059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988/" ]
39,061
<p>I've convinced myself that they can't.</p> <p>Take for example:</p> <p>4 4 + 4 /</p> <p>stack: 4 stack: 4 4 4 + 4 = 8 stack: 8 stack: 8 4 8 / 4 = 2 stack: 2</p> <p>There are two ways that you could write the above expression with the same operators and operands such that the operands all come first: "4 4 4 + /...
[ { "answer_id": 39072, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 3, "selected": true, "text": "(a + b) * (c + d)\n a b + c d + *\n a b c d +\na b S\n" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/39061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4175/" ]
39,064
<p>I'm trying to call a 3rd party vendor's C DLL from vb.net 2005 and am getting <code>P/Invoke</code> errors. I'm successfully calling other methods but have hit a bottle-neck on one of the more complex. The structures involved are horrendous and in an attempt to simplify the troubleshooting I'd like to create a C++...
[ { "answer_id": 39079, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "__declspec(dllexport) WINAPI int Multiply(int p1, int p2)\n{\n return p1 * p2;\n}\n" }, { "answer_id": 43629, ...
2008/09/02
[ "https://Stackoverflow.com/questions/39064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
39,065
<p>I am working on localization for a asp.net application that consists of several projects.</p> <p>For this, there are some strings that are used in several of these projects. Naturally, I would prefer to have only one copy of the resource file in each project.</p> <p>Since the resource files don't have an namespace...
[ { "answer_id": 39169, "author": "Mark Harris", "author_id": 4026, "author_profile": "https://Stackoverflow.com/users/4026", "pm_score": 3, "selected": false, "text": "<Compile Include=\"path to shared file usually relative\">\n <Link>filename for Visual Studio To Dispaly.resx</Link>\n</...
2008/09/02
[ "https://Stackoverflow.com/questions/39065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1090/" ]
39,066
<p>Whenever I use my MacBook away from my desk and later plug it into an external display (as primary), I get into the state of having windows deposited in both the notebook monitor and the external one.</p> <p>To move all windows to a single screen, my current solution is to "Turn on mirroring" in the display prefere...
[ { "answer_id": 39097, "author": "erlando", "author_id": 4192, "author_profile": "https://Stackoverflow.com/users/4192", "pm_score": 2, "selected": false, "text": "-- Source: http://www.jonathanlaliberte.com/2007/10/19/move-all-windows-to-your-main-screen/\n-- and: http://www.macosxhints....
2008/09/02
[ "https://Stackoverflow.com/questions/39066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4161/" ]
39,070
<p>We need to move off traditional FTP for security purposes (it transmits it's passwords unencrypted). I am hearing SSH touted as the obvious alternative. However I have been driving FTP from an ASP.NET program interface to automate my web-site development, which is now quite a highly web-enabled process. </p> <p>Can...
[ { "answer_id": 84138, "author": "Martin Vobr", "author_id": 16132, "author_profile": "https://Stackoverflow.com/users/16132", "pm_score": 3, "selected": true, "text": "// create client, connect and log in \nSftp client = new Sftp();\nclient.Connect(hostname);\nclient.Login(username, pass...
2008/09/02
[ "https://Stackoverflow.com/questions/39070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4180/" ]
39,086
<p>I want to loop over the contents of a text file and do a search and replace on some lines and write the result back to the file. I could first load the whole file in memory and then write it back, but that probably is not the best way to do it.</p> <p>What is the best way to do this, within the following code?</p> ...
[ { "answer_id": 39110, "author": "Thomas Watnedal", "author_id": 4059, "author_profile": "https://Stackoverflow.com/users/4059", "pm_score": 9, "selected": true, "text": "from tempfile import mkstemp\nfrom shutil import move, copymode\nfrom os import fdopen, remove\n\ndef replace(file_pat...
2008/09/02
[ "https://Stackoverflow.com/questions/39086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4166/" ]
39,104
<p>I've written a Python package that includes a bsddb database of pre-computed values for one of the more time-consuming computations. For simplicity, my setup script installs the database file in the same directory as the code which accesses the database (on Unix, something like /usr/lib/python2.5/site-packages/mypa...
[ { "answer_id": 39659, "author": "Aaron Maenpaa", "author_id": 2603, "author_profile": "https://Stackoverflow.com/users/2603", "pm_score": 5, "selected": false, "text": ">>> import pkg_resources\n>>> pkg_resources.resource_filename(__name__, \"foo.config\")\n'foo.config'\n>>> pkg_resource...
2008/09/02
[ "https://Stackoverflow.com/questions/39104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4198/" ]
39,108
<p>What would be the best way to draw a simple animation just before showing a modal <a href="https://docs.oracle.com/javase/9/docs/api/javax/swing/JDialog.html" rel="nofollow noreferrer">JDialog</a>? (i.e. expanding borders from the mouse click point to the dialog location). I thought it would be possible to draw on t...
[ { "answer_id": 39868, "author": "rcreswick", "author_id": 3446, "author_profile": "https://Stackoverflow.com/users/3446", "pm_score": 1, "selected": false, "text": "SwingUtilities.invokeLater(new Runnable(){\n public void run(){\n doAnnimation();\n showDialog();\n }\n}\n" ...
2008/09/02
[ "https://Stackoverflow.com/questions/39108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3993/" ]
39,112
<p>I know in certain circumstances, such as long running processes, it is important to lock ASP.NET cache in order to avoid subsequent requests by another user for that resource from executing the long process again instead of hitting the cache.</p> <p>What is the best way in c# to implement cache locking in ASP.NET? ...
[ { "answer_id": 40065, "author": "a7drew", "author_id": 4239, "author_profile": "https://Stackoverflow.com/users/4239", "pm_score": 8, "selected": true, "text": "private static object ThisLock = new object();\n\npublic string GetFoo()\n{\n\n // try to pull from cache here\n\n lock (This...
2008/09/02
[ "https://Stackoverflow.com/questions/39112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2471/" ]
39,116
<p>I'm working on a module for a CMS. This module is distributed as a class library DLL.</p> <p>I have several utility libraries I'd like to use in this module. Is there anyway I can link these libraries statically so I won't have to distribute several DLL's (thereby distributing my utility libraries separately)?</p> ...
[ { "answer_id": 9040079, "author": "Kaganar", "author_id": 873886, "author_profile": "https://Stackoverflow.com/users/873886", "pm_score": 4, "selected": false, "text": "resourceName AssemblyLoadingAndReflection" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/39116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4192/" ]
39,119
<p>I have a .Net desktop application with a TreeView as one of the UI elements.</p> <p>I want to be able to multi-select that TreeView, only that isn't supported at all.</p> <p>So I'm adding check-boxes to the tree, My problem is that only some items are selectable, and those that aren't can't consistently cascade se...
[ { "answer_id": 39158, "author": "Skizz", "author_id": 1898, "author_profile": "https://Stackoverflow.com/users/1898", "pm_score": 1, "selected": false, "text": "TreeNode BackColor SelectionChanged Generic::List<>" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/39119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/905/" ]
39,125
<p>How can a .net class library project and resulting dll be protected so it cant be referenced by other applications (.net projects) except those projects in my own solution?</p>
[ { "answer_id": 39129, "author": "Glenn Slaven", "author_id": 2975, "author_profile": "https://Stackoverflow.com/users/2975", "pm_score": 1, "selected": false, "text": "internal" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/39125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/254/" ]
39,187
<p>I prefer dark backgrounds for coding, and I've downloaded a jar file containing an IntelliJ IDEA color theme that has a dark background. How do I tell IntelliJ about it?</p>
[ { "answer_id": 23292020, "author": "Alexander Suraphel", "author_id": 1242842, "author_profile": "https://Stackoverflow.com/users/1242842", "pm_score": 6, "selected": false, "text": "File Import Settings... jar Settings Editor Colors and Fonts" }, { "answer_id": 49256413, "au...
2008/09/02
[ "https://Stackoverflow.com/questions/39187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4203/" ]
39,222
<p>I'm working on porting a Visual C++ application to GCC (should build on MingW and Linux).</p> <p>The existing code uses <code>__try { ... } __except(1) { ... }</code> blocks in a few places so that almost nothing (short of maybe out of memory type errors?) would make the program exit without doing some minimal logg...
[ { "answer_id": 39231, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 0, "selected": false, "text": "struct my_exception_type : public logic_error {\n my_exception_type(char const* msg) : logic_error(msg) { }\n};\n\n...
2008/09/02
[ "https://Stackoverflow.com/questions/39222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/163/" ]
39,240
<p>I have lots of article store in MS SQL server 2005 database in a table called Articles-</p> <pre><code>"Articles (ArticleID, ArticleTitle, ArticleContent)" </code></pre> <p>Now I want some SP or SQL query which could return me similar Article against any user's input (very much like "Similar Posts" in blogs OR "Re...
[ { "answer_id": 39257, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 0, "selected": false, "text": "-- Assuming @Title contains title of current articles you can find related articles runnig this query \nSELECT * FROM Acticles W...
2008/09/02
[ "https://Stackoverflow.com/questions/39240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191/" ]
39,243
<p>Is there any query which can return me the number of revisions made to the structure of a database table?</p> <p>Secondly, how can I determine the number of pages (in terms of size) present in mdf or ldf files?</p>
[ { "answer_id": 39269, "author": "Christian Hagelid", "author_id": 202, "author_profile": "https://Stackoverflow.com/users/202", "pm_score": 2, "selected": false, "text": "trigger" }, { "answer_id": 39291, "author": "Matt Lacey", "author_id": 1755, "author_profile": "h...
2008/09/02
[ "https://Stackoverflow.com/questions/39243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021/" ]
39,281
<p>We have a requirement in project to store all the revisions(Change History) for the entities in the database. Currently we have 2 designed proposals for this:</p> <p>e.g. for "Employee" Entity</p> <p><strong>Design 1:</strong></p> <pre><code>-- Holds Employee Entity "Employees (EmployeeId, FirstName, LastName, De...
[ { "answer_id": 39296, "author": "Matthew Watson", "author_id": 3839, "author_profile": "https://Stackoverflow.com/users/3839", "pm_score": 3, "selected": false, "text": "Employees (EmployeeId, DateModified, < Employee Fields > , boolean isCurrent );\n" }, { "answer_id": 39300, ...
2008/09/02
[ "https://Stackoverflow.com/questions/39281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191/" ]
39,331
<p>What techniques can be applied effectively to improve the performance of SQL queries? Are there any general rules that apply?</p>
[ { "answer_id": 78938, "author": "EvilTeach", "author_id": 7734, "author_profile": "https://Stackoverflow.com/users/7734", "pm_score": 1, "selected": false, "text": "WITH\nmaster AS\n(\n SELECT SSN, FIRST_NAME, LAST_NAME\n FROM MASTER_SSN\n WHERE STATE = 'PA' AND\n GENDE...
2008/09/02
[ "https://Stackoverflow.com/questions/39331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184/" ]
39,364
<p>I have inherited a client site which crashes every 3 or 4 days. It is built using the zend-framework with which I have no knowledge.</p> <p>The following code:</p> <pre><code>&lt;?php // Make sure classes are in the include path. ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . 'lib' . PAT...
[ { "answer_id": 39387, "author": "Robin Barnes", "author_id": 1349865, "author_profile": "https://Stackoverflow.com/users/1349865", "pm_score": 3, "selected": true, "text": " set_include_path('../library/ZendFramework-1.5.2/library/:../application/classes/:../application/classes/excpet...
2008/09/02
[ "https://Stackoverflow.com/questions/39364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319/" ]
39,365
<p>Typically I develop my websites on trunk, then merge changes to a testing branch where they are put on a 'beta' website, and then finally they are merged onto a live branch and put onto the live website.</p> <p>With a Facebook application things are a bit tricky. As you can't view a Facebook application through a n...
[ { "answer_id": 445197, "author": "Arron S", "author_id": 16628, "author_profile": "https://Stackoverflow.com/users/16628", "pm_score": 5, "selected": false, "text": "(for windows users @ c:\\windows\\System32\\Drivers\\etc\\hosts) 127.0.0.1 mywebappthatusesfacebook.com." }, { "a...
2008/09/02
[ "https://Stackoverflow.com/questions/39365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2990/" ]
39,374
<p>How do you write code that is easily read by other people and who have had no hand in writing any part of it?</p>
[ { "answer_id": 39394, "author": "Rob Cooper", "author_id": 832, "author_profile": "https://Stackoverflow.com/users/832", "pm_score": 3, "selected": false, "text": "// add one to the count:\ni++;\n int x = i + j;\nint runSum = prevSum += newValue;\n if (x == y)\n{\n z = a;\n}\nelse\n{\n ...
2008/09/02
[ "https://Stackoverflow.com/questions/39374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021/" ]
39,391
<p>If I create an HTTP <code>java.net.URL</code> and then call <code>openConnection()</code> on it, does it necessarily imply that an HTTP post is going to happen? I know that <code>openStream()</code> implies a GET. If so, how do you perform one of the other HTTP verbs without having to work with the raw socket laye...
[ { "answer_id": 39431, "author": "WMR", "author_id": 2844, "author_profile": "https://Stackoverflow.com/users/2844", "pm_score": 2, "selected": false, "text": "HttpURLConnection setRequestMethod" }, { "answer_id": 39449, "author": "Herms", "author_id": 1409, "author_pr...
2008/09/02
[ "https://Stackoverflow.com/questions/39391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4223/" ]
39,392
<p>Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of data on a web-page with XSL over ASP.NET MVC?</p> <p>The two alternatives are:</p> <ol> <li><p><strong>ASP.NET (MVC/WebForms) with XSL</strong><br/> Getting the data from the database and transforming it to XML which is then d...
[ { "answer_id": 39423, "author": "Keith", "author_id": 905, "author_profile": "https://Stackoverflow.com/users/905", "pm_score": 3, "selected": false, "text": "<% %>" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/39392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2429/" ]
39,395
<p>How can I calculate the value of PI using C#?</p> <p>I was thinking it would be through a recursive function, if so, what would it look like and are there any math equations to back it up?</p> <p>I'm not too fussy about performance, mainly how to go about it from a learning point of view.</p>
[ { "answer_id": 39401, "author": "Niyaz", "author_id": 184, "author_profile": "https://Stackoverflow.com/users/184", "pm_score": 1, "selected": false, "text": "x = 1 - 1/3 + 1/5 - 1/7 + 1/9 (... etc as far as possible.)\nPI = x * 4\n" }, { "answer_id": 39404, "author": "wvdsc...
2008/09/02
[ "https://Stackoverflow.com/questions/39395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383/" ]
39,399
<p>I have a struts-based webapp, and I would like the default "welcome" page to be an action. The only solutions I have found to this seem to be variations on making the welcome page a JSP that contains a redirect to the action. For example, in <code>web.xml</code>:</p> <pre><code>&lt;welcome-file-list&gt; &lt;wel...
[ { "answer_id": 43879, "author": "Martin McNulty", "author_id": 4507, "author_profile": "https://Stackoverflow.com/users/4507", "pm_score": 5, "selected": false, "text": "<% \n response.sendRedirect(\"/myproject/MyAction.action\");\n%>\n <jsp:forward page=\"/MyAction.action\" />\n" }, ...
2008/09/02
[ "https://Stackoverflow.com/questions/39399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3913/" ]
39,419
<p>In Visual C++ a DWORD is just an unsigned long that is machine, platform, and SDK dependent. However, since DWORD is a double word (that is 2 * 16), is a DWORD still 32-bit on 64-bit architectures?</p>
[ { "answer_id": 39430, "author": "Mark Ingram", "author_id": 986, "author_profile": "https://Stackoverflow.com/users/986", "pm_score": 4, "selected": false, "text": "typedef unsigned long DWORD;\n typdef unsigned _int64 DWORD64;\n" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/39419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44972/" ]
39,438
<p>We are bringing a new project in house and whereas previously all our work was on SQL Server the new product uses an oracle back end.</p> <p>Can anyone advise any crib sheets or such like that gives an SQL Server person like me a rundown of what the major differences are - Would like to be able to get up and runnin...
[ { "answer_id": 39463, "author": "hamishmcn", "author_id": 3590, "author_profile": "https://Stackoverflow.com/users/3590", "pm_score": 1, "selected": false, "text": "INSERT INTO atable (a_varchar_column) VALUES (''); INSERT INTO atable (a_varchar_column) VALUES (NULL);\n sqlserver" }, ...
2008/09/02
[ "https://Stackoverflow.com/questions/39438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/770/" ]
39,447
<p>I have a class property exposing an internal IList&lt;> through</p> <pre><code>System.Collections.ObjectModel.ReadOnlyCollection&lt;&gt; </code></pre> <p>How can I pass a part of this <code>ReadOnlyCollection&lt;&gt;</code> without copying elements into a new array (I need a live view, and the target device is sho...
[ { "answer_id": 39462, "author": "Mendelt", "author_id": 3320, "author_profile": "https://Stackoverflow.com/users/3320", "pm_score": 1, "selected": false, "text": "IEnumerable<object> FilteredList()\n{\n foreach( object item in FullList )\n {\n if( IsItemInPartialList( item )...
2008/09/02
[ "https://Stackoverflow.com/questions/39447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3205/" ]
39,468
<p>I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used VB in ten years and I don't even have it insta...
[ { "answer_id": 39478, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 3, "selected": true, "text": "__declspec LIBRARY mylibname\nEXPORTS\n myfirstfunction\n secondfunction\n stdcall" }, { "answer_id": 394...
2008/09/02
[ "https://Stackoverflow.com/questions/39468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3685/" ]
39,474
<p>Does anyone know how to get IntelliSense to work reliably when working in C/C++ projects? It seems to work for about 1 in 10 files. Visual Studio 2005 seems to be a lot better than 2008.</p> <p>Edit: Whilst not necessarily a solution, the work-around provided here: </p> <p><a href="https://stackoverflow.com/questi...
[ { "answer_id": 39534, "author": "Mark Ingram", "author_id": 986, "author_profile": "https://Stackoverflow.com/users/986", "pm_score": 1, "selected": false, "text": "class MyPredeclared;\n\nclass SomeOtherClass\n{\nprivate:\n MyPredeclared* m_pPointer;\n}\n" }, { "answer_id": 5...
2008/09/02
[ "https://Stackoverflow.com/questions/39474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/986/" ]
39,475
<p>Hello I have the following error by git-fsck, which cannot be cleaned by git-gc even in --aggressive mode. What can I do next to fix this repository error? </p> <pre><code>$ git-fsck bad sha1 file: .git/objects/55/tmp_obj_a07724 </code></pre>
[ { "answer_id": 44733, "author": "Damien Diederen", "author_id": 3844, "author_profile": "https://Stackoverflow.com/users/3844", "pm_score": 3, "selected": false, "text": "tmp_obj_a07724 .git" }, { "answer_id": 49404775, "author": "Sergei Krivonos", "author_id": 525578, ...
2008/09/02
[ "https://Stackoverflow.com/questions/39475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2313/" ]
39,476
<p>In the <a href="https://stackoverflow.com/questions/39447/how-can-i-expose-only-a-fragment-of-ilist">How Can I Expose Only a Fragment of IList&lt;></a> question one of the answers had the following code snippet:</p> <pre><code>IEnumerable&lt;object&gt; FilteredList() { foreach(object item in FullList) { ...
[ { "answer_id": 39488, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 5, "selected": false, "text": "item IEnumerable" }, { "answer_id": 39496, "author": "Mendelt", "author_id": 3320, "author_profile...
2008/09/02
[ "https://Stackoverflow.com/questions/39476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1409/" ]
39,485
<p>Does anyone know of anywhere I can find actual code examples of Software Phase Locked Loops (SPLLs) ? </p> <p>I need an SPLL that can track a PSK modulated signal that is somewhere between 1.1 KHz and 1.3 KHz. A Google search brings up plenty of academic papers and patents but nothing usable. Even a trip to the Uni...
[ { "answer_id": 9118612, "author": "Kragen Javier Sitaker", "author_id": 176009, "author_profile": "https://Stackoverflow.com/users/176009", "pm_score": 4, "selected": false, "text": "main(a,b){for(;;)a+=((b+=16+a/1024)&256?1:-1)*getchar()-a/512,putchar(b);}\n arecord | ./pll | aplay b ge...
2008/09/02
[ "https://Stackoverflow.com/questions/39485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3875/" ]
39,503
<p>I need to modify the MBR of Windows, and I would really like to do this from Windows.</p> <p>Here are my questions. I know that I can get a handle on a physical device with a call to CreateFile. Will the MBR always be on \\.\PHYSICALDRIVE0? Also, I'm still learning the Windows API to read directly from the disk. Is...
[ { "answer_id": 40009, "author": "Grey Panther", "author_id": 1265, "author_profile": "https://Stackoverflow.com/users/1265", "pm_score": 2, "selected": false, "text": "OUT AX, BL\n" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/39503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2171/" ]
39,533
<p>Is there a way to identify, from within a VM, that your code is running inside a VM?</p> <p>I guess there are more or less easy ways to identify specific VM systems, especially if the VM has the provider's extensions installed (such as for VirtualBox or VMWare). But is there a general way to identify that you are n...
[ { "answer_id": 39542, "author": "wvdschel", "author_id": 2018, "author_profile": "https://Stackoverflow.com/users/2018", "pm_score": 3, "selected": false, "text": "/sys/devices/virtual/dmi/id/product_name dmidecode | grep Product" }, { "answer_id": 108504, "author": "Charles ...
2008/09/02
[ "https://Stackoverflow.com/questions/39533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/107/" ]
39,536
<p>I have a fairly small MySQL database (a Textpattern install) on a server that I do not have SSH access to (I have FTP access only). I need to regularly download the live database to my local dev server on demand; i.e., I would like to either run a script and/or have a cron job running. What are some good ways of doi...
[ { "answer_id": 39555, "author": "Anders Sandvig", "author_id": 1709, "author_profile": "https://Stackoverflow.com/users/1709", "pm_score": 0, "selected": false, "text": "SELECT * FROM ... DROP DATABASE ... INSERT SHOW DATABASES SHOW CREATE TABLE ... CREATE TABLE SHOW TABLES" }, { ...
2008/09/02
[ "https://Stackoverflow.com/questions/39536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1944/" ]
39,541
<p>Maybe I just don't know .NET well enough yet, but I have yet to see a satisfactory way to implement this simple VB6 code easily in .NET (assume this code is on a form with N CommandButtons in array Command1() and N TextBoxes in array Text1()):</p> <pre><code>Private Sub Command1_Click(Index As Integer) Text1(In...
[ { "answer_id": 39544, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 0, "selected": false, "text": "TextBox[] textboxes = new TextBox[] {\n textBox1,\n textBox2,\n textBox3\n};\n" }, { "answer_id": 395...
2008/09/02
[ "https://Stackoverflow.com/questions/39541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4228/" ]
39,561
<p>Trying to get my css / C# functions to look like this:</p> <pre><code>body { color:#222; } </code></pre> <p>instead of this:</p> <pre><code>body { color:#222; } </code></pre> <p>when I auto-format the code.</p>
[ { "answer_id": 17557791, "author": "Gabriel Nahmias", "author_id": 2285405, "author_profile": "https://Stackoverflow.com/users/2285405", "pm_score": 3, "selected": false, "text": "Tools -> Options -> Text Editor -> CSS -> Formatting" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/39561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26/" ]
39,562
<p>A friend of mine is now building a web application with J2EE and Struts, and it's going to be prepared to display pages in several languages.</p> <p>I was told that the best way to support a multi-language site is to use a properties file where you store all the strings of your pages, something like:</p> <pre><cod...
[ { "answer_id": 39587, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 4, "selected": true, "text": "SELECT NewsText FROM News INNER JOIN NewsText ON News.NewsID = NewsText.NewsID\nWHERE NewsText.NewsLanguageID = <<Session[\"UserL...
2008/09/02
[ "https://Stackoverflow.com/questions/39562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1679/" ]
39,564
<p>In my host, I currently have installed 2 wordpress applications, 1 phpBB forum and one MediaWiki.</p> <p>Is there a way to merge the login so that all applications share the same credentials?</p> <p>For instance, I want to register only in my phpBB and then I want to access all other applications with the given us...
[ { "answer_id": 39595, "author": "seanyboy", "author_id": 1726, "author_profile": "https://Stackoverflow.com/users/1726", "pm_score": 2, "selected": false, "text": "require_once('includes/AuthPlugin.php');\nrequire_once('extensions/AuthPress.php');\n\n$wgAuth = new AuthPress();\n$wgAuth->...
2008/09/02
[ "https://Stackoverflow.com/questions/39564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2644/" ]
39,567
<p>In Ruby, given an array in one of the following forms...</p> <pre><code>[apple, 1, banana, 2] [[apple, 1], [banana, 2]] </code></pre> <p>...what is the best way to convert this into a hash in the form of...</p> <pre><code>{apple =&gt; 1, banana =&gt; 2} </code></pre>
[ { "answer_id": 39621, "author": "John Topley", "author_id": 1450, "author_profile": "https://Stackoverflow.com/users/1450", "pm_score": 7, "selected": false, "text": "Hash[*array_variable.flatten] a1 = ['apple', 1, 'banana', 2]\nh1 = Hash[*a1.flatten(1)]\nputs \"h1: #{h1.inspect}\"\n\na2...
2008/09/02
[ "https://Stackoverflow.com/questions/39567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4142/" ]