qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
409,217
<p>First, let me say that I'm a complete beginner at Python. I've never learned the language, I just thought "how hard can it be" when Google turned up nothing but Python snippets to solve my problem. :)</p> <p>I have a bunch of mailboxes in Maildir format (a backup from the mail server on my old web host), and I need...
[ { "answer_id": 409249, "author": "Wayne Molina", "author_id": 40667, "author_profile": "https://Stackoverflow.com/users/40667", "pm_score": 0, "selected": false, "text": "<% if @user.admin? # is the user an admin %>\n <h3>Admin Tools</h3>\n<% end %>\n<p>Regular site content</p>\n" }, ...
2009/01/03
[ "https://Stackoverflow.com/questions/409217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33213/" ]
409,226
<p>is there any difference between:</p> <pre><code>lock((IDictionary) _collection).SyncRoot) </code></pre> <p>or</p> <pre><code>lock(_collection) </code></pre>
[ { "answer_id": 409242, "author": "Rauhotz", "author_id": 48722, "author_profile": "https://Stackoverflow.com/users/48722", "pm_score": 0, "selected": false, "text": "this" }, { "answer_id": 409246, "author": "R. Martinho Fernandes", "author_id": 46642, "author_profile...
2009/01/03
[ "https://Stackoverflow.com/questions/409226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4653/" ]
409,236
<p>I am getting back a "string[]" from a 3rd party library. I want to do a contains on it. what is the most efficient way of doing this?</p>
[ { "answer_id": 409238, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 4, "selected": true, "text": "bool contains = Array.IndexOf(arr, value) >= 0;\n" }, { "answer_id": 409243, "author": "Dmitri Nesteruk", ...
2009/01/03
[ "https://Stackoverflow.com/questions/409236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4653/" ]
409,256
<p>I have a byte array that represents a complete TCP/IP packet. For clarification, the byte array is ordered like this:</p> <p>(IP Header - 20 bytes)(TCP Header - 20 bytes)(Payload - X bytes)</p> <p>I have a <code>Parse</code> function that accepts a byte array and returns a <code>TCPHeader</code> object. It looks...
[ { "answer_id": 409267, "author": "Greg Beech", "author_id": 13552, "author_profile": "https://Stackoverflow.com/users/13552", "pm_score": 2, "selected": false, "text": "IEnumerable<byte>" }, { "answer_id": 409270, "author": "mmx", "author_id": 33708, "author_profile":...
2009/01/03
[ "https://Stackoverflow.com/questions/409256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51170/" ]
409,259
<p>I'm trying to do that for a couple of days now, and after reading tons of messages of people trying to do that too, I'm still unable to have a fully working <code>UITextField</code> in some of my <code>UITableViewCells</code>, just like in this example: </p> <p><img src="https://i.stack.imgur.com/gD4cE.png" alt="Sc...
[ { "answer_id": 412583, "author": "lostInTransit", "author_id": 46297, "author_profile": "https://Stackoverflow.com/users/46297", "pm_score": 4, "selected": false, "text": "UITextField *txtField = [[UITextField alloc] initWithFrame....]\n...\n[cell.contentView addSubview:txtField]\n" },...
2009/01/03
[ "https://Stackoverflow.com/questions/409259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50090/" ]
409,286
<p>Would you recommend using a <a href="https://dev.mysql.com/doc/refman/5.0/en/datetime.html" rel="noreferrer">datetime</a> or a <a href="https://dev.mysql.com/doc/refman/5.0/en/datetime.html" rel="noreferrer">timestamp</a> field, and why (using MySQL)? </p> <p>I'm working with PHP on the server side.</p>
[ { "answer_id": 409292, "author": "Mark Davidson", "author_id": 50866, "author_profile": "https://Stackoverflow.com/users/50866", "pm_score": 5, "selected": false, "text": "time();" }, { "answer_id": 409295, "author": "Jeff Warnica", "author_id": 321668, "author_profil...
2009/01/03
[ "https://Stackoverflow.com/questions/409286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25152/" ]
409,293
<p><strong>Exact Duplicate of:</strong> <a href="https://stackoverflow.com/questions/409069/getting-the-size-free-total-of-a-windows-mobile-phone-drive-using-c-not-solve">Getting the size (free,total) of a Windows Mobile phone drive using c#</a> <hr> dear all;</p> <p>i know my problem took alot of time and many of u h...
[ { "answer_id": 409322, "author": "casperOne", "author_id": 50776, "author_profile": "https://Stackoverflow.com/users/50776", "pm_score": 3, "selected": true, "text": "FolderInfo = (CONADefinitions.CONAPI_FOLDER_INFO)Marshal.PtrToStructure(Buffer, typeof(CONADefinitions.CONAPI_FOLDER_INFO...
2009/01/03
[ "https://Stackoverflow.com/questions/409293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42782/" ]
409,300
<p>The v4 series of the <code>gcc</code> compiler can automatically vectorize loops using the <a href="http://en.wikipedia.org/wiki/SIMD" rel="noreferrer">SIMD</a> processor on some modern CPUs, such as the AMD Athlon or Intel Pentium/Core chips. How is this done?</p>
[ { "answer_id": 409302, "author": "casualcoder", "author_id": 10578, "author_profile": "https://Stackoverflow.com/users/10578", "pm_score": 6, "selected": true, "text": "gcc -O2 -ftree-vectorize -msse2 -mfpmath=sse -ftree-vectorizer-verbose=5\n" }, { "answer_id": 1666961, "aut...
2009/01/03
[ "https://Stackoverflow.com/questions/409300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10578/" ]
409,321
<p>So I'm trying to build a simple forum. It'll be a list of topics in descending order by the date of either the topic (if no replies) or latest reply. Here's the DB structure:</p> <p><strong>forum_topic</strong></p> <blockquote> <p>id, name, email, body, date</p> </blockquote> <p><strong>forum_reply</strong></p>...
[ { "answer_id": 409345, "author": "Filip Ekberg", "author_id": 39106, "author_profile": "https://Stackoverflow.com/users/39106", "pm_score": 2, "selected": false, "text": "select * from forum_topic\ninner join forum_reply on forum_topic.id=topc_id\n" }, { "answer_id": 409346, ...
2009/01/03
[ "https://Stackoverflow.com/questions/409321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32881/" ]
409,325
<p>How do I check if a file is already used by another process from Powerscript ?</p>
[ { "answer_id": 411672, "author": "RealHowTo", "author_id": 25122, "author_profile": "https://Stackoverflow.com/users/25122", "pm_score": 3, "selected": true, "text": "FUNCTION Long CreateFile(ref string lpszName, long fdwAccess, long fdwShareMode, long lpsa, &\nlong fdwCreate, long fdwAt...
2009/01/03
[ "https://Stackoverflow.com/questions/409325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25122/" ]
409,342
<p>Do you think it may be OK for a person to have more than one role in a software development company that wants to use SCRUM?</p> <p>E.g. is it ok/possible if a person is</p> <ul> <li>SCRUM master and team member</li> <li>Product owner and team member</li> <li>SCRUM master and product owner</li> </ul> <p>Which com...
[ { "answer_id": 14946433, "author": "Paul Rowland", "author_id": 6268, "author_profile": "https://Stackoverflow.com/users/6268", "pm_score": 0, "selected": false, "text": "Scrum master and team member" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/409342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19635/" ]
409,348
<p>What is the correct way of iterating over a vector in C++?</p> <p>Consider these two code fragments, this one works fine:</p> <pre><code>for (unsigned i=0; i &lt; polygon.size(); i++) { sum += polygon[i]; } </code></pre> <p>and this one:</p> <pre><code>for (int i=0; i &lt; polygon.size(); i++) { sum += p...
[ { "answer_id": 409356, "author": "Igor", "author_id": 44673, "author_profile": "https://Stackoverflow.com/users/44673", "pm_score": 4, "selected": false, "text": "size_t" }, { "answer_id": 409358, "author": "Jasper Bekkers", "author_id": 31486, "author_profile": "http...
2009/01/03
[ "https://Stackoverflow.com/questions/409348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24545/" ]
409,351
<p>Some guy called one of my Snipplr submissions "crap" because I used <code>if ($_SERVER['REQUEST_METHOD'] == 'POST')</code> instead of <code>if ($_POST)</code></p> <p>Checking the request method seems more correct to me because that's what I really want to do. Is there some operational difference between the two or ...
[ { "answer_id": 409365, "author": "Alex UK", "author_id": 51174, "author_profile": "https://Stackoverflow.com/users/51174", "pm_score": -1, "selected": false, "text": "$_POST" }, { "answer_id": 409376, "author": "Eran Galperin", "author_id": 10585, "author_profile": "h...
2009/01/03
[ "https://Stackoverflow.com/questions/409351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6126/" ]
409,354
<p>Is there a way in Cocoa that is currently considered best practice for creating a multi-tier or client server application?</p> <p>I'm an experienced web developer and I really love Python. I'm new to Cocoa though. The application I'm toying with writing is a patient management system for a large hospital. The syste...
[ { "answer_id": 409925, "author": "Barry Wark", "author_id": 2140, "author_profile": "https://Stackoverflow.com/users/2140", "pm_score": 4, "selected": true, "text": "py2app" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/409354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6053/" ]
409,370
<p>I have the following data structure (a list of lists)</p> <pre><code>[ ['4', '21', '1', '14', '2008-10-24 15:42:58'], ['3', '22', '4', '2somename', '2008-10-24 15:22:03'], ['5', '21', '3', '19', '2008-10-24 15:45:45'], ['6', '21', '1', '1somename', '2008-10-24 15:45:49'], ['7', '22', '3', '2somename', '200...
[ { "answer_id": 409394, "author": "Federico A. Ramponi", "author_id": 18770, "author_profile": "https://Stackoverflow.com/users/18770", "pm_score": 2, "selected": false, "text": "l = [\n ['4', '21', '1', '14', '2008-10-24 15:42:58'], \n ['3', '22', '4', '2somename', '2008-10-24 15:22:03']...
2009/01/03
[ "https://Stackoverflow.com/questions/409370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51181/" ]
409,372
<p>I have a page where I would like it to remain static after refresh and does not default back to the top page again as it will disrupt the position I was viewing it last. Hence I have all the time to scroll down again to find the area I was viewing last. Is there a way of eliminating the burden of scrolling down agai...
[ { "answer_id": 2434861, "author": "Patrick Foley", "author_id": 44430, "author_profile": "https://Stackoverflow.com/users/44430", "pm_score": 2, "selected": false, "text": "<HTML>\n<HEAD>\n<TITLE>Test</TITLE>\n<script>\n function SaveScrollXY() {\n document.Form1.ScrollX.value = docu...
2009/01/03
[ "https://Stackoverflow.com/questions/409372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44973/" ]
409,385
<p>I have a VB6 application that I am converting to .net. I am doing this in phases so clients will have both VB6 and .net applications at the same. Part of the application caches ADO 2.8 COM recordsets to a table in SQL Server and retrieves them as needed. The .net application uses that same persisted recordsets. I ...
[ { "answer_id": 549793, "author": "casperOne", "author_id": 50776, "author_profile": "https://Stackoverflow.com/users/50776", "pm_score": 3, "selected": true, "text": "SqlConnection CreateConnection()\n{\n // Create the connection here and return it.\n return ...;\n}\n" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/409385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8219/" ]
409,434
<p>How can I automatically execute an Excel macro each time a value in a particular cell changes?</p> <p>Right now, my working code is:</p> <pre><code>Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("H5")) Is Nothing Then Macro End Sub </code></pre> <p>where <code>"H5"</code> i...
[ { "answer_id": 409439, "author": "Joe", "author_id": 13087, "author_profile": "https://Stackoverflow.com/users/13087", "pm_score": 3, "selected": false, "text": "Worksheet_Change" }, { "answer_id": 410876, "author": "Javier Torón", "author_id": 50730, "author_profile"...
2009/01/03
[ "https://Stackoverflow.com/questions/409434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34596/" ]
409,449
<p>I have a Python function in which I am doing some sanitisation of the input parameters:</p> <pre><code>def func(param1, param2, param3): param1 = param1 or '' param2 = param2 or '' param3 = param3 or '' </code></pre> <p>This caters for the arguments being passed as <em>None</em> rather than empty strin...
[ { "answer_id": 409467, "author": "llimllib", "author_id": 42559, "author_profile": "https://Stackoverflow.com/users/42559", "pm_score": -1, "selected": false, "text": "def func(x='', y='', z='hooray!'):\n print x, y, z\n\nIn [2]: f('test')\ntest hooray!\n\nIn [3]: f('test', 'and')\nt...
2009/01/03
[ "https://Stackoverflow.com/questions/409449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42974/" ]
409,454
<p>On C# 3.0 and .NET 3.5, imagine there's an interface:</p> <pre><code>public interface INameable { string Name {get;} } </code></pre> <p>and many immutable classes that implement the interface.</p> <p>I would like to have a single extension method</p> <pre><code>public static T Rename&lt;T&gt;(this T obj) where...
[ { "answer_id": 409481, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 1, "selected": false, "text": "SomeNameableObject a1 = new SomeNameableObject(\"ThisIsTheFirstName\");\nSomeNameableObject a2 = a1.Rename(\"ThisIsTh...
2009/01/03
[ "https://Stackoverflow.com/questions/409454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48722/" ]
409,465
<p>Does anyone know of a way to make Eclipse an SDI application rather than an MDI one? SDI - Single document interface, each pane is its own window MDI - Multiple document interface, all of the panes are stuck inside one "master" window.</p> <p>Eclipse is an MDI application. All of the little panes (like the call st...
[ { "answer_id": 412534, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 3, "selected": false, "text": "Window\\Save Perspective As" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/409465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51189/" ]
409,483
<p>I've been using C++ for about 6 or 7 years now, and I consider myself fluent in it. I've never bothered with Java until now, but I find myself out of the job (company went under) and I need to expand my skill set. Someone recommended Java, so I am wondering if there is any advice for where somebody like me might s...
[ { "answer_id": 409489, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "EnumSet" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/409483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43496/" ]
409,491
<p>This question originally asked which is the best method for uploading files via SFTP or FTPS in SSIS. It now just lists the pros and cons of each solution. I personally use CozyRoc's SFTP library these days, but I've used each of the below solutions at one point or another.</p> <p>SSIS COMPONENT LIBRARY</p> <p>M...
[ { "answer_id": 5800319, "author": "sacha79", "author_id": 726659, "author_profile": "https://Stackoverflow.com/users/726659", "pm_score": -1, "selected": false, "text": "Imports System\nImports Microsoft.SqlServer.Dts.Runtime\nImports Ftp\nImports System.IO\n\nPublic Class ScriptMain\n\n...
2009/01/03
[ "https://Stackoverflow.com/questions/409491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38332/" ]
409,495
<p>This question is language agnostic but I am a C# guy so I use the term POCO to mean an object that only preforms data storage, usually using getter and setter fields.</p> <p>I just reworked my Domain Model to be super-duper POCO and am left with a couple of concerns regarding how to ensure that the property values ...
[ { "answer_id": 409508, "author": "George Mauer", "author_id": 5056, "author_profile": "https://Stackoverflow.com/users/5056", "pm_score": 2, "selected": false, "text": "public class ServiceEndDateValidator : IValidator<Service> {\n public void Check(Service s) {\n if(s.EndDate > s.Co...
2009/01/03
[ "https://Stackoverflow.com/questions/409495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
409,496
<p>I have a php file which I will be using as exclusively as an include. Therefore I would like to throw an error instead of executing it when it's accessed directly by typing in the URL instead of being included.</p> <p>Basically I need to do a check as follows in the php file:</p> <pre><code>if ( $REQUEST_URL == $U...
[ { "answer_id": 409503, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 2, "selected": false, "text": "$including = true;\n" }, { "answer_id": 409511, "author": "Chuck", "author_id": 50742, "author_profile...
2009/01/03
[ "https://Stackoverflow.com/questions/409496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36848/" ]
409,507
<p>Is it possible to use PowerShell to script out SQL Server Reporting Services rdl files in SQL Server 2008? If so, can someone provide a code example of doing this? This would be a useful replacement for using a 3rd party tool to script out RDL files created by business users outside of my Business Intelligence dep...
[ { "answer_id": 3198967, "author": "Registered User", "author_id": 38332, "author_profile": "https://Stackoverflow.com/users/38332", "pm_score": 2, "selected": false, "text": "SELECT CONVERT(VARCHAR(MAX), CONVERT(NVARCHAR(MAX), CONVERT(XML, CONVERT(VARBINARY(MAX), Content))))\nFROM [Repor...
2009/01/03
[ "https://Stackoverflow.com/questions/409507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38332/" ]
409,512
<p>Is is possible to call a custom VB function, saved in the same Access Db, from a query written in that db, and if so, how?</p>
[ { "answer_id": 409534, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": true, "text": " CustomFunction([field])\n" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/409512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51205/" ]
409,529
<p>This particular example relates to Django in Python, but should apply to any language supporting exceptions:</p> <pre><code>try: object = ModelClass.objects.get(search=value) except DoesNotExist: pass if object: # do stuff </code></pre> <p>The Django model class provides a simple method <em>get</em> w...
[ { "answer_id": 409538, "author": "Greg Beech", "author_id": 13552, "author_profile": "https://Stackoverflow.com/users/13552", "pm_score": 4, "selected": true, "text": "get" }, { "answer_id": 409542, "author": "Ned Batchelder", "author_id": 14343, "author_profile": "ht...
2009/01/03
[ "https://Stackoverflow.com/questions/409529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42974/" ]
409,555
<p>I have three buttons and need to save some data. I have a idea, I have to set an ID to every button and then let the JS determinate witch button that has been pressed, like:</p> <pre><code>$("#mySpecifikButton").click(function() { ....some code here... }); </code></pre> <p>but then Im stuck. For example I have 9 u...
[ { "answer_id": 409567, "author": "Salty", "author_id": 50548, "author_profile": "https://Stackoverflow.com/users/50548", "pm_score": 3, "selected": true, "text": "<input type=\"button\" value=\"Button 1\" id=\"1\" />\n<input type=\"button\" value=\"Button 2\" id=\"2\" />\n<input type=\"b...
2009/01/03
[ "https://Stackoverflow.com/questions/409555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50896/" ]
409,560
<p>Is it better in some sense to vectorize code by hand, using explicit pragmas or to rely on or use auto-vectorization? For optimum performance using auto-vectorization, one would have to monitor the compiler output to ensure that loops are being vectorized or modify them until they are vectorizable. </p> <p>With h...
[ { "answer_id": 409723, "author": "Norman Ramsey", "author_id": 41661, "author_profile": "https://Stackoverflow.com/users/41661", "pm_score": 3, "selected": false, "text": "gcc" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/409560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10578/" ]
409,563
<p>I'm stuck deciding how to handle exceptions in my application. </p> <p>Much if my issues with exceptions comes from 1) accessing data via a remote service or 2) deserializing a JSON object. Unfortunately I can't guarantee success for either of these tasks (cut network connection, malformed JSON object that is out o...
[ { "answer_id": 409574, "author": "JoshBerke", "author_id": 26160, "author_profile": "https://Stackoverflow.com/users/26160", "pm_score": 5, "selected": false, "text": "try\n{\n //do something\n}\ncatch(Exception)\n{\n throw;\n}\n" }, { "answer_id": 409605, "author": "Yuv...
2009/01/03
[ "https://Stackoverflow.com/questions/409563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51211/" ]
409,599
<p>[EDIT] Hmm. Perhaps this question should be titled "what is the default user-input dialog view called in CocoaTouch?" I realize that I can create an entire view that is exactly what I want, and wrap it in a view controller and presentModalView -- but I was sort of hoping that there was a standard, normal user-inpu...
[ { "answer_id": 409714, "author": "Stephen Darlington", "author_id": 2998, "author_profile": "https://Stackoverflow.com/users/2998", "pm_score": 3, "selected": false, "text": "UIAlertView" }, { "answer_id": 412618, "author": "rpetrich", "author_id": 4007, "author_profi...
2009/01/03
[ "https://Stackoverflow.com/questions/409599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34820/" ]
409,619
<p>Does anyone know how to monitor long-running server-side processes in GWT, other than polling the server? We need to do some time-consuming, multiple-step, I/O-bound processing on the server, and it would be nice to display the progress of this processing in the browser.</p>
[ { "answer_id": 410070, "author": "cletus", "author_id": 18393, "author_profile": "https://Stackoverflow.com/users/18393", "pm_score": 3, "selected": true, "text": "checkStatus()" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/409619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49642/" ]
409,648
<p>is there a way to make the datatextfield property of a dropdownlist in asp.net via c# composed of more than one property of an object?</p> <pre><code>public class MyObject { public int Id { get; set; } public string Name { get; set; } public string FunkyValue { get; set; } public int Zip { get; set; } } pr...
[ { "answer_id": 409681, "author": "M4N", "author_id": 19635, "author_profile": "https://Stackoverflow.com/users/19635", "pm_score": 6, "selected": true, "text": "public string DisplayValue\n{\n get { return string.Format(\"{0} ({1})\", Name, Zip); }\n}\n" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/409648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49034/" ]
409,686
<p>I'm using Apache 2. I know how to handle .pl files as "cgi-script", but mod_perl is supposedly way faster. I successfully built and installed mod_perl, but how do I change httpd.conf so that .pl files will be handled by mod_perl (and not as cgi-script)?</p>
[ { "answer_id": 409693, "author": "helloandre", "author_id": 50, "author_profile": "https://Stackoverflow.com/users/50", "pm_score": 1, "selected": false, "text": "AddHandler mod_perl .pl" }, { "answer_id": 6037569, "author": "AndrewPK", "author_id": 705198, "author_pr...
2009/01/03
[ "https://Stackoverflow.com/questions/409686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
409,688
<p>This is a complex question, please consider carefully before answering.</p> <p>Consider this situation. Two threads (a reader and a writer) access a single global <code>int</code>. Is this safe? Normally, I would respond without thought, yes!</p> <p>However, it seems to me that Herb Sutter doesn't think so. In...
[ { "answer_id": 409749, "author": "Henk", "author_id": 4613, "author_profile": "https://Stackoverflow.com/users/4613", "pm_score": 2, "selected": false, "text": "volatile" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/409688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28817/" ]
409,705
<p>Ok, here is my dilemma I have a database set up with about 5 tables all with the exact same data structure. The data is separated in this manner for localization purposes and to split up a total of about 4.5 million records.</p> <p>A majority of the time only one table is needed and all is well. However, sometimes ...
[ { "answer_id": 409720, "author": "Mihai Limbășan", "author_id": 14444, "author_profile": "https://Stackoverflow.com/users/14444", "pm_score": 8, "selected": true, "text": "(SELECT * from us_music where `genre` = 'punk')\nUNION\n(SELECT * from de_music where `genre` = 'punk')\n" }, { ...
2009/01/03
[ "https://Stackoverflow.com/questions/409705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24802/" ]
409,727
<p>I just finished transferring as much link-structure data concerning wikipedia (English) as I could. Basically, I downloaded a bunch of SQL dumps from wikipedia's <a href="http://download.wikimedia.org/enwiki/latest/" rel="nofollow noreferrer">latest dump repository</a>. Since I am using PostgreSQL instead of MySQL, ...
[ { "answer_id": 409760, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 1, "selected": false, "text": "pl_namespace" }, { "answer_id": 409873, "author": "Barry Brown", "author_id": 17312, "author_profile...
2009/01/03
[ "https://Stackoverflow.com/questions/409727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49985/" ]
409,732
<p>I have a list of booleans where occasionally I reset them all to false. After first writing the reset as:</p> <pre><code>for b in bool_list: b = False </code></pre> <p>I found it doesn't work. I spent a moment scratching my head, then remembered that of course it won't work since I'm only changing a reference ...
[ { "answer_id": 409744, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 4, "selected": false, "text": "bool_list = [False] * len(bool_list)\n" }, { "answer_id": 409745, "author": "Zoomulator", "author_id": 44...
2009/01/03
[ "https://Stackoverflow.com/questions/409732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22897/" ]
409,761
<p>I am trying to insert a very long text string into a MySQL Blob column, but MySQL is only saving 64kB of the data. The string is 75360 characters long. I am connecting with PHP's <code>mysql_connect()</code>.</p> <p>Any ideas?</p> <p>Does it make a difference if it's Blob or Text. I originally had it as a Text but...
[ { "answer_id": 409779, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 3, "selected": false, "text": "BLOB" }, { "answer_id": 410093, "author": "meouw", "author_id": 12161, "author_profile": "https:...
2009/01/03
[ "https://Stackoverflow.com/questions/409761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
409,769
<p>I am using google's appengine api</p> <pre><code>from google.appengine.api import urlfetch </code></pre> <p>to fetch a webpage. The result of</p> <pre><code>result = urlfetch.fetch("http://www.example.com/index.html") </code></pre> <p>is a string of the html content (in result.content). The problem is the data...
[ { "answer_id": 409844, "author": "rob", "author_id": 43927, "author_profile": "https://Stackoverflow.com/users/43927", "pm_score": 3, "selected": true, "text": "import re\ndata = re.findall('<body>([^\\<]*)</body>', result)[0]\n" }, { "answer_id": 410142, "author": "S.Lott", ...
2009/01/03
[ "https://Stackoverflow.com/questions/409769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40619/" ]
409,783
<p>I recently saw a bit of code that looked like this (with sock being a socket object of course):</p> <pre><code>sock.shutdown(socket.SHUT_RDWR) sock.close() </code></pre> <p>What exactly is the purpose of calling shutdown on the socket and then closing it? If it makes a difference, this socket is being used for no...
[ { "answer_id": 598759, "author": "Robert S. Barnes", "author_id": 71074, "author_profile": "https://Stackoverflow.com/users/71074", "pm_score": 8, "selected": false, "text": "close" }, { "answer_id": 19009869, "author": "mykhal", "author_id": 234248, "author_profile":...
2009/01/03
[ "https://Stackoverflow.com/questions/409783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
409,784
<p>In Java, arrays don't override <code>toString()</code>, so if you try to print one directly, you get the <code>className</code> + '@' + the hex of the <a href="https://en.wikipedia.org/wiki/Java_hashCode()" rel="nofollow noreferrer"><code>hashCode</code></a> of the array, as defined by <code>Object.toString()</code>...
[ { "answer_id": 409795, "author": "Esko", "author_id": 44523, "author_profile": "https://Stackoverflow.com/users/44523", "pm_score": 13, "selected": true, "text": "Arrays.toString(arr)" }, { "answer_id": 409812, "author": "Limbic System", "author_id": 1274957, "author_...
2009/01/03
[ "https://Stackoverflow.com/questions/409784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12149/" ]
409,799
<p>I am trying to setup roles in a dynamic data website.. the problem is that i cant set it by simpy doing this. </p> <pre><code> &lt;location path="List.aspx"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow roles="Administrators" /&gt; &lt;deny users="*" /&gt; &lt;/authorizat...
[ { "answer_id": 898965, "author": "Merritt", "author_id": 60385, "author_profile": "https://Stackoverflow.com/users/60385", "pm_score": 3, "selected": false, "text": " <location path=\"Admin/<TableName>/List.aspx\">\n <system.web>\n <authorization>\n <allow roles=\"Adminis...
2009/01/03
[ "https://Stackoverflow.com/questions/409799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43838/" ]
409,827
<p>I'm trying to get my head around tuples (thanks @litb), and the common suggestion for their use is for functions returning > 1 value. </p> <p>This is something that I'd normally use a struct for , and I can't understand the advantages to tuples in this case - it seems an error-prone approach for the terminally lazy...
[ { "answer_id": 409838, "author": "Anteru", "author_id": 39912, "author_profile": "https://Stackoverflow.com/users/39912", "pm_score": 3, "selected": false, "text": "tie" }, { "answer_id": 409930, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile"...
2009/01/03
[ "https://Stackoverflow.com/questions/409827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1737/" ]
409,846
<p>Im new into that asp.net thing, but here goes.</p> <p>I got at ImageButton, and when its clicked i want the image displayed in another window. If I can avoid using ajax i would like to do that. If possible would like to make the window modal, but still avoid ajax, since Im not ready to mix more technolgies yet.</p>...
[ { "answer_id": 409851, "author": "Filip Ekberg", "author_id": 39106, "author_profile": "https://Stackoverflow.com/users/39106", "pm_score": 0, "selected": false, "text": "<asp:ImageButton ID=\"imbJoin\" CssClass=\"btn-find\" AlternateText=\"Find\" ToolTip=\"Find\" runat=\"server\" ImageU...
2009/01/03
[ "https://Stackoverflow.com/questions/409846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36476/" ]
409,849
<p>I am trying to select 100s of rows at a DB that contains 100000s of row and update those rows afters.</p> <p>the problem is I don't want to go to DB twice for this purpose since update only marks those rows as "read".</p> <p>is there any way I can do this in java using simple jdbc libraries? (hopefully without usi...
[ { "answer_id": 409943, "author": "Todd", "author_id": 49746, "author_profile": "https://Stackoverflow.com/users/49746", "pm_score": 2, "selected": false, "text": "update table_x\nset read = 'T'\nwhere date > sysdate-1;\n" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/409849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51238/" ]
409,886
<p>I can send any windows application key strokes with <code>PostMessage</code> api. But I can't send key strokes to Game window by using <code>PostMessage</code>.</p> <p>Anyone know anything about using Direct Input functions for sending keys to games from C#.</p>
[ { "answer_id": 20898776, "author": "Jason", "author_id": 555547, "author_profile": "https://Stackoverflow.com/users/555547", "pm_score": 3, "selected": false, "text": "input.MoveMouseTo(5, 5);\ninput.MoveMouseBy(25, 25);\ninput.SendLeftClick();\n\ninput.KeyDelay = 1; // See below for exp...
2009/01/03
[ "https://Stackoverflow.com/questions/409886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50985/" ]
409,916
<p>I'm creating a indoor navigation application (with the intention that a user can store maps for different buildings in the phones file system). The application starts up by asking the user to select a map for the desired building. Once this has been selected, a file parser would be used to parse and convert the map ...
[ { "answer_id": 410043, "author": "Honza", "author_id": 8621, "author_profile": "https://Stackoverflow.com/users/8621", "pm_score": 2, "selected": false, "text": "InputStream is = getClass().getResourceAsStream(\"/OceanFish.gif\");\nDataInputStream di = new DataInputStream(is);\nStaticAni...
2009/01/03
[ "https://Stackoverflow.com/questions/409916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51243/" ]
409,919
<p>I'm trying to work this out.</p> <p>In my project, i have a file called 'Hello.java' which is the file with the main() argument and which is called when the program is compiled. And I have another file called MyObj.java which has got just a random class I made up to test java's OO features. I'm trying to do this:</...
[ { "answer_id": 409927, "author": "Ross", "author_id": 29173, "author_profile": "https://Stackoverflow.com/users/29173", "pm_score": 5, "selected": true, "text": "/* Static */\nclass Hello {\n public static MyObj an_obj;\n public static void main(String[] args) { \n setObj();...
2009/01/03
[ "https://Stackoverflow.com/questions/409919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49153/" ]
409,932
<p>I have code where I schedule a task using <code>java.util.Timer</code>. I was looking around and saw <code>ExecutorService</code> can do the same. So this question here, have you used <code>Timer</code> and <code>ExecutorService</code> to schedule tasks, what is the benefit of one using over another?</p> <p>Also wa...
[ { "answer_id": 409993, "author": "Peter Štibraný", "author_id": 47190, "author_profile": "https://Stackoverflow.com/users/47190", "pm_score": 9, "selected": true, "text": "Timer" }, { "answer_id": 410220, "author": "Neil Coffey", "author_id": 48933, "author_profile": ...
2009/01/03
[ "https://Stackoverflow.com/questions/409932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43756/" ]
409,945
<p>How, being inside the main form of my WinForm app can I tell if there are any modal windows/dialogs open that belong to the main form?</p>
[ { "answer_id": 409989, "author": "Juliet", "author_id": 40516, "author_profile": "https://Stackoverflow.com/users/40516", "pm_score": 3, "selected": false, "text": "foreach (Form f in Application.OpenForms)\n{\n if (f.Modal)\n {\n // do stuff\n }\n}\n" }, { "answe...
2009/01/03
[ "https://Stackoverflow.com/questions/409945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18046/" ]
409,949
<p>I've been using mutagen for reading and writing MP3 tags, but I want to be able to embed album art directly into the file.</p>
[ { "answer_id": 1002814, "author": "Owen", "author_id": 2109, "author_profile": "https://Stackoverflow.com/users/2109", "pm_score": 4, "selected": false, "text": "def update_id3(mp3_file_name, artwork_file_name, artist, item_title): \n #edit the ID3 tag to add the title, artist, art...
2009/01/03
[ "https://Stackoverflow.com/questions/409949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
409,955
<p>Does heavy use of unit tests discourage the use of debug asserts? It seems like a debug assert firing in the code under test implies the unit test shouldn't exist or the debug assert shouldn't exist. "There can be only one" seems like a reasonable principle. Is this the common practice? Or do you disable your debu...
[ { "answer_id": 2595786, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 3, "selected": false, "text": "Debug.Assert" }, { "answer_id": 2595941, "author": "Paul Kohler", "author_id": 276563, "author_prof...
2009/01/03
[ "https://Stackoverflow.com/questions/409955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3892/" ]
409,969
<p>I've looked at other definitions and explanations and none of them satisfy me. I want to see if anybody can define polymorphism in at most two sentences without using any code or examples. I don't want to hear 'So you have a person/car/can opener...' or how the word is derived (nobody is impressed that you know what...
[ { "answer_id": 15182108, "author": "jazziiilove", "author_id": 2128050, "author_profile": "https://Stackoverflow.com/users/2128050", "pm_score": 0, "selected": false, "text": "List list = new List();\n" }, { "answer_id": 21112443, "author": "Nicolas Rinaudo", "author_id":...
2009/01/03
[ "https://Stackoverflow.com/questions/409969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51248/" ]
409,991
<p>I am trying to execute this SQL command:</p> <pre><code>SELECT page.page_namespace, pagelinks.pl_namespace, COUNT(*) FROM page, pagelinks WHERE (page.page_namespace &lt;=3 OR page.page_namespace = 12 OR page.page_namespace = 13 ) AND (pagelinks.pl_namespace &...
[ { "answer_id": 410037, "author": "Peter Becker", "author_id": 19820, "author_profile": "https://Stackoverflow.com/users/19820", "pm_score": 0, "selected": false, "text": "page.page_namespace <=3" }, { "answer_id": 410057, "author": "Adrian Pronk", "author_id": 41861, ...
2009/01/03
[ "https://Stackoverflow.com/questions/409991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49985/" ]
409,995
<p>How would I truncate a sentence at a certain character:</p> <p>$sentence = 'Stack Overflow - Ask Questions Here';</p> <p>so that only the following is echoed:</p> <p>Stack Overflow</p> <p>The character count varies, but the stop point is always "Space Dash Space"</p>
[ { "answer_id": 410032, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 0, "selected": false, "text": "$variable" }, { "answer_id": 410066, "author": "Rob Cowie", "author_id": 46690, "author_profile"...
2009/01/03
[ "https://Stackoverflow.com/questions/409995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
409,999
<p>I want to retrieve information like the city, state, and country of a visitor from their IP address, so that I can customize my web page according to their location. Is there a good and reliable way to do this in PHP? I am using JavaScript for client-side scripting, PHP for server-side scripting, and MySQL for the d...
[ { "answer_id": 410014, "author": "Isaac Waller", "author_id": 764272, "author_profile": "https://Stackoverflow.com/users/764272", "pm_score": 3, "selected": false, "text": "$data = file_get_contents(\"http://api.hostip.info/country.php?ip=12.215.42.19\");\n//$data contains: \"US\"\n\n$da...
2009/01/03
[ "https://Stackoverflow.com/questions/409999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
410,002
<p>PHP has the habit of evaluating (int)0 and (string)"0" as empty when using the <code>empty()</code> function. This can have unintended results if you expect numerical or string values of 0. How can I "fix" it to only return true to empty objects, arrays, strings, etc?</p>
[ { "answer_id": 410003, "author": "null", "author_id": 25411, "author_profile": "https://Stackoverflow.com/users/25411", "pm_score": 0, "selected": false, "text": "IsEmpty()" }, { "answer_id": 410044, "author": "Bill Karwin", "author_id": 20860, "author_profile": "http...
2009/01/03
[ "https://Stackoverflow.com/questions/410002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25411/" ]
410,005
<p>I'm relatively new to the Component Object Model specification - I have a simple question:</p> <ul> <li> How can I access a <b>COM interface</b> from a C or C++ application </ul> <p>For instance, accessing Microsoft Excel COM interface to perform basic operations, without user intervention.</p> <p>Kind regards</...
[ { "answer_id": 410003, "author": "null", "author_id": 25411, "author_profile": "https://Stackoverflow.com/users/25411", "pm_score": 0, "selected": false, "text": "IsEmpty()" }, { "answer_id": 410044, "author": "Bill Karwin", "author_id": 20860, "author_profile": "http...
2009/01/03
[ "https://Stackoverflow.com/questions/410005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51078/" ]
410,011
<p>Right now in Flash CS3 and up (using Actionscript 3) if you have the same instance that is used in multiple keyframes in a layer, and you decide to assign or change the instance name later, you would have to go to each keyframe and set the instance name. This is a big nuisance. Is there a quicker or better way to ...
[ { "answer_id": 410781, "author": "Soviut", "author_id": 46914, "author_profile": "https://Stackoverflow.com/users/46914", "pm_score": 3, "selected": false, "text": "var prefix:String = \"myInstance_\";\nfor(i in fl.getDocumentDOM().selection)\n{\n fl.getDocumentDOM().selection[i].name...
2009/01/03
[ "https://Stackoverflow.com/questions/410011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51258/" ]
410,013
<p>I've noticed on OSX, installation is frequently a drag and drop one file kinda deal. I assume that file is an archive of all the applications necessary bits and that the application runs directly from it. Where does the application store configuration data, particularly per user settings when there are multiple us...
[ { "answer_id": 410023, "author": "harms", "author_id": 41489, "author_profile": "https://Stackoverflow.com/users/41489", "pm_score": 8, "selected": true, "text": "/Users/username/Library/Preferences" }, { "answer_id": 36725188, "author": "ThorstenC", "author_id": 1664943,...
2009/01/03
[ "https://Stackoverflow.com/questions/410013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51259/" ]
410,022
<p>Can a <strong>PHP script</strong> (which can be working with a MySQL DB) <strong>send and/or receive SMSs</strong> using some sort of server-side solution?</p> <p>Any special server-side <strong>application</strong>, or special <strong>hardware</strong> required? And compatibility? Windows, <strong>Linux?</strong><...
[ { "answer_id": 45932943, "author": "Serve", "author_id": 8295711, "author_profile": "https://Stackoverflow.com/users/8295711", "pm_score": 1, "selected": false, "text": "function CURLsendsms($number, $message_body){\n $api_params = $api_element.'?apikey='.$apikey.'&sender='.$sender.'&to=...
2009/01/03
[ "https://Stackoverflow.com/questions/410022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41021/" ]
410,026
<p>The <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/yield" rel="noreferrer">yield</a> keyword is one of those <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/" rel="noreferrer">keywords</a> in C# that continues to mystify me, and I've never be...
[ { "answer_id": 410047, "author": "petr k.", "author_id": 15497, "author_profile": "https://Stackoverflow.com/users/15497", "pm_score": 3, "selected": false, "text": "public static IEnumerable<Product> GetAllProducts()\n{\n using (AdventureWorksEntities db = new AdventureWorksEntities(...
2009/01/03
[ "https://Stackoverflow.com/questions/410026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10792/" ]
410,062
<p>Functions in Python can be called using keyword arguments of the form keyword = value. For instance, the following function:</p> <pre><code>def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'): print "-- This parrot wouldn't", action, print "if you put", voltage, "volts through it." ...
[ { "answer_id": 410104, "author": "grapefrukt", "author_id": 914, "author_profile": "https://Stackoverflow.com/users/914", "pm_score": 3, "selected": false, "text": "public function awesomefunction(input:Object):void {\n if (input.foo) trace(\"got foo\");\n if (input.bar) trace(\"go...
2009/01/03
[ "https://Stackoverflow.com/questions/410062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
410,073
<p>I've seen many questions about this, but i've never really got the answer that I need. </p> <p>I'm converting a fairly large web application from Web Forms to MVC and after a while I encountred a problem with passing data to the view. In the Action I execute the code: </p> <p><code>//This is just an example ViewDa...
[ { "answer_id": 410139, "author": "ccook", "author_id": 51275, "author_profile": "https://Stackoverflow.com/users/51275", "pm_score": 1, "selected": false, "text": "ViewData[\"QUsers\"] = (from u in db.Users select u).ToList();\n\nforeach(Users u in (List<Users>)ViewData[\"QUsers\"]){ \n\...
2009/01/03
[ "https://Stackoverflow.com/questions/410073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51269/" ]
410,089
<p>How do I append the previous item in array to the next item in the array for unknown number of items?</p> <p>Here is what I'm trying to do. I have a string containing an LDAP path such as "OU=3,OU=2,OU=1,DC=Internal,DC=Net", I want to create each container in the above LDAP path so from the above string I need to c...
[ { "answer_id": 410117, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 0, "selected": false, "text": "static string[] Split(string path)\n{\n const string postfix = \",DC=Internal,DC=Net\";\n string shortPath = path.S...
2009/01/03
[ "https://Stackoverflow.com/questions/410089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
410,109
<p>Are there any helper libs to read a cookie file in php. I have a cookie file on my local disk and I would like a better way of reading it. I am currently just reading to file like by line and parsing out the values.</p>
[ { "answer_id": 410159, "author": "null", "author_id": 25411, "author_profile": "https://Stackoverflow.com/users/25411", "pm_score": 0, "selected": false, "text": "setcookie()" }, { "answer_id": 410165, "author": "lpfavreau", "author_id": 35935, "author_profile": "http...
2009/01/03
[ "https://Stackoverflow.com/questions/410109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
410,111
<p>I'm an Objective-C developer porting an application to the .Net world. In my Obj-C application, I use NSNotification objects to communicate asynchronously between a handful of objects. Is there some way to do something similar in the .Net world (more specifically, using the C# language)? The fundamental approach is ...
[ { "answer_id": 49100535, "author": "Hussein Juybari", "author_id": 5229540, "author_profile": "https://Stackoverflow.com/users/5229540", "pm_score": 0, "selected": false, "text": "NotificationCenter" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/410111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44641/" ]
410,112
<p>Is it possible to use LINQ in win32 DELPHI applications</p>
[ { "answer_id": 410123, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 2, "selected": false, "text": "var query = from it in \"foobar\" select Char.ToUpper(it);\n" } ]
2009/01/03
[ "https://Stackoverflow.com/questions/410112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48705/" ]
410,127
<p>I'm the developer of the trash-cli project.</p> <p>The trash-cli project is a opensource implementation of the FreeDesktop.org Trash Specification that provides a command line interface to manage the trashcan.</p> <p>Ideally trash-cli provides these commands:</p> <ul> <li>trash <em>(trashes files and d...
[ { "answer_id": 410151, "author": "slim", "author_id": 7512, "author_profile": "https://Stackoverflow.com/users/7512", "pm_score": 3, "selected": false, "text": "tf" }, { "answer_id": 410977, "author": "joel.neely", "author_id": 3525, "author_profile": "https://Stackov...
2009/01/04
[ "https://Stackoverflow.com/questions/410127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36131/" ]
410,146
<p>One of the advantages of Flash/Flex is that you can use vector graphics (SVG), which is nice. I did a bit of searching around and came across this <a href="http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm" rel="noreferrer">Javascript vector graphics library</a>. It's pretty simple stuff but it got me thinking...
[ { "answer_id": 54959999, "author": "mirageglobe", "author_id": 154365, "author_profile": "https://Stackoverflow.com/users/154365", "pm_score": 0, "selected": false, "text": "$ meteor add mirageglobe:snapsvgcdn\n" } ]
2009/01/04
[ "https://Stackoverflow.com/questions/410146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18393/" ]
410,150
<p>I came across a site that demonstrated a Javascript library and it asked that you please not link to the Javascript file directly from your site. That's a reasonable request. In fact, it wouldn't have occurred to me to do that instead of hosting it myself but I guess will try and save on bandwidth any way they can...
[ { "answer_id": 410168, "author": "Forrest Marvez", "author_id": 51237, "author_profile": "https://Stackoverflow.com/users/51237", "pm_score": 4, "selected": true, "text": "RewriteEngine on\nRewriteCond %{HTTP_REFERER} !^$\nRewriteCond %{HTTP_REFERER} !^http://(www\\.)?yourdomain.com(/)?....
2009/01/04
[ "https://Stackoverflow.com/questions/410150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18393/" ]
410,163
<p>I'm learning Python now because of the Django framework. I have been a Perl programmer for a number of years and I'm so used to Perl's tools. One of the things that I really miss is Perl's CPAN and its tools. Is there anything equivalent in Python? I would like to be able to search, install and maintain Python m...
[ { "answer_id": 653629, "author": "denis", "author_id": 86643, "author_profile": "https://Stackoverflow.com/users/86643", "pm_score": 2, "selected": false, "text": "easy_install" } ]
2009/01/04
[ "https://Stackoverflow.com/questions/410163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31026/" ]
410,178
<p>I have once tried to use typed DateSets in a relatively small production application. Initially it looked like a pretty good idea, but turned out to be different. It was pretty fine for some basic tasks, but as soon as something more advanced was required, it's limitations kicked in and it failed miserably. Luckily ...
[ { "answer_id": 410194, "author": "Ady", "author_id": 31395, "author_profile": "https://Stackoverflow.com/users/31395", "pm_score": 2, "selected": false, "text": "" } ]
2009/01/04
[ "https://Stackoverflow.com/questions/410178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41360/" ]
410,186
<p>I have found some info on the subject (<a href="http://rubylearning.com/satishtalim/object_serialization.html" rel="noreferrer">like this link)</a>, but nothing that tells me how it actually works under the covers. If you don't want to read the essay below, here are the real questions:</p> <ol> <li><p>How should I...
[ { "answer_id": 410290, "author": "Chuck", "author_id": 50742, "author_profile": "https://Stackoverflow.com/users/50742", "pm_score": 4, "selected": true, "text": "marshal_dump" }, { "answer_id": 40082657, "author": "wedesoft", "author_id": 382784, "author_profile": "h...
2009/01/04
[ "https://Stackoverflow.com/questions/410186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1053/" ]
410,221
<p>I'd like a way to show natural times for dated items in Python. Similar to how Twitter will show a message from "a moment ago", "a few minutes ago", "two hours ago", "three days ago", etc.</p> <p>Django 1.0 has a "humanize" method in django.contrib. I'm not using the Django framework, and even if I were, it's more ...
[ { "answer_id": 410482, "author": "runeh", "author_id": 2906, "author_profile": "https://Stackoverflow.com/users/2906", "pm_score": 5, "selected": true, "text": "from datetime import timedelta\nfrom babel.dates import format_timedelta\ndelta = timedelta(days=6)\nformat_timedelta(delta, lo...
2009/01/04
[ "https://Stackoverflow.com/questions/410221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9106/" ]
410,222
<p>I know that a lot of examples exist where a SqlConnection is defined and then a SqlCommand is defined, both in Using blocks:</p> <pre><code>using (var conn = new SqlConnection(connString)) { using (var cmd = new SqlCommand()) { cmd.Connection = conn; //open the connection } } </code></pr...
[ { "answer_id": 410237, "author": "Andrew Hare", "author_id": 34211, "author_profile": "https://Stackoverflow.com/users/34211", "pm_score": 3, "selected": false, "text": "using" } ]
2009/01/04
[ "https://Stackoverflow.com/questions/410222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10104/" ]
410,224
<p>How can I go about creating a UITableView with taller cells? Basically, I want to create a full screen table with only four cells, but they should take up the entire screen (1/4 each).</p> <p>Assuming this is possible using a UITableView, can it be done both in code and in Interface Builder? And also, can each cell...
[ { "answer_id": 410585, "author": "jpm", "author_id": 35478, "author_profile": "https://Stackoverflow.com/users/35478", "pm_score": 3, "selected": false, "text": "-tableView:heightForRowAtIndexPath:" } ]
2009/01/04
[ "https://Stackoverflow.com/questions/410224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5284/" ]
410,227
<p>What is the simplest way of testing if an object implements a given interface in C#? (Answer to this question <a href="https://stackoverflow.com/questions/766106/test-if-object-implements-interface">in Java</a>)</p>
[ { "answer_id": 410230, "author": "Robert C. Barth", "author_id": 9209, "author_profile": "https://Stackoverflow.com/users/9209", "pm_score": 10, "selected": true, "text": "if (object is IBlah)\n" }, { "answer_id": 410233, "author": "Rauhotz", "author_id": 48722, "auth...
2009/01/04
[ "https://Stackoverflow.com/questions/410227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23276/" ]
410,236
<p>When overriding the equals() function of java.lang.Object, the javadocs suggest that, </p> <blockquote> <p>it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal ...
[ { "answer_id": 410246, "author": "Marc Novakowski", "author_id": 27020, "author_profile": "https://Stackoverflow.com/users/27020", "pm_score": 6, "selected": true, "text": "public int hashCode() {\n int result = name != null ? name.hashCode() : 0;\n result = 31 * result + age;\n ...
2009/01/04
[ "https://Stackoverflow.com/questions/410236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48728/" ]
410,243
<p>I have my MySQL database server on Server 1. I want to have my Rails apps on two other servers - say A and B to be able to connect to this Server 1. What's the best way to do this?</p> <p>In the my.cnf file it appears I can use the bind-address to bind to one and only one IP address. I can't specify the IP addresse...
[ { "answer_id": 410244, "author": "Michael Haren", "author_id": 29, "author_profile": "https://Stackoverflow.com/users/29", "pm_score": 2, "selected": false, "text": "bind-address" }, { "answer_id": 410377, "author": "Florin Andrei", "author_id": 49330, "author_profile...
2009/01/04
[ "https://Stackoverflow.com/questions/410243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
410,253
<p>We have an embedded device that needs to interact with an enterprise software system. </p> <p>The enterprise system currently uses many different mechanisms for communication between its components: ODBC, RPC, proprietary protocol over TCP/IP, and is moving to .Net-implmented web services.</p> <p>The embedded dev...
[ { "answer_id": 410244, "author": "Michael Haren", "author_id": 29, "author_profile": "https://Stackoverflow.com/users/29", "pm_score": 2, "selected": false, "text": "bind-address" }, { "answer_id": 410377, "author": "Florin Andrei", "author_id": 49330, "author_profile...
2009/01/04
[ "https://Stackoverflow.com/questions/410253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12570/" ]
410,270
<p>Or should you always create some other lock object?</p>
[ { "answer_id": 410274, "author": "Michael Haren", "author_id": 29, "author_profile": "https://Stackoverflow.com/users/29", "pm_score": 5, "selected": true, "text": ".SyncRoot" } ]
2009/01/04
[ "https://Stackoverflow.com/questions/410270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4653/" ]
410,278
<p>There are methods to transfer a CGPoint from one UIView to another and from one CALayer to another. I cannot find a way to change a CGPoint from a UIView's coordinate system to a CALayer's coordinate system. </p> <p>Does a layer and it's host view have the same coordinate system? Do I need to transform points bet...
[ { "answer_id": 412098, "author": "Lily Ballard", "author_id": 582, "author_profile": "https://Stackoverflow.com/users/582", "pm_score": 3, "selected": true, "text": "transform" }, { "answer_id": 587619, "author": "schwa", "author_id": 23113, "author_profile": "https:/...
2009/01/04
[ "https://Stackoverflow.com/questions/410278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48311/" ]
410,313
<p>I would like to render to an offscreen bitmap (or array of RGBA values) and then blit those to a <code>UIView</code> during in the view's <code>drawRect</code> function. I would prefer to do full 32-bit rendering (including alpha channel), but would also be content with 24-bit rendering.</p> <p>Would anyone mind po...
[ { "answer_id": 657288, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "CGDataProviderCreateWithData" }, { "answer_id": 1962986, "author": "benzado", "author_id": 10947, "author_...
2009/01/04
[ "https://Stackoverflow.com/questions/410313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/338/" ]
410,324
<p>Is there a way I can write text to a file from a certain point in the file?</p> <p>For example, I open a file of 10 lines of text but I want to write a line of text to the 5th line.</p> <p>I guess one way is to get the lines of text in the file back as an array using the readalllines method, and then add a line at...
[ { "answer_id": 410332, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 3, "selected": true, "text": "open master file for reading.\ncount := 0\nwhile not EOF do\n read line from master file into buffer\n write l...
2009/01/04
[ "https://Stackoverflow.com/questions/410324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32484/" ]
410,343
<p>I have a generic Callback object which provides a (primitive) callback capability for Java, in the absence of closures. The Callback object contains a Method, and returns the parameter and return types for the method via a couple of accessor methods that just delegate to the equivalent methods in Method.</p> <p>I ...
[ { "answer_id": 410352, "author": "Apocalisp", "author_id": 3434, "author_profile": "https://Stackoverflow.com/users/3434", "pm_score": 1, "selected": false, "text": "public interface F<A, B> {\n public B $(A a);\n}\n" } ]
2009/01/04
[ "https://Stackoverflow.com/questions/410343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8946/" ]
410,355
<p>I have a model, Thing, that has a has_many with ThingPhoto, using Paperclip to manage everything. On the "show" view for Thing, I want to have a file upload, and have it relate to the Thing model.</p> <p>For some reason, I'm totally glitching on how this should be done. I've tried doing this (Haml):</p> <pre><code...
[ { "answer_id": 410371, "author": "zenazn", "author_id": 46848, "author_profile": "https://Stackoverflow.com/users/46848", "pm_score": 0, "selected": false, "text": ".first" }, { "answer_id": 410503, "author": "PJ Davis", "author_id": 39077, "author_profile": "https://...
2009/01/04
[ "https://Stackoverflow.com/questions/410355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/722/" ]
410,391
<p>Okay so a continuation from <a href="https://stackoverflow.com/questions/409913/can-php-be-installed-on-a-local-machine">this question</a>, where you experts intro'd me to <a href="http://www.wampserver.com/en/presentation.php" rel="nofollow noreferrer">WAMP</a>, which can basically execute PHP within a Windows XP e...
[ { "answer_id": 7176802, "author": "deepika ", "author_id": 909788, "author_profile": "https://Stackoverflow.com/users/909788", "pm_score": 3, "selected": false, "text": "Listen 80" }, { "answer_id": 13766222, "author": "jchapa", "author_id": 228353, "author_profile": ...
2009/01/04
[ "https://Stackoverflow.com/questions/410391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41021/" ]
410,392
<p>I'm working on a Django-based application in a corporate environment and would like to use the existing Active Directory system for authentication of users (so they don't get yet another login/password combo). I would also like to continue to use Django's user authorization / permission system to manage user capabi...
[ { "answer_id": 7914309, "author": "dgorissen", "author_id": 494572, "author_profile": "https://Stackoverflow.com/users/494572", "pm_score": 3, "selected": false, "text": "group=Group.objects.get(pk=1)\n" }, { "answer_id": 51919165, "author": "partofthething", "author_id":...
2009/01/04
[ "https://Stackoverflow.com/questions/410392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40529/" ]
410,393
<p>I want to recomment Git to my boss as a new source control system, since we're stuck in the 90s with VSS (ouch), but are the tools and 3rd party support good enough yet?</p> <p>Specifically I'm talking about GUI front-ends similar to TortoiseSVN, decent visual diff/merge support, as well as stuff like email commit ...
[ { "answer_id": 410487, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 5, "selected": false, "text": "git-svn" } ]
2009/01/04
[ "https://Stackoverflow.com/questions/410393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49658/" ]
410,396
<p>Can anybody let me know that what permission does public have in sql server.</p> <p>Thanks</p>
[ { "answer_id": 410425, "author": "Mitchell Gilman", "author_id": 43219, "author_profile": "https://Stackoverflow.com/users/43219", "pm_score": 4, "selected": false, "text": "*" } ]
2009/01/04
[ "https://Stackoverflow.com/questions/410396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47957/" ]
410,411
<p>I'm writing a sidebar extension for Firefox and need a way to get the URL of the current page so I can check it against a database and display the results. How can I do this?</p>
[ { "answer_id": 410915, "author": "wimh", "author_id": 33499, "author_profile": "https://Stackoverflow.com/users/33499", "pm_score": 5, "selected": true, "text": "window.top.getBrowser().selectedBrowser.contentWindow.location.href;\n" }, { "answer_id": 445405, "author": "Nicko...
2009/01/04
[ "https://Stackoverflow.com/questions/410411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51310/" ]
410,417
<p>I was looking through my code and I found a couple of extension methods that I wrote in order to remove items from a System.Collections.Generic.Stack. I was curious, so I looked at the source of Stack with Reflector and I can see that they implemented it as an array instead of a linked list and I'm just wondering wh...
[ { "answer_id": 410684, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "Stack<byte>" } ]
2009/01/04
[ "https://Stackoverflow.com/questions/410417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16387/" ]
410,419
<p>I need to display text in an iPhone application, something like the way a book is displayed, for example:</p> <p><h1>Heading</h1> <h2>Sub heading</h2> The actual text of the book. Blah. Blah. Blah.</p> <p><br/> How would I go about doing that? I've found the UITextView and UITextField and UIScrollView objects, but...
[ { "answer_id": 411948, "author": "Lily Ballard", "author_id": 582, "author_profile": "https://Stackoverflow.com/users/582", "pm_score": 1, "selected": false, "text": "-sizeToFit" } ]
2009/01/04
[ "https://Stackoverflow.com/questions/410419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16313/" ]
410,437
<p>Does anyone ever use stopwatch benchmarking, or should a performance tool always be used? Are there any good free tools available for Java? What tools do you use?</p> <p>To clarify my concerns, stopwatch benchmarking is subject to error due to operating system scheduling. On a given run of your program the OS mi...
[ { "answer_id": 410460, "author": "Lawrence Dol", "author_id": 8946, "author_profile": "https://Stackoverflow.com/users/8946", "pm_score": 7, "selected": true, "text": "System.currentTimeMillis()" }, { "answer_id": 475697, "author": "Peter Lawrey", "author_id": 57695, ...
2009/01/04
[ "https://Stackoverflow.com/questions/410437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1288/" ]
410,450
<p>Archaelus suggested in <a href="https://stackoverflow.com/questions/383407/what-are-some-interesting-projects-to-solve-in-erlang-for-learning-purposes#383456">this post</a> that writing a new format routine to handle named parameters may be a good learning exercise. So, in the spirit of learning the language I wrote...
[ { "answer_id": 410515, "author": "Doug Currie", "author_id": 33252, "author_profile": "https://Stackoverflow.com/users/33252", "pm_score": 3, "selected": true, "text": "parse_in_format ([], FmtStr, ParmStrs, ParmName) -> {FmtStr, ParmStrs};\nparse_in_format ([${ | Vr], FmtStr, ParmStrs, ...
2009/01/04
[ "https://Stackoverflow.com/questions/410450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42050/" ]
410,469
<p>I want to spawn another process to display an error message asynchronously while the rest of the application continues. </p> <p>I'm using the <code>multiprocessing</code> module in Python 2.6 to create the process and I'm trying to display the window with <code>TKinter</code>. </p> <p>This code worked okay on Wind...
[ { "answer_id": 410587, "author": "Nicholas Leonard", "author_id": 49985, "author_profile": "https://Stackoverflow.com/users/49985", "pm_score": 0, "selected": false, "text": "xhost +" }, { "answer_id": 434207, "author": "Malx", "author_id": 51086, "author_profile": "h...
2009/01/04
[ "https://Stackoverflow.com/questions/410469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2283/" ]
410,471
<p>I have an application where I need to remove one view from the stack of a UINavigationController and replace it with another. The situation is that the first view creates an editable item and then replaces itself with an editor for the item. When I do the obvious solution within the first view:</p> <pre><code>MyEdi...
[ { "answer_id": 410486, "author": "diclophis", "author_id": 32678, "author_profile": "https://Stackoverflow.com/users/32678", "pm_score": 1, "selected": false, "text": "UINavigationController" }, { "answer_id": 411942, "author": "Lily Ballard", "author_id": 582, "autho...
2009/01/04
[ "https://Stackoverflow.com/questions/410471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7383/" ]