qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
60,680
<p>I'm writing a small web server in Python, using BaseHTTPServer and a custom subclass of BaseHTTPServer.BaseHTTPRequestHandler. Is it possible to make this listen on more than one port?</p> <p>What I'm doing now:</p> <pre><code>class MyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): def doGET [...] clas...
[ { "answer_id": 60753, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 6, "selected": true, "text": "from threading import Thread\nfrom SocketServer import ThreadingMixIn\nfrom BaseHTTPServer import HTTPServer, BaseHTTP...
2008/09/13
[ "https://Stackoverflow.com/questions/60680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4321/" ]
60,683
<p>Can you have a multicolumn listview control where one of the columns is a checkbox? Example code or links would be greatly appreciated.</p> <p>I am using visual studio 2005</p>
[ { "answer_id": 60695, "author": "Winter", "author_id": 6227, "author_profile": "https://Stackoverflow.com/users/6227", "pm_score": 4, "selected": true, "text": "\n GlacialList mylist = new GlacialList();\n\nmylist.Columns.Add( \"Column1\", 100 ); // this can also be added \n\n ...
2008/09/13
[ "https://Stackoverflow.com/questions/60683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4653/" ]
60,684
<p><strong><em>Edit:</em></strong> This question had been tagged "Tolstoy" in appreciation of the quality and length of my writing:) Just reading the first and the last paragraph should be enough:) If you tend to select and move code with the mouse, the stuff in middle could be interesting to you.</p> <p>This questio...
[ { "answer_id": 60697, "author": "jfs", "author_id": 4279, "author_profile": "https://Stackoverflow.com/users/4279", "pm_score": 2, "selected": false, "text": "kill-whole-line" }, { "answer_id": 60709, "author": "Nathan Fellman", "author_id": 1084, "author_profile": "h...
2008/09/13
[ "https://Stackoverflow.com/questions/60684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6103/" ]
60,685
<p>What follows is a regular expression I have written to match multi-line pre-processor macros in C / C++ code. I'm by no means a regular expressions guru, so I'd welcome any advice on how I can make this better.</p> <p>Here's the regex:</p> <pre><code>\s*#define(.*\\\n)+[\S]+(?!\\) </code></pre> <p>It should match...
[ { "answer_id": 60723, "author": "Douglas Leeder", "author_id": 3978, "author_profile": "https://Stackoverflow.com/users/3978", "pm_score": 4, "selected": true, "text": "#!/usr/bin/env python\n\nTEST1=\"\"\"\n#include \"Foo.h\"\n#define bar foo\\\\\n x\n#include \"Bar.h\"\n\"\"\"\n\nTE...
2008/09/13
[ "https://Stackoverflow.com/questions/60685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1304/" ]
60,720
<p>What is the best way for me to determine a controller variable's value during execution?</p> <p>For example, is there a way I can insert a break in the code, and cause the value of the variable to be output to the screen (or the log)?</p>
[ { "answer_id": 60731, "author": "Jordi Bunster", "author_id": 4272, "author_profile": "https://Stackoverflow.com/users/4272", "pm_score": 5, "selected": true, "text": "raise @foo.to_s gem install ruby-debug --debugger debugger p" }, { "answer_id": 60732, "author": "John Tople...
2008/09/13
[ "https://Stackoverflow.com/questions/60720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3764/" ]
60,736
<p>I have a laptop running Ubuntu that I would like to act as a Subversion server. Both for myself to commit to locally, and for others remotely. What are the steps required to get this working? Please include steps to:</p> <ul> <li>Get and configure Apache, and necessary modules (I know there are other ways to create...
[ { "answer_id": 60741, "author": "UnkwnTech", "author_id": 115, "author_profile": "https://Stackoverflow.com/users/115", "pm_score": -1, "selected": false, "text": "sudo apt-get -yq install apache2\n sudo apt-get -yq install openssh-server\n sudo apt-get -yq install subversion subversion-...
2008/09/13
[ "https://Stackoverflow.com/questions/60736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4120/" ]
60,740
<p>Is there an IE6/PNG fix that is officially developed by the jQuery team?</p> <p>If not which of the available plugins should I use?</p>
[ { "answer_id": 2163740, "author": "Guilherme Santos", "author_id": 262002, "author_profile": "https://Stackoverflow.com/users/262002", "pm_score": 1, "selected": false, "text": "// this line\njQuery(this).find(\"img[src$=.png]:visible\").each(function() { \n// this line\njQuery(this).fin...
2008/09/13
[ "https://Stackoverflow.com/questions/60740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3747/" ]
60,751
<p>Currently my app uses just Direct3D9 for graphics, however in the future I' m planning to extend this to D3D10 and possibly OpenGL. The question is how can I do this in a tidy way?</p> <p>At present there are various Render methods in my code</p> <pre><code>void Render(boost::function&lt;void()&gt; &amp;Call) { ...
[ { "answer_id": 60790, "author": "Tobi", "author_id": 5422, "author_profile": "https://Stackoverflow.com/users/5422", "pm_score": 4, "selected": true, "text": "class IRenderer {\n public:\n virtual ~IRenderer() {}\n virtual void RenderModel(CModel* model) = 0;\n virtual void Dra...
2008/09/13
[ "https://Stackoverflow.com/questions/60751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6266/" ]
60,757
<p>What is the best way to handle user account management in a system, without having your employees who have access to a database, to have access to the accounts.</p> <p>Examples:</p> <ol> <li><p>Storing username/password in the database. This is a bad idea because anyone that has access to a database can see the u...
[ { "answer_id": 60864, "author": "Mr Shark", "author_id": 6093, "author_profile": "https://Stackoverflow.com/users/6093", "pm_score": 2, "selected": false, "text": "SetPassword(user, password)\n salt = RandomString()\n hash = Hashfunction(salt+password)\n StoreInDatabase(user, sa...
2008/09/13
[ "https://Stackoverflow.com/questions/60757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
60,764
<p>Why is it so hard to do this in Java? If you want to have any kind of module system you need to be able to load JAR files dynamically. I'm told there's a way of doing it by writing your own <code>ClassLoader</code>, but that's a lot of work for something that should (in my mind at least) be as easy as calling a meth...
[ { "answer_id": 60766, "author": "Allain Lalonde", "author_id": 2443, "author_profile": "https://Stackoverflow.com/users/2443", "pm_score": 7, "selected": false, "text": "File file = ...\nURL url = file.toURI().toURL();\n\nURLClassLoader classLoader = (URLClassLoader)ClassLoader.getSystem...
2008/09/13
[ "https://Stackoverflow.com/questions/60764", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2443/" ]
60,768
<p>I am trying to dynamicaly compile code using CodeDom. I can load other assemblies, but I cannot load System.Data.Linq.dll. I get an error:</p> <p>Metadata file 'System.Data.Linq.dll' could not be found</p> <p>My code looks like:</p> <pre><code>CompilerParameters compilerParams = new CompilerParameters(); compile...
[ { "answer_id": 60781, "author": "Curt Hagenlocher", "author_id": 533, "author_profile": "https://Stackoverflow.com/users/533", "pm_score": 3, "selected": true, "text": "compilerParams.ReferencedAssemblies.Add(typeof(DataContext).Assembly.Location);\n" } ]
2008/09/13
[ "https://Stackoverflow.com/questions/60768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5189/" ]
60,779
<p>Trying to do this sort of thing...</p> <pre><code>WHERE username LIKE '%$str%' </code></pre> <p>...but using bound parameters to prepared statements in PDO. e.g.:</p> <pre><code>$query = $db-&gt;prepare("select * from comments where comment like :search"); $query-&gt;bindParam(':search', $str); $query-&gt;execute...
[ { "answer_id": 60782, "author": "Polsonby", "author_id": 137, "author_profile": "https://Stackoverflow.com/users/137", "pm_score": 5, "selected": true, "text": "$str = \"%$str%\";\n$query = $db->prepare(\"select * from comments where comment like :search\");\n$query->bindParam(':search',...
2008/09/13
[ "https://Stackoverflow.com/questions/60779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/137/" ]
60,785
<p>How can I show a grey transparent overlay in C#?<br> It should overlay other process which are not owned by the application doing the overlay.</p>
[ { "answer_id": 60782, "author": "Polsonby", "author_id": 137, "author_profile": "https://Stackoverflow.com/users/137", "pm_score": 5, "selected": true, "text": "$str = \"%$str%\";\n$query = $db->prepare(\"select * from comments where comment like :search\");\n$query->bindParam(':search',...
2008/09/13
[ "https://Stackoverflow.com/questions/60785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44972/" ]
60,802
<p>I'm having trouble ordering by more than one field in my Linq to NHibernate query. Does anyone either know what might be wrong or if there is a work around?</p> <p>Code:</p> <pre><code>IQueryable&lt;AgendaItem&gt; items = _agendaRepository.GetAgendaItems(location) .Where(item =&gt; item.Minutes.Contains(query) ...
[ { "answer_id": 86686, "author": "dcstraw", "author_id": 10391, "author_profile": "https://Stackoverflow.com/users/10391", "pm_score": 4, "selected": true, "text": "var results = items\n .ToArray()\n .OrderBy(item => item.Agenda.Date)\n .ThenBy(item => item.OutcomeType)\n .ThenBy(...
2008/09/13
[ "https://Stackoverflow.com/questions/60802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2595/" ]
60,805
<p>How do I select one or more random rows from a table using SQLAlchemy? </p>
[ { "answer_id": 60811, "author": "Fire Lancer", "author_id": 6266, "author_profile": "https://Stackoverflow.com/users/6266", "pm_score": -1, "selected": false, "text": "SELECT colum FROM table\nORDER BY RAND()\nLIMIT 1\n SELECT column FROM table\nORDER BY RANDOM()\nLIMIT 1\n SELECT TOP 1 ...
2008/09/13
[ "https://Stackoverflow.com/questions/60805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1448/" ]
60,825
<p>I am working on a web application, where I transfer data from the server to the browser in XML.</p> <p>Since I'm danish, I quickly run into problems with the characters <code>æøå</code>.</p> <p>I know that in html, I use the <code>"&amp;amp;aelig;&amp;amp;oslash;&amp;amp;aring;"</code> for <code>æøå</code>.</p> <...
[ { "answer_id": 60832, "author": "chryss", "author_id": 5169, "author_profile": "https://Stackoverflow.com/users/5169", "pm_score": 0, "selected": false, "text": "alert(\"&aelig;&oslash;&aring;\");\n alert(\"æøå\");\n AddCharset utf-8 .js\n" }, { "answer_id": 67289, "author": ...
2008/09/13
[ "https://Stackoverflow.com/questions/60825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1090/" ]
60,830
<p>While it would be very convenient to use inline functions at some situations,</p> <p>Are there any drawbacks with inline functions?</p> <p><strong>Conclusion</strong>:</p> <p>Apparently, There is nothing wrong with using inline functions.</p> <p>But it is worth noting the following points!</p> <ul> <li><p>Overu...
[ { "answer_id": 60854, "author": "Fire Lancer", "author_id": 6266, "author_profile": "https://Stackoverflow.com/users/6266", "pm_score": 1, "selected": false, "text": "__forceinline" }, { "answer_id": 60941, "author": "maccullt", "author_id": 4945, "author_profile": "h...
2008/09/13
[ "https://Stackoverflow.com/questions/60830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/123/" ]
60,848
<p>Is it possible to retrieve items from a Python dictionary in the order that they were inserted?</p>
[ { "answer_id": 60862, "author": "dF.", "author_id": 3002, "author_profile": "https://Stackoverflow.com/users/3002", "pm_score": 7, "selected": true, "text": "dict collections.OrderedDict" }, { "answer_id": 61031, "author": "Eli Courtwright", "author_id": 1694, "author...
2008/09/13
[ "https://Stackoverflow.com/questions/60848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
60,874
<p>I know a few advanced ways, to change directories. <code>pushd</code> and <code>popd</code> (directory stack) or <code>cd -</code> (change to last directory).</p> <p>But I am looking for quick way to achieve the following:</p> <p>Say, I am in a rather deep dir:</p> <pre><code>/this/is/a/very/deep/directory/struct...
[ { "answer_id": 60887, "author": "dF.", "author_id": 3002, "author_profile": "https://Stackoverflow.com/users/3002", "pm_score": 4, "selected": true, "text": "cd ${PWD/a/another}\n $PWD ${var/foo/bar} $var" }, { "answer_id": 60936, "author": "Rob Wells", "author_id": 2974,...
2008/09/13
[ "https://Stackoverflow.com/questions/60874", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1870/" ]
60,877
<p>I have a query where I wish to retrieve the oldest X records. At present my query is something like the following:</p> <pre><code>SELECT Id, Title, Comments, CreatedDate FROM MyTable WHERE CreatedDate &gt; @OlderThanDate ORDER BY CreatedDate DESC </code></pre> <p>I know that normally I would remove the 'DESC' key...
[ { "answer_id": 60882, "author": "Jason Punyon", "author_id": 6212, "author_profile": "https://Stackoverflow.com/users/6212", "pm_score": 6, "selected": true, "text": "SELECT T1.* \nFROM\n(SELECT TOP X Id, Title, Comments, CreatedDate\nFROM MyTable\nWHERE CreatedDate > @OlderThanDate\nORD...
2008/09/13
[ "https://Stackoverflow.com/questions/60877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5086/" ]
60,904
<p>How can I open a cmd window in a specific location without having to navigate all the way to the directory I want?</p>
[ { "answer_id": 60907, "author": "Allain Lalonde", "author_id": 2443, "author_profile": "https://Stackoverflow.com/users/2443", "pm_score": 9, "selected": false, "text": "cmd /K \"cd C:\\Windows\\\"\n cd /d C:\\Windows\\System32\\cmd.exe /K \"cd /d H:\\Python\\\"\n" }, { "answer_i...
2008/09/13
[ "https://Stackoverflow.com/questions/60904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44972/" ]
60,910
<p>I've recently had a need to do a bit of lisp editing and I found the nifty Ready Lisp package for OS X, which is great, except Aquamacs automatically uses a proportional font (which is idiotic, IMHO) and I want to change it to a monospace font. However, I'm not really much of an EMACS user, and the preferences menu ...
[ { "answer_id": 60948, "author": "Natalie Weizenbaum", "author_id": 2518, "author_profile": "https://Stackoverflow.com/users/2518", "pm_score": 4, "selected": true, "text": "(set-default-font \"-apple-bitstream vera sans mono-medium-r-normal--0-0-0-0-m-0-mac-roman\")\n (x-list-fonts \"sea...
2008/09/13
[ "https://Stackoverflow.com/questions/60910", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85/" ]
60,918
<p>I'm trying to do 'Attach to Process' for debugging in Visual Studio 2008 and I can't figure out what process to attach to. Help.</p>
[ { "answer_id": 6362634, "author": "Robin Minto", "author_id": 1456, "author_profile": "https://Stackoverflow.com/users/1456", "pm_score": 4, "selected": false, "text": "cscript iisapp.vbs appcmd list wp" } ]
2008/09/13
[ "https://Stackoverflow.com/questions/60918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4541/" ]
60,919
<p>Can I use this approach efficiently?</p> <pre><code>using(SqlCommand cmd = new SqlCommand("GetSomething", new SqlConnection(Config.ConnectionString)) { cmd.Connection.Open(); // set up parameters and CommandType to StoredProcedure etc. etc. cmd.ExecuteNonQuery(); } </code></pre> <p>My concern is : Will...
[ { "answer_id": 60934, "author": "Ryan Farley", "author_id": 1627, "author_profile": "https://Stackoverflow.com/users/1627", "pm_score": 8, "selected": true, "text": "SqlCommand SqlConnection using (SqlConnection conn = new SqlConnection(connstring))\n{\n conn.Open();\n using (SqlCo...
2008/09/13
[ "https://Stackoverflow.com/questions/60919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1796/" ]
60,942
<p>I'd like to redirect the stdout of process proc1 to two processes proc2 and proc3:</p> <pre><code> proc2 -&gt; stdout / proc1 \ proc3 -&gt; stdout </code></pre> <p>I tried</p> <pre><code> proc1 | (proc2 &amp; proc3) </code></pre> <p>but it doesn't seem to work, i.e.</p> <pre><co...
[ { "answer_id": 60955, "author": "dF.", "author_id": 3002, "author_profile": "https://Stackoverflow.com/users/3002", "pm_score": 8, "selected": true, "text": ">(…) bash ksh zsh echo 123 | tee >(tr 1 a) | tr 1 b zsh >(…) tee $ echo 123 | tee >(tr 1 a) >(tr 1 b) >/dev/null\nb23\na23\n tee $...
2008/09/13
[ "https://Stackoverflow.com/questions/60942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4085/" ]
60,950
<p>I find working on the command line in Windows frustrating, primarily because the console window is wretched to use compared to terminal applications on linux and OS X such as "rxvt", "xterm", or "Terminal". Major complaints:</p> <ol> <li><p>No standard copy/paste. You have to turn on "mark" mode and it's only ava...
[ { "answer_id": 60956, "author": "Apocalisp", "author_id": 3434, "author_profile": "https://Stackoverflow.com/users/3434", "pm_score": 5, "selected": false, "text": "xterm" } ]
2008/09/13
[ "https://Stackoverflow.com/questions/60950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4668/" ]
60,977
<p>Sometimes I have to work on code that moves the computer clock forward. In this case some .cpp or .h files get their latest modification date set to the future time.</p> <p>Later on, when my clock is fixed, and I compile my sources, system rebuilds most of the project because some of the latest modification dates a...
[ { "answer_id": 61015, "author": "Nathan Jones", "author_id": 5848, "author_profile": "https://Stackoverflow.com/users/5848", "pm_score": 1, "selected": false, "text": "touch temp\nfind . -newer temp -exec touch {} ;\nrm temp\n" }, { "answer_id": 61105, "author": "Jay Bazuzi",...
2008/09/13
[ "https://Stackoverflow.com/questions/60977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
61,000
<p>I am wondering what directory structure are commonly used in development projects. I mean with the idea of facilitating builds, deploys release, and etc.</p> <p>I recently used a <a href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html" rel="nofollow noreferrer">Maven...
[ { "answer_id": 4540307, "author": "Fernando Barrocal", "author_id": 2274, "author_profile": "https://Stackoverflow.com/users/2274", "pm_score": 4, "selected": true, "text": "/project_name (everything goes here)\n /web (htdocs)\n /img\n /css\n /app (usual...
2008/09/14
[ "https://Stackoverflow.com/questions/61000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2274/" ]
61,002
<p>I'd like to script, preferably in rake, the following actions into a single command:</p> <ol> <li>Get the version of my local git repository.</li> <li>Git pull the latest code.</li> <li>Git diff from the version I extracted in step #1 to what is now in my local repository.</li> </ol> <p>In other words, I want to g...
[ { "answer_id": 61004, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 4, "selected": false, "text": "git fetch\ngit diff ...origin\n git pull" }, { "answer_id": 61477, "author": "Greg", "author_id": 108, ...
2008/09/14
[ "https://Stackoverflow.com/questions/61002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4061/" ]
61,005
<p>What are the best file permission settings for PHP scripts? Any suggestions on ways to figure out the minimum required permissions?</p>
[ { "answer_id": 61004, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 4, "selected": false, "text": "git fetch\ngit diff ...origin\n git pull" }, { "answer_id": 61477, "author": "Greg", "author_id": 108, ...
2008/09/14
[ "https://Stackoverflow.com/questions/61005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/814/" ]
61,033
<p>I've got a table of URLs and I don't want any duplicate URLs. How do I check to see if a given URL is already in the table using PHP/MySQL?</p>
[ { "answer_id": 61035, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": -1, "selected": false, "text": "SELECT url FROM urls WHERE url = 'http://asdf.com' LIMIT 1\n" }, { "answer_id": 61036, "author": "roman m", ...
2008/09/14
[ "https://Stackoverflow.com/questions/61033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6305/" ]
61,051
<p>You can use more than one css class in an HTML tag in current web browsers, e.g.:</p> <pre><code>&lt;div class="style1 style2 style3"&gt;foo bar&lt;/div&gt; </code></pre> <p>This hasn't always worked; with which versions did the major browsers begin correctly supporting this feature?</p>
[ { "answer_id": 61414, "author": "Bryan M.", "author_id": 4636, "author_profile": "https://Stackoverflow.com/users/4636", "pm_score": 4, "selected": true, "text": "<div class=\"bold italic\">content</div>\n\n.bold {\n font-weight: 800;\n}\n\n.italic {\n font-style: italic;\n{\n .bold.it...
2008/09/14
[ "https://Stackoverflow.com/questions/61051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3283/" ]
61,052
<p>I need to know the application's ProductCode in the Installer.OnCommitted callback. There doesn't seem to be an obvious way of determining this.</p>
[ { "answer_id": 61298, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "string productCode = (string)Context.Parameters[\"productcode\"];\n" }, { "answer_id": 67385558, "author": "aolszow...
2008/09/14
[ "https://Stackoverflow.com/questions/61052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
61,084
<p>I'm trying to create a sitemap using Linq to Xml, but am getting an empty namespace attribute, which I would like to get rid of. e.g.</p> <pre><code>XNamespace ns = "http://www.sitemaps.org/schemas/sitemap/0.9"; XDocument xdoc = new XDocument(new XDeclaration("1.0", "utf-8", "true"), new XElement(ns + "urlset"...
[ { "answer_id": 61141, "author": "Micah", "author_id": 6209, "author_profile": "https://Stackoverflow.com/users/6209", "pm_score": 6, "selected": true, "text": "XDocument xdoc = new XDocument(new XDeclaration(\"1.0\", \"utf-8\", \"true\"),\nnew XElement(ns + \"urlset\",\nnew XElement(ns +...
2008/09/14
[ "https://Stackoverflow.com/questions/61084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4449/" ]
61,085
<p>I've been trying to use SQLite with the PDO wrapper in PHP with mixed success. I can read from the database fine, but none of my updates are being committed to the database when I view the page in the browser. Curiously, running the script from my shell does update the database. I suspected file permissions as the c...
[ { "answer_id": 61102, "author": "Tom Martin", "author_id": 5303, "author_profile": "https://Stackoverflow.com/users/5303", "pm_score": 1, "selected": false, "text": "echo exec('whoami');" }, { "answer_id": 3470364, "author": "paolo_O", "author_id": 418707, "author_pro...
2008/09/14
[ "https://Stackoverflow.com/questions/61085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658/" ]
61,088
<p><strong>What "Hidden Features" of JavaScript do you think every programmer should know?</strong></p> <p>After having seen the excellent quality of the answers to the following questions I thought it was time to ask it for JavaScript.</p> <ul> <li><a href="https://stackoverflow.com/questions/954327/">Hidden Feature...
[ { "answer_id": 61094, "author": "Gulzar Nazim", "author_id": 4337, "author_profile": "https://Stackoverflow.com/users/4337", "pm_score": 8, "selected": false, "text": "var passFunAndApply = function (fn,x,y,z) { return fn(x,y,z); };\n\nvar sum = function(x,y,z) {\n return x+y+z;\n};\n\n...
2008/09/14
[ "https://Stackoverflow.com/questions/61088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2443/" ]
61,092
<p>Having read the threads <a href="https://stackoverflow.com/questions/60919/is-sqlcommanddispose-enough">Is SqlCommand.Dispose enough?</a> and <a href="https://stackoverflow.com/questions/23867/closing-and-disposing-a-wcf-service">Closing and Disposing a WCF Service</a> I am wondering for classes such as SqlConnectio...
[ { "answer_id": 61096, "author": "Curt Hagenlocher", "author_id": 533, "author_profile": "https://Stackoverflow.com/users/533", "pm_score": 4, "selected": false, "text": "SqlConnection Dispose() Close() Stream.Dispose()" }, { "answer_id": 61131, "author": "Brannon", "autho...
2008/09/14
[ "https://Stackoverflow.com/questions/61092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5086/" ]
61,109
<p>I have been learning C++ for a while now, I find it very powerful. But, the problem is the the level of abstraction is not much and I have to do memory management myself. What are the languages that I can use which uses a higher level of abstraction.</p>
[ { "answer_id": 12147944, "author": "mikera", "author_id": 214010, "author_profile": "https://Stackoverflow.com/users/214010", "pm_score": 1, "selected": false, "text": ";; treat a vector as a sequence and reverse it\n(reverse [1 2 3 4 5])\n=> (5 4 3 2 1)\n\n;; Take 10 items from a infini...
2008/09/14
[ "https://Stackoverflow.com/questions/61109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6323/" ]
61,110
<p>I need advice on how to have my C# console application display text to the user through the standard output while still being able access it later on. The actual feature I would like to implement is to dump the entire output buffer to a text file at the end of program execution.</p> <p>The workaround I use while I ...
[ { "answer_id": 61119, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 3, "selected": false, "text": "MultiWriter TextWriter" }, { "answer_id": 61123, "author": "Shog9", "author_id": 811, "author_profile...
2008/09/14
[ "https://Stackoverflow.com/questions/61110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4850/" ]
61,143
<p>Can someone show me how to implement a recursive lambda expression to traverse a tree structure in C#. </p>
[ { "answer_id": 61149, "author": "DevelopingChris", "author_id": 1220, "author_profile": "https://Stackoverflow.com/users/1220", "pm_score": 1, "selected": false, "text": " public void HandleTreeItems(Action<TreeItem> item, TreeItem parent)\n {\n if (parent.Children.Count > 0...
2008/09/14
[ "https://Stackoverflow.com/questions/61143", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5360/" ]
61,150
<p>My motto for Java is "just because Java has static blocks, it doesn't mean that you should be using them." Jokes aside, there are a lot of tricks in Java that make testing a nightmare. Two of the most I hate are Anonymous Classes and Static Blocks. We have a lot of legacy code that make use of Static Blocks and thes...
[ { "answer_id": 61153, "author": "Justin Standard", "author_id": 92, "author_profile": "https://Stackoverflow.com/users/92", "pm_score": 3, "selected": false, "text": "staticInit()" }, { "answer_id": 61190, "author": "marcospereira", "author_id": 4600, "author_profile"...
2008/09/14
[ "https://Stackoverflow.com/questions/61150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3087/" ]
61,151
<p>If you're writing a library, or an app, where do the unit test files go? </p> <p>It's nice to separate the test files from the main app code, but it's awkward to put them into a "tests" subdirectory inside of the app root directory, because it makes it harder to import the modules that you'll be testing. </p> <p...
[ { "answer_id": 61169, "author": "Cristian", "author_id": 680, "author_profile": "https://Stackoverflow.com/users/680", "pm_score": 6, "selected": false, "text": "parent_dir/\n foo.py\n tests/\n" }, { "answer_id": 61531, "author": "John Millikin", "author_id": 3560, ...
2008/09/14
[ "https://Stackoverflow.com/questions/61151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
61,155
<p>I'm trying to place this menu on the left hand side of the page:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="left-menu" style="left: 123px; top: 355...
[ { "answer_id": 61200, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 4, "selected": true, "text": "float px em % <div style=\"width: 10em; float: left;\">Left</div>\n<div>Right, spanning<br/> multiple lines</div>\n mar...
2008/09/14
[ "https://Stackoverflow.com/questions/61155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4298/" ]
61,176
<p>I want to access messages in Gmail from a Java application using <a href="http://www.ing.iac.es/~docs/external/java/javamail/javadocs/index.html" rel="nofollow noreferrer">JavaMail</a> and <a href="https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol" rel="nofollow noreferrer">IMAP</a>. Why am I getting a ...
[ { "answer_id": 61185, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 3, "selected": false, "text": "imaps SSLNOTES.txt imaps://username%40gmail.com@imap.gmail.com/INBOX smtps smtps://username%40gmail.com@smtp.gmail.com/ SSLNO...
2008/09/14
[ "https://Stackoverflow.com/questions/61176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2512222/" ]
61,212
<p>How do I delete untracked local files from the current working tree?</p>
[ { "answer_id": 61214, "author": "Fire Lancer", "author_id": 6266, "author_profile": "https://Stackoverflow.com/users/6266", "pm_score": 9, "selected": false, "text": "git-clean" }, { "answer_id": 64966, "author": "Community", "author_id": -1, "author_profile": "https:...
2008/09/14
[ "https://Stackoverflow.com/questions/61212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
61,217
<p>This question is a follow up to my <a href="https://stackoverflow.com/questions/56279/export-aspx-to-html">previous question</a> about getting the HTML from an ASPX page. I decided to try using the webclient object, but the problem is that I get the login page's HTML because login is required. I tried "logging in" u...
[ { "answer_id": 61231, "author": "NakedBrunch", "author_id": 3742, "author_profile": "https://Stackoverflow.com/users/3742", "pm_score": 2, "selected": false, "text": "WebClient ww = new WebClient();\nww.Credentials = CredentialCache.DefaultCredentials;\nww.DownloadString(\"Login.aspx?Use...
2008/09/14
[ "https://Stackoverflow.com/questions/61217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278/" ]
61,219
<p>I've just started skimming 'Debugging MS .Net 2.0 Applications' by John Robbins, and have become confused by his evangelism for Debug.Assert(...).</p> <p>He points out that well-implemented Asserts store the state, somewhat, of an error condition, e.g.:</p> <pre><code>Debug.Assert(i &gt; 3, "i &gt; 3", "This means...
[ { "answer_id": 61225, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 7, "selected": true, "text": "ArgumentOutOfRangeException" }, { "answer_id": 61266, "author": "hwiechers", "author_id": 5883, "author_pr...
2008/09/14
[ "https://Stackoverflow.com/questions/61219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6004/" ]
61,227
<p>If I have: </p> <pre><code>signed char * p; </code></pre> <p>and I do a comparison:</p> <pre><code>if ( *p == 0xFF ) break; </code></pre> <p>it will never catch 0XFF, but if I replace it with -1 it will:</p> <pre><code>if ( *p == (signed char)0xFF ) break; </code></pre> <p>How can this happen? Is it some...
[ { "answer_id": 61229, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 6, "selected": true, "text": "0xFF *p int if( -1 == 255 ) break;\n (signed char)0xFF if( -1 == -1 ) break;\n int signed char" } ]
2008/09/14
[ "https://Stackoverflow.com/questions/61227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2566/" ]
61,233
<p>What is the best way to shred XML data into various database columns? So far I have mainly been using the nodes and value functions like so:</p> <pre><code>INSERT INTO some_table (column1, column2, column3) SELECT Rows.n.value('(@column1)[1]', 'varchar(20)'), Rows.n.value('(@column2)[1]', 'nvarchar(100)'), Rows.n.v...
[ { "answer_id": 61246, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 2, "selected": false, "text": "INSERT INTO Test\nSELECT Id, Data \nFROM OPENXML (@XmlDocument, '/Root/blah',2)\nWITH (Id int '@ID',\n Data varcha...
2008/09/14
[ "https://Stackoverflow.com/questions/61233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5769/" ]
61,262
<p>Here's the problem, you include multiple assemblies and add 'using namespaceX' at the top of your code file.<br> Now you want to create a class or use a symbol which is defined in multiple namespaces, e.g. <code>System.Windows.Controls.Image</code> &amp; <code>System.Drawing.Image</code></p> <p>Now unless you use ...
[ { "answer_id": 61264, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 6, "selected": true, "text": "using System.Windows.Controls;\nusing Drawing = System.Drawing;\n\n...\n\nImage img = ... //System.Windows.Controls.Image\nDrawing...
2008/09/14
[ "https://Stackoverflow.com/questions/61262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695/" ]
61,278
<p>What method do you use when you want to get performance data about specific code paths?</p>
[ { "answer_id": 61279, "author": "Motti", "author_id": 3848, "author_profile": "https://Stackoverflow.com/users/3848", "pm_score": 5, "selected": true, "text": "#pragma once\n#include <tchar.h>\n#include <windows.h>\n#include <sstream>\n#include <boost/noncopyable.hpp>\n\nnamespace scope_...
2008/09/14
[ "https://Stackoverflow.com/questions/61278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3848/" ]
61,307
<p>I have a VB.net test application that clicks a link that opens the Microsoft Word application window and displays the document. How do I locate the Word application window so that I can grab some text from it?</p>
[ { "answer_id": 61279, "author": "Motti", "author_id": 3848, "author_profile": "https://Stackoverflow.com/users/3848", "pm_score": 5, "selected": true, "text": "#pragma once\n#include <tchar.h>\n#include <windows.h>\n#include <sstream>\n#include <boost/noncopyable.hpp>\n\nnamespace scope_...
2008/09/14
[ "https://Stackoverflow.com/questions/61307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2665/" ]
61,320
<p>SVN in Eclipse is spread into two camps. The SVN people have developed a plugin called <a href="http://subclipse.tigris.org/" rel="noreferrer">Subclipse</a>. The Eclipse people have a plugin called <a href="http://www.eclipse.org/subversive/" rel="noreferrer">Subversive</a>. Broadly speaking they both do the same th...
[ { "answer_id": 4215210, "author": "Rahel Lüthy", "author_id": 57448, "author_profile": "https://Stackoverflow.com/users/57448", "pm_score": 2, "selected": false, "text": "bugtraq bugtraq:label BUGID bugtraq:url" }, { "answer_id": 8433757, "author": "Yinch", "author_id": 1...
2008/09/14
[ "https://Stackoverflow.com/questions/61320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3408/" ]
61,339
<p>I am trying to retrieve a user on Sharepoint's user photo through the WSS 3.0 object model. I have been browsing the web for solutions, but so far I've been unable to find a way to do it. Is it possible, and if so how?</p>
[ { "answer_id": 61452, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "public override void ItemAdded(SPItemEventProperties properties)\n{\n // Get list item on which the event occurred.\n SPL...
2008/09/14
[ "https://Stackoverflow.com/questions/61339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
61,341
<p>I remember back in the day with the old borland DOS compiler you could do something like this:</p> <pre><code>asm { mov ax,ex etc etc... } </code></pre> <p>Is there a semi-platform independent way to do this now? I have a need to make a BIOS call, so if there was a way to do this without asm code, that would be ...
[ { "answer_id": 61344, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 3, "selected": false, "text": "#include <stdio.h>\n\n\nint main() {\n /* Add 10 and 20 and store result into register %eax */\n __asm__ ( \"movl $10, %ea...
2008/09/14
[ "https://Stackoverflow.com/questions/61341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6062/" ]
61,354
<p>I was just working on fixing up exception handling in a .NET 2.0 app, and I stumbled onto some weird issue with <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.application.threadexception.aspx" rel="nofollow noreferrer">Application.ThreadException</a>.</p> <p>What I want is to be able to catch...
[ { "answer_id": 61647, "author": "Leo Moore", "author_id": 6336, "author_profile": "https://Stackoverflow.com/users/6336", "pm_score": -1, "selected": false, "text": " Public Overridable Function GetBaseException() As Exception\n Dim innerException As Exception = Me.InnerExcepti...
2008/09/14
[ "https://Stackoverflow.com/questions/61354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5422/" ]
61,357
<p>Should I still be using tables anyway?</p> <p>The table code I'd be replacing is:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt;Name&lt;/td&gt;&lt;td&gt;Value&lt;/td&gt; &lt;/tr&gt; ... &lt;/table&gt; </code></pre> <p>From what I've been reading I should have something like</p> <pre><code...
[ { "answer_id": 61360, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 3, "selected": false, "text": "<dl> and <dt> <td>" }, { "answer_id": 61362, "author": "macbirdie", "author_id": 5049, "author_profile": "ht...
2008/09/14
[ "https://Stackoverflow.com/questions/61357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1122/" ]
61,366
<p>This question is slightly related to <a href="https://stackoverflow.com/questions/61354/how-to-get-entire-chain-of-exceptions-in-applicationthreadexception-event-handl">this question about exception handling</a>. The workaround I found there consists of rolling my own message loop.</p> <p>So my Main method now look...
[ { "answer_id": 61393, "author": "ima", "author_id": 5733, "author_profile": "https://Stackoverflow.com/users/5733", "pm_score": 2, "selected": false, "text": "Thread.Sleep(100);\n" } ]
2008/09/14
[ "https://Stackoverflow.com/questions/61366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5422/" ]
61,372
<p>I want to write an <code>onClick</code> event which submits a form several times, iterating through selected items in a multi-select field, submitting once for each. </p> <p><strong>How do I code the loop?</strong></p> <p>I'm working in Ruby on Rails and using <code>remote_function()</code> to generate the JavaSc...
[ { "answer_id": 61651, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 2, "selected": false, "text": "<%= javascript_include_tag 'prototype' %>\n\n<form id=\"my-form\">\n <input type=\"text\" name=\"username\" />\n\n <sel...
2008/09/14
[ "https://Stackoverflow.com/questions/61372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3764/" ]
61,383
<p>My current project is in Rails. Coming from a Symfony (PHP) and Django (Python) background, they both have excellent admin generators. Seems like this is missing in Rails.</p> <p>For those who aren't familiar with Symfony or Django, they both allow you to specify some metadata around your models to automatically ...
[ { "answer_id": 62410, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "./script/generate scaffold_resource MyModel property:type property2:type2\n" }, { "answer_id": 17062194, "author": ...
2008/09/14
[ "https://Stackoverflow.com/questions/61383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2884/" ]
61,400
<p>I'm sure most of you are writing lots of automated tests and that you also have run into some common pitfalls when unit testing. </p> <p>My question is do you follow any rules of conduct for writing tests in order to avoid problems in the future? To be more specific: What are the <strong>properties of good unit tes...
[ { "answer_id": 61441, "author": "Jay Bazuzi", "author_id": 5314, "author_profile": "https://Stackoverflow.com/users/5314", "pm_score": 3, "selected": false, "text": "[TestFixture]\npublic class StackTests\n{\n [TestFixture]\n public class EmptyTests\n {\n Stack<int> _stac...
2008/09/14
[ "https://Stackoverflow.com/questions/61400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3713/" ]
61,401
<p>I know this sounds like a point-whoring question but let me explain where I'm coming from.</p> <p>Out of college I got a job at a PHP shop. I worked there for a year and a half and thought that I had learned all there was to learn about programming.</p> <p>Then I got a job as a one-man internal development shop a...
[ { "answer_id": 61403, "author": "George Mauer", "author_id": 5056, "author_profile": "https://Stackoverflow.com/users/5056", "pm_score": 4, "selected": false, "text": "function MyMethod($VarICareAbout, $VarIDontCareAbout = 'yippie') { }\n" }, { "answer_id": 61482, "author": "...
2008/09/14
[ "https://Stackoverflow.com/questions/61401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
61,405
<p>I'm about to start on a large Qt application, which is made up of smaller components (groups of classes that work together). For example, there might be a dialog that is used in the project, but should be developed on its own before being integrated into the project. Instead of working on it in another folder somewh...
[ { "answer_id": 62009, "author": "Jérôme", "author_id": 2796, "author_profile": "https://Stackoverflow.com/users/2796", "pm_score": 6, "selected": true, "text": "/MyWholeApp\n /MyWholeApp/DummyDlg/\n # Input\nFORMS += dummydlg.ui\nHEADERS += dummydlg.h\nSOURCES += dummydlg.cpp\n TEMPLATE ...
2008/09/14
[ "https://Stackoverflow.com/questions/61405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1585/" ]
61,418
<p>I have a function that gives me the following warning:</p> <blockquote> <p>[DCC Warning] filename.pas(6939): W1035 Return value of function 'function' might be undefined</p> </blockquote> <p>The function, however, is clean, small, and does have a known, expected, return value. The first statement in the function...
[ { "answer_id": 61426, "author": "Lars Truijens", "author_id": 1242, "author_profile": "https://Stackoverflow.com/users/1242", "pm_score": 4, "selected": true, "text": "{$WARN NO_RETVAL OFF}\nfunction func(...): string;\nbegin\n ...\nend;\n{$WARN NO_RETVAL ON}\n" }, { "answer_id"...
2008/09/14
[ "https://Stackoverflow.com/questions/61418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/267/" ]
61,421
<p>I'm making an example for someone who hasn't yet realized that controls like <code>ListBox</code> don't have to contain strings; he had been storing formatted strings and jumping through complicated parsing hoops to get the data back out of the <code>ListBox</code> and I'd like to show him there's a better way.</p> ...
[ { "answer_id": 61425, "author": "Quibblesome", "author_id": 1143, "author_profile": "https://Stackoverflow.com/users/1143", "pm_score": 3, "selected": false, "text": "Public Class Form1\n\n Private datasource As New List(Of NumberInfo)\n Private bindingSource As New BindingSource\n...
2008/09/14
[ "https://Stackoverflow.com/questions/61421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2547/" ]
61,443
<p>I have a counter in hardware that I can observe for timing considerations. It counts miliseconds and is stored in a 16 bit unsigned value. How do I safely check if a timer value has passed a certain time and safely handle the inevitable rollover:</p> <pre><code>//this is a bit contrived, but it illustrates what I'm...
[ { "answer_id": 61461, "author": "ReaperUnreal", "author_id": 4218, "author_profile": "https://Stackoverflow.com/users/4218", "pm_score": 1, "selected": false, "text": "const int32 print_interval = 5000;\nstatic int32 last_print_time; // I'm assuming this gets initialized elsewhere\n\nint...
2008/09/14
[ "https://Stackoverflow.com/questions/61443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/445087/" ]
61,446
<p>Particularly, what is the best snippets package out there?</p> <p>Features:</p> <ul> <li>easy to define new snippets (plain text, custom input with defaults)</li> <li>simple navigation between predefined positions in the snippet</li> <li>multiple insertion of the same custom input</li> <li>accepts currently select...
[ { "answer_id": 61447, "author": "jfs", "author_id": 4279, "author_profile": "https://Stackoverflow.com/users/4279", "pm_score": 6, "selected": true, "text": "hippie-expand .emacs YASnippet" }, { "answer_id": 18829042, "author": "gavenkoa", "author_id": 173149, "author...
2008/09/14
[ "https://Stackoverflow.com/questions/61446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4279/" ]
61,449
<p>I've just created a new Windows XP VM on my Mac using VMware Fusion. The VM is using NAT to share the host's internet connection.</p> <p>How do I access a Rails application, which is accessible on the Mac itself using <code>http://localhost:3000</code>?</p>
[ { "answer_id": 61455, "author": "JW.", "author_id": 4321, "author_profile": "https://Stackoverflow.com/users/4321", "pm_score": 8, "selected": true, "text": "ipconfig" }, { "answer_id": 191707, "author": "Richard Poirier", "author_id": 26842, "author_profile": "https:...
2008/09/14
[ "https://Stackoverflow.com/questions/61449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1450/" ]
61,451
<p>Does Django have any template tags to generate common HTML markup? For example, I know that I can get a url using</p> <pre><code>{% url mapper.views.foo %} </code></pre> <p>But that only gives me the URL and not the HTML code to create the link. Does Django have anything similar to Rails' link_to helper? I found <...
[ { "answer_id": 71598, "author": "Ali", "author_id": 11895, "author_profile": "https://Stackoverflow.com/users/11895", "pm_score": -1, "selected": false, "text": "<a href=\"{% url mapper.views.foo %}\">foo</a>" }, { "answer_id": 82175, "author": "zgoda", "author_id": 12138...
2008/09/14
[ "https://Stackoverflow.com/questions/61451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796/" ]
61,456
<p>After trying to avoid JavaScript for years, Iv started using Query for <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" rel="nofollow noreferrer">validation</a> in MVC asp.net, as there does not seem to be an official way of doing validation, Iv been surprised how good jQuery is. </p> <p>Fir...
[ { "answer_id": 66527, "author": "Dane O'Connor", "author_id": 1946, "author_profile": "https://Stackoverflow.com/users/1946", "pm_score": 5, "selected": true, "text": "display:none; $().ready(function() {\n $(\"#CreateLog\").validate({\n errorLabelContainer: $(\"ul\", $('div.error-co...
2008/09/14
[ "https://Stackoverflow.com/questions/61456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230/" ]
61,480
<p>In the past we declared properties like this:</p> <pre><code>public class MyClass { private int _age; public int Age { get{ return _age; } set{ _age = value; } } } </code></pre> <p>Now we can do:</p> <pre><code>public class MyClass { public int Age {get; set;} } </code><...
[ { "answer_id": 61493, "author": "Scott Dorman", "author_id": 1559, "author_profile": "https://Stackoverflow.com/users/1559", "pm_score": 4, "selected": false, "text": "[CompilerGenerated]\nprivate int <Age>k_BackingField;\n\npublic int Age\n{\n [CompilerGenerated]\n get\n {\n ...
2008/09/14
[ "https://Stackoverflow.com/questions/61480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
61,486
<p>I need to figure out what div is visible out of four possible divs using jQuery. Only one of those div's will be visible at any given time.</p> <p>This is what I have that works so far:</p> <pre><code>$("#FeatureImage1:visible, #FeatureImage2:visible, #FeatureImage3:visible, #FeatureImage4:visible").attr("id"); <...
[ { "answer_id": 61500, "author": "Gilean", "author_id": 6305, "author_profile": "https://Stackoverflow.com/users/6305", "pm_score": 5, "selected": true, "text": "$(\"div.myClass:visible\").attr(\"id\");\n" }, { "answer_id": 64390, "author": "Jim", "author_id": 8427, "a...
2008/09/14
[ "https://Stackoverflow.com/questions/61486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/648/" ]
61,517
<p>Do you know if there is a built-in function to build a dictionary from an arbitrary object? I'd like to do something like this:</p> <pre><code>&gt;&gt;&gt; class Foo: ... bar = 'hello' ... baz = 'world' ... &gt;&gt;&gt; f = Foo() &gt;&gt;&gt; props(f) { 'bar' : 'hello', 'baz' : 'world' } </code></pre> <p><...
[ { "answer_id": 61522, "author": "dF.", "author_id": 3002, "author_profile": "https://Stackoverflow.com/users/3002", "pm_score": 6, "selected": false, "text": "dir __str__ __dict__ >>> class Foo(object):\n... bar = 'hello'\n... baz = 'world'\n...\n>>> f = Foo()\n>>> [name for name...
2008/09/14
[ "https://Stackoverflow.com/questions/61517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2148/" ]
61,535
<p>I get a URL from a user. I need to know:<br/> a) is the URL a valid RSS feed?<br/> b) if not is there a valid feed associated with that URL</p> <p>using PHP/Javascript or something similar</p> <p>(Ex. <a href="http://techcrunch.com" rel="nofollow noreferrer">http://techcrunch.com</a> fails a), but b) would return th...
[ { "answer_id": 61537, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 3, "selected": false, "text": "text/html <link>" }, { "answer_id": 61538, "author": "ConroyP", "author_id": 2287, "author_profile"...
2008/09/14
[ "https://Stackoverflow.com/questions/61535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6305/" ]
61,552
<p><a href="http://www.stackoverflow.com/questions/61088/hidden-features-of-javascript#61118">Alan Storm's comments</a> in response to my answer regarding the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with" rel="noreferrer"><code>with</code> statement</a> got me thinking. I'v...
[ { "answer_id": 61566, "author": "Sören Kuklau", "author_id": 1600, "author_profile": "https://Stackoverflow.com/users/1600", "pm_score": 4, "selected": false, "text": "With someObject.Foo = ''\nsomeObject.Bar = ''\nsomeObject.Baz = ''\n With someObject\n .Foo = ''\n .Bar = ''\n ...
2008/09/14
[ "https://Stackoverflow.com/questions/61552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/811/" ]
61,604
<p>Do you often see in API documentation (as in 'javadoc of public functions' for example) the description of "value limits" as well as the classic documentation ?</p> <p><strong>Note:</strong> I am not talking about <a href="https://stackoverflow.com/questions/20922/do-you-comment-your-code">comments within the code<...
[ { "answer_id": 61608, "author": "Fire Lancer", "author_id": 6266, "author_profile": "https://Stackoverflow.com/users/6266", "pm_score": 1, "selected": false, "text": "//File:\n// Should be a path to the teexture file to load, if it is not a full path (eg \"c:\\example.png\") it will atte...
2008/09/14
[ "https://Stackoverflow.com/questions/61604", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6309/" ]
61,605
<p>In python, you can have a function return multiple values. Here's a contrived example:</p> <pre><code>def divide(x, y): quotient = x/y remainder = x % y return quotient, remainder (q, r) = divide(22, 7) </code></pre> <p>This seems very useful, but it looks like it can also be abused ("Well..functio...
[ { "answer_id": 61629, "author": "Jason Etheridge", "author_id": 2193, "author_profile": "https://Stackoverflow.com/users/2193", "pm_score": 5, "selected": false, "text": "q, r = divide(22, 7)\n" }, { "answer_id": 61636, "author": "jfs", "author_id": 4279, "author_prof...
2008/09/14
[ "https://Stackoverflow.com/questions/61605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
61,615
<p>C# and Java allow almost any character in class names, method names, local variables, etc.. Is it bad practice to use non-ASCII characters, testing the boundaries of poor editors and analysis tools and making it difficult for some people to read, or is American arrogance the only argument against?</p>
[ { "answer_id": 61619, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 2, "selected": false, "text": "if toString()" } ]
2008/09/14
[ "https://Stackoverflow.com/questions/61615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4926/" ]
61,634
<p>I'm trying to create a dialog box using C++ and the windows API, but I don't want the dialog defined in a resource file. I can't find anything good on this on the web, and none of the examples I've read seem to define the dialog programmatically.</p> <p>How can I do this?</p> <p>A simple example is fine. I'm not d...
[ { "answer_id": 48009861, "author": "jrh", "author_id": 4975230, "author_profile": "https://Stackoverflow.com/users/4975230", "pm_score": 3, "selected": false, "text": "CreateWindow CreateWindowEx Control TextBox UNICODE _UNICODE UNICODE _UNICODE char* char* SendMessageA // This sample wi...
2008/09/14
[ "https://Stackoverflow.com/questions/61634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1467/" ]
61,669
<p>How do I use the profiler in Visual Studio 2008?</p> <p>I know theres a build option in Config Properties -> Linker -> Advanced -> Profile (/PROFILE), however I can't find anything about actauly using it, only articles I was able to find appear to only apply to older versions of Visual Studio (eg most say to goto B...
[ { "answer_id": 11205196, "author": "Michelle", "author_id": 1482301, "author_profile": "https://Stackoverflow.com/users/1482301", "pm_score": 0, "selected": false, "text": ".vsp .vsp" } ]
2008/09/14
[ "https://Stackoverflow.com/questions/61669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6266/" ]
61,675
<p>I'm reading lines of input on a TCP socket, similar to this:</p> <pre><code>class Bla def getcmd @sock.gets unless @sock.closed? end def start srv = TCPServer.new(5000) @sock = srv.accept while ! @sock.closed? ans = getcmd end end end </code></pre> <p>If the endpoint termi...
[ { "answer_id": 61732, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": -1, "selected": false, "text": "gets recvfrom gets" }, { "answer_id": 64313, "author": "manveru", "author_id": 8367, "author_profile...
2008/09/14
[ "https://Stackoverflow.com/questions/61675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3796/" ]
61,677
<p>Suppose I have a COM object which users can access via a call such as:</p> <pre><code>Set s = CreateObject("Server") </code></pre> <p>What I'd like to be able to do is allow the user to specify an event handler for the object, like so:</p> <pre><code>Function ServerEvent MsgBox "Event handled" End Function ...
[ { "answer_id": 61723, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 2, "selected": false, "text": "IProvideClassInfo ConnectObject" }, { "answer_id": 61762, "author": "Jeff Hillman", "author_id": 395...
2008/09/14
[ "https://Stackoverflow.com/questions/61677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5449/" ]
61,680
<p>I need to create a 2D int array of size 800x800. But doing so creates a stack overflow (ha ha).</p> <p>I'm new to C++, so should I do something like a vector of vectors? And just encapsulate the 2d array into a class?</p> <p>Specifically, this array is my zbuffer in a graphics program. I need to store a z value...
[ { "answer_id": 61684, "author": "Adam Mitz", "author_id": 2574, "author_profile": "https://Stackoverflow.com/users/2574", "pm_score": 5, "selected": true, "text": "int *array = new int[800*800];\n delete[]" }, { "answer_id": 61685, "author": "Niall", "author_id": 6049, ...
2008/09/14
[ "https://Stackoverflow.com/questions/61680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396/" ]
61,688
<p>My current project is to write a web application that is an equivalent of an existing desktop application. </p> <p>In the desktop app at certain points in the workflow the user might click on a button and then be shown a form to fill in. Even if it takes a little time for the app to display the form, expert users...
[ { "answer_id": 61708, "author": "Leo Moore", "author_id": 6336, "author_profile": "https://Stackoverflow.com/users/6336", "pm_score": 0, "selected": false, "text": "<html><head>\n<script language=javascript>\nIE=document.all;\nNN=document.layers;\nkys=\"\";\nif (NN){document.captureEvent...
2008/09/14
[ "https://Stackoverflow.com/questions/61688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2649/" ]
61,691
<p>The .NET Setup project seems to have a lot of options, but I don't see an "Uninstall" option. </p> <p>I'd prefer if people could "uninstall" from the standard "start menu" folder rather than send them to the control panel to uninstall my app, so can someone please tell me how to do this?</p> <p>Also, I am aware o...
[ { "answer_id": 61697, "author": "Mladen Janković", "author_id": 6300, "author_profile": "https://Stackoverflow.com/users/6300", "pm_score": 4, "selected": true, "text": "msiexec /uninstall [path to msi or product code]\n" } ]
2008/09/14
[ "https://Stackoverflow.com/questions/61691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4050/" ]
61,692
<p>I have a Java application which I want to shutdown 'nicely' when the user selects Start->Shutdown. I've tried using JVM shutdown listeners via Runtime.addShutdownHook(...) but this doesn't work as I can't use any UI elements from it.</p> <p>I've also tried using the exit handler on my main application UI window but...
[ { "answer_id": 61697, "author": "Mladen Janković", "author_id": 6300, "author_profile": "https://Stackoverflow.com/users/6300", "pm_score": 4, "selected": true, "text": "msiexec /uninstall [path to msi or product code]\n" } ]
2008/09/14
[ "https://Stackoverflow.com/questions/61692", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1849/" ]
61,699
<p>Until recently we were using Inno Setup for our installations, something I would like to continue doing, unless we can get an <a href="https://stackoverflow.com/questions/61691/how-to-add-uninstall-option-in-net-setup-project">uninstall option in the start menu</a> (thanks Giovanni Galbo), however we now need to GAC...
[ { "answer_id": 1476781, "author": "Lars Truijens", "author_id": 1242, "author_profile": "https://Stackoverflow.com/users/1242", "pm_score": 4, "selected": true, "text": "* Added new [Files] section flag: gacinstall.\n* Added new [Files] section parameter: StrongAssemblyName.\n* Added new...
2008/09/14
[ "https://Stackoverflow.com/questions/61699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5302/" ]
61,718
<p>When you are doing integration tests with either just your data access layer or the majority of the application stack. What is the best way prevent multiple tests from clashing with each other if they are run on the same database?</p>
[ { "answer_id": 61721, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 4, "selected": true, "text": "Load all fixture data.\n\nFor each test:\n\n BEGIN TRANSACTION\n\n # Yield control to user code\n\n ROLLBACK TRANSACT...
2008/09/14
[ "https://Stackoverflow.com/questions/61718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6369/" ]
61,733
<p>Which of the following is better code in c# and why?</p> <pre><code>((DateTime)g[0]["MyUntypedDateField"]).ToShortDateString() </code></pre> <p>or</p> <pre><code>DateTime.Parse(g[0]["MyUntypedDateField"].ToString()).ToShortDateString() </code></pre> <p>Ultimately, is it better to cast or to parse?</p>
[ { "answer_id": 62619, "author": "Steve Cooper", "author_id": 6722, "author_profile": "https://Stackoverflow.com/users/6722", "pm_score": 1, "selected": false, "text": "DateTime.TryParse() ToShortDateString() private DateTime ParseDateTime(object data)\n{\n if (data is DateTime)\n {...
2008/09/14
[ "https://Stackoverflow.com/questions/61733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4246/" ]
61,735
<p>What is the best method for including a CSS or Javascript file for a specific node in Drupal 6.</p> <p>I want to create a page on my site that has a little javascript application running, so the CSS and javascript is specific to that page and would not want to be included in other page loads at all.</p>
[ { "answer_id": 61798, "author": "ceejayoz", "author_id": 1902010, "author_profile": "https://Stackoverflow.com/users/1902010", "pm_score": 2, "selected": false, "text": "function mymodule_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {\n // the node ID of the node you want to modify\n $...
2008/09/14
[ "https://Stackoverflow.com/questions/61735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6277/" ]
61,739
<p>I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl:</p> <pre><code>DrawFrameControl(dc, &amp;rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO); </code></pre> <p>I've never been able to figure out a sure fire...
[ { "answer_id": 124770, "author": "Brannon", "author_id": 5745, "author_profile": "https://Stackoverflow.com/users/5745", "pm_score": 2, "selected": false, "text": "GetSystemMetrics" } ]
2008/09/14
[ "https://Stackoverflow.com/questions/61739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3655/" ]
61,747
<p>How can I get PDO to work on my mac (os x 10.5)? I'm using the built in php and php in Zend/Eclipse. Can't seem to find useful drivers for it at all.</p>
[ { "answer_id": 1286153, "author": "hbw", "author_id": 90155, "author_profile": "https://Stackoverflow.com/users/90155", "pm_score": 6, "selected": true, "text": "$ pecl download pdo_pgsql\n$ tar xzf PDO_PGSQL-1.0.2.tgz\n pecl sudo pecl $ cd PDO_PGSQL-1.0.2\n$ phpize\n$ ./configure --with...
2008/09/15
[ "https://Stackoverflow.com/questions/61747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6371/" ]
61,750
<p>Task: implement paging of database records suitable for different RDBMS. Method should work for mainstream engines - MSSQL2000+, Oracle, MySql, etc.</p> <p>Please don't post RDBMS specific solutions, I know how to implement this for most of the modern database engines. I'm looking for the universal solution. Only t...
[ { "answer_id": 61757, "author": "jodonnell", "author_id": 4223, "author_profile": "https://Stackoverflow.com/users/4223", "pm_score": 0, "selected": false, "text": "Query q = ...;\nq.setFirstResult (0);\nq.setMaxResults (10);\n" }, { "answer_id": 61985, "author": "aku", "...
2008/09/15
[ "https://Stackoverflow.com/questions/61750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1196/" ]
61,805
<p>I had a working solution using ASP.NET MVC Preview 3 (was upgraded from a Preview 2 solution) that uses an untyped ViewMasterPage like so:</p> <pre><code>public partial class Home : ViewMasterPage </code></pre> <p>On Home.Master there is a display statement like this:</p> <pre><code>&lt;%= ((GenericViewData)ViewD...
[ { "answer_id": 61835, "author": "Ricky", "author_id": 653, "author_profile": "https://Stackoverflow.com/users/653", "pm_score": 0, "selected": false, "text": "ViewData[\"CategoryName\"] = a.Name;\n <%= ViewData[\"CategoryName\"] %>\n" } ]
2008/09/15
[ "https://Stackoverflow.com/questions/61805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364/" ]
61,817
<p>I am wondering what the best way to obtain the current domain is in ASP.NET?</p> <p>For instance:</p> <p><a href="http://www.domainname.com/subdir/" rel="noreferrer">http://www.domainname.com/subdir/</a> should yield <a href="http://www.domainname.com" rel="noreferrer">http://www.domainname.com</a> <a href="http:/...
[ { "answer_id": 61819, "author": "Matt Mitchell", "author_id": 364, "author_profile": "https://Stackoverflow.com/users/364", "pm_score": 5, "selected": false, "text": "Request.Url.Scheme + System.Uri.SchemeDelimiter + Request.Url.Host \n int defaultPort = Request.IsSecureConnection ? 443 ...
2008/09/15
[ "https://Stackoverflow.com/questions/61817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364/" ]
61,838
<p>If I have something like a UILabel linked to a xib file, do I need to release it on dealloc of my view? The reason I ask is because I don't alloc it, which makes me think I don't need to release it either? eg (in the header):</p> <pre><code>IBOutlet UILabel *lblExample; </code></pre> <p>in the implementation:</p> ...
[ { "answer_id": 61867, "author": "Kendall Helmstetter Gelner", "author_id": 6330, "author_profile": "https://Stackoverflow.com/users/6330", "pm_score": 0, "selected": false, "text": "@property (nonatomic, retain) UILabel *lblExample;\n" }, { "answer_id": 191935, "author": "mma...
2008/09/15
[ "https://Stackoverflow.com/questions/61838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6044/" ]
61,861
<p>I would like to make my web control more readable in design mode, basically I want the tag declaration to look like:</p> <pre><code>&lt;cc1:Ctrl ID="Value1" runat="server"&gt; &lt;Values&gt;string value 1&lt;/Value&gt; &lt;Values&gt;string value 2&lt;/Value&gt; &lt;/cc1:Ctrl&gt; </code></pre> <p>...
[ { "answer_id": 61925, "author": "Matt", "author_id": 4154, "author_profile": "https://Stackoverflow.com/users/4154", "pm_score": 0, "selected": false, "text": " <asp:ListBox ID=\"ListBox1\" runat=\"server\">\n <asp:ListItem>String 1</asp:ListItem>\n <asp:ListItem>String ...
2008/09/15
[ "https://Stackoverflow.com/questions/61861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2758/" ]
61,872
<p>We are rewriting our legacy <a href="https://en.wikipedia.org/wiki/Accounting_information_system" rel="nofollow noreferrer">accounting system</a> in VB.NET and SQL Server. We brought in a new team of .NET/ SQL Programmers to do the rewrite. Most of the system is already completed with the dollar amounts using floats...
[ { "answer_id": 62071, "author": "Keith", "author_id": 905, "author_profile": "https://Stackoverflow.com/users/905", "pm_score": 3, "selected": false, "text": "money" }, { "answer_id": 62493, "author": "David T. Macknet", "author_id": 6850, "author_profile": "https://S...
2008/09/15
[ "https://Stackoverflow.com/questions/61872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4964/" ]
61,882
<p>In a typical handheld/portable embedded system device Battery life is a major concern in design of H/W, S/W and the features the device can support. From the Software programming perspective, one is aware of MIPS, Memory(Data and Program) optimized code. I am aware of the H/W Deep sleep mode, Standby mode that are u...
[ { "answer_id": 61912, "author": "macbirdie", "author_id": 5049, "author_profile": "https://Stackoverflow.com/users/5049", "pm_score": 5, "selected": false, "text": "1800 INFORMATION" } ]
2008/09/15
[ "https://Stackoverflow.com/questions/61882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2759376/" ]
61,888
<p>Is it possible to use <a href="http://subversion.apache.org/" rel="noreferrer">Apache Subversion</a> (SVN) as general purpose backup tool? (As a kind of <a href="http://en.wikipedia.org/wiki/Rsync" rel="noreferrer">rsync</a> alternative.)</p>
[ { "answer_id": 15548768, "author": "user2195264", "author_id": 2195264, "author_profile": "https://Stackoverflow.com/users/2195264", "pm_score": 1, "selected": false, "text": "cd svnauto #!/bin/sh\nexport LANG=en_US.UTF-8 && cd /my/directory && echo Starting backup $(date) > /root/backup...
2008/09/15
[ "https://Stackoverflow.com/questions/61888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1897/" ]