qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
195,262
<p>I'm playing around with the <a href="http://developer.mozilla.org/en/HTML/Canvas" rel="noreferrer"><code>&lt;canvas&gt;</code></a> element, drawing lines and such.</p> <p>I've noticed that my diagonal lines are antialiased. I'd prefer the jaggy look for what I'm doing - is there any way of turning this feature off?...
[ { "answer_id": 195575, "author": "Kornel", "author_id": 27009, "author_profile": "https://Stackoverflow.com/users/27009", "pm_score": 7, "selected": true, "text": "context.imageSmoothingEnabled = false getImageData putImageData" }, { "answer_id": 3279863, "author": "allan", ...
2008/10/12
[ "https://Stackoverflow.com/questions/195262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
195,267
<p>I'm trying to use the Windows API to set the primary monitor. It doesn't seem to work - my screen just flicks and nothing happens.</p> <pre><code> public const int DM_ORIENTATION = 0x00000001; public const int DM_PAPERSIZE = 0x00000002; public const int DM_PAPERLENGTH = 0x00000004; public const int DM_PAPERWIDTH...
[ { "answer_id": 195319, "author": "tobsen", "author_id": 27083, "author_profile": "https://Stackoverflow.com/users/27083", "pm_score": 2, "selected": false, "text": "rundll32.exe NvCpl.dll,dtcfg primary 2" }, { "answer_id": 23044185, "author": "ADBailey", "author_id": 3410...
2008/10/12
[ "https://Stackoverflow.com/questions/195267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2972/" ]
195,270
<p>Are there any <strong>professional</strong> Combobox controls (dropdown list with autosuggestion) based on the jQuery library?</p> <p>It should be able to handle <strong>large datasets</strong> and have some <strong>skinning</strong> options. A <strong>multi-column result list</strong> would be great too. I'm worki...
[ { "answer_id": 5609429, "author": "Danny W. Adair", "author_id": 640759, "author_profile": "https://Stackoverflow.com/users/640759", "pm_score": 5, "selected": false, "text": "<select id=\"combo4\" style=\"width: 200px;\"\n onchange=\"$('input#text4').val($(this).val());\">\n ...
2008/10/12
[ "https://Stackoverflow.com/questions/195270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6461/" ]
195,287
<p>I'd like to get all the permutations of swapped characters pairs of a string. For example:</p> <p>Base string: <code>abcd</code></p> <p>Combinations:</p> <ol> <li><code>bacd</code></li> <li><code>acbd</code></li> <li><code>abdc</code></li> </ol> <p>etc.</p> <h3>Edit</h3> <p>I want to swap only letters that are next ...
[ { "answer_id": 195295, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 3, "selected": true, "text": "$input = \"abcd\";\n$len = strlen($input);\n$output = array();\n\nfor ($i = 0; $i < $len - 1; ++$i) {\n $output[] = substr($...
2008/10/12
[ "https://Stackoverflow.com/questions/195287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27186/" ]
195,288
<p>I'm working on an ASP.NET website where I am using an asp:repeater with paging done through a VB.NET code-behind file. I'm having trouble with the database connection though. As far as I can tell, the paging is working, but I can't get the data to be certain.</p> <p>The database is a Microsoft Access database. The ...
[ { "answer_id": 201365, "author": "Matt", "author_id": 17020, "author_profile": "https://Stackoverflow.com/users/17020", "pm_score": 1, "selected": true, "text": "Protected Sub Page_Load1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\n doPaging()\nEnd Sub\n" } ...
2008/10/12
[ "https://Stackoverflow.com/questions/195288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17020/" ]
195,317
<p>I am tryiing to create an "add to cart" button for each item that is displayed by an XSLT file. The button must be run at server (VB) and I need to pass parameters into the onlick, so that the requested item is added to the cart. Is this possible, and if so, how should I go about it?</p> <p>When I try</p> <pre><co...
[ { "answer_id": 195384, "author": "samjudson", "author_id": 1908, "author_profile": "https://Stackoverflow.com/users/1908", "pm_score": 2, "selected": false, "text": "<asp:Button id=\"Button123\"\n Text=\"Add to Cart\"\n CommandName=\"AddToCart\"\n CommandArgument=\"123\...
2008/10/12
[ "https://Stackoverflow.com/questions/195317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
195,321
<p><a href="https://stackoverflow.com/users/9931/ryan-delucchi">Ryan Delucchi</a> asked <a href="https://stackoverflow.com/questions/194698/how-to-load-a-jar-file-at-runtime#194712">here</a> in comment #3 to <a href="https://stackoverflow.com/users/4725/tom-hawtin-tackline">Tom Hawtin</a>'s answer:</p> <blockquote> ...
[ { "answer_id": 195328, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 7, "selected": true, "text": "Constructor.newInstance InvocationTargetException" }, { "answer_id": 53014482, "author": "Eugene", "author_id...
2008/10/12
[ "https://Stackoverflow.com/questions/195321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11813/" ]
195,323
<p>I'd like to read whole content of a text file to a <code>std::string</code> object with c++. </p> <p>With Python, I can write:</p> <pre><code>text = open("text.txt", "rt").read() </code></pre> <p>It is very simple and elegant. I hate ugly stuff, so I'd like to know - what is the most elegant way to read a text fi...
[ { "answer_id": 195350, "author": "Milan Babuškov", "author_id": 14690, "author_profile": "https://Stackoverflow.com/users/14690", "pm_score": 8, "selected": true, "text": "ifstream file (\"file.txt\", ios::in|ios::binary|ios::ate);\nif (file.is_open())\n{\n file.seekg(0, ios::end);\n ...
2008/10/12
[ "https://Stackoverflow.com/questions/195323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25077/" ]
195,332
<p>What are the possibilities of a programmer to handle data that are rarely used but cannot be simply deleted because at least reporting still requires it?</p> <p>Some examples I am thinking of:</p> <ul> <li>Discountinued funding types of older years of a university</li> <li>Unused currencies (e.g. Italian lira)</li...
[ { "answer_id": 195431, "author": "Andrew not the Saint", "author_id": 23670, "author_profile": "https://Stackoverflow.com/users/23670", "pm_score": 2, "selected": false, "text": "CREATE TABLE Currency (CurrencyID NUMBER, CurrencyStartDate DATETIME, CurrentEndDate DATETIME)\n" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21047/" ]
195,363
<p>In IE when I insert text into a <code>&lt;pre&gt;</code> tag the newlines are ignored:</p> <pre><code>&lt;pre id="putItHere"&gt;&lt;/pre&gt; &lt;script&gt; function putText() { document.getElementById("putItHere").innerHTML = "first line\nsecond line"; } &lt;/script&gt; </code></pre> <p>Using <code>\r\n</code>...
[ { "answer_id": 195370, "author": "GavinCattell", "author_id": 21644, "author_profile": "https://Stackoverflow.com/users/21644", "pm_score": 2, "selected": false, "text": "<br/> document.getElementById(\"putItHere\").innerHTML = \"first line<br/>second line\";\n" }, { "answer_id":...
2008/10/12
[ "https://Stackoverflow.com/questions/195363", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27198/" ]
195,368
<p>How is it possible for this to be true</p> <pre><code>XmlDocument d = BuildReportXML(schema); DataSet ds = new DataSet(); ds.ReadXmlSchema(schema); ds.ReadXml(new XmlNodeReader(d)); </code></pre> <p>Schema is the schema location that I apply to the XmlDocument before I start setting data, assuring that all the col...
[ { "answer_id": 195370, "author": "GavinCattell", "author_id": 21644, "author_profile": "https://Stackoverflow.com/users/21644", "pm_score": 2, "selected": false, "text": "<br/> document.getElementById(\"putItHere\").innerHTML = \"first line<br/>second line\";\n" }, { "answer_id":...
2008/10/12
[ "https://Stackoverflow.com/questions/195368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11137/" ]
195,408
<p>I'm looking for a technique (javascript, CSS, whatever ???) that will let me control the amount of a string that is displayed. The string is the result of a search (and therefore not initially known). A simple Character count approach is trivial, but not acceptable, as it needs to handle proportional fonts. In other...
[ { "answer_id": 195413, "author": "moritz", "author_id": 14132, "author_profile": "https://Stackoverflow.com/users/14132", "pm_score": 3, "selected": true, "text": "overflow: hidden; width" }, { "answer_id": 195435, "author": "roryf", "author_id": 270, "author_profile"...
2008/10/12
[ "https://Stackoverflow.com/questions/195408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27200/" ]
195,410
<p>I am interested in what methods of logging is frequent in an Oracle database. Our method is the following:</p> <p>We create a log table for the table to be logged. The log table contains all the columns of the original table plus some special fields including timestamp, modification type (insert, update, delete), m...
[ { "answer_id": 196454, "author": "Salamander2007", "author_id": 10629, "author_profile": "https://Stackoverflow.com/users/10629", "pm_score": 2, "selected": false, "text": "+----------------------------------------------------------------------------+\n| Column Name | Function ...
2008/10/12
[ "https://Stackoverflow.com/questions/195410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21047/" ]
195,420
<p>I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can hit its timeout and then VoteCommit (as opposed to VoteRollback). Is this accurate or hearsay? I couldn't track down information on the web that talked about this issue (if it IS an issue), so I wonder if anyone has any direct exper...
[ { "answer_id": 195427, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 6, "selected": true, "text": "Transaction Binding=Explicit Unbind; TransactionScope" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20971/" ]
195,434
<p>I know its possible to get the top terms within a Lucene Index, but is there a way to get the top terms based on a subset of a Lucene index?</p> <p>I.e. What are the top terms in the Index for documents within a certain date range?</p>
[ { "answer_id": 224131, "author": "zaphod", "author_id": 13871, "author_profile": "https://Stackoverflow.com/users/13871", "pm_score": 3, "selected": false, "text": "Query Filter IndexSearcher.search(Query, Filter, HitCollector) HitCollector IndexReader.getTermFreqVector TermVectorMapper ...
2008/10/12
[ "https://Stackoverflow.com/questions/195434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1982/" ]
195,437
<p>Would it be possible to execute a JSP page and capture its output outside of a web application? Mode specifically, in my case there still exists a usual web application, but it loads JSP pages not from its classpath, but from an arbitrary source. It seems like I cannot simply get RequestDispatcher and point it to ...
[ { "answer_id": 195503, "author": "Olaf Kock", "author_id": 13447, "author_profile": "https://Stackoverflow.com/users/13447", "pm_score": 2, "selected": false, "text": "<jsp-config>\n <jsp-property-group>\n <url-pattern>*.jsp</url-pattern>\n <scripting-invalid>true</scrip...
2008/10/12
[ "https://Stackoverflow.com/questions/195437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6954/" ]
195,439
<p>Using web forms I know that you can only have one ASP.NET form on a page. I've done some implementations where I've used Javascript to add other forms to a page to support things like logon controls (that post back to Logon.aspx instead of the current page). I'm wondering if the single form per page is still prese...
[ { "answer_id": 195479, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 1, "selected": false, "text": "runat=\"server\" runat='server' LiteralControl HtmlForm <%= code blocks %> <%= Html.Button() %>" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12950/" ]
195,450
<p>I'm considering building a framework for VB.NET, and using the My namespace to plug it into VB seems like a reasonable idea. What is &quot;My&quot; used for?</p>
[ { "answer_id": 195467, "author": "Sören Kuklau", "author_id": 1600, "author_profile": "https://Stackoverflow.com/users/1600", "pm_score": 2, "selected": false, "text": "My Environment.SpecialFolder Temp My.Computer.FileSystem.SpecialDirectories Path.GetTempPath() My My My" }, { "...
2008/10/12
[ "https://Stackoverflow.com/questions/195450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18426/" ]
195,451
<p>I use <code>public boolean mouseDown(Event ev, int x, int y)</code> to detect a click of the mouse.<br> I can distinguish between the right mouse button (ev.metaDown() is true) and the left and middle.</p> <p>How can i differentiate the left from the middle button? Or if it is impossible with mouseDown, what should...
[ { "answer_id": 270373, "author": "Michael Myers", "author_id": 13531, "author_profile": "https://Stackoverflow.com/users/13531", "pm_score": 2, "selected": true, "text": "if (ev.modifiers & Event.ALT_MASK != 0) {\n // middle button was pressed\n}\n" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12860/" ]
195,454
<p>How can I <strong>protect a ClickOnce deployed application with a password</strong>? Do I have to change the IIS settings of the web or is there a way to do it programmatically? I'm using Visual Studio 2005 (.NET 2.0).</p> <p>If I have to use web credentials, are auto-updates of the application still possible?</p> ...
[ { "answer_id": 215100, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 5, "selected": true, "text": "http://servername.adatum.com/WindowsApp1.application?username=joeuser\n" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6461/" ]
195,455
<p>I am writing a compiler in F# and I want to be able to access the <a href="http://msdn.microsoft.com/en-us/library/ms404384.aspx" rel="nofollow noreferrer">unmanaged metadata COM interfaces</a> in the .net runtime. Before anybody mentions it, <em>Reflection.Emit is not suitable for my purposes</em>, nor do I want to...
[ { "answer_id": 215100, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 5, "selected": true, "text": "http://servername.adatum.com/WindowsApp1.application?username=joeuser\n" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3394/" ]
195,468
<p>Basically, I have a class with 2 methods: one to serialize an object into an XML file and another to read an object from XML. Here is an example of synchronized part from the method that restores an object:</p> <pre><code> public T restore(String from) throws Exception { // variables declaration syn...
[ { "answer_id": 195796, "author": "Ran Biron", "author_id": 931, "author_profile": "https://Stackoverflow.com/users/931", "pm_score": 4, "selected": true, "text": "StringBuffer sb = new StringBuffer(); sb.append(\"a\").append(\"b\");\nString a = new String(sb.toString());\nString b = new ...
2008/10/12
[ "https://Stackoverflow.com/questions/195468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15187/" ]
195,483
<p>Is there an easy way of programmatically checking if a serial COM port is already open/being used?</p> <p>Normally I would use:</p> <pre><code>try { // open port } catch (Exception ex) { // handle the exception } </code></pre> <p>However, I would like to programatically check so I can attempt to use anoth...
[ { "answer_id": 195493, "author": "Fionn", "author_id": 21566, "author_profile": "https://Stackoverflow.com/users/21566", "pm_score": 5, "selected": true, "text": "var portNames = SerialPort.GetPortNames();\n\nforeach(var port in portNames) {\n //Try for every portName and break on the...
2008/10/12
[ "https://Stackoverflow.com/questions/195483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1816/" ]
195,497
<p>I'm playing around with the locale and I18N stuff in c++ and have been looking for real world examples. I've read through the Josuttis chapter on I18N in his <a href="http://www.josuttis.com/libbook/" rel="noreferrer">book</a> (2nd Edition for C++11 to be released April 2012), and found it useful but with no real wo...
[ { "answer_id": 72341513, "author": "BullyWiiPlaza", "author_id": 3764804, "author_profile": "https://Stackoverflow.com/users/3764804", "pm_score": 0, "selected": false, "text": "Internationalization.hpp #pragma once\n\n#include <map>\n#include <string>\n\nenum class supported_language_t\...
2008/10/12
[ "https://Stackoverflow.com/questions/195497", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14788/" ]
195,520
<p>Can you post a short example of real, overdone spaghetti code, possibly saying what it does? Can you show me a little debugger's nightmare?</p> <p>I don't mean <a href="http://www0.us.ioccc.org/main.html" rel="noreferrer">IOCCC</a> code, that is science fiction. I mean real life examples that happened to you...</p>...
[ { "answer_id": 195531, "author": "Nils Pipenbrinck", "author_id": 15955, "author_profile": "https://Stackoverflow.com/users/15955", "pm_score": 3, "selected": false, "text": ".286\n.model tiny\n\ng4 equ 55-48 ; removed note-decoding !\na4 equ 57-48 ; now: storing midi...
2008/10/12
[ "https://Stackoverflow.com/questions/195520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18770/" ]
195,530
<p>I accidentally coded <code>SELECT $FOO..</code> and got the error "Invalid pseudocolumn "$FOO".</p> <p>I can't find any documentation for them. Is it something I should know?</p> <p>Edit: this is a MS SQL Server specific question.</p>
[ { "answer_id": 195565, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 0, "selected": false, "text": "SELECT * FROM SomeTable SELECT ROWID, * FROM SomeTable *" }, { "answer_id": 4736433, "author": "Marti...
2008/10/12
[ "https://Stackoverflow.com/questions/195530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9328/" ]
195,537
<p>I am working on an implementation for RSS feeds for a collaboration platform. Say there are several thousands of different collaboration rooms where users can share information, and each needs to publish an RSS feed with news, changes, etc...</p> <p>Using a plain servlet (i.e. <a href="http://www.site.com/RSSServle...
[ { "answer_id": 202044, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 4, "selected": true, "text": "doGet() doPost() doGet doPost doGet doPost public void doGet(HttpServletRequest request, HttpServletResponse response) {\n ...
2008/10/12
[ "https://Stackoverflow.com/questions/195537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24545/" ]
195,548
<p>Due to company constraints out of my control, I have the following scenario:</p> <p>A COM library that defines the following interface (no CoClass, just the interface):</p> <pre><code>[ object, uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx), dual, nonextensible, helpstring("IService Interface"), ...
[ { "answer_id": 195885, "author": "ilitirit", "author_id": 9825, "author_profile": "https://Stackoverflow.com/users/9825", "pm_score": 4, "selected": true, "text": "Warning 65 warning C4192: automatically excluding 'IServiceProvider' while importing type library 'ServiceLibrary.dll'\n im...
2008/10/12
[ "https://Stackoverflow.com/questions/195548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25565/" ]
195,549
<p>Here's a problem I keep running into:</p> <p>I have a lot of situations where I need to display some text with a styled container like so:</p> <pre><code>&lt;mx:Canvas&gt; &lt;mx:Text text="{text}" left="5" verticalCenter="0" right="5" /&gt; &lt;/mx:Canvas&gt; </code></pre> <p>As you can see - the text i...
[ { "answer_id": 195570, "author": "James Fassett", "author_id": 27081, "author_profile": "https://Stackoverflow.com/users/27081", "pm_score": 3, "selected": true, "text": "<mx:HBox \n width=\"500\"\n paddingLeft=\"5\"\n paddingRight=\"5\">\n <mx:Spacer width=\"100%\" />\n <...
2008/10/12
[ "https://Stackoverflow.com/questions/195549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3435/" ]
195,578
<p>I got a problem like this (this is html/css menu):</p> <p>Eshop | Another eshop | Another eshop</p> <p>Client wants it work like this:</p> <p>User comes to website, clicks on Eshop. Eshop changes to red color with red box outline. User decides to visit Another eshop, so Eshop will go back to normaln color without...
[ { "answer_id": 195601, "author": "Georg Schölly", "author_id": 24587, "author_profile": "https://Stackoverflow.com/users/24587", "pm_score": 3, "selected": true, "text": ".red {\n outline-color:red;\n outline-width:10px;\n}\n $('.red').removeClass('red'); // removes class red from ...
2008/10/12
[ "https://Stackoverflow.com/questions/195578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21209/" ]
195,582
<p>I am taking my first steps programming in Lua and get this error when I run my script:</p> <pre><code>attempt to index upvalue 'base' (a function value) </code></pre> <p>It's probably due to something very basic that I haven't grasped yet, but I can't find any good information about it when googling. Could someone...
[ { "answer_id": 195599, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 5, "selected": true, "text": "base base[5] base.somefield base" }, { "answer_id": 42890331, "author": "GoojajiGreg", "author_id": 3455883, ...
2008/10/12
[ "https://Stackoverflow.com/questions/195582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22283/" ]
195,587
<p>Got a class that serializes into xml with XMLEncoder nicely with all the variables there. Except for the one that holds <em>java.util.Locale</em>. What could be the trick?</p>
[ { "answer_id": 195693, "author": "McDowell", "author_id": 304, "author_profile": "https://Stackoverflow.com/users/304", "pm_score": 4, "selected": true, "text": "public class MyBean implements Serializable {\n\n private static final long serialVersionUID = 1L;\n\n private Locale lo...
2008/10/12
[ "https://Stackoverflow.com/questions/195587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15187/" ]
195,590
<p>Does anybody know how to determine the location of a file that's in one of the folders specified by the PATH environmental variable other than doing a dir filename.exe /s from the root folder?</p> <p>I know this is stretching the bounds of a programming question but this is useful for deployment-related issues, als...
[ { "answer_id": 195594, "author": "MvdD", "author_id": 18044, "author_profile": "https://Stackoverflow.com/users/18044", "pm_score": 7, "selected": true, "text": "where.exe C:\\Windows\\System32" }, { "answer_id": 195612, "author": "Kris", "author_id": 18565, "author_p...
2008/10/12
[ "https://Stackoverflow.com/questions/195590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3394/" ]
195,593
<p>MessageBox.Show has forms like MessageBox.Show( ownerWindow, .... ).</p> <p>What do I gain by assigning a owner window?</p>
[ { "answer_id": 195614, "author": "jyoung", "author_id": 14841, "author_profile": "https://Stackoverflow.com/users/14841", "pm_score": 0, "selected": false, "text": "else if (owner == IntPtr.Zero)\n owner = UnsafeNativeMethods.GetActiveWindow();\n" }, { "answer_id": 25250001, ...
2008/10/12
[ "https://Stackoverflow.com/questions/195593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14841/" ]
195,625
<p>I wonder what is the time complexity of pop method of list objects in Python (in CPython particulary). Also does the value of N for list.pop(N) affects the complexity? </p>
[ { "answer_id": 195647, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 6, "selected": true, "text": "Pop() pop()" }, { "answer_id": 51576152, "author": "Pythoner", "author_id": 5117474, "author_profile...
2008/10/12
[ "https://Stackoverflow.com/questions/195625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21000/" ]
195,626
<p>I have a python module that makes use of a huge dictionary global variable, currently I put the computation code in the top section, every first time import or reload of the module takes more then one minute which is totally unacceptable. How can I save the computation result somewhere so that the next import/reload...
[ { "answer_id": 195739, "author": "jfs", "author_id": 4279, "author_profile": "https://Stackoverflow.com/users/4279", "pm_score": 2, "selected": false, "text": "class Proxy:\n @property\n def global_name(self):\n # calculate your global var here, enable cache if needed\n ...
2008/10/12
[ "https://Stackoverflow.com/questions/195626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1925263/" ]
195,632
<p>So, I can create an input button with an image using</p> <pre><code>&lt;INPUT type=&quot;image&quot; src=&quot;/images/Btn.PNG&quot; value=&quot;&quot;&gt; </code></pre> <p>But, I can't get the same behavior using CSS. For instance, I've tried</p> <pre><code>&lt;INPUT type=&quot;image&quot; class=&quot;myButton&quot...
[ { "answer_id": 195638, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 5, "selected": false, "text": "#replacement-1 {\n width: 100px;\n height: 55px;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent ur...
2008/10/12
[ "https://Stackoverflow.com/questions/195632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1179/" ]
195,635
<p>I am trying to figure out Messagebox( ownerWindow, ... ).</p> <p>Using reflector I see that the ownerWindow defaults to the ActiveWindow for the thread.</p> <p>So the only time I need the ownerWindow parameter is to call Show from another thread. </p> <p>However when I try this, I get a cross threading exception...
[ { "answer_id": 195640, "author": "Patrik Svensson", "author_id": 936, "author_profile": "https://Stackoverflow.com/users/936", "pm_score": 2, "selected": false, "text": "private delegate void ThreadExecuteDelegate(object args);\n\npublic void StartThread\n{\n Thread thread = new Thread...
2008/10/12
[ "https://Stackoverflow.com/questions/195635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14841/" ]
195,639
<p>I need a way to bind POJO objects to an external entity, that could be XML, YAML, structured text or anything easy to write and maintain in order to create Mock data for unit testing and TDD. Below are some libraries I tried, but the main problems with them were that I am stuck (for at least more 3 months) to Java 1...
[ { "answer_id": 196243, "author": "OscarRyz", "author_id": 20654, "author_profile": "https://Stackoverflow.com/users/20654", "pm_score": 0, "selected": false, "text": "import java.beans.XMLEncoder;\nimport java.beans.XMLDecoder;\nimport java.io.BufferedInputStream;\nimport java.io.Buffere...
2008/10/12
[ "https://Stackoverflow.com/questions/195639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14540/" ]
195,641
<p>During the installation of Apache2 I got the following message into cmd window:</p> <blockquote> <p>Installing the Apache2.2 service The Apache2.2 service is successfully installed. Testing httpd.conf....</p> <p>Errors reported here must be corrected before the service can be started. httpd.exe: Coul...
[ { "answer_id": 195654, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 8, "selected": true, "text": "Conexiones activas\n\n Proto Dirección local Dirección remota Estado PID\n TCP 127.0....
2008/10/12
[ "https://Stackoverflow.com/questions/195641", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16039/" ]
195,648
<p>What's an example of something dangerous that would not be caught by the code below?</p> <p>EDIT: After some of the comments I added another line, commented below. See Vinko's comment in David Grant's answer. So far only Vinko has answered the question, which asks for specific examples that would slip through th...
[ { "answer_id": 195662, "author": "David Grant", "author_id": 26829, "author_profile": "https://Stackoverflow.com/users/26829", "pm_score": 2, "selected": false, "text": "<a href=\"javascript:document.writeln('on' + 'unload' + ' and more malicious stuff here...');\">example</a>\n" }, ...
2008/10/12
[ "https://Stackoverflow.com/questions/195648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9328/" ]
195,655
<p>Is it possible to copy a single file to multiple directories using the cp command ?</p> <p>I tried the following , which did not work: </p> <pre><code>cp file1 /foo/ /bar/ cp file1 {/foo/,/bar} </code></pre> <p>I know it's possible using a for loop, or find. But is it possible using the gnu cp command?</p>
[ { "answer_id": 195663, "author": "moonshadow", "author_id": 11834, "author_profile": "https://Stackoverflow.com/users/11834", "pm_score": 8, "selected": true, "text": "cp cp" }, { "answer_id": 195972, "author": "Robert Gamble", "author_id": 25222, "author_profile": "h...
2008/10/12
[ "https://Stackoverflow.com/questions/195655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13523/" ]
195,667
<p>I have an iframe and couple of tables on my aspx page. Now when the page loads these tables are hidden. The iframe is used to upload file to database. Depending on the result of the event I have to show a particular table on my main page (these tables basically have "Retry","next" buttons...depending on whether or n...
[ { "answer_id": 195675, "author": "Dimitry", "author_id": 27073, "author_profile": "https://Stackoverflow.com/users/27073", "pm_score": 0, "selected": false, "text": "<!-- in the main page --->\nfunction showTable1() {}\n\n<!-- in the iframe -->\nwindow.onload = function () {\n parent....
2008/10/12
[ "https://Stackoverflow.com/questions/195667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
195,682
<p>Here's my issue, I'd like to mock a class that creates a thread at initialization and closes it at destruction. There's no reason for my mock class to actually create and close threads. But, to mock a class, I have inherit from it. When I create a new instance of my mock class, the base classes constructor is cal...
[ { "answer_id": 195747, "author": "hazzen", "author_id": 5066, "author_profile": "https://Stackoverflow.com/users/5066", "pm_score": 5, "selected": true, "text": "class RAIIClass {\n public:\n RAIIClass(Foo* f);\n ~RAIIClass();\n bool DoOperation();\n\n private:\n ...\n};\n class Mock...
2008/10/12
[ "https://Stackoverflow.com/questions/195682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23071/" ]
195,684
<p>On a CentOS LAMP box, trying to get require_once to work inside a script in PHP5. If the file to be included is not a in symlinked directory, it works fine, but if the file to be required is in a directory found via a symbolic link, it fails to find it.</p> <p>Is this a limitation of require_once and symbolic links...
[ { "answer_id": 195801, "author": "Andy", "author_id": 26693, "author_profile": "https://Stackoverflow.com/users/26693", "pm_score": 2, "selected": false, "text": "\n if (is_link($path))\n {\n $path = readlink($path);\n }\n require_once($path);\n" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/137/" ]
195,688
<p>I have a string(char*), and i need to find its underlying datatype such as int, float, double, short, long, or just a character array containing alphabets with or with out digits(like varchar in SQL). For ex: </p> <pre><code> char* str1 = "12312" char* str2 = "231.342" char* str3 = "234234243234" cha...
[ { "answer_id": 195732, "author": "Pitarou", "author_id": 1260685, "author_profile": "https://Stackoverflow.com/users/1260685", "pm_score": 1, "selected": false, "text": "[+-]?\\d+" }, { "answer_id": 195775, "author": "fizzer", "author_id": 18167, "author_profile": "ht...
2008/10/12
[ "https://Stackoverflow.com/questions/195688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27221/" ]
195,696
<p>While researching this issue, I found multiple mentions of the following scenario online, invariably as unanswered questions on programming forums. I hope that posting this here will at least serve to document my findings.</p> <p>First, the symptom: While running pretty standard code that uses waveOutWrite() to out...
[ { "answer_id": 514317, "author": "AShelly", "author_id": 10396, "author_profile": "https://Stackoverflow.com/users/10396", "pm_score": 2, "selected": false, "text": "hdr->reserved hdr->reserved fdwOpen = CALLBACK_FUNCTION" }, { "answer_id": 1303694, "author": "pps", "auth...
2008/10/12
[ "https://Stackoverflow.com/questions/195696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9047/" ]
195,697
<p>I have an XML file, which I open in F# like this:</p> <pre><code>let Bookmarks(xmlFile:string) = let xml = XDocument.Load(xmlFile) </code></pre> <p>Once I have the XDocument I need to navigate it using LINQ to XML and extract all specific tags. Part of my solution is:</p> <pre><code>let xname (tag:string) = ...
[ { "answer_id": 195859, "author": "Brian", "author_id": 19299, "author_profile": "https://Stackoverflow.com/users/19299", "pm_score": 2, "selected": false, "text": "open System.IO\nopen System.Xml\nopen System.Xml.Linq \n\nlet xmlStr = @\"<?xml version='1.0' encoding='UTF-8'?>\n<doc>\n ...
2008/10/12
[ "https://Stackoverflow.com/questions/195697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18619/" ]
195,709
<p>After switching back and forth between several scripting languages this week, I found myself thinking how similar they all are. Yet I'm always reaching for Google (or nowadays SO) to remember details like what the local equivalents of "instanceof" and "endswith" are, or the right syntax to declare an interface, or ...
[ { "answer_id": 195846, "author": "shoosh", "author_id": 9611, "author_profile": "https://Stackoverflow.com/users/9611", "pm_score": 1, "selected": false, "text": "print sys.argv sys.argv" }, { "answer_id": 850141, "author": "inkredibl", "author_id": 22129, "author_pro...
2008/10/12
[ "https://Stackoverflow.com/questions/195709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4540/" ]
195,714
<p>I'm writing an editor for large <em>archive files</em> (see below) of 4GB+, in native&amp;managed C++.</p> <p>For accessing the files, I'm using <em>file mapping</em> (see below) like any sane person. This is absolutely great for reading data, but a problem arises in actually editing the archive. File mapping does ...
[ { "answer_id": 196248, "author": "Shane Powell", "author_id": 23235, "author_profile": "https://Stackoverflow.com/users/23235", "pm_score": 2, "selected": true, "text": "// Open memory mapped file \nHANDLE FileHandle = ::CreateFileW(file_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OP...
2008/10/12
[ "https://Stackoverflow.com/questions/195714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15477/" ]
195,717
<p>My father died recently and I've inherited his Mac. I'd love to put it to use in my own life, but I don't want to wipe its brains out just so I can reconfigure it to use in my network, etc. His old files are historically important to me&mdash;I trust you can understand my desire to keep them.</p> <p>I can log in as...
[ { "answer_id": 195725, "author": "Gordon Wilson", "author_id": 23071, "author_profile": "https://Stackoverflow.com/users/23071", "pm_score": 2, "selected": false, "text": "sudo passwd root\n" }, { "answer_id": 12132784, "author": "Michael Zaporozhets", "author_id": 106196...
2008/10/12
[ "https://Stackoverflow.com/questions/195717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26976/" ]
195,740
<p>I'm writing a Rails application, but can't seem to find how to do relative time, i.e. if given a certain Time class, it can calculate "30 seconds ago" or "2 days ago" or if it's longer than a month "9/1/2008", etc.</p>
[ { "answer_id": 195743, "author": "TonyLa", "author_id": 1295, "author_profile": "https://Stackoverflow.com/users/1295", "pm_score": 4, "selected": false, "text": "Time.now - 2.days \n" }, { "answer_id": 195793, "author": "Gordon Wilson", "author_id": 23071, "author_pr...
2008/10/12
[ "https://Stackoverflow.com/questions/195740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
195,742
<p>I can run the server on my local machine and connect to it on the same machine, but when I try to connect to it from a different computer over the internet, there is not sign of activity on my server, nor a response from the server on the computer I'm testing it on. I've tried both XP and Vista, turn off firewalls, ...
[ { "answer_id": 195749, "author": "hectorsq", "author_id": 14755, "author_profile": "https://Stackoverflow.com/users/14755", "pm_score": 4, "selected": true, "text": "3326" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195742", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22582/" ]
195,764
<p>Here's the XML file i'm working on:</p> <pre><code>&lt;list&gt; &lt;activity&gt;swimming&lt;/activity&gt; &lt;activity&gt;running&lt;/activity&gt; &lt;activity&gt;soccer&lt;/activity&gt; &lt;/list&gt; </code></pre> <p>The index.php, page that shows the list of activities with checkboxes, a button to de...
[ { "answer_id": 203430, "author": "John ODonnell", "author_id": 28072, "author_profile": "https://Stackoverflow.com/users/28072", "pm_score": 1, "selected": false, "text": "<list>\n <activity name=\"swimming\">swimming</activity>\n <activity name=\"running\">running</activity>\n ...
2008/10/12
[ "https://Stackoverflow.com/questions/195764", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27090/" ]
195,768
<p>I'm in search of a JavaScript month selection tool. I'm already using jQuery on the website, so if it were a jQuery plugin, that would fit nicely. I'm open to other options, as well.</p> <p>Basically, I'm after a simplified version of the <a href="http://docs.jquery.com/UI/Datepicker" rel="noreferrer">jQuery UI Dat...
[ { "answer_id": 3348217, "author": "Cory", "author_id": 8207, "author_profile": "https://Stackoverflow.com/users/8207", "pm_score": 4, "selected": false, "text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\...
2008/10/12
[ "https://Stackoverflow.com/questions/195768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/751/" ]
195,794
<p>Assuming Visual C/C++ 6, I have a complex data structure of 22399 elements that looks like this:</p> <pre><code>{ { "(SAME", "AS", "U+4E18)", "HILLOCK", "OR", "MOUND"}, { "TO", "LICK;", {1, 1, 0}, "TASTE,", "A", "MAT,", "BAMBOO", "BARK"}, { "(J)", "NON-STANDARD", "FORM", "OF", "U+559C", ",", {1, 1, 0}, "LIKE,", "LO...
[ { "answer_id": 195805, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "char * abbrevs3[][22399] = { ... };\n" }, { "answer_id": 195825, "author": "tvanfosson", "author_id": 129...
2008/10/12
[ "https://Stackoverflow.com/questions/195794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/426/" ]
195,802
<p>I was wondering if there was any difference in the way the following code was compiled into assembly. I've heard that switch-case is more efficient than if else, but in this example I am not quite sure if that would be the case.</p> <pre><code>if(x==1){ ... }else if(x==2){ ... }else{ ... } </code></pre> <p>and</p>...
[ { "answer_id": 195810, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "switch if = == x if x volatile" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17162/" ]
195,809
<p>I am thinking of developing a web search engine using Erlang, Mnesia &amp; Yaws. Is it possible to make a powerful and the fastest web search engine using these software? What will it need to accomplish this and how what do I start with? </p>
[ { "answer_id": 213571, "author": "uwiger", "author_id": 6834, "author_profile": "https://Stackoverflow.com/users/6834", "pm_score": 1, "selected": false, "text": "rdbms_wsearch.erl\nrdbms_wsearch_idx.erl\nrdbms_wsearch_porter.erl\n" }, { "answer_id": 4004413, "author": "Muzaa...
2008/10/12
[ "https://Stackoverflow.com/questions/195809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24813/" ]
195,834
<p>When are <strong>custom Exception classes</strong> most-valuable?<br> Are there cases when they should or should not be used? What are the benefits?</p> <p><strong>Related questions:</strong></p> <ol> <li><strong><a href="https://stackoverflow.com/questions/6891/performance-considerations-for-throwing-exceptions"...
[ { "answer_id": 196211, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 4, "selected": true, "text": "throw catch()" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19468/" ]
195,840
<p>What are the main differences between XHTML and HTML? Which one is better in your opinion, and why? Do most browsers support both?</p>
[ { "answer_id": 195850, "author": "Dave Rutledge", "author_id": 2486915, "author_profile": "https://Stackoverflow.com/users/2486915", "pm_score": 0, "selected": false, "text": "<br>\n <br />\n" }, { "answer_id": 196187, "author": "Vincent Robert", "author_id": 268, "au...
2008/10/12
[ "https://Stackoverflow.com/questions/195840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24644/" ]
195,849
<p>Is there a way to programmatically find the location of the current user's Outlook .pst file(s) through an API call or registry entry?</p>
[ { "answer_id": 197358, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 4, "selected": true, "text": "RDOStores RDOSession.Stores Sub PstFiles()\n Dim f As MAPIFolder\n\n For Each f In Session.Folders\n Debug.Print f.Sto...
2008/10/12
[ "https://Stackoverflow.com/questions/195849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27236/" ]
195,853
<p>What are the basic differences between a semaphore &amp; spin-lock?</p> <p>When would we use a semaphore over a spin-lock?</p>
[ { "answer_id": 17221568, "author": "Damon", "author_id": 572743, "author_profile": "https://Stackoverflow.com/users/572743", "pm_score": 8, "selected": true, "text": "sys_futex" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24813/" ]
195,872
<p>I need to have multiple forms in the same webpage, all of them POSTing to itself and then performing different actions depending on the type of form.</p> <p>What's the best way to achieve this?</p> <p>To be more specific, the page shows the details of an event, with a form to subscribe (a drop-down box) and anothe...
[ { "answer_id": 195878, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 4, "selected": true, "text": "<input type=\"hidden\" name=\"formname\" value=\"firstForm\" /> <form action=\"mypage.php?formtype=firstForm\" ...> <input type...
2008/10/12
[ "https://Stackoverflow.com/questions/195872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2841/" ]
195,886
<p>I've searched around a bit, but haven't found a satisfactory answer, so I'd like to hear your opinions on this.</p> <p>I have a couple of tools which I have to update and deploy to a few servers every now and then. The source is managed in a SVN repository.</p> <p>To save myself the bother of copying the binaries ...
[ { "answer_id": 195891, "author": "zigdon", "author_id": 4913, "author_profile": "https://Stackoverflow.com/users/4913", "pm_score": 0, "selected": false, "text": "<tag id <code as usual" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/195886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2899/" ]
195,887
<p>I've seen a number of 'code metrics' related questions on SO lately, and have to wonder what the fascination is? Here are some recent examples:</p> <ul> <li><a href="https://stackoverflow.com/questions/187289/what-code-metrics-convince-you-that-provided-code-is-crappy">what code metrics convince you that provided c...
[ { "answer_id": 3346033, "author": "RMatthews", "author_id": 75155, "author_profile": "https://Stackoverflow.com/users/75155", "pm_score": 4, "selected": false, "text": "CRAP(m) = comp(m)^2 * (1 – cov(m)/100)^3 + comp(m) Method’s Cyclomatic Complexity % of coverage required to be\n...
2008/10/12
[ "https://Stackoverflow.com/questions/195887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9345/" ]
195,919
<p>When uninstalling my application, I'd like to configure the <a href="http://en.wikipedia.org/wiki/WiX" rel="noreferrer">Wix</a> setup to remove all the files that were added <strong>after the original installation</strong>. It seems like the uninstaller removes only the directories and files that were originally ins...
[ { "answer_id": 196149, "author": "Pavel Chuchuva", "author_id": 14131, "author_profile": "https://Stackoverflow.com/users/14131", "pm_score": 7, "selected": true, "text": "<Directory Id=\"CommonAppDataFolder\" Name=\"CommonAppDataFolder\">\n <Directory Id=\"MyAppFolder\" Name=\"My\">\n ...
2008/10/12
[ "https://Stackoverflow.com/questions/195919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23609/" ]
195,951
<p>How can I change the class of an HTML element in response to an <code>onclick</code> or any other events using JavaScript?</p>
[ { "answer_id": 195961, "author": "Jon Galloway", "author_id": 5, "author_profile": "https://Stackoverflow.com/users/5", "pm_score": -1, "selected": false, "text": "<input type=\"button\" onClick=\"javascript:test_byid();\" value=\"id='second'\" />\n\n<script>\nfunction test_byid()\n{\n ...
2008/10/12
[ "https://Stackoverflow.com/questions/195951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4998/" ]
195,975
<p>For example, how to avoid writing the 'func_name' twice?</p> <pre><code>#ifndef TEST_FUN # define TEST_FUN func_name # define TEST_FUN_NAME "func_name" #endif </code></pre> <p>I'd like to follow the <a href="http://en.wikipedia.org/wiki/Single_Point_of_Truth" rel="noreferrer">Single Point of Truth</a> rule.</p> ...
[ { "answer_id": 195980, "author": "shoosh", "author_id": 9611, "author_profile": "https://Stackoverflow.com/users/9611", "pm_score": -1, "selected": false, "text": "#define TEST_FUN_NAME #FUNC_NAME" }, { "answer_id": 195999, "author": "Jason Weathered", "author_id": 3736, ...
2008/10/12
[ "https://Stackoverflow.com/questions/195975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4279/" ]
195,991
<p>For explanation imagine a simple address. Written in a HTML paragraph with line breaks it would like this:</p> <pre><code>Street: Example Street 1 City: Vienna Zip Code: 1010 Country: Austria </code></pre> <p>Most of the time that's completely okay, but sometimes I have to achieve the following output:</p> <pre><...
[ { "answer_id": 196007, "author": "Kornel", "author_id": 27009, "author_profile": "https://Stackoverflow.com/users/27009", "pm_score": 4, "selected": false, "text": "<th> <td> <caption> <dl> <th> <td> <th> <dl> <address>" }, { "answer_id": 196030, "author": "Eevee", "autho...
2008/10/12
[ "https://Stackoverflow.com/questions/195991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20467/" ]
196,017
<p>I'd like to generate unique random numbers between 0 and 1000 that never repeat (i.e. 6 doesn't show up twice), but that doesn't resort to something like an O(N) search of previous values to do it. Is this possible?</p>
[ { "answer_id": 196065, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 9, "selected": true, "text": "+--+--+--+--+--+--+--+--+--+--+--+\n| 0| 1| 2| 3| 4| 5| 6| 7| 8| 9|10|\n+--+--+--+--+--+--+--+--+--+--+--+\n ...
2008/10/12
[ "https://Stackoverflow.com/questions/196017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3886/" ]
196,020
<p>I need to create a 'slider' for a client's site. The slider should allow people to select how many items they want of x item, and show what the price will be based on that. The weird(ish) part is that the ratio of the price increase will go down as the amount of items goes up:</p> <ul> <li>1 item: $100</li> <li>2 i...
[ { "answer_id": 196034, "author": "Dimitry", "author_id": 27073, "author_profile": "https://Stackoverflow.com/users/27073", "pm_score": 3, "selected": false, "text": "// First example of http://demos.mootools.net/Slider\n\n<div class=\"slider\" id=\"myslider\">\n <div class=\"knob\" ...
2008/10/12
[ "https://Stackoverflow.com/questions/196020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12765/" ]
196,027
<p>Something that has always bugged me is how unpredictable the <code>setTimeout()</code> method in Javascript is.</p> <p>In my experience, the timer is horribly inaccurate in a lot of situations. By inaccurate, I mean the actual delay time seems to vary by 250-500ms more or less. Although this isn't a huge amount of ...
[ { "answer_id": 196138, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 7, "selected": true, "text": "setTimeout() setTimeout() setTimeout() (new Date()).milliseconds setTimeout()" }, { "answer_id": 3652173, "author": "...
2008/10/12
[ "https://Stackoverflow.com/questions/196027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/392/" ]
196,029
<p>I have a PHP script that initialises an image gallery. It loops through all images, checks if they are thumbnailed and watermarks them.</p> <p>My shared hosting account only lets me have 30 seconds of execution per script, as set in the php.ini settings. I can't change that.</p> <p>What can I do to get round this?...
[ { "answer_id": 196050, "author": "daniels", "author_id": 9789, "author_profile": "https://Stackoverflow.com/users/9789", "pm_score": 2, "selected": false, "text": "<meta http-equiv=\"refresh\" content=\"2;url=script.php?start=5\">\n" }, { "answer_id": 196057, "author": "nickf...
2008/10/12
[ "https://Stackoverflow.com/questions/196029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16511/" ]
196,032
<p>What Visual Studio settings and .emacs macros improve the likelihood that code written on Windows (in visual studio) will still look good in Emacs (and vice versa)? I've recently taken to turning off tabs in emacs (so tabs are rendered via spaces) and this at least makes the code look the same (tho people who like c...
[ { "answer_id": 196245, "author": "ejgottl", "author_id": 9808, "author_profile": "https://Stackoverflow.com/users/9808", "pm_score": 1, "selected": false, "text": "'(c-default-style (quote ((c-mode . \"bsd\") (c++-mode . \"bsd\") (java-mode . \"jav\na\") (other . \"gnu\"))))\n" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/196032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3886/" ]
196,037
<p>How can I access a public static member of a Java class from ColdFusion?</p>
[ { "answer_id": 196107, "author": "Turnkey", "author_id": 13144, "author_profile": "https://Stackoverflow.com/users/13144", "pm_score": 5, "selected": true, "text": "<cfset systemObject = createObject(\"java\", \"java.lang.System\") />\n<cfoutput>#systemObject.currentTimeMillis()#</cfoutp...
2008/10/12
[ "https://Stackoverflow.com/questions/196037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2484/" ]
196,048
<p>I have a system which generates a large number of XML documents every day (of the order of 1 million) and I would like to be able to store and index these so that I can, for example, search for all documents with a certain field set to a given value.</p> <p>I understand that there are fundamentally two types of XML...
[ { "answer_id": 13856159, "author": "thewhitetulip", "author_id": 1160051, "author_profile": "https://Stackoverflow.com/users/1160051", "pm_score": 1, "selected": false, "text": "create table person(name varchar(20), data xml);\n\ninsert into person values('bane', XMLPARSE(DOCUMENT '\n<pe...
2008/10/12
[ "https://Stackoverflow.com/questions/196048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3305/" ]
196,053
<p>I am in the process of developing a web application that consists visually of a header above a body containing four columns of variable-height content. The design gods have decreed it to be fixed height, mainly because each of the columns can potentially get very long, and so (being designers) they are wanting ifram...
[ { "answer_id": 196078, "author": "Dimitry", "author_id": 27073, "author_profile": "https://Stackoverflow.com/users/27073", "pm_score": 0, "selected": false, "text": "<div id=\"head\"></div>\n<div id=\"body\">\n <div id=\"col1\"></div>\n <div id=\"col2\"></div>\n <div id=\"col3\"></div...
2008/10/12
[ "https://Stackoverflow.com/questions/196053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14979/" ]
196,087
<p>I listen to the podcast java posse, on this there is often discussion about components (note components are not (clearly) objects). They lament the fact that Java does not have components, and contrast with .NET that does. Components apparently makes developing applications (not just GUI apps) easier.</p> <p>I c...
[ { "answer_id": 22465686, "author": "Miguel Gamboa", "author_id": 1140754, "author_profile": "https://Stackoverflow.com/users/1140754", "pm_score": 2, "selected": false, "text": ".class .class .class .dll .exe" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/196087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6715/" ]
196,088
<p>Assume I have a function template like this:</p> <pre><code>template&lt;class T&gt; inline void doStuff(T* arr) { // stuff that needs to use sizeof(T) } </code></pre> <p>Then in another <code>.h</code> filee I have a template class <code>Foo</code> that has:</p> <pre><code>public: operator T*() const; </code></...
[ { "answer_id": 196103, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": -1, "selected": false, "text": "\ntemplate \ninline\nvoid \ndoStuff(T& arrRef)\n{\n doStuff(&arrRef);\n}\n" }, { "answer_id": 196151, "auth...
2008/10/12
[ "https://Stackoverflow.com/questions/196088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18721/" ]
196,094
<p>I know I can get the public static members of a class by doing something like:</p> <p><code>obj.getClass().getFields()</code></p> <p>but this doesn't get me the enums. I'd like to be able to get them from the Class object returned by the getClass method. Any ideas?</p>
[ { "answer_id": 196117, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "Class.getDeclaredClasses() Class.isEnum() Class.getEnumConstants()" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/196094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2484/" ]
196,097
<p>On a site of mine in which a textarea is used for submission, I have code that can appear something along the lines of the following:</p> <pre><code>&lt;textarea&gt;&lt;p&gt;text&lt;/p&gt;&lt;/textarea&gt; </code></pre> <p>When validating (XHTML 1.0 Transitional), this error arises,</p> <pre><code>line 88 column ...
[ { "answer_id": 196105, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 4, "selected": true, "text": "<p> <textarea> <textarea>&lt;p&gt;text&lt;/p&gt;</textarea>\n" }, { "answer_id": 196108, "author": "acrosman", "...
2008/10/12
[ "https://Stackoverflow.com/questions/196097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23666/" ]
196,109
<p>Does anybody know of a good media framework for Flex?<br/> I'd like to be able to create apps that can play not only those formats that the Flex framework provides support for, but other formats as well (like wav, wma, ogg and other...).</p> <p><strong>EDIT 13.10.2008.:</strong> It was recently pointed out to me in...
[ { "answer_id": 196105, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 4, "selected": true, "text": "<p> <textarea> <textarea>&lt;p&gt;text&lt;/p&gt;</textarea>\n" }, { "answer_id": 196108, "author": "acrosman", "...
2008/10/12
[ "https://Stackoverflow.com/questions/196109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19911/" ]
196,114
<p>I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing:</p> <pre><code>rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); </co...
[ { "answer_id": 196118, "author": "Ross", "author_id": 2025, "author_profile": "https://Stackoverflow.com/users/2025", "pm_score": 0, "selected": false, "text": "print_r(posix_getpwuid(getmyuid()));\nprint_r(pathinfo($YOUR_PATH));\n" }, { "answer_id": 196167, "author": "Owen",...
2008/10/12
[ "https://Stackoverflow.com/questions/196114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
196,136
<p>I'm working on designing the kernel (which I'm going to actually call the "core" just to be different, but its basically the same) for an OS I'm working on. The specifics of the OS itself are irrelevant if I can't get multi-tasking, memory management, and other basic things up and running, so I need to work on that ...
[ { "answer_id": 196146, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 0, "selected": false, "text": "malloc mmap sbrk malloc" }, { "answer_id": 196191, "author": "Adam Rosenfield", "author_id": 9530, "auth...
2008/10/12
[ "https://Stackoverflow.com/questions/196136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19521/" ]
196,171
<p>Is it possible to use a CHECK constraint to prevent any date that falls on a Sunday? I don't want to use a trigger.</p>
[ { "answer_id": 196190, "author": "Mark", "author_id": 26310, "author_profile": "https://Stackoverflow.com/users/26310", "pm_score": 1, "selected": false, "text": "TO_CHAR(sysdate, 'D'); \n" }, { "answer_id": 196196, "author": "Plasmer", "author_id": 397314, "author_pr...
2008/10/12
[ "https://Stackoverflow.com/questions/196171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3401/" ]
196,173
<p>Modern UI's are starting to give their UI elments nice inertia when moving. Tabs slide in, page transitions, even some listboxes and scroll elments have nice inertia to them (the iphone for example). What is the best algorythm for this? It is more than just gravity as they speed up, and then slow down as they fal...
[ { "answer_id": 196209, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 5, "selected": true, "text": "smoothstep(t) = 3*t*t - 2*t*t*t [0 <= t <= 1]\n smoothstep_eo(t) = 2*smoothstep((t+1)/2) - 1\n" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/196173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3798/" ]
196,177
<p>I have code like this:</p> <pre><code>var newMsg = new Msg { Var1 = var1, Var2 = var2 }; using (AppDataContext appDataContext = new AppDataContext(ConnectionString)) { appDataContext.CClass.InsertOnSubmit(newMsg); appDataContext.SubmitChanges(); } </code></pre> <p>After reading <a href="https://st...
[ { "answer_id": 196304, "author": "Aaron Powell", "author_id": 11388, "author_profile": "https://Stackoverflow.com/users/11388", "pm_score": 2, "selected": false, "text": "INSERT INTO [MSG] [Var1] = @p1, [Var2] = @p2\n" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/196177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463/" ]
196,179
<p>I'm having a problem understanding the shift/reduce confict for a grammar that I know has no ambiguity. The case is one of the if else type but it's not the 'dangling else' problem since I have mandatory END clauses delimiting code blocks.</p> <p>Here is the grammar for gppg (Its a Bison like compiler compiler ... ...
[ { "answer_id": 196201, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 2, "selected": false, "text": "elseifs : elseifs '#' ELSEIF statements else\n | '#' ELSEIF statements else\n ;\n else : '#' END\n ...
2008/10/12
[ "https://Stackoverflow.com/questions/196179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23190/" ]
196,216
<p>I am new to strut/web programming and I thought I could learn a lot by reading a sample app. On google, I searched and found a sample app at <a href="http://www.roseindia.net/struts/struts2/struts2tutorial.zip" rel="nofollow noreferrer">http://www.roseindia.net/struts/struts2/struts2tutorial.zip</a> , the tutorial i...
[ { "answer_id": 4298347, "author": "Hans Beemsterboer", "author_id": 522561, "author_profile": "https://Stackoverflow.com/users/522561", "pm_score": 0, "selected": false, "text": "WebContent/WEB-INF/classes\n" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/196216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17085/" ]
196,221
<p>Is it possible to assign a custom ID to a HTTP session through Servlet API?</p> <p>I know that session handling from any application server, Tomcat for example, it's enough good to generate unique IDs. But I have custom unique session IDs based on information per user and time, so it won't be repeated.</p> <p>And ...
[ { "answer_id": 196343, "author": "MetroidFan2002", "author_id": 8026, "author_profile": "https://Stackoverflow.com/users/8026", "pm_score": 1, "selected": false, "text": "/** \n * The String key of the user id attribute.\n */\npublic static final String USER_ID_KEY = \"userIdKey\";\n\n//...
2008/10/12
[ "https://Stackoverflow.com/questions/196221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11583/" ]
196,224
<p>I have a component which writes/generates javascript from a server side renderer. This component can be used in multiple times in a same page. However, once the page is loaded I have to collect all the variables or JSO written by this multiple components in the page. How can I do this so that I will have a collectio...
[ { "answer_id": 196271, "author": "Vincent Robert", "author_id": 268, "author_profile": "https://Stackoverflow.com/users/268", "pm_score": 2, "selected": true, "text": "Component_appendArray(['First', 'Second']);\n...\nComponent_appendArray(['Third', 'Fourth']);\n Component_appendArray() ...
2008/10/12
[ "https://Stackoverflow.com/questions/196224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3627/" ]
196,244
<p>Can anyone point to some code that deals with the security of files access via a path specified (in part) by an environment variable, specifically for Unix and its variants, but Windows solutions are also of interest?</p> <p><em>This is a big long question - I'm not sure how well it fits the SO paradigm.</em></p> ...
[ { "answer_id": 196280, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 3, "selected": true, "text": "$PQRHOME socketpair" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/196244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15168/" ]
196,253
<p>I'm using LINQ to SQL in a data access object library. The library is used in both web (web application/web service) and non-web (windows service) contexts. Initially, I stored the <code>DataContext</code> on the current <code>HttpContext</code> since it permitted me to manage a fairly small unit of work (one web re...
[ { "answer_id": 196264, "author": "Bradley Grainger", "author_id": 23633, "author_profile": "https://Stackoverflow.com/users/23633", "pm_score": 5, "selected": false, "text": "DataContext IDisposable DataContext using DataContext" } ]
2008/10/12
[ "https://Stackoverflow.com/questions/196253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7625/" ]
196,294
<p>I'm trying to learn about catamorphisms and I've read <a href="http://en.wikipedia.org/wiki/Catamorphism" rel="noreferrer">the Wikipedia article</a> and the first couple posts in <a href="http://lorgonblog.spaces.live.com/Blog/cns!701679AD17B6D310!256.entry" rel="noreferrer">the series of the topic for F#</a> on the...
[ { "answer_id": 196309, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 4, "selected": false, "text": "IEnumerable<A> => B Max() Min() Aggregate()" }, { "answer_id": 196451, "author": "Brian", "author_id": 1...
2008/10/12
[ "https://Stackoverflow.com/questions/196294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1659/" ]
196,302
<p>Since I keep showing up late for answering questions tagged php where i actually know the answer i figured i'd try asking a question myself.</p> <p>I've been working on so many complete rewrites of a custom template engine in php for so long and so many times that i thought i'd ask for opinions.</p> <p>In short, t...
[ { "answer_id": 197119, "author": "SchizoDuckie", "author_id": 18077, "author_profile": "https://Stackoverflow.com/users/18077", "pm_score": 3, "selected": false, "text": "<?php=$variable;?>" }, { "answer_id": 206935, "author": "Kris", "author_id": 18565, "author_profi...
2008/10/12
[ "https://Stackoverflow.com/questions/196302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18565/" ]
196,326
<p>.NET newbie here... I'd like to make a button in a Windows form that displays a progress or "cooldown" effect. That is, when the button is pressed, it becomes disabled. As some event or timer is progressing, the button shows the progress graphically. When the progress is finished, the graphic completes and the bu...
[ { "answer_id": 196335, "author": "Fry", "author_id": 23553, "author_profile": "https://Stackoverflow.com/users/23553", "pm_score": 1, "selected": true, "text": "button += new buttonPaintEvent(buttonPaintEventHandlerMethod);\n" } ]
2008/10/13
[ "https://Stackoverflow.com/questions/196326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3696/" ]
196,329
<p>I'm working on a project in C and it requires memalign(). Really, posix_memalign() would do as well, but darwin/OSX lacks both of them.</p> <p>What is a good solution to shoehorn-in memalign? I don't understand the licensing for posix-C code if I were to rip off memalign.c and put it in my project- I don't want an...
[ { "answer_id": 196361, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "void *aligned_malloc( size_t size, int align )\n{\n void *mem = malloc( size + (align-1) + sizeof(void*) );\n\n char *am...
2008/10/13
[ "https://Stackoverflow.com/questions/196329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17925/" ]
196,345
<p>I want to I check whether a string is in ASCII or not.</p> <p>I am aware of <code>ord()</code>, however when I try <code>ord('é')</code>, I have <code>TypeError: ord() expected a character, but string of length 2 found</code>. I understood it is caused by the way I built Python (as explained in <a href="http://docs...
[ { "answer_id": 196391, "author": "Vincent Marchetti", "author_id": 8935, "author_profile": "https://Stackoverflow.com/users/8935", "pm_score": 8, "selected": false, "text": "try:\n mystring.decode('ascii')\nexcept UnicodeDecodeError:\n print \"it was not a ascii-encoded unicode str...
2008/10/13
[ "https://Stackoverflow.com/questions/196345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3504/" ]
196,357
<p>In bash shell with emacs key-binding, you can use key combination like M-f, M-b to move one word forward or backward on the shell prompt respectively. Usually, the meta key is mapped to Alt key on Windows and Linux. However, in iTerm, I could not find a way to map this meta key to either Option or Command key on my ...
[ { "answer_id": 197092, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 9, "selected": true, "text": "Profiles Keys General Left Option key: Esc+" }, { "answer_id": 4369714, "author": "ches", "author_id": 455009, ...
2008/10/13
[ "https://Stackoverflow.com/questions/196357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27274/" ]
196,382
<p>I see that the SML/NJ includes a queue structure. I can't figure out how to use it. How do I use the additional libraries provided by SML/NJ?</p>
[ { "answer_id": 1070416, "author": "ephemient", "author_id": 20713, "author_profile": "https://Stackoverflow.com/users/20713", "pm_score": 3, "selected": true, "text": "Queue open Queue." }, { "answer_id": 18422301, "author": "N A", "author_id": 1415760, "author_profil...
2008/10/13
[ "https://Stackoverflow.com/questions/196382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6013/" ]