qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
109,825
<p>Should I bind directly to objects returned from a webservice or should I have client-side objects that I bind to my gridcontrols? For instance if I have a service that returns object Car should I have a client side Car object that I populate with values from the webservice Car object? What is considered best-practi...
[ { "answer_id": 235048, "author": "Rob Cooper", "author_id": 832, "author_profile": "https://Stackoverflow.com/users/832", "pm_score": 2, "selected": false, "text": "Car CarFactory BuyCar(string make, string model) Mechanic Car Garage CarFactory Mechanic CarFactory.BuyCar(\"Audi\", \"R8\"...
2008/09/20
[ "https://Stackoverflow.com/questions/109825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15771/" ]
109,859
<p>I am reading a .NET book, and in one of the code examples there is a class definition with this field:</p> <pre><code>private DateTime? startdate </code></pre> <p>What does <code>DateTime?</code> mean?</p>
[ { "answer_id": 109862, "author": "Daniel Auger", "author_id": 1644, "author_profile": "https://Stackoverflow.com/users/1644", "pm_score": 5, "selected": false, "text": "? DateTime?" }, { "answer_id": 109872, "author": "Thomas", "author_id": 14637, "author_profile": "h...
2008/09/21
[ "https://Stackoverflow.com/questions/109859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7148/" ]
109,880
<p>Has anybody found a good solution for lazily-evaluated lists in Perl? I've tried a number of ways to turn something like </p> <pre><code>for my $item ( map { ... } @list ) { } </code></pre> <p>into a lazy evaluation--by tie-ing @list, for example. I'm trying to avoid breaking down and writing a source filter to ...
[ { "answer_id": 109899, "author": "jkramer", "author_id": 12523, "author_profile": "https://Stackoverflow.com/users/12523", "pm_score": 2, "selected": false, "text": "my $list = sub { return calculate_next_element };\nwhile(defined(my $element = &$list)) {\n ...\n}\n" }, { "ans...
2008/09/21
[ "https://Stackoverflow.com/questions/109880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11289/" ]
109,883
<p>aspnet mvc has the HandleError filter that will return a view if an error occurs, but if an error occurs when calling a JsonResult Action how can I return a JSON object that represents an error?</p> <p>I don't want to wrap the code in each action method that returns a JsonResult in a try/catch to accomplish it, I'd...
[ { "answer_id": 109897, "author": "Vyrotek", "author_id": 10941, "author_profile": "https://Stackoverflow.com/users/10941", "pm_score": 1, "selected": false, "text": " public enum ActionResultTypes\n {\n View,\n Json\n }\n\n public sealed class AuthorizationRequiredAt...
2008/09/21
[ "https://Stackoverflow.com/questions/109883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5556/" ]
109,916
<p>To see what file to invoke the unrar command on, one needs to determine which file is the first in the file set.</p> <p>Here are some sample file names, of which - naturally - only the first group should be matched:</p> <pre><code>yes.rar yes.part1.rar yes.part01.rar yes.part001.rar no.part2.rar no.part02.rar no....
[ { "answer_id": 110120, "author": "Matthew Encinas", "author_id": 14433, "author_profile": "https://Stackoverflow.com/users/14433", "pm_score": 0, "selected": false, "text": "^(yes|no)\\.(rar|part0*1\\.rar)$\n" }, { "answer_id": 110122, "author": "mweerden", "author_id": 4...
2008/09/21
[ "https://Stackoverflow.com/questions/109916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19392/" ]
109,931
<p>How to implement multi-threading in visual basic 6.0. It would be great if someone can give an example.</p>
[ { "answer_id": 219502, "author": "Jeffrey L Whitledge", "author_id": 10174, "author_profile": "https://Stackoverflow.com/users/10174", "pm_score": 2, "selected": false, "text": "DoEvents" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/109931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9087/" ]
109,934
<p>I've got a generic&lt;> function that takes a linq query ('items') and enumerates through it adding additional properties. How can I select all the properties of the original 'item' rather than the item itself (as the code below does)?</p> <p>So equivalent to the sql: select *, 'bar' as Foo from items</p> <pre><co...
[ { "answer_id": 109967, "author": "Esteban Araya", "author_id": 781, "author_profile": "https://Stackoverflow.com/users/781", "pm_score": 0, "selected": false, "text": "from item in items\nwhere someConditionOnItem\nselect\n{\n propertyOne,\n propertyTwo\n};\n" }, { "answe...
2008/09/21
[ "https://Stackoverflow.com/questions/109934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14072/" ]
109,948
<p>just a quick question:</p> <p>I am a CS undergrad and have only had experience with the Eclipse, and Net Beans IDEs. I have recently acquired a Macbook and was wanting to recompile a recent school project in Xcode just to test it out. Right after the line where I declare a new instance of an ArrayList: </p> <pre...
[ { "answer_id": 109966, "author": "Nicholas Riley", "author_id": 6372, "author_profile": "https://Stackoverflow.com/users/6372", "pm_score": 4, "selected": true, "text": " <target name=\"compile\" depends=\"init\" description=\"Compile code\">\n <mkdir dir=\"${bin}\"/>\n <javac d...
2008/09/21
[ "https://Stackoverflow.com/questions/109948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14013/" ]
109,993
<p>In the past, some of my projects have required me to create a movie version of a fullscreen Flash application. The easiest way to do this has been to get a screen capture. However, capturing anything over 1024x768 has resulted in choppy video, which is unacceptable. I understand that there are hardware based solutio...
[ { "answer_id": 110115, "author": "rpetrich", "author_id": 4007, "author_profile": "https://Stackoverflow.com/users/4007", "pm_score": 1, "selected": false, "text": "IViewObject::Draw OleDraw" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/109993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2715/" ]
110,016
<p>I know that <code>JTable</code> can sort by a single column. But is it possible to allow for multiple column sort or do I need to write the code myself?</p>
[ { "answer_id": 110027, "author": "Joshua", "author_id": 6013, "author_profile": "https://Stackoverflow.com/users/6013", "pm_score": 2, "selected": false, "text": "TableModel myModel = createMyTableModel();\nJTable table = new JTable(myModel);\nTableRowSorter t = new TableRowSorter(myMode...
2008/09/21
[ "https://Stackoverflow.com/questions/110016", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
110,018
<p>Anyone know? Want to be able to on the fly stamp an image with another image as a watermark, also to do large batches. Any type of existing library or a technique you know of would be great.</p>
[ { "answer_id": 110085, "author": "John West", "author_id": 19832, "author_profile": "https://Stackoverflow.com/users/19832", "pm_score": 2, "selected": false, "text": "\nvbc.exe watermark.vb /t:exe /out:watermark.exe\n \nwatermark.exe \"c:\\source folder\" \"c:\\destination folder\"\n \n...
2008/09/21
[ "https://Stackoverflow.com/questions/110018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18309/" ]
110,031
<p>Several questions about functional programming languages have got me thinking about whether XSLT is a functional programming language. If not, what features are missing? Has XSLT 2.0 shortened or closed the gap?</p>
[ { "answer_id": 111403, "author": "JeniT", "author_id": 6739, "author_profile": "https://Stackoverflow.com/users/6739", "pm_score": 2, "selected": false, "text": "saxon:function() {http://net.sf.saxon/java-type}net.sf.saxon.expr.UserFunctionCall saxon:call() saxon:expression() saxon:eval(...
2008/09/21
[ "https://Stackoverflow.com/questions/110031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13342/" ]
110,078
<p>I need to store app specific configuration in rails. But it has to be:</p> <ul> <li>reachable in any file (model, view, helpers and controllers</li> <li>environment specified (or not), that means each environment can overwrite the configs specified in environment.rb</li> </ul> <p>I've tried to use environment.rb a...
[ { "answer_id": 110307, "author": "Otto", "author_id": 9594, "author_profile": "https://Stackoverflow.com/users/9594", "pm_score": 2, "selected": false, "text": "lib/analytics/google_analytics.rb module Analytics\n class GoogleAnalytics\n @@account_id = nil\n\n cattr_accessor :acco...
2008/09/21
[ "https://Stackoverflow.com/questions/110078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19224/" ]
110,081
<p>The LinearGradientBrush in .net (or even in GDI+ as a whole?) seems to have a severe bug: Sometimes, it introduces artifacts. (See <a href="http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.languages.csharp/2007-01/msg01592.html" rel="nofollow noreferrer">here</a> or <a href="http://www.experts-exch...
[ { "answer_id": 227715, "author": "David Schmitt", "author_id": 4918, "author_profile": "https://Stackoverflow.com/users/4918", "pm_score": 1, "selected": false, "text": "GradientStop" }, { "answer_id": 13729217, "author": "Hugh W", "author_id": 1688738, "author_profil...
2008/09/21
[ "https://Stackoverflow.com/questions/110081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91/" ]
110,083
<pre><code>String s = ""; for(i=0;i&lt;....){ s = some Assignment; } </code></pre> <p>or</p> <pre><code>for(i=0;i&lt;..){ String s = some Assignment; } </code></pre> <p>I don't need to use 's' outside the loop ever again. The first option is perhaps better since a new String is not initialized each time. Th...
[ { "answer_id": 110099, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 2, "selected": false, "text": "some Assignment" }, { "answer_id": 110322, "author": "Milhous", "author_id": 17712, "author_pro...
2008/09/21
[ "https://Stackoverflow.com/questions/110083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16485/" ]
110,088
<p>I'm fully aware that set division can be accomplished through a series of other operations, so my question is: </p> <p>Is there a command for set division in SQL?</p>
[ { "answer_id": 5922425, "author": "TuteC", "author_id": 356060, "author_profile": "https://Stackoverflow.com/users/356060", "pm_score": 2, "selected": false, "text": "sailors boats reserves SELECT name FROM sailors\nWHERE Sid NOT IN (\n -- A sailor is disqualified if by attaching a bo...
2008/09/21
[ "https://Stackoverflow.com/questions/110088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/781/" ]
110,121
<p>Everything inherits from object. It's the basis of inheritance. Everything can be implicitly cast up the inheritance tree, ie.</p> <pre><code>object me = new Person(); </code></pre> <p>Therefore, following this through to its logical conclusion, a group of People would also be a group of objects:</p> <pre><code>L...
[ { "answer_id": 110136, "author": "mattlant", "author_id": 14642, "author_profile": "https://Stackoverflow.com/users/14642", "pm_score": 2, "selected": false, "text": "IEnumerable<Person> oldList = someIenumarable;\nIEnumerable<object> newList = oldlist.Cast<object>()\n" }, { "ans...
2008/09/21
[ "https://Stackoverflow.com/questions/110121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15537/" ]
110,123
<p>I'm using ASP.NET Web Forms for blog style comments. </p> <p>Edit 1: This looks way more complicated then I first thought. How do you filter the src?<br> I would prefer to still use real html tags but if things get too complicated that way, I might go a custom route. I haven't done any XML yet, so do I need to l...
[ { "answer_id": 110146, "author": "Thomas", "author_id": 14637, "author_profile": "https://Stackoverflow.com/users/14637", "pm_score": 1, "selected": false, "text": "<img> tag, and all attributes from that except src, alt and title tag, and all attributes from that except src, alt src" ...
2008/09/21
[ "https://Stackoverflow.com/questions/110123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10352/" ]
110,157
<p>This is one of the possible ways I come out:</p> <pre><code>struct RetrieveKey { template &lt;typename T&gt; typename T::first_type operator()(T keyValuePair) const { return keyValuePair.first; } }; map&lt;int, int&gt; m; vector&lt;int&gt; keys; // Retrieve all keys transform(m.begin(), m.e...
[ { "answer_id": 110170, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 4, "selected": false, "text": "select1st" }, { "answer_id": 110211, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "h...
2008/09/21
[ "https://Stackoverflow.com/questions/110157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18638/" ]
110,163
<p>I have a rails model that looks something like this:</p> <pre><code>class Recipe &lt; ActiveRecord::Base has_many :ingredients attr_accessor :ingredients_string attr_accessible :title, :directions, :ingredients, :ingredients_string before_save :set_ingredients def ingredients_string ingredien...
[ { "answer_id": 110170, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 4, "selected": false, "text": "select1st" }, { "answer_id": 110211, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "h...
2008/09/21
[ "https://Stackoverflow.com/questions/110163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12448/" ]
110,175
<p>How can you automatically import the latest build/revision number in subversion?</p> <p>The goal would be to have that number visible on your webpage footer like SO does.</p>
[ { "answer_id": 110185, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 5, "selected": true, "text": "svn info <Repository-URL>\n svn info --xml <Repository-URL>\n <?xml version=\"1.0\"?>\n<info>\n<entry\n kind=\"dir\"\n p...
2008/09/21
[ "https://Stackoverflow.com/questions/110175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
110,205
<p>I want to download this open source application, and they are using Git. What do I need to download the code base?</p> <p><b>Update</b> How do I change the working directory when I am using Git Bash? (I want to download the repo at a certain directory, using pwd tells me I will be downloading the repo where I don...
[ { "answer_id": 110209, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 8, "selected": true, "text": "git clone git://project.url.here\n" }, { "answer_id": 110237, "author": "Michael Johnson", "author_id": 17...
2008/09/21
[ "https://Stackoverflow.com/questions/110205", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
110,229
<p>What is the behind-the-scenes difference between 'int?' and 'int'? Is 'int?' a somehow a reference type?</p>
[ { "answer_id": 59404837, "author": "simon9k", "author_id": 2416245, "author_profile": "https://Stackoverflow.com/users/2416245", "pm_score": -1, "selected": false, "text": "int? n = null;\n\n//int m1 = n; // Doesn't compile\nint n2 = (int)n; // Compiles, but throws an exception if n i...
2008/09/21
[ "https://Stackoverflow.com/questions/110229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16872/" ]
110,232
<p>I am creating a website in CakePHP and I am kind of new on it. I couldn't find good resources on this matter, so there you go:</p> <p>I have a three table structure for registering users: <code>Users</code>, <code>Addresses</code> and <code>Contacts</code>. I have to build a view with info of all three tables like:...
[ { "answer_id": 112685, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "echo $form->create('User', array('action' => 'add');\necho $form->input('User.name');\necho $form->input('Address.line_1');\nec...
2008/09/21
[ "https://Stackoverflow.com/questions/110232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2274/" ]
110,249
<p>Since VS 2005, I see that it is not possible to simply build a dll against MS runtime and deploy them together (<a href="http://www.ddj.com/windows/184406482" rel="nofollow noreferrer">http://www.ddj.com/windows/184406482</a>). I am deeply confused by manifest, SxS and co: MSDN documentation is really poor, with cir...
[ { "answer_id": 113022, "author": "titanae", "author_id": 2387, "author_profile": "https://Stackoverflow.com/users/2387", "pm_score": 3, "selected": true, "text": "/*----------------------------------------------------------------------------*/\n\n#if _MSC_VER >= 1400\n\n/*---------------...
2008/09/21
[ "https://Stackoverflow.com/questions/110249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11465/" ]
110,259
<p>I want to know the memory usage of my Python application and specifically want to know what code blocks/portions or objects are consuming most memory. Google search shows a commercial one is <a href="http://www.softwareverify.com/python/memory/index.html" rel="noreferrer">Python Memory Validator</a> (Windows only).<...
[ { "answer_id": 110272, "author": "sanxiyn", "author_id": 18382, "author_profile": "https://Stackoverflow.com/users/18382", "pm_score": 6, "selected": false, "text": "# memdebug.py\n\nimport cherrypy\nimport dowser\n\ndef start(port):\n cherrypy.tree.mount(dowser.Root())\n cherrypy....
2008/09/21
[ "https://Stackoverflow.com/questions/110259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6946/" ]
110,263
<p>I am trying to add a project reference or swc to papervision in FlashDevelop but intellisense isn't picking it up. I've done it before but i forgot how.</p> <p>Thanks.</p>
[ { "answer_id": 110588, "author": "grapefrukt", "author_id": 914, "author_profile": "https://Stackoverflow.com/users/914", "pm_score": 3, "selected": false, "text": "Project -> Properties -> Compiler Options -> SWC Libraries \n" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/110263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1748529/" ]
110,281
<p>How can I make a style have all of the properties of the style defined in <code>.a .b .c</code> except for <code>background-color</code> (or some other property)? This does not seem to work.</p> <pre><code>.a .b .c { background-color: #0000FF; color: #ffffff; border: 1px solid #c0c0c0; margin-top: 4...
[ { "answer_id": 110287, "author": "micahwittman", "author_id": 11181, "author_profile": "https://Stackoverflow.com/users/11181", "pm_score": 2, "selected": false, "text": ".a, .b, .c {color: #ffffff; border: 1px solid #c0c0c0; margin-top: 4px; padding: 3px; text-align: center; font-weight...
2008/09/21
[ "https://Stackoverflow.com/questions/110281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15059/" ]
110,305
<p>I'm working on a page has an ol with nested p's, div's, and li's. Internet Explorer 6 and 7 both render the numbers for the ol tag after the p element at the end (at the very, very bottom of the li tag) rather than at the top of the outermost li as expected. I'm working on a PowerPC Mac and can't do any testing. Is ...
[ { "answer_id": 131103, "author": "Dustman", "author_id": 16398, "author_profile": "https://Stackoverflow.com/users/16398", "pm_score": 5, "selected": true, "text": "...\n\nol {\n font-size: 1.1em;\n}\n\n...\n\nli.main_item {\n width: 700px;\n clear: right;\n}\n\n...\n ...\n\nol ...
2008/09/21
[ "https://Stackoverflow.com/questions/110305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10140/" ]
110,313
<p>If our organisation were to switch from a central-server VCS like subversion to a distributed VCS like git, how do I make sure that all my code is safe from hardware failure?</p> <p>With a central-server VCS I just need to backup the repository every day. If we were using a DVCS then there'd be loads of code branch...
[ { "answer_id": 110619, "author": "CB Bailey", "author_id": 19563, "author_profile": "https://Stackoverflow.com/users/19563", "pm_score": 5, "selected": true, "text": "git mybackup git push origin +refs/heads/*:refs/jbloggs/*\n" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/110313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6408/" ]
110,314
<p>So, I am using the Linq entity framework. I have 2 entities: <code>Content</code> and <code>Tag</code>. They are in a many-to-many relationship with one another. <code>Content</code> can have many <code>Tags</code> and <code>Tag</code> can have many <code>Contents</code>. So I am trying to write a query to select al...
[ { "answer_id": 110348, "author": "chakrit", "author_id": 3055, "author_profile": "https://Stackoverflow.com/users/3055", "pm_score": 1, "selected": false, "text": "tags.Select(testTag => testTag.Name)\n" }, { "answer_id": 110363, "author": "Alex Lyman", "author_id": 5897,...
2008/09/21
[ "https://Stackoverflow.com/questions/110314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19854/" ]
110,325
<p>Obviously I can use BCP but here is the issue. If one of the records in a Batch have an invalid date I want to redirect that to a separate table/file/whatever, but keep the batch processing running. I don't think SSIS can be installed on the server which would have helped.</p>
[ { "answer_id": 110372, "author": "Stephen Wrighton", "author_id": 7516, "author_profile": "https://Stackoverflow.com/users/7516", "pm_score": 4, "selected": true, "text": "BULK INSERT your_database.your_schema.your_table FROM your_file WITH (FIRE_TRIGGERS )\n" }, { "answer_id": 1...
2008/09/21
[ "https://Stackoverflow.com/questions/110325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19857/" ]
110,332
<p>I have an <code>NSArray</code> and I'd like to create a new <code>NSArray</code> with objects from the original array that meet certain criteria. The criteria is decided by a function that returns a <code>BOOL</code>.</p> <p>I can create an <code>NSMutableArray</code>, iterate through the source array and copy over...
[ { "answer_id": 110343, "author": "lajos", "author_id": 3740, "author_profile": "https://Stackoverflow.com/users/3740", "pm_score": 8, "selected": true, "text": "NSArray NSMutableArray NSArray NSMutableArray NSMutableArray *array =\n [NSMutableArray arrayWithObjects:@\"Bill\", @\"Ben\"...
2008/09/21
[ "https://Stackoverflow.com/questions/110332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3740/" ]
110,336
<p>Here's my issue: I need to close a process, already running, from a C# program. The problem is that the process now runs as an icon (minimized to taskbar), and unless the user opens it at least once (which will never happen on unattended machines), it'll never have a main window. </p> <p>The other requirement that...
[ { "answer_id": 110413, "author": "rpetrich", "author_id": 4007, "author_profile": "https://Stackoverflow.com/users/4007", "pm_score": 2, "selected": false, "text": "[DllImport(\"user32.dll\", CharSet=CharSet.Auto)]\nprivate static extern IntPtr FindWindow(string className, string windowN...
2008/09/21
[ "https://Stackoverflow.com/questions/110336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19856/" ]
110,344
<p>What would be the most optimal algorithm (performance-wise) to calculate the number of divisors of a given number?</p> <p>It'll be great if you could provide pseudocode or a link to some example.</p> <p>EDIT: All the answers have been very helpful, thank you. I'm implementing the Sieve of Atkin and then I'm going ...
[ { "answer_id": 110358, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 0, "selected": false, "text": "factor(N)\n divisor = first_prime\n list_of_factors = { 1 }\n while (N > 1)\n while (N % divisor ...
2008/09/21
[ "https://Stackoverflow.com/questions/110344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9776/" ]
110,354
<p>I want to do this:</p> <pre><code>e.className = t; </code></pre> <p>Where t is the name of a style I have defined in a stylesheet.</p>
[ { "answer_id": 110357, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "button.style.fontFamily = \"Verdana, Arial, sans-serif\";\n button" }, { "answer_id": 110361, "author": "jonah",...
2008/09/21
[ "https://Stackoverflow.com/questions/110354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15059/" ]
110,362
<p>As the title says, how can I find the current operating system in python?</p>
[ { "answer_id": 110368, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 6, "selected": false, "text": "import os\nprint(os.name)\n" }, { "answer_id": 110829, "author": "dF.", "author_id": 3002, "author_pr...
2008/09/21
[ "https://Stackoverflow.com/questions/110362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115/" ]
110,378
<p>How can I change the width of a textarea form element if I used ModelForm to create it?</p> <p>Here is my product class:</p> <pre><code>class ProductForm(ModelForm): long_desc = forms.CharField(widget=forms.Textarea) short_desc = forms.CharField(widget=forms.Textarea) class Meta: model = Produc...
[ { "answer_id": 110414, "author": "zuber", "author_id": 9812, "author_profile": "https://Stackoverflow.com/users/9812", "pm_score": 8, "selected": true, "text": "long_desc #id_long_desc {\n width: 300px;\n height: 200px;\n}\n attrs class ProductForm(ModelForm):\n long_desc = form...
2008/09/21
[ "https://Stackoverflow.com/questions/110378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2592/" ]
110,384
<p>I am looking to set the result action from a failed IAuthorizationFilter. However I am unsure how to create an ActionResult from inside the Filter. The controller doesn't seem to be accible from inside the filter so my usual View("SomeView") isn't working. Is there a way to get the controler or else another way o...
[ { "answer_id": 110630, "author": "Jeremy Skinner", "author_id": 8560, "author_profile": "https://Stackoverflow.com/users/8560", "pm_score": 2, "selected": true, "text": "public void OnAuthorization(AuthorizationContext context)\n{\n if (!context.HttpContext.User.Identity.IsAuthenticat...
2008/09/21
[ "https://Stackoverflow.com/questions/110384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/361/" ]
110,385
<p>I have a group of checkboxes that I only want to allow a set amount to be checked at any one time. If the newly checked checkbox pushes the count over the limit, I'd like the oldest checkbox to be automatically unchecked. The group of checkboxes all use the same event handler shown below.</p> <p>I have achieved the...
[ { "answer_id": 110398, "author": "chakrit", "author_id": 3055, "author_profile": "https://Stackoverflow.com/users/3055", "pm_score": 3, "selected": true, "text": "AddLast Enqueue RemoveFirst Dequeue Remove" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/110385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1880/" ]
110,393
<p>I'm attempting to use TinyXML to read and save from memory, instead of only reading and saving files to disk.</p> <p>It seems that the documnent's parse function can load a char *. But then I need to save the document to a char * when I'm done with it. Does anyone know about this?</p> <p><strike>Edit: The printing...
[ { "answer_id": 110412, "author": "SemiColon", "author_id": 1994, "author_profile": "https://Stackoverflow.com/users/1994", "pm_score": 0, "selected": false, "text": "#include <stdio.h>\n FILE* fd = fopen(\"filename.xml\", \"rb\"); // Read-only mode\nint fsize = fseek(fd, 0, SEEK_END); //...
2008/09/21
[ "https://Stackoverflow.com/questions/110393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14278/" ]
110,430
<p>Do you write one test per function/method, with multiple checks in the test, or a test for each check?</p>
[ { "answer_id": 110461, "author": "marcospereira", "author_id": 4600, "author_profile": "https://Stackoverflow.com/users/4600", "pm_score": 6, "selected": true, "text": "@Test\npublic void userCannotVoteDownWhenScoreIsLessThanOneHundred() {\n ...\n}\n" }, { "answer_id": 110563, ...
2008/09/21
[ "https://Stackoverflow.com/questions/110430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19863/" ]
110,433
<p>Are there any Common Lisp implementations for .Net?</p>
[ { "answer_id": 58422645, "author": "mythz", "author_id": 85785, "author_profile": "https://Stackoverflow.com/users/85785", "pm_score": 2, "selected": false, "text": "#Script #Script #Script fn def defn #Script #Script dotnet $ dotnet tool install -g x\n $ x lisp\n $ dotnet tool install -...
2008/09/21
[ "https://Stackoverflow.com/questions/110433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18658/" ]
110,436
<p>Any recommended practices for cleaning up "header spaghetti" which is causing extremely slow compilation times (Linux/Unix)?</p> <p>Is there any equvalent to "#pragma once" with GCC?<br> (found conflicting messages regarding this)</p> <p>Thanks.</p>
[ { "answer_id": 110489, "author": "jasonmray", "author_id": 17230, "author_profile": "https://Stackoverflow.com/users/17230", "pm_score": 3, "selected": false, "text": "#pragma once #pragma once #include" }, { "answer_id": 110608, "author": "Assaf Lavie", "author_id": 1120...
2008/09/21
[ "https://Stackoverflow.com/questions/110436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
110,451
<p>I am working through the book Learning WCF by Michele Bustamante, and trying to do it using Visual Studio C# Express 2008. The instructions say to use WCF project and item templates, which are not included with VS C# Express. There <em>are</em> templates for these types included with Visual Studio Web Developer Ex...
[ { "answer_id": 676745, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 5, "selected": true, "text": "C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\VWDExpress\n C:\\Program Files\\Microsoft Visual Studio 9.0\\Comm...
2008/09/21
[ "https://Stackoverflow.com/questions/110451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14607/" ]
110,458
<p>I'm new to developing things on the web. So far, I'm spending a lot of time (50% or so) to try and prevent bad people from putting things like sql injection into my input forms and validating it server side. Is this normal? </p>
[ { "answer_id": 110526, "author": "Cheekysoft", "author_id": 1820, "author_profile": "https://Stackoverflow.com/users/1820", "pm_score": 3, "selected": false, "text": "mysqli PDO $result = \"SELECT fields FROM table WHERE id = \".mysql_real_escape_string($_POST['id']);\n id 1 OR 1=1\n SEL...
2008/09/21
[ "https://Stackoverflow.com/questions/110458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10352/" ]
110,488
<p>I am looking for a better solution than what we currently have to deal with <strong>unexpected production errors</strong>, without reinventing the wheel.</p> <p>A larger number of our products are WinForm and WPF applications that are installed at remote sites. Inevitably unexpected errors occur, from NullReferenc...
[ { "answer_id": 110501, "author": "sontek", "author_id": 17176, "author_profile": "https://Stackoverflow.com/users/17176", "pm_score": 2, "selected": false, "text": "[STAThread]\nstatic void Main() \n{\n Application.ThreadException += new ThreadExceptionEventHandler(OnUnhandledExceptio...
2008/09/21
[ "https://Stackoverflow.com/questions/110488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11123/" ]
110,498
<p>Looking at the source of urllib2 it looks like the easiest way to do it would be to subclass HTTPRedirectHandler and then use build_opener to override the default HTTPRedirectHandler, but this seems like a lot of (relatively complicated) work to do what seems like it should be pretty simple.</p>
[ { "answer_id": 110547, "author": "olt", "author_id": 19759, "author_profile": "https://Stackoverflow.com/users/19759", "pm_score": 5, "selected": false, "text": ">>> import httplib\n>>> conn = httplib.HTTPConnection(\"www.bogosoft.com\")\n>>> conn.request(\"GET\", \"\")\n>>> r1 = conn.ge...
2008/09/21
[ "https://Stackoverflow.com/questions/110498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2168/" ]
110,512
<p>I'm currently running mongrel clusters with monit watching over them for 8 Rails applications on one server.</p> <p>I'd like to move 7 of these applications to mod_rails, with one remaining on mongrel. The 7 smaller applications are low-volume, while the one I'd like to remain on mongrel is a high volume, app.</p> ...
[ { "answer_id": 110799, "author": "tomtaylor", "author_id": 19079, "author_profile": "https://Stackoverflow.com/users/19079", "pm_score": 3, "selected": true, "text": "<Directory \"/var/www/app/current/public\">\n Options FollowSymLinks\n AllowOverride None\n Order allow,deny\n ...
2008/09/21
[ "https://Stackoverflow.com/questions/110512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10596/" ]
110,533
<p>Joel always said to be careful when using 3rd party libraries. From my initial impressions, jQuery is great. What should I beware of when using it? What are the limitations? What headaches will I run into later on as I use it more?</p>
[ { "answer_id": 120853, "author": "cllpse", "author_id": 20946, "author_profile": "https://Stackoverflow.com/users/20946", "pm_score": 3, "selected": false, "text": "$(\"a tip\")\n.you()\n.can()\n.chain()\n.stuff()\n.like()\n.this();\n var $tip = $(\"a tip\");\n$tip.choo();\n$tip.choo();\...
2008/09/21
[ "https://Stackoverflow.com/questions/110533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10352/" ]
110,536
<p>I have the following code:</p> <pre><code>string prefix = "OLD:"; Func&lt;string, string&gt; prependAction = (x =&gt; prefix + x); prefix = "NEW:"; Console.WriteLine(prependAction("brownie")); </code></pre> <p>Because the compiler replaces the prefix variable with a closure "NEW:brownie" is printed to the console....
[ { "answer_id": 110540, "author": "Dested", "author_id": 11137, "author_profile": "https://Stackoverflow.com/users/11137", "pm_score": -1, "selected": false, "text": "string prefix = \"OLD:\";\nstring _prefix=prefix;\nFunc<string, string> prependAction = (x => _prefix + x);\nprefix = \"NE...
2008/09/21
[ "https://Stackoverflow.com/questions/110536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6600/" ]
110,562
<p>I need to write a function that receives a property as a parameter and execute its getter.</p> <p>If I needed to pass a function/delegate I would have used:</p> <pre><code>delegate RET FunctionDelegate&lt;T, RET&gt;(T t); void func&lt;T, RET&gt;(FunctionDelegate function, T param, ...) { ... return functi...
[ { "answer_id": 110621, "author": "Nir", "author_id": 3509, "author_profile": "https://Stackoverflow.com/users/3509", "pm_score": 4, "selected": true, "text": "value = obj.GetType().GetProperty(\"Foo\").GetAccessors()[0].Invoke(obj,null);\n obj.GetType().GetProperty(\"Foo\").GetAccessors(...
2008/09/21
[ "https://Stackoverflow.com/questions/110562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11361/" ]
110,575
<p>Earlier today a question was asked regarding <a href="https://stackoverflow.com/questions/110458/what-percentage-of-my-time-will-be-spent-in-user-input-verfication-during-web-d">input validation strategies in web apps</a>.</p> <p>The top answer, at time of writing, suggests in <code>PHP</code> just using <code>html...
[ { "answer_id": 110576, "author": "Cheekysoft", "author_id": 1820, "author_profile": "https://Stackoverflow.com/users/1820", "pm_score": 9, "selected": true, "text": "mysqli PDO mysql_real_escape_string mysql_real_escape_string $result = \"SELECT fields FROM table WHERE id = \".mysql_real...
2008/09/21
[ "https://Stackoverflow.com/questions/110575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1820/" ]
110,587
<p>in a DB2 trigger, I need to compare the value of a CLOB field. Something like:</p> <pre><code>IF OLD_ROW.CLOB_FIELD != UPDATED_ROW.CLOB_FIELD </code></pre> <p>but "!=" does not work for comparing CLOBs.</p> <p>What is the way to compare it?</p> <p><strong>Edited to add:</strong></p> <p>My trigger needs to do s...
[ { "answer_id": 266524, "author": "Brian", "author_id": 700, "author_profile": "https://Stackoverflow.com/users/700", "pm_score": 3, "selected": false, "text": "select * from table t where dbms_lob.compare(t.clob1, t.clob2) != 0\n DBMS_LOB.COMPARE (\n lob_1 IN BLOB,\n lob_2...
2008/09/21
[ "https://Stackoverflow.com/questions/110587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11710/" ]
110,592
<p>Spring DA helps in writing DAOs. When using iBATIS as the persistence framework, and extending SqlMapClientDaoSupport, a SqlMapClient mock should be set for the DAO, but I can't do it. SqlMapClientTemplate is not an interface and EasyMock cannot creates a mock for it.</p>
[ { "answer_id": 139589, "author": "bsanders", "author_id": 22200, "author_profile": "https://Stackoverflow.com/users/22200", "pm_score": 1, "selected": false, "text": "SqlMapClientDaoSupport SqlMapClientTemplate SqlMapClientOperations @Component\npublic class MyDaoImpl implements MyDao {\...
2008/09/21
[ "https://Stackoverflow.com/questions/110592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19888/" ]
110,632
<p>Currently IIS sends an expires http header of yesterday minus 1 hour on ASP.NET pages. How do I change this to 60 seconds in the further instead? </p>
[ { "answer_id": 110670, "author": "Johannes Hädrich", "author_id": 18246, "author_profile": "https://Stackoverflow.com/users/18246", "pm_score": 3, "selected": true, "text": "Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/110632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9819/" ]
110,674
<p>I'm developing a performance critical application for Intel Atom processor.</p> <p>What are the best gcc optimization flags for this CPU?</p>
[ { "answer_id": 300463, "author": "user38733", "author_id": 38733, "author_profile": "https://Stackoverflow.com/users/38733", "pm_score": 2, "selected": false, "text": "-march=prescott -O2 -pipe -fomit-frame-pointer\n" }, { "answer_id": 379908, "author": "pixelbeat", "auth...
2008/09/21
[ "https://Stackoverflow.com/questions/110674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7305/" ]
110,684
<p>Some years ago I was on a panel that was interviewing candidates for a relatively senior embedded C programmer position.</p> <p>One of the standard questions that I asked was about optimisation techniques. I was quite surprised that some of the candidates didn't have answers.</p> <p>So, in the interests of putting...
[ { "answer_id": 110734, "author": "jkramer", "author_id": 12523, "author_profile": "https://Stackoverflow.com/users/12523", "pm_score": 2, "selected": false, "text": "char buf[1024] = { 0, };\n/* becomes: */\nchar buf[1024];\nmemset(buf, 0, sizeof(buf));\n" }, { "answer_id": 11422...
2008/09/21
[ "https://Stackoverflow.com/questions/110684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11694/" ]
110,749
<p>How would you write a regular expression to convert mark down into HTML? For example, you would type in the following:</p> <pre><code>This would be *italicized* text and this would be **bold** text </code></pre> <p>This would then need to be converted to:</p> <pre><code>This would be &lt;em&gt;italicized&lt;/em&...
[ { "answer_id": 110769, "author": "Tim Booker", "author_id": 10046, "author_profile": "https://Stackoverflow.com/users/10046", "pm_score": 4, "selected": true, "text": "private string DoItalicsAndBold (string text)\n{\n // <strong> must go first:\n text = Regex.Replace (text, @\"(\\...
2008/09/21
[ "https://Stackoverflow.com/questions/110749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768/" ]
110,763
<p>I've built a wrapper over NumbericUpDown control. The wrapper is generic and can support int? and double?</p> <p>I would like to write a method that will do the following.</p> <pre><code>public partial class NullableNumericUpDown&lt;T&gt; : UserControl where T : struct { private NumbericUpDown numericUpDown; ...
[ { "answer_id": 110772, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 3, "selected": false, "text": "using System;\nusing System.ComponentModel;\n\nstatic Nullable<T> ConvertFromString<T>(string value) where T:struct\n{\n Type...
2008/09/21
[ "https://Stackoverflow.com/questions/110763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11659/" ]
110,774
<p>Say I have a blogging app in Django. How can i re-order the posts using a draggable table in the default admin?</p> <p>It would be best if i didn't have to add any extra fields to the model, but if i really have to i can.</p>
[ { "answer_id": 110830, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 2, "selected": false, "text": ".order_by(x) ordering class InOrder( models.Model ):\n position = models.IntegerField()\n data = models.TextField()\n...
2008/09/21
[ "https://Stackoverflow.com/questions/110774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2592/" ]
110,801
<p>I've tried cpan and cpanp shell and I keep getting:</p> <pre><code>ExtUtils::PkgConfig requires the pkg-config utility, but it doesn't seem to be in your PATH. Is it correctly installed? </code></pre> <p>What is the pkg-config utility and how do I install it? </p> <p>Updates: </p> <ul> <li>OS: Windows</li> <li...
[ { "answer_id": 110842, "author": "Cetra", "author_id": 15087, "author_profile": "https://Stackoverflow.com/users/15087", "pm_score": 2, "selected": false, "text": " sudo apt-get install pkg-config\n" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/110801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9411/" ]
110,803
<p>In my app i need to save changed values (old and new) when model gets saved. Any examples or working code?</p> <p>I need this for premoderation of content. For example, if user changes something in model, then administrator can see all changes in separate table and then decide to apply them or not.</p>
[ { "answer_id": 110821, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 2, "selected": false, "text": "def updateSomething( request, object_id ):\n object= Model.objects.get( id=object_id )\n if request.method == \"GET\"...
2008/09/21
[ "https://Stackoverflow.com/questions/110803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7437/" ]
110,833
<p>What is the correct way to import a C++ class from a DLL? We're using Visual C++. </p> <p>There's the dllexport/exports.def+LoadLibrary+GetProcAddress trifecta, but it doesn't work on C++ classes, only C functions. Is this due to C++ name-mangling? How do I make this work?</p>
[ { "answer_id": 110854, "author": "Dror Helper", "author_id": 11361, "author_profile": "https://Stackoverflow.com/users/11361", "pm_score": 4, "selected": false, "text": "extern \"C\"\n{\n...\n}\n SomeClass* CreateObjectInstace()\n{\n return new SomeClass();\n}\n\nvoid ReleaseObject(So...
2008/09/21
[ "https://Stackoverflow.com/questions/110833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13897/" ]
110,858
<p>I am searching for a tutorial <code>(optimally with Zend Framework)</code> on how to use <code>PHPUnit</code>.</p> <p>I have found a couple on <code>google</code> but have not quiet understood it yet.</p>
[ { "answer_id": 804040, "author": "Andrew", "author_id": 48523, "author_profile": "https://Stackoverflow.com/users/48523", "pm_score": 1, "selected": false, "text": "Zend_Test Zend_Test" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/110858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19929/" ]
110,867
<p>I have a public property set in my form of type <code>ListE&lt;T&gt;</code> where:</p> <pre><code>public class ListE&lt;T&gt; : IList&lt;T&gt;, ICollection&lt;T&gt;, IEnumerable&lt;T&gt;, IList, ICollection, IEnumerable </code></pre> <p>Yeah, it's a mouthful, but that's what the Designer requires for it to show up...
[ { "answer_id": 111065, "author": "user7116", "author_id": 7116, "author_profile": "https://Stackoverflow.com/users/7116", "pm_score": 0, "selected": false, "text": "checked\n{\n // ...\n}\n" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/110867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15537/" ]
110,887
<p>Is there a way to read a module's configuration ini file? </p> <p>For example I installed php-eaccelerator (<a href="http://eaccelerator.net" rel="nofollow noreferrer">http://eaccelerator.net</a>) and it put a <code>eaccelerator.ini</code> file in <code>/etc/php.d</code>. My PHP installation wont read this <code>.i...
[ { "answer_id": 110907, "author": "Till", "author_id": 2859, "author_profile": "https://Stackoverflow.com/users/2859", "pm_score": 3, "selected": true, "text": "<?php phpinfo(); ?> [eAccelerator]\nextension=\"eaccelerator.so\"\neaccelerator.shm_size=\"32\"\neaccelerator.cache_dir=\"/tmp\"...
2008/09/21
[ "https://Stackoverflow.com/questions/110887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3983/" ]
110,894
<p>I've got C# code that accesses MySQL through ODBC.</p> <p>It creates a transaction, does a few thousand insert commands, and then commits. Now my question is how many "round trips", so to speak, happen against the DB server? I mean, does it simply transmit every insert command to the DB server, or does it cache/buf...
[ { "answer_id": 110915, "author": "Sam Saffron", "author_id": 17174, "author_profile": "https://Stackoverflow.com/users/17174", "pm_score": 0, "selected": false, "text": "cmd.ExecuteNonQuery \"insert table values (1) insert table values (2)\"\n" }, { "answer_id": 110955, "aut...
2008/09/21
[ "https://Stackoverflow.com/questions/110894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11208/" ]
110,911
<p>I do most of my development in Common Lisp, but there are some moments when I want to switch to Scheme (while reading <em>Lisp in Small Pieces</em>, when I want to play with continuations, or when I want to do some scripting in Gauche, for example). In such situations, my main source of discomfort is that I don't ha...
[ { "answer_id": 122570, "author": "jfm3", "author_id": 11138, "author_profile": "https://Stackoverflow.com/users/11138", "pm_score": 2, "selected": false, "text": "mzscheme" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/110911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19922/" ]
110,923
<p>How do I end a Tkinter program? Let's say I have this code:</p> <pre><code>from Tkinter import * def quit(): # code to exit root = Tk() Button(root, text="Quit", command=quit).pack() root.mainloop() </code></pre> <p>How should I define the <code>quit</code> function to exit my application?</p>
[ { "answer_id": 110929, "author": "Matt Gregory", "author_id": 10577, "author_profile": "https://Stackoverflow.com/users/10577", "pm_score": 6, "selected": false, "text": "def quit()\n root.quit()\n def quit()\n root.destroy()\n" }, { "answer_id": 111011, "author": "dF."...
2008/09/21
[ "https://Stackoverflow.com/questions/110923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10577/" ]
110,928
<p>Seriously. On a 22" monitor, it only covers maybe a quarter of the screen. I need some ammo to axe down this rule.</p> <hr> <p>I'm not saying that there shouldn't be a limit; I'm just saying, 80 characters is very small.</p>
[ { "answer_id": 124774, "author": "Sam Hasler", "author_id": 2541, "author_profile": "https://Stackoverflow.com/users/2541", "pm_score": 5, "selected": false, "text": "switch(Type) {\ncase External_BL: mpstrd[\"X\"] = ptDig1.x - RadialClrX; mpstrd[\"Y\"] = ptDig1.y - RadialClrY; b...
2008/09/21
[ "https://Stackoverflow.com/questions/110928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18658/" ]
110,987
<p>This question is directed to the non-english speaking people here.</p> <p><em>It is somewhat biased because SO is an &quot;english-speaking&quot; web forum, so... In the other hand, most developers would know english anyway...</em></p> <p>In your locale culture, are technical words translated into locale words ? For...
[ { "answer_id": 13518183, "author": "Giulio Muscarello", "author_id": 1541408, "author_profile": "https://Stackoverflow.com/users/1541408", "pm_score": 0, "selected": false, "text": "stack matrice array Design pattern schema di progettazione" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/110987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14089/" ]
111,026
<p>Which is the best way to store a 2D array in c# in order to optimize performance when performing lots of arithmetic on the elements in the array?</p> <p>We have large (approx 1.5G) arrays, which for example we want to multiply with each other element by element. Performance is critical. The context in which this is...
[ { "answer_id": 111046, "author": "Cameron MacFarland", "author_id": 3820, "author_profile": "https://Stackoverflow.com/users/3820", "pm_score": 3, "selected": false, "text": "int[] array = Enumerable.Range(0, 1000).ToArray();\n\nint count = 0;\nunsafe {\n fixed (int* pArray = array) {...
2008/09/21
[ "https://Stackoverflow.com/questions/111026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4044/" ]
111,045
<p>What are your favorite supplementary tools for Java development?</p> <p>Mine are:</p> <p>1) Total Commander (due to the ability to search inside JARs).</p> <p>2) JAD + Jadclipse (to understand and debug libraries)</p> <p>And of-course, Google. (can't really live without it)</p>
[ { "answer_id": 117151, "author": "ShawnD", "author_id": 6186, "author_profile": "https://Stackoverflow.com/users/6186", "pm_score": 2, "selected": false, "text": "* Possible bugs - empty try/catch/finally/switch statements\n* Dead code - unused local variables, parameters and private met...
2008/09/21
[ "https://Stackoverflow.com/questions/111045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15100/" ]
111,097
<p><strong>EDIT:</strong> This was formerly more explicitly titled: - "<strong>Best solution to stop Kontiki's KHOST.EXE from loading automatically at start-up on Windows XP?</strong>"</p> <p>Essentially, whenever the <strong><a href="http://www.channel4.com/4od/index.html" rel="nofollow noreferrer">40D</a></strong> a...
[ { "answer_id": 111137, "author": "beakersoft", "author_id": 19638, "author_profile": "https://Stackoverflow.com/users/19638", "pm_score": 2, "selected": true, "text": "Dim WSHShell\nSet WSHShell = WScript.CreateObject(\"WScript.Shell\")\n'repeat the line below for each key to delete \nWS...
2008/09/21
[ "https://Stackoverflow.com/questions/111097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17759/" ]
111,102
<p>How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?</p> <p>I have seen <a href="http://en.wikipedia.org/wiki/Scheme_%28programming_language%29" rel="noreferrer">the Scheme ...
[ { "answer_id": 111111, "author": "Joel Anair", "author_id": 7441, "author_profile": "https://Stackoverflow.com/users/7441", "pm_score": 14, "selected": true, "text": "inner foo secret function foo() {\n const secret = Math.trunc(Math.random() * 100)\n return function inner() {\n con...
2008/09/21
[ "https://Stackoverflow.com/questions/111102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9951/" ]
111,129
<p>I have a table which is referenced by foreign keys on many other tables. In my program if I want to delete one of these rows I need to first search for dependencies and present them to the user - "This object depends on x from table y, z from table q, etc". I also expect the number of tables which have foreign keys ...
[ { "answer_id": 6069057, "author": "Denis de Bernardy", "author_id": 417194, "author_profile": "https://Stackoverflow.com/users/417194", "pm_score": 1, "selected": false, "text": "show create table create table rolando (num int not null, primary key (num) using hash);\n mysql> show create...
2008/09/21
[ "https://Stackoverflow.com/questions/111129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15004/" ]
111,133
<p>Just wondering</p>
[ { "answer_id": 111158, "author": "Ian P", "author_id": 10853, "author_profile": "https://Stackoverflow.com/users/10853", "pm_score": 0, "selected": false, "text": "String[] MazeArray = new String[5];\n\nMazeArray[0] = \"---X---X-------XF\";\nMazeArray[0] = \"-X-X-X---XXXXXXX-\";\nMazeArr...
2008/09/21
[ "https://Stackoverflow.com/questions/111133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19970/" ]
111,135
<p>I write my app in VS 2008 and so use all the fanciful stuffs such as LINQ, object initializers etc. Now can my app run on machines that have only .Net 2.0 runtime, but no .Net 3.5 runtime? .Net 3.5 runtime is a huge download, as all of you might know.</p>
[ { "answer_id": 111153, "author": "andynil", "author_id": 446, "author_profile": "https://Stackoverflow.com/users/446", "pm_score": 4, "selected": true, "text": "namespace System.Runtime.CompilerServices\n{\n public class ExtensionAttribute : Attribute { }\n}\n" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/111135", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
111,155
<p>How do I handle the window close event (user clicking the 'X' button) in a Python Tkinter program?</p>
[ { "answer_id": 111160, "author": "Matt Gregory", "author_id": 10577, "author_profile": "https://Stackoverflow.com/users/10577", "pm_score": 8, "selected": false, "text": "WM_DELETE_WINDOW protocol Tk Toplevel import tkinter as tk\nfrom tkinter import messagebox\n\nroot = tk.Tk()\n\ndef o...
2008/09/21
[ "https://Stackoverflow.com/questions/111155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10577/" ]
111,194
<p>I have a web app which connects to a server using a TCP connection and reads a binary document which it then writes to its response object. In other words it's transferring a file from a backend server using a custom protocol and returning that file to its client through HTTP.</p> <p>The server sends a status code ...
[ { "answer_id": 111212, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 2, "selected": false, "text": " public static byte[] doFetchBinaryUrl(string url)\n {\n BinaryReader rdr;\n HttpWebResponse res...
2008/09/21
[ "https://Stackoverflow.com/questions/111194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4086/" ]
111,234
<p>Now that it's clear <a href="https://stackoverflow.com/questions/100003/what-is-a-metaclass-in-python">what a metaclass is</a>, there is an associated concept that I use all the time without knowing what it really means. </p> <p>I suppose everybody made once a mistake with parenthesis, resulting in an "object is n...
[ { "answer_id": 111251, "author": "ConcernedOfTunbridgeWells", "author_id": 15401, "author_profile": "https://Stackoverflow.com/users/15401", "pm_score": 4, "selected": false, "text": "__call__ [nigel@k9 ~]$ python\nPython 2.5 (r25:51908, Nov 6 2007, 15:55:44) \n[GCC 4.1.2 20070925 (Red ...
2008/09/21
[ "https://Stackoverflow.com/questions/111234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9951/" ]
111,282
<p>I'm modifying some code in which the original author built a web page by using an array thusly:</p> <pre><code> $output[]=$stuff_from_database; $output[]='more stuff'; // etc echo join('',$output); </code></pre> <p>Can anyone think of a reason why this would be preferable (or vice versa) to:</p> <pre><code> $o...
[ { "answer_id": 111310, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 4, "selected": false, "text": "~$ cat join.php\n<?php\n\nfor ($i=0;$i<50000;$i++) {\n$output[] = \"HI $i\\n\";\n}\n\necho join('',$output);\n?>\n\n...
2008/09/21
[ "https://Stackoverflow.com/questions/111282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
111,285
<p>I am currently using an MSAccess mdb file for a redistributable app. </p> <p>A while ago I found out about SQLite, as an alternative to my solution, but the binaries they provide do not offer the possiblilty of using them as an object in VB6. (Or at least I couldn't figure it out how).</p> <p>Does anyone has a lin...
[ { "answer_id": 48403155, "author": "StayOnTarget", "author_id": 3195477, "author_profile": "https://Stackoverflow.com/users/3195477", "pm_score": 0, "selected": false, "text": "sqlite.dll Declare Sub Declare Function Public Declare Sub sqlite3_open Lib \"sqlite.dll\" (ByVal FileName As S...
2008/09/21
[ "https://Stackoverflow.com/questions/111285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4749/" ]
111,287
<p>Is it possible to put the results from more than one query on more than one table into a TClientDataset?</p> <p>Just something like</p> <pre><code>SELECT * from t1; SELECT * from t2; SELECT * from t3; </code></pre> <p>I can't seem to figure out a way to get a data provider (SetProvider) to pull in results from mo...
[ { "answer_id": 111324, "author": "Ralph M. Rickenbach", "author_id": 4549416, "author_profile": "https://Stackoverflow.com/users/4549416", "pm_score": 2, "selected": false, "text": "select * from t1, t2, t3 where t1.key = t2.key and t2.key = t3.key;\n" }, { "answer_id": 112219, ...
2008/09/21
[ "https://Stackoverflow.com/questions/111287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19658/" ]
111,294
<p>What are some resources in use for marketing downloadable desktop software online? AdWords, certainly, and "organic" search engine results but is anyone having any luck making sales through sites like Tucows and/or Download.com anymorE?</p>
[ { "answer_id": 111324, "author": "Ralph M. Rickenbach", "author_id": 4549416, "author_profile": "https://Stackoverflow.com/users/4549416", "pm_score": 2, "selected": false, "text": "select * from t1, t2, t3 where t1.key = t2.key and t2.key = t3.key;\n" }, { "answer_id": 112219, ...
2008/09/21
[ "https://Stackoverflow.com/questions/111294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19658/" ]
111,302
<p>I have a webservice that when called without specifying a callback will return a JSON string using <code>application/json</code> as the content type.</p> <p>When a callback is specified it will wrap the JSON string in a callback function, so it's not really valid JSON anymore. My question is, should I serve it as <...
[ { "answer_id": 111319, "author": "Florian Bösch", "author_id": 19435, "author_profile": "https://Stackoverflow.com/users/19435", "pm_score": 7, "selected": false, "text": "application/json application/javascript" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/111302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9128/" ]
111,307
<p>The question of whether P=NP is perhaps the most famous in all of Computer Science. What does it mean? And why is it so interesting?</p> <p>Oh, and for extra credit, please post a proof of the statement's truth or falsehood. :)</p>
[ { "answer_id": 535771, "author": "Jonas Kölker", "author_id": 58668, "author_profile": "https://Stackoverflow.com/users/58668", "pm_score": 3, "selected": false, "text": "n^k k n n log n n^2 k n^k n^k O(n) O(m) O(n^2) P =? NP not ((u_h and not u_l) and (v_h and not v_l) or ...) AND O(n+m...
2008/09/21
[ "https://Stackoverflow.com/questions/111307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7598/" ]
111,339
<p>From my own "key logger like" process I figured out that another process Locale is wrong (i.e. by sniffing few keys, I figured out that the foreground process Locale should be something while it is set to another). What's the best way to do this?</p>
[ { "answer_id": 111353, "author": "Isak Savo", "author_id": 8521, "author_profile": "https://Stackoverflow.com/users/8521", "pm_score": 1, "selected": false, "text": "setlocale()" } ]
2008/09/21
[ "https://Stackoverflow.com/questions/111339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
111,341
<p>I've got two tables:</p> <pre><code>TableA ------ ID, Name TableB ------ ID, SomeColumn, TableA_ID (FK for TableA) </code></pre> <p>The relationship is one row of <code>TableA</code> - many of <code>TableB</code>.</p> <p>Now, I want to see a result like this:</p> <pre><code>ID Name SomeColumn 1. A...
[ { "answer_id": 111356, "author": "Bill", "author_id": 14547, "author_profile": "https://Stackoverflow.com/users/14547", "pm_score": 0, "selected": false, "text": "ID Name SomeColumn\n1 ABC X\n1 ABC Y\n1 ABC Z\n2 MNO R\n2...
2008/09/21
[ "https://Stackoverflow.com/questions/111341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6939/" ]
111,345
<p>Is there a cheap way to get the dimensions of an image (jpg, png, ...)? Preferably, I would like to achieve this using only the standard class library (because of hosting restrictions). I know that it should be relatively easy to read the image header and parse it myself, but it seems that something like this should...
[ { "answer_id": 111349, "author": "Frank Krueger", "author_id": 338, "author_profile": "https://Stackoverflow.com/users/338", "pm_score": 4, "selected": false, "text": "System.Windows.Media.Imaging.BitmapDecoder" }, { "answer_id": 112266, "author": "Abbas", "author_id": 47...
2008/09/21
[ "https://Stackoverflow.com/questions/111345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15716/" ]
111,368
<p>CPU Cycles, Memory Usage, Execution Time, etc.?</p> <p>Added: Is there a quantitative way of testing performance in JavaScript besides just perception of how fast the code runs?</p>
[ { "answer_id": 111729, "author": "noah", "author_id": 12034, "author_profile": "https://Stackoverflow.com/users/12034", "pm_score": 9, "selected": false, "text": "console.time() console.profile() performance.now()" }, { "answer_id": 2550811, "author": "pramodc84", "author...
2008/09/21
[ "https://Stackoverflow.com/questions/111368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10352/" ]
111,405
<p>I have some problems with Miktex installed on Windows Vista Business SP1/32 bit. I use miktex 2.7, ghostscript, and texniccenter 1 beta 7.50. When I compile a document with the following profiles: Latex=>DVI, Latex=>PDF everything works fine; the system crashes when I compile with profiles Latex=>PS and Latex=>PS=>P...
[ { "answer_id": 111506, "author": "finrod", "author_id": 8295, "author_profile": "https://Stackoverflow.com/users/8295", "pm_score": 2, "selected": true, "text": "%in the document preamble\n\\usepackage{graphicx}\n\n%in the document, in the place where you want to put your image\n\\includ...
2008/09/21
[ "https://Stackoverflow.com/questions/111405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11464/" ]
111,407
<p>I have a simple unordered list that I want to show and hide on click using the jQuery slideUp and slideDown effect. Everything seems to work fine, however in IE6 the list will slide up, flicker for a split second, and then disappear.</p> <p>Does anyone know of a fix for this?</p> <p>Thanks!</p>
[ { "answer_id": 111409, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 3, "selected": false, "text": "$(document).ready(function() {\n // Fix background image caching problem\n if (jQuery.browser.msie) {\n try { \n ...
2008/09/21
[ "https://Stackoverflow.com/questions/111407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1396/" ]
111,417
<p>What’s the difference between <code>Response.Write()</code> and <code>Response.Output.Write()</code>? </p>
[ { "answer_id": 111425, "author": "Jesper Blad Jensen", "author_id": 11559, "author_profile": "https://Stackoverflow.com/users/11559", "pm_score": 0, "selected": false, "text": "Response.Write Response.Output" }, { "answer_id": 111429, "author": "Dexter", "author_id": 1071...
2008/09/21
[ "https://Stackoverflow.com/questions/111417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
111,426
<p>I'm taking a course in computational complexity and have so far had an impression that it won't be of much help to a developer. </p> <p>I might be wrong but if you have gone down this path before, could you please provide an example of how the complexity theory helped you in your work? Tons of thanks.</p>
[ { "answer_id": 111510, "author": "Stefan Rusek", "author_id": 19704, "author_profile": "https://Stackoverflow.com/users/19704", "pm_score": 3, "selected": false, "text": "SELECT User.*, COUNT(Order.*) OrderCount FROM User Join Order ON User.UserId = Order.UserId\n CREATE INDEX ORDER_USER...
2008/09/21
[ "https://Stackoverflow.com/questions/111426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8203/" ]
111,436
<p>I want to have my PHP application labeled with the revision number which it uses, but I don't want to use <a href="http://en.wikipedia.org/wiki/CruiseControl" rel="nofollow noreferrer">CruiseControl</a> or update a file and upload it every time. How should I do it?</p>
[ { "answer_id": 111459, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 4, "selected": false, "text": "$svn = File('.svn/entries');\n$svnrev = $svn[3];\nunset($svn);\n" }, { "answer_id": 111463, "author": "Espo", ...
2008/09/21
[ "https://Stackoverflow.com/questions/111436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19929/" ]
111,440
<p>How can I detect, using php, if the machine has oracle <code>(oci8 and/or pdo_oci)</code> installed?</p> <p>I'm working on a <code>PHP</code> project where some developers, such as myself, have it installed, but there's little need for the themers to have it. How can I write a quick function to use in the code so ...
[ { "answer_id": 111466, "author": "user19264", "author_id": 19264, "author_profile": "https://Stackoverflow.com/users/19264", "pm_score": 0, "selected": false, "text": "<?php\n $connection = oci_connect('username', 'password', 'table');\n if (!$connection) {\n // no OCI connection.\n...
2008/09/21
[ "https://Stackoverflow.com/questions/111440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9143/" ]
111,460
<p>I'm working on serial port, transmitting and receiving data to some hardware at 8bit data. I would like to store it as string to facilitate comparison, and preset data are stored as string or hex format in xml file. I found out that only when using Encoding.Default which is ANSI encoding then the 8bit data is conver...
[ { "answer_id": 111508, "author": "Matt Howells", "author_id": 16881, "author_profile": "https://Stackoverflow.com/users/16881", "pm_score": -1, "selected": false, "text": "byte[] toEncode; \nstring encoded = System.Convert.ToBase64String(toEncode);\n" }, { "answer_id": 111541, ...
2008/09/21
[ "https://Stackoverflow.com/questions/111460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20007/" ]
111,461
<p>I see a lot of example code for C# classes that does this:</p> <pre><code>public class Point { public int x { get; set; } public int y { get; set; } } </code></pre> <p>Or, in older code, the same with an explicit private backing value and without the new auto-implemented properties:</p> <pre><code>public ...
[ { "answer_id": 111484, "author": "Brad Wilson", "author_id": 1554, "author_profile": "https://Stackoverflow.com/users/1554", "pm_score": 5, "selected": false, "text": "public int x { get; private set; }\n" }, { "answer_id": 111515, "author": "Rob Pilkington", "author_id":...
2008/09/21
[ "https://Stackoverflow.com/questions/111461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19688/" ]