qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
35,700
<p>What things should be kept most in mind when writing cross-platform applications in C? Targeted platforms: 32-bit Intel based PC, Mac, and Linux. I'm especially looking for the type of versatility that Jungle Disk has in their USB desktop edition ( <a href="http://www.jungledisk.com/desktop/download.aspx" rel="noref...
[ { "answer_id": 372091, "author": "flolo", "author_id": 36472, "author_profile": "https://Stackoverflow.com/users/36472", "pm_score": 0, "selected": false, "text": "int c;\nfread(&c, sizeof(int), 1, file);\n" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/35700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/356/" ]
35,743
<p>According to <a href="http://msdn.microsoft.com/en-us/library/bb386454.aspx" rel="noreferrer">Microsoft</a> the FileUpload control is not compatible with an AJAX UpdatePanel. </p> <p>I am aware that a PostBackTrigger can be added to the submit button of the form like this:</p> <pre><code>&lt;Triggers&gt; &lt;asp...
[ { "answer_id": 36859, "author": "palotasb", "author_id": 3063, "author_profile": "https://Stackoverflow.com/users/3063", "pm_score": 2, "selected": false, "text": "AJAX HTML iframe" }, { "answer_id": 217722, "author": "user10859", "author_id": 10859, "author_profile":...
2008/08/30
[ "https://Stackoverflow.com/questions/35743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3677/" ]
35,753
<p>Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). </p> <p>Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you...
[ { "answer_id": 35759, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 4, "selected": false, "text": "assert" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/35753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3373/" ]
35,785
<p>What is the Java analogue of .NET's XML serialization?</p>
[ { "answer_id": 4067429, "author": "so_mv", "author_id": 186858, "author_profile": "https://Stackoverflow.com/users/186858", "pm_score": 4, "selected": false, "text": "FREE Simple" }, { "answer_id": 18681762, "author": "Mishax", "author_id": 1766655, "author_profile": ...
2008/08/30
[ "https://Stackoverflow.com/questions/35785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3583/" ]
35,805
<p>If I create a class <code>A</code> as follows:</p> <pre><code>class A: def __init__(self): self.name = 'A' </code></pre> <p>Inspecting the <code>__dict__</code> member looks like <code>{'name': 'A'}</code></p> <p>If however I create a class <code>B</code>:</p> <pre><code>class B: name = 'B' </cod...
[ { "answer_id": 35823, "author": "Carl Meyer", "author_id": 3207, "author_profile": "https://Stackoverflow.com/users/3207", "pm_score": 7, "selected": true, "text": "B.name B.__dict__ b = B(); b.__dict__ b.name B.name" }, { "answer_id": 39755, "author": "Tendayi Mawushe", ...
2008/08/30
[ "https://Stackoverflow.com/questions/35805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154/" ]
35,817
<p>When using os.system() it's often necessary to escape filenames and other arguments passed as parameters to commands. How can I do this? Preferably something that would work on multiple operating systems/shells but in particular for bash.</p> <p>I'm currently doing the following, but am sure there must be a libra...
[ { "answer_id": 35857, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 8, "selected": true, "text": "def shellquote(s):\n return \"'\" + s.replace(\"'\", \"'\\\\''\") + \"'\"\n" }, { "answer_id": 35858, "autho...
2008/08/30
[ "https://Stackoverflow.com/questions/35817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3715/" ]
35,837
<p>I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences between hg and git.</p> <p>Has anyone made a side-by-side comparison bet...
[ { "answer_id": 892688, "author": "Martin Geisler", "author_id": 110204, "author_profile": "https://Stackoverflow.com/users/110204", "pm_score": 8, "selected": false, "text": "git-instaweb.sh git fetch <project-to-union-merge>\nGIT_INDEX_FILE=.git/tmp-index git-read-tree FETCH_HEAD\nGIT_I...
2008/08/30
[ "https://Stackoverflow.com/questions/35837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3713/" ]
35,842
<p>How do I get the id of my Java process? </p> <p>I know there are several platform-dependent hacks, but I would prefer a more generic solution.</p>
[ { "answer_id": 35885, "author": "Wouter Coekaerts", "author_id": 3432, "author_profile": "https://Stackoverflow.com/users/3432", "pm_score": 10, "selected": true, "text": "ManagementFactory.getRuntimeMXBean().getName() \"12345@hostname\" 12345 long pid = ProcessHandle.current().pid();\n"...
2008/08/30
[ "https://Stackoverflow.com/questions/35842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3583/" ]
35,848
<p>I have a VB6.0 project and I want to convert it in VB.Net.</p> <p>In my VB6.0 application some of the MDI Child form’s height is 17000 and width is 13000. Now I want to set the same form size in VB.Net forms, but it allows maximum form width = 1036, height = 780 for resolution 1024x768.</p> <p>How can I increase f...
[ { "answer_id": 154479, "author": "Eduardo Molteni", "author_id": 2385, "author_profile": "https://Stackoverflow.com/users/2385", "pm_score": 1, "selected": false, "text": "Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load\n Me.Heigh...
2008/08/30
[ "https://Stackoverflow.com/questions/35848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2528/" ]
35,849
<p>So we've discussed logging in passing at my place of work and I was wondering if some of you guys here could give me some ideas of your approaches?</p> <p>Typically our scenario is, no logging really at all, and mostly .NET apps, winforms/WPF clients talking through web services or direct to a db.</p> <p>So, the r...
[ { "answer_id": 35875, "author": "Tristan Juricek", "author_id": 3436, "author_profile": "https://Stackoverflow.com/users/3436", "pm_score": 1, "selected": false, "text": "info(\"waaah\") warning(\"waah\")" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/35849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3717/" ]
35,870
<p>I have a list of more than 15 thousand latitude and longitude coordinates. Given any X,Y coordinates, what is the fastest way to find the closest coordinates on the list?</p>
[ { "answer_id": 35946, "author": "Jeremy", "author_id": 3657, "author_profile": "https://Stackoverflow.com/users/3657", "pm_score": 3, "selected": false, "text": "select *\n from dealers\n where latitude >= minlat\n and latitude <= maxlat\n and longitude >= minlong\n ...
2008/08/30
[ "https://Stackoverflow.com/questions/35870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3725/" ]
35,879
<p>I am building an open search add-on for Firefox/IE and the image needs to be Base64 Encoded so how can I base 64 encode the favicon I have?</p> <p>I am only familiar with PHP</p>
[ { "answer_id": 35891, "author": "Ross", "author_id": 2025, "author_profile": "https://Stackoverflow.com/users/2025", "pm_score": 7, "selected": true, "text": " <?php\n $im = file_get_contents('filename.gif');\n $imdata = base64_encode($im); \n?> \n <img width=\"16\" he...
2008/08/30
[ "https://Stackoverflow.com/questions/35879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115/" ]
35,896
<p>Is there a portable, not patent-restricted way to play compressed sound files in C# / .Net? I want to play short "jingle" sounds on various events occuring in the program.</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.media.soundplayer.aspx" rel="noreferrer">System.Media.SoundPlayer</a> can handle ...
[ { "answer_id": 36050, "author": "skolima", "author_id": 3205, "author_profile": "https://Stackoverflow.com/users/3205", "pm_score": 4, "selected": true, "text": "System.Media.SoundPlayer using (var file = new FileStream(oggFilename, FileMode.Open, FileAccess.Read))\n{\n var player = new...
2008/08/30
[ "https://Stackoverflow.com/questions/35896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3205/" ]
35,905
<p>I've created a few <code>autorun</code> script files on various USB devices that run <code>bash</code> scripts when they mount. These scripts run "in the background", how do I get them to run in a terminal window? (Like the "Application in Terminal" gnome Launcher type.)</p>
[ { "answer_id": 35924, "author": "Vagnerr", "author_id": 3720, "author_profile": "https://Stackoverflow.com/users/3720", "pm_score": 4, "selected": true, "text": "gnome-terminal -e top --title Testing\n" }, { "answer_id": 35925, "author": "Steve Moon", "author_id": 3660, ...
2008/08/30
[ "https://Stackoverflow.com/questions/35905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3715/" ]
35,914
<p>Here's the situation: I am trying to launch an application, but the location of the .exe isn't known to me. Now, if the file extension is registered (in Windows), I can do something like:</p> <pre><code>Process.Start("Sample.xls"); </code></pre> <p>However, I need to pass some command line arguments as well. I c...
[ { "answer_id": 35930, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 3, "selected": true, "text": "Process.Start" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/35914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2258/" ]
35,922
<p>I've played around with GTK, TK, wxPython, Cocoa, curses and others. They are are fairly horrible to use.. GTK/TK/wx/curses all seem to basically be direct-ports of the appropriate C libraries, and Cocoa basically mandates using both PyObjC and Interface Builder, both of which I dislike..</p> <p>The Shoes GUI libra...
[ { "answer_id": 106696, "author": "Ed Leafe", "author_id": 19399, "author_profile": "https://Stackoverflow.com/users/19399", "pm_score": 4, "selected": false, "text": "obj.BackColor = \"red\"\nobj.BackColor = (255, 0, 0)\nobj.BackColor = \"FF0000\"\nobj.BackColor = \"#FF0000\"\n" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/35922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745/" ]
35,948
<p>I'm using Google App Engine and Django templates.<br> I have a table that I want to display the objects look something like:<br></p> <pre><code>Object Result: Items = [item1,item2] Users = [{name='username',item1=3,item2=4},..] </code></pre> <p>The Django template is:</p> <pre><code>&lt;table&gt; &lt;tr a...
[ { "answer_id": 35978, "author": "David Webb", "author_id": 3171, "author_profile": "https://Stackoverflow.com/users/3171", "pm_score": 3, "selected": false, "text": "{{ user.item }} \"item\" item {{ user.name }} name user name" }, { "answer_id": 37190, "author": "Nic Wise", ...
2008/08/30
[ "https://Stackoverflow.com/questions/35948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3117/" ]
35,950
<p>I need an associative container that makes me index a certain object through a string, but that also keeps the order of insertion, so I can look for a specific object by its name or just iterate on it and retrieve objects in the same order I inserted them.</p> <p>I think this <a href="http://www.ddj.com/cpp/1844062...
[ { "answer_id": 35965, "author": "Christopher", "author_id": 3186, "author_profile": "https://Stackoverflow.com/users/3186", "pm_score": 3, "selected": true, "text": "operator< operator( key ) => index" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/35950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3373/" ]
35,954
<p>I have a query that originally looks like this:</p> <pre><code>select c.Id, c.Name, c.CountryCode, c.CustomerNumber, cacc.AccountNumber, ca.Line1, ca.CityName, ca.PostalCode from dbo.Customer as c left join dbo.CustomerAddress as ca on ca.CustomerId = c.Id left join dbo.CustomerAccount as cacc on cacc.CustomerId = ...
[ { "answer_id": 35965, "author": "Christopher", "author_id": 3186, "author_profile": "https://Stackoverflow.com/users/3186", "pm_score": 3, "selected": true, "text": "operator< operator( key ) => index" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/35954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/372/" ]
35,973
<p>What is the best approach to define additional data for typedef enums in C?</p> <p>Example:</p> <pre><code>typedef enum { kVizsla = 0, kTerrier = 3, kYellowLab = 10 } DogType; </code></pre> <p>Now I would like to define names for each, for example <code>kVizsla</code> should be "vizsla". I currently use a f...
[ { "answer_id": 35998, "author": "dmckee --- ex-moderator kitten", "author_id": 2509, "author_profile": "https://Stackoverflow.com/users/2509", "pm_score": 1, "selected": false, "text": "char *DogList[] = {\n \"vizsla\", /* element 0 */\n NULL,\n NULL,\n NULL,\n \"terrier\", /* eleme...
2008/08/30
[ "https://Stackoverflow.com/questions/35973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3740/" ]
35,974
<p>I'm working on an email solution in SQL Server ONLY that will use Database Mail to send out HTML formatted emails. The catch is that the images in the HTML need to be embedded in the outgoing email. This wouldn't be a problem if I were using a .net app to generate &amp; send the emails but, unfortunately, all I hav...
[ { "answer_id": 36173, "author": "nathan_jr", "author_id": 3769, "author_profile": "https://Stackoverflow.com/users/3769", "pm_score": 1, "selected": false, "text": "<img src=\"data:image/png;base64[your encoded image here...]" }, { "answer_id": 166446, "author": "Josef", ...
2008/08/30
[ "https://Stackoverflow.com/questions/35974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3742/" ]
35,983
<p>Let's say I have committed some bad changes to Subversion repository. Then I commit good changes, that I want to keep.</p> <p>What would be easiest way to roll back those bad changes in Eclipse, and keep the good changes? Assuming that files relating to bad changes are not same as those relating to the good changes...
[ { "answer_id": 36063, "author": "Fernando Barrocal", "author_id": 2274, "author_profile": "https://Stackoverflow.com/users/2274", "pm_score": 6, "selected": true, "text": "Replace with... Latest from Repository Branch Merge svn revert svn merge" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/35983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1431/" ]
35,988
<p>Is there a way to conveniently define a C-like structure in Python? I'm tired of writing stuff like:</p> <pre><code>class MyStruct(): def __init__(self, field1, field2, field3): self.field1 = field1 self.field2 = field2 self.field3 = field3 </code></pre>
[ { "answer_id": 35990, "author": "Mark Biek", "author_id": 305, "author_profile": "https://Stackoverflow.com/users/305", "pm_score": 6, "selected": false, "text": "myStruct = {'field1': 'some val', 'field2': 'some val'}\n print myStruct['field1']\nmyStruct['field2'] = 'some other values'\...
2008/08/30
[ "https://Stackoverflow.com/questions/35988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3738/" ]
35,991
<p>I'm considering using Django for a project I'm starting (fyi, a browser-based game) and one of the features I'm liking the most is using <code>syncdb</code> to automatically create the database tables based on the Django models I define (a feature that I can't seem to find in any other framework). I was already thin...
[ { "answer_id": 36015, "author": "David Webb", "author_id": 3171, "author_profile": "https://Stackoverflow.com/users/3171", "pm_score": 3, "selected": false, "text": "initial_data django-admin.py dumpdata fixtures django-admin.py loaddata initial_data.json syncdb manage.py test" }, { ...
2008/08/30
[ "https://Stackoverflow.com/questions/35991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2841/" ]
35,999
<p>How can I execute <code>a.exe</code> using the Cygwin shell?</p> <p>I created a C file in Eclipse on Windows and then used Cygwin to navigate to the directory. I called gcc on the C source file and <code>a.exe</code> was produced. I would like to run <code>a.exe</code>.</p>
[ { "answer_id": 36006, "author": "kaiz.net", "author_id": 3714, "author_profile": "https://Stackoverflow.com/users/3714", "pm_score": -1, "selected": false, "text": "> a\n" }, { "answer_id": 36016, "author": "Jason Weathered", "author_id": 3736, "author_profile": "http...
2008/08/30
[ "https://Stackoverflow.com/questions/35999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
36,001
<p>I have a table defined (see code snippet below). How can I add a constraint or whatever so that the LastUpdate column is automatically updated anytime the row is changed?</p> <pre><code>CREATE TABLE dbo.Profiles ( UserName varchar(100) NOT NULL, LastUpdate ...
[ { "answer_id": 36068, "author": "Kevin Fairchild", "author_id": 3743, "author_profile": "https://Stackoverflow.com/users/3743", "pm_score": 5, "selected": false, "text": "CREATE TRIGGER KeepUpdated on Profiles\nFOR UPDATE, INSERT AS \nUPDATE dbo.Profiles \nSET LastUpdate = GetDate()\nWHE...
2008/08/30
[ "https://Stackoverflow.com/questions/36001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3747/" ]
36,014
<p>I'm working on a project using the <a href="http://antlr.org" rel="noreferrer">ANTLR</a> parser library for C#. I've built a grammar to parse some text and it works well. However, when the parser comes across an illegal or unexpected token, it throws one of many exceptions. The problem is that in some cases (not ...
[ { "answer_id": 36047, "author": "ljs", "author_id": 3394, "author_profile": "https://Stackoverflow.com/users/3394", "pm_score": 3, "selected": false, "text": "using System.Threading;\n\n...\n\nvoid Application_ThreadException(object sender, ThreadExceptionEventArgs e) {\n throw new Pars...
2008/08/30
[ "https://Stackoverflow.com/questions/36014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3347/" ]
36,028
<p>How do I assign a method's output to a textbox value without code behind?</p> <pre><code>&lt;%@ Page Language="VB" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;script runat="server"&gt; Public TextFromString As String =...
[ { "answer_id": 36164, "author": "Toran Billups", "author_id": 2701, "author_profile": "https://Stackoverflow.com/users/2701", "pm_score": 1, "selected": false, "text": "<input type=\"text\" id=\"TextBox4\" runat=\"server\" value=\"<%=TextFromString%>\" />\n" }, { "answer_id": 362...
2008/08/30
[ "https://Stackoverflow.com/questions/36028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3747/" ]
36,039
<p>C++ seems to be rather grouchy when declaring templates across multiple files. More specifically, when working with templated classes, the linker expect all method definitions for the class in a single compiler object file. When you take into account headers, other declarations, inheritance, etc., things get really ...
[ { "answer_id": 94890, "author": "jwfearn", "author_id": 10559, "author_profile": "https://Stackoverflow.com/users/10559", "pm_score": 2, "selected": false, "text": "extern" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/36039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4381/" ]
36,058
<p>I have a popup window containing a form which gathers data for a report. When I click submit in that window, I want it to close the popup, and open the report in the original window that called the popup.</p> <p>I think I can open the report in the correct window by using</p> <pre><code>{ :target =&gt; &lt;name of...
[ { "answer_id": 36065, "author": "Craig", "author_id": 1611, "author_profile": "https://Stackoverflow.com/users/1611", "pm_score": 0, "selected": false, "text": "# The submit button in your child window's view:\n<%= button_to_function 'Save', \"$('my_form').submit(); window.opener.locatio...
2008/08/30
[ "https://Stackoverflow.com/questions/36058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
36,064
<p>I am attempting to update a project from ASP.NET MVC Preview 3 to Preview 5 and it seems that Controller.ReadFromRequest(string key) has been removed from the Controller class. Does anyone know of any alternatives to retrieving information based on an identifier from a form?</p>
[ { "answer_id": 36206, "author": "Dane O'Connor", "author_id": 1946, "author_profile": "https://Stackoverflow.com/users/1946", "pm_score": 2, "selected": false, "text": "public static T ReadFromRequest < T > (this Controller controller, string key) \n{\n // Setup\n HttpContextBase c...
2008/08/30
[ "https://Stackoverflow.com/questions/36064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3412/" ]
36,077
<p>I'm looking for an answer in MS VC++.</p> <p>When debugging a large C++ application, which unfortunately has a very extensive usage of C++ exceptions. Sometimes I catch an exception a little later than I actually want.</p> <p>Example in pseudo code:</p> <pre><code>FunctionB() { ... throw e; ... } Fun...
[ { "answer_id": 36223, "author": "Frank Krueger", "author_id": 338, "author_profile": "https://Stackoverflow.com/users/338", "pm_score": 2, "selected": false, "text": "#include <execinfo.h> // Backtrace\n#include <cxxabi.h> // Demangling\n\nvector<Str> backtrace(size_t numskip) {\n vec...
2008/08/30
[ "https://Stackoverflow.com/questions/36077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
36,079
<p>In my PHP web app, I want to be notified via email whenever certain errors occur. I'd like to use my Gmail account for sending these. How could this be done?</p>
[ { "answer_id": 36086, "author": "maxsilver", "author_id": 1477, "author_profile": "https://Stackoverflow.com/users/1477", "pm_score": 2, "selected": false, "text": "<?php\nrequire_once \"Mail.php\";\n\n$from = \"Sandra Sender <sender@example.com>\";\n$to = \"Ramona Recipient <recipient@e...
2008/08/30
[ "https://Stackoverflow.com/questions/36079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/356/" ]
36,081
<p>I'm trying to leverage the using block more and more these days when I have an object that implements IDisposable but one thing I have not figured out is how to catch an exception as I would in a normal try/catch/finally ... any code samples to point me in the right direction?</p> <p>Edit: The question was modified...
[ { "answer_id": 36094, "author": "Quibblesome", "author_id": 1143, "author_profile": "https://Stackoverflow.com/users/1143", "pm_score": 2, "selected": false, "text": "IDisposable disposable = null;\ntry\n{\n disposable = new WhateverYouWantedToMake();\n}\nfinally\n{\n disposable.Di...
2008/08/30
[ "https://Stackoverflow.com/questions/36081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2701/" ]
36,101
<p>How do I "name" a browser window in ROR, such that I can open a page in it later, from another (popup) window (using the target="name" html parameter)</p>
[ { "answer_id": 36131, "author": "John Topley", "author_id": 1450, "author_profile": "https://Stackoverflow.com/users/1450", "pm_score": 4, "selected": true, "text": "<script type=\"text/javascript\">\n window.name = \"MyWindow\";\n</script>\n app/helpers/application_helper.rb def window...
2008/08/30
[ "https://Stackoverflow.com/questions/36101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3764/" ]
36,108
<p>Some WPF controls (like the <code>Button</code>) seem to happily consume all the available space in its' container if you don't specify the height it is to have.</p> <p>And some, like the ones I need to use right now, the (multiline) <code>TextBox</code> and the <code>ListBox</code> seem more worried about just tak...
[ { "answer_id": 36634, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 8, "selected": false, "text": "HorizontalContentAlignment=\"Stretch\"\n HorizontalAlignment=\"Stretch\"\n" }, { "answer_id": 36741, "author"...
2008/08/30
[ "https://Stackoverflow.com/questions/36108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2122/" ]
36,109
<p>The following shell script takes a list of arguments, turns Unix paths into WINE/Windows paths and invokes the given executable under WINE.</p> <pre><code>#! /bin/sh if [ "${1+set}" != "set" ] then echo "Usage; winewrap EXEC [ARGS...]" exit 1 fi EXEC="$1" shift ARGS="" for p in "$@"; do if [ -e "$p" ] ...
[ { "answer_id": 36113, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 0, "selected": false, "text": "/home/chris/.wine/drive_c/Program Files/Microsoft\\ Research/Z3-1.3.6/bin/z3.exe\n" }, { "answer_id": 42005, "a...
2008/08/30
[ "https://Stackoverflow.com/questions/36109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412/" ]
36,114
<p>I know I must be missing something, but in a <code>while</code> statement how does the variable hold the data, when it finishes the first pass and goes into the second pass?</p> <hr> <p>{</p> <pre><code>int num1 = 0 ; int num2 = 0; int num3 = 0; while (num1 &lt; 10) {cout &lt;&lt; "enter your first number: ...
[ { "answer_id": 36155, "author": "James Sutherland", "author_id": 1739, "author_profile": "https://Stackoverflow.com/users/1739", "pm_score": 2, "selected": false, "text": "int a = 0;\n\nwhile(a < 10)\n{\n int b = 0;\n\n cout << \"a: \" << a << \" b: \" << b << \"\\n\";\n\n a++;\...
2008/08/30
[ "https://Stackoverflow.com/questions/36114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/335696/" ]
36,129
<p>I'm reading through head first design patterns at the moment and while the book is excellent I also would like to see how these are actually used in the real world.</p> <p>If you know of a good example of design pattern usage (preferably in a OSS program so we can have a look :) then please list it below.</p>
[ { "answer_id": 36167, "author": "rp.", "author_id": 2536, "author_profile": "https://Stackoverflow.com/users/2536", "pm_score": 3, "selected": true, "text": "namespace PublishSubscribe\n{\n public partial class Form1 : Form\n {\n Form2 f2 = new Form2();\n\n public For...
2008/08/30
[ "https://Stackoverflow.com/questions/36129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1603/" ]
36,139
<p>What is the best way of creating an alphabetically sorted list in Python?</p>
[ { "answer_id": 36143, "author": "rix0rrr", "author_id": 2474, "author_profile": "https://Stackoverflow.com/users/2474", "pm_score": 5, "selected": false, "text": "list.sort()\n" }, { "answer_id": 36156, "author": "Eli Courtwright", "author_id": 1694, "author_profile":...
2008/08/30
[ "https://Stackoverflow.com/questions/36139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3205/" ]
36,144
<p>I'm trying to open a new browser tab with the results of a POST request. I'm trying to do so using a function containing the following code:</p> <pre><code>var windowManager = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interface s.nsIWindowMediator); var browserWindow ...
[ { "answer_id": 36216, "author": "Marius", "author_id": 1585, "author_profile": "https://Stackoverflow.com/users/1585", "pm_score": 0, "selected": false, "text": "function openAndReuseOneTabPerURL(url) {\n var wm = Components.classes[\"@mozilla.org/appshell/window-mediator;1\"]\n ...
2008/08/30
[ "https://Stackoverflow.com/questions/36144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3288/" ]
36,183
<p>I'm trying to write a regex function that will identify and replace a single instance of a match within a string without affecting the other instances. For example, I have this string:</p> <pre><code>12||34||56 </code></pre> <p>I want to replace the second set of pipes with ampersands to get this string:</p> <pr...
[ { "answer_id": 36191, "author": "Sam Hasler", "author_id": 2541, "author_profile": "https://Stackoverflow.com/users/2541", "pm_score": 5, "selected": true, "text": "\"23||45||45||56||67\".replace(/^((?:[0-9]+\\|\\|){n})([0-9]+)\\|\\|/,\"$1$2&&\")\n function pipe_replace(str,n) {\n var ...
2008/08/30
[ "https://Stackoverflow.com/questions/36183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289/" ]
36,260
<p>I'm writing an interpreter for an experimental language. Three of the main constructs of the language are definitions, statements, and expressions. Definitions can contain statements and expressions, statements can contain definitions and expressions, and one kind of expression can contain statements. I represent al...
[ { "answer_id": 216062, "author": "J D", "author_id": 13924, "author_profile": "https://Stackoverflow.com/users/13924", "pm_score": 4, "selected": false, "text": "type ('stmt, 'expr) defn = ...\ntype ('defn, 'expr) stmt = ...\ntype ('defn, 'stmt) expr = ...\n" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/36260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1891/" ]
36,274
<p>What is Lazy Loading?</p> <p>[Edit after reading a few answers] Why do people use this term so often? </p> <p>Say you just use a ASP/ADO recordset and load it with data or ADO.NET Datasource for a gridview.</p> <p>I guess I should have asked why people use the term Lazy Loading, what "other" types are their?</p>
[ { "answer_id": 36291, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 3, "selected": false, "text": "class Item(Model):\n ...\n @property\n def total(self):\n if not hasattr(self, \"_total\"):\n ...
2008/08/30
[ "https://Stackoverflow.com/questions/36274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3747/" ]
36,294
<p>Looks like here in StackOveflow there is a group of <strong>F#</strong> enthusiasts. </p> <p>I'd like to know better this language, so, apart from the <a href="http://en.wikipedia.org/wiki/Functional_programming" rel="noreferrer">functional programming theory</a>, can you point me to the better starting points to s...
[ { "answer_id": 36393, "author": "ljs", "author_id": 3394, "author_profile": "https://Stackoverflow.com/users/3394", "pm_score": 6, "selected": true, "text": "#light\n > #light;;\n > let f x y = x + y;;\n\n val f : int -> int -> int\n\n > f 1 2;;\n val it : int = 3\n let sumStuff x ...
2008/08/30
[ "https://Stackoverflow.com/questions/36294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1178/" ]
36,314
<p>I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!)</p>
[ { "answer_id": 36321, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 11, "selected": true, "text": "function add (a, b) {\n return a + b;\n}\n\nadd(3, 4); // returns 7\n function add (a) {\n return function (b) {\n ret...
2008/08/30
[ "https://Stackoverflow.com/questions/36314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3786/" ]
36,315
<p>It'd be really nice to target my Windows Forms app to the .NET 3.5 SP1 <em>client</em> framework. But, right now I'm using the <code>HttpUtility.HtmlDecode</code> and <code>HttpUtility.UrlDecode</code> functions, and the MSDN documentation doesn't point to any alternatives inside of, say, System.Net or something.</p...
[ { "answer_id": 36359, "author": "Jeremy McGee", "author_id": 3546, "author_profile": "https://Stackoverflow.com/users/3546", "pm_score": 1, "selected": false, "text": "HttpUtility System.Web.dll c:\\windows\\Microsoft.NET\\Framework\\ ..." }, { "answer_id": 4389349, "author":...
2008/08/30
[ "https://Stackoverflow.com/questions/36315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3191/" ]
36,326
<p>I know it is a good idea to store configuration data in app.config (e.g. database connection strings) instead of hardcoing it, even if I am writing an application just for myself. But is there a way to update the configuration data stored in app.config from the program that is using it?</p>
[ { "answer_id": 36335, "author": "Domenic", "author_id": 3191, "author_profile": "https://Stackoverflow.com/users/3191", "pm_score": 1, "selected": false, "text": "a UserScopedSettingAttribute" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/36326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3205/" ]
36,344
<p>I'm trying to "install SGML::Parser::OpenSP" from the cpan shell, but it fails on the first "make test". I also get the same error if I go into the build directory and run make test.</p> <p>I believe this bit of the output below is the relevant part. Note the Symbol not found when perl gets to the "use" line for t...
[ { "answer_id": 36335, "author": "Domenic", "author_id": 3191, "author_profile": "https://Stackoverflow.com/users/3191", "pm_score": 1, "selected": false, "text": "a UserScopedSettingAttribute" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/36344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
36,347
<p>Java has generics and C++ provides a very strong programming model with <code>template</code>s. So then, what is the difference between C++ and Java generics?</p>
[ { "answer_id": 36364, "author": "Alexandru Nedelcu", "author_id": 3280, "author_profile": "https://Stackoverflow.com/users/3280", "pm_score": 8, "selected": true, "text": "template <typename T> T sum(T a, T b) { return a + b; }\n <T extends Something> T sum(T a, T b) { return a.add ( b )...
2008/08/30
[ "https://Stackoverflow.com/questions/36347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1556/" ]
36,350
<p>I have a method which takes params object[] such as:</p> <pre><code>void Foo(params object[] items) { Console.WriteLine(items[0]); } </code></pre> <p>When I pass two object arrays to this method, it works fine:</p> <pre><code>Foo(new object[]{ (object)"1", (object)"2" }, new object[]{ (object)"3", (object)"4"...
[ { "answer_id": 36360, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 2, "selected": false, "text": "Foo(new Object[] { new object[]{ (object)\"1\", (object)\"2\" }});\n" }, { "answer_id": 36361, "author": "...
2008/08/30
[ "https://Stackoverflow.com/questions/36350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31505/" ]
36,407
<p>What Firefox add-ons do you use that are useful for programmers?</p>
[ { "answer_id": 36433, "author": "Dan Herbert", "author_id": 392, "author_profile": "https://Stackoverflow.com/users/392", "pm_score": 1, "selected": false, "text": "Miscellaneous Display Ruler" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/36407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3305/" ]
36,417
<p>What is a good way to remove the code from display pages when developing with PHP. Often the pages I work on need to be editted by an outside person. This person is often confused by lots of blocks of PHP, and also likes to break my code.</p> <p>I've tried moving blocks of code out into functions, so now there are ...
[ { "answer_id": 36428, "author": "different", "author_id": 3654, "author_profile": "https://Stackoverflow.com/users/3654", "pm_score": 0, "selected": false, "text": "$userName = \"John Doe\";\n$dateOfBirth = \"04/02/1982\";\n\nfunction calculateUserAgeFromBirth($userName, $dateOfBirth)\n"...
2008/08/30
[ "https://Stackoverflow.com/questions/36417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3800/" ]
36,430
<p>I'm not sure of all of them, but what are the commands to do things like update Ruby, download a new gem, or update an existing gem? What other important things are there?</p> <p>Since it might matter, I'm running Windows.</p>
[ { "answer_id": 36452, "author": "John Topley", "author_id": 1450, "author_profile": "https://Stackoverflow.com/users/1450", "pm_score": 1, "selected": false, "text": "sudo gem install gemname\nsudo gem update gemname\n" }, { "answer_id": 36463, "author": "Joseph Pecoraro", ...
2008/08/30
[ "https://Stackoverflow.com/questions/36430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
36,455
<p>Older K&amp;R (2nd ed.) and other C-language texts I have read that discuss the implementation of a dynamic memory allocator in the style of <code>malloc()</code> and <code>free()</code> usually also mention, in passing, something about data type alignment restrictions. Apparently certain computer hardware architect...
[ { "answer_id": 36466, "author": "Rob Walker", "author_id": 3631, "author_profile": "https://Stackoverflow.com/users/3631", "pm_score": 1, "selected": false, "text": "struct\n{ \n char A;\n int B;\n char C;\n int D;\n};\n struct\n{ \n char A;\n char C;\n int B;\n i...
2008/08/30
[ "https://Stackoverflow.com/questions/36455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
36,475
<p>What would be the best way to design a threaded commenting system so that it doesn't hammer the database?</p>
[ { "answer_id": 36629, "author": "Mark Harrison", "author_id": 116, "author_profile": "https://Stackoverflow.com/users/116", "pm_score": 2, "selected": false, "text": "select * from my_table\n start with parent = :TOP_ARTICLE\n connect by prior child = parent;\n" } ]
2008/08/30
[ "https://Stackoverflow.com/questions/36475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1745/" ]
36,498
<p>I would like to quickly send email from the command line. I realize there are probably a number of different ways to do this.</p> <p>I'm looking for a simple way to do this from a linux terminal (likely a bash shell but anything should do) and an alternative way to do this on Windows. I want to be able to whip up...
[ { "answer_id": 36499, "author": "aryeh", "author_id": 3288, "author_profile": "https://Stackoverflow.com/users/3288", "pm_score": 4, "selected": false, "text": "$ echo \"This is the email body\" | mail -s \"This is the subject\" me@email.com\n $ cat | mail -s \"A few lines off the top of...
2008/08/31
[ "https://Stackoverflow.com/questions/36498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/792/" ]
36,502
<p>I know Windows Vista (and XP) cache recently loaded DLL's in memory...</p> <p>How can this be disabled via the command prompt?</p>
[ { "answer_id": 36529, "author": "The How-To Geek", "author_id": 291, "author_profile": "https://Stackoverflow.com/users/291", "pm_score": 4, "selected": true, "text": "sc config Superfetch start= disabled\n" } ]
2008/08/31
[ "https://Stackoverflow.com/questions/36502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383/" ]
36,504
<p>I see a lot of talk on here about functional languages and stuff. Why would you use one over a "traditional" language? What do they do better? What are they worse at? What's the ideal functional programming application?</p>
[ { "answer_id": 1440354, "author": "RD1", "author_id": 175097, "author_profile": "https://Stackoverflow.com/users/175097", "pm_score": 3, "selected": false, "text": "* The average corporate programmer, e.g. most of the people I work with, will not understand it and most work environments ...
2008/08/31
[ "https://Stackoverflow.com/questions/36504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/655/" ]
36,511
<p>I'm attempting to create a dataset based on the properties of an object. For example, I have an instance of a Person class with properties including ID, Forename, Surname, DOB etc. Using reflection, I'm adding columns to a new dataset based on the object properties:</p> <pre><code>For Each pi As PropertyInfo In per...
[ { "answer_id": 36519, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 1, "selected": false, "text": "if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))\n" }, { "answer_id": 44108, ...
2008/08/31
[ "https://Stackoverflow.com/questions/36511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
36,515
<p>I have a page with a Google Maps mashup that has pushpins that are color-coded by day (Monday, Tuesday, etc.) The IFrame containing the map is dynamically sized, so it gets resized when the browser window is resized. </p> <p>I'd like to put a legend in the corner of the map window that tells the user what each colo...
[ { "answer_id": 36821, "author": "Tom", "author_id": 3715, "author_profile": "https://Stackoverflow.com/users/3715", "pm_score": 2, "selected": false, "text": "<div id=\"wrapper\">\n <div id=\"map\" style=\"width:400px;height:400px;\"></div>\n <div id=\"legend\"> ... marker descriptio...
2008/08/31
[ "https://Stackoverflow.com/questions/36515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1482/" ]
36,533
<p>my primary language is spanish, but I use all my software in english, including windows; however I'd like to use speech recognition in spanish.</p> <p>Do you know if there's a way to use vista's speech recognition in other language than the primary os language?</p>
[ { "answer_id": 483699, "author": "guerda", "author_id": 32043, "author_profile": "https://Stackoverflow.com/users/32043", "pm_score": 2, "selected": false, "text": "Windows Speech Recognition \"change language\"" }, { "answer_id": 1441205, "author": "Eric Brown", "author_...
2008/08/31
[ "https://Stackoverflow.com/questions/36533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1782/" ]
36,563
<p>I'm writing a simple app that's going to have a tiny form sitting in one corner of the screen, updating itself.</p> <p>I'd really love for that form to be transparent and to have the transparency be user-configurable.</p> <p>Is there any easy way to achieve this?</p>
[ { "answer_id": 36576, "author": "Eric Haskins", "author_id": 100, "author_profile": "https://Stackoverflow.com/users/100", "pm_score": 0, "selected": false, "text": "Form.Opacity" }, { "answer_id": 36577, "author": "Cameron MacFarland", "author_id": 3820, "author_prof...
2008/08/31
[ "https://Stackoverflow.com/questions/36563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305/" ]
36,567
<p>I'm looking into writing a audio syntesizer in Java, and was wondering if anybody has any advice or good resources for writing such a program. I'm looking for info on generating raw sound waves, how to output them into a usable form (playing over speakers), as well as general theory on the topic. Thanks guys.</p>
[ { "answer_id": 38203, "author": "secr", "author_id": 4085, "author_profile": "https://Stackoverflow.com/users/4085", "pm_score": 4, "selected": true, "text": "typedef struct _WAVstruct\n{\n char headertag[4];\n unsigned int remnantlength;\n char fileid[4];\n\n char fmtchunkta...
2008/08/31
[ "https://Stackoverflow.com/questions/36567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
36,585
<p>I have a column which is of type nvarchar(max). How do I find the length of the string (or the number of bytes) for the column for each row in the table?</p>
[ { "answer_id": 36592, "author": "Joseph Pecoraro", "author_id": 792, "author_profile": "https://Stackoverflow.com/users/792", "pm_score": 1, "selected": false, "text": "desc tablename;\n SELECT *, LENGTH(fieldname) AS len FROM tablename\n" }, { "answer_id": 2943468, "author":...
2008/08/31
[ "https://Stackoverflow.com/questions/36585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1208/" ]
36,605
<p>What is the simplest and most elegant way to simulate the hover pseudo-class for non-Anchor tags in IE6?</p> <p>I am specifically trying to change the cursor in this instance to that of a pointer.</p>
[ { "answer_id": 36609, "author": "Jon Galloway", "author_id": 5, "author_profile": "https://Stackoverflow.com/users/5", "pm_score": 4, "selected": false, "text": "body { behavior:url(\"csshover.htc\"); }\n" }, { "answer_id": 36892, "author": "Nathan Peretic", "author_id": ...
2008/08/31
[ "https://Stackoverflow.com/questions/36605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3821/" ]
36,608
<p>I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set.</p> <p>Something like:</p> <pre><code>Record.find(:all).date.unique.count </code></pre> <p>but of course, that doesn't seem to work.</p>
[ { "answer_id": 36618, "author": "Natalie Weizenbaum", "author_id": 2518, "author_profile": "https://Stackoverflow.com/users/2518", "pm_score": 7, "selected": true, "text": "SELECT COUNT(DISTINCT date) FROM records\n Record.count('date', :distinct => true)\n" }, { "answer_id": 402...
2008/08/31
[ "https://Stackoverflow.com/questions/36608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3764/" ]
36,621
<p>I'm taking the leap: my PHP scripts will ALL fail gracefully!</p> <p>At least, that's what I'm hoping for...`</p> <p>I don't want to wrap (practically) every single line in <code>try...catch</code> statements, so I think my best bet is to make a custom error handler for the beginning of my files.</p> <p>I'm testi...
[ { "answer_id": 36625, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 1, "selected": false, "text": "try..catch" }, { "answer_id": 36705, "author": "Ross", "author_id": 2025, "author_profile": "https:...
2008/08/31
[ "https://Stackoverflow.com/questions/36621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1615/" ]
36,636
<p>I asked a question about Currying and closures were mentioned. What is a closure? How does it relate to currying?</p>
[ { "answer_id": 36639, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 7, "selected": false, "text": "function makeCounter () {\n var count = 0;\n return function () {\n count += 1;\n return count;\n }\n}\n\nvar x = ...
2008/08/31
[ "https://Stackoverflow.com/questions/36636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3786/" ]
36,646
<p>Does anyone use <a href="http://phing.info/trac/" rel="nofollow noreferrer">Phing</a> to deploy PHP applications, and if so how do you use it? We currently have a hand-written "setup" script that we run whenever we deploy a new instance of our project. We just check out from SVN and run it. It sets some basic config...
[ { "answer_id": 6323542, "author": "cweiske", "author_id": 282601, "author_profile": "https://Stackoverflow.com/users/282601", "pm_score": 2, "selected": false, "text": "exec exec" } ]
2008/08/31
[ "https://Stackoverflow.com/questions/36646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/577/" ]
36,647
<p>Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good?</p>
[ { "answer_id": 36648, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 6, "selected": true, "text": "unittest doctest nose unittest unittest doctest" }, { "answer_id": 36654, "author": "John Millikin", "au...
2008/08/31
[ "https://Stackoverflow.com/questions/36647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/577/" ]
36,656
<p>I'm parsing text from a file and storing it in a string. The problem is that some of the text in the original files contains <code>ASCII art</code> and whatnot that I would like to preserve. When I print out the string on the <code>HTML page</code>, even if it does have the same formatting and everything since it ...
[ { "answer_id": 36657, "author": "UnkwnTech", "author_id": 115, "author_profile": "https://Stackoverflow.com/users/115", "pm_score": 3, "selected": false, "text": "nl2br() \\n \\r\\n <br>" }, { "answer_id": 36658, "author": "Grant", "author_id": 30, "author_profile": "...
2008/08/31
[ "https://Stackoverflow.com/questions/36656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3831/" ]
36,701
<p>Is it completely against the Java way to create struct like objects?</p> <pre><code>class SomeData1 { public int x; public int y; } </code></pre> <p>I can see a class with accessors and mutators being more Java like.</p> <pre><code>class SomeData2 { int getX(); void setX(int x); int getY(); ...
[ { "answer_id": 36734, "author": "Bartosz Bierkowski", "author_id": 3666, "author_profile": "https://Stackoverflow.com/users/3666", "pm_score": 7, "selected": true, "text": "public property String foo; \na->Foo = b->Foo;\n" }, { "answer_id": 36874, "author": "Spoike", "a...
2008/08/31
[ "https://Stackoverflow.com/questions/36701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3836/" ]
36,707
<p>Are there good reasons why it's a better practice to have only one return statement in a function? </p> <p>Or is it okay to return from a function as soon as it is logically correct to do so, meaning there may be many return statements in the function?</p>
[ { "answer_id": 36714, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 11, "selected": true, "text": "public void DoStuff(Foo foo)\n{\n if (foo != null)\n {\n ...\n }\n}\n public void DoStuff(Foo foo)\n{\n ...
2008/08/31
[ "https://Stackoverflow.com/questions/36707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/381/" ]
36,715
<p>When using host headers to host multiple websites on the same IP address in IIS, is there any way of accessing that website from a browser running on the local machine?</p> <p>This is normally required when a given web component only allows configuration from the local machine. It's also useful when things like ASP...
[ { "answer_id": 35499622, "author": "Anders Bornholm", "author_id": 1425531, "author_profile": "https://Stackoverflow.com/users/1425531", "pm_score": 0, "selected": false, "text": "$ telnet localhost 80\n GET / HTTP/1.1\nHost: www.example.com\n" } ]
2008/08/31
[ "https://Stackoverflow.com/questions/36715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1521/" ]
36,733
<p>I am working on a project management web application. The user has a variety of ways to display a list of tasks. When viewing a list page, they click on task and are redirected to the task edit page. </p> <p>Since they are coming from a variety of ways, I am just curious as to the <strong>best</strong> way to <s...
[ { "answer_id": 36735, "author": "Rob Cooper", "author_id": 832, "author_profile": "https://Stackoverflow.com/users/832", "pm_score": 1, "selected": false, "text": "public partial class _Default : System.Web.UI.Page \n{\n\n void Redirect(string url, string messsage)\n {\n Red...
2008/08/31
[ "https://Stackoverflow.com/questions/36733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768/" ]
36,742
<p>My GPS logger occassionally leaves "unfinished" lines at the end of the log files. I think they're only at the end, but I want to check all lines just in case. </p> <p>A sample complete sentence looks like:</p> <pre><code>$GPRMC,005727.000,A,3751.9418,S,14502.2569,E,0.00,339.17,210808,,,A*76 </code></pre> <p>The...
[ { "answer_id": 36779, "author": "Motti", "author_id": 3848, "author_profile": "https://Stackoverflow.com/users/3848", "pm_score": 2, "selected": false, "text": "grep -Ev \"^\\$.*\\*[0-9A-Fa-f]{2}$\" a.txt | grep -v ADVER\n grep -v ADVER" }, { "answer_id": 36842, "author": "Pa...
2008/08/31
[ "https://Stackoverflow.com/questions/36742", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3715/" ]
36,748
<p>What's the best way to asynchronously load an BitmapImage in C# using WPF? </p>
[ { "answer_id": 40774, "author": "bentford", "author_id": 946, "author_profile": "https://Stackoverflow.com/users/946", "pm_score": 0, "selected": false, "text": "public class ResizeFolderBackgroundWorker : BackgroundWorker\n{\n\n public ResizeFolderBackgroundWorker(string sourceFolder...
2008/08/31
[ "https://Stackoverflow.com/questions/36748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3837/" ]
36,760
<p>I have three tables: page, attachment, page-attachment</p> <p>I have data like this:</p> <pre><code>page ID NAME 1 first page 2 second page 3 third page 4 fourth page attachment ID NAME 1 foo.word 2 test.xsl 3 mm.ppt page-attachment ID PAGE-ID ATTACHMENT-ID 1 2 ...
[ { "answer_id": 36762, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 6, "selected": true, "text": "select page.name, count(page-attachment.id) as attachmentsnumber \nfrom page \n left outer join page-attachment on page...
2008/08/31
[ "https://Stackoverflow.com/questions/36760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2138/" ]
36,806
<p>I have been sold on mod_wsgi and apache rather than mod_python. I have all the parts installed (django, apache, mod_wsgi) but have run into a problem deploying.</p> <p>I am on osx 10.5 with apache 2.2 and django 1.0b2, mod_wsgi-2.3</p> <p>My application is called tred.</p> <p>Here are the relevant files: httpd-vh...
[ { "answer_id": 37009, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 4, "selected": true, "text": "Alias /" }, { "answer_id": 37218, "author": "John Millikin", "author_id": 3560, "author_profile": "h...
2008/08/31
[ "https://Stackoverflow.com/questions/36806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3431280/" ]
36,812
<p>Currently, I am writing up a bit of a product-based CMS as my first project.</p> <p>Here is my question. How can I add additional data (products) to my Product model?</p> <p>I have added '/admin/products/add' to my urls.py, but I don't really know where to go from there. How would i build both my view and my templ...
[ { "answer_id": 36935, "author": "Carl Meyer", "author_id": 3207, "author_profile": "https://Stackoverflow.com/users/3207", "pm_score": 4, "selected": true, "text": "from django.conf.urls.defaults import *\nfrom django.views.generic.create_update import create_object\n\nfrom my_products_a...
2008/08/31
[ "https://Stackoverflow.com/questions/36812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2592/" ]
36,813
<p>When and how should table stats gathering be performed for Oracle, version 9 and up? How would you go about gathering stats for a large database, where stats gathering would collide with "business hours".</p>
[ { "answer_id": 117066, "author": "Nick Pierpoint", "author_id": 4003, "author_profile": "https://Stackoverflow.com/users/4003", "pm_score": 3, "selected": false, "text": "dbms_stats.export_table_stats\n dbms_stats.import_table_stats\n schema database" } ]
2008/08/31
[ "https://Stackoverflow.com/questions/36813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3839/" ]
36,831
<p>I'm writing C# code that uses the windows IP Helper API. One of the functions I'm trying to call is "<a href="http://msdn.microsoft.com/en-us/library/aa365920(VS.85).aspx" rel="nofollow noreferrer">GetBestInterface</a>" that takes a 'uint' representation of an IP. What I need is to parse a textual representation of ...
[ { "answer_id": 36841, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 5, "selected": true, "text": "var ipAddress = IPAddress.Parse(\"some.ip.address\");\nvar ipBytes = ipAddress.GetAddressBytes();\nvar ip = (uint)ipBytes [3] << 2...
2008/08/31
[ "https://Stackoverflow.com/questions/36831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1596/" ]
36,832
<p>In C++ when a virtual function is called from within a constructor it doesn't behave like a virtual function.</p> <p>I think everyone who encountered this behavior for the first time was surprised but on second thought it made sense:</p> <p>As long as the derived constructor has not been executed the object is <st...
[ { "answer_id": 75026, "author": "Lars Truijens", "author_id": 1242, "author_profile": "https://Stackoverflow.com/users/1242", "pm_score": 0, "selected": false, "text": "type\n TComponent = class\n public\n constructor Create(AOwner: TComponent); virtual; // virtual constructor\n en...
2008/08/31
[ "https://Stackoverflow.com/questions/36832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3848/" ]
36,861
<p>I've run into a strange syntax in <a href="http://boo.codehaus.org/Closures" rel="nofollow noreferrer">Boo Language Guide</a> :</p> <pre><code>setter = { value | a = value } </code></pre> <p>What does the | operator mean?</p>
[ { "answer_id": 36869, "author": "dF.", "author_id": 3002, "author_profile": "https://Stackoverflow.com/users/3002", "pm_score": 4, "selected": true, "text": "setter = { value | a = value }\n setter = def(value):\n a = value\n" } ]
2008/08/31
[ "https://Stackoverflow.com/questions/36861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2313/" ]
36,862
<p>With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the machines. I could checkout a specific project, commit and it updated the 'master' project, or I could checkout the entire thing.</p> <p>Now, I...
[ { "answer_id": 36905, "author": "Spoike", "author_id": 3713, "author_profile": "https://Stackoverflow.com/users/3713", "pm_score": 2, "selected": false, "text": "git-submodule repo" }, { "answer_id": 37006, "author": "Damien Diederen", "author_id": 3844, "author_profi...
2008/08/31
[ "https://Stackoverflow.com/questions/36862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745/" ]
36,876
<p>I am using forms authentication. My users are redirected to a page (written in web.config) when they login, but some of them may not have the privilages to access this default page. In this case, I want them to redirect to another page but RedirectFromLoginPage method always redirects to the default page in web.conf...
[ { "answer_id": 36879, "author": "Joseph Daigle", "author_id": 507, "author_profile": "https://Stackoverflow.com/users/507", "pm_score": 4, "selected": true, "text": "SetAuthCookie" }, { "answer_id": 11499845, "author": "peyman", "author_id": 1528166, "author_profile":...
2008/08/31
[ "https://Stackoverflow.com/questions/36876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31505/" ]
36,877
<p>How can I set the cookies in my <code>PHP apps</code> as <code>HttpOnly cookies</code>?</p>
[ { "answer_id": 36880, "author": "Polsonby", "author_id": 137, "author_profile": "https://Stackoverflow.com/users/137", "pm_score": 3, "selected": false, "text": "header(\"Set-Cookie: hidden=value; httpOnly\");\n" }, { "answer_id": 36882, "author": "Marius", "author_id": 1...
2008/08/31
[ "https://Stackoverflow.com/questions/36877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3871/" ]
36,881
<p>I have an activity that has a TabHost containing a set of TabSpecs each with a listview containing the items to be displayed by the tab. When each TabSpec is created, I set an icon to be displayed in the tab header.</p> <p>The TabSpecs are created in this way within a <code>setupTabs()</code> method which loops to c...
[ { "answer_id": 68078, "author": "dmazzoni", "author_id": 7193, "author_profile": "https://Stackoverflow.com/users/7193", "pm_score": 6, "selected": true, "text": "TabHost TabSpec TabSpec mTabs.getTabWidget() TabWidget ViewGroup getChildCount() getChildAt() TabWidget ViewGroup LinearLayou...
2008/08/31
[ "https://Stackoverflow.com/questions/36881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1197/" ]
36,889
<p>We've been running <a href="http://eaccelerator.net/" rel="noreferrer" title="eAccelerator">eAccelerator</a> on each of 3 webservers and are looking to move to a <a href="http://www.danga.com/memcached/" rel="noreferrer" title="memcache">memcache</a> pool across all 3, hopefully reducing by about 2/3 our db lookups....
[ { "answer_id": 26085210, "author": "Bainternet", "author_id": 783536, "author_profile": "https://Stackoverflow.com/users/783536", "pm_score": 3, "selected": false, "text": "github" } ]
2008/08/31
[ "https://Stackoverflow.com/questions/36889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287/" ]
36,890
<p>I'd like to add a method to my existing server's CORBA interface. Will that require recompiling all clients?</p> <p>I'm using TAO.</p>
[ { "answer_id": 20404774, "author": "shijie xu", "author_id": 910118, "author_profile": "https://Stackoverflow.com/users/910118", "pm_score": 0, "selected": false, "text": " remoteObjRef->invoke(\"methodname\", args); // send(\"methodname\", args)\n" } ]
2008/08/31
[ "https://Stackoverflow.com/questions/36890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3583/" ]
36,901
<p>What do <code>*args</code> and <code>**kwargs</code> mean?</p> <pre><code>def foo(x, y, *args): def bar(x, y, **kwargs): </code></pre>
[ { "answer_id": 36908, "author": "Peter Hoffmann", "author_id": 720, "author_profile": "https://Stackoverflow.com/users/720", "pm_score": 13, "selected": true, "text": "*args **kwargs *args def foo(*args):\n for a in args:\n print(a) \n\nfoo(1)\n# 1\n\nfoo(1,2,3)\n# 1\n# ...
2008/08/31
[ "https://Stackoverflow.com/questions/36901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2572/" ]
36,906
<p>I want to swap two integers, and I want to know which of these two implementations will be faster: The obvious way with a temp variable:</p> <pre><code>void swap(int* a, int* b) { int temp = *a; *a = *b; *b = temp; } </code></pre> <p>Or the xor version that I'm sure most people have seen:</p> <pre><co...
[ { "answer_id": 36948, "author": "Tim Ring", "author_id": 3685, "author_profile": "https://Stackoverflow.com/users/3685", "pm_score": 0, "selected": false, "text": "PUSH A\nA=B\nPOP B\n" }, { "answer_id": 44911, "author": "paperhorse", "author_id": 4498, "author_profil...
2008/08/31
[ "https://Stackoverflow.com/questions/36906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3869/" ]
36,915
<p>We have been working with CVS for years, and frequently find it useful to "sticky" a single file here and there.</p> <p>Is there any way to do this in subversion, specifically from TortoiseSVN?</p>
[ { "answer_id": 36948, "author": "Tim Ring", "author_id": 3685, "author_profile": "https://Stackoverflow.com/users/3685", "pm_score": 0, "selected": false, "text": "PUSH A\nA=B\nPOP B\n" }, { "answer_id": 44911, "author": "paperhorse", "author_id": 4498, "author_profil...
2008/08/31
[ "https://Stackoverflow.com/questions/36915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3798/" ]
36,932
<p>I'm mainly a C# developer, but I'm currently working on a project in Python.</p> <p>How can I represent the equivalent of an Enum in Python? </p>
[ { "answer_id": 36937, "author": "Alexandru Nedelcu", "author_id": 3280, "author_profile": "https://Stackoverflow.com/users/3280", "pm_score": 10, "selected": false, "text": "class Animal:\n DOG = 1\n CAT = 2\n\nx = Animal.DOG\n name value from enum import Enum\n\nclass Animal(Enum)...
2008/08/31
[ "https://Stackoverflow.com/questions/36932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3880/" ]
36,953
<p>Can people point me to resources on lexing, parsing and tokenising with Python?</p> <p>I'm doing a little hacking on an open source project (<a href="http://www.hotwire-shell.org/" rel="noreferrer">hotwire</a>) and wanted to do a few changes to the code that <a href="http://code.google.com/p/hotwire-shell/source/br...
[ { "answer_id": 137207, "author": "Torsten Marek", "author_id": 9567, "author_profile": "https://Stackoverflow.com/users/9567", "pm_score": 4, "selected": false, "text": ">>> from pyparsing import Word, alphas\n>>> greet = Word( alphas ) + \",\" + Word( alphas ) + \"!\" # <-- grammar defi...
2008/08/31
[ "https://Stackoverflow.com/questions/36953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3189/" ]
36,956
<p>A Windows Forms application of ours pulls records from a view on SQL Server through ADO.NET and a SOAP web service, displaying them in a data grid. We have had several cases with ~25,000 rows, which works relatively smoothly, but a potential customer needs to have many times that much in a single list.</p> <p>To fi...
[ { "answer_id": 37004, "author": "Sören Kuklau", "author_id": 1600, "author_profile": "https://Stackoverflow.com/users/1600", "pm_score": 0, "selected": false, "text": "WHILE (SELECT count(1) FROM benchmark) < 100000\n INSERT INTO benchmark\n SELECT TOP 100000 * FROM actualData\n" } ]
2008/08/31
[ "https://Stackoverflow.com/questions/36956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1600/" ]
36,959
<p>In MS SQL Server, I create my scripts to use customizable variables:</p> <pre><code>DECLARE @somevariable int SELECT @somevariable = -1 INSERT INTO foo VALUES ( @somevariable ) </code></pre> <p>I'll then change the value of <code>@somevariable</code> at runtime, depending on the value that I want in the particu...
[ { "answer_id": 36989, "author": "Craig Walker", "author_id": 3488, "author_profile": "https://Stackoverflow.com/users/3488", "pm_score": 6, "selected": false, "text": "SELECT * FROM foo WHERE bar = ':myvariable'\n \\set myvariable '\\'somestring\\'' \nSELECT * FROM foo WHERE bar = :myva...
2008/08/31
[ "https://Stackoverflow.com/questions/36959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3488/" ]
36,984
<p>So right now my project has a few custom dialogs that do things like prompt the user for his birthday, or whatever. Right now they're just doing things like setting a <code>this.Birthday</code> property once they get an answer (which is of type <code>DateTime?</code>, with the null indicating a "Cancel"). Then the c...
[ { "answer_id": 37008, "author": "Murph", "author_id": 1070, "author_profile": "https://Stackoverflow.com/users/1070", "pm_score": 2, "selected": false, "text": "if (Dialog == Ok)\n{\n // Do Stuff with the entered values\n}\nelse\n{\n // Respond appropriately to the user cancelling ...
2008/08/31
[ "https://Stackoverflow.com/questions/36984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3191/" ]
36,991
<p>So, I am a total beginner in any kind of <code>Windows</code> related programming. I have been playing around with the <code>Windows</code> <code>API</code> and came across a couple of examples on how to initialize create windows and such. </p> <p>One example creates a regular window (I abbreviated some of the code...
[ { "answer_id": 37008, "author": "Murph", "author_id": 1070, "author_profile": "https://Stackoverflow.com/users/1070", "pm_score": 2, "selected": false, "text": "if (Dialog == Ok)\n{\n // Do Stuff with the entered values\n}\nelse\n{\n // Respond appropriately to the user cancelling ...
2008/08/31
[ "https://Stackoverflow.com/questions/36991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2386/" ]