qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
148,982
<p>I have a function that passes an array to another function as an argument, there will be multiple data types in this array but I want to know how to pass a function or a reference to a function so the other function can call it at any time.</p> <p>ex.</p> <p>function A:</p> <pre><code>add(new Array("hello", some ...
[ { "answer_id": 148990, "author": "davr", "author_id": 14569, "author_profile": "https://Stackoverflow.com/users/14569", "pm_score": 3, "selected": false, "text": "function someFunction(foo, bar) {\n ...\n}\n\nfunction a() {\n b([\"hello\", someFunction]);\n}\n\nfunction b(args:Array...
2008/09/29
[ "https://Stackoverflow.com/questions/148982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
148,988
<p>I need to create an XML schema that validates a tree structure of an XML document. I don't know exactly the occurrences or depth level of the tree.</p> <p>XML example:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;node&gt; &lt;attribute/&gt; &lt;node&gt; &lt;attribute/&gt; &lt;node/&g...
[ { "answer_id": 149003, "author": "Michael Brown", "author_id": 14359, "author_profile": "https://Stackoverflow.com/users/14359", "pm_score": 5, "selected": false, "text": "<xsd:element name=\"section\">\n <xsd:complexType>\n <xsd:sequence>\n <xsd:element ref=\"title\"/>\n <...
2008/09/29
[ "https://Stackoverflow.com/questions/148988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19012/" ]
149,008
<p>I have an object that I'm testing that raises an event. What is the best way of using Rhino Mocks to check that it was raised? </p> <p>Best I could come up with (I am certain it gets better than this):</p> <pre><code>public void MyCallback(object sender, EventArgs e) { _flag = true;} [Test] public void DoSometh...
[ { "answer_id": 149077, "author": "casademora", "author_id": 5619, "author_profile": "https://Stackoverflow.com/users/5619", "pm_score": 0, "selected": false, "text": "[Test]\npublic void MyEventTest()\n{\n\n IEventRaiser eventRaiser;\n\n mockView = _mocks.CreateMock<IView>();\n ...
2008/09/29
[ "https://Stackoverflow.com/questions/149008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
149,024
<p>What does the POP3 CAPA UIDL command do?</p>
[ { "answer_id": 149036, "author": "David Webb", "author_id": 3171, "author_profile": "https://Stackoverflow.com/users/3171", "pm_score": 3, "selected": false, "text": "UIDL CAPA CAPA UIDL" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9587/" ]
149,033
<p>I know that a float isn't appropriate to store currency values because of rounding errors. Is there a standard way to represent money in C++? </p> <p>I've looked in the boost library and found nothing about it. In java, it seems that BigInteger is the way but I couldn't find an equivalent in C++. I could write my o...
[ { "answer_id": 45910765, "author": "Fernando", "author_id": 3238668, "author_profile": "https://Stackoverflow.com/users/3238668", "pm_score": 3, "selected": false, "text": "#include <iostream>\n#include <iomanip>\n#include <boost/multiprecision/cpp_dec_float.hpp>\n\nint main()\n{\n fl...
2008/09/29
[ "https://Stackoverflow.com/questions/149033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
149,037
<p><P>How can I instantiate a JMS queue listener in java (JRE /JDK / J2EE 1.4) that only receives messages that match a given JMSCorrelationID? The messages that I'm looking to pick up have been published to a queue and not a topic, although that can change if needed.</P> Here's the code that I'm currently using to pu...
[ { "answer_id": 149167, "author": "Robin", "author_id": 21925, "author_profile": "https://Stackoverflow.com/users/21925", "pm_score": 5, "selected": true, "text": " QueueReceiver receiver = session.createReceiver(myQueue, \"JMSCorrelationID='theid'\");\n receiver.receive()\n receiver.s...
2008/09/29
[ "https://Stackoverflow.com/questions/149037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/231627/" ]
149,040
<p>Assume the following:</p> <p><em>models.py</em></p> <pre><code>class Entry(models.Model): title = models.CharField(max_length=50) slug = models.CharField(max_length=50, unique=True) body = models.CharField(max_length=200) </code></pre> <p><em>admin.py</em></p> <pre><code>class EntryAdmin(admin.ModelA...
[ { "answer_id": 149295, "author": "Dmitry Shevchenko", "author_id": 7437, "author_profile": "https://Stackoverflow.com/users/7437", "pm_score": 3, "selected": true, "text": "def save(self):\n from django.template.defaultfilters import slugify\n\n if not self.slug:\n self.slug...
2008/09/29
[ "https://Stackoverflow.com/questions/149040", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22306/" ]
149,042
<p>My questions is simple!</p> <ol> <li>Would you start learning Smalltalk if you had the time? Why? Why not?</li> <li>Do you already know Smalltalk? Why would you recommend Smalltalk? Why not?</li> </ol> <p>Personally I'm a Ruby on Rails programmer and I really like it. However, I'm thinking about Smalltalk because ...
[ { "answer_id": 149110, "author": "Kevin Driedger", "author_id": 9587, "author_profile": "https://Stackoverflow.com/users/9587", "pm_score": 4, "selected": false, "text": "i < 60\n ifTrue: [ self walk ]\n" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20467/" ]
149,054
<p>My everyday IDE is Eclipse which has a wonderful Open Resource feature (CTRL+SHIFT+R or Navigate > Open Resource) which allows the user to search for files/resources across multiple projects.</p> <p>I can't find a similar feature in SQL Server Management Studio, is there one?</p>
[ { "answer_id": 234485, "author": "Mark S. Rasmussen", "author_id": 12469, "author_profile": "https://Stackoverflow.com/users/12469", "pm_score": 1, "selected": false, "text": "sp_MSforeachdb 'SELECT * FROM ?.INFORMATION_SCHEMA.routines WHERE ROUTINE_TYPE = ''PROCEDURE'''\n" }, { ...
2008/09/29
[ "https://Stackoverflow.com/questions/149054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6912/" ]
149,055
<p>I would like to format a price in JavaScript. I'd like a function which takes a <code>float</code> as an argument and returns a <code>string</code> formatted like this:</p> <pre><code>&quot;$ 2,500.00&quot; </code></pre> <p>How can I do this?</p>
[ { "answer_id": 149080, "author": "roenving", "author_id": 23142, "author_profile": "https://Stackoverflow.com/users/23142", "pm_score": 5, "selected": false, "text": "<script type=\"text/javascript\">\n function ins1000Sep(val) {\n val = val.split(\".\");\n val[0] = val[0].split(\...
2008/09/29
[ "https://Stackoverflow.com/questions/149055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3314/" ]
149,057
<p>How can you remove all of the trailing whitespace of an entire project? Starting at a root directory, and removing the trailing whitespace from all files in all folders.</p> <p>Also, I want to to be able to modify the file directly, and not just print everything to stdout.</p>
[ { "answer_id": 149070, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 5, "selected": false, "text": "find dir -type f -exec sed -i 's/ *$//' '{}' ';' .git -not -iwholename '.git'" }, { "answer_id": 149081, ...
2008/09/29
[ "https://Stackoverflow.com/questions/149057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19718/" ]
149,058
<p>There doesn't seem to be an accepted way of sending down a header parameter in non ascii format.</p> <p>The header for file download usually looks like</p> <p>Content-disposition: attachment; filename="theasciifilename.doc"</p> <p>Except if you smash a utf8 encoded string in the filename parameter, Firefox will h...
[ { "answer_id": 149128, "author": "Mr. Shiny and New 安宇", "author_id": 7867, "author_profile": "https://Stackoverflow.com/users/7867", "pm_score": 3, "selected": true, "text": "0xE1 0xBA 0xA3" }, { "answer_id": 149529, "author": "Grant Wagner", "author_id": 9254, "auth...
2008/09/29
[ "https://Stackoverflow.com/questions/149058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/245/" ]
149,073
<p>I want to see the stack trace in any function of my code, so i made somthing like this to call it and print the stack trace:</p> <pre><code>public function PrintStackTrace() { try { throw new Error('StackTrace'); } catch (e:Error) { trace(e.getStackTrace()); } } </code></pre> <p>I like ...
[ { "answer_id": 149188, "author": "hasseg", "author_id": 4111, "author_profile": "https://Stackoverflow.com/users/4111", "pm_score": 7, "selected": true, "text": "var tempError:Error = new Error();\nvar stackTrace:String = tempError.getStackTrace();\n" }, { "answer_id": 20659235, ...
2008/09/29
[ "https://Stackoverflow.com/questions/149073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20601/" ]
149,078
<p>Suppose I have a database table with two fields, "foo" and "bar". Neither of them are unique, but each of them are indexed. However, rather than being indexed together, they each have a separate index.</p> <p>Now suppose I perform a query such as <code>SELECT * FROM sometable WHERE foo='hello' AND bar='world';</c...
[ { "answer_id": 149104, "author": "Georgi", "author_id": 13209, "author_profile": "https://Stackoverflow.com/users/13209", "pm_score": 2, "selected": false, "text": "CREATE INDEX IX_BAR_AND_FOO on sometable(bar,foo);\n" }, { "answer_id": 149168, "author": "David Aldridge", ...
2008/09/29
[ "https://Stackoverflow.com/questions/149078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1694/" ]
149,092
<p>I have backups of files archived in optical media (CDs and DVDs). These all have par2 recovery files, stored on separate media. Even in cases where there are no par2 files, minor errors when reading on one optical drive can be read fine on another drive.</p> <p>The thing is, when reading faulty media, the read time...
[ { "answer_id": 150102, "author": "Alexander", "author_id": 16724, "author_profile": "https://Stackoverflow.com/users/16724", "pm_score": 1, "selected": false, "text": "hdparm" }, { "answer_id": 150252, "author": "tzot", "author_id": 6899, "author_profile": "https://St...
2008/09/29
[ "https://Stackoverflow.com/questions/149092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6899/" ]
149,102
<p>How can I capture the event in Excel when a user clicks on a cell. I want to be able to use this event to trigger some code to count how many times the user clicks on several different cells in a column.</p>
[ { "answer_id": 149121, "author": "Robert S.", "author_id": 7565, "author_profile": "https://Stackoverflow.com/users/7565", "pm_score": 3, "selected": true, "text": "Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)\n If Not Intersect(Target, Range(\"SomeNamedRange\"))...
2008/09/29
[ "https://Stackoverflow.com/questions/149102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22376/" ]
149,132
<p>I'm not sure if this is something I should do in T-SQL or not, and I'm pretty sure using the word 'iterate' was wrong in this context, since you should never iterate anything in sql. It should be a set based operation, correct? Anyway, here's the scenario:</p> <p>I have a stored proc that returns many uniqueidentif...
[ { "answer_id": 149152, "author": "Ben Hoffstein", "author_id": 4482, "author_profile": "https://Stackoverflow.com/users/4482", "pm_score": 5, "selected": true, "text": "CREATE TABLE #t (uniqueid int)\nINSERT INTO #t EXEC p_YourStoredProc\n\nUPDATE TargetTable \nSET a.FlagColumn = 1\nFROM...
2008/09/29
[ "https://Stackoverflow.com/questions/149132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5469/" ]
149,153
<p>I'm trying to create a ImageIcon from a animated gif stored in a jar file.</p> <pre><code>ImageIcon imageIcon = new ImageIcon(ImageIO.read(MyClass.class.getClassLoader().getResourceAsStream("animated.gif"))); </code></pre> <p>The image loads, but only the first frame of the animated gif. The animation does not pl...
[ { "answer_id": 5444422, "author": "Andrew Thompson", "author_id": 418556, "author_profile": "https://Stackoverflow.com/users/418556", "pm_score": 2, "selected": false, "text": "import javax.swing.*;\nimport java.net.URL;\n\nclass AnimatedGifInLabel {\n\n public static void main(String...
2008/09/29
[ "https://Stackoverflow.com/questions/149153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/739/" ]
149,191
<p>I am seeing some rather weird behavior with PowerShell, it looks like custom functions might need a "parenthesis wrapper" to evaluate as you might expect them. Given a simple PowerShell function:</p> <pre><code>function Return-True { return $true } </code></pre> <p>and then some sample code to invoke it:</p> <pre...
[ { "answer_id": 149373, "author": "hurcane", "author_id": 21363, "author_profile": "https://Stackoverflow.com/users/21363", "pm_score": 3, "selected": false, "text": "PS C:\\> function Return-True { return \"True string\" }\nPS C:\\> Return-True\nTrue string\nPS C:\\> Return-True -eq \"Fa...
2008/09/29
[ "https://Stackoverflow.com/questions/149191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/243/" ]
149,198
<p>I use Tortoise SVN usuallly, but I have been looking into Mercurial since it is a distributed revision control system. </p> <p>What I am looking for, in both systems, is a tool that let me pick only parts of a file and commit them. If I want to do this now, I have to copy to a temp version of the file and keep only...
[ { "answer_id": 149270, "author": "Nicholas Riley", "author_id": 6372, "author_profile": "https://Stackoverflow.com/users/6372", "pm_score": 6, "selected": true, "text": "% hg record\ndiff --git a/prelim.tex b/prelim.tex\n2 hunks, 4 lines changed\nexamine changes to 'prelim.tex'? [Ynsfdaq...
2008/09/29
[ "https://Stackoverflow.com/questions/149198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6752/" ]
149,200
<p>I have an application that uses Forms Authentication to authenticate one type of user. There is a section in this application that needs to be authenticated for another type of user using a different table in the database. The problem happens if the second type of user's session times out, she is taken to the login ...
[ { "answer_id": 149255, "author": "Ian Jacobs", "author_id": 22818, "author_profile": "https://Stackoverflow.com/users/22818", "pm_score": 1, "selected": false, "text": "<location>...</location> \n" }, { "answer_id": 150169, "author": "Ty.", "author_id": 8873, "author_...
2008/09/29
[ "https://Stackoverflow.com/questions/149200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21160/" ]
149,206
<p>I have a XML response from an HTTPService call with the e4x result format.</p> <pre> <code> &lt;?xml version="1.0" encoding="utf-8"?> &lt;Validation Error="Invalid Username/Password Combination" /> </code> </pre> <p>I have tried:</p> <pre> <code> private function callback(event:ResultEvent):void { if(event.re...
[ { "answer_id": 149291, "author": "mmattax", "author_id": 1638, "author_profile": "https://Stackoverflow.com/users/1638", "pm_score": 1, "selected": false, "text": "\nprivate function callback(event:ResultEvent):void {\n if(event.result.attribute(\"Error\").length()) {\n // erro...
2008/09/29
[ "https://Stackoverflow.com/questions/149206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
149,213
<p>Does anybody know what hypothetical indexes are used for in sql server 2000? I have a table with 15+ such indexes, but have no idea what they were created for. Can they slow down deletes/inserts?</p>
[ { "answer_id": 149224, "author": "Galwegian", "author_id": 3201, "author_profile": "https://Stackoverflow.com/users/3201", "pm_score": 1, "selected": false, "text": "SELECT *\nFROM sys.indexes\nWHERE is_hypothetical = 1\n" }, { "answer_id": 56820837, "author": "Lukasz S...
2008/09/29
[ "https://Stackoverflow.com/questions/149213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12772/" ]
149,233
<p>I have 7-8 xml files. Each one is approximately 50 MB in size. What is the best way to merge files programmatically in C# without getting System.OutOfMemory Exception? So far I have tried reading each file in a StringBuilder and than putting it in an array of string builder but I still get system.outofmemoery excep...
[ { "answer_id": 149264, "author": "ZombieSheep", "author_id": 377, "author_profile": "https://Stackoverflow.com/users/377", "pm_score": 0, "selected": false, "text": "<items>\n <item id=\"1\">\n <name>Widget</name>\n </item>\n <item id=\"2\">\n <name>Widget 2</name>...
2008/09/29
[ "https://Stackoverflow.com/questions/149233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
149,236
<p>I'm slowly getting back into PHP, and now I run into a problem, I want to install some web software on our host and I need to have either the latest Zend (which they don't have) or IonCube on the server and IonCube requires enable_dl to be on in the php.ini. Now a colleague of mine thinks I can update this via an .h...
[ { "answer_id": 149264, "author": "ZombieSheep", "author_id": 377, "author_profile": "https://Stackoverflow.com/users/377", "pm_score": 0, "selected": false, "text": "<items>\n <item id=\"1\">\n <name>Widget</name>\n </item>\n <item id=\"2\">\n <name>Widget 2</name>...
2008/09/29
[ "https://Stackoverflow.com/questions/149236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1841427/" ]
149,262
<p>What delphi function asserts that an object is not nil?</p>
[ { "answer_id": 149296, "author": "Roman Ganz", "author_id": 17981, "author_profile": "https://Stackoverflow.com/users/17981", "pm_score": 3, "selected": false, "text": "Assert(Assigned(MyObject));" }, { "answer_id": 149351, "author": "Mihai Limbășan", "author_id": 14444, ...
2008/09/29
[ "https://Stackoverflow.com/questions/149262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1765/" ]
149,268
<p>Since I have started using this site, I keep hearing about the Boost library. I am wondering what are some of the major benefits of the Boost library (hence why should I use it) and how portable is the Boost library?</p>
[ { "answer_id": 149285, "author": "Douglas Mayle", "author_id": 8458, "author_profile": "https://Stackoverflow.com/users/8458", "pm_score": 4, "selected": false, "text": "int iResult = 0;\ntry\n{\n iResult = lexical_cast<int>(\"4\");\n}\ncatch(bad_lexical_cast &)\n{\n cout << \"Unab...
2008/09/29
[ "https://Stackoverflow.com/questions/149268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20229/" ]
149,307
<p>How can I run background tasks on App Engine?</p>
[ { "answer_id": 35063902, "author": "phucat", "author_id": 755410, "author_profile": "https://Stackoverflow.com/users/755410", "pm_score": 1, "selected": false, "text": "from google.appengine.ext import deferred\n\ndef do_something_expensive(a, b, c=None):\n logging.info(\"Doing someth...
2008/09/29
[ "https://Stackoverflow.com/questions/149307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
149,311
<p>When adding an EditItemTemplate of some complexity (mulitple fields in one template), and then parsing the controls from the RowUpdating event, the controls that were manually entered by the user have no values. My guess is there is something going on with when the data is bound, but I've had instances where simply ...
[ { "answer_id": 149392, "author": "Elijah Manor", "author_id": 4481, "author_profile": "https://Stackoverflow.com/users/4481", "pm_score": 0, "selected": false, "text": "TextBox txtValue = gvwSettings.SelectedRow.FindControl(\"txtValue\") as TextBox;\n" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2017/" ]
149,324
<p>Is there a way set flags on a per-file basis with automake?<br> In particular, if I have a c++ project and want to compile with -WAll all the files except one for which I want to disable a particular warning, what could I do?</p> <p>I tried something like:</p> <pre><code>CXXFLAGS = -WAll ... bin_PROGRAMS = test te...
[ { "answer_id": 149642, "author": "Douglas Leeder", "author_id": 3978, "author_profile": "https://Stackoverflow.com/users/3978", "pm_score": 2, "selected": false, "text": "gnu\n warnings related to the GNU Coding Standards (see Top).\nobsolete\n obsolete features or constructions\no...
2008/09/29
[ "https://Stackoverflow.com/questions/149324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15622/" ]
149,337
<p>Is it possible to create a .NET equivalent to the following code?</p> <pre><code>&lt;?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); echo 'Text to send if user hits Cancel button'; exit; } else { echo "&lt;p&g...
[ { "answer_id": 149390, "author": "mattlant", "author_id": 14642, "author_profile": "https://Stackoverflow.com/users/14642", "pm_score": 0, "selected": false, "text": "if(SecurityHelper.LoginUser(txtUsername.Text, txtPassword.Text))\n{\n FormsAuthentication.RedirectFromLoginPage(txtUse...
2008/09/29
[ "https://Stackoverflow.com/questions/149337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/795/" ]
149,375
<p>Is there any way to do this in the Powerbuilder properties window for a datawindow's textbox?</p>
[ { "answer_id": 3128575, "author": "Matt", "author_id": 377533, "author_profile": "https://Stackoverflow.com/users/377533", "pm_score": 1, "selected": false, "text": "® ls_key = '®" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12646/" ]
149,379
<p>I want to create Code39 encoded barcodes from my application. </p> <p>I know I can use a font for this, but I'd prefer not to as I'd have to register the font on the server and I've had some pretty bad experiences with that.</p> <p><em>An example of what I've produced after asking this question is in the answers</...
[ { "answer_id": 156784, "author": "sebastiaan", "author_id": 5018, "author_profile": "https://Stackoverflow.com/users/5018", "pm_score": 5, "selected": true, "text": "Option Explicit On\nOption Strict On\n\nImports System.Drawing\nImports System.Drawing.Imaging\nImports System.Drawing.Bit...
2008/09/29
[ "https://Stackoverflow.com/questions/149379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5018/" ]
149,380
<p>This is an issue that I've spent hours researching in the past. It seems to me to be something that should have been addressed by modern <a href="http://en.wikipedia.org/wiki/Relational_database_management_system" rel="noreferrer">RDBMS</a> solutions but as yet I have not found anything that really addresses what I...
[ { "answer_id": 149549, "author": "Eric Z Beard", "author_id": 1219, "author_profile": "https://Stackoverflow.com/users/1219", "pm_score": 7, "selected": false, "text": "order by\ncase when @SortExpr = 'CustomerName' and @SortDir = 'ASC' \n then CustomerName end asc, \ncase when @SortE...
2008/09/29
[ "https://Stackoverflow.com/questions/149380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7290/" ]
149,388
<p>Was wondering if anyone knows, or has pointers to good documentation that discusses, the low-level implementation details of Cocoa's 'performSelectorOnMainThread:' method.</p> <p>My best guess, and one I think is probably pretty close, is that it uses mach ports or an abstraction on top of them to provide intra-thr...
[ { "answer_id": 149448, "author": "Evan DiBiase", "author_id": 2399475, "author_profile": "https://Stackoverflow.com/users/2399475", "pm_score": 2, "selected": false, "text": "performSelectorOnMainThread:withObject:waitUntilDone:" }, { "answer_id": 149471, "author": "Mecki", ...
2008/09/29
[ "https://Stackoverflow.com/questions/149388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23498/" ]
149,394
<p>I have a winforms application, the issue has to do with threading. Since I am calling 'MyCustomCode() which creates a new thread, and calls the method 'SomeMethod()' which then accesses MessageBox.Show(...).</p> <p>The problem has to do with threading, since the newly created thread is trying to access a control t...
[ { "answer_id": 149404, "author": "albertein", "author_id": 23020, "author_profile": "https://Stackoverflow.com/users/23020", "pm_score": 3, "selected": false, "text": "public delegate void InvokeDelegate();\n\npublic void SomeMethod()\n{\n\n button1.Invoke((InvokeDelegate)doUIStuff);\...
2008/09/29
[ "https://Stackoverflow.com/questions/149394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
149,395
<p>We have a Windows machine running SQL Server 2005, and we need to be able to run some database queries on it from a Linux box. What are some of the recommended ways of doing this? Ideally, we would want a command-line utility similar to sqlcmd on Windows.</p>
[ { "answer_id": 149418, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 6, "selected": true, "text": "$more /etc/freetds/freetds.conf\n[10.0.1.251]\n host = 10.0.1.251\n port = 1433\n tds version = 8.0\n\n$ mor...
2008/09/29
[ "https://Stackoverflow.com/questions/149395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4828/" ]
149,421
<p>How does Stackoverflow implement the resizable textarea?</p> <p>Is that something they rolled themselves or is it a publicly available component that I can easily attach to textareas on my sites? </p> <p>I found this question and it doesn't quite do what I want.</p> <p><a href="https://stackoverflow.com/question...
[ { "answer_id": 29240767, "author": "benshope", "author_id": 1865305, "author_profile": "https://Stackoverflow.com/users/1865305", "pm_score": 0, "selected": false, "text": "angular.module('app').directive('textarea', function() {\n return {\n restrict: 'E',\n controller: function(...
2008/09/29
[ "https://Stackoverflow.com/questions/149421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305/" ]
149,439
<p>How can you avoid circular dependencies when you're designing two classes with a producer/consumer relationship? Here ListenerImpl needs a reference to Broadcaster in order to register/unregister itself, and Broadcaster needs a reference back to the Listeners in order to send messages. This example is in Java but it...
[ { "answer_id": 149457, "author": "Herms", "author_id": 1409, "author_profile": "https://Stackoverflow.com/users/1409", "pm_score": 4, "selected": true, "text": " Listener\n ^ ^\n / \\\n / \\\nBroadcaster <-- ListenerImpl\n" }, { "...
2008/09/29
[ "https://Stackoverflow.com/questions/149439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16399/" ]
149,463
<p>I have this code inside a class:</p> <pre><code>void SendStones() { int currenthole = hole; int lastplace = 0; for(int i=0;i&lt;stns.size();i++) { while(1) {//Calculate new currenthole if(currenthole == 13) { currenthole = 7; break;} if(currenthole == 14) { cu...
[ { "answer_id": 149562, "author": "moswald", "author_id": 8368, "author_profile": "https://Stackoverflow.com/users/8368", "pm_score": 0, "selected": false, "text": "int currenthole = hole;\n if(currenthole == 13) { currenthole = 7; break;}\n if(currenthole == 14) { currenthole ...
2008/09/29
[ "https://Stackoverflow.com/questions/149463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
149,474
<p>This XML file contained archived news stories for all of last year. I was asked to sort these stories by story categor[y|ies] into new XML files.</p> <pre><code>big_story_export.xml </code></pre> <p>turns into</p> <pre><code>lifestyles.xml food.xml nascar.xml </code></pre> <p>...and so on.</p> <p>I got the job ...
[ { "answer_id": 149495, "author": "Sklivvz", "author_id": 7028, "author_profile": "https://Stackoverflow.com/users/7028", "pm_score": 2, "selected": false, "text": "xsltproc" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22491/" ]
149,479
<p>Well, it seems simple enough, but I can't find a way to add a caption to an equation. The caption is needed to explain the variables used in the equation, so some kind of table-like structure to keep it all aligned and pretty would be great.</p>
[ { "answer_id": 149494, "author": "dmckee --- ex-moderator kitten", "author_id": 2509, "author_profile": "https://Stackoverflow.com/users/2509", "pm_score": 4, "selected": false, "text": "\\newfloat $ ... $ $$ ... $$ begin{equation}... \\caption \\begin{document} \\usepackage{float}\n\\us...
2008/09/29
[ "https://Stackoverflow.com/questions/149479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2841/" ]
149,484
<p>I want to create a VB.NET generic factory method that creates instances of classes (as a home-grown inversion of control container). If I pass the interface IDoSomething as the generic parameter, I want to return an instance of DoSomething (that implements IDoSomething). I cannot figure out the syntax of the if st...
[ { "answer_id": 149536, "author": "codeConcussion", "author_id": 1321, "author_profile": "https://Stackoverflow.com/users/1321", "pm_score": 2, "selected": false, "text": "Public Function Build(Of T) As T\n Dim foo As Type = GetType(T)\n\n If foo Is GetType(IDoSomething) Then\n Retur...
2008/09/29
[ "https://Stackoverflow.com/questions/149484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
149,485
<p>Like many projects, we deploy to many environments, QA, UA, Developer trunks, etc..</p> <p>What is the best way to store sensitive configuration parameters in SVN? Or, should you not and just maintain a smaller unversioned file with credentials in it on the server?</p> <p>Mainly, we do not want to expose productio...
[ { "answer_id": 149590, "author": "Michał Niedźwiedzki", "author_id": 2169, "author_profile": "https://Stackoverflow.com/users/2169", "pm_score": 3, "selected": false, "text": "setup.default.php setup.php .svnignore $ echo 'setup.php' > .svnignore\n$ svn propset svn:ignore -F .svnignore ....
2008/09/29
[ "https://Stackoverflow.com/questions/149485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
149,488
<p>I enjoy developing algorithms using the STL, however, I have this recurring problem where my data sets are too large for the heap. </p> <p>I have been searching for drop-in replacements for STL containers and algorithms which are disk-backed, i.e. the data structures on stored on disk rather than the heap. </p> <p...
[ { "answer_id": 151612, "author": "Ted", "author_id": 8965, "author_profile": "https://Stackoverflow.com/users/8965", "pm_score": 4, "selected": true, "text": "boost::iterator_facade" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14069/" ]
149,491
<p>I've been arguing with my coworkers about Pascal casing (upper camel case) vs. lower <a href="http://en.wikipedia.org/wiki/CamelCase" rel="noreferrer">CamelCasing</a>. They are used to lower camel casing for everything from table names in SQL databases to property naming in C# code but I like Pascal casing better, l...
[ { "answer_id": 149511, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 0, "selected": false, "text": "_localVar" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14533/" ]
149,500
<p>What does the following code do in C/C++?</p> <pre><code>if (blah(), 5) { //do something } </code></pre>
[ { "answer_id": 149518, "author": "jop", "author_id": 11830, "author_profile": "https://Stackoverflow.com/users/11830", "pm_score": 6, "selected": false, "text": "blah();\nif (5) {\n // do something\n}\n #include <iostream>\n#include <string>\n\nusing namespace std;\n\nstring blah()\n{\n...
2008/09/29
[ "https://Stackoverflow.com/questions/149500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20630/" ]
149,506
<p>I'm investigating an annotation-based approach to validating Spring beans using <a href="https://springmodules.dev.java.net/" rel="nofollow noreferrer">spring modules</a>. In <a href="http://wheelersoftware.com/articles/spring-bean-validation-framework.html" rel="nofollow noreferrer">this tutorial</a>, the following...
[ { "answer_id": 176039, "author": "toolkit", "author_id": 3295, "author_profile": "https://Stackoverflow.com/users/3295", "pm_score": 4, "selected": true, "text": "....\n<bean id=\"validator\" class=\"org.springmodules.validation.bean.BeanValidator\"\n p:configurationLoader-ref=\"confi...
2008/09/29
[ "https://Stackoverflow.com/questions/149506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2648/" ]
149,530
<p>I have code from an old website that I needed to modify. There are two pages that I modified some form code in. I modified the max length of a textbox and I modified slightly a line or two of code in a function. The "btnSubmit_Click" function as it happens.</p> <p>With the new code FTPed up on the webserver, when I...
[ { "answer_id": 13083362, "author": "A.D.K", "author_id": 1742791, "author_profile": "https://Stackoverflow.com/users/1742791", "pm_score": 2, "selected": false, "text": "<form> <form>" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13980/" ]
149,551
<p>We have a few operations where we are doing a large number of large string concatenations, and have recently encountered an out of memory exception. Unfortunately, debugging the code is not an option, as this is occurring at a customer site. </p> <p>So, before looking into a overhaul of our code, I would like to ...
[ { "answer_id": 149576, "author": "albertein", "author_id": 23020, "author_profile": "https://Stackoverflow.com/users/23020", "pm_score": -1, "selected": false, "text": "string a = \"a\";\n\n//creates object with a\n\na += \"b\"\n\n/creates object with b, creates object with ab, assings o...
2008/09/29
[ "https://Stackoverflow.com/questions/149551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13990/" ]
149,569
<p>How do I write unit tests in .NET? </p> <p>Specifically Visual Studio 2005?</p>
[ { "answer_id": 212016, "author": "Chris Burgess", "author_id": 6624, "author_profile": "https://Stackoverflow.com/users/6624", "pm_score": 2, "selected": false, "text": "Imports nunit.Framework <TestFixture()> <TestFixture()> Public Class MyTestClass <Test()> <Test()> _\nPublic Sub harne...
2008/09/29
[ "https://Stackoverflow.com/questions/149569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
149,570
<p>Has anyone ever done work to get Ruby to do continuations (like Seaside on Smalltalk)?</p>
[ { "answer_id": 149699, "author": "Krzysiek Goj", "author_id": 23018, "author_profile": "https://Stackoverflow.com/users/23018", "pm_score": 5, "selected": true, "text": "callcc Generator" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23513/" ]
149,573
<p>Using jQuery, how do you check if there is an option selected in a select menu, and if not, assign one of the options as selected.</p> <p>(The select is generated with a maze of PHP functions in an app I just inherited, so this is a quick fix while I get my head around those :)</p>
[ { "answer_id": 149592, "author": "Hank Gay", "author_id": 4203, "author_profile": "https://Stackoverflow.com/users/4203", "pm_score": 2, "selected": false, "text": "select" }, { "answer_id": 149620, "author": "FlySwat", "author_id": 1965, "author_profile": "https://St...
2008/09/29
[ "https://Stackoverflow.com/questions/149573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4196/" ]
149,577
<p>My math-fu is failing me! I need an efficient way of reducing network ranges to supersets, e.g. if I input list of IP ranges:</p> <ul> <li>1.1.1.1 to 2.2.2.5</li> <li>1.1.1.2 to 2.2.2.4</li> <li>10.5.5.5 to 155.5.5.5</li> <li>10.5.5.6 to 10.5.5.7</li> </ul> <p>I want to return the following ranges:</p> <ul> <li>1...
[ { "answer_id": 152594, "author": "Mecki", "author_id": 15809, "author_profile": "https://Stackoverflow.com/users/15809", "pm_score": 3, "selected": false, "text": "1.1.1.1 to 2.2.2.5\n1.1.1.2 to 2.2.2.4\n 16,843,009 to 33,686,021\n16,843,010 to 33,686,020\n startIP2 >= startIP1 && startI...
2008/09/29
[ "https://Stackoverflow.com/questions/149577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12979/" ]
149,585
<p>Does BeautifulSoup work with Python 3? </p> <p>If not, how soon will there be a port? Will there be a port at all?</p> <p>Google doesn't turn up anything to me (Maybe it's 'coz I'm looking for the wrong thing?)</p>
[ { "answer_id": 9906160, "author": "badp", "author_id": 13992, "author_profile": "https://Stackoverflow.com/users/13992", "pm_score": 4, "selected": false, "text": "pip install beautifulsoup4\n" }, { "answer_id": 51483060, "author": "Tanvir Islam Streame", "author_id": 574...
2008/09/29
[ "https://Stackoverflow.com/questions/149585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17865/" ]
149,600
<p>Do you know any good tools for nicely formatting messy php code? Preferably a script for Aptana/Eclipse, but a standalone tool will do too.</p>
[ { "answer_id": 150028, "author": "ConroyP", "author_id": 2287, "author_profile": "https://Stackoverflow.com/users/2287", "pm_score": 5, "selected": true, "text": "if($code == BAD){$action = REWRITE;}else{$action = KEEP;}\nfor($i=0; $i<10;$i++){while($j>0){$j++;doCall($i+$j);if($k){$k/=10...
2008/09/29
[ "https://Stackoverflow.com/questions/149600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/556/" ]
149,609
<p>Does the using catch the exception or throw it? i.e. </p> <pre><code>using (StreamReader rdr = File.OpenText("file.txt")) { //do stuff } </code></pre> <p>If the streamreader throws an exception is it caught by using or thrown so the calling function can handle it?</p>
[ { "answer_id": 149625, "author": "Chris Marasti-Georg", "author_id": 96, "author_profile": "https://Stackoverflow.com/users/96", "pm_score": 4, "selected": false, "text": "using IDisposable" }, { "answer_id": 149643, "author": "jop", "author_id": 11830, "author_profil...
2008/09/29
[ "https://Stackoverflow.com/questions/149609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21299/" ]
149,617
<p>Let's assume that I have some packets with a 16-bit checksum at the end. I would like to guess which checksum algorithm is used.</p> <p>For a start, from dump data I can see that one byte change in the packet's payload totally changes the checksum, so I can assume that it isn't some kind of simple XOR or sum.</p> ...
[ { "answer_id": 158693, "author": "selwyn", "author_id": 16314, "author_profile": "https://Stackoverflow.com/users/16314", "pm_score": 5, "selected": true, "text": "Polynomial\nNo of bits (16 or 32)\nNormal (LSB first) or Reverse (MSB first)\nInitial value\nHow the final value is manipula...
2008/09/29
[ "https://Stackoverflow.com/questions/149617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1081/" ]
149,627
<p>Is there a clean way of cloning a record in SQL that has an index(auto increment). I want to clone all the fields except the index. I currently have to enumerate every field, and use that in an insert select, and I would rather not explicitly list all of the fields, as they may change over time.</p>
[ { "answer_id": 149650, "author": "Ben Hoffstein", "author_id": 4482, "author_profile": "https://Stackoverflow.com/users/4482", "pm_score": 2, "selected": true, "text": "-- Get list of columns in table\nSELECT INTO #t\nEXEC sp_columns @table_name = N'TargetTable'\n\n-- Create a comma-deli...
2008/09/29
[ "https://Stackoverflow.com/questions/149627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17712/" ]
149,635
<p>I've got some JSON data, but it's all on one line. Does anyone know of a web or Windows editor that will format (e.g. indent and insert new lines) this data for me, so I can read it better? Preferably one that uses a GUI to display the JSON&mdash;instead of a command-line tool that outputs a reformatted document, fo...
[ { "answer_id": 7059746, "author": "Nick Perkins", "author_id": 138939, "author_profile": "https://Stackoverflow.com/users/138939", "pm_score": 0, "selected": false, "text": "{} x={}; x= ; function get_json_file(url,options,callback){\n var opts = {dataType:\"text\"};\n opts.url = u...
2008/09/29
[ "https://Stackoverflow.com/questions/149635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11574/" ]
149,639
<p>I've got a 'task list' database that uses the adjacency list model (see below) so each 'task' can have unlimited sub-tasks. The table has an 'TaskOrder' column so everything renders in the correct order on a treeview.</p> <p>Is there an SQL statement (MS-SQL 2005) that will select all the child nodes for a specifie...
[ { "answer_id": 149711, "author": "Amy B", "author_id": 8155, "author_profile": "https://Stackoverflow.com/users/8155", "pm_score": 0, "selected": false, "text": "DECLARE @Tasks TABLE\n(\n TaskId int PRIMARY KEY,\n ParentTaskId int,\n TaskOrder int,\n TaskName varchar(30)\n)\n\nINSERT...
2008/09/29
[ "https://Stackoverflow.com/questions/149639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14072/" ]
149,646
<p>In the Apple documentation for <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSRunLoop_Class/Reference/Reference.html#//apple_ref/occ/instm/NSRunLoop/run" rel="noreferrer">NSRunLoop</a> there is sample code demonstrating suspending execution while waiting for a flag to be set b...
[ { "answer_id": 150417, "author": "Jon Shea", "author_id": 3770, "author_profile": "https://Stackoverflow.com/users/3770", "pm_score": 2, "selected": false, "text": "NSRunLoops runMode:beforeDate: NSRunLoop runMode:beforeDate: runMode:beforeDate: while() shouldKeepRunning NO runMode:befor...
2008/09/29
[ "https://Stackoverflow.com/questions/149646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4496/" ]
149,690
<p>I am trying to extract a certain part of a column that is between delimiters.</p> <p>e.g. find foo in the following</p> <p>test 'esf :foo: bar</p> <p>So in the above I'd want to return foo, but all the regexp functions only return true|false, is there a way to do this in MySQL</p>
[ { "answer_id": 149703, "author": "Mark Biek", "author_id": 305, "author_profile": "https://Stackoverflow.com/users/305", "pm_score": 2, "selected": false, "text": "MID( fooField, LOCATE('foo', fooField), 3);\n" }, { "answer_id": 149756, "author": "Vinko Vrsalovic", "autho...
2008/09/29
[ "https://Stackoverflow.com/questions/149690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
149,710
<p>In a C++ Linux app, what is the simplest way to get the functionality that the <a href="http://msdn.microsoft.com/en-us/library/system.threading.interlocked.aspx" rel="noreferrer">Interlocked</a> functions on Win32 provide? Specifically, a lightweight way to atomically increment or add 32 or 64 bit integers? </p>
[ { "answer_id": 332214, "author": "Ben Combee", "author_id": 1323, "author_profile": "https://Stackoverflow.com/users/1323", "pm_score": 2, "selected": false, "text": "g_atomic" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23524/" ]
149,718
<p>I have several .NET <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="nofollow noreferrer">Windows Forms</a> applications that I'm preparing to convert into a <a href="http://en.wikipedia.org/wiki/ClickOnce" rel="nofollow noreferrer">ClickOnce</a>/smart-client deployment scenario. I've read the isn't-this-gr...
[ { "answer_id": 542030, "author": "Jamie Ide", "author_id": 12752, "author_profile": "https://Stackoverflow.com/users/12752", "pm_score": 2, "selected": false, "text": "try\n{\n string company = string.Empty;\n string product = string.Empty;\n if (Attribute.IsDefined(asm, typeof(...
2008/09/29
[ "https://Stackoverflow.com/questions/149718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9345/" ]
149,763
<p>I'm benchmarking a WPF application on various platforms and I need an easy way to determine if WPF is using hardware or software rendering. </p> <p>I seem to recall a call to determine this, but can't lay my hands on it right now.</p> <p>Also, is there an easy, code based way to force one rendering pipeline over ...
[ { "answer_id": 150005, "author": "Charley Rathkopf", "author_id": 10119, "author_profile": "https://Stackoverflow.com/users/10119", "pm_score": 3, "selected": false, "text": " logger.InfoFormat(\"WPF Tier = {0}\",RenderCapability.Tier / 0x10000);\n RenderCapability.TierChan...
2008/09/29
[ "https://Stackoverflow.com/questions/149763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10119/" ]
149,772
<p>Basically the question is how to get from this:</p> <pre> foo_id foo_name 1 A 1 B 2 C </pre> <p>to this:</p> <pre> foo_id foo_name 1 A B 2 C </pre>
[ { "answer_id": 149799, "author": "Scott Noyes", "author_id": 23539, "author_profile": "https://Stackoverflow.com/users/23539", "pm_score": 10, "selected": true, "text": "SELECT id, GROUP_CONCAT(name SEPARATOR ' ') FROM table GROUP BY id;\n GROUP_CONCAT" }, { "answer_id": 149805, ...
2008/09/29
[ "https://Stackoverflow.com/questions/149772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9403/" ]
149,777
<p>i have several common elements (components), that will generate some html. it seems my options are creating a taglib, or just putting that logic into a jsp page and including the jsp.</p> <p>whats the difference? positives vs negatives?</p>
[ { "answer_id": 149879, "author": "erickson", "author_id": 3474, "author_profile": "https://Stackoverflow.com/users/3474", "pm_score": 1, "selected": false, "text": "JspFragment" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20641/" ]
149,784
<p><a href="https://stackoverflow.com/questions/57168/how-to-copy-a-row-from-one-sql-server-table-to-another">This question</a> comes close to what I need, but my scenario is slightly different. The source table and destination table are the same and the primary key is a uniqueidentifier (guid). When I try this:</p> <...
[ { "answer_id": 149792, "author": "AaronSieb", "author_id": 16911, "author_profile": "https://Stackoverflow.com/users/16911", "pm_score": 9, "selected": true, "text": "\ninsert into MyTable(field1, field2, id_backup)\n select field1, field2, uniqueId from MyTable where uniqueId = @Id;\...
2008/09/29
[ "https://Stackoverflow.com/questions/149784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5469/" ]
149,796
<p>Often I want to add a value to a table or update the value if its key already exists. This can be accomplished in several ways, assuming a primary or unique key is set on the 'user_id' and 'pref_key' columns in the example:</p> <p><strong>1. Blind insert, update if receiving a duplicate key error:</strong></p> <pr...
[ { "answer_id": 149834, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 3, "selected": false, "text": "INSERT INTO my_prefs \n(user_id, pref_key, pref_value) \nVALUES (1234, 'show_help', 'true')\nON DUPLICATE KEY \nUPDA...
2008/09/29
[ "https://Stackoverflow.com/questions/149796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15872/" ]
149,821
<p>I have the following function that is pulling data from a database. The ajax call is working correctly. How can I send the tab delimited data in my success function to the user? Setting the contect type to "application/vnd.ms-excel" didn't work. The alert on success shows the correctly formatted data.</p> <pre>...
[ { "answer_id": 4455600, "author": "fernando", "author_id": 544005, "author_profile": "https://Stackoverflow.com/users/544005", "pm_score": 3, "selected": false, "text": "onclick=\"exportExcel(); function exportExcel(){\n var inputs = $(\"#myForm\").serialize();\n var url = '/ajaxre...
2008/09/29
[ "https://Stackoverflow.com/questions/149821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/681/" ]
149,823
<p>When I dynamically create a Datagrid and add in a new buttoncolumn how do I access the buttoncolumn_click event? </p> <p>Thanks.</p>
[ { "answer_id": 150165, "author": "Collin Estes", "author_id": 20748, "author_profile": "https://Stackoverflow.com/users/20748", "pm_score": 0, "selected": false, "text": " Datagridtest.Width = 600;\n Datagridtest.GridLines = GridLines.Both;\n Datagridtest.CellPadding...
2008/09/29
[ "https://Stackoverflow.com/questions/149823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20748/" ]
149,825
<p>I ran across the following code in <a href="http://www.quietlyscheming.com/blog/" rel="nofollow noreferrer">Ely Greenfield's</a> SuperImage from his Book component - I understand loader.load() but what does the rest of do?</p> <pre><code>loader.load((newSource is URLRequest)? newSource:new URLRequest(newSource)); <...
[ { "answer_id": 149847, "author": "Matt", "author_id": 20630, "author_profile": "https://Stackoverflow.com/users/20630", "pm_score": 0, "selected": false, "text": "String str = null;\nint x = (str != null) ? str.length() : 0;\n String str = null;\nint x;\nif (str != null)\n x = str.lengt...
2008/09/29
[ "https://Stackoverflow.com/questions/149825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3435/" ]
149,827
<p>I want to be able to run a text editor from my app, as given by the user in the TEXT_EDITOR environment variable. Now, assuming there is nothing in that variable, I want to default to the TextEdit program that ships with OSX. Is it kosher to hardcode /Applications/TextEdit.app/Contents/MacOS/TextEdit into my app, ...
[ { "answer_id": 149866, "author": "Vivek", "author_id": 7418, "author_profile": "https://Stackoverflow.com/users/7418", "pm_score": -1, "selected": false, "text": "open <full path to text file>\n open" }, { "answer_id": 149915, "author": "Chris Hanson", "author_id": 714, ...
2008/09/29
[ "https://Stackoverflow.com/questions/149827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3830/" ]
149,844
<p>I'm running my site through the W3C's validator trying to get it to validate as XHTML 1.0 Strict and I've gotten down to a particularly sticky (at least in my experience) validation error. I'm including certain badges from various services in the site that provide their own API and code for inclusion on an external...
[ { "answer_id": 150230, "author": "Panos", "author_id": 8049, "author_profile": "https://Stackoverflow.com/users/8049", "pm_score": 4, "selected": true, "text": "<div id=\"twitter_div\">\n <h2 class=\"twitter-title\"><a href=\"http://twitter.com/stopsineman\" title=\"Tim's Twitter Page...
2008/09/29
[ "https://Stackoverflow.com/questions/149844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16562/" ]
149,848
<p>What is a strong way to protect against sql injection for a classic asp app?</p> <p>FYI I am using it with an access DB. (I didnt write the app)</p>
[ { "answer_id": 149854, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 6, "selected": true, "text": "Conn.Execute(\"EXEC usp_ImOnlySafeIfYouCallMeRight '\" + param1 + \"', '\" + param2 + \"'\") ;\n INSERT/UPDATE/DELETE" ...
2008/09/29
[ "https://Stackoverflow.com/questions/149848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23528/" ]
149,851
<p>I'm consuming a third party .NET WebService in my client application. For debugging purposes I want to capture the SOAP requests that are being sent from my server. How would I go about doing this? This is being done on .NET 2.0 without the use of WCF or WSE.</p>
[ { "answer_id": 4268955, "author": "Steven de Salas", "author_id": 448568, "author_profile": "https://Stackoverflow.com/users/448568", "pm_score": 4, "selected": false, "text": "SoapExtension ProcessMessage public class SoapMessageLogger : SoapExtension\n{\n //…\n public override void P...
2008/09/29
[ "https://Stackoverflow.com/questions/149851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13611/" ]
149,852
<p>I have a couple variants of a program that I want to compare on performance. Both perform essentially the same task.</p> <p>One does it all in C and memory. The other calls an external utility and does file IO.</p> <p>How do I reliably compare them? </p> <p>1) Getting "time on CPU" using "time" favors the second ...
[ { "answer_id": 156887, "author": "n-alexander", "author_id": 23420, "author_profile": "https://Stackoverflow.com/users/23420", "pm_score": 1, "selected": false, "text": " clock_t times(struct tms *buf);\n struct tms {\n clock_t tms_utime; /* user time */\n clock_t...
2008/09/29
[ "https://Stackoverflow.com/questions/149852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23420/" ]
149,860
<p>I have a <code>popen()</code> function which executes <code>tail -f sometextfile</code>. Aslong as there is data in the filestream obviously I can get the data through <code>fgets()</code>. Now, if no new data comes from tail, <code>fgets()</code> hangs. I tried <code>ferror()</code> and <code>feof()</code> to no av...
[ { "answer_id": 149885, "author": "Sufian", "author_id": 9241, "author_profile": "https://Stackoverflow.com/users/9241", "pm_score": 4, "selected": false, "text": "fgets() select() poll() epoll() FILE* int fd = fileno(f);" }, { "answer_id": 149988, "author": "DGentry", "au...
2008/09/29
[ "https://Stackoverflow.com/questions/149860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10010/" ]
149,869
<p>Does it make sense to qualify bit fields as signed / unsigned?</p>
[ { "answer_id": 149950, "author": "tzot", "author_id": 6899, "author_profile": "https://Stackoverflow.com/users/6899", "pm_score": 3, "selected": false, "text": "struct {\n /* field 4 bits wide */\n unsigned field1 :4;\n /*\n * unnamed 3 bit field\n * unnamed fields allow for paddi...
2008/09/29
[ "https://Stackoverflow.com/questions/149869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
149,871
<p>I'm building a data warehouse that includes delivery information for restaurants. The data is stored in SQL Server 2005 and is then put into a SQL Server Analysis Services 2005 cube.</p> <p>The Deliveries information consists of the following tables:</p> <p><strong>FactDeliveres</strong></p> <ul> <li>BranchKey</l...
[ { "answer_id": 149951, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 2, "selected": false, "text": "Fact table:\nOrderDateID (not in your model, but probably should be, date dimension in a role)\nDeliveryDateID (date dim...
2008/09/29
[ "https://Stackoverflow.com/questions/149871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16279/" ]
149,909
<p>I would like to specify a constraint which is another type with a generic argument.</p> <pre><code>class KeyFrame&lt;T&gt; { public float Time; public T Value; } // I want any kind of Keyframe to be accepted class Timeline&lt;T&gt; where T : Keyframe&lt;*&gt; { } </code></pre> <p>But this cannot be done i...
[ { "answer_id": 149954, "author": "workmad3", "author_id": 16035, "author_profile": "https://Stackoverflow.com/users/16035", "pm_score": 2, "selected": false, "text": "class TimeLine<T>\n{\nprivate IList<KeyFrame<T>> keyFrameList;\n...\n}\n" }, { "answer_id": 149997, "author":...
2008/09/29
[ "https://Stackoverflow.com/questions/149909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7839/" ]
149,937
<p>Is there a way to deploy a Java program in a format that is not reverse-engineerable? </p> <p>I know how to convert my application into an executable JAR file, but I want to make sure that the code cannot be reverse engineered, or at least, not easily. </p> <p>Obfuscation of the source code doesn't count... it mak...
[ { "answer_id": 149957, "author": "Tanktalus", "author_id": 23512, "author_profile": "https://Stackoverflow.com/users/23512", "pm_score": 3, "selected": false, "text": ".class" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/149937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23249/" ]
149,956
<p>Does anyone know of a method to determine when a file copy completes in VBScript? I'm using the following to copy:</p> <pre><code>set sa = CreateObject("Shell.Application") set zip = sa.NameSpace(saveFile) set Fol = sa.NameSpace(folderToZip) zip.copyHere (Fol.items) </code></pre>
[ { "answer_id": 149979, "author": "Matt Dillard", "author_id": 863, "author_profile": "https://Stackoverflow.com/users/863", "pm_score": 2, "selected": false, "text": "FileSystemObject" }, { "answer_id": 149996, "author": "olle", "author_id": 22422, "author_profile": "...
2008/09/29
[ "https://Stackoverflow.com/questions/149956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14092/" ]
149,962
<p>I have an ASP.NET page which has a button it it. The button click launches a modal dialog box using JavaScript. Based on the value returned by the modal dialog box, I want to proceed with, or cancel the post back that happens. How do I do this?</p>
[ { "answer_id": 149982, "author": "Chris Cudmore", "author_id": 18907, "author_profile": "https://Stackoverflow.com/users/18907", "pm_score": 0, "selected": false, "text": "function HandleClick()\n{\n // do some work;\n\nif (some condition) return true; //proceed\nelse return false; //can...
2008/09/29
[ "https://Stackoverflow.com/questions/149962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1909/" ]
150,010
<p>I am creating a "department picker" form that is going to serve as a modal popup form with many of my "primary" forms of a Winforms application. Ideally the user is going to click on an icon next to a text box that will pop up the form, they will select the department they need, and when they click OK, the dialog wi...
[ { "answer_id": 150021, "author": "OregonGhost", "author_id": 20363, "author_profile": "https://Stackoverflow.com/users/20363", "pm_score": 3, "selected": true, "text": "using (var dlg = new DeptPicker()) {\n if (dlg.ShowDialog() == DialogResult.OK) {\n myTextBoxOrWhatEver.Text ...
2008/09/29
[ "https://Stackoverflow.com/questions/150010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/71/" ]
150,011
<p>My clients application exports and imports quite a few variables of type real through a text file using writeln and readln. I've tried to increase the width of the fields written so the code looks like: </p> <pre><code>writeln(file, exportRealvalue:30); //using excess width of field .... readln(file, importRealval...
[ { "answer_id": 150644, "author": "Toon Krijthe", "author_id": 18061, "author_profile": "https://Stackoverflow.com/users/18061", "pm_score": 3, "selected": true, "text": "WriteLn(RealVar:12:3);\n" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/150011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9077/" ]
150,017
<p>I have a query that I'm executing from a .NET application to a SQL Server database and it seems to take quite a while to complete (5+ Minutes). I created a test app in c# to try to see what was talking so long (the query should return quickly). </p> <p>As I was reconstructing the query by adding in elements to se...
[ { "answer_id": 150408, "author": "George Mastros", "author_id": 1408129, "author_profile": "https://Stackoverflow.com/users/1408129", "pm_score": 3, "selected": true, "text": "DBCC MemoryStatus\n\nSelect Columns... From TABLES.... Where....\n\ndbcc MemoryStatus\n\nSelect Columns... From ...
2008/09/29
[ "https://Stackoverflow.com/questions/150017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23553/" ]
150,031
<p>Does anyone have a good technique (or tutorial) to implement rulers within a C# Windows Forms application? I want to display an image while showing rulers that indicate your mouse position to allow a more accurate positioning of the cursor. Just like the image below:</p> <p><img src="https://i.stack.imgur.com/QfIIi...
[ { "answer_id": 150065, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 3, "selected": true, "text": "Paint()" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/150031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13115/" ]
150,033
<p>What is the easiest way to match non-ASCII characters in a regex? I would like to match all words individually in an input string, but the language may not be English, so I will need to match things like ü, ö, ß, and ñ. Also, this is in Javascript/jQuery, so any solution will need to apply to that. </p>
[ { "answer_id": 150078, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 9, "selected": true, "text": "[^\\x00-\\x7F]+\n [^\\u0000-\\u007F]+\n" }, { "answer_id": 873600, "author": "Community", "author_id": -1, ...
2008/09/29
[ "https://Stackoverflow.com/questions/150033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85/" ]
150,038
<p>I have a middle tier containing several related objects and a data tier that is using a DataSet with several DataTables and relationships.</p> <p>I want to call a Save method on one of my objects (a parent object) and have its private variable data transformed into a DataRow and added to a DataTable. Some of the p...
[ { "answer_id": 151255, "author": "Keith Sirmons", "author_id": 1048, "author_profile": "https://Stackoverflow.com/users/1048", "pm_score": 0, "selected": false, "text": "// some random save event in a gui.cs//\npublic void HandleSaveButtonClick()\n{ parentObject.Save(); }\n\n\n// Save in...
2008/09/29
[ "https://Stackoverflow.com/questions/150038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048/" ]
150,042
<p>I have tried this...</p> <pre><code>Dim myMatches As String() = System.Text.RegularExpressions.Regex.Split(postRow.Item("Post"), "\b\#\b") </code></pre> <p>But it is splitting all words, I want an array of words that start with#</p> <p>Thanks!</p>
[ { "answer_id": 150086, "author": "rslite", "author_id": 15682, "author_profile": "https://Stackoverflow.com/users/15682", "pm_score": 1, "selected": false, "text": "\"\\b#\\w+\\b\"\n" }, { "answer_id": 150087, "author": "Rory Becker", "author_id": 11356, "author_profi...
2008/09/29
[ "https://Stackoverflow.com/questions/150042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6514/" ]
150,044
<p>I'm new to ASP.NET and want to have an asp:content control for the page title, but I want that value to be used for the tag and for a page header. When I tried to do this with two tags with the same id, it complained that I couldn't have two tags with the same id. Is there a way to achieve this with contentplaceho...
[ { "answer_id": 150072, "author": "Mark Brackett", "author_id": 2199, "author_profile": "https://Stackoverflow.com/users/2199", "pm_score": 2, "selected": true, "text": "<%@ Page Language=\"C#\" MasterPageFile=\"~/default.master\" Title=\"My Content Title\" %>\n <h1><%= this.Page.Title %>...
2008/09/29
[ "https://Stackoverflow.com/questions/150044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6222/" ]
150,047
<p>Does anyone know how to get the name of the TARGET (/t) called from the MSBuild command line? There are a few types of targets that can be called and I want to use that property in a notification to users.</p> <p>Example:</p> <pre><code>msbuild Project.proj /t:ApplicationDeployment /p:Environment=DEV </code></pre>...
[ { "answer_id": 150271, "author": "Tim Booker", "author_id": 10046, "author_profile": "https://Stackoverflow.com/users/10046", "pm_score": 4, "selected": false, "text": "msbuild Project.proj /t:ApplicationDeployment /p:Environment=DEV;MyValue=ApplicationDeployment\n <Target Name=\"Applica...
2008/09/29
[ "https://Stackoverflow.com/questions/150047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18475/" ]
150,053
<p>How can I limit my post-build events to running only for one type of build?</p> <p>I'm using the events to copy DLL files to a local IIS virtual directory, but I don't want this happening on the build server in release mode.</p>
[ { "answer_id": 150070, "author": "Lou Franco", "author_id": 3937, "author_profile": "https://Stackoverflow.com/users/3937", "pm_score": 3, "selected": false, "text": "$(ConfigurationName)" }, { "answer_id": 150089, "author": "Franci Penov", "author_id": 17028, "author...
2008/09/29
[ "https://Stackoverflow.com/questions/150053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3615/" ]
150,058
<p>mysql5.0 with a pair of databases "A" and "B", both with large innodb tables. "drop database A;" freezes database "B" for a couple minutes. Nothing is using "A" at that point, so why is this such an intensive operation?</p> <p>Bonus points: Given that we use "A", upload data into "B", and then switch to using "B", ...
[ { "answer_id": 150763, "author": "Matt Rogish", "author_id": 2590, "author_profile": "https://Stackoverflow.com/users/2590", "pm_score": 3, "selected": false, "text": "innodb_file_per_table = 1\n" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/150058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12332/" ]
150,076
<p>I created a Rails application normally. Then created the scaffold for an event class. Then tried the following code. When run it complains about a InvalidAuthenticityToken when the destroy method is executed. How do I authenticate to avoid this response?</p> <pre><code>require 'rubygems' require 'activeresource' c...
[ { "answer_id": 150763, "author": "Matt Rogish", "author_id": 2590, "author_profile": "https://Stackoverflow.com/users/2590", "pm_score": 3, "selected": false, "text": "innodb_file_per_table = 1\n" } ]
2008/09/29
[ "https://Stackoverflow.com/questions/150076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/219658/" ]
150,084
<p>I have a collection of data stored in XDocuments and DataTables, and I'd like to address both as a single unified data space with XPath queries. So, for example, "/Root/Tables/Orders/FirstName" would fetch the value of the Firstname column in every row of the DataTable named "Orders". </p> <p>Is there a way to do t...
[ { "answer_id": 226818, "author": "Chris Wenham", "author_id": 5548, "author_profile": "https://Stackoverflow.com/users/5548", "pm_score": 2, "selected": true, "text": "Dictionary<string,DataTable> Tables = new Dictionary<string,DataTable>();\n// ... populate dictionary of tables ...\nXEl...
2008/09/29
[ "https://Stackoverflow.com/questions/150084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5548/" ]
150,095
<p>I need to substitute the value of a string into my regular expression in Ruby. Is there an easy way to do this? For example:</p> <pre><code>foo = "0.0.0.0" goo = "here is some other stuff 0.0.0.0" if goo =~ /value of foo here dynamically/ puts "success!" end </code></pre>
[ { "answer_id": 150108, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 2, "selected": false, "text": "if goo =~ Regexp.new(foo) # Evaluates to /0.0.0.0/\n" }, { "answer_id": 150110, "author": "JasonTrue", "au...
2008/09/29
[ "https://Stackoverflow.com/questions/150095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/422/" ]
150,113
<p>An older application using System.Web.Mail is throwing an exception on emails coming from <em>hr@domain.com</em>. Other addresses appear to be working correctly. We changed our mail server to Exchange 2007 when the errors started, so I assume that is where the problem is. Does anyone know what is happening?</p> <p>...
[ { "answer_id": 150108, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 2, "selected": false, "text": "if goo =~ Regexp.new(foo) # Evaluates to /0.0.0.0/\n" }, { "answer_id": 150110, "author": "JasonTrue", "au...
2008/09/29
[ "https://Stackoverflow.com/questions/150113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17287/" ]