qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
47,066
<p>I am writing a C program in Linux. Commands like execv() require a path in the form of a C string. Is there a command that will return the current path in the form of a C-style string?</p>
[ { "answer_id": 47071, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 5, "selected": true, "text": "#include <unistd.h>\n\nchar *getcwd(char *buf, size_t size);\n" }, { "answer_id": 47074, "author": "Andreas ...
2008/09/05
[ "https://Stackoverflow.com/questions/47066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/159/" ]
47,078
<p>We are currently using the ExtJS tree view in an application - a requirement has arisen requiring a user to select multiple nodes (which the tree view supports currently through a pluggable selection model) - but you can not then drag the multiple selections to another part of the tree.</p> <p>Does anyone know of a...
[ { "answer_id": 3988952, "author": "Benoit", "author_id": 483194, "author_profile": "https://Stackoverflow.com/users/483194", "pm_score": 2, "selected": true, "text": "..new Ext.tree.TreePanel({\n ...\n selModel : new Ext.tree.MultiSelectionModel()\n ...\n})\n" } ]
2008/09/05
[ "https://Stackoverflow.com/questions/47078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4843/" ]
47,087
<p>Here are a few possibilities to get the conversation started:</p> <ol> <li>Escape all input upon initialization.</li> <li>Escape each value, preferably when generating the SQL.</li> </ol> <p>The first solution is suboptimal, because you then need to unescape each value if you want to use it in anything other than ...
[ { "answer_id": 47108, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": -1, "selected": false, "text": "$_GET $_POST $_COOKIE" } ]
2008/09/05
[ "https://Stackoverflow.com/questions/47087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
47,089
<p>About 6 months ago I rolled out a site where every request needed to be over https. The only way at the time I could find to ensure that every request to a page was over https was to check it in the page load event. If the request was not over http I would response.redirect("<a href="https://example.com" rel="nore...
[ { "answer_id": 47095, "author": "John Boker", "author_id": 2847, "author_profile": "https://Stackoverflow.com/users/2847", "pm_score": 9, "selected": true, "text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration>\n <system.webServer>\n <rewrite>\n <rules>...
2008/09/05
[ "https://Stackoverflow.com/questions/47089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4846/" ]
47,104
<p>Can anyone explain this behavior or how to get around it?</p> <p>If you execute this query:</p> <pre><code>select * from TblA left join freetexttable ( TblB, *, 'query' ) on TblA.ID = [Key] inner join DifferentDbCatalog.dbo.TblC on TblA.ID = TblC.TblAID </code></pre> <p>It will be very very very slow.</p> <p>If...
[ { "answer_id": 47128, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 3, "selected": false, "text": "SELECT * \nFROM TblA\nINNER JOIN DifferentDbCatalog.dbo.TblC on TblA.ID = TblC.TblAID\nLEFT JOIN freetexttable ( TblB, ...
2008/09/05
[ "https://Stackoverflow.com/questions/47104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4407/" ]
47,107
<p>Is there a way to disallow publishing of debug builds with ClickOnce?</p> <p>I only want to allow release builds through, but right now human error causes a debug build to slip through once in a while. </p> <p>We're publishing the build from within Visual Studio.</p>
[ { "answer_id": 865822, "author": "Judah Gabriel Himango", "author_id": 536, "author_profile": "https://Stackoverflow.com/users/536", "pm_score": 3, "selected": false, "text": "<Choose>\n <When Condition=\" '$(Configuration)'=='Debug' \">\n <Exec Command=\"C:\\foo.bat\" Continue...
2008/09/05
[ "https://Stackoverflow.com/questions/47107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3641/" ]
47,144
<p>In my C# program, I have a thread that represents a running test, which can be aborted by a click on a button labeled "Interrupt execution". In order for the thread (and therefore the test) to terminate in an elegant manner (and do some vital work beforehand), this button is enabled only in some well-defined moments...
[ { "answer_id": 47150, "author": "Corey", "author_id": 1595, "author_profile": "https://Stackoverflow.com/users/1595", "pm_score": 2, "selected": false, "text": "Thread.BeginCriticalRegion()\n\n//do important stuff here\n\nThread.EndCriticalRegion()\n" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4850/" ]
47,169
<p>I'd like to enable/disable some other controls based on how many items are in my <code>ListView</code> control. I can't find any event that would do this, either on the <code>ListView</code> itself or on the <code>ListViewItemCollection</code>. Maybe there's a way to generically watch any collection in C# for change...
[ { "answer_id": 47178, "author": "Kibbee", "author_id": 1862, "author_profile": "https://Stackoverflow.com/users/1862", "pm_score": 0, "selected": false, "text": "Public Class MyListViewItemCollection\n Inherits ListView.ListViewItemCollection\n\n Public Event ItemAdded(ByVal Item A...
2008/09/06
[ "https://Stackoverflow.com/questions/47169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3191/" ]
47,177
<p>I would like to monitor the following system information in Java:</p> <ul> <li>Current CPU usage** (percent)</li> <li>Available memory* (free/total)</li> <li><p>Available disk space (free/total)</p> <p>*Note that I mean overall memory available to the whole system, not just the JVM.</p></li> </ul> <p>I'm looking ...
[ { "answer_id": 47199, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 6, "selected": false, "text": "import java.lang.management.ManagementFactory;\nimport java.lang.management.OperatingSystemMXBean;\nimport java.lang.re...
2008/09/06
[ "https://Stackoverflow.com/questions/47177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783/" ]
47,198
<p>If I was going to start an open source project using Python what version should I use to ensure that the vast majority of users can use it on their system?</p> <p>I'm the kind of person who quickly jumps to the next version (which I'll do when Python 3 comes out) but many people may be more conservative if their cu...
[ { "answer_id": 47201, "author": "Matthew Schinckel", "author_id": 188, "author_profile": "https://Stackoverflow.com/users/188", "pm_score": 2, "selected": false, "text": "from __future__ import *\n" }, { "answer_id": 47264, "author": "Christopher Mahan", "author_id": 479,...
2008/09/06
[ "https://Stackoverflow.com/questions/47198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/680/" ]
47,203
<p>When should I choose one or the other? What are the implications regarding space and (full-text) indexing?</p> <p>BTW: I'm currently using SQL Server 2005 planing to upgrade to 2008 in the following months.</p> <p>Thanks</p>
[ { "answer_id": 47214, "author": "Eric Z Beard", "author_id": 1219, "author_profile": "https://Stackoverflow.com/users/1219", "pm_score": 5, "selected": true, "text": "varbinary(max) SqlParameter varbinary(max) varchar(max)" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2148/" ]
47,207
<p>Can i print out a url <code>/admin/manage/products/add</code> of a certain view in a template?</p> <p>Here is the rule i want to create a link for</p> <pre><code>(r'^manage/products/add/$', create_object, {'model': Product, 'post_save_redirect': ''}), </code></pre> <p>I would like to have /manage/products/add in ...
[ { "answer_id": 47212, "author": "Peter Hoffmann", "author_id": 720, "author_profile": "https://Stackoverflow.com/users/720", "pm_score": 2, "selected": false, "text": "{% url create_object %}\n" }, { "answer_id": 47213, "author": "Cristian", "author_id": 680, "author_...
2008/09/06
[ "https://Stackoverflow.com/questions/47207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2592/" ]
47,217
<p>I've got a DataSet in VisualStudio 2005. I need to change the datatype of a column in one of the datatables from <code>System.Int32</code> to <code>System.Decimal</code>. When I try to change the datatype in the <code>DataSet Designer</code> I receive the following error:</p> <blockquote> <p>Property value is n...
[ { "answer_id": 1905709, "author": "Are", "author_id": 231880, "author_profile": "https://Stackoverflow.com/users/231880", "pm_score": 6, "selected": true, "text": "DefaultValue <DBNull> <DBNull>" }, { "answer_id": 34353698, "author": "ldam", "author_id": 1492861, "aut...
2008/09/06
[ "https://Stackoverflow.com/questions/47217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3123/" ]
47,239
<p>Does anyone know a way to auto-generate database tables for a given class? I'm not looking for an entire persistence layer - I already have a data access solution I'm using, but I suddenly have to store a lot of information from a large number of classes and I really don't want to have to create all these tables by...
[ { "answer_id": 47251, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 1, "selected": false, "text": "CREATE TABLE MiscTypes /* may have to include standard types as well */\n ( TypeID INT,\n TypeName VARCHAR(...)\n )\n\n...
2008/09/06
[ "https://Stackoverflow.com/questions/47239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4550/" ]
47,309
<p>I'm trying to install <a href="http://godi.camlcity.org/godi/index.html" rel="noreferrer">GODI</a> on linux (Ubuntu). It's a library management tool for the ocaml language. I've actually installed this before --twice, but awhile ago-- with no issues --that I can remember-- but this time I just can't figure out what ...
[ { "answer_id": 47655, "author": "Chris Conway", "author_id": 1412, "author_profile": "https://Stackoverflow.com/users/1412", "pm_score": 2, "selected": false, "text": "which godi_confdir" }, { "answer_id": 47678, "author": "nlucaroni", "author_id": 157, "author_profil...
2008/09/06
[ "https://Stackoverflow.com/questions/47309", "https://Stackoverflow.com", "https://Stackoverflow.com/users/157/" ]
47,329
<p>I'm implementing a custom control and in this control I need to write a bunch of links to the current page, each one with a different query parameter. I need to keep existing query string intact, and add (or modify the value of ) an extra query item (eg. "page"):</p> <pre><code>"Default.aspx?page=1" "Default.aspx?...
[ { "answer_id": 47344, "author": "Glenn Slaven", "author_id": 2975, "author_profile": "https://Stackoverflow.com/users/2975", "pm_score": 2, "selected": true, "text": " /// <summary>\n /// Set a parameter value in a query string. If the parameter is not found in the passed in query ...
2008/09/06
[ "https://Stackoverflow.com/questions/47329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3263/" ]
47,338
<p>I have a problem with a sample routing with the preview 5 of asp.net mvc.</p> <p>In the AccountController I have 2 actions: </p> <pre><code>public ActionResult Delete() public ActionResult Delete(string username) </code></pre> <p>While trying to look for Account/Delete or Account/Delete?username=davide the Con...
[ { "answer_id": 49187, "author": "crucible", "author_id": 3717, "author_profile": "https://Stackoverflow.com/users/3717", "pm_score": 0, "selected": false, "text": "public ActionResult Delete(string id)\n{\n if(string.IsNullOrEmpty(id)) return EmptyID();\n\n // Continue normal Delet...
2008/09/06
[ "https://Stackoverflow.com/questions/47338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1812/" ]
47,363
<p>What is the command to list all triggers in a MySQL database?</p>
[ { "answer_id": 47364, "author": "Harry", "author_id": 4704, "author_profile": "https://Stackoverflow.com/users/4704", "pm_score": 9, "selected": true, "text": "show triggers;\n INFORMATION_SCHEMA select trigger_schema, trigger_name, action_statement\nfrom information_schema.triggers\n TR...
2008/09/06
[ "https://Stackoverflow.com/questions/47363", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4704/" ]
47,387
<p>I've been hearing about triggers, and I have a few questions.<br /> What are triggers?<br /> How do I set them up?<br /> Are there any precautions, aside from typical SQL stuff, that should be taken?</p>
[ { "answer_id": 47391, "author": "UnkwnTech", "author_id": 115, "author_profile": "https://Stackoverflow.com/users/115", "pm_score": 0, "selected": false, "text": "CREATE TRIGGER triggerName [BEFORE|AFTER] [INSERT|UPDATE|DELETE|REPLACE] ON tableName FOR EACH ROW SET stuffToDoHERE;\n" },...
2008/09/06
[ "https://Stackoverflow.com/questions/47387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115/" ]
47,400
<p>With the code, forms and data inside the same database I am wondering what are the best practices to design a suite of tests for a Microsoft Access application (say for Access 2007).</p> <p>One of the main issues with testing forms is that only a few controls have a <code>hwnd</code> handle and other controls only ...
[ { "answer_id": 70572, "author": "Philippe Grondier", "author_id": 11436, "author_profile": "https://Stackoverflow.com/users/11436", "pm_score": 4, "selected": false, "text": "AfterUpdate Private Sub myControl_AfterUpdate() \n CTLAfterUpdate myControl\n On Error Resume Next\n Ev...
2008/09/06
[ "https://Stackoverflow.com/questions/47400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3811/" ]
47,402
<p>Given an array of characters which forms a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.</p> <p>Example input and output:</p> <pre><code>&gt;&gt;&gt; reverse_words("this is a string") 'string a is this' </code></pre> <p>It should be O(N) time and O(1) spa...
[ { "answer_id": 47416, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 1, "selected": false, "text": "reverse input string\nreverse each word (you will need to find word boundaries)\n" }, { "answer_id": 47423, "author":...
2008/09/06
[ "https://Stackoverflow.com/questions/47402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4279/" ]
47,413
<p>It's common to have a table where for example the the fields are account, value, and time. What's the best design pattern for retrieving the last value for each account? Unfortunately the last keyword in a grouping gives you the last physical record in the database, not the last record by any sorting. Which means...
[ { "answer_id": 47431, "author": "Tom", "author_id": 3715, "author_profile": "https://Stackoverflow.com/users/3715", "pm_score": 2, "selected": true, "text": "select * \nfrom table \nwhere account+time in (select account+max(time) \n from table \n ...
2008/09/06
[ "https://Stackoverflow.com/questions/47413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4873/" ]
47,420
<p>I'm using the d programing language to write a program, and I'm trying to use ddbg to debug it. When there is an exception, I want to have the program break whenever there is an exception thrown so that I can inspect the stack.</p> <p>Alternatively, is there another debugger that works with d? Is there another wa...
[ { "answer_id": 47974, "author": "user4891", "author_id": 4891, "author_profile": "https://Stackoverflow.com/users/4891", "pm_score": 0, "selected": false, "text": "onex break\nonex b\n" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4891/" ]
47,427
<p>Many websites, including this one, add what are apparently called <em>slugs</em> - descriptive but as far as I can tell useless bits of text - to the end of URLs.</p> <p>For example, the URL the site gives for this question is:</p> <p><a href="https://stackoverflow.com/questions/47427/why-do-some-websites-add-slug...
[ { "answer_id": 47451, "author": "Tom", "author_id": 3715, "author_profile": "https://Stackoverflow.com/users/3715", "pm_score": 3, "selected": false, "text": "https://stackoverflow.com/questions/47427/ https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of...
2008/09/06
[ "https://Stackoverflow.com/questions/47427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3171/" ]
47,432
<p>This free collection library comes from IT University of Copenhagen.</p> <p><a href="http://www.itu.dk/research/c5/" rel="noreferrer">http://www.itu.dk/research/c5/</a></p> <p>There is a video with one of the authors on Channel 9. I am trying to learn how to use these collections and I was wondering whether anyone...
[ { "answer_id": 209387, "author": "Marcus Griep", "author_id": 28645, "author_profile": "https://Stackoverflow.com/users/28645", "pm_score": 3, "selected": false, "text": "System.Collections.Generic IList ArrayList LinkedList ArrayList LinkedList C5.IList" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4694/" ]
47,433
<p>Consider the following 2 queries:</p> <pre><code>select tblA.a,tblA.b,tblA.c,tblA.d from tblA where tblA.a not in (select tblB.a from tblB) select tblA.a,tblA.b,tblA.c,tblA.d from tblA left outer join tblB on tblA.a = tblB.a where tblB.a is null </code></pre> <p>Which will perform better? My assumption is that i...
[ { "answer_id": 57744, "author": "Martynnw", "author_id": 5466, "author_profile": "https://Stackoverflow.com/users/5466", "pm_score": 1, "selected": false, "text": "exists in" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292/" ]
47,436
<p>What is the shortcut key for <em>Run to cursor</em> in Visual Studio 2008?</p>
[ { "answer_id": 70101220, "author": "Teoman shipahi", "author_id": 929902, "author_profile": "https://Stackoverflow.com/users/929902", "pm_score": 0, "selected": false, "text": "Ctrl + Shift + P\n > Run to Cursor @command:editor.debug.action.runToCursor" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3854/" ]
47,447
<p>I am trying to create a horizontal menu with the elements represented by <code>&lt;span&gt;</code>'s. The menu itself (parent <code>&lt;div&gt;</code>) has a fixed width, but the elements number is always different.</p> <p>I would like to have child <code>&lt;span&gt;</code>'s of the same width, independently of ho...
[ { "answer_id": 47465, "author": "Xian", "author_id": 4642, "author_profile": "https://Stackoverflow.com/users/4642", "pm_score": 2, "selected": false, "text": "<div>\n<span class=\"first-in-row\">/<span><span></span><span></span><span class=\"first-in-row\"><span></span><span></span>...\...
2008/09/06
[ "https://Stackoverflow.com/questions/47447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3894/" ]
47,475
<p>If unit-test names can become outdated over time and if you consider that the test itself is the most important thing, then is it important to choose wise test names?</p> <p>ie </p> <pre><code>[Test] public void ShouldValidateUserNameIsLessThan100Characters() {} </code></pre> <p>verse </p> <pre><code>[Test] publ...
[ { "answer_id": 47477, "author": "zappan", "author_id": 4723, "author_profile": "https://Stackoverflow.com/users/4723", "pm_score": 1, "selected": false, "text": "UserNameLengthValidate()\n UserNameLengthTest()\n" }, { "answer_id": 47478, "author": "Adrian Mouat", "author_...
2008/09/06
[ "https://Stackoverflow.com/questions/47475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4642/" ]
47,483
<p>I have a user script that would be much more useful if it could dynamically change some of its execution dependent on what the user wanted. Passing simple switches would easily solve this problem but I don't see any way to do it.</p> <p>I also tried embedding a keyword in the script name, but <em>Xcode</em> copies ...
[ { "answer_id": 47619, "author": "vt.", "author_id": 3905, "author_profile": "https://Stackoverflow.com/users/3905", "pm_score": 0, "selected": false, "text": "#!/bin/bash\nresult=$( osascript << END\ntell app \"System Events\"\n set a to display dialog \"What shall be the result?\" defa...
2008/09/06
[ "https://Stackoverflow.com/questions/47483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4233/" ]
47,487
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/30170/avoiding-repeated-constants-in-css">Avoiding repeated constants in CSS</a> </p> </blockquote> <p>We have some "theme colors" that are reused in our CSS sheet.</p> <p>Is there a way to set a variable and ...
[ { "answer_id": 47505, "author": "Tim Sullivan", "author_id": 722, "author_profile": "https://Stackoverflow.com/users/722", "pm_score": 3, "selected": false, "text": "$blue: #3bbfce;\n$margin: 16px;\n\n.content-navigation {\n border-color: $blue;\n color:\n darken($blue, 9%);\n}\n\n....
2008/09/06
[ "https://Stackoverflow.com/questions/47487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4906/" ]
47,519
<p>I have a fairly standards compliant XHTML+CSS site that looks great on all browsers on PC and Mac. The other day I saw it on FF3 on Linux and the letter spacing was slightly larger, throwing everything out of whack and causing unwanted wrapping and clipping of text. The CSS in question has</p> <pre><code>font-size:...
[ { "answer_id": 47531, "author": "Dan Herbert", "author_id": 392, "author_profile": "https://Stackoverflow.com/users/392", "pm_score": 3, "selected": false, "text": "ems" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3206/" ]
47,521
<p>Here is a sample code to retrieve data from a database using the yield keyword that I found in a few place while googling around :</p> <pre><code>public IEnumerable&lt;object&gt; ExecuteSelect(string commandText) { using (IDbConnection connection = CreateConnection()) { using (IDbCommand cmd = Creat...
[ { "answer_id": 47746, "author": "Joel Gauvreau", "author_id": 4789, "author_profile": "https://Stackoverflow.com/users/4789", "pm_score": 2, "selected": false, "text": "class Program\n{\n static void Main(string[] args)\n {\n foreach (int v in getValues())\n {\n ...
2008/09/06
[ "https://Stackoverflow.com/questions/47521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4789/" ]
47,535
<p>Updating an old ASP/Access site for a client - I need SQL to add a column to an existing table and set a default value. Doesn't work - any ideas?</p> <p>This works fine</p> <pre><code>ALTER TABLE documents ADD COLUMN membersOnly NUMBER </code></pre> <p>I want this to work:</p> <pre><code>ALTER TABLE documents AD...
[ { "answer_id": 47552, "author": "zappan", "author_id": 4723, "author_profile": "https://Stackoverflow.com/users/4723", "pm_score": 4, "selected": true, "text": "ALTER TABLE documents ADD COLUMN membersOnly NUMBER DEFAULT 0\n" }, { "answer_id": 6066172, "author": "HansUp", ...
2008/09/06
[ "https://Stackoverflow.com/questions/47535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/137/" ]
47,537
<p>Does anyone know if there is a c# Console app, similar to the Python or Ruby console? I know the whole "Compiled versus Interpreted" difference, but with C#'s reflection power I think it could be done.</p> <p><strong>UPDATE</strong> Well, it only took about 200 lines, but I wrote a simple one...It works a lot like ...
[ { "answer_id": 47548, "author": "Sören Kuklau", "author_id": 1600, "author_profile": "https://Stackoverflow.com/users/1600", "pm_score": 5, "selected": true, "text": "irb" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
47,589
<p>I'm dealing with a MySQL table that defines the JobName column as UNIQUE. If somebody tries to save a new Job to the database using a JobName that is already in the database, MySQL throws a warning.</p> <p>I would like to be able to detect this warning, just like an error, in my PHP script and deal with it appropr...
[ { "answer_id": 47597, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 2, "selected": false, "text": "mysql_query() mysql_errno()" }, { "answer_id": 47606, "author": "yukondude", "author_id": 726, "author_...
2008/09/06
[ "https://Stackoverflow.com/questions/47589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2056/" ]
47,591
<p>Specifically, I am looking to use CA on properties of types other than </p> <ul> <li>integers and doubles</li> <li>CGRect, CGPoint, CGSize, and CGAffineTransform structures</li> <li>CATransform3D data structures</li> <li>CGColor and CGImage references</li> </ul> <p>and in objects other than CALayers or NSViews</p>...
[ { "answer_id": 59168, "author": "millenomi", "author_id": 6061, "author_profile": "https://Stackoverflow.com/users/6061", "pm_score": 1, "selected": false, "text": "[[someObject animator] setValue:[NSNumber numberWithFloat:1.0] forKeyPath:@\"someCustomProperty.progress\"];\n" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
47,605
<p>Assuming String a and b:</p> <pre><code>a += b a = a.concat(b) </code></pre> <p>Under the hood, are they the same thing?</p> <p>Here is concat decompiled as reference. I'd like to be able to decompile the <code>+</code> operator as well to see what that does.</p> <pre><code>public String concat(String s) { ...
[ { "answer_id": 47624, "author": "Bartosz Bierkowski", "author_id": 3666, "author_profile": "https://Stackoverflow.com/users/3666", "pm_score": 2, "selected": false, "text": "a.concat(b) + + StringBuffer + += +" }, { "answer_id": 47626, "author": "Eli Courtwright", "author...
2008/09/06
[ "https://Stackoverflow.com/questions/47605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292/" ]
47,612
<p>I've got a C# class with a <code>Dispose</code> function via <code>IDisposable</code>. It's intended to be used inside a <code>using</code> block so the expensive resource it handles can be released right away.</p> <p>The problem is that a bug occurred when an exception was thrown before <code>Dispose</code> was ca...
[ { "answer_id": 47617, "author": "Quibblesome", "author_id": 1143, "author_profile": "https://Stackoverflow.com/users/1143", "pm_score": 2, "selected": false, "text": "~ClassName()\n{\n}\n public class DisposableFinalisableClass : IDisposable\n {\n ~DisposableFinalisableClas...
2008/09/06
[ "https://Stackoverflow.com/questions/47612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3568/" ]
47,639
<p>I just noticed that Chromium was installed in AppData in both Vista and XP. If Google does that and if other applications does this, than is that becuase there is some form of protection? Should we write installers that does the same thing as Google?</p>
[ { "answer_id": 47649, "author": "Sören Kuklau", "author_id": 1600, "author_profile": "https://Stackoverflow.com/users/1600", "pm_score": 5, "selected": true, "text": "%PROGRAMFILES% %USERPROFILE%\\Local Settings\\Apps %USERPROFILE%\\AppData\\Roaming ~/Applications" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370899/" ]
47,656
<p>I would like to do full-text searching of data in my Ruby on Rails application. What options exist?</p>
[ { "answer_id": 47680, "author": "sock", "author_id": 4028, "author_profile": "https://Stackoverflow.com/users/4028", "pm_score": 5, "selected": true, "text": "acts_as_tsearch acts_as_solr acts_as_ferret acts_as_xapian" }, { "answer_id": 59523303, "author": "Joshua Pinter", ...
2008/09/06
[ "https://Stackoverflow.com/questions/47656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4028/" ]
47,658
<p>I am writing a coding standards document for a team of about 15 developers with a project load of between 10 and 15 projects a year. Amongst other sections (which I may post here as I get to them) I am writing a section on code formatting. So to start with, I think it is wise that, for whatever reason, we establish ...
[ { "answer_id": 48121, "author": "Adam Davis", "author_id": 2915, "author_profile": "https://Stackoverflow.com/users/2915", "pm_score": 2, "selected": false, "text": "if(...)\n{\n\n}\n while(stillwaiting())\n{\n ;\n}\n" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4910/" ]
47,676
<p>The Weblogic servers we are using have been configured to allow JNDI datasource names like "appds".</p> <p>For development (localhost), we might be running Tomcat and when declared in the &lt;context&gt; section of server.xml, Tomcat will hang JNDI datasources on "java:comp/env/jdbc/*" in the JNDI tree.</p> <p><st...
[ { "answer_id": 50552, "author": "Binil Thomas", "author_id": 3973, "author_profile": "https://Stackoverflow.com/users/3973", "pm_score": 0, "selected": false, "text": "WEB-INF/classes/application.properties /etc/sysenv ${ds.jndi} PropertyPlaceholderConfigurer classpath:application.proper...
2008/09/06
[ "https://Stackoverflow.com/questions/47676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4910/" ]
47,683
<p>We have a Java listener that reads text messages off of a queue in JBossMQ. If we have to reboot JBoss, the listener will not reconnect and start reading messages again. We just get messages in the listener's log file every 2 minutes saying it can't connect. Is there something we're not setting in our code or in JBo...
[ { "answer_id": 47963, "author": "Todd", "author_id": 3803, "author_profile": "https://Stackoverflow.com/users/3803", "pm_score": 4, "selected": true, "text": " public void onException (JMSException jsme)\n {\n if (!closeRequested)\n {\n this.disconnect();\n...
2008/09/06
[ "https://Stackoverflow.com/questions/47683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3098/" ]
47,701
<p>I'm trying to debug a deadlock in a multi-threaded Python application after it has locked up. Is there a way to attach a debugger to inspect the state of the process? </p> <p>Edit: I'm attempting this on Linux, but it would be great if there were a cross-platform solution. It's Python after all :)</p>
[ { "answer_id": 56510, "author": "asksol", "author_id": 5577, "author_profile": "https://Stackoverflow.com/users/5577", "pm_score": 5, "selected": true, "text": "(gdb) thr 2\n[Switching to thread 2 (process 6159 thread 0x3f1b)]\n(gdb) backtrace\n....\n" }, { "answer_id": 550795, ...
2008/09/06
[ "https://Stackoverflow.com/questions/47701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
47,709
<p>When you print from Google Docs (using the "print" link, not File/Print) you end up printing a nicely formated PDF file instead of relying on the print engine of the browser. Same is true for some of the reports in Google Analytics . . . the printed reports as PDF's are beautiful. How do they do that? I can't ima...
[ { "answer_id": 88919, "author": "Brian", "author_id": 700, "author_profile": "https://Stackoverflow.com/users/700", "pm_score": 1, "selected": false, "text": "<pd4ml:transform>\n<!-- Your HTML is here -->\n\n<c:import url=\"/page.html\" />\n</pd4ml:transform>\n" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4835/" ]
47,749
<p>A while ago I read the <a href="http://www.martinfowler.com/articles/mocksArentStubs.html" rel="nofollow noreferrer">Mocks Aren't Stubs</a> article by Martin Fowler and I must admit I'm a bit scared of external dependencies with regards to added complexity so I would like to ask:</p> <p>What is the best method to u...
[ { "answer_id": 47787, "author": "Toran Billups", "author_id": 2701, "author_profile": "https://Stackoverflow.com/users/2701", "pm_score": 2, "selected": false, "text": "<TestMethod()> _\nPublic Sub Should_Populate_Products_List_OnViewLoad_When_PostBack_Is_False()\n mMockery = New Mock...
2008/09/06
[ "https://Stackoverflow.com/questions/47749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1324220/" ]
47,752
<p>Anyone have a quick method for de-duplicating a generic List in C#?</p>
[ { "answer_id": 47755, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 6, "selected": false, "text": "list.Sort();\nInt32 index = list.Count - 1;\nwhile (index > 0)\n{\n if (list[index] == list[index - 1])\n {\n ...
2008/09/06
[ "https://Stackoverflow.com/questions/47752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4541/" ]
47,762
<p>I have a webapp development problem that I've developed one solution for, but am trying to find other ideas that might get around some performance issues I'm seeing.</p> <p>problem statement: </p> <ul> <li>a user enters several keywords/tokens</li> <li>the application searches for matches to the tokens</li> <li>ne...
[ { "answer_id": 47796, "author": "Robin Barnes", "author_id": 1349865, "author_profile": "https://Stackoverflow.com/users/1349865", "pm_score": 4, "selected": true, "text": "SELECT * FROM `entries` \nWHERE token like \"%x%\" union all \n SELECT * FROM `entries` \n WHERE token like \...
2008/09/06
[ "https://Stackoverflow.com/questions/47762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4418/" ]
47,780
<p>I have an inherited project that uses a build script (not make) to build and link the project with various libraries.</p> <p>When it performs a build I would like to parse the build output to determine what and where the actual static libraries being linked into the final executable are and where are they coming fr...
[ { "answer_id": 47809, "author": "Ben Collins", "author_id": 3279, "author_profile": "https://Stackoverflow.com/users/3279", "pm_score": 1, "selected": false, "text": "nm #!/bin/sh\n\nnm -Ag $* | sed 's/^.*\\/\\(.*\\.a\\):/\\1/' | sort -k 3 | grep -v ' U '\n" } ]
2008/09/06
[ "https://Stackoverflow.com/questions/47780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/445087/" ]
47,786
<p>Simple one really. In SQL, if I want to search a text field for a couple of characters, I can do:</p> <pre><code>SELECT blah FROM blah WHERE blah LIKE '%text%' </code></pre> <p>The documentation for App Engine makes no mention of how to achieve this, but surely it's a common enough problem?</p>
[ { "answer_id": 47811, "author": "David Webb", "author_id": 3171, "author_profile": "https://Stackoverflow.com/users/3171", "pm_score": 7, "selected": true, "text": "= > < != > < index.yaml LIKE" }, { "answer_id": 1096744, "author": "Community", "author_id": -1, "autho...
2008/09/06
[ "https://Stackoverflow.com/questions/47786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/366/" ]
47,789
<p>When should you use generator expressions and when should you use list comprehensions in Python?</p> <pre><code># Generator expression (x*2 for x in range(256)) # List comprehension [x*2 for x in range(256)] </code></pre>
[ { "answer_id": 47826, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 9, "selected": true, "text": "def gen():\n return (something for something in get_some_stuff())\n\nprint gen()[:2] # generators don't support...
2008/09/06
[ "https://Stackoverflow.com/questions/47789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
47,817
<p>Html Textarea elements only wrap when they reach a space or tab character. This is fine, until the user types a looooooooooooooooooooooong enough word. I'm looking for a way to strictly enforce line breaks (eg.: even if it results in "loooooooooooo \n ooooooooooong").</p> <p><img src="https://i.stack.imgur.com/sUmH...
[ { "answer_id": 47866, "author": "Sören Kuklau", "author_id": 1600, "author_profile": "https://Stackoverflow.com/users/1600", "pm_score": 3, "selected": false, "text": "word-wrap: break-word" }, { "answer_id": 604928, "author": "Kim Reece", "author_id": 1911072, "autho...
2008/09/06
[ "https://Stackoverflow.com/questions/47817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4939/" ]
47,824
<p>Using core jQuery, how do you remove all the options of a select box, then add one option and select it?</p> <p>My select box is the following.</p> <pre><code>&lt;Select id="mySelect" size="9"&gt; &lt;/Select&gt; </code></pre> <p>EDIT: The following code was helpful with chaining. However, (in Internet&nbsp;Explo...
[ { "answer_id": 47829, "author": "Matt", "author_id": 2338, "author_profile": "https://Stackoverflow.com/users/2338", "pm_score": 12, "selected": true, "text": "$('#mySelect')\n .find('option')\n .remove()\n .end()\n .append('<option value=\"whatever\">text</option>')\n .va...
2008/09/06
[ "https://Stackoverflow.com/questions/47824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2755/" ]
47,827
<p>At work, we have a dedicated SEO Analyst who's job is to pour over lots of data (KeyNote/Compete etc) and generate up fancy reports for the executives so they can see how we are doing against our competitors in organic search ranking. He also leads initiatives to improve the SEO rankings on our sites by optimizing t...
[ { "answer_id": 47834, "author": "Brian Lyttle", "author_id": 636, "author_profile": "https://Stackoverflow.com/users/636", "pm_score": 3, "selected": false, "text": "<p class=\"headerOne\">Header 1</" }, { "answer_id": 30213963, "author": "East End", "author_id": 4887099,...
2008/09/06
[ "https://Stackoverflow.com/questions/47827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
47,833
<p>I know you can look at the row.count or tables.count, but are there other ways to tell if a dataset is empty?</p>
[ { "answer_id": 47841, "author": "ljs", "author_id": 3394, "author_profile": "https://Stackoverflow.com/users/3394", "pm_score": 5, "selected": true, "text": " bool nonEmptyDataSet = dataSet != null && \n (from DataTable t in dataSet.Tables where t.Rows.Count > 0 select t).Any();\n pu...
2008/09/06
[ "https://Stackoverflow.com/questions/47833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/445815/" ]
47,837
<p>I'm struggling to find the right terminology here, but if you have jQuery object...</p> <pre><code>$('#MyObject') </code></pre> <p>...is it possible to extract the base element? Meaning, the equivalent of this:</p> <pre><code>document.getElementById('MyObject') </code></pre>
[ { "answer_id": 47844, "author": "VolkerK", "author_id": 4833, "author_profile": "https://Stackoverflow.com/users/4833", "pm_score": 7, "selected": true, "text": ".get(index) .get()" }, { "answer_id": 47848, "author": "Aaron Wagner", "author_id": 3909, "author_profile"...
2008/09/06
[ "https://Stackoverflow.com/questions/47837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1923/" ]
47,838
<p>I have wondered about the appropriateness of reflection in C# code. For example I have written a function which iterates through the properties of a given source object and creates a new instance of a specified type, then copies the values of properties with the same name from one to the other. I created this to cop...
[ { "answer_id": 48223, "author": "Omer van Kloeten", "author_id": 4979, "author_profile": "https://Stackoverflow.com/users/4979", "pm_score": 1, "selected": false, "text": "static class AtoBCopier\n{\n public static B Copy(A item)\n {\n return new B() { Prop1 = item.Prop1, Pr...
2008/09/06
[ "https://Stackoverflow.com/questions/47838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3394/" ]
47,845
<p>I've heard that creating a new process on a Windows box is more expensive than on Linux. Is this true? Can somebody explain the technical reasons for why it's more expensive and provide any historical reasons for the design decisions behind those reasons?</p>
[ { "answer_id": 47964, "author": "mweerden", "author_id": 4285, "author_profile": "https://Stackoverflow.com/users/4285", "pm_score": 4, "selected": false, "text": "fork" }, { "answer_id": 67293, "author": "Chris Smith", "author_id": 9073, "author_profile": "https://St...
2008/09/06
[ "https://Stackoverflow.com/questions/47845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
47,849
<p>I'm trying to refer to a drive whose letter may change. I'd like to refer to it by its label (e.g., MyLabel (v:) within a Batch File. It can be referred to by V:\ . I'd like to refer to it by MyLabel.</p> <p>(This was posted on Experts Echange for a month with no answer. Let's see how fast SO answers it )</p>
[ { "answer_id": 47856, "author": "VolkerK", "author_id": 4833, "author_profile": "https://Stackoverflow.com/users/4833", "pm_score": 1, "selected": false, "text": "SELECT * FROM Win32_LogicalDisk WHERE VolumeName=\"MyLabel\"" }, { "answer_id": 47860, "author": "Rob Walker", ...
2008/09/06
[ "https://Stackoverflow.com/questions/47849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4906/" ]
47,862
<p>I'm loading a <strong><em>SQL Server 2000</em></strong> database into my new <strong><em>SQL Server 2005</em></strong> <strong><em>instance</em></strong>. <strong><em>As expected, the full-text catalogs don't come with it.</strong> <strong>How can I rebuild them?</em></strong></p> <p>Right-clicking my full text cat...
[ { "answer_id": 47900, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 2, "selected": true, "text": "--Change to accent insensitive\nUSE AdventureWorks;\nGO\nALTER FULLTEXT CATALOG ftCatalog \nREBUILD WITH ACCENT_SENSITIV...
2008/09/06
[ "https://Stackoverflow.com/questions/47862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590/" ]
47,864
<p>ValidateEvents is a great ASP.net function, but the Yellow Screen of Death is not so nice. I found a way how to handle the HttpRequestValidationException gracefully <a href="http://www.romsteady.net/blog/2007/06/how-to-catch-httprequestvalidationexcep.html" rel="nofollow noreferrer">here</a>, but that does not work...
[ { "answer_id": 50671, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 3, "selected": true, "text": "<script type=\"text/javascript\" language=\"javascript\">\nvar prm = Sys.WebForms.PageRequestManager.getInstance();\nprm.add_...
2008/09/06
[ "https://Stackoverflow.com/questions/47864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91/" ]
47,882
<p>What is a magic number?</p> <p>Why should it be avoided?</p> <p>Are there cases where it's appropriate?</p>
[ { "answer_id": 47890, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 7, "selected": false, "text": "SELECT TOP 50 * FROM orders for (i = 0; i < 50; i++) Session.Timeout = 50 if a < 50 then bla const int NumOrdersToDisplay = ...
2008/09/06
[ "https://Stackoverflow.com/questions/47882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2915/" ]
47,883
<p>I'm trying to install 'quadrupel', a library that relies on ffmpeg on Solaris x86.</p> <p>I managed to build ffmpeg and its libraries live in /opt/gnu/lib and the includes are in /opt/gnu/include but when I try to build quadrupel, it can't find the ffmpeg headers.</p> <p>What flags/configuration is required to inc...
[ { "answer_id": 47913, "author": "stimms", "author_id": 361, "author_profile": "https://Stackoverflow.com/users/361", "pm_score": 2, "selected": true, "text": "crle -l -c /var/ld/ld.config -l /usr/lib:/usr/local/lib:/opt/gnu/lib\n" }, { "answer_id": 47916, "author": "DGentry",...
2008/09/06
[ "https://Stackoverflow.com/questions/47883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/555/" ]
47,884
<p>I simply wondered whether people thought it was worth learning to use the MSBuild syntax in order to customise the build process for a .net project, or whether it is really not worth it given the ease with which one can build a project using visual studio. </p> <p>I am thinking in terms of nightly builds, etc., but...
[ { "answer_id": 108691, "author": "Jay Bazuzi", "author_id": 5314, "author_profile": "https://Stackoverflow.com/users/5314", "pm_score": 1, "selected": false, "text": "msbuild /?" }, { "answer_id": 14589196, "author": "yantaq", "author_id": 554060, "author_profile": "h...
2008/09/06
[ "https://Stackoverflow.com/questions/47884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3394/" ]
47,886
<p>We have an SEO team at my office, and one of their dictums is that having lots of &lt;script&gt; blocks inline with the HTML is apocalypticly bad. As a developer that makes no sense to me at all. Surely the Google search engineers, who are the smartest people on the planet, know how to skip over such blocks? <br /> ...
[ { "answer_id": 14243630, "author": "Michael Thamm", "author_id": 1964121, "author_profile": "https://Stackoverflow.com/users/1964121", "pm_score": 0, "selected": false, "text": "<p>" }, { "answer_id": 21980464, "author": "Swift Computers", "author_id": 3167778, "autho...
2008/09/06
[ "https://Stackoverflow.com/questions/47886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2757/" ]
47,919
<p>I'm used to doing all my coding in one C file. However, I'm working on a project large enough that it becomes impractical to do so. I've been #including them together but I've run into cases where I'm #including some files multiple times, etc. I've heard of .h files, but I'm not sure what their function is (or why h...
[ { "answer_id": 47928, "author": "Andrew", "author_id": 826, "author_profile": "https://Stackoverflow.com/users/826", "pm_score": 3, "selected": false, "text": "#ifndef ACCOUNTS_H\n#define ACCOUNTS_H\n....\n#endif\n" }, { "answer_id": 47955, "author": "smh", "author_id": 1...
2008/09/06
[ "https://Stackoverflow.com/questions/47919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658/" ]
47,941
<p>I'm trying to upload an application to the iPhone App Store, but I get this error message from iTunes Connect:</p> <blockquote> <p>The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate.</p> </blockquote> <hr> <p>Note: The details of original qu...
[ { "answer_id": 956502, "author": "Eddie", "author_id": 118089, "author_profile": "https://Stackoverflow.com/users/118089", "pm_score": 4, "selected": false, "text": "C384C90C0F9939FA00E76E41 /* Distribution */ = {\nisa = XCBuildConfiguration;\nbuildSettings = {\nARCHS = \"$(ARCHS_STANDAR...
2008/09/06
[ "https://Stackoverflow.com/questions/47941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175/" ]
47,960
<p>What are the best code snippets for C#? (using visual studio) VB has a lot that are pre-defined, but there are only a handful for C#. Do you have any really useful ones for C#?</p> <p>Anyone want to post a good custom one you created yourself?</p> <p><a href="http://en.wikipedia.org/wiki/Ferris_Bueller" rel="nor...
[ { "answer_id": 1053225, "author": "Dario", "author_id": 105459, "author_profile": "https://Stackoverflow.com/users/105459", "pm_score": 3, "selected": false, "text": "cw" }, { "answer_id": 1053276, "author": "Mark Seemann", "author_id": 126014, "author_profile": "http...
2008/09/06
[ "https://Stackoverflow.com/questions/47960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1874/" ]
47,972
<p>I'm researching and experimenting more with Groovy and I'm trying to wrap my mind around the pros and cons of implementing things in Groovy that I can't/don't do in Java. Dynamic programming is still just a concept to me since I've been deeply steeped static and strongly typed languages. </p> <p>Groovy gives me t...
[ { "answer_id": 250119, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 4, "selected": false, "text": "class SimpleResults {\n def results\n def total\n def categories\n}\n results Map<String, List<ComplexType>> tot...
2008/09/07
[ "https://Stackoverflow.com/questions/47972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3030/" ]
47,975
<p>More out of interest than anything else, but can you compile a DirectX app under linux?</p> <p>Obviously there's no official SDK, but I was thinking it might be possible with wine.</p> <p>Presumably wine has an implementation of the DirectX interface in order to run games? Is it possible to link against that? (edi...
[ { "answer_id": 70695, "author": "Nick", "author_id": 4949, "author_profile": "https://Stackoverflow.com/users/4949", "pm_score": 4, "selected": true, "text": "wineg++ -ld3d9 -ld3dx9 triangle.cpp\n" }, { "answer_id": 15586569, "author": "Guest1337", "author_id": 2202177, ...
2008/09/07
[ "https://Stackoverflow.com/questions/47975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4949/" ]
47,980
<p>I'm really beginning to understand what people mean when they say that C++'s error messages are pretty terrible in regards to templates. I've seen horrendously long errors for things as simple as a function not matching its prototype.</p> <p>Are there any tricks to deciphering these errors?</p> <p>EDIT: I'm usin...
[ { "answer_id": 48263, "author": "Motti", "author_id": 3848, "author_profile": "https://Stackoverflow.com/users/3848", "pm_score": 3, "selected": false, "text": "s/std::basic_string<char,std::char_traits<char>,std::allocator<char>>/string/g \n std::basic_string<char,std::char_traits<char>...
2008/09/07
[ "https://Stackoverflow.com/questions/47980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
47,981
<p>How do I set, clear, and toggle a bit?</p>
[ { "answer_id": 47990, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 13, "selected": true, "text": "| number |= 1UL << n;\n n number n 1 n-1 n 1ULL number unsigned long 1UL << n 1UL << n long & number &= ~(1UL << n);\n n nu...
2008/09/07
[ "https://Stackoverflow.com/questions/47981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/445087/" ]
48,006
<p>Right up front: I do <em>not</em> want to start a religious war.</p> <p>I've used <em>vi</em> for as long as I can remember, and the few times I've tried to pick up <em>Emacs</em> I've been so lost that I've quickly given up. Lots of people find Emacs very powerful, however. Its programmability is somewhat legendar...
[ { "answer_id": 71397, "author": "Aristotle Pagaltzis", "author_id": 9410, "author_profile": "https://Stackoverflow.com/users/9410", "pm_score": 5, "selected": false, "text": ".vimrc" }, { "answer_id": 977462, "author": "dbr", "author_id": 745, "author_profile": "https...
2008/09/07
[ "https://Stackoverflow.com/questions/48006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/826/" ]
48,009
<p>What are the performance, security, or "other" implications of using the following form to declare a new class instance in PHP</p> <pre><code>&lt;?php $class_name = 'SomeClassName'; $object = new $class_name; ?&gt; </code></pre> <p>This is a contrived example, but I've seen this form used in Factories (OOP) to...
[ { "answer_id": 48035, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 3, "selected": false, "text": "<?php\n\nclass Test {\n function __construct($x) {\n echo $x;\n }\n}\n\n$class = 'Test';\n$object = new $class...
2008/09/07
[ "https://Stackoverflow.com/questions/48009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4668/" ]
48,017
<p>Can someone explain the mechanics of a jump table and why is would be needed in embedded systems?</p>
[ { "answer_id": 48033, "author": "Adam Davis", "author_id": 2915, "author_profile": "https://Stackoverflow.com/users/2915", "pm_score": 5, "selected": false, "text": "MyJump(int c)\n{\n switch(state)\n {\n case 0:\n goto func0label;\n case 1:\n goto func1labe...
2008/09/07
[ "https://Stackoverflow.com/questions/48017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/445087/" ]
48,053
<p>I read somewhere once that the modulus operator is inefficient on small embedded devices like 8 bit micro-controllers that do not have integer division instruction. Perhaps someone can confirm this but I thought the difference is 5-10 time slower than with an integer division operation.</p> <p>Is there another way ...
[ { "answer_id": 48058, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 1, "selected": false, "text": "& | >>" }, { "answer_id": 48075, "author": "Matt Sheppard", "author_id": 797, "author_profile": "htt...
2008/09/07
[ "https://Stackoverflow.com/questions/48053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/445087/" ]
48,070
<p>We are trying to lighten our page load as much as possible. Since ViewState can sometimes swell up to 100k of the page, I'd love to completely eliminate it.</p> <p>I'd love to hear some techniques other people have used to move ViewState to a custom provider.</p> <p>That said, a few caveats:</p> <ul> <li>We serve...
[ { "answer_id": 48133, "author": "Mike", "author_id": 1573, "author_profile": "https://Stackoverflow.com/users/1573", "pm_score": 3, "selected": false, "text": " protected override PageStatePersister PageStatePersister {\n get { return new SessionPageStatePersister(this); }\n ...
2008/09/07
[ "https://Stackoverflow.com/questions/48070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
48,087
<p>I need a quick algorithm to select 5 random elements from a generic list. For example, I'd like to get 5 random elements from a <code>List&lt;string&gt;</code>.</p>
[ { "answer_id": 48114, "author": "Tyler", "author_id": 3561, "author_profile": "https://Stackoverflow.com/users/3561", "pm_score": 5, "selected": false, "text": "# Returns a container s with k distinct random numbers from {0, 1, ..., n-1}\ndef ChooseRandomSubset(n, k):\n for i in range(k...
2008/09/07
[ "https://Stackoverflow.com/questions/48087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4541/" ]
48,088
<p>I was surprised recently to find that it's possible to have a return statement in a finally block in Java.</p> <p>It seems like lots of people think it's a bad thing to do as described in '<a href="https://web.archive.org/web/20070922061412/http://weblogs.java.net/blog/staufferjames/archive/2007/06/_dont_return_in....
[ { "answer_id": 48740, "author": "John Meagher", "author_id": 3535, "author_profile": "https://Stackoverflow.com/users/3535", "pm_score": 7, "selected": false, "text": "Object problemMethod() {\n Object rtn = null;\n try {\n rtn = somethingThatThrewAnException();\n }\n ...
2008/09/07
[ "https://Stackoverflow.com/questions/48088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/797/" ]
48,094
<p>So I have a pointer to an array of pointers. If I delete it like this:</p> <pre><code>delete [] PointerToPointers; </code></pre> <p>Will that delete all the pointed to pointers as well? If not, do I have to loop over all of the pointers and delete them as well, or is there an easier way to do it? My google-fu d...
[ { "answer_id": 48670, "author": "Ray", "author_id": 456786, "author_profile": "https://Stackoverflow.com/users/456786", "pm_score": 4, "selected": false, "text": "int main()\n{\n int *pI = new int;\n int *pArr = new int[10];\n delete pI;\n delete [] pArr;\n int ppArr = new int *[1...
2008/09/07
[ "https://Stackoverflow.com/questions/48094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
48,115
<p>I'm using an Ubuntu 8.04 (x86_64) machine to connect to my employer's Cisco VPN. (The client didn't compile out of the box, but I found <a href="http://projects.tuxx-home.at/?id=cisco_vpn_client" rel="nofollow noreferrer">patches to update the client to compile on kernels released in the last two years</a>.) This al...
[ { "answer_id": 48130, "author": "Sean", "author_id": 4919, "author_profile": "https://Stackoverflow.com/users/4919", "pm_score": 3, "selected": false, "text": "sudo apt-get install resolvconf sudo apt-get remove resolvconf vpn resolv.conf" }, { "answer_id": 202040, "author": ...
2008/09/07
[ "https://Stackoverflow.com/questions/48115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4659/" ]
48,123
<p>I've been learning python for a while now with some success. I even managed to create one or two (simple) programs using PyGtk + Glade.</p> <p>The thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.</p> <p>I was wondering if the more experienced ones among us (...
[ { "answer_id": 524614, "author": "Bruce van der Kooij", "author_id": 63736, "author_profile": "https://Stackoverflow.com/users/63736", "pm_score": 2, "selected": false, "text": "container = gtk.HBox()\nlabel = gtk.Label(str=\"test\")\ncontainer.add(label)\n" } ]
2008/09/07
[ "https://Stackoverflow.com/questions/48123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/802/" ]
48,124
<p>How can I generate a (pseudo)random alpha-numeric string, something like: 'd79jd8c' in PHP?</p>
[ { "answer_id": 48125, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 8, "selected": true, "text": " $characters = 'abcdefghijklmnopqrstuvwxyz0123456789';\n $characters $string = '';\n $max = strlen($characters) - 1;\n for ...
2008/09/07
[ "https://Stackoverflow.com/questions/48124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115/" ]
48,126
<p>Documentation is severely lacking on anything to do with stored procedures in mysql with PHP. I currently have a stored procedure that I call via PHP, how can I get the value of an out parameter?</p>
[ { "answer_id": 48161, "author": "John Boker", "author_id": 2847, "author_profile": "https://Stackoverflow.com/users/2847", "pm_score": 5, "selected": true, "text": "$mysqli = new mysqli( \"HOST\", \"USR\", \"PWD\", \"DBNAME\" );\n$ivalue=1;\n$res = $mysqli->multi_query( \"CALL myproc($i...
2008/09/07
[ "https://Stackoverflow.com/questions/48126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
48,176
<p>You can embed the <a href="http://ipython.scipy.org/" rel="noreferrer">IPython</a> shell inside of your application so that it launches the shell in the foreground. Is there a way to embed a telnet server in a python app so that you can telnet to a certain port and launch a remote IPython shell? </p> <p>Any tips ...
[ { "answer_id": 48266, "author": "David Webb", "author_id": 3171, "author_profile": "https://Stackoverflow.com/users/3171", "pm_score": 0, "selected": false, "text": "SocketServer RequestHandler ThreadingMixIn" } ]
2008/09/07
[ "https://Stackoverflow.com/questions/48176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
48,198
<p>How do I find out which process is listening on a TCP or UDP port on Windows?</p>
[ { "answer_id": 48199, "author": "Brad Wilson", "author_id": 1554, "author_profile": "https://Stackoverflow.com/users/1554", "pm_score": 13, "selected": true, "text": "Get-Process -Id (Get-NetTCPConnection -LocalPort YourPortNumberHere).OwningProcess\n Get-Process -Id (Get-NetUDPEndpoint ...
2008/09/07
[ "https://Stackoverflow.com/questions/48198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
48,203
<p>Simply, are there any Java Developer specific Linux distros?</p>
[ { "answer_id": 698093, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": false, "text": "[package manager command to install] jdk\n // begin hypocritical personal recomendation\n // end hypocritical personal recomen...
2008/09/07
[ "https://Stackoverflow.com/questions/48203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4857/" ]
48,224
<p>I need to automate a process involving a website that is using a login form. I need to capture some data in the pages following the login page.</p> <p>I know how to screen-scrape normal pages, but not those behind a secure site.</p> <ol> <li>Can this be done with the .NET WebClient class? <ul> <li>How would I au...
[ { "answer_id": 48228, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 1, "selected": false, "text": "<form name=\"loginForm\" method=\"post\" Action=\"target_page.html\">\n <input type=\"Text\" name=\"Username\">\n <input type...
2008/09/07
[ "https://Stackoverflow.com/questions/48224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1583/" ]
48,225
<p>I want to put songs on a web page and have a little play button, like you can see on Last.fm or Pandora. There can be multiple songs listed on the site, and if you start playing a different song with one already playing, it will pause the first track and begin playing the one you just clicked on. I think they use Fl...
[ { "answer_id": 48231, "author": "Sean", "author_id": 4919, "author_profile": "https://Stackoverflow.com/users/4919", "pm_score": 1, "selected": false, "text": "flash mp3 player" }, { "answer_id": 48368, "author": "UnkwnTech", "author_id": 115, "author_profile": "https...
2008/09/07
[ "https://Stackoverflow.com/questions/48225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432/" ]
48,235
<p>I really enjoy Chrome, and the sheer exercise of helping a port would boost my knowledge-base.</p> <p>Where do I start?</p> <p>What are the fundamental similarities and differences between the code which will operated under Windows and Linux?</p> <p>What skills and software do I need?</p> <hr /> <h3>Note:</h3> <p>Th...
[ { "answer_id": 48236, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 3, "selected": false, "text": "$ sudo apt-get install subversion pkg-config python perl g++ bison flex gperf libnss3-dev\n" }, { "answer_id": 692397, ...
2008/09/07
[ "https://Stackoverflow.com/questions/48235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4857/" ]
48,239
<p>Is there any way to get the ID of the element that fires an event?</p> <p>I'm thinking something like:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready...
[ { "answer_id": 48242, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 6, "selected": false, "text": "(this) 'this'" }, { "answer_id": 48684, "author": "samjudson", "author_id": 1908, "author_profile": "https:/...
2008/09/07
[ "https://Stackoverflow.com/questions/48239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1090/" ]
48,240
<p>I am working with an API that provides bus arrival data. For every request, I get back (among other things) a list of which routes serve the stop in question. For example, if the list includes result for bus route #1, 2, and 5, then I know that those serve this stop.</p> <p>I have a many-to-many relationship set up...
[ { "answer_id": 48529, "author": "Can Berk Güder", "author_id": 2119, "author_profile": "https://Stackoverflow.com/users/2119", "pm_score": 1, "selected": false, "text": "class Route < ActiveRecord::Base\n has_and_belongs_to_many :stops\n belongs_to :stop, :foreign_key => 'destination_i...
2008/09/07
[ "https://Stackoverflow.com/questions/48240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124/" ]
48,249
<p>Is there a way to embed a browser in Java? more specifically, is there a library that can emulate a browser?</p>
[ { "answer_id": 10381446, "author": "11684", "author_id": 1087848, "author_profile": "https://Stackoverflow.com/users/1087848", "pm_score": 1, "selected": false, "text": "JEditorPane EditorKit" } ]
2008/09/07
[ "https://Stackoverflow.com/questions/48249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4857/" ]
48,253
<p>I know PHP scripts don't actually compile until they are run. However, say I want to create a small simple program and compile it to a binary without requiring the PHP binary. How could I do this?</p> <p>I've seen a few IDE's out there that would do this, but either they are all for windows or the Linux versions do...
[ { "answer_id": 48264, "author": "UnkwnTech", "author_id": 115, "author_profile": "https://Stackoverflow.com/users/115", "pm_score": 2, "selected": false, "text": "#!/usr/bin/php\n" } ]
2008/09/07
[ "https://Stackoverflow.com/questions/48253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4985/" ]
48,278
<p>I am using the webbrowser control in winforms and discovered now that background images which I apply with css are not included in the printouts.</p> <p>Is there a way to make the webbrowser print the background of the displayed document too?</p> <p>Edit: Since I wanted to do this programatically, I opted for this...
[ { "answer_id": 48292, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 0, "selected": false, "text": "* File > Page Setup > Check Off \"Print Background\"\n* File > Print Preview\n * Tools > Internet Options > Advanced > Printing\...
2008/09/07
[ "https://Stackoverflow.com/questions/48278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4582/" ]
48,288
<p>I've been trying to understand <a href="http://msdn.microsoft.com/en-gb/library/system.diagnostics.process.mainwindowhandle.aspx" rel="nofollow noreferrer">Process.MainWindowHandle</a>.</p> <p>According to MSDN; "The main window is the window that is created when the process is started. After initialization, other ...
[ { "answer_id": 48318, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 5, "selected": true, "text": "private bool IsMainWindow(IntPtr handle)\n{\n return (!(NativeMethods.GetWindow(new HandleRef(this, handle), 4) != IntPtr.Zero)...
2008/09/07
[ "https://Stackoverflow.com/questions/48288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4200/" ]
48,307
<p>I would like to know how people implement the following data structures in C# without using the base class library implementations:-</p> <ul> <li>Linked List</li> <li>Hash Table</li> <li>Binary Search Tree</li> <li>Red-Black Tree</li> <li>B-Tree</li> <li>Binomial Heap</li> <li>Fibonacci Heap</li> </ul> <p>and any ...
[ { "answer_id": 48319, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 3, "selected": false, "text": "Vector List<T>" }, { "answer_id": 48464, "author": "FlySwat", "author_id": 1965, "author_profile":...
2008/09/07
[ "https://Stackoverflow.com/questions/48307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3394/" ]
48,340
<p>i have a wcf service that does an operation. and in this operation there could be a fault. i have stated that there could be a fault in my service contract. </p> <p>here is the code below;</p> <pre><code>public void Foo() { try { DoSomething(); // throws FaultException&lt;FooFault&gt; ...
[ { "answer_id": 284215, "author": "Serhat Ozgel", "author_id": 31505, "author_profile": "https://Stackoverflow.com/users/31505", "pm_score": 1, "selected": false, "text": "throw;\n" }, { "answer_id": 295188, "author": "Jonathan C Dickinson", "author_id": 24064, "author...
2008/09/07
[ "https://Stackoverflow.com/questions/48340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4215/" ]
48,356
<p>Greetings, I'm trying to find a way to 'unbind' a socket from a particular IP/Port combination. My pseudocode looks like this:</p> <pre><code>ClassA a = new ClassA(); //(class A instantiates socket and binds it to 127.0.0.1:4567) //do something //...much later, a has been garbage-collected away. ClassA aa = ne...
[ { "answer_id": 48362, "author": "David Schmitt", "author_id": 4918, "author_profile": "https://Stackoverflow.com/users/4918", "pm_score": 0, "selected": false, "text": "Socket.Close() using (ClassA a = new ClassA()) \n{\n // code goes here\n}\n// 'a' is now disposed and the socket is ...
2008/09/07
[ "https://Stackoverflow.com/questions/48356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5021/" ]