qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
155,544
<p>I need to create a unique ID for a given location, and the location's ID must be sequential. So its basically like a primary key, except that it is also tied to the locationID. So 3 different locations will all have ID's like 1,2,3,4,5,...,n</p> <p>What is the best way to do this? I also need a safe way of getti...
[ { "answer_id": 155557, "author": "Chris Marasti-Georg", "author_id": 96, "author_profile": "https://Stackoverflow.com/users/96", "pm_score": 1, "selected": false, "text": "transaction {\n id = getId\n}\n\n... other processing\n\ntransaction {\n createRowWithNewId\n}\n" }, { "...
2008/09/30
[ "https://Stackoverflow.com/questions/155544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
155,560
<p>I want a function like GetCurrentThread which returns a TThread object of the current executing thread. I know there is a Win32 API call GetCurrentThread, but it returns the thread Id. If there is a possibility to get TThread object from that ID that's also fine.</p>
[ { "answer_id": 155773, "author": "Hugh Allen", "author_id": 15069, "author_profile": "https://Stackoverflow.com/users/15069", "pm_score": 5, "selected": false, "text": "if Windows.GetCurrentThreadId() = System.MainThreadID then\n// ...\n" } ]
2008/09/30
[ "https://Stackoverflow.com/questions/155560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
155,566
<p>Please provide tips for effectively using git with svn. What are your "best practices"?</p>
[ { "answer_id": 155577, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 2, "selected": false, "text": "git svn rebase git svn dcommit dcommit svn dcommit" }, { "answer_id": 155643, "author": "andy", "au...
2008/09/30
[ "https://Stackoverflow.com/questions/155566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3146/" ]
155,584
<p>I need a way to allow each letter of a word to rotate through 3 different colors. I know of some not so clean ways I can do this with asp.NET, but I'm wondering if there might be a cleaner CSS/JavaScript solution that is more search engine friendly.</p> <p>The designer is including <a href="http://stlartworks.effic...
[ { "answer_id": 155595, "author": "Brendan Kidwell", "author_id": 13958, "author_profile": "https://Stackoverflow.com/users/13958", "pm_score": 3, "selected": false, "text": "// This server-side code example is in JavaScript because that's\n// what I know best.\nvar words = split(message,...
2008/09/30
[ "https://Stackoverflow.com/questions/155584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4318/" ]
155,586
<p>We use the DesignSurface and all that good IDesignerHost goodness in our own designer. The designed forms are then persisted in our own bespoke format and all that works great. WE also want to export the forms to a text-based format (which we've done as it isn't that difficult).</p> <p>However, we also want to impo...
[ { "answer_id": 155595, "author": "Brendan Kidwell", "author_id": 13958, "author_profile": "https://Stackoverflow.com/users/13958", "pm_score": 3, "selected": false, "text": "// This server-side code example is in JavaScript because that's\n// what I know best.\nvar words = split(message,...
2008/09/30
[ "https://Stackoverflow.com/questions/155586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23234/" ]
155,593
<p>Is there a way to determine the number of users that have active sessions in an ASP.NET application? I have an admin/tools page in a particular application, and I would like to display info regarding all open sessions, such as the number of sessions, and perhaps the requesting machines' addresses, or other credenti...
[ { "answer_id": 659879, "author": "Eduardo Molteni", "author_id": 2385, "author_profile": "https://Stackoverflow.com/users/2385", "pm_score": 4, "selected": false, "text": "void Application_Start(object sender, EventArgs e)\n{\n // Code that runs on application startup\n Application...
2008/09/30
[ "https://Stackoverflow.com/questions/155593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23886/" ]
155,609
<p>Can someone provide a simple explanation of <strong>methods</strong> vs. <strong>functions</strong> in OOP context?</p>
[ { "answer_id": 155648, "author": "Statement", "author_id": 2166173, "author_profile": "https://Stackoverflow.com/users/2166173", "pm_score": 3, "selected": false, "text": "class Example\n{\n public int data = 0; // Each instance of Example holds its internal data. This is a \"field\", ...
2008/09/30
[ "https://Stackoverflow.com/questions/155609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23973/" ]
155,610
<p>I have a trivial console application in .NET. It's just a test part of a larger application. I'd like to specify the "exit code" of my console application. How do I do this?</p>
[ { "answer_id": 155611, "author": "palehorse", "author_id": 312, "author_profile": "https://Stackoverflow.com/users/312", "pm_score": 5, "selected": false, "text": "int code = 2;\nEnvironment.Exit( code );\n" }, { "answer_id": 155613, "author": "albertein", "author_id": 23...
2008/09/30
[ "https://Stackoverflow.com/questions/155610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22471/" ]
155,615
<p>I understand that server-side validation is an absolute must to prevent malicious users (or simply users who choose to disable javascript) from bypassing client-side validation. But that's mainly to protect your application, not to provide value for those who are running browsers with javascript disabled. Is it re...
[ { "answer_id": 157042, "author": "James", "author_id": 21677, "author_profile": "https://Stackoverflow.com/users/21677", "pm_score": 2, "selected": false, "text": "<noscript>" }, { "answer_id": 4316596, "author": "Master Morality", "author_id": 304299, "author_profile...
2008/09/30
[ "https://Stackoverflow.com/questions/155615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
155,649
<p>What's the best way to add the coordinates of a circle to an array in JavaScript? So far I've only been able to do a half circle, but I need a formula that returns the whole circle to two different arrays: <code>xValues</code> and <code>yValues</code>. (I'm trying to get the coordinates so I can animate an object al...
[ { "answer_id": 155653, "author": "shoosh", "author_id": 9611, "author_profile": "https://Stackoverflow.com/users/9611", "pm_score": 1, "selected": false, "text": "+ sin(...) - sin(...)" }, { "answer_id": 155662, "author": "dlamblin", "author_id": 459, "author_profile"...
2008/09/30
[ "https://Stackoverflow.com/questions/155649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13281/" ]
155,669
<p>I have Flex based consumer <a href="http://www.rollingrazor.com" rel="nofollow noreferrer">website</a> where I would like to change various look and feel type settings based on random and other criteria, and then track these through to what results in the most sales. </p> <p>For instance I might completely switch o...
[ { "answer_id": 627904, "author": "David Pokluda", "author_id": 223, "author_profile": "https://Stackoverflow.com/users/223", "pm_score": 2, "selected": false, "text": "+----------------\n| User\n+----------------\n| UserId (PK)\n| ...\n+----------------\n +----------------\n| CustomPrope...
2008/10/01
[ "https://Stackoverflow.com/questions/155669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16940/" ]
155,670
<p>I want to invert a 4x4 matrix. My numbers are stored in fixed-point format (1.15.16 to be exact).</p> <p>With floating-point arithmetic I usually just build the adjoint matrix and divide by the determinant (e.g. brute force the solution). That worked for me so far, but when dealing with fixed point numbers I get an...
[ { "answer_id": 155705, "author": "Adrian", "author_id": 23624, "author_profile": "https://Stackoverflow.com/users/23624", "pm_score": 4, "selected": false, "text": "[ux vx wx tx]\n[uy vy wy ty]\n[uz vz wz tz]\n[ 0 0 0 1]\n [ux uy uz -dot(u,t)]\n[vx vy vz -dot(v,t)]\n[wx wy wz -dot(w,t...
2008/10/01
[ "https://Stackoverflow.com/questions/155670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15955/" ]
155,681
<p>I have saved input from a textarea element to a TEXT column in MySQL. I'm using PHP to pull that data out of the database and want to display it in a p element while still showing the whitespace that the user entered (e.g. multiple spaces and newlines). I've tried a pre tag but it doesn't obey the width set in the...
[ { "answer_id": 155698, "author": "Vincent McNabb", "author_id": 16299, "author_profile": "https://Stackoverflow.com/users/16299", "pm_score": 5, "selected": true, "text": "pre pre {\n white-space: pre-wrap; /* css-3 */\n white-space: -moz-pre-wrap; /* Mozilla, since 1999 */\n whit...
2008/10/01
[ "https://Stackoverflow.com/questions/155681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23976/" ]
155,685
<p>I need to replace the contents of a node in an XElement hierarchy when the element name and all the attribute names and values match an input element. (If there is no match, the new element can be added.)</p> <p>For example, if my data looks like this:</p> <pre><code>&lt;root&gt; &lt;thing1 a1="a" a2="b"&gt;one&...
[ { "answer_id": 155787, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 4, "selected": true, "text": "public static void ReplaceOrAdd(this XElement source, XElement node)\n{\n var q = from x in source.Elements()\n ...
2008/10/01
[ "https://Stackoverflow.com/questions/155685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14842/" ]
155,706
<p>I have been looking at a few options for enabling localization and internationalization of a dynamic php application. There appears to be a variety of tools available such as gettext and Yahoo's R3 and I am interested in hearing from both developers and translators about which tools are good to use and what function...
[ { "answer_id": 426915, "author": "Gabriel Sosa", "author_id": 31039, "author_profile": "https://Stackoverflow.com/users/31039", "pm_score": 1, "selected": false, "text": "<?php\ninclude('lang/en.php');\ninclude('lang/en_us.php'); // this file overrides few keys from the last one.\n?>\n" ...
2008/10/01
[ "https://Stackoverflow.com/questions/155706", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11979/" ]
155,712
<p>Here's my problem - I have some code like this:</p> <pre><code>&lt;mx:Canvas width="300" height="300"&gt; &lt;mx:Button x="800" /&gt; &lt;/mx:Canvas&gt; </code></pre> <p>So the problem is that the Button inside the canvas has an x property way in excess of the Canvas's width - since it's a child of the Canvas...
[ { "answer_id": 155817, "author": "Paul Mignard", "author_id": 3435, "author_profile": "https://Stackoverflow.com/users/3435", "pm_score": 4, "selected": true, "text": "<mx:Canvas width=\"300\" height=\"300\" clipContent=\"false\" >\n <mx:Button x=\"800\" />\n</mx:Canvas>\n" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/155712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3435/" ]
155,719
<p>Internationalizing web apps always seems to be a chore. No matter how much you plan ahead for pluggable languages, there's always issues with encoding, funky phrasing that doesn't fit your templates, and other problems.</p> <p>I think it would be useful to get the SO community's input for a set of things that prog...
[ { "answer_id": 157833, "author": "Kip", "author_id": 18511, "author_profile": "https://Stackoverflow.com/users/18511", "pm_score": 4, "selected": false, "text": "Click here\n [~~ Çļïčк н∑ѓё ~~ タウ ~~]\n" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/155719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14032/" ]
155,721
<p>Please post a working source code example (or link) of how to search string in another process memory and getting offset of match if found. The similar way its done in game cheating utils which search for values in game memory using ReadProcessMemory.</p>
[ { "answer_id": 157833, "author": "Kip", "author_id": 18511, "author_profile": "https://Stackoverflow.com/users/18511", "pm_score": 4, "selected": false, "text": "Click here\n [~~ Çļïčк н∑ѓё ~~ タウ ~~]\n" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/155721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21582/" ]
155,739
<p>I have a requirement to implement an "Unsaved Changes" prompt in an ASP .Net application. If a user modifies controls on a web form, and attempts to navigate away before saving, a prompt should appear warning them that they have unsaved changes, and give them the option to cancel and stay on the current page. The ...
[ { "answer_id": 155760, "author": "Wayne", "author_id": 8236, "author_profile": "https://Stackoverflow.com/users/8236", "pm_score": 4, "selected": false, "text": "<script language=\"javascript\">\n var isDirty = false;\n\n function setDirty() {\n isDirty = true;\n }\n\n ...
2008/10/01
[ "https://Stackoverflow.com/questions/155739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/637/" ]
155,740
<p>I am working on an application that will sport a web-based point of sale interface.</p> <p>The point of sale PC (I am not sure as of now whether it will run on Linux or Windows) must have a fiscal printer attached to it, but like any web app, it is the server which processes all stuff. Both server and PoS machines ...
[ { "answer_id": 155782, "author": "OscarRyz", "author_id": 20654, "author_profile": "https://Stackoverflow.com/users/20654", "pm_score": 1, "selected": false, "text": "DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;\nPrintRequestAttributeSet aset = new HashPrintRequestHashAttributeS...
2008/10/01
[ "https://Stackoverflow.com/questions/155740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22116/" ]
155,751
<p>In my php web app, suppose I want to go the extra mile and in addition to going gang-busters and being anal-retentive about sanitizing my inputs, I also want to ensure that no JavaScript is being output in strings I am inserting into html templates. </p> <p>Is there a standard way to make sure I don't put JavaScrip...
[ { "answer_id": 155768, "author": "dlamblin", "author_id": 459, "author_profile": "https://Stackoverflow.com/users/459", "pm_score": 0, "selected": false, "text": "<img src=\"${path}\"> ${path} http://p0wned.com/jpg.jpg\" /><script src=\"p0wned.com/js.js\"/> #from http://www.perlmonks.org...
2008/10/01
[ "https://Stackoverflow.com/questions/155751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8123/" ]
155,780
<p>What is SafeHandle? how does it differ from IntPtr? When should I use one? What are its advantages?</p>
[ { "answer_id": 27453342, "author": "Mike Ness", "author_id": 4286419, "author_profile": "https://Stackoverflow.com/users/4286419", "pm_score": 4, "selected": false, "text": "static class Examples\n{\n static void Example1_SafeUserToken()\n {\n const string user = \"SomeLocal...
2008/10/01
[ "https://Stackoverflow.com/questions/155780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7418/" ]
155,792
<p>I'm working on a method that accepts an expression tree as a parameter, along with a type (or instance) of a class.</p> <p>The basic idea is that this method will add certain things to a collection that will be used for validation.</p> <pre><code>public interface ITestInterface { //Specify stuff here. } private...
[ { "answer_id": 155845, "author": "Jason Jackson", "author_id": 13103, "author_profile": "https://Stackoverflow.com/users/13103", "pm_score": 2, "selected": false, "text": "DoSomething(\"MyProperty\", new OtherClass());\n [DoSomething(typeof(OtherClass), typeof(OtherClass2))]\npublic int ...
2008/10/01
[ "https://Stackoverflow.com/questions/155792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10853/" ]
155,797
<p>ADO.NET has the notorious DataRow class which you cannot instantiate using new. This is a problem now that I find a need to mock it using Rhino Mocks. </p> <p>Does anyone have any ideas how I could get around this problem?</p>
[ { "answer_id": 155813, "author": "Josh", "author_id": 11702, "author_profile": "https://Stackoverflow.com/users/11702", "pm_score": 5, "selected": true, "text": "SetupResult.For(someMockClass.GetDataRow(input)).Return(GetReturnRow());\n\npublic DataRow GetReturnRow()\n{\n DataTable ta...
2008/10/01
[ "https://Stackoverflow.com/questions/155797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
155,810
<p>When you double click on a class (in 'solution explorer')... if that class happens to be an .asmx.cs webservice... then you get this...</p> <blockquote> <p>To add components to your class, drag them from the Toolbox and use the Properties window to set their properties. To create methods and events for yo...
[ { "answer_id": 3196200, "author": "Bob Sidie", "author_id": 385681, "author_profile": "https://Stackoverflow.com/users/385681", "pm_score": 1, "selected": false, "text": "<System.ComponentModel.DesignerCategory(\"\")>\n" }, { "answer_id": 4246213, "author": "Steinar Herland",...
2008/10/01
[ "https://Stackoverflow.com/questions/155810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49/" ]
155,829
<p>I am getting this error but only very occasionally. 99.9% of the time it works fine:</p> <p>Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.</p> <p>Does anyone have any idea on what the cause could be? I only use that datatable for viewing and ...
[ { "answer_id": 38776066, "author": "Nick", "author_id": 1931573, "author_profile": "https://Stackoverflow.com/users/1931573", "pm_score": 0, "selected": false, "text": "varchar(100) InitClass()" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/155829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10102/" ]
155,848
<p>I need to create an access (mdb) database without using the ADOX interop assembly. </p> <p>How can this be done?</p>
[ { "answer_id": 155851, "author": "Sam Saffron", "author_id": 17174, "author_profile": "https://Stackoverflow.com/users/17174", "pm_score": 5, "selected": true, "text": "if (!File.Exists(DB_FILENAME))\n{\n var cnnStr = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\" + DB_FILENAME;\n\...
2008/10/01
[ "https://Stackoverflow.com/questions/155848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17174/" ]
155,852
<p>I have created a non-visual component in C# which is designed as a placeholder for meta-data on a form.<br> The component has a property which is a collection of custom objects, this object is marked as Serializable and implements the GetObjectData for serilizing and public constuctor for deserilizing.<br></p> <p>I...
[ { "answer_id": 199307, "author": "benPearce", "author_id": 4490, "author_profile": "https://Stackoverflow.com/users/4490", "pm_score": 3, "selected": true, "text": "private List<Rule> _Rules;\n[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]\npublic List<Rule> R...
2008/10/01
[ "https://Stackoverflow.com/questions/155852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490/" ]
155,864
<p>I have a controller with an action method as follows:</p> <pre><code>public class InventoryController : Controller { public ActionResult ViewStockNext(int firstItem) { // Do some stuff } } </code></pre> <p>And when I run it I get an error stating:</p> <blockquote> <p>The parameters dictionar...
[ { "answer_id": 155895, "author": "Jarrett Meyer", "author_id": 5834, "author_profile": "https://Stackoverflow.com/users/5834", "pm_score": 8, "selected": true, "text": "{controller}/{action}/{firstItem} {controller}/{action}/{id} global.asax.cs id routes.MapRoute(\n \"Inventory\",\n ...
2008/10/01
[ "https://Stackoverflow.com/questions/155864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11908/" ]
155,869
<p>The Interwebs are no help on this one. We're encoding data in ColdFusion using <code>serializeJSON</code> and trying to decode it in PHP using <code>json_decode</code>. Most of the time, this is working fine, but in some cases, <code>json_decode</code> returns <code>NULL</code>. We've looked for the obvious culprits...
[ { "answer_id": 171521, "author": "Ates Goral", "author_id": 23501, "author_profile": "https://Stackoverflow.com/users/23501", "pm_score": 2, "selected": false, "text": "json_decode <meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/>\n json_decode" }, { "answer...
2008/10/01
[ "https://Stackoverflow.com/questions/155869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
155,884
<p>What is a realistic use for VB.Net's MyClass keyword?</p> <p>I understand the <a href="http://msdn.microsoft.com/en-us/library/b3b35kyk.aspx" rel="noreferrer">technical usage of MyClass</a>; I don't understand the practical usage of it in the real world.</p> <p>Using MyClass only makes sense if you have any virtua...
[ { "answer_id": 169787, "author": "Jonathan Allen", "author_id": 5274, "author_profile": "https://Stackoverflow.com/users/5274", "pm_score": -1, "selected": false, "text": "Public Sub New(ByVal accountKey As Integer)\n MyClass.New(accountKey, Nothing)\nEnd Sub\n\nPublic Sub New(ByVal a...
2008/10/01
[ "https://Stackoverflow.com/questions/155884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6375/" ]
155,891
<p>Can't seem to rename an existing Verity collection in ColdFusion without deleting, recreating, and rebuilding the collection. Problem is, I have some very large collections I'd rather not have to delete and rebuild from scratch. Any one have a handy trick for this conundrum?</p>
[ { "answer_id": 158948, "author": "Ben Doom", "author_id": 12267, "author_profile": "https://Stackoverflow.com/users/12267", "pm_score": 2, "selected": false, "text": "<cfcollection action=\"map\" ...>\n" }, { "answer_id": 571061, "author": "crb", "author_id": 51691, "...
2008/10/01
[ "https://Stackoverflow.com/questions/155891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10750/" ]
155,908
<p>I have defined tomcat:catalina:5.5.23 as a dependency to the cargo plugin, however I still get the following exception:</p> <pre><code>java.lang.ClassNotFoundException: org.apache.catalina.Connector at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Metho...
[ { "answer_id": 169029, "author": "Hugo", "author_id": 972, "author_profile": "https://Stackoverflow.com/users/972", "pm_score": 1, "selected": false, "text": "mvn jetty6:run\n <project>\n <build>\n <plugins>\n <plugin>\n <groupId>org.mortbay.jetty</gro...
2008/10/01
[ "https://Stackoverflow.com/questions/155908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2767300/" ]
155,911
<p>During software development, there may be bugs in the codebase which are known issues. These bugs will cause the regression/unit tests to fail, if the tests have been written well.</p> <p>There is constant debate in our teams about how failing tests should be managed:</p> <ol> <li><p>Comment out failing test case...
[ { "answer_id": 155942, "author": "Mark", "author_id": 4405, "author_profile": "https://Stackoverflow.com/users/4405", "pm_score": 4, "selected": true, "text": "// TODO: fix test case\n // HAHA: you'll never revisit me\n" }, { "answer_id": 155971, "author": "Georgi", "aut...
2008/10/01
[ "https://Stackoverflow.com/questions/155911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22489/" ]
155,912
<p>Calling <code>Validate()</code> on an <strong>XmlDocument</strong> requires passing in a <code>ValidationEventHandler</code> delegate. That event function gets a <code>ValidationEventArgs</code> parameter which in turn has an <code>Exception</code> property of the type <code>XmlSchemaException</code>. Whew!</p> <...
[ { "answer_id": 57436064, "author": "Adam Porad", "author_id": 21353, "author_profile": "https://Stackoverflow.com/users/21353", "pm_score": 0, "selected": false, "text": "null validationEventHandler validationEventHandler ValidationEventHandler null" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/155912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9642/" ]
155,913
<p>The project I'm working is using n-tier architecture. Our layers are as follows:</p> <ul> <li>Data Access</li> <li>Business Logic</li> <li>Business Entities</li> <li>Presentation</li> </ul> <p>The Business Logic calls down into the data access layer, and the Presentation layer calls down into the Business Logic la...
[ { "answer_id": 155965, "author": "Andrew Kennan", "author_id": 22506, "author_profile": "https://Stackoverflow.com/users/22506", "pm_score": 1, "selected": false, "text": "public class Relation<T>\n{\n private T _value;\n\n private void FetchData()\n {\n if( LoadData != null ) {\n ...
2008/10/01
[ "https://Stackoverflow.com/questions/155913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17744/" ]
155,920
<p>I have one of those "I swear I didn't touch the server" situations. I honestly didn't touch any of the php scripts. The problem I am having is that php data is not being saved across different pages or page refreshes. I know a new session is being created correctly because I can set a session variable (e.g. $_SESSIO...
[ { "answer_id": 155941, "author": "vIceBerg", "author_id": 17766, "author_profile": "https://Stackoverflow.com/users/17766", "pm_score": 3, "selected": false, "text": "phpinfo() session.* print_r($_SESSION); phpinfo() session.save_path" }, { "answer_id": 155945, "author": "nic...
2008/10/01
[ "https://Stackoverflow.com/questions/155920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13556/" ]
155,930
<p>I have an application that launches a webpage in the "current" browser when the user selects it. This part of my app works fine in the Windows version but I can't figure out how to do this in Linux build.</p> <p>Right now the Linux version is hardcoded for Firefox in a specific directory and runs a new instance of ...
[ { "answer_id": 155946, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 4, "selected": true, "text": "xdg-open $ xdg-open http://google.com/\n gnome-open exo-open" }, { "answer_id": 159102, "author": "matli", ...
2008/10/01
[ "https://Stackoverflow.com/questions/155930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13676/" ]
155,932
<p>I would like to know how to loop through each line in a text file using a Windows batch file and process each line of text in succession.</p>
[ { "answer_id": 155937, "author": "Michael Ratanapintha", "author_id": 1879, "author_profile": "https://Stackoverflow.com/users/1879", "pm_score": 3, "selected": false, "text": "cmd.exe" }, { "answer_id": 155950, "author": "Ash", "author_id": 5023, "author_profile": "h...
2008/10/01
[ "https://Stackoverflow.com/questions/155932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5132/" ]
155,934
<p>What GNU/Linux command-line tool would I use for performing a search and replace on a file? </p> <p>Can the search text, and replacement, be specified in a regex format?</p>
[ { "answer_id": 155939, "author": "Michael Cramer", "author_id": 1496728, "author_profile": "https://Stackoverflow.com/users/1496728", "pm_score": 5, "selected": false, "text": "perl -pi -e 's/foo/bar/g;' *.txt\n perl -pi.bak -e 's/foo/bar/g;' *.txt\n cat file.txt | perl -ne 's/foo/bar/g;...
2008/10/01
[ "https://Stackoverflow.com/questions/155934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2045/" ]
155,959
<p>The following code executes a simple insert command. If it is called 2,000 times consecutively (to insert 2,000 rows) an OleDbException with message = "System Resources Exceeded" is thrown. Is there something else I should be doing to free up resources?</p> <pre><code>using (OleDbConnection conn = new OleDbConnec...
[ { "answer_id": 155961, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 4, "selected": true, "text": "using (OleDBConnection conn = new OleDBConnection(connstr))\n{\n while (IHaveData)\n {\n using (OldDBCommand cmd...
2008/10/01
[ "https://Stackoverflow.com/questions/155959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2669/" ]
155,964
<p>I know about the <a href="http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html" rel="noreferrer">HIG</a> (which is quite handy!), but what programming practices do you use when writing Objective-C, and more specifically when using Cocoa (or CocoaTouch).</...
[ { "answer_id": 155966, "author": "JamesSugrue", "author_id": 1075, "author_profile": "https://Stackoverflow.com/users/1075", "pm_score": 6, "selected": false, "text": "alloc release" }, { "answer_id": 156098, "author": "Kendall Helmstetter Gelner", "author_id": 6330, ...
2008/10/01
[ "https://Stackoverflow.com/questions/155964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21804/" ]
155,977
<p>I have the following markup, and I want to make the <code>All</code> radio button checked.</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;input type="radio" value="All" name="Foo"/&gt;All&lt;/li&gt; &lt;li&gt;&lt;input type="radio" value="New" name="Foo"/&gt;New&lt;/li&gt; &lt;li&gt;&lt;input type="radio" valu...
[ { "answer_id": 156027, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 7, "selected": true, "text": "<html>\n <head>\n <script type=\"text/javascript\" src=\"jquery-1.2.6.pack.js\"></script>\n <script type=\"text/ja...
2008/10/01
[ "https://Stackoverflow.com/questions/155977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/410357/" ]
155,996
<p>I have an MDI application. When I show a message box using MessageBox.Show(), the entire application disappears behind all of my open windows when I dismiss the message box.</p> <p>The code is not doing anything special. In fact, here is the line that invokes the message box from within an MDI Child form:</p> <pre...
[ { "answer_id": 156039, "author": "DaveK", "author_id": 4244, "author_profile": "https://Stackoverflow.com/users/4244", "pm_score": 2, "selected": false, "text": "MessageBoxOptions.DefaultDesktopOnly DefaultDesktopOnly" }, { "answer_id": 156040, "author": "Mitch Wheat", "a...
2008/10/01
[ "https://Stackoverflow.com/questions/155996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10224/" ]
155,998
<p>Given this:</p> <pre><code>Public Sub timReminder_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) If DateTime.Now() &gt; g_RemindTime Then Reminders.ShowDialog() timReminder.Enabled = False End If End Sub </code></pre> <p>I want to be able to say this (as I would in Delphi)...
[ { "answer_id": 354784, "author": "Jon Winstanley", "author_id": 42106, "author_profile": "https://Stackoverflow.com/users/42106", "pm_score": 0, "selected": false, "text": "addHandler" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/155998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/672/" ]
156,002
<p>I have a very basic question about MVC web applications in Java.</p> <p>Since the olden days of raw JSP up until current technologies like Seam, a very basic pattern has always been the internal dispatch from the controller that initially accepted the request to the view layer that creates the output to be sent to ...
[ { "answer_id": 453374, "author": "Simon Lieschke", "author_id": 2766, "author_profile": "https://Stackoverflow.com/users/2766", "pm_score": 2, "selected": false, "text": "security-constraint web.xml <!-- Prevent direct access to JSPs. -->\n<security-constraint>\n <web-resource-collect...
2008/10/01
[ "https://Stackoverflow.com/questions/156002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14955/" ]
156,009
<p>Because of the more tedious way of adding hosts to be monitored in Nagios (it requires defining a host object, as opposed to the previous program which only required the IP and hostname), I figured it'd be best to automate this, and it'd be a great time to learn Perl, because all I know at the moment is C/C++ and Ja...
[ { "answer_id": 156020, "author": "David Nehme", "author_id": 14167, "author_profile": "https://Stackoverflow.com/users/14167", "pm_score": 3, "selected": false, "text": "perl -nae 'print \"$F[0] $F[1]\\n\";'\n -F" }, { "answer_id": 156025, "author": "C. K. Young", "author...
2008/10/01
[ "https://Stackoverflow.com/questions/156009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3879/" ]
156,013
<p>I can't quite figure out this syntax problem with a <code>case</code> expression in a <code>do</code> block.</p> <p>What is the correct syntax? </p> <p>If you could correct my example and explain it that would be the best.</p> <pre><code>module Main where main = do putStrLn "This is a test" s &lt;-...
[ { "answer_id": 156050, "author": "wnoise", "author_id": 15464, "author_profile": "https://Stackoverflow.com/users/15464", "pm_score": 6, "selected": true, "text": "module Main where \nimport System(getArgs)\n\nmain = do \n putStrLn \"This is a test\"\n s <- foo\n putStrLn s...
2008/10/01
[ "https://Stackoverflow.com/questions/156013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8965/" ]
156,032
<p>Java &amp; Oracle both have a <em>timestamp</em> type called Date. Developers tend to manipulate these as if they were <em>calendar</em> dates, which I've seen cause nasty one-off bugs.</p> <ol> <li><p>For a basic date quantity you can simply chop off the time portion upon input, i.e., reduce the precision. But if ...
[ { "answer_id": 156038, "author": "Alan", "author_id": 17205, "author_profile": "https://Stackoverflow.com/users/17205", "pm_score": 0, "selected": false, "text": "java.util.Date java.util.Date" }, { "answer_id": 156041, "author": "David Aldridge", "author_id": 6742, "...
2008/10/01
[ "https://Stackoverflow.com/questions/156032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14749/" ]
156,046
<p>I'm using a Form to show notifications (it appears at the bottom right of the screen), but when I show this form it steals the focus from the main Form. Is there a way to show this "notification" form without stealing focus?</p>
[ { "answer_id": 156067, "author": "Matthew Scharley", "author_id": 15537, "author_profile": "https://Stackoverflow.com/users/15537", "pm_score": 3, "selected": false, "text": "this.TopMost = true; // as a result the form gets thrown to the front\nthis.TopMost = false; // but we don't act...
2008/10/01
[ "https://Stackoverflow.com/questions/156046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
156,051
<p>I've got a dropdown list that is being populated via a webservice using ASP>NET AJAX. On the success callback of the method in javascript, I'm populating the dropdown via a loop:</p> <pre><code>function populateDropDown(dropdownId, list, enable, showCount) { var dropdown = $get(dropdownId); dropdown.options...
[ { "answer_id": 156065, "author": "Aaron Powell", "author_id": 11388, "author_profile": "https://Stackoverflow.com/users/11388", "pm_score": 3, "selected": true, "text": "AjaxControlToolkit.CascadingDropDownBehavior.callBaseMethod(this, 'set_ClientState', [ this._selectedValue+':::'+text ...
2008/10/01
[ "https://Stackoverflow.com/questions/156051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2975/" ]
156,083
<p>I hear people writing these programs all the time and I know what they do, but how do they actually do it? I'm looking for general concepts.</p>
[ { "answer_id": 156312, "author": "micahwittman", "author_id": 11181, "author_profile": "https://Stackoverflow.com/users/11181", "pm_score": 2, "selected": false, "text": "//Show My SO Reputation Score\nvar repval = $('span.reputation-score:first'); alert('StackOverflow User \"' + repval....
2008/10/01
[ "https://Stackoverflow.com/questions/156083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17744/" ]
156,084
<p>Using VBA i have a set of functions that return an <code>ADODB.Recordset</code> where all the columns as <code>adVarChar</code>. Unfortunately this means numerics get sorted as text. So 1,7,16,22 becomes 1,16,22,7</p> <p>Is there any methods that can sort numerics as text columns without resorting to changing the t...
[ { "answer_id": 157741, "author": "Chris OC", "author_id": 11041, "author_profile": "https://Stackoverflow.com/users/11041", "pm_score": 2, "selected": false, "text": "SELECT ID, Field1\nFROM tablename\nORDER BY Val(Field1);\n" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/156084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4134/" ]
156,089
<p>I am just starting with SL and WPF. I am using the DataGrid control and I need to remove the mouseover effect (I actually will need to do more customizations than that). How do I do this. I think I need to do it with a control template but not sure how. I'm researching and reading right now. Any help would be apprec...
[ { "answer_id": 183936, "author": "Jobi Joy", "author_id": 8091, "author_profile": "https://Stackoverflow.com/users/8091", "pm_score": 2, "selected": false, "text": "<vsm:VisualState x:Name=\"MouseOver\">" }, { "answer_id": 1681462, "author": "Scott", "author_id": 38832, ...
2008/10/01
[ "https://Stackoverflow.com/questions/156089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23663/" ]
156,113
<p>I have some linq entities that inherit something like this:</p> <pre><code>public abstract class EntityBase { public int Identifier { get; } } public interface IDeviceEntity { int DeviceId { get; set; } } public abstract class DeviceEntityBase : EntityBase, IDeviceEntity { public abstract int DeviceId { get; se...
[ { "answer_id": 156365, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": true, "text": "static Expression<Func<T, bool>> BuildWhere<T>(int deviceId) {\n var id = Expression.Constant(deviceId, typeof(int)...
2008/10/01
[ "https://Stackoverflow.com/questions/156113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2281/" ]
156,114
<p>When paging through data that comes from a DB, you need to know how many pages there will be to render the page jump controls.</p> <p>Currently I do that by running the query twice, once wrapped in a <code>count()</code> to determine the total results, and a second time with a limit applied to get back just the res...
[ { "answer_id": 8242764, "author": "Erwin Brandstetter", "author_id": 939860, "author_profile": "https://Stackoverflow.com/users/939860", "pm_score": 8, "selected": true, "text": "SELECT foo\n , count(*) OVER() AS full_count\nFROM bar\nWHERE <some condition>\nORDER BY <some col>\n...
2008/10/01
[ "https://Stackoverflow.com/questions/156114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20851/" ]
156,116
<p>I'm using CSS Filters to modify images on the fly within the browser. These work perfectly in Internet Explorer, but aren't supported in Firefox.</p> <p>Does anyone know what the CSS Filter equivalent for these is for Firefox? An answer that would work cross browser (Safari, WebKit, Firefox, etc.) would be preferre...
[ { "answer_id": 156142, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 2, "selected": false, "text": "filter" }, { "answer_id": 156238, "author": "Steven Oxley", "author_id": 3831, "author_profile": "...
2008/10/01
[ "https://Stackoverflow.com/questions/156116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7831/" ]
156,230
<p>Is there a framework equivalent to Guice (<a href="http://code.google.com/p/google-guice" rel="noreferrer">http://code.google.com/p/google-guice</a>) for Python?</p>
[ { "answer_id": 34346267, "author": "Aigrefin", "author_id": 1014321, "author_profile": "https://Stackoverflow.com/users/1014321", "pm_score": 0, "selected": false, "text": "from py3njection import inject\nfrom some_package import ClassToInject\n\nclass Demo:\n @inject\n def __init_...
2008/10/01
[ "https://Stackoverflow.com/questions/156230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9940/" ]
156,243
<p>What is the difference between the following 2 ways to allocate and init an object?</p> <pre><code>AController *tempAController = [[AController alloc] init]; self.aController = tempAController; [tempAController release]; </code></pre> <p>and</p> <pre><code>self.aController= [[AController alloc] init]; </code></pr...
[ { "answer_id": 156289, "author": "benzado", "author_id": 10947, "author_profile": "https://Stackoverflow.com/users/10947", "pm_score": 7, "selected": true, "text": "@property (retain) alloc self setAController: retain release retain self.property = foo; [self setProperty:foo]; setPropert...
2008/10/01
[ "https://Stackoverflow.com/questions/156243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1987/" ]
156,256
<p>The sample below has two TextBoxes. The second TextBox has a handler for the LostFocus event which calls Clear() on itself. Changing focus between the two text boxes works fine; however, if the focus is on the second text box when the window is closed, TextBox.Clear() generates a NullReferenceException. Is this ...
[ { "answer_id": 156277, "author": "Jason Anderson", "author_id": 5142, "author_profile": "https://Stackoverflow.com/users/5142", "pm_score": 2, "selected": false, "text": " private void Test_LostFocus(object sender, RoutedEventArgs e)\n {\n if (Test != null)\n Test...
2008/10/01
[ "https://Stackoverflow.com/questions/156256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
156,257
<p>In an AI application I am writing in C++, </p> <ol> <li>there is not much numerical computation </li> <li>there are lot of structures for which run-time polymorphism is needed </li> <li>very often, several polymorphic structures interact during computation</li> </ol> <p>In such a situation, are there any optimiz...
[ { "answer_id": 156420, "author": "loudej", "author_id": 6056, "author_profile": "https://Stackoverflow.com/users/6056", "pm_score": 6, "selected": true, "text": "classptr -> [vtable:4][classdata:x]\nvtable -> [first:4][second:4][third:4][fourth:4][...]\nfirst -> [code:x]\nsecond -> [code...
2008/10/01
[ "https://Stackoverflow.com/questions/156257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19501/" ]
156,275
<p>Is there a good reason why there is no <code>Pair&lt;L,R&gt;</code> in Java? What would be the equivalent of this C++ construct? I would rather avoid reimplementing my own.</p> <p>It seems that <strong>1.6</strong> is providing something similar (<code>AbstractMap.SimpleEntry&lt;K,V&gt;</code>), but this looks quit...
[ { "answer_id": 156286, "author": "cletus", "author_id": 18393, "author_profile": "https://Stackoverflow.com/users/18393", "pm_score": 4, "selected": false, "text": "Map<String, Object> map = ... ; // just an example\nfor (Map.Entry<String, Object> entry : map.entrySet()) {\n System.out....
2008/10/01
[ "https://Stackoverflow.com/questions/156275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13673/" ]
156,278
<p>Yet again, my teacher was unable to answer my question. I knew who may be able to...</p> <p>So, I've never really learned C. In C++, I would, obviously, use a cout statement all of the time. In a recent assignment, my teacher told us to make sure to put </p> <pre><code>setbuf( stdout , NULL ); </code></pre> <p>at...
[ { "answer_id": 156321, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 4, "selected": true, "text": "std::endl std::flush <ostream> std::cout << \"Hello, world!\" << std::endl;\n std::cout << \"Hello, world!\\n\" << std::flush...
2008/10/01
[ "https://Stackoverflow.com/questions/156278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73/" ]
156,279
<p>The title is self explanatory. Is there a way of directly doing such kind of importing?</p>
[ { "answer_id": 156479, "author": "Richard Harrison", "author_id": 19624, "author_profile": "https://Stackoverflow.com/users/19624", "pm_score": 7, "selected": true, "text": "sqlcmd -S <COMPUTERNAME>\\SQLExpress restore filelistonly from disk='c:\\temp\\mydbName-2009-09-29-v10.bak';\nGO\n...
2008/10/01
[ "https://Stackoverflow.com/questions/156279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/131/" ]
156,280
<p>When using mercurial, I'd like to be able to diff the working copy of a file with the tip file in my default remote repository. Is there an easy way to do this?</p> <p>I know I can do an "hg incoming -p" to see the patch sets of changes coming in, but it'd be nice to just directly see the actual changes for a part...
[ { "answer_id": 157642, "author": "nlucaroni", "author_id": 157, "author_profile": "https://Stackoverflow.com/users/157", "pm_score": 2, "selected": false, "text": "-R diff hg" }, { "answer_id": 164566, "author": "Ted Naleid", "author_id": 8912, "author_profile": "http...
2008/10/01
[ "https://Stackoverflow.com/questions/156280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8912/" ]
156,292
<p>I'm a bit of a DI newbie, so forgive me if this is the wrong approach or a silly question.</p> <p>Let's say I have a form which creates/updates an order, and I know it's going to need to retrieve a list of products and customers to display. I want to pass in the Order object that it's editing, but I also want to in...
[ { "answer_id": 63869152, "author": "Efran Cobisi", "author_id": 904178, "author_profile": "https://Stackoverflow.com/users/904178", "pm_score": 0, "selected": false, "text": "*Service Build() Order public class OrderFormFactory\n{\n private readonly ProductsService _prodsSvc;\n private...
2008/10/01
[ "https://Stackoverflow.com/questions/156292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/615/" ]
156,322
<p>fossil <a href="http://www.fossil-scm.org" rel="noreferrer">http://www.fossil-scm.org</a><br> I found this recently and have started using it for my home projects. I want to hear what other people think of this VCS. </p> <p>What is missing in my mind, is IDE support. Hopefully it will come, but I use the command...
[ { "answer_id": 265829, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "for /r %i in (*.*) do fossil add \"%i\"\n find . -type f -print0 | xargs -0 fossil add --\n" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/156322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3576/" ]
156,329
<p>I need to pad numbers with leading zeros (total 8 digits) for display. I'm using oracle.</p> <pre><code>select to_char(1011,'00000000') OPE_NO from dual; select length(to_char(1011,'00000000')) OPE_NO from dual; </code></pre> <p>Instead of '00001011' I get ' 00001011'. Why do I get an extra leading blank space? Wh...
[ { "answer_id": 156670, "author": "Steve Bosman", "author_id": 4389, "author_profile": "https://Stackoverflow.com/users/4389", "pm_score": 6, "selected": true, "text": "select to_char(1011,'FM00000000') OPE_NO from dual;" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/156329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3751/" ]
156,330
<p>I'm just trying to time a piece of code. The pseudocode looks like:</p> <pre><code>start = get_ticks() do_long_code() print "It took " + (get_ticks() - start) + " seconds." </code></pre> <p>How does this look in Python?</p> <p>More specifically, how do I get the number of ticks since midnight (or however Python o...
[ { "answer_id": 156335, "author": "blackwing", "author_id": 9107, "author_profile": "https://Stackoverflow.com/users/9107", "pm_score": 5, "selected": false, "text": "time() time import time\nstart = time.time()\ndo_long_code()\nprint \"it took\", time.time() - start, \"seconds.\"\n" },...
2008/10/01
[ "https://Stackoverflow.com/questions/156330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432/" ]
156,331
<p>I was inserting data into a MS Access database using JDBC-ODBC driver. The blank mdb file was 2KB. After populating this database, the size grew to 155MB. Then I was deleting the data. But I found the size of mdb remains the same as 155MB. I don't get any errors. But is it normal this way? I would expect the ...
[ { "answer_id": 156346, "author": "Jon Cahill", "author_id": 10830, "author_profile": "https://Stackoverflow.com/users/10830", "pm_score": 5, "selected": false, "text": "msaccess.exe \"target database.accdb\" /compact \n" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/156331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24020/" ]
156,360
<p>I have one thread that writes results into a Queue.</p> <p>In another thread (GUI), I periodically (in the IDLE event) check if there are results in the queue, like this:</p> <pre><code>def queue_get_all(q): items = [] while 1: try: items.append(q.get_nowait()) except Empty, e: ...
[ { "answer_id": 156564, "author": "Brian", "author_id": 9493, "author_profile": "https://Stackoverflow.com/users/9493", "pm_score": 4, "selected": false, "text": "from __future__ import with_statement\nimport threading\n\nclass ItemStore(object):\n def __init__(self):\n self.loc...
2008/10/01
[ "https://Stackoverflow.com/questions/156360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
156,362
<p>Just getting my head around Ruby metaprogramming. The mixin/modules always manage to confuse me. </p> <ul> <li><strong>include</strong>: mixes in specified module methods as <strong>instance methods</strong> in the target class</li> <li><strong>extend</strong>: mixes in specified module methods as <strong>class met...
[ { "answer_id": 156927, "author": "domgblackwell", "author_id": 16954, "author_profile": "https://Stackoverflow.com/users/16954", "pm_score": 9, "selected": true, "text": "Klazz Mod Mod Klazz Klazz Mod Klazz Mod Klazz Mod o.extend Mod Mod o" }, { "answer_id": 5008349, "author"...
2008/10/01
[ "https://Stackoverflow.com/questions/156362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695/" ]
156,369
<p>It seems quite a few mainstream languages support <a href="http://en.wikipedia.org/wiki/First-class_function" rel="noreferrer">function literals</a> these days. They are also called <a href="http://en.wikipedia.org/wiki/Anonymous_function" rel="noreferrer">anonymous functions</a>, but I don't care if they have a nam...
[ { "answer_id": 156374, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "labels letrec var foo = {\"bar\": function baz() {return baz() + 1;}};\n callee function" }, { "answer_id": 156393, ...
2008/10/01
[ "https://Stackoverflow.com/questions/156369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15069/" ]
156,373
<p>I'm storing an object (<code>TTF_Font</code>) in a <code>shared_ptr</code> that is provided to me from a third-party API. I cannot use new or delete on the object, so the <code>shared_ptr</code> is also provided a "freeing" functor.</p> <pre><code>// Functor struct CloseFont { void operator()(TTF_Font* font) co...
[ { "answer_id": 156386, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 0, "selected": false, "text": "TTF_OpenFont TTF_CloseFont CloseFont &TTF_CloseFont" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/156373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18265/" ]
156,394
<p>How is it that Ruby allows a class access methods outside of the class implicitly?</p> <p>Example:</p> <pre><code>class Candy def land homer end end def homer puts "Hello" end Candy.new.land #Outputs Hello </code></pre>
[ { "answer_id": 161113, "author": "Grant Hutchins", "author_id": 6304, "author_profile": "https://Stackoverflow.com/users/6304", "pm_score": 2, "selected": false, "text": "homer Kernel Object Object homer Candy Object Kernel Object" }, { "answer_id": 8286738, "author": "Linuxi...
2008/10/01
[ "https://Stackoverflow.com/questions/156394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
156,395
<p>As a Java developer who is reading Apple's Objective-C 2.0 documentation: I wonder what "<em>sending a message to nil</em>" means - let alone how it is actually useful. Taking an excerpt from the documentation:</p> <blockquote> <p>There are several patterns in Cocoa that take advantage of this fact. The valu...
[ { "answer_id": 156415, "author": "Rich", "author_id": 22003, "author_profile": "https://Stackoverflow.com/users/22003", "pm_score": 4, "selected": false, "text": "[someNullNSArrayReference count] => 0\n" }, { "answer_id": 156463, "author": "Michael Buckley", "author_id": ...
2008/10/01
[ "https://Stackoverflow.com/questions/156395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9931/" ]
156,412
<p><code>GWT</code> gets locale from either the locale property or the locale query string. If neither is specified, it uses the "default" (ie <code>en_US</code>) locale.</p> <p>Why doesn't it get it from the browser settings?</p> <p>It seems the only solution to this is to replace your static html launch page with...
[ { "answer_id": 161313, "author": "Drejc", "author_id": 6482, "author_profile": "https://Stackoverflow.com/users/6482", "pm_score": 2, "selected": false, "text": "<!-- Slovenian in Slovenia -->\n<extend-property name=\"locale\" values=\"sl\"/>\n\n<!-- English language, independent of coun...
2008/10/01
[ "https://Stackoverflow.com/questions/156412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18393/" ]
156,430
<p>I recently read somewhere that writing a regexp to match an email address, taking into account all the variations and possibilities of the standard is extremely hard and is significantly more complicated than what one would initially assume.</p> <p>Why is that?</p> <p>Are there any known and proven regexps that actu...
[ { "answer_id": 156449, "author": "janm", "author_id": 7256, "author_profile": "https://Stackoverflow.com/users/7256", "pm_score": 3, "selected": false, "text": "\" @ \"@example.com\n" }, { "answer_id": 156455, "author": "Mike Thompson", "author_id": 2754, "author_prof...
2008/10/01
[ "https://Stackoverflow.com/questions/156430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9611/" ]
156,436
<p>It's quite a simple question - how do I sort a collection?</p> <p>I've got a CSV file with rows in a random order. I'd like to sort the rows according to the date in one column. Do I add the rows to a recordset? Can I sort with a Scripting.Dictionary?</p> <p>I've clearly been spoilt with .NET and Linq, and now I f...
[ { "answer_id": 156496, "author": "Wayne", "author_id": 8236, "author_profile": "https://Stackoverflow.com/users/8236", "pm_score": 2, "selected": false, "text": "<%\n\nDim strConnection, conn, rs, strSQL\n\nstrConnection = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\inetpub\\wwwro...
2008/10/01
[ "https://Stackoverflow.com/questions/156436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5744/" ]
156,438
<p>See title: what does it mean for a C++ function to be inline?</p>
[ { "answer_id": 156453, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 0, "selected": false, "text": "if switch" }, { "answer_id": 156511, "author": "Simon Buchan", "author_id": 20135, "author_profile": "ht...
2008/10/01
[ "https://Stackoverflow.com/questions/156438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7545/" ]
156,457
<p>Is it possible to enumerate all the current errors being displayed through an "Error Provider" without having to access the controls?</p>
[ { "answer_id": 2297261, "author": "Aidan Ryan", "author_id": 1042, "author_profile": "https://Stackoverflow.com/users/1042", "pm_score": 2, "selected": false, "text": "foreach (Control ctrl in errProv.ContainerControl.Controls)\n{\n Console.WriteLine(errProv.GetError(ctrl));\n}\n" }...
2008/10/01
[ "https://Stackoverflow.com/questions/156457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490/" ]
156,467
<p>I've been looking at F# recently, and while I'm not likely to leap the fence any time soon, it definitely highlights some areas where C# (or library support) could make life easier.</p> <p>In particular, I'm thinking about the pattern matching capability of F#, which allows a very rich syntax - much more expressive...
[ { "answer_id": 156566, "author": "Brian", "author_id": 19299, "author_profile": "https://Stackoverflow.com/users/19299", "pm_score": 5, "selected": false, "text": "let getRentPrice (v : Vehicle) = \n match v with\n | :? Motorcycle as bike -> 100 + bike.Cylinders * 10\n | :? Bicy...
2008/10/01
[ "https://Stackoverflow.com/questions/156467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23354/" ]
156,478
<p>I'm implementing a cache in a class library that i'm using in an asp.net application. </p> <p>I created my cache object as a singleton pattern with a static method to update the cache which is really just loading a member variable/property with a collection of data i need cached (got some locking logic ofcourse). I...
[ { "answer_id": 156506, "author": "Sergio Acosta", "author_id": 2954, "author_profile": "https://Stackoverflow.com/users/2954", "pm_score": 4, "selected": true, "text": "public interface ICacheService \n{\n AddItem(...);\n}\n public AspNetBasedCacheService : ICacheService\n{\n AddIt...
2008/10/01
[ "https://Stackoverflow.com/questions/156478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11619/" ]
156,492
<p>I have built a CFC designed to serve as a dynamic, aging cache intended for almost everything worth caching. LDAP queries, function results, arrays, ojects, you name it. Whatever takes time or resources to calculate and is needed more than once. I'd like to be able to do a few things:</p> <ul> <li><strong>share the...
[ { "answer_id": 240702, "author": "Adam Tuttle", "author_id": 751, "author_profile": "https://Stackoverflow.com/users/751", "pm_score": 2, "selected": true, "text": "<cfcomponent>\n <cfset variables.cacheScope = \"session\" /><!--- default to session --->\n <cfset variables.cache = ...
2008/10/01
[ "https://Stackoverflow.com/questions/156492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18771/" ]
156,503
<p>How can I use JUnit idiomatically to test that some code throws an exception?</p> <p>While I can certainly do something like this:</p> <pre><code>@Test public void testFooThrowsIndexOutOfBoundsException() { boolean thrown = false; try { foo.doStuff(); } catch (IndexOutOfBoundsException e) { thrown = t...
[ { "answer_id": 156515, "author": "Johan", "author_id": 11347, "author_profile": "https://Stackoverflow.com/users/11347", "pm_score": 5, "selected": false, "text": "public void testFooThrowsIndexOutOfBoundsException() {\n Throwable e = null;\n\n try {\n foo.doStuff();\n } catch (Thr...
2008/10/01
[ "https://Stackoverflow.com/questions/156503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1666/" ]
156,504
<p>I'm trying to insert some import lines into a python source file, but i would ideally like to place them right after the initial docstring. Let's say I load the file into the lines variable like this:</p> <pre><code>lines = open('filename.py').readlines() </code></pre> <p>How to find the line number, where the doc...
[ { "answer_id": 156513, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 3, "selected": true, "text": "count = 0\nfor line in lines:\n if line.startswith ('\"\"\"'):\n count += 1\n if count < 3:\n ...
2008/10/01
[ "https://Stackoverflow.com/questions/156504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/985/" ]
156,508
<p>Alright, I have been doing the following (variable names have been changed):</p> <pre><code> FileInputStream fis = null; try { fis = new FileInputStream(file); ... process ... } catch (IOException e) { ... handle error ... } finally { if (fis != null) fis.close(); } </code> </pre> <p>Rece...
[ { "answer_id": 156520, "author": "Max Stewart", "author_id": 18338, "author_profile": "https://Stackoverflow.com/users/18338", "pm_score": 5, "selected": false, "text": "FileInputStream fis = null;\ntry\n{\n fis = new FileInputStream(file);\n\n ... process ...\n\n\n}\ncatch (IOExce...
2008/10/01
[ "https://Stackoverflow.com/questions/156508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18049/" ]
156,510
<p>Is there a way to increase the stack size of a Windows application at compile/link time with GCC?</p>
[ { "answer_id": 156730, "author": "Jonas Engström", "author_id": 7634, "author_profile": "https://Stackoverflow.com/users/7634", "pm_score": 5, "selected": false, "text": "gcc -Wl,--stack,16777216 -o file.exe file.c\n" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/156510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1597/" ]
156,532
<p>I need to import largish (24MB) text files into a MySQL table. Each line looks like this:</p> <pre><code>1 1 0.008 0 0 0 0 0 </code></pre> <p>There are one or more spaces after each field, and the last field is tailed by about 36 spaces before the newline.</p> <p>How do I ...
[ { "answer_id": 156550, "author": "Jauco", "author_id": 6874, "author_profile": "https://Stackoverflow.com/users/6874", "pm_score": 4, "selected": true, "text": "sed 's/ \\+/ /g' thefile > thefile.new\n" }, { "answer_id": 156578, "author": "Ian", "author_id": 4396, "au...
2008/10/01
[ "https://Stackoverflow.com/questions/156532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1428/" ]
156,552
<p>I want to implement a two-pass cache system:</p> <ul> <li><p>The first pass generates a PHP file, with all of the common stuff (e.g. news items), hardcoded. The database then has a cache table to link these with the pages (eg "index.php page=1 style=default"), the database also stores an uptodate field, which if fa...
[ { "answer_id": 156561, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 1, "selected": false, "text": "if filename exists\n include filename\nelse\n generate results\n render to html (as string)\n write to file\n o...
2008/10/01
[ "https://Stackoverflow.com/questions/156552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6266/" ]
156,563
<p>How do you setup an asp.net sql membership role/membership provider on a production machine? I'm trying to setup BlogEngine.NET and all the documentation says to use the ASP.NET Website Administration tool from Visual Studio but that isn't available on a production machine. Am I the first BlogEngine user to use it o...
[ { "answer_id": 158238, "author": "ThatBloke", "author_id": 7050, "author_profile": "https://Stackoverflow.com/users/7050", "pm_score": 4, "selected": true, "text": "\n void Application_Start(object sender, EventArgs e) \n {\n // Code that runs on application startup\n\n ...
2008/10/01
[ "https://Stackoverflow.com/questions/156563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17176/" ]
156,575
<p>I'm looking for a good TraceListener for .Net that supports rolling over the log file based on size limits. </p> <p><strong>Constraints</strong></p> <ul> <li>Uses .Net built in Trace logging</li> <li>Independent class or binary that's not part of some gigantic library</li> <li>Allows rolling over a log file based...
[ { "answer_id": 36406938, "author": "Ostati", "author_id": 2654100, "author_profile": "https://Stackoverflow.com/users/2654100", "pm_score": 4, "selected": false, "text": "<system.diagnostics>\n <sources>\n <source name=\"System.Net\">\n <listeners>\n <add name=\"System.Ne...
2008/10/01
[ "https://Stackoverflow.com/questions/156575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17222/" ]
156,582
<p>I started using <a href="http://www.codeplex.com/SHFB" rel="noreferrer">Sandcastle</a> some time ago to generate a Documentation Website for one of our projects. It's working quite well but we've always only written documentation for classes, methods, properties (...) in our project and had completely separate docum...
[ { "answer_id": 156726, "author": "Rinat Abdullin", "author_id": 47366, "author_profile": "https://Stackoverflow.com/users/47366", "pm_score": 3, "selected": false, "text": "<namespaceSummaryItem name=\"System\" isDocumented=\"True\">\n Generic interfaces and helper classes.\n</namespa...
2008/10/01
[ "https://Stackoverflow.com/questions/156582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5005/" ]
156,584
<p>I've seen a few examples on how to do build deployment, however I have something unique that I'd like to do:</p> <ol> <li>Deploy the build to a folder that has the build number (eg. Project\Builds\8423)</li> <li>Alter the version number in the .NET AssmblyInfo.cs to match the build number</li> </ol> <p>Has anyone ...
[ { "answer_id": 163518, "author": "Mike", "author_id": 2848, "author_profile": "https://Stackoverflow.com/users/2848", "pm_score": 0, "selected": false, "text": "<AssemblyInfo CodeLanguage=\"C#\"\n OutputFile=\"%(YourProjects.RootDir)%(Directory)Properties\\AssemblyInfo.cs\"\n Assem...
2008/10/01
[ "https://Stackoverflow.com/questions/156584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17222/" ]
156,585
<p>I'm just wondering if there can be a case where the hostname can be successfully resolved but the returned hostEntry.AddressList is empty.</p> <p>Currently I'm doing something like this:</p> <pre><code>IPHostEntry hostEntry = Dns.GetHostEntry("some.hostname.tld"); if (hostEntry.AddressList.Count() &lt; 1) { // c...
[ { "answer_id": 156638, "author": "mdb", "author_id": 8562, "author_profile": "https://Stackoverflow.com/users/8562", "pm_score": 2, "selected": true, "text": "InternalGetHostByName(string hostName, bool includeIPv6)" } ]
2008/10/01
[ "https://Stackoverflow.com/questions/156585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21038/" ]
156,586
<p>We are using fmt:setBundle to load a resource bundle from a database (we extended the ResourceBundle class to do that). When we modify a value in database, we have to reload the web server to display the new value on the web app.</p> <p>Is there any simple way to use the new value without restarting the web server ...
[ { "answer_id": 156675, "author": "WMR", "author_id": 2844, "author_profile": "https://Stackoverflow.com/users/2844", "pm_score": 3, "selected": false, "text": "getTimeToLive() needsReload()" }, { "answer_id": 55914608, "author": "y.hussain", "author_id": 5874302, "aut...
2008/10/01
[ "https://Stackoverflow.com/questions/156586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3122/" ]
156,610
<p>I have a requirement to be able to provide a flex component in English and several asian languages. I have looked at the flex documentation and it seems that I have to build several swf's, which feels wrong. </p> <p>Does anyone know of a straightforward and practical way of bundling string resources in different ...
[ { "answer_id": 156631, "author": "Nadav", "author_id": 23094, "author_profile": "https://Stackoverflow.com/users/23094", "pm_score": 0, "selected": false, "text": "ResourceBundle" }, { "answer_id": 156718, "author": "Theo", "author_id": 1109, "author_profile": "https:...
2008/10/01
[ "https://Stackoverflow.com/questions/156610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24039/" ]
156,641
<p>I have a table of users which has a username column consisting of a six digit number e.g 675381, I need to prepend a zero to each of these usernames e.g. 0675381 would be the final output of the previous example, is there a query that could handle this?</p>
[ { "answer_id": 156656, "author": "daniels", "author_id": 9789, "author_profile": "https://Stackoverflow.com/users/9789", "pm_score": 6, "selected": true, "text": "UPDATE Tablename SET Username = Concat('0', Username);\n" }, { "answer_id": 156657, "author": "f13o", "author...
2008/10/01
[ "https://Stackoverflow.com/questions/156641", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13658/" ]
156,650
<p>When reviewing, I sometimes encounter this kind of loop:</p> <pre><code>i = begin while ( i != end ) { // ... do stuff if ( i == end-1 (the one-but-last element) ) { ... do other stuff } increment i } </code></pre> <p>Then I ask the question: would you write this?</p> <pre><code>i = begin mi...
[ { "answer_id": 156669, "author": "Matthias Winkelmann", "author_id": 4494, "author_profile": "https://Stackoverflow.com/users/4494", "pm_score": 4, "selected": false, "text": "for(i=0;i<elements.size;i++) {\n if (i>0) {\n string += ','\n }\n string += elements[i]\n}\n string = ...
2008/10/01
[ "https://Stackoverflow.com/questions/156650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6610/" ]
156,683
<p>I would like to know what of the many XSLT engines out there works well with Perl.</p> <p>I will use Apache (2.0) and Perl, and I want to obtain PDFs and XHTMLs.</p> <p>I'm new to this kind of projects so any comment or suggestion will be welcome.</p> <p>Thanks.</p> <hr> <p>Doing a simple search on Google I fou...
[ { "answer_id": 156870, "author": "Penfold", "author_id": 11952, "author_profile": "https://Stackoverflow.com/users/11952", "pm_score": 6, "selected": true, "text": " use XML::LibXSLT;\n use XML::LibXML;\n\n my $parser = XML::LibXML->new();\n my $xslt = XML::LibXSLT->new();\n\n my $s...
2008/10/01
[ "https://Stackoverflow.com/questions/156683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19689/" ]