qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
125,878
<p>I am new to java so excuse my lame questions:)</p> <p>I am trying to build a web service in Java NetBeans 6.1 , but I have some troubles with configuration parameters ( like .settings in .net).</p> <p>What is the right way to save and access such settings in a java web service.</p> <p>Is there a way to read cont...
[ { "answer_id": 125949, "author": "Lars Westergren", "author_id": 15627, "author_profile": "https://Stackoverflow.com/users/15627", "pm_score": 2, "selected": false, "text": "<servlet>\n <servlet-name>jsp</servlet-name>\n <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-clas...
2008/09/24
[ "https://Stackoverflow.com/questions/125878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18834/" ]
125,880
<p>Maps are great to get things done easily, but they are memory hogs and suffer from caching issues. And when you have a map in a critical loop that can be bad.</p> <p>So I was wondering if anyone can recommend another container that has the same API but uses lets say a vector or hash implementation instead of a tree...
[ { "answer_id": 125938, "author": "Carl Seleborg", "author_id": 2095, "author_profile": "https://Stackoverflow.com/users/2095", "pm_score": 2, "selected": false, "text": "std::vector" }, { "answer_id": 125943, "author": "Luc Touraille", "author_id": 20984, "author_prof...
2008/09/24
[ "https://Stackoverflow.com/questions/125880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15124/" ]
125,885
<p>I'm working on a fairly complex project, a custom encryption routine if you will (just for fun) and I've run into this issue in designing my code layout.</p> <p>I have a number of functions that I want to be able to call by index. Specifically, I need to be able to call one randomly for the encrypt process, but the...
[ { "answer_id": 125915, "author": "NeARAZ", "author_id": 6799, "author_profile": "https://Stackoverflow.com/users/6799", "pm_score": 3, "selected": false, "text": "struct FunctionPair {\n EncodeFunction encode;\n DecodeFunction decode;\n};\nFunctionPair g_Functions[] = {\n { MyEncod...
2008/09/24
[ "https://Stackoverflow.com/questions/125885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19521/" ]
125,921
<p>I'm trying to handle Winsock_Connect event (Actually I need it in Excel macro) using the following code:</p> <pre><code>Dim Winsock1 As Winsock 'Object type definition Sub Init() Set Winsock1 = CreateObject("MSWinsock.Winsock") 'Object initialization Winsock1.RemoteHost = "MyHost" Winsock1.RemotePort =...
[ { "answer_id": 125975, "author": "Nescio", "author_id": 14484, "author_profile": "https://Stackoverflow.com/users/14484", "pm_score": 3, "selected": true, "text": "Private WithEvents Winsock1 As Winsock\n" }, { "answer_id": 27361729, "author": "befzz", "author_id": 107920...
2008/09/24
[ "https://Stackoverflow.com/questions/125921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21530/" ]
125,934
<p>I'm writing an application to start and monitor other applications in C#. I'm using the System.Diagnostics.Process class to start applications and then monitor the applications using the Process.Responding property to poll the state of the application every 100 milisecs. I use Process.CloseMainWindow to stop the app...
[ { "answer_id": 126001, "author": "Rob Cooper", "author_id": 832, "author_profile": "https://Stackoverflow.com/users/832", "pm_score": 4, "selected": true, "text": "WaitForInputIdle" }, { "answer_id": 126140, "author": "Mendelt", "author_id": 3320, "author_profile": "h...
2008/09/24
[ "https://Stackoverflow.com/questions/125934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3320/" ]
125,951
<p>What is a good command line tool to create screenshots of websites on Linux? I need to automatically generate screenshots of websites without human interaction. The only tool that I found was <a href="http://khtml2png.sourceforge.net/" rel="noreferrer">khtml2png</a>, but I wonder if there are others that aren't base...
[ { "answer_id": 143148, "author": "Shannon Nelson", "author_id": 14450, "author_profile": "https://Stackoverflow.com/users/14450", "pm_score": 7, "selected": true, "text": "--height --width #!/bin/sh\n\n# start a server with a specific DISPLAY\nvncserver :11 -geometry 1024x768\n\n# start ...
2008/09/24
[ "https://Stackoverflow.com/questions/125951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4936/" ]
125,964
<p>Is there an easier way to step through the code than to start the service through the Windows Service Control Manager and then attaching the debugger to the thread? It's kind of cumbersome and I'm wondering if there is a more straightforward approach.</p>
[ { "answer_id": 125983, "author": "Paul van Brenk", "author_id": 1837197, "author_profile": "https://Stackoverflow.com/users/1837197", "pm_score": 5, "selected": false, "text": "/ConsoleRunner\n /....\n/ServiceRunner\n /....\n/ApplicationLogic\n /....\n" }, { "answer_id": 12...
2008/09/24
[ "https://Stackoverflow.com/questions/125964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16440/" ]
125,997
<p>I'm a newbie in C# bu I'm experienced Delphi developer. In Delphi I can use same code for MenuItem and ToolButton using TAction.OnExecute event and I can disable/enable MenuItem and ToolButton together using TAction.OnUpdate event. Is there a similar way to do this in C# without using external libraries? Or more - H...
[ { "answer_id": 127214, "author": "Michael Meadows", "author_id": 7643, "author_profile": "https://Stackoverflow.com/users/7643", "pm_score": 1, "selected": false, "text": "public abstract class ToolStripItemCommand\n{\n private bool enabled = true;\n private bool visible = true;\n ...
2008/09/24
[ "https://Stackoverflow.com/questions/125997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21540/" ]
126,002
<p>I need to find out what ports are attached to which processes on a Unix machine (HP Itanium). Unfortunately, <code>lsof</code> is not installed and I have no way of installing it. </p> <p>Does anyone know an alternative method? A fairly lengthy Googling session hasn't turned up anything.</p>
[ { "answer_id": 126014, "author": "dogbane", "author_id": 7412, "author_profile": "https://Stackoverflow.com/users/7412", "pm_score": 2, "selected": false, "text": "pfiles PID" }, { "answer_id": 126026, "author": "lms", "author_id": 21359, "author_profile": "https://St...
2008/09/24
[ "https://Stackoverflow.com/questions/126002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21544/" ]
126,005
<p>Specifically I have a PHP command-line script that at a certain point requires input from the user. I would like to be able to execute an external editor (such as vi), and wait for the editor to finish execution before resuming the script.</p> <p>My basic idea was to use a temporary file to do the editing in, and t...
[ { "answer_id": 126031, "author": "lms", "author_id": 21359, "author_profile": "https://Stackoverflow.com/users/21359", "pm_score": 0, "selected": false, "text": "system('vi');\n" }, { "answer_id": 126037, "author": "Seldaek", "author_id": 6512, "author_profile": "http...
2008/09/24
[ "https://Stackoverflow.com/questions/126005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10942/" ]
126,012
<p>I have a stored procedure in SQL 2005. The Stored Procedure is actually creating temporary tables in the beginning of SP and deleting it in the end. I am now debugging the SP in VS 2005. In between the SP i would want to know the contents into the temporary table. Can anybody help in in viewing the contents of the t...
[ { "answer_id": 126040, "author": "Ilya Kochetov", "author_id": 15329, "author_profile": "https://Stackoverflow.com/users/15329", "pm_score": 5, "selected": true, "text": "@table #table ##table" }, { "answer_id": 126060, "author": "Vinod", "author_id": 20951, "author_p...
2008/09/24
[ "https://Stackoverflow.com/questions/126012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20951/" ]
126,028
<p>We have a 3D viewer that uses OpenGL, but our clients sometimes complain about it "not working". We suspect that most of these issues stem from them trying to use, what is in effect a modern 3d realtime game, on a businiss laptop computer.</p> <p><strong>How can we, in the windows msi installer we use, check for su...
[ { "answer_id": 126553, "author": "NeARAZ", "author_id": 6799, "author_profile": "https://Stackoverflow.com/users/6799", "pm_score": 4, "selected": true, "text": "// setup minimal required GL\nHWND wnd = CreateWindow(\n \"STATIC\",\n \"GL\",\n WS_OVERLAPPEDWINDOW | WS_CLIPSIBLING...
2008/09/24
[ "https://Stackoverflow.com/questions/126028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4013/" ]
126,036
<p>Is there a way to know and output the stack size needed by a function at compile time in C ? Here is what I would like to know :</p> <p>Let's take some function :</p> <pre><code>void foo(int a) { char c[5]; char * s; //do something return; } </code></pre> <p>When compiling this function, I would l...
[ { "answer_id": 126047, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 1, "selected": false, "text": "alloca" }, { "answer_id": 126490, "author": "shodanex", "author_id": 11589, "author_profile": "...
2008/09/24
[ "https://Stackoverflow.com/questions/126036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11589/" ]
126,044
<p>I just got Delphi 2009 and have previously read some articles about modifications that might be necessary because of the switch to Unicode strings. Mostly, it is mentioned that sizeof(char) is not guaranteed to be 1 anymore. But why would this be interesting regarding string manipulation?</p> <p>For example, if I u...
[ { "answer_id": 126079, "author": "Loesje", "author_id": 17559, "author_profile": "https://Stackoverflow.com/users/17559", "pm_score": 1, "selected": false, "text": "var p : pchar;\nbegin\n p := s[1];\n for i := 0 to length(string)-1 do\n begin\n write(p);\n inc(p);\n end; ...
2008/09/24
[ "https://Stackoverflow.com/questions/126044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5015/" ]
126,048
<p>I have a problem where a Web Application needs to (after interaction from the user via Javascript)<br> &nbsp;&nbsp; 1) open a Windows Forms Application<br> &nbsp;&nbsp; 2) send a parameter to the app (e.g. an ID)</p> <p>Correspondingly, the Windows Forms Application should be able to<br> &nbsp;&nbsp; 1) send parame...
[ { "answer_id": 126067, "author": "Ilya Kochetov", "author_id": 15329, "author_profile": "https://Stackoverflow.com/users/15329", "pm_score": 3, "selected": false, "text": "System.Diagnostics.Process.Start(\"http://example.com?key=value\");\n" }, { "answer_id": 136740, "author...
2008/09/24
[ "https://Stackoverflow.com/questions/126048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21552/" ]
126,068
<p>I'm building a public website which has its own domain name with pop/smtp mail services. I'm considering giving users the option to update their data via email - something similar to the functionality found in Flickr or Blogger where you email posts to a special email address. The email data is then processed and st...
[ { "answer_id": 126375, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 2, "selected": false, "text": "username@domain.com username-randomnumer@domain.com" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18655/" ]
126,070
<p>I have an email subject of the form:</p> <pre><code>=?utf-8?B?T3.....?= </code></pre> <p>The body of the email is utf-8 base64 encoded - and has decoded fine. I am current using Perl's Email::MIME module to decode the email.</p> <p>What is the meaning of the =?utf-8 delimiter and how do I extract information from...
[ { "answer_id": 126087, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 6, "selected": true, "text": "encoded-word =?<charset>?<encoding>?<data>?=\n B Q use Encode qw/encode decode/;\n$utf8 = decode('MIME-Header', $h...
2008/09/24
[ "https://Stackoverflow.com/questions/126070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21553/" ]
126,094
<p>Considering that the debug data file is available (PDB) and by using either <strong>System.Reflection</strong> or another similar framework such as <strong>Mono.Cecil</strong>, how to retrieve programmatically the source file name and the line number where a type or a member of a type is declared.</p> <p>For exampl...
[ { "answer_id": 126132, "author": "Richard", "author_id": 20038, "author_profile": "https://Stackoverflow.com/users/20038", "pm_score": -1, "selected": false, "text": "Dim CurrentStack As System.Diagnostics.StackTrace\nMsgBox (CurrentStack.GetFrame(0).GetFileLineNumber)\n Public Function ...
2008/09/24
[ "https://Stackoverflow.com/questions/126094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/563/" ]
126,100
<p>What's the fastest way to count the number of keys/properties of an object? Is it possible to do this without iterating over the object? I.e., without doing:</p> <pre><code>var count = 0; for (k in myobj) if (myobj.hasOwnProperty(k)) ++count; </code></pre> <p>(Firefox did provide a magic <code>__count__</code> prop...
[ { "answer_id": 126151, "author": "Confusion", "author_id": 16784, "author_profile": "https://Stackoverflow.com/users/16784", "pm_score": 5, "selected": false, "text": "getNumberOfProperties(object)" }, { "answer_id": 126157, "author": "Luke Bennett", "author_id": 17602, ...
2008/09/24
[ "https://Stackoverflow.com/questions/126100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11543/" ]
126,109
<p>I defined a record named <code>log</code>. I want to create an mnesia table with name <code>log_table</code>. When I try to write a record to table, I get <code>bad_type</code> error as follows:</p> <pre><code>(node1@kitt)4&gt; mnesia:create_table(log_table, [{ram_copies, [node()]}, ...
[ { "answer_id": 126223, "author": "Haldun", "author_id": 21000, "author_profile": "https://Stackoverflow.com/users/21000", "pm_score": 2, "selected": false, "text": "mnesia:create_table mnesia:create_table(log_table, [{ram_copies, [node()]},\n {record_name, ...
2008/09/24
[ "https://Stackoverflow.com/questions/126109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21000/" ]
126,114
<p><strong>Problem</strong>. I need a way to find Starteam server time through Starteam Java SDK 8.0. Version of server is 8.0.172 so method <code>Server.getCurrentTime()</code> is not available since it was added only in server version 9.0.</p> <p><strong>Motivation</strong>. My application needs to use views at spec...
[ { "answer_id": 126516, "author": "Ioannis", "author_id": 20428, "author_profile": "https://Stackoverflow.com/users/20428", "pm_score": -1, "selected": false, "text": "<stab_in_the_dark> </stab_in_the_dark>" }, { "answer_id": 127671, "author": "wheleph", "author_id": 15647...
2008/09/24
[ "https://Stackoverflow.com/questions/126114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15647/" ]
126,116
<p>Is it possbile to execute linux commands with java? I am trying to create a web servlet to allow ftp users to change their passwords without ssh login access. I would like to execute the next commands: </p> <pre><code># adduser -s /sbin/nologin clientA -d /home/mainclient/clientA # passwd clientA # cd /home/maincl...
[ { "answer_id": 126124, "author": "Josh Moore", "author_id": 5004, "author_profile": "https://Stackoverflow.com/users/5004", "pm_score": 3, "selected": false, "text": "Runtime.getRuntim().exec(\"Command\");\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2138/" ]
126,128
<p>Anyone know if it is possible? And got any sample code for this? Or any other java API that can do this?</p>
[ { "answer_id": 3332837, "author": "Leonardo", "author_id": 401906, "author_profile": "https://Stackoverflow.com/users/401906", "pm_score": 1, "selected": false, "text": " IDocument myDoc = new Document2004(); \n myDoc.getBody().addEle(\"path/myImage.png\"));\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17147/" ]
126,138
<p>I'm trying to run a process and do stuff with its input, output and error streams. The obvious way to do this is to use something like <code>select()</code>, but the only thing I can find in Java that does that is <code>Selector.select()</code>, which takes a <code>Channel</code>. It doesn't appear to be possible to...
[ { "answer_id": 126423, "author": "Daniel Schneller", "author_id": 1252368, "author_profile": "https://Stackoverflow.com/users/1252368", "pm_score": 2, "selected": false, "text": "public void run() {\n BufferedReader tStreamReader = null;\n try {\n while (externalCommand == n...
2008/09/24
[ "https://Stackoverflow.com/questions/126138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11815/" ]
126,141
<p>I need to determine which version of GTK+ is installed on Ubuntu</p> <p>Man does not seem to help</p>
[ { "answer_id": 126145, "author": "Torsten Marek", "author_id": 9567, "author_profile": "https://Stackoverflow.com/users/9567", "pm_score": 5, "selected": false, "text": "$ dpkg -s libgtk2.0-0|grep '^Version'\n" }, { "answer_id": 126193, "author": "Mark Baker", "author_id"...
2008/09/24
[ "https://Stackoverflow.com/questions/126141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15352/" ]
126,148
<p>How is the salt generated in HashProvider in Microsoft Enterprise Library when we set SaltEnabled?</p> <p>Is it random to new machines? Is it some magic number?</p> <p>(I know what is a salt, the question is what's the actual value of a/the salt in Enterprise Library HashProvider)</p>
[ { "answer_id": 128481, "author": "Corbin March", "author_id": 7625, "author_profile": "https://Stackoverflow.com/users/7625", "pm_score": 2, "selected": false, "text": "public bool CompareHash(byte[] plaintext, byte[] hashedtext)\n" }, { "answer_id": 27247664, "author": "Gare...
2008/09/24
[ "https://Stackoverflow.com/questions/126148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
126,154
<p>I am designing a page to Add/Edit users - I used a repeater control and a table to display users. In users view the individual columns of the table row have labels to display a record values and when users click on edit button, the labels are hidden and text boxes are displayed for users to edit values - The problem...
[ { "answer_id": 126254, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 0, "selected": false, "text": "<td> <td> <td> <td>" }, { "answer_id": 126311, "author": "Filini", "author_id": 21162, "author_profile": "...
2008/09/24
[ "https://Stackoverflow.com/questions/126154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17296/" ]
126,164
<p>Assume the following class:</p> <pre><code>public class MyEnum: IEnumerator { private List&lt;SomeObject&gt; _myList = new List&lt;SomeObject&gt;(); ... } </code></pre> <p>It is necessary to implement the IEnumerator methods in MyEnum. But is it possible to 'delegate' or redirect the implementation for IEnume...
[ { "answer_id": 126171, "author": "Paul van Brenk", "author_id": 1837197, "author_profile": "https://Stackoverflow.com/users/1837197", "pm_score": -1, "selected": false, "text": "public class MyEnum : List<SomeObject>, IEnumerable<SomeObject>{}\n" }, { "answer_id": 126191, "au...
2008/09/24
[ "https://Stackoverflow.com/questions/126164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21568/" ]
126,167
<p>Application able to record error in OnError, but we are not able to do any redirect or so to show something meaningfull to user. Any ideas? I know that we can set maxRequestLength in web.config, but anyway user can exceed this limit and some normal error need to be displayed.</p>
[ { "answer_id": 126376, "author": "JohnIdol", "author_id": 1311500, "author_profile": "https://Stackoverflow.com/users/1311500", "pm_score": 4, "selected": true, "text": "<system.web>\n <customErrors mode=On defaultRedirect=yourCustomErrorPage.aspx />\n</system.web>\n <system.web> \n...
2008/09/24
[ "https://Stackoverflow.com/questions/126167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11768/" ]
126,179
<p>If I have a query like, </p> <pre><code>DELETE FROM table WHERE datetime_field &lt; '2008-01-01 00:00:00' </code></pre> <p>does having the <code>datetime_field</code> column indexed help? i.e. is the index only useful when using equality (or inequality) testing, or is it useful when doing an ordered comparison as...
[ { "answer_id": 126461, "author": "Bruno De Fraine", "author_id": 6918, "author_profile": "https://Stackoverflow.com/users/6918", "pm_score": 2, "selected": false, "text": "EXPLAIN" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4966/" ]
126,207
<p>Are there any best practices (or even standards) to store addresses in a consistent and comprehensive way in a database ?</p> <p>To be more specific, I believe at this stage that there are two cases for address storage :</p> <ul> <li>you just need to associate an address to a person, a building or any item (the mo...
[ { "answer_id": 126219, "author": "Hank Gay", "author_id": 4203, "author_profile": "https://Stackoverflow.com/users/4203", "pm_score": 3, "selected": true, "text": "Address" }, { "answer_id": 414803, "author": "Nicholas Piasecki", "author_id": 32187, "author_profile": ...
2008/09/24
[ "https://Stackoverflow.com/questions/126207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8696/" ]
126,238
<p>Imagine to have two RESTful controllers (UsersController, OffersController) and a PagesController (used for static content such as index, about and so on) in your application.</p> <p>You have the following routes defined:</p> <pre><code>map.with_options :controller =&gt; 'pages' do |pages| pages.root :action =&g...
[ { "answer_id": 126849, "author": "Jeremiah Peschka", "author_id": 11780, "author_profile": "https://Stackoverflow.com/users/11780", "pm_score": 1, "selected": false, "text": "def render_admin_menu()\n if !current_path.contains('offer')\n render :partial => 'shared/admin_menu'\n end\...
2008/09/24
[ "https://Stackoverflow.com/questions/126238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20467/" ]
126,242
<p>This is probably explained more easily with an example. I'm trying to find a way of turning a relative URL, e.g. "/Foo.aspx" or "~/Foo.aspx" into a full URL, e.g. <a href="http://localhost/Foo.aspx" rel="noreferrer">http://localhost/Foo.aspx</a>. That way when I deploy to test or stage, where the domain under which ...
[ { "answer_id": 126258, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 7, "selected": true, "text": "public string ConvertRelativeUrlToAbsoluteUrl(string relativeUrl) {\n return string.Format(\"http{0}://{1}{2}\",\n (R...
2008/09/24
[ "https://Stackoverflow.com/questions/126242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12277/" ]
126,260
<p>Since the release of Adobe AIR I am wondering why Java Web Start has not gained more attention in the past as to me it seems to be very similar, but web start is available for a much longer time.</p> <p>Is it mainly because of bad marketing from Sun, or are there more technical concerns other than the need of havin...
[ { "answer_id": 11465462, "author": "Mikko Rantalainen", "author_id": 334451, "author_profile": "https://Stackoverflow.com/users/334451", "pm_score": 2, "selected": false, "text": "application/x-java-jnlp-file javaws javaws.exe .jnlp application/x- https://example.com/app/launch.jnlp java...
2008/09/24
[ "https://Stackoverflow.com/questions/126260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7524/" ]
126,271
<p>Does someone have experience with storing key-value pairs in a database?</p> <p>I've been using this type of table:</p> <pre><code>CREATE TABLE key_value_pairs ( itemid varchar(32) NOT NULL, itemkey varchar(32) NOT NULL, itemvalue varchar(32) NOT NULL, CONSTRAINT ct_primary...
[ { "answer_id": 126308, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 1, "selected": false, "text": "create table item_config (item_id int, colour varchar, size varchar, fabric varchar)\n" }, { "answer_id": 12...
2008/09/24
[ "https://Stackoverflow.com/questions/126271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2887/" ]
126,277
<p>Say you want to generate a matched list of identifiers and strings</p> <pre><code>enum { NAME_ONE, NAME_TWO, NAME_THREE }; myFunction(NAME_ONE, "NAME_ONE"); myFunction(NAME_TWO, "NAME_TWO"); myFunction(NAME_THREE, "NAME_THREE"); </code></pre> <p>..without repeating yourself, and without auto-generating the code, ...
[ { "answer_id": 126291, "author": "Kristopher Johnson", "author_id": 1175, "author_profile": "https://Stackoverflow.com/users/1175", "pm_score": 6, "selected": true, "text": "#define myDefine(a) myFunc(a, #a);\n" }, { "answer_id": 126511, "author": "AareP", "author_id": 11...
2008/09/24
[ "https://Stackoverflow.com/questions/126277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46478/" ]
126,279
<p>To my amazement I just discovered that the C99 stdint.h is missing from MS Visual Studio 2003 upwards. I'm sure they have their reasons, but does anyone know where I can download a copy? Without this header I have no definitions for useful types such as uint32_t, etc.</p>
[ { "answer_id": 127166, "author": "Nicholas Mancuso", "author_id": 8945, "author_profile": "https://Stackoverflow.com/users/8945", "pm_score": 6, "selected": false, "text": "#ifdef _MSC_VER\n\ntypedef __int32 int32_t;\ntypedef unsigned __int32 uint32_t;\ntypedef __int64 int64_t;\ntypedef ...
2008/09/24
[ "https://Stackoverflow.com/questions/126279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
126,297
<p>After I <a href="https://stackoverflow.com/questions/121922/automatic-casts">messed up the description of my previous post</a> on this I have sat down and tried to convey my exact intent.</p> <p>I have a class called P which performs some distinct purpose. I also have PW which perform some distinct purpose on P. PW...
[ { "answer_id": 126446, "author": "Luc Touraille", "author_id": 20984, "author_profile": "https://Stackoverflow.com/users/20984", "pm_score": 3, "selected": true, "text": "class P\n{\n public:\n void a( ) { std::cout << \"a\" << std::endl; }\n};\n\nclass PW\n{\n public:\n PW(P& p)...
2008/09/24
[ "https://Stackoverflow.com/questions/126297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/342/" ]
126,320
<p>Suppose I have a set of commits in a repository folder...</p> <pre><code>123 (250 new files, 137 changed files, 14 deleted files) 122 (150 changed files) 121 (renamed folder) 120 (90 changed files) 119 (115 changed files, 14 deleted files, 12 added files) 118 (113 changed files) 117 (10 changed files) </code></pre>...
[ { "answer_id": 126357, "author": "Christian Davén", "author_id": 12534, "author_profile": "https://Stackoverflow.com/users/12534", "pm_score": -1, "selected": false, "text": "svn copy -r 117 source destination\n svnmerge.py merge -r119,120-123 svn merge" }, { "answer_id": 126411,...
2008/09/24
[ "https://Stackoverflow.com/questions/126320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4200/" ]
126,331
<p>I'm calling a non-.NET dll from my project using P/Invoke, meaning that the .dll must always be present in the .exe's directory. </p> <p>Is there any way to tell Visual Studio of this dependency, so that it will automatically copy the .dll to the output directory when compiling, and will automatically include the ....
[ { "answer_id": 126351, "author": "Magnus Johansson", "author_id": 3584, "author_profile": "https://Stackoverflow.com/users/3584", "pm_score": 3, "selected": false, "text": "Properties Build Action Content Copy to Output Directory Copy if newer" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6448/" ]
126,332
<p>I'm wanting a method called same_url? that will return true if the passed in URLs are equal. The passed in URLs might be either params options hash or strings.</p> <pre><code>same_url?({:controller =&gt; :foo, :action =&gt; :bar}, "http://www.example.com/foo/bar") # =&gt; true </code></pre> <p>The Rails Framework ...
[ { "answer_id": 126693, "author": "Codebeef", "author_id": 12037, "author_profile": "https://Stackoverflow.com/users/12037", "pm_score": 1, "selected": false, "text": "def same_url?(one, two)\n url_for(one) == url_for(two)\nend\n" }, { "answer_id": 126816, "author": "Dave Nol...
2008/09/24
[ "https://Stackoverflow.com/questions/126332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19588/" ]
126,367
<p>This is kind of hard to explain, I hope my English is sufficient:</p> <p>I have a class "A" which should maintain a list of objects of class "B" (like a private List). A consumer of class "A" should be able to add items to the list. After the items are added to the list, the consumer should not be able to modify th...
[ { "answer_id": 126374, "author": "Jorge Ferreira", "author_id": 6508, "author_profile": "https://Stackoverflow.com/users/6508", "pm_score": 0, "selected": false, "text": "namespace ConsoleApplication2\n{\n using System;\n using System.Collections.Generic;\n using System.Collecti...
2008/09/24
[ "https://Stackoverflow.com/questions/126367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16440/" ]
126,373
<p>I write a lot of dynamically generated content (developing under PHP) and I use jQuery to add extra flexibility and functionality to my projects.</p> <p>Thing is that it's rather hard to add JavaScript in an unobtrusive manner. Here's an example:</p> <p>You have to generate a random number of <code>div</code> elem...
[ { "answer_id": 126398, "author": "roryf", "author_id": 270, "author_profile": "https://Stackoverflow.com/users/270", "pm_score": 3, "selected": false, "text": "<div class=\"odd\">...</div>\n<div class=\"even\">...</div>\n<div class=\"odd\">...</div>\n<div class=\"even\">...</div>\n $(doc...
2008/09/24
[ "https://Stackoverflow.com/questions/126373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20603/" ]
126,381
<p>I am looking for a hash-algorithm, to create as close to a unique hash of a string (max len = 255) as possible, that produces a long integer (DWORD).</p> <p>I realize that 26^255 >> 2^32, but also know that the number of words in the English language is far less than 2^32.</p> <p>The strings I need to 'hash' would...
[ { "answer_id": 126391, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 1, "selected": false, "text": "static long\nstring_hash(PyStringObject *a)\n{\n register Py_ssize_t len;\n register unsigned char *p;\n r...
2008/09/24
[ "https://Stackoverflow.com/questions/126381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15161/" ]
126,385
<p>In our game project we did have a timer loop set to fire about 20 times a second (the same as the application framerate). We use this to move some sprites around. I'm wondering if this could cause problems and we should instead do our updates using an EnterFrame event handler? I get the impression that having a time...
[ { "answer_id": 131216, "author": "fenomas", "author_id": 10651, "author_profile": "https://Stackoverflow.com/users/10651", "pm_score": 2, "selected": false, "text": "ENTER_FRAME updateAfterEvent()" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13220/" ]
126,401
<p>Debugging some finance-related SQL code found a strange issue with numeric(24,8) mathematics precision.</p> <p>Running the following query on your MSSQL you would get A + B * C expression result to be 0.123457</p> <p>SELECT A, B, C, A + B * C FROM ( SELECT CAST(0.12345678 AS NUMERIC(24,8)) AS ...
[ { "answer_id": 126473, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 4, "selected": true, "text": "NUMERIC(24,8) NUMERIC(24,8) SELECT A, B, C, A + B * C\nFROM ( SELECT CAST(0.12345678 AS NUMERIC(24,8)) AS A,\n CAST(0 ...
2008/09/24
[ "https://Stackoverflow.com/questions/126401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21603/" ]
126,406
<p>I would like to change the database files location of MySQL administrator to another drive of my computer. (I run Windows XP SP2 and MySQL Administrator 1.2.8.)</p> <p>--Under the startup variable --> General Parameters --> I changed <code>Data directory:</code> from <code>C:/Program Files/MySQL/MySQL Server 5.0/...
[ { "answer_id": 126420, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 5, "selected": true, "text": "[mysqld] [mysqld_safe] datadir basedir" }, { "answer_id": 13462057, "author": "ajcw", "author_id": 3...
2008/09/24
[ "https://Stackoverflow.com/questions/126406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21608/" ]
126,409
<p>What are the ways to eliminate the use of switch in code?</p>
[ { "answer_id": 126415, "author": "Bernard", "author_id": 61, "author_profile": "https://Stackoverflow.com/users/61", "pm_score": 4, "selected": false, "text": "if else" }, { "answer_id": 126417, "author": "Josh", "author_id": 11702, "author_profile": "https://Stackove...
2008/09/24
[ "https://Stackoverflow.com/questions/126409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12514/" ]
126,430
<p>Is it possible to change the natural order of columns in Postgres 8.1?</p> <p>I know that you shouldn't rely on column order - it's not <em>essential</em> to what I am doing - I only need it to make some auto-generated stuff come out in a way that is more pleasing, so that the field order matches all the way from p...
[ { "answer_id": 126437, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 0, "selected": false, "text": "postgres=# create table a(a int, b int, c int);\nCREATE TABLE\npostgres=# insert into a values (1,2,3);\nINSERT 0 1\...
2008/09/24
[ "https://Stackoverflow.com/questions/126430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3408/" ]
126,431
<p>For a report in MS Access (2007) I need to put data of some columns on all odd pages and other columns on all even pages. It is for printing out double sided card files onto sheets of paper.</p> <p>Does somebody have an idea how to do that?</p>
[ { "answer_id": 127621, "author": "BIBD", "author_id": 685, "author_profile": "https://Stackoverflow.com/users/685", "pm_score": 1, "selected": false, "text": "A B \nC D\n A\nB\nC\nD\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
126,445
<p>I am implementing a design that uses custom styled submit-buttons. They are quite simply light grey buttons with a slightly darker outer border:</p> <pre><code>input.button { background: #eee; border: 1px solid #ccc; } </code></pre> <p>This looks just right in Firefox, Safari and Opera. The problem is with...
[ { "answer_id": 126474, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 1, "selected": false, "text": "<span> span.button {\n background: #eee;\n border: 1px solid #ccc;\n}\n\nspan.button input {\n background: #eee;\n ...
2008/09/24
[ "https://Stackoverflow.com/questions/126445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1123/" ]
126,465
<p>If I want to create the registry key</p> <blockquote> <p>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp</p> </blockquote> <p>with the string value</p> <blockquote> <p>EventMessageFile : C:\Path\To\File.dll</p> </blockquote> <p>how do I define this in my <a href="http://en.wik...
[ { "answer_id": 126565, "author": "SCdF", "author_id": 1666, "author_profile": "https://Stackoverflow.com/users/1666", "pm_score": 1, "selected": false, "text": "<registry action=\"write\" \n root\"HKLM\" key=\"SYSTEM\\CurrentControlSet\\Services\\Eventlog\\Application\\MyApp\"\n type=\"s...
2008/09/24
[ "https://Stackoverflow.com/questions/126465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20457/" ]
126,513
<p>I am running following <code>PHP</code> code to interact with a MS Access database.</p> <pre><code>$odbc_con = new COM("ADODB.Connection"); $constr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . $db_path . ";"; $odbc_con -&gt; open($constr); $rs_select = $odbc_con -&gt; execute ("SELECT * FROM Main"); </code...
[ { "answer_id": 126543, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 0, "selected": false, "text": "$rs_select = $odbc_con -> execute (\"SELECT COUNT(*) FROM Main\");\n" }, { "answer_id": 126603, "author": "Othersi...
2008/09/24
[ "https://Stackoverflow.com/questions/126513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6561/" ]
126,524
<p>I could swear I've seen the function (or method) that takes a list, like this <code>[3, 7, 19]</code> and makes it into iterable list of tuples, like so: <code>[(0,3), (1,7), (2,19)]</code> to use it instead of:</p> <pre><code>for i in range(len(name_of_list)): name_of_list[i] = something </code></pre> <p>but ...
[ { "answer_id": 126533, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 10, "selected": true, "text": ">>> a = [3,4,5,6]\n>>> for i, val in enumerate(a):\n... print i, val\n...\n0 3\n1 4\n2 5\n3 6\n>>>\n" }, { ...
2008/09/24
[ "https://Stackoverflow.com/questions/126524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37141/" ]
126,526
<p>Has anyone got any suggestions for unit testing a Managed Application Add-In for Office? I'm using NUnit but I had the same issues with MSTest.</p> <p>The problem is that there is a .NET assembly loaded inside the Office application (in my case, Word) and I need a reference to that instance of the .NET assembly. ...
[ { "answer_id": 713567, "author": "Richard Gadsden", "author_id": 20354, "author_profile": "https://Stackoverflow.com/users/20354", "pm_score": 3, "selected": true, "text": "Private Sub btnMemo_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) Han...
2008/09/24
[ "https://Stackoverflow.com/questions/126526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20354/" ]
126,528
<p>On the safari browser, the standard &lt;asp:Menu&gt; doesn't render well at all. How can this be fixed?</p>
[ { "answer_id": 127649, "author": "deepcode.co.uk", "author_id": 20524, "author_profile": "https://Stackoverflow.com/users/20524", "pm_score": 3, "selected": true, "text": "<browsers>\n <browser refID=\"safari1plus\">\n <controlAdapters>\n <adapter controlType=\"Syste...
2008/09/24
[ "https://Stackoverflow.com/questions/126528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20524/" ]
126,562
<p>I want to replace a single file inside a msi. How to do it?</p>
[ { "answer_id": 519098, "author": "saschabeaumont", "author_id": 592, "author_profile": "https://Stackoverflow.com/users/592", "pm_score": 1, "selected": false, "text": "Const MSI_SOURCE = \"application.msi\"\nConst FILE_REPLACE = \"config.xml\"\n\nDim filesys, installer, database, view\n...
2008/09/24
[ "https://Stackoverflow.com/questions/126562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5978/" ]
126,584
<p>I have a requirement to be be able to embed scanned tiff images into some SSRS reports.</p> <p>When I design a report in VS2005 and add an image control the tiff image displays perfectly however when I build it. I get the warning :</p> <p><code>Warning 2 [rsInvalidMIMEType] The value of the MIMEType property ...
[ { "answer_id": 130950, "author": "Peter Wone", "author_id": 1715673, "author_profile": "https://Stackoverflow.com/users/1715673", "pm_score": 3, "selected": true, "text": "Response.ContentType = \"image/png\";\nResponse.Clear();\nusing (Bitmap bmp = new Bitmap(tifFilepath))\n bmp.Save(R...
2008/09/24
[ "https://Stackoverflow.com/questions/126584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1116/" ]
126,587
<p>I have an old server with a defunct evaluation version of SQL 2000 on it (from 2006), and two databases which were sitting on it.</p> <p>For some unknown reason, the LDF log files are missing. Presumed deleted.</p> <p>I have the mdf files (and in one case an ndf file too) for the databases which used to exist on t...
[ { "answer_id": 126633, "author": "Jonathan", "author_id": 6910, "author_profile": "https://Stackoverflow.com/users/6910", "pm_score": 4, "selected": true, "text": "sp_configure 'allow updates', 1\ngo\nreconfigure with override\nGO\nupdate sysdatabases set status = 32768 where name = 'Tes...
2008/09/24
[ "https://Stackoverflow.com/questions/126587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6910/" ]
126,611
<p>I am not too familiar with .NET desktop applications (using <a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_2005" rel="noreferrer">Visual&nbsp;Studio&nbsp;2005</a>). Is it possible to have the entire application run from a single .exe file?</p>
[ { "answer_id": 126694, "author": "Vertigo", "author_id": 5468, "author_profile": "https://Stackoverflow.com/users/5468", "pm_score": 2, "selected": false, "text": "netz -s application.exe foo.dll bar.dll\n" }, { "answer_id": 10600027, "author": "nawfal", "author_id": 6619...
2008/09/24
[ "https://Stackoverflow.com/questions/126611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
126,631
<p>Is it possible to pass a function/callback from javascript to a java applet?</p> <p>For example i have an applet with a button that when pressed it will call the passed js callback</p> <pre><code>function onCommand() { alert('Button pressed from applet'); } applet.onCommand(onCommand); </code></pre>
[ { "answer_id": 126650, "author": "moonshadow", "author_id": 11834, "author_profile": "https://Stackoverflow.com/users/11834", "pm_score": 2, "selected": false, "text": "import netscape.javascript.*;\nimport java.applet.*;\nimport java.awt.*;\nclass MyApplet extends Applet {\n public ...
2008/09/24
[ "https://Stackoverflow.com/questions/126631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20300/" ]
126,652
<p>(Oracle) I have to return all records from last 12 months. How to do that in PL/SQL?</p> <p>EDIT: Sorry, I forgot to explain, I do have a column of DATA type</p>
[ { "answer_id": 126684, "author": "cagcowboy", "author_id": 19629, "author_profile": "https://Stackoverflow.com/users/19629", "pm_score": -1, "selected": false, "text": "SELECT *\nFROM table\nWHERE date_column > SYSDATE - 365\n" }, { "answer_id": 126707, "author": "cagcowbo...
2008/09/24
[ "https://Stackoverflow.com/questions/126652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3221/" ]
126,656
<p>I am doing a project at the moment, and in the interest of code reuse, I went looking for a library that can perform some probabilistic accept/reject of an item: </p> <p>i.e., there are three people (a, b c), and each of them have a probability P{i} of getting an item, where p{a} denotes the probability of a. These...
[ { "answer_id": 127132, "author": "finalman", "author_id": 20522, "author_profile": "https://Stackoverflow.com/users/20522", "pm_score": 2, "selected": true, "text": "public int selectPerson(float[] probabilies, Random r) {\n float t = r.nextFloat();\n float p = 0.0f;\n\n for (in...
2008/09/24
[ "https://Stackoverflow.com/questions/126656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17335/" ]
126,667
<p>When I launch the "mvn install" command, maven sometimes tries to download dependencies that it has already downloaded. That's expected for SNAPSHOT but why does maven do that for other JARs?</p> <p>I know I can avoid that behavior by "-o" flag but I just wonder what the cause is.</p>
[ { "answer_id": 7780139, "author": "fivetenwill", "author_id": 983104, "author_profile": "https://Stackoverflow.com/users/983104", "pm_score": 0, "selected": false, "text": "find ~/.m2/repository -name '_maven*' | xargs rm\nfind ~/.m2/repository -name '*lastUpdated' | xargs rm\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3122/" ]
126,678
<p>I don't seem to be able to close the OledbDataReader object after reading data from it. Here is the relevant code -</p> <pre><code>Dim conSyBase As New OleDb.OleDbConnection("Provider=Sybase.ASEOLEDBProvider.2;Server Name=xx.xx.xx.xx;Server Port Address=5000;Initial Catalog=xxxxxxxxxx;User ID=xxxxxxxx;Password=xxxx...
[ { "answer_id": 126784, "author": "Mikey", "author_id": 13347, "author_profile": "https://Stackoverflow.com/users/13347", "pm_score": 0, "selected": false, "text": "\nDim conSyBase As New OleDb.OleDbConnection(\"Provider=Sybase.ASEOLEDBProvider.2;Server Name=xx.xx.xx.xx;Server Port Addres...
2008/09/24
[ "https://Stackoverflow.com/questions/126678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1831/" ]
126,680
<p>Looking for one that is fast enough and still graceful with memory. The image is a 24bpp System.Drawing.Bitmap.</p>
[ { "answer_id": 126712, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 2, "selected": false, "text": "var cnt = new HashSet<System.Drawing.Color>();\n\nforeach (Color pixel in image)\n cnt.Add(pixel);\n\nConsole.Writ...
2008/09/24
[ "https://Stackoverflow.com/questions/126680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21623/" ]
126,718
<p>I'm working on a VB6 application and I would like to send a Type as a reference and store it in another form. Is this possible?</p> <p>Sending it is no problem, I just use the <code>ByRef</code> keyword:</p> <pre><code>public Sub SetStopToEdit(ByRef currentStop As StopType) </code></pre> <p>But when I try to use ...
[ { "answer_id": 126740, "author": "Daren Thomas", "author_id": 2260, "author_profile": "https://Stackoverflow.com/users/2260", "pm_score": 1, "selected": false, "text": "Set stopToEdit = currentStop\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16047/" ]
126,720
<p>Is it possible to setup a JDBC connection to Oracle without providing username/password information in a configuration file (or in any other standard readable location)?</p> <p>Typically applications have a configuration file that contains setup parameters to connect to a database. Some DBAs have problems with the ...
[ { "answer_id": 822248, "author": "Achille", "author_id": 100733, "author_profile": "https://Stackoverflow.com/users/100733", "pm_score": 2, "selected": false, "text": "J2EE 1/100 JBOSS J2EE" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9504/" ]
126,737
<p>After watching The Dark Knight I became rather enthralled with the concept of the Prisoner's Dilemma. There <em>must</em> be an algorithm that that maximizes one's own gain given a situation.</p> <p>For those that find this foreign: <a href="http://en.wikipedia.org/wiki/Prisoner%27s_dilemma" rel="nofollow noreferre...
[ { "answer_id": 126826, "author": "slim", "author_id": 7512, "author_profile": "https://Stackoverflow.com/users/7512", "pm_score": 5, "selected": true, "text": "cooperate = true;\n cooperate = false\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14877/" ]
126,738
<p>I have drawn an image in the device context using python and I want to move it smoothly/animate either vertically or horizontally.</p> <p>What algorithm should I use? Where can I get info for this kind of tasks in python?</p>
[ { "answer_id": 127216, "author": "freespace", "author_id": 8297, "author_profile": "https://Stackoverflow.com/users/8297", "pm_score": 0, "selected": false, "text": "(x1, y1) (x2,y2) t dx = (x2-x1)/t\ndy = (y2-y1)/t\n (dx,dy) (x,y) (x1,y1) (x,y)==(x2,y2)\n v(t) = u(t) + t*a(t)\nx(t) = v(...
2008/09/24
[ "https://Stackoverflow.com/questions/126738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20894/" ]
126,751
<p>During a long compilation with Visual Studio 2005 (version 8.0.50727.762), I sometimes get the following error in several files in some project: </p> <pre><code>fatal error C1033: cannot open program database 'v:\temp\apprtctest\win32\release\vc80.pdb' </code></pre> <p>(The file mentioned is either <code>vc80.pdb...
[ { "answer_id": 18296973, "author": "M.H.", "author_id": 2610299, "author_profile": "https://Stackoverflow.com/users/2610299", "pm_score": 4, "selected": false, "text": "Project Options -> C/C++ -> General -> Debug Information Format C7" }, { "answer_id": 19676823, "author": "...
2008/09/24
[ "https://Stackoverflow.com/questions/126751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7224/" ]
126,756
<p>Can anybody suggest programming examples that illustrate recursive functions? There are the usual old horses such as <strong><em>Fibonacci series</em></strong> and <strong><em>Towers of Hanoi</em></strong>, but anything besides them would be fun.</p>
[ { "answer_id": 126793, "author": "Yuval F", "author_id": 1702, "author_profile": "https://Stackoverflow.com/users/1702", "pm_score": 0, "selected": false, "text": "void rev(string s) {\n if (!s.empty()) {\n rev(s[1..s.length]);\n }\n print(s[0]);\n}\n" }, { "answer_id": 126...
2008/09/24
[ "https://Stackoverflow.com/questions/126756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021/" ]
126,759
<p>I've created an implementation of the <code>QAbstractListModel</code> class in Qt Jambi 4.4 and am finding that using the model with a <code>QListView</code> results in nothing being displayed, however using the model with a <code>QTableView</code> displays the data correctly.</p> <p>Below is my implementation of <...
[ { "answer_id": 126793, "author": "Yuval F", "author_id": 1702, "author_profile": "https://Stackoverflow.com/users/1702", "pm_score": 0, "selected": false, "text": "void rev(string s) {\n if (!s.empty()) {\n rev(s[1..s.length]);\n }\n print(s[0]);\n}\n" }, { "answer_id": 126...
2008/09/24
[ "https://Stackoverflow.com/questions/126759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13678/" ]
126,772
<h2>Background</h2> <p>I am writing and using a very simple CGI-based (Perl) content management tool for two pro-bono websites. It provides the website administrator with HTML forms for events where they fill the fields (date, place, title, description, links, etc.) and save it. On that form I allow the administrator ...
[ { "answer_id": 126782, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 6, "selected": false, "text": "<img src=\"foo.cgi?random=323527528432525.24234\" alt=\"\">\n Cache-Control: no-cache\n" }, { "answer_id": ...
2008/09/24
[ "https://Stackoverflow.com/questions/126772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7984/" ]
126,781
<p>I'm translating a library written in C++ to C#, and the keyword 'union' exists once. In a struct.</p> <p>What's the correct way of translating it into C#? And what does it do? It looks something like this;</p> <pre><code>struct Foo { float bar; union { int killroy; float fubar; } as; }...
[ { "answer_id": 126807, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 8, "selected": true, "text": "[StructLayout(LayoutKind.Explicit)] \npublic struct SampleUnion\n{\n [FieldOffset(0)] public float bar;\n [Fie...
2008/09/24
[ "https://Stackoverflow.com/questions/126781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15067/" ]
126,787
<p>Almost every Python web framework has a simple server that runs a wsgi application and automatically reloads the imported modules every time the source gets changed. I know I can look at the code and see how it's done, but that may take some time and I'm asking just out of curiosity. Does anyone have any idea how th...
[ { "answer_id": 126843, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 3, "selected": true, "text": "reload()" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7883/" ]
126,794
<p>I'm trying to write a query that will pull back the two most recent rows from the Bill table where the Estimated flag is true. The catch is that these need to be consecutive bills. </p> <p>To put it shortly, I need to enter a row in another table if a Bill has been estimated for the last two bill cycles.</p> <p>I'...
[ { "answer_id": 126828, "author": "Kibbee", "author_id": 1862, "author_profile": "https://Stackoverflow.com/users/1862", "pm_score": 2, "selected": false, "text": "select top 2 * \nfrom bills\nwhere estimated = 1 \norder by billdate desc\n" }, { "answer_id": 126848, "author": ...
2008/09/24
[ "https://Stackoverflow.com/questions/126794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11780/" ]
126,798
<p>Does anyone know how to solve this java error?</p> <pre><code>java.io.IOException: Invalid keystore format </code></pre> <p>I get it when I try and access the certificate store from the Java option in control panels. It's stopping me from loading applets that require elevated privileges.</p> <p><a href="http://im...
[ { "answer_id": 126981, "author": "Craig Day", "author_id": 5193, "author_profile": "https://Stackoverflow.com/users/5193", "pm_score": 3, "selected": true, "text": "C:\\Documents and Settings\\CDay\\Application Data\\Sun\\Java\\Deployment\\security" }, { "answer_id": 23430647, ...
2008/09/24
[ "https://Stackoverflow.com/questions/126798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/942/" ]
126,800
<p>In a destructor, is there a way to determine if an exception is currently being processed?</p>
[ { "answer_id": 126950, "author": "Eddie", "author_id": 21116, "author_profile": "https://Stackoverflow.com/users/21116", "pm_score": 0, "selected": false, "text": "struct my_exception1\n{\n explicit my_exception1( int res_code ) : m_res_code( res_code ) {}\n int m_res_co...
2008/09/24
[ "https://Stackoverflow.com/questions/126800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
126,801
<p>I'm confused about what the various testing appliances in Ruby on Rails are for. I have been using the framework for about 6 months but I've never understood the testing part of it. The only testing I've used is JUnit3 in Java and that only briefly.</p> <p>Everything I've read about it just shows testing validation...
[ { "answer_id": 130710, "author": "Ian Terrell", "author_id": 9269, "author_profile": "https://Stackoverflow.com/users/9269", "pm_score": 6, "selected": true, "text": "validates_numericality_of" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16204/" ]
126,804
<p>I have used "traditional" version control systems to maintain source code repositories on past projects. I am starting a new project with a distributed team and I can see advantages to using a distributed system. Given that I understand SourceSafe, CVS, and Subversion; what suggestions do you have for a Git newbie?<...
[ { "answer_id": 126937, "author": "Jonathan Tran", "author_id": 12887, "author_profile": "https://Stackoverflow.com/users/12887", "pm_score": 2, "selected": false, "text": "-a git commit -a git diff git diff git status" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3014/" ]
126,829
<p>Here's a question to expose my lack of experience: I have a method <strong>DoSomething()</strong> which throws an exception if it doesn't manage to do it cleanly. If it fails, I try the less accurate method <strong>DoSomethingApproximately()</strong> several times in the hope that it will find a sufficiently good so...
[ { "answer_id": 126859, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 2, "selected": false, "text": " bool result = DoSomething();\n while (!result && tries < MAX_TRIES) {\n result = DoSomethingApproximately...
2008/09/24
[ "https://Stackoverflow.com/questions/126829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6091/" ]
126,853
<p>I saw <a href="http://www.gnegg.ch/2008/09/automatic-language-detection/" rel="nofollow noreferrer">this</a> on reddit, and it reminded me of one of my vim gripes: It shows the UI in German. I want English. But since my OS is set up in German (the standard at our office), I guess vim is actually trying to be helpful...
[ { "answer_id": 126858, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 2, "selected": false, "text": "LC_ALL=en_GB.utf-8 vim\n" }, { "answer_id": 127539, "author": "Aristotle Pagaltzis", "author_id": 9...
2008/09/24
[ "https://Stackoverflow.com/questions/126853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2260/" ]
126,855
<p>I have two tables, Users and DoctorVisit</p> <p>User - UserID - Name</p> <p>DoctorsVisit - UserID - Weight - Date </p> <p>The doctorVisit table contains all the visits a particular user did to the doctor. The user's weight is recorded per visit.</p> <p>Query: Sum up all the Users weight, using the last doctor's...
[ { "answer_id": 126892, "author": "JPrescottSanders", "author_id": 19444, "author_profile": "https://Stackoverflow.com/users/19444", "pm_score": 0, "selected": false, "text": "select user.name, temp.AvgWeight\nfrom user left outer join (select userid, avg(weight)\n from doctors...
2008/09/24
[ "https://Stackoverflow.com/questions/126855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
126,863
<p>In some instances, I prefer working with custom objects instead of strongly typed datasets and data rows. However, it seems like Microsoft Reporting (included with VS2005) requires strongly typed datasets.</p> <p>Is there a way to use my custom objects to design and populate reports?</p>
[ { "answer_id": 11303040, "author": "CRice", "author_id": 55693, "author_profile": "https://Stackoverflow.com/users/55693", "pm_score": 2, "selected": false, "text": "Aies.Core.Model.Invoice.MemberInvoice reportViewer.LocalReport.DataSources.Add(new ReportDataSource(\"MemberInvoice\", new...
2008/09/24
[ "https://Stackoverflow.com/questions/126863", "https://Stackoverflow.com", "https://Stackoverflow.com/users/681/" ]
126,868
<p>I'm developing a C# assembly which is to be called via COM from a Delphi 7 (iow, native win32, not .net) application.</p> <p>So far, it seems to work. I've exported a TLB file, imported that into my Delphi project, and I can create my C# object and call its functions.</p> <p>So that's great, but soon I'm going to ...
[ { "answer_id": 126886, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "#if DEBUG\n if (!System.Diagnostics.Debugger.IsAttached)\n Debugger.Launch();\n#endif\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126868", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
126,870
<p>I am designing a class that stores (caches) a set of data. I want to lookup a value, if the class contains the value then use it and modify a property of the class. I am concerned about the design of the public interface.<br> Here is how the class is going to be used:</p> <pre> ClassItem *pClassItem = myClass.Loo...
[ { "answer_id": 126944, "author": "Mark Brackett", "author_id": 2199, "author_profile": "https://Stackoverflow.com/users/2199", "pm_score": 1, "selected": false, "text": "if (!myClass.AddIfNotExists(value, something)) {\n // use myClass\n}\n if (myClass.TryModify(value, something)) {\n ...
2008/09/24
[ "https://Stackoverflow.com/questions/126870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12663/" ]
126,876
<p>During a complicated update I might prefer to display all the changes at once. I know there is a method that allows me to do this, but what is it?</p>
[ { "answer_id": 126904, "author": "Romain Verdier", "author_id": 4687, "author_profile": "https://Stackoverflow.com/users/4687", "pm_score": 2, "selected": false, "text": "BeginUpdate EndUpdate" }, { "answer_id": 126914, "author": "moobaa", "author_id": 3569, "author_p...
2008/09/24
[ "https://Stackoverflow.com/questions/126876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4694/" ]
126,885
<p>We have a SQL Server table containing Company Name, Address, and Contact name (among others).</p> <p>We regularly receive data files from outside sources that require us to match up against this table. Unfortunately, the data is slightly different since it is coming from a completely different system. For example...
[ { "answer_id": 126903, "author": "torial", "author_id": 13990, "author_profile": "https://Stackoverflow.com/users/13990", "pm_score": 3, "selected": true, "text": " Public Shared Function FindMostSimilarString(ByVal toFind As String, ByVal ParamArray stringList() As String) As String\...
2008/09/24
[ "https://Stackoverflow.com/questions/126885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2173/" ]
126,894
<p>I use the right button>Refactor>Encapsultate field to have my accessor every time. The problem is when I create new class, I can have more than 10 attributes and it's long to do 1 by 1 every accessor. Is there a faster way to create them?</p> <p>Thank you for your time.</p>
[ { "answer_id": 142910, "author": "Jay Bazuzi", "author_id": 5314, "author_profile": "https://Stackoverflow.com/users/5314", "pm_score": 1, "selected": false, "text": "public string Name { get; private set; }\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13913/" ]
126,896
<p>we are using git-svn to manage branches of an SVN repo. We are facing the following problem: after a number of commits by user X in the branch, user Y would like to use git-svn to merge the changes in branch to trunk. The problem we're seeing is that the commit messages for all the individual merge operations look a...
[ { "answer_id": 127242, "author": "richq", "author_id": 4596, "author_profile": "https://Stackoverflow.com/users/4596", "pm_score": 5, "selected": true, "text": "------------------------------------------------------------------------\nr5 | Y | 2008-09-24 15:17:12 +0200 (Wed, 24 Sep 2008)...
2008/09/24
[ "https://Stackoverflow.com/questions/126896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
126,897
<p>The question is pretty self-explanatory. I'm looking for a PostgreSQL equivalent to the <a href="http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions" rel="nofollow noreferrer">SQLite datetime function</a>.</p>
[ { "answer_id": 126920, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 3, "selected": false, "text": "postgres=# select to_char(now(),'YYYY-mm-dd HH:MM:ss');\n to_char\n---------------------\n 2008-09-24 02:09:20...
2008/09/24
[ "https://Stackoverflow.com/questions/126897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6583/" ]
126,898
<p>I ran into a problem a few days ago when I had to introduce C++ files into a Java project. It started with a need to measure the CPU usage of the Java process and it was decided that the way to go was to use JNI to call out to a native library (a shared library on a Unix machine) written in C. The problem was to fin...
[ { "answer_id": 127018, "author": "m_pGladiator", "author_id": 446104, "author_profile": "https://Stackoverflow.com/users/446104", "pm_score": 0, "selected": false, "text": "Product/Workspace(1)/JavaProject1/src \nProduct/Workspace(1)/JavaProject2/src \nProduct/Workspace(1 or 2)/CPPprojec...
2008/09/24
[ "https://Stackoverflow.com/questions/126898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21647/" ]
126,917
<p>In ASPNET, I grew to love the Application and Cache stores. They're awesome. For the uninitiated, you can just throw your data-logic objects into them, and hey-presto, you only need query the database once for a bit of data. </p> <p>By far one of the best ASPNET features, IMO.</p> <p>I've since ditched Windows for...
[ { "answer_id": 127098, "author": "Michael Johnson", "author_id": 17688, "author_profile": "https://Stackoverflow.com/users/17688", "pm_score": 2, "selected": false, "text": "project/\n app/\n html/\n index.php\n data/\n cache/\n app cache data project/html index.php app" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12870/" ]
126,925
<p>I have an Internet Explorer Browser Helper Object (BHO), written in c#, and in various places I open forms as modal dialogs. Sometimes this works but in some cases it doesn't. The case that I can replicate at present is where IE is running javascript to open other child windows... I guess it's getting a bit confused...
[ { "answer_id": 126959, "author": "Rory", "author_id": 8479, "author_profile": "https://Stackoverflow.com/users/8479", "pm_score": 2, "selected": true, "text": "IWebBrowser2 browser = siteObject as IWebBrowser2;\nif (browser != null) hwnd = new IntPtr(browser.HWND);\n(new MyForm(someParam...
2008/09/24
[ "https://Stackoverflow.com/questions/126925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8479/" ]
126,926
<p>It seems like if you compile a Visual Studio solution and have a version # in your AssemblyInfo.cs file, that should propagate to say, the Windows Explorer properties dialog. This way, someone could simply right click on the *.exe and click 'properties' to see the version #. Is there a special setting in Visual Stud...
[ { "answer_id": 126948, "author": "Nigel Hawkins", "author_id": 1389021, "author_profile": "https://Stackoverflow.com/users/1389021", "pm_score": 1, "selected": false, "text": "[assembly: AssemblyFileVersion(\"1.0.114.0\")]" }, { "answer_id": 126961, "author": "Wolfwyrd", ...
2008/09/24
[ "https://Stackoverflow.com/questions/126926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273/" ]
126,966
<p>What I'm looking for is a simple timer queue possibly with an external timing source and a poll method (in this way it will be multi-platform). Each enqueued message could be an object implementing a simple interface with a <code>virtual onTimer()</code> member function.</p>
[ { "answer_id": 127074, "author": "TonJ", "author_id": 11537, "author_profile": "https://Stackoverflow.com/users/11537", "pm_score": 2, "selected": false, "text": "#ifdef -- #endif" }, { "answer_id": 127182, "author": "Len Holgate", "author_id": 7925, "author_profile":...
2008/09/24
[ "https://Stackoverflow.com/questions/126966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15785/" ]
126,976
<p>I am looking for a good primer or technical description of the <strong>System Call</strong> mechanism that is used by operating systems to transition from user space to the kernel to invoke functions such as "open", "read", "write", etc...</p> <p>Is there anything other than the <a href="http://en.wikipedia.org/wik...
[ { "answer_id": 127187, "author": "Mike Dimmick", "author_id": 6970, "author_profile": "https://Stackoverflow.com/users/6970", "pm_score": 2, "selected": false, "text": "SYSCALL SYSENTER" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/126976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10703/" ]
126,980
<p>I would like to support keyboard shortcuts in my WPF XBAP application, such as <kbd>Ctrl</kbd>+<kbd>O</kbd> for 'Open' etc. How do I disable the browsers built-in keyboard shortcuts and replace them with my own?</p>
[ { "answer_id": 1058624, "author": "John Donoghue", "author_id": 130473, "author_profile": "https://Stackoverflow.com/users/130473", "pm_score": 1, "selected": false, "text": "Private Shared m_handle As IntPtr\nPrivate Shared m_hook As Interop.HwndSourceHook\nPrivate Shared m_hookCreated ...
2008/09/24
[ "https://Stackoverflow.com/questions/126980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
126,999
<p>When writing j2me applications for cellphones, using <code>System.out.println()</code> prints on the console if using an emulator. However, when the code is deployed on a cellphone, where does the console output go?</p> <p>If it is impossible to see this in the untethered cellphone, is there a way to see it if the ...
[ { "answer_id": 127078, "author": "Animesh", "author_id": 20386, "author_profile": "https://Stackoverflow.com/users/20386", "pm_score": 2, "selected": false, "text": "System.out.println()" }, { "answer_id": 807496, "author": "kozen", "author_id": 98649, "author_profile...
2008/09/24
[ "https://Stackoverflow.com/questions/126999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20386/" ]