qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
87,304
<p>What's a good algorithm for calculating frames per second in a game? I want to show it as a number in the corner of the screen. If I just look at how long it took to render the last frame the number changes too fast.</p> <p>Bonus points if your answer updates each frame and doesn't converge differently when the fra...
[ { "answer_id": 87333, "author": "Martin Beckett", "author_id": 10897, "author_profile": "https://Stackoverflow.com/users/10897", "pm_score": 7, "selected": false, "text": "// eg.\nfloat smoothing = 0.9; // larger=more smoothing\nmeasurement = (measurement * smoothing) + (current * (1.0-s...
2008/09/17
[ "https://Stackoverflow.com/questions/87304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16679/" ]
87,317
<p>I need to get a list of attribute values from child elements in Python.</p> <p>It's easiest to explain with an example.</p> <p>Given some XML like this:</p> <pre><code>&lt;elements&gt; &lt;parent name="CategoryA"&gt; &lt;child value="a1"/&gt; &lt;child value="a2"/&gt; &lt;child value="...
[ { "answer_id": 87503, "author": "pjz", "author_id": 8002, "author_profile": "https://Stackoverflow.com/users/8002", "pm_score": 2, "selected": false, "text": " import xmltramp\n\n values = xmltramp.parse('''...''')\n\n def getValues( values, category ):\n cat = [ parent for parent ...
2008/09/17
[ "https://Stackoverflow.com/questions/87317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3464/" ]
87,330
<p>Is there a canonical ordering of submatch expressions in a regular expression? </p> <p>For example: What is the order of the submatches in<br> "(([0-9]{3}).([0-9]{3}).([0-9]{3}).([0-9]{3}))\s+([A-Z]+)" ?</p> <pre><code>a. (([0-9]{3})\.([0-9]{3})\.([0-9]{3})\.([0-9]{3}))\s+([A-Z]+) (([0-9]{3})\.([0-9]{3})\.([0...
[ { "answer_id": 87417, "author": "Asgeir S. Nilsen", "author_id": 16023, "author_profile": "https://Stackoverflow.com/users/16023", "pm_score": 0, "selected": false, "text": "(([0-9]{3}).([0-9]{3}).([0-9]{3}).([0-9]{3}))\n([0-9]{3})\n([0-9]{3})\n([0-9]{3})\n([0-9]{3})\n([A-Z]+)\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16753/" ]
87,350
<p>Any recommendations on <a href="http://en.wikipedia.org/wiki/Grep" rel="noreferrer">grep</a> tools for Windows? Ideally ones that could leverage 64-bit OS.</p> <p>I'm aware of <a href="http://www.cygwin.com/" rel="noreferrer">Cygwin</a>, of course, and have also found <a href="http://www.powergrep.com/" rel="norefe...
[ { "answer_id": 87378, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 6, "selected": false, "text": "grep --include \"*.xxx\" -nRHI \"my Text to grep\" *\n" }, { "answer_id": 87394, "author": "Ray Hayes", "author_...
2008/09/17
[ "https://Stackoverflow.com/questions/87350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1690/" ]
87,359
<p>I have a page which spawns a popup browser window. I have a JavaScript variable in the parent browser window and I would like to pass it to the popped-up browser window.</p> <p>Is there a way to do this? I know this can be done across frames in the same browser window but I'm not sure if it can be done across brows...
[ { "answer_id": 87649, "author": "Milan Babuškov", "author_id": 14690, "author_profile": "https://Stackoverflow.com/users/14690", "pm_score": 0, "selected": false, "text": "var x = 10;\nwindow.open('mypage.php?x='+x);\n" }, { "answer_id": 87659, "author": "Grant Wagner", "...
2008/09/17
[ "https://Stackoverflow.com/questions/87359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2577/" ]
87,365
<p>If the owner of a web site wants to track who their users are as much as possible, what things can they capture (and how). You might want to know about this in order to capture information on a site you create or, as a user, to <em>prevent</em> a site from capturing data on you.</p> <p>Here is a starting list, but ...
[ { "answer_id": 87494, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 0, "selected": false, "text": "Accept-Language Accept User-Agent" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14570/" ]
87,372
<p>I'm asking for a template trick to detect if a class has a specific member function of a given signature.</p> <p>The problem is similar to the one cited here <a href="http://www.gotw.ca/gotw/071.htm" rel="noreferrer">http://www.gotw.ca/gotw/071.htm</a> but not the same: in the item of Sutter's book he answered to t...
[ { "answer_id": 87474, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "serialize std swap" }, { "answer_id": 87846, "author": "yrp", "author_id": 7228, "author_profile": "https...
2008/09/17
[ "https://Stackoverflow.com/questions/87372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10120/" ]
87,380
<p>I need to write a function that receives a string and a regex. I need to check if there is a match and return the start and end location of a match. (The regex was already compiled by <code>qr//</code>.)</p> <p>The function might also receive a "global" flag and then I need to return the (start,end) pairs of all th...
[ { "answer_id": 87410, "author": "Leon Timmermans", "author_id": 4727, "author_profile": "https://Stackoverflow.com/users/4727", "pm_score": 3, "selected": false, "text": "length $1 sub match_positions {\n my ($regex, $string) = @_;\n return if not $string =~ /($regex)/;\n return...
2008/09/17
[ "https://Stackoverflow.com/questions/87380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11827/" ]
87,381
<p>With ViEmu you really need to unbind a lot of resharpers keybindings to make it work well.</p> <p>Does anyone have what they think is a good set of keybindings that work well for resharper when using ViEmu?</p> <p>What I'm doing at the moment using the Visual Studio bindings from Resharper. Toasting all the confli...
[ { "answer_id": 994587, "author": "Jay", "author_id": 114994, "author_profile": "https://Stackoverflow.com/users/114994", "pm_score": 5, "selected": true, "text": "map <C-S-c> gS:vsc Edit.CommentSelection<CR>\nmap <C-A-c> gS:vsc Edit.UncommentSelection<CR>\n map <C-S-A-f> gS:vsc ReSharper...
2008/09/17
[ "https://Stackoverflow.com/questions/87381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10431/" ]
87,408
<p>a lot of websites like twitter, facebook and others let the users enter their email id and pwd and 'extract' the contacts based on that. </p> <p>Anyone know how this is done? </p>
[ { "answer_id": 87624, "author": "Dónal", "author_id": 2648, "author_profile": "https://Stackoverflow.com/users/2648", "pm_score": 2, "selected": false, "text": "List<Contact> contacts = SimpleAddressBookImporter.fetchContacts(emailAddress, password)\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,422
<p>I am writing an application that if the user hits back, it may resend the same information and mess up the flow and integrity of data. How do I disable it for users who are with and without javascript on?</p>
[ { "answer_id": 87632, "author": "Claus Thomsen", "author_id": 15555, "author_profile": "https://Stackoverflow.com/users/15555", "pm_score": 3, "selected": false, "text": " Response.Cache.SetCacheability(HttpCacheability.NoCache);\n Response.Cache.SetExpires(Now.AddSeconds(-1));\n Resp...
2008/09/17
[ "https://Stackoverflow.com/questions/87422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10088/" ]
87,425
<p>Do you generally assume that toString() on any given object has a low cost (i.e. for logging)? I do. Is that assumption valid? If it has a high cost should that normally be changed? What are valid reasons to make a toString() method with a high cost? The only time that I get concerned about toString costs is wh...
[ { "answer_id": 87519, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 5, "selected": true, "text": "Arrays.toString Collections.toString java.util java.net.URL" }, { "answer_id": 94872, "author": "Mr. Shiny...
2008/09/17
[ "https://Stackoverflow.com/questions/87425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6770/" ]
87,442
<p>I know that you can make a virtual network interface in Windows (see <a href="http://support.microsoft.com/kb/236869" rel="nofollow noreferrer">here</a>), and in Linux it is also pretty easy with ip-aliases, but does something similar exist for <strong>Mac OS X</strong>? I've been looking for loopback adapters, virt...
[ { "answer_id": 6375307, "author": "bmasterswizzle", "author_id": 801917, "author_profile": "https://Stackoverflow.com/users/801917", "pm_score": 5, "selected": false, "text": "/Library/Preferences/SystemConfiguration/preferences.plist preferences.plist preferences.plist preferences.plist...
2008/09/17
[ "https://Stackoverflow.com/questions/87442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9504/" ]
87,458
<p>I want to do this so that I can say something like, <code>svn mv *.php php-folder/</code>, but it does not seem to be working. Is it even possible? No mention of it is made on the relevant page in the <a href="http://svnbook.red-bean.com/en/1.0/re18.html" rel="noreferrer">svn book</a>.</p> <p>Example output of <c...
[ { "answer_id": 87516, "author": "sirprize", "author_id": 12902, "author_profile": "https://Stackoverflow.com/users/12902", "pm_score": 4, "selected": true, "text": "for file in *.php; do svn mv $file php-folder/; done\n" }, { "answer_id": 87524, "author": "cjm", "author_i...
2008/09/17
[ "https://Stackoverflow.com/questions/87458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16562/" ]
87,459
<p>I have a class with a string property that's actually several strings joined with a separator.</p> <p>I'm wondering if it is good form to have a proxy property like this:</p> <pre><code>public string ActualProperty { get { return actualProperty; } set { actualProperty = value; } } public string[] Individu...
[ { "answer_id": 87498, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 1, "selected": false, "text": "Split() IndividualStrings ActualProperty actualProperty" }, { "answer_id": 88196, "author": "Steve Cooper", "auth...
2008/09/17
[ "https://Stackoverflow.com/questions/87459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4192/" ]
87,468
<p>Essentially I have a PHP page that calls out some other HTML to be rendered through an object's method. It looks like this:</p> <p>MY PHP PAGE:</p> <pre><code>// some content... &lt;?php $GLOBALS["topOfThePage"] = true; $this-&gt;renderSomeHTML(); ?&gt; // some content... &lt;?php $GLOBALS["topOfThe...
[ { "answer_id": 87507, "author": "DGM", "author_id": 14253, "author_profile": "https://Stackoverflow.com/users/14253", "pm_score": 1, "selected": false, "text": "$GLOBALS. $this->renderSomeHTML(true);\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,542
<p>I have a set of WCF web services connected to dynamically by a desktop application.</p> <p>My problem is the really detailed config settings that WCF requires to work. Getting SSL to work involves custom settings. Getting MTOM or anything else to work requires more. You want compression? Here we go again...</p> <p...
[ { "answer_id": 101186, "author": "Keith", "author_id": 905, "author_profile": "https://Stackoverflow.com/users/905", "pm_score": 1, "selected": false, "text": "/// <summary>If the url doesn't end with a WSDL query string append it</summary>\nstatic string AddWsdlQueryStringIfMissing( str...
2008/09/17
[ "https://Stackoverflow.com/questions/87542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/905/" ]
87,557
<p>I have a class with many embedded assets. </p> <p>Within the class, I would like to get the class definition of an asset by name. I have tried using getDefinitionByName(), and also ApplicationDomain.currentDomain.getDefinition() but neither work.</p> <p>Example:</p> <pre><code>public class MyClass { [Embed(sou...
[ { "answer_id": 87596, "author": "Marc Hughes", "author_id": 6791, "author_profile": "https://Stackoverflow.com/users/6791", "pm_score": 4, "selected": true, "text": "public class MyClass\n{\n [Embed(source=\"images/image1.png\")] private static var Image1Class:Class;\n [Embed(source=\"...
2008/09/17
[ "https://Stackoverflow.com/questions/87557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8399/" ]
87,561
<p>I'd like to add some pie, bar and scatter charts to my Ruby on Rails web application. I want want them to be atractive, easy to add and not introduce much overhead. </p> <p>What charting solution would you recommend?<br> What are its drawbacks (requires Javascript, Flash, expensive, etc)?</p>
[ { "answer_id": 87646, "author": "Clinton Dreisbach", "author_id": 6262, "author_profile": "https://Stackoverflow.com/users/6262", "pm_score": 7, "selected": true, "text": "GoogleChart::PieChart.new('320x200', \"Things I Like To Eat\", false) do |pc| \n pc.data \"Broccoli\", 30\n pc.dat...
2008/09/17
[ "https://Stackoverflow.com/questions/87561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16779/" ]
87,587
<p>Continuing my problem from yesterday, the Silverlight datagrid I have from this <a href="https://stackoverflow.com/questions/74461/silverlight-datagrid-control-selection-changed-event-interfering-with-sorting">issue</a> is now causing Stack Overflow errors when sorting a column with a large amount of data (Like the ...
[ { "answer_id": 88253, "author": "BKimmel", "author_id": 13776, "author_profile": "https://Stackoverflow.com/users/13776", "pm_score": 0, "selected": false, "text": "dataGridView1.Columns[*Numberofthecolumnyoudontwantsorted*].SortMode\n= DataGridViewColumnSortMode.NotSortable;\n" }, {...
2008/09/17
[ "https://Stackoverflow.com/questions/87587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12413/" ]
87,612
<p>I want to fire up a flash presentation inside Powerpoint 2007. I am calling the Win32 ShellExecute() routine. When I run this from a location whose path is a UNC path (\myserver\myfolder\sample.ppt) it does not work.</p> <p>The ShellExecute routine expects 6 arguments, one of which is the path to run it from. I've ...
[ { "answer_id": 91379, "author": "Robert Mearns", "author_id": 5050, "author_profile": "https://Stackoverflow.com/users/5050", "pm_score": 2, "selected": false, "text": "* Autoload = True\n* EmbedMovie = True\n* Enabled = True\n* Loop = True\n* Playing = True\n* Visible = True\n* Movie = ...
2008/09/17
[ "https://Stackoverflow.com/questions/87612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13800/" ]
87,621
<p>I have an XML that I want to load to objects, manipulate those objects (set values, read values) and then save those XMLs back. It is important for me to have the XML in the structure (xsd) that I created.</p> <p>One way to do that is to write my own serializer, but is there a built in support for it or open source...
[ { "answer_id": 87641, "author": "ckarras", "author_id": 5688, "author_profile": "https://Stackoverflow.com/users/5688", "pm_score": 6, "selected": true, "text": "xsd.exe dependency1.xsd dependency2.xsd schema.xsd /out:outputDir\n" }, { "answer_id": 88003, "author": "Community...
2008/09/17
[ "https://Stackoverflow.com/questions/87621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9855/" ]
87,647
<p>I have a DTS package with a data transformation task (data pump). I’d like to source the data with the results of a stored procedure that takes parameters, but DTS won’t preview the result set and can’t define the columns in the data transformation task.</p> <p>Has anyone gotten this to work?</p> <p>Caveat: The ...
[ { "answer_id": 88006, "author": "Cervo", "author_id": 16219, "author_profile": "https://Stackoverflow.com/users/16219", "pm_score": 2, "selected": false, "text": "DECLARE @param1 DataType1 \nDECLARE @param2 DataType2\nSET @param1 = global variable \nSET @param2 = global variable (I for...
2008/09/17
[ "https://Stackoverflow.com/questions/87647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16813/" ]
87,676
<p>Every time I need to work with date and/or timstamps in Java I always feel like I'm doing something wrong and spend endless hours trying to find a better way of working with the APIs without having to code my own Date and Time utility classes. Here's a couple of annoying things I just ran into:</p> <ul> <li><p>0-b...
[ { "answer_id": 88135, "author": "Michael", "author_id": 13379, "author_profile": "https://Stackoverflow.com/users/13379", "pm_score": 2, "selected": false, "text": "DateUtils DateUtils.truncate() Date Calendar" }, { "answer_id": 88974, "author": "Patrick Wilkes", "author_...
2008/09/17
[ "https://Stackoverflow.com/questions/87676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5917/" ]
87,689
<p>I have several applications that are part of a suite of tools that various developers at our studio use. these applications are mainly command line apps that open a DOS cmd shell. These apps in turn start up a GUI application that tracks output and status (via sockets) of these command line apps.</p> <p>The comma...
[ { "answer_id": 92462, "author": "Mark", "author_id": 4405, "author_profile": "https://Stackoverflow.com/users/4405", "pm_score": 3, "selected": true, "text": "HWINSTA dHandle = GetProcessWindowStation();\nif ( GetUserObjectInformation(dHandle, UOI_NAME, nameBuffer, bufferLen, &lenNeeded)...
2008/09/17
[ "https://Stackoverflow.com/questions/87689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4405/" ]
87,692
<p>How can I, as the wiki admin, enter scripting (Javascript) into a Sharepoint wiki page?<br><br> I would like to enter a title and, when clicking on that, having displayed under it a small explanation. I usually have done that with javascript, any other idea?</p>
[ { "answer_id": 87739, "author": "RobbieGee", "author_id": 6752, "author_profile": "https://Stackoverflow.com/users/6752", "pm_score": 0, "selected": false, "text": "title=\"text here\" alt=\"text here\" <h2 title=\"some explanation here\">headline</h2>" }, { "answer_id": 87744, ...
2008/09/17
[ "https://Stackoverflow.com/questions/87692", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15346/" ]
87,734
<p>If the major axis of the ellipse is vertical or horizontal, it's easy to calculate the bounding box, but what about when the ellipse is rotated?</p> <p>The only way I can think of so far is to calculate all the points around the perimeter and find the max/min x and y values. It seems like there should be a simpler ...
[ { "answer_id": 88020, "author": "Mike Tunnicliffe", "author_id": 13956, "author_profile": "https://Stackoverflow.com/users/13956", "pm_score": 6, "selected": true, "text": "x = h + a*cos(t)*cos(phi) - b*sin(t)*sin(phi) [1]\ny = k + b*sin(t)*cos(phi) + a*cos(t)*sin(phi) [2]\n 0 = dx/dt ...
2008/09/17
[ "https://Stackoverflow.com/questions/87734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2214/" ]
87,735
<p>I have a simple SQL 'Select' query, and I'd like to dump the results into an Excel file. I'm only able to save as .csv and converting to .xls creates some super ugly output. In any case, as far as I can tell (using Google) this doesn't seem to be so straight forward. Any help would be greatly appreciated.</p>
[ { "answer_id": 6704819, "author": "Prathap", "author_id": 565302, "author_profile": "https://Stackoverflow.com/users/565302", "pm_score": 2, "selected": false, "text": "insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', \n'Excel 8.0;Database=D:\\testing.xls;', \n'SELECT * FROM [SheetName$...
2008/09/17
[ "https://Stackoverflow.com/questions/87735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16830/" ]
87,747
<p>I want to create a list of columns in SQL Server 2005 that have identity columns and their corresponding table in T-SQL.</p> <p>Results would be something like:</p> <p>TableName, ColumnName</p>
[ { "answer_id": 87773, "author": "Kevin Crumley", "author_id": 1818, "author_profile": "https://Stackoverflow.com/users/1818", "pm_score": 6, "selected": false, "text": "select o.name, c.name\nfrom sys.objects o inner join sys.columns c on o.object_id = c.object_id\nwhere c.is_identity = ...
2008/09/17
[ "https://Stackoverflow.com/questions/87747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,753
<p>How can I resize an image, with the image quality unaffected?</p>
[ { "answer_id": 87786, "author": "Kris Erickson", "author_id": 3798, "author_profile": "https://Stackoverflow.com/users/3798", "pm_score": 8, "selected": false, "text": "Bitmap newImage = new Bitmap(newWidth, newHeight);\nusing (Graphics gr = Graphics.FromImage(newImage))\n{\n gr.Smoot...
2008/09/17
[ "https://Stackoverflow.com/questions/87753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
87,758
<p>I have several old 3.5in floppy disks that I would like to backup. My attempts to create an image of the disks have failed. I tried using the UNIX utility dd_rescue, but when the kernel tries to open (<code>/dev/fd0</code>) I get a kernel error,</p> <pre><code>floppy0: probe failed... </code></pre> <p>I would li...
[ { "answer_id": 89689, "author": "Ana Betts", "author_id": 5728, "author_profile": "https://Stackoverflow.com/users/5728", "pm_score": 0, "selected": false, "text": "dd if=/dev/floppy0 of=animage.bin conv=noerror\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4778/" ]
87,760
<p>Ive been smashing my head with this for a while. I have 2 completely identical .wmv files encoded with wmv3 codec. I put them both through ffmpeg with the following command:</p> <pre><code>/usr/bin/ffmpeg -i file.wmv -ar 44100 -ab 64k -qscale 9 -s 512x384 -f flv file.flv </code></pre> <p>One file converts just fin...
[ { "answer_id": 239656, "author": "razong", "author_id": 29885, "author_profile": "https://Stackoverflow.com/users/29885", "pm_score": 4, "selected": true, "text": "ffmpeg audio 0x0162" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,769
<p>How do you connect to Oracle using PHP on MAC OS X?</p>
[ { "answer_id": 87860, "author": "Guy", "author_id": 993, "author_profile": "https://Stackoverflow.com/users/993", "pm_score": 0, "selected": false, "text": "c:> SQLPLUS\n\nCONNECT scott/tiger@mydatabase\n" }, { "answer_id": 5263006, "author": "nick fox", "author_id": 2232...
2008/09/17
[ "https://Stackoverflow.com/questions/87769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,771
<p>How would I go about...</p> <ul> <li><p>multiplying two 64-bit numbers </p></li> <li><p>multiplying two 16-digit hexadecimal numbers </p></li> </ul> <p>...using Assembly Language. </p> <p>I'm only allowed to use registers %eax, %ebx, %ecx, %edx, and the stack.</p> <p>EDIT: Oh, I'm using ATT Syntax on the x86<br>...
[ { "answer_id": 87884, "author": "BCS", "author_id": 1343, "author_profile": "https://Stackoverflow.com/users/1343", "pm_score": 0, "selected": false, "text": "a:b * c:d = e:f\n// goes to\ne:f = b*d;\nx:y = a*d; e += x;\nx:y = b*c; e += x;\n" }, { "answer_id": 15542823, "aut...
2008/09/17
[ "https://Stackoverflow.com/questions/87771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13597/" ]
87,795
<p>All I want is to update an ListViewItem's text whithout seeing any flickering.</p> <p>This is my code for updating (called several times):</p> <pre><code>listView.BeginUpdate(); listViewItem.SubItems[0].Text = state.ToString(); // update the state listViewItem.SubItems[1].Text = progress.ToString(); // update t...
[ { "answer_id": 87848, "author": "Ed S.", "author_id": 1053, "author_profile": "https://Stackoverflow.com/users/1053", "pm_score": 0, "selected": false, "text": "SetStyle(\n ControlStyles.AllPaintingInWmPaint |\n ControlStyles.UserPaint |\n ControlStyles.DoubleBuffer, true)\n" }, {...
2008/09/17
[ "https://Stackoverflow.com/questions/87795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10833/" ]
87,812
<p>Say I have the following class</p> <pre><code>MyComponent : IMyComponent { public MyComponent(int start_at) {...} } </code></pre> <p>I can register an instance of it with castle windsor via xml as follows</p> <pre><code>&lt;component id="sample" service="NS.IMyComponent, WindsorSample" type="NS.MyComponent, Wi...
[ { "answer_id": 87893, "author": "Gareth", "author_id": 1313, "author_profile": "https://Stackoverflow.com/users/1313", "pm_score": 0, "selected": false, "text": "T Resolve<T>(IDictionary arguments)\n object Resolve(Type service, IDictionary arguments)\n IDictionary<string, object> values...
2008/09/17
[ "https://Stackoverflow.com/questions/87812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
87,818
<p>Hi I am trying to find a way to read the cookie that i generated in .net web application to read that on the php page because i want the users to login once but they should be able to view .net and php pages ,until the cookie expires user should not need to login in again , but both .net and php web applications are...
[ { "answer_id": 87851, "author": "blowdart", "author_id": 2525, "author_profile": "https://Stackoverflow.com/users/2525", "pm_score": 1, "selected": false, "text": "Response.Cookies[\"domain\"].Domain = \"contoso.com\";\n" }, { "answer_id": 88174, "author": "Mike King", "a...
2008/09/17
[ "https://Stackoverflow.com/questions/87818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,821
<p>Is it possible to use an <strong>IF</strong> clause within a <strong>WHERE</strong> clause in MS SQL?</p> <p>Example:</p> <pre><code>WHERE IF IsNumeric(@OrderNumber) = 1 OrderNumber = @OrderNumber ELSE OrderNumber LIKE '%' + @OrderNumber + '%' </code></pre>
[ { "answer_id": 87839, "author": "bdukes", "author_id": 2688, "author_profile": "https://Stackoverflow.com/users/2688", "pm_score": 9, "selected": true, "text": "WHERE OrderNumber LIKE\n CASE WHEN IsNumeric(@OrderNumber) = 1 THEN \n @OrderNumber \n ELSE\n '%' + @OrderNumber\n END...
2008/09/17
[ "https://Stackoverflow.com/questions/87821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/299/" ]
87,831
<p>Nant seems very compiler-centric - which is guess is because it's considered a .NET development system. But I know it can be done! I've seen it. The platform we're building on has its own compiler and doesn't use 'cl.exe' for c++. We're building a C++ app on a different platform and would like to override with our ...
[ { "answer_id": 87878, "author": "Romain Verdier", "author_id": 4687, "author_profile": "https://Stackoverflow.com/users/4687", "pm_score": 0, "selected": false, "text": "<exec>" }, { "answer_id": 87948, "author": "Jeff Cuscutis", "author_id": 2277, "author_profile": "...
2008/09/17
[ "https://Stackoverflow.com/questions/87831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/424554/" ]
87,849
<p>I am about to move to SVN as my RCS of choice (after many years using CVS) and have a basic question...</p> <p>I have a number of shared projects - code that I want to use with lots of different projects. Is it possible to 'link' these shared folders to the projects that need them, so checking out a project will a...
[ { "answer_id": 87899, "author": "jamuraa", "author_id": 9805, "author_profile": "https://Stackoverflow.com/users/9805", "pm_score": 2, "selected": false, "text": "$ svn propget svn:externals calc\nthird-party/sounds http://svn.example.com/repos/sounds\nthird-party/skins -r148...
2008/09/17
[ "https://Stackoverflow.com/questions/87849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
87,871
<p>How best to make the selected date of an ASP.NET Calendar control available to JavaScript?</p> <p>Most controls are pretty simple, but the calendar requires more than just a simple <em>document.getElementById().value</em>.</p>
[ { "answer_id": 88199, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 0, "selected": false, "text": "document.getElementById('<%= DateTextBox.ClientID%>').value;" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043/" ]
87,877
<p>I am trying to build a dependency graph of tables based on the foreign keys between them. This graph needs to start with an arbitrary table name as its root. I could, given a table name look up the tables that reference it using the all_constraints view, then look up the tables that reference them, and so on, but ...
[ { "answer_id": 88217, "author": "Milan Babuškov", "author_id": 14690, "author_profile": "https://Stackoverflow.com/users/14690", "pm_score": 2, "selected": false, "text": "while (rows left in that table)\n list = rows where table name exists in child but not in parent\n print list\n r...
2008/09/17
[ "https://Stackoverflow.com/questions/87877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9940/" ]
87,885
<p>anyone have any experience using this? if so, is it worth while?</p>
[ { "answer_id": 9679469, "author": "Evans Y.", "author_id": 1118703, "author_profile": "https://Stackoverflow.com/users/1118703", "pm_score": 3, "selected": false, "text": "java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=<port> <class>\n jdb -attach <port>\n jdb -sourcepath \...
2008/09/17
[ "https://Stackoverflow.com/questions/87885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13143/" ]
87,902
<p>I am trying to validate user id's matching the example:</p> <pre><code>smith.jack or smith.jack.s </code></pre> <p>In other words, any number of non-whitespace characters (except dot), followed by exactly one dot, followed by any number of non-whitespace characters (except dot), optionally followed by exactly one ...
[ { "answer_id": 87919, "author": "BCS", "author_id": 1343, "author_profile": "https://Stackoverflow.com/users/1343", "pm_score": 1, "selected": false, "text": "[^\\s.]+\\.[^\\s.]+(\\.[^\\s.]+)?\n" }, { "answer_id": 87923, "author": "kch", "author_id": 13989, "author_pr...
2008/09/17
[ "https://Stackoverflow.com/questions/87902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,909
<p>Is it possible to set the title of a page when it's simply a loaded SWF?</p>
[ { "answer_id": 88131, "author": "64BitBob", "author_id": 16339, "author_profile": "https://Stackoverflow.com/users/16339", "pm_score": 2, "selected": false, "text": "getURL('javascript:var x = (document.getElementsByTagName(\"head\")[0].getElementsByTagName(\"title\")[0].firstChild.nodeV...
2008/09/17
[ "https://Stackoverflow.com/questions/87909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69665/" ]
87,932
<p>Most mature C++ projects seem to have an own <strong>reflection and attribute system</strong>, i.e for defining attributes which can be accessed by string and are automatically serializable. At least many C++ projects I participated in seemed to <strong>reinvent the wheel</strong>.</p> <p>Do you know any <strong>go...
[ { "answer_id": 2486020, "author": "Matthew Herrmann", "author_id": 232066, "author_profile": "https://Stackoverflow.com/users/232066", "pm_score": 2, "selected": false, "text": "struct point\n{\n int x;\n int y;\n\n // add this to your classes\n template <typename Visitor...
2008/09/17
[ "https://Stackoverflow.com/questions/87932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15288/" ]
87,934
<p>In Notepad++, I was writing a JavaScript file and something didn't work: an alert had to be shown when a button was clicked, but it wasn't working.</p> <p>I has used the auto-complete plugin provided with Notepad++, which presented me with <code>onClick</code>.</p> <p>When I changed the capital <code>C</code> to a...
[ { "answer_id": 87958, "author": "Prestaul", "author_id": 5628, "author_profile": "https://Stackoverflow.com/users/5628", "pm_score": 6, "selected": true, "text": "<div id='divYo' onClick=\"alert('yo!');\">Say Yo</div> // Upper-case 'C'\n <div id='divYo' onclick=\"alert('yo!');\">Say Yo</...
2008/09/17
[ "https://Stackoverflow.com/questions/87934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11795/" ]
87,950
<p>I've been attempting move a directory structure from one location to another in Subversion, but I get an <code>Item '*' is out of date</code> commit error. </p> <p>I have the latest version checked out (so far as I can tell). <code>svn st -u</code> turns up no differences other than the mv commands.</p>
[ { "answer_id": 88079, "author": "Michael", "author_id": 9316, "author_profile": "https://Stackoverflow.com/users/9316", "pm_score": 10, "selected": true, "text": "svn update" }, { "answer_id": 89496, "author": "Aeon", "author_id": 13289, "author_profile": "https://Sta...
2008/09/17
[ "https://Stackoverflow.com/questions/87950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16562/" ]
87,970
<p>I'd like to populate an arraylist by specifying a list of values just like I would an integer array, but am unsure of how to do so without repeated calls to the "add" method.</p> <p>For example, I want to assign { 1, 2, 3, "string1", "string2" } to an arraylist. I know for other arrays you can make the assignment...
[ { "answer_id": 88017, "author": "Sunny Milenov", "author_id": 8220, "author_profile": "https://Stackoverflow.com/users/8220", "pm_score": 4, "selected": true, "text": "object[] myArray = new object[] {1,2,3,\"string1\",\"string2\"};\nArrayList myArrayList = new ArrayList(myArray);\n" }...
2008/09/17
[ "https://Stackoverflow.com/questions/87970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16866/" ]
87,986
<p>In C# you can get the original error and trace the execution path (stack trace) using the inner exception that is passed up. I would like to know how this can be achieved using the error handling try/catch in sql server 2005 when an error occurs in a stored procedure nested 2 or 3 levels deep. </p> <p>I am hoping...
[ { "answer_id": 166372, "author": "Josef", "author_id": 5581, "author_profile": "https://Stackoverflow.com/users/5581", "pm_score": 2, "selected": false, "text": "USE tempdb\ngo\nCREATE PROCEDURE SubProcedure @RandomNumber int, @XMLErrors XML OUTPUT\nAS\nBEGIN\nBEGIN TRY\n IF @RandomNu...
2008/09/17
[ "https://Stackoverflow.com/questions/87986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11989/" ]
87,999
<p>Well the docs finally said it, I need to take it easy on my wrist for a few months. Being that I'm a .NET Developer this could end my livelihood for a little while, something I'm not anxious to do. That said, are there any good handsfree options for developers? Anyone had success using any of the speech recognition...
[ { "answer_id": 350542, "author": "onnodb", "author_id": 1037, "author_profile": "https://Stackoverflow.com/users/1037", "pm_score": 6, "selected": true, "text": "if (somevar == 'a')\n{\n print('You pressed a!');\n}\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16868/" ]
88,011
<p>For various reasons, such as cookies, SEO, and to keep things simple, I would like to make apache automatically redirect any requests for <a href="http://www.foobar.com/anything" rel="nofollow noreferrer">http://www.foobar.com/anything</a> to <a href="http://foobar.com/anything" rel="nofollow noreferrer">http://foob...
[ { "answer_id": 88034, "author": "UnkwnTech", "author_id": 115, "author_profile": "https://Stackoverflow.com/users/115", "pm_score": -1, "selected": false, "text": "RewriteEngine On\nRewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]\nRewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]\n" }, ...
2008/09/17
[ "https://Stackoverflow.com/questions/88011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14569/" ]
88,030
<p>What's the best way to import/export app internal settings into a file from within an app?</p> <p>I have the Settings.settings file, winform UI tied to the settings file, and I want to import/export settings, similar to Visual Studio Import/Export Settings feature. </p>
[ { "answer_id": 88226, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "public static string SerializeToXMLString(object ObjectToSerialize)\nMemoryStream mem = new MemoryStream(); \nSystem.X...
2008/09/17
[ "https://Stackoverflow.com/questions/88030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,036
<p>I need to make an ArrayList of ArrayLists thread safe. I also cannot have the client making changes to the collection. Will the unmodifiable wrapper make it thread safe or do I need two wrappers on the collection?</p>
[ { "answer_id": 88090, "author": "John Gardner", "author_id": 13687, "author_profile": "https://Stackoverflow.com/users/13687", "pm_score": 1, "selected": false, "text": "static class UnmodifiableSet<E> extends UnmodifiableCollection<E>\n implements Set<E>, Serializable;\n...
2008/09/17
[ "https://Stackoverflow.com/questions/88036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13491/" ]
88,078
<p>I wand to construct an MSI which, in its installation process, will deploy itself along with its contained Files/Components, to the TargetDir.</p> <p>So MyApp.msi contains MyApp.exe and MyAppBootstrapperEmpty.exe (with no resources) in its File Table.</p> <p>The user launches a MyAppBootstrapperPackaged.exe (conta...
[ { "answer_id": 90094, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "%TEMP%" }, { "answer_id": 559407, "author": "Wim Coenen", "author_id": 52626, "author_profile": "https://St...
2008/09/17
[ "https://Stackoverflow.com/questions/88078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8787/" ]
88,082
<p>It can be either at compile time or at run-time using a config file. Is there a more elegant way than simple (and many) if statements?</p> <p>I am targeting especially sets of UI controls that comes for a particular feature.</p>
[ { "answer_id": 88101, "author": "Doug Moore", "author_id": 13179, "author_profile": "https://Stackoverflow.com/users/13179", "pm_score": 0, "selected": false, "text": "switch (setting) {\n case \"development\": \n dostuff;\n break\n case \"production\":\n dootherstuff;\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/88082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9411/" ]
88,087
<p>We’re getting the following error message when we click on “Search Settings” for a Shared Services Provider: “Authentication failed because the remote party has closed the transport stream.”</p> <p>This is a new server environment with two web front ends, one database server, and one index server, all running Windo...
[ { "answer_id": 248377, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "#WARNING: AcquireCredentialsHandle failed with error -2146893043(0x8009030d)\n CN={hostname},L=951338967,OU=SharePoint,O=Micro...
2008/09/17
[ "https://Stackoverflow.com/questions/88087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13368/" ]
88,093
<p>What update rate should I run my fixed-rate game logic at?</p> <p>I've used 60 updates per second in the past, but that's hard because it's not an even number of updates per second (16.666666). My current games uses 100, but that seems like overkill for most things.</p>
[ { "answer_id": 88210, "author": "Jeff", "author_id": 16639, "author_profile": "https://Stackoverflow.com/users/16639", "pm_score": 3, "selected": false, "text": "while(1) \n{ \n while(CurrentTime() < lastUpdate + TICK_LENGTH) \n { \n UpdateGame(); \n lastUpdate += TICK_LENGTH;\...
2008/09/17
[ "https://Stackoverflow.com/questions/88093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16679/" ]
88,094
<p>I seem to make this mistake every time I set up a new development box. Is there a way to make sure you don't have to manually assign rights for the ASPNET user? I usually install .Net then IIS, then Visual Studio but it seems I still have to manually assign rights to the ASPNET user to get everything running correct...
[ { "answer_id": 88124, "author": "Jonathan Rupp", "author_id": 12502, "author_profile": "https://Stackoverflow.com/users/12502", "pm_score": 3, "selected": true, "text": "%windir%\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_regiis.exe -i\n %windir%\\Microsoft.NET\\Framework\\v2.0.50727\...
2008/09/17
[ "https://Stackoverflow.com/questions/88094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16636/" ]
88,096
<p>I am working on a project with peek performance requirements, so we need to bulk (batch?) several operations (for example persisting the data to a database) for efficiency.</p> <p>However, I want our code to maintain an easy to understand flow, like:</p> <pre><code>input = Read(); parsed = Parse(input); if (parsed...
[ { "answer_id": 873821, "author": "Robin", "author_id": 108040, "author_profile": "https://Stackoverflow.com/users/108040", "pm_score": 0, "selected": false, "text": "BackgroundWorker using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.ComponentModel;...
2008/09/17
[ "https://Stackoverflow.com/questions/88096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11236/" ]
88,211
<p>The title should say it all, then I can solidify 2 more ticks on the Joel test. </p> <p>I've implemented build automation using a makefile and a python script already and I understand the basics and the options. </p> <p>But how can I, the new guy who reads the blogs, convince my cohort of its inherent efficacy?</p...
[ { "answer_id": 105576, "author": "Vladimir", "author_id": 9641, "author_profile": "https://Stackoverflow.com/users/9641", "pm_score": 1, "selected": false, "text": "to: all developers\n\nGuys,\n\nI've just noticed that I can build our software using the \nlatest version because of the fo...
2008/09/17
[ "https://Stackoverflow.com/questions/88211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1765/" ]
88,222
<p>I'd like know what people think about using RAISERROR in stored procedures to pass back user messages (i.e. business related messages, not error messages) to the application. </p> <p>Some of the senior developers in my firm have been using this method and catching the SqlException in our C# code to pick up the mes...
[ { "answer_id": 91207, "author": "Jonas Lincoln", "author_id": 17436, "author_profile": "https://Stackoverflow.com/users/17436", "pm_score": 0, "selected": false, "text": "CREATE PROCEDURE checkReturnValue\nAS\nBEGIN\n DECLARE @err AS INT\n SET @err = 0\n\n IF (rand() < 0.5)\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/88222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11989/" ]
88,235
<p>Recently I ran into this error in my web application:</p> <blockquote> <p>java.lang.OutOfMemoryError: PermGen space</p> </blockquote> <p>It's a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6. Apparently this can occur after redeploying an application a few times.</p> <p>What ca...
[ { "answer_id": 88262, "author": "Chris", "author_id": 16907, "author_profile": "https://Stackoverflow.com/users/16907", "pm_score": 10, "selected": true, "text": "-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled\n tomcat6w //ES//servicename\n" }, { "answer_id": 89748,...
2008/09/17
[ "https://Stackoverflow.com/questions/88235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16907/" ]
88,259
<p>I tend to use <a href="http://en.wikipedia.org/wiki/SQLite" rel="noreferrer">SQLite</a> when doing <a href="http://en.wikipedia.org/wiki/Django_(web_framework)" rel="noreferrer">Django</a> development, but on a live server something more robust is often needed (<a href="http://en.wikipedia.org/wiki/MySQL" rel="noref...
[ { "answer_id": 88331, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 6, "selected": false, "text": "settings_local.py settings_development.py DEBUG = True settings_production.py SERVER_EMAIL settings.py settings_local.py settings...
2008/09/17
[ "https://Stackoverflow.com/questions/88259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,269
<p>In certain unknown situations selenium does not detect that a page has loaded when using the open method. I am using the Java API. For example (This code will not produce this error. I don't know of an externally visible page that will.):</p> <pre><code>Selenium browser = new DefaultSelenium("localhost", 4444, "*fi...
[ { "answer_id": 88320, "author": "Matthew Jaskula", "author_id": 4356, "author_profile": "https://Stackoverflow.com/users/4356", "pm_score": 0, "selected": false, "text": "SeleniumServer server = new SeleniumServer(4444, false, true);\n" }, { "answer_id": 8079103, "author": "T...
2008/09/17
[ "https://Stackoverflow.com/questions/88269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4356/" ]
88,276
<p>I've been trying to figure this out for about two weeks. I'm able to create email items in people's folders, read the folders, all that stuff but for the life of me I can not get anything to work with the calendars.</p> <p>I can provide examples of the XML I'm sending to WebDav but hoping someone out there has done...
[ { "answer_id": 92523, "author": "Robert Sanders", "author_id": 16952, "author_profile": "https://Stackoverflow.com/users/16952", "pm_score": 2, "selected": false, "text": "T 10.0.1.95:59741 -> 66.211.136.9:80 [AP]\nPUT /exchange/yourname.domainname.com/Cal2/CC1.1163646061548.0.eml HTTP/1...
2008/09/17
[ "https://Stackoverflow.com/questions/88276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,306
<p>I'm making a small web application in Seaside. I have a login component, and after the user logs in I want to send along a cookie when the next component renders itself. Is there a way to get at the object handling the response so I can add something to the headers it will output?</p> <p>I'm trying to avoid using W...
[ { "answer_id": 90695, "author": "Julian", "author_id": 11526, "author_profile": "https://Stackoverflow.com/users/11526", "pm_score": 4, "selected": true, "text": "self requestContext response addCookie: aCookie\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2766176/" ]
88,311
<p>I'm currently generating an 8-character pseudo-random uppercase string for "A" .. "Z":</p> <pre><code>value = ""; 8.times{value &lt;&lt; (65 + rand(25)).chr} </code></pre> <p>but it doesn't look clean, and it can't be passed as an argument since it isn't a single statement. To get a mixed-case string "a" .. "z" ...
[ { "answer_id": 88338, "author": "easeout", "author_id": 10906, "author_profile": "https://Stackoverflow.com/users/10906", "pm_score": 0, "selected": false, "text": "(0...8).collect { |n| value << (65 + rand(25)).chr }.join()\n" }, { "answer_id": 88341, "author": "Kent Fredri...
2008/09/17
[ "https://Stackoverflow.com/questions/88311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10157/" ]
88,325
<p>I have a class:</p> <pre><code>class MyClass: def __init__(self, foo): if foo != 1: raise Error("foo is not equal to 1!") </code></pre> <p>and a unit test that is supposed to make sure the incorrect arg passed to the constructor properly raises an error:</p> <pre><code>def testInsufficientArgs(self): ...
[ { "answer_id": 88346, "author": "Jerub", "author_id": 14648, "author_profile": "https://Stackoverflow.com/users/14648", "pm_score": 6, "selected": true, "text": "class MyClass:\n def __init__(self, foo):\n if foo != 1:\n raise ValueError(\"foo is not equal to 1!\")\n...
2008/09/17
[ "https://Stackoverflow.com/questions/88325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/577/" ]
88,326
<p>Does <a href="http://elmah.github.io/" rel="nofollow noreferrer">ELMAH</a> logged exceptions even when they do not bubble up to the application? I'd like to pop up a message when an exception occurs and still log the exception. Currently I've been putting everything in try catch blocks and spitting out messages, b...
[ { "answer_id": 841426, "author": "Michael La Voie", "author_id": 65843, "author_profile": "https://Stackoverflow.com/users/65843", "pm_score": 7, "selected": false, "text": "try\n{\n int i = 5;\n int j = 0;\n i = i / j; //Throws exception\n}\ncatch (Exception ex)\n{\n MyPerso...
2008/09/17
[ "https://Stackoverflow.com/questions/88326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16891/" ]
88,343
<p>When I try to compile code on VS 2005 and it fails, the line which causes the error gets underlined blue, and mouse-hovering over it displays the error message. Fine, but you can't see object types or whatever, because Intellisense will show the error message, and not object info.</p> <p>In this image, I wanted to ...
[ { "answer_id": 88459, "author": "André Chalella", "author_id": 4850, "author_profile": "https://Stackoverflow.com/users/4850", "pm_score": 0, "selected": false, "text": "View -> IntelliSense -> Quick Info Ctrl+K, Ctrl+I" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4850/" ]
88,359
<p>While searching the interweb for a solution for my VB.net problems I often find helpful articles on a specific topic, but the code is C#. That is no big problem but it cost some time to convert it to VB manually. There are some sites that offer code converters from C# to VB and vice versa, but to fix all the flaws a...
[ { "answer_id": 114152, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": false, "text": "public class FileSystemEventSubscription : EventSubscription\n{\n private FileSystemWatcher fileSystemWatcher;\n\n publi...
2008/09/17
[ "https://Stackoverflow.com/questions/88359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12336/" ]
88,361
<p>I have an Asp.Net repeater, which contains a textbox and a checkbox. I need to add client-side validation that verifies that when the checkbox is checked, the textbox can only accept a value of zero or blank.</p> <p>I would like to use one or more of Asp.Net's validator controls to accomplish this, to provide a co...
[ { "answer_id": 88386, "author": "Doug Moore", "author_id": 13179, "author_profile": "https://Stackoverflow.com/users/13179", "pm_score": 0, "selected": false, "text": "protected MyDataBound(object sender, RepeaterItemEventArgs e) {\n (CheckBox)cb = (CheckBox)e.Item.FindControl(\"myCheck...
2008/09/17
[ "https://Stackoverflow.com/questions/88361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16911/" ]
88,381
<p>we have several <em>"production environments"</em> (three servers each, with the same version of our system. Each one has a SQL Server Database as production database). </p> <p>In one of this environment the <em>tempdb</em> transaction log starts to grow fast and infinitely, we can´t find why. Same version of SO, S...
[ { "answer_id": 88446, "author": "Nick Craver", "author_id": 13249, "author_profile": "https://Stackoverflow.com/users/13249", "pm_score": 0, "selected": false, "text": "DBCC OPENTRAN\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,399
<p>I saw <a href="https://stackoverflow.com/questions/73319/duplicate-a-whole-line-in-vim#73357">this same question for VIM</a> and it has been something that I myself wanted to know how to do for Emacs. In ReSharper I use CTRL-D for this action. What is the least number of commands to perform this in Emacs?</p>
[ { "answer_id": 88468, "author": "Allen", "author_id": 6043, "author_profile": "https://Stackoverflow.com/users/6043", "pm_score": 2, "selected": false, "text": "kill-whole-line" }, { "answer_id": 88588, "author": "sverrejoh", "author_id": 473, "author_profile": "https...
2008/09/17
[ "https://Stackoverflow.com/questions/88399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872/" ]
88,434
<p>I'm trying to build a better username/password field for my workplace and would like to be able to complain when they have their caps lock on.</p> <p>Is this possible? And if so I'd like to have it detected before the client types their first letter.</p> <p>Is there a non-platform specific way to do this?</p>
[ { "answer_id": 88456, "author": "Nick Craver", "author_id": 13249, "author_profile": "https://Stackoverflow.com/users/13249", "pm_score": 6, "selected": true, "text": "Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2443/" ]
88,448
<p>I have a public facing application deployed with Flex. I want to switch to using the cached framework (.swz) but need to know if for my user base this is an effective solution or not (most users will only visit the site once and its just not worth it).</p> <p>What I want to do is track whether or not a user has loa...
[ { "answer_id": 90767, "author": "Seldaek", "author_id": 6512, "author_profile": "https://Stackoverflow.com/users/6512", "pm_score": 0, "selected": false, "text": "grep -c \\.swz web_log_dir/* \ngrep -c \\.swf web_log_dir/*\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16940/" ]
88,454
<p>Most of the MVC samples I have seen pass an instance of the view to the controller like this</p> <pre><code>public class View { Controller controller = new Controller(this); } </code></pre> <p>Is there any advantage to passing a class which provides access to just the the properties and events the controlle...
[ { "answer_id": 90767, "author": "Seldaek", "author_id": 6512, "author_profile": "https://Stackoverflow.com/users/6512", "pm_score": 0, "selected": false, "text": "grep -c \\.swz web_log_dir/* \ngrep -c \\.swf web_log_dir/*\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35031/" ]
88,460
<p>I'm trying to use libvirt with virsh to manage my kvm/qemu vms. The problem I have is with getting it to work with public IPs. The server is running ubuntu 8.04.</p> <p>libvirt keeps trying to run it as:</p> <pre><code>/usr/bin/kvm -M pc -m 256 -smp 3 -monitor pty -no-acpi \ -drive file=/opt/virtual-machines/c...
[ { "answer_id": 90689, "author": "AgentK", "author_id": 14868, "author_profile": "https://Stackoverflow.com/users/14868", "pm_score": 4, "selected": true, "text": "auto eth0\niface eth0 inet manual\n\nauto br0\niface br0 inet static\n address 192.168.0.10\n network 192.168.0...
2008/09/17
[ "https://Stackoverflow.com/questions/88460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11105/" ]
88,471
<p>I have searched for such a plugin but haven't found any. I need a facility to "tag" my java files. Similar to tagging on stackoverflow.</p> <p>I want to be able to group my files based on projects/tasks I wam working on. Mylyn helps a little but it dynamically changes the context (list of resources associated with ...
[ { "answer_id": 97820, "author": "Scott Stanchfield", "author_id": 12541, "author_profile": "https://Stackoverflow.com/users/12541", "pm_score": 0, "selected": false, "text": "public interface Observer {} // no required methods\n public class SomeClass implements Observer {...}\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,473
<p>Does anybody know how to apply a "where in values" type condition using LINQ-to-Entities? I've tried the following but it doesn't work:</p> <pre><code>var values = new[] { "String1", "String2" }; // some string values var foo = model.entitySet.Where(e =&gt; values.Contains(e.Name)); </code></pre> <p>I believe t...
[ { "answer_id": 88486, "author": "Aaron Powell", "author_id": 11388, "author_profile": "https://Stackoverflow.com/users/11388", "pm_score": 0, "selected": false, "text": "SELECT [t0].[col1]\nFROM [table] [t0]\nWHERE [col1] IN ( 'Value 1', 'Value 2')\n" }, { "answer_id": 88495, ...
2008/09/17
[ "https://Stackoverflow.com/questions/88473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16948/" ]
88,476
<p>I'm a little hesitant to post this, as I'm not completely sure what I'm doing. Any help would be wonderful.</p> <p>I'm on a computer with a firewall/filter on it. I can download files without any difficulty. When I try to clone files from Github, though, the computer just hangs. Nothing happens. It creates a git fi...
[ { "answer_id": 88492, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "git://" }, { "answer_id": 2382585, "author": "rogerdpack", "author_id": 32453, "author_profile": "http...
2008/09/17
[ "https://Stackoverflow.com/questions/88476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69299/" ]
88,481
<p>I see that Adobe AIR uses WebKit as its render and I see that WebKit (at least the most current build) has some SVG support. Does this mean (and has anyone specifically tried) that an Adobe AIR application could render SVG on an HTML page?</p>
[ { "answer_id": 227999, "author": "aaaidan", "author_id": 26331, "author_profile": "https://Stackoverflow.com/users/26331", "pm_score": 2, "selected": false, "text": "[Embed(source=\"assets/frog.svg\")]\n[Bindable]\npublic var SvgAsset:Class;\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8256/" ]
88,485
<p>This is a follow up question to <a href="https://stackoverflow.com/questions/85815/how-to-tell-if-a-javascript-function-is-defined">This Question</a>. </p> <p>I like (and understand) the solution there. However, in the code I am working in, another way to solve the same problem is used:</p> <pre><code>function exi...
[ { "answer_id": 88498, "author": "kch", "author_id": 13989, "author_profile": "https://Stackoverflow.com/users/13989", "pm_score": 2, "selected": false, "text": "typeof typeof(foobar) // -> undefined\ntypeof(alert) // -> function\n function isfun(sym) { return typeof(sym) } isfun(inexi...
2008/09/17
[ "https://Stackoverflow.com/questions/88485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2515/" ]
88,488
<p>Is there a way to get a <code>DrawingContext</code> (or something similar) for a <code>WriteableBitmap</code>? I.e. something to allow you to call simple <code>DrawLine</code>/<code>DrawRectangle</code>/etc kinds of methods, rather than manipulate the raw pixels directly.</p>
[ { "answer_id": 88531, "author": "user7116", "author_id": 7116, "author_profile": "https://Stackoverflow.com/users/7116", "pm_score": 3, "selected": false, "text": "DrawingVisual drawingVisual = new DrawingVisual();\nusing (DrawingContext drawingContext = drawingVisual.RenderOpen())\n{\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/88488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2495/" ]
88,489
<p><strong>Keep in mind that I'm not looking for a list of current browsers to support, I'm looking for logical ways to make that list, backed by some kind of hard statistics.</strong> </p> <p>Since it's been a while since my last web job, I decided to do this latest site up from scratch. Now I have to decide <em>agai...
[ { "answer_id": 88538, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 6, "selected": true, "text": "alt" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16398/" ]
88,490
<p>Is there a difference between just saying <code>throw;</code> and <code>throw ex;</code> assuming <code>ex</code> is the exception you're catching?</p>
[ { "answer_id": 88502, "author": "GEOCHET", "author_id": 5640, "author_profile": "https://Stackoverflow.com/users/5640", "pm_score": 6, "selected": true, "text": "throw ex; throw;" }, { "answer_id": 88577, "author": "Eric Schoonover", "author_id": 3957, "author_profile...
2008/09/17
[ "https://Stackoverflow.com/questions/88490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16891/" ]
88,518
<p>I'm a complete perl novice, am running a perl script using perl 5.10 and getting this warning: </p> <pre><code>$* is no longer supported at migrate.pl line 380. </code></pre> <p>Can anyone describe what $* did and what the recommended replacement of it is now? Alternatively if you could point me to documentation t...
[ { "answer_id": 88528, "author": "Leon Timmermans", "author_id": 4727, "author_profile": "https://Stackoverflow.com/users/4727", "pm_score": 1, "selected": false, "text": "m s s/\\n?Project.*rebuilt\\.//msg\n" }, { "answer_id": 88540, "author": "Michael Carman", "author_i...
2008/09/17
[ "https://Stackoverflow.com/questions/88518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8479/" ]
88,522
<p>I wanting to show prices for my products in my online store. I'm currently doing:</p> <pre><code>&lt;span class="ourprice"&gt; &lt;%=GetPrice().ToString("C")%&gt; &lt;/span&gt; </code></pre> <p>Where GetPrice() returns a decimal. So this currently returns a value e.g. "£12.00"</p> <p>I think the correct HTML...
[ { "answer_id": 88535, "author": "Nick Craver", "author_id": 13249, "author_profile": "https://Stackoverflow.com/users/13249", "pm_score": 2, "selected": false, "text": "<%=String.Format(\"{0:C}\",GetPrice())%>\n" }, { "answer_id": 88555, "author": "Claus Thomsen", "author...
2008/09/17
[ "https://Stackoverflow.com/questions/88522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11538/" ]
88,541
<p>I’ve been reading a few questions and answers regarding exceptions and their use. Seems to be a strong opinion that exceptions should be raised only for exception, unhandled cases. So that lead me to wondering how validation works with business objects.</p> <p>Lets say I have a business object with getters/setters ...
[ { "answer_id": 88733, "author": "Matt Howells", "author_id": 16881, "author_profile": "https://Stackoverflow.com/users/16881", "pm_score": 2, "selected": false, "text": "[MinValue(10), MaxValue(20)]\npublic int Value { get; set; }\n" }, { "answer_id": 88770, "author": "Rob Gr...
2008/09/17
[ "https://Stackoverflow.com/questions/88541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11355/" ]
88,546
<p>In Perl, a conditional can be expressed either as</p> <pre><code>if (condition) { do something } </code></pre> <p>or as</p> <pre><code>(condition) and do { do something } </code></pre> <p>Interestingly, the second way seems to be about 10% faster. Does anyone know why?</p>
[ { "answer_id": 88611, "author": "Leon Timmermans", "author_id": 4727, "author_profile": "https://Stackoverflow.com/users/4727", "pm_score": 4, "selected": false, "text": "LISTOP (0x8177a18) leave [1] \n OP (0x8176590) enter \n COP (0x8177a40) nextstate \n LISTOP (0x8177b20) scop...
2008/09/17
[ "https://Stackoverflow.com/questions/88546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,554
<p>In <em>C++</em>, I can have take input like this: </p> <pre><code>cin &gt;&gt; a &gt;&gt; b &gt;&gt; c; </code></pre> <p>And <code>a</code> can be <code>int</code>, <code>b</code> can be <code>float</code>, and <code>c</code> can be whatever... How do I do the same in <em>python</em>?</p> <p><code>input()</code> ...
[ { "answer_id": 88587, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "input() int float >>> line = raw_input().split()\n>>> a = int(line[0])\n>>> b = float(line[1])\n>>> c = \" \".join(line[2:])\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/88554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10096/" ]
88,558
<p>I am making a game in C++ and am having problems with my derived class. I have a base class called GameScreen which has a vitrual void draw() function with no statements. I also have a derived class called MenuScreen which also has a virtual void draw() function and a derived class from MenuScreen called TestMenu ...
[ { "answer_id": 90612, "author": "Johann Gerell", "author_id": 6345, "author_profile": "https://Stackoverflow.com/users/6345", "pm_score": 1, "selected": false, "text": "std::vector<> #include <vector>\n#include <algorithm>\n\nstruct Base\n{\n virtual void Foo() = 0;\n virtual ~Base...
2008/09/17
[ "https://Stackoverflow.com/questions/88558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,566
<p>In a custom module for drupal 4.7 I hacked together a node object and passed it to node_save($node) to create nodes. This hack appears to no longer work in drupal 6. While I'm sure this hack could be fixed I'm curious if there is a standard solution to create nodes without a form. In this case the data is pulled ...
[ { "answer_id": 88876, "author": "calebbrown", "author_id": 7007, "author_profile": "https://Stackoverflow.com/users/7007", "pm_score": 4, "selected": true, "text": "node_add() node_form() node_object_prepare()" }, { "answer_id": 90437, "author": "William OConnor - csevb10", ...
2008/09/17
[ "https://Stackoverflow.com/questions/88566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10393/" ]
88,570
<p>Does anyone know if it's possible to use regex capture within Apache's DirectoryMatch directive? I'd like to do something like the following:</p> <pre><code>&lt;DirectoryMatch ^/home/www/(.*)&gt; AuthType Basic AuthName $1 AuthUserFile /etc/apache2/svn.passwd Require group $1 admin &lt;/DirectoryMat...
[ { "answer_id": 91535, "author": "innaM", "author_id": 7498, "author_profile": "https://Stackoverflow.com/users/7498", "pm_score": 3, "selected": true, "text": "<Perl>\nmy @groups = qw/ foo bar baz /;\nforeach ( @groups ) {\n push @PerlConfig, qq| <Directory /home/www/$_> blah </Direct...
2008/09/17
[ "https://Stackoverflow.com/questions/88570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16960/" ]
88,573
<p>In C++, you can specify that a function may or may not throw an exception by using an exception specifier. For example:</p> <pre><code>void foo() throw(); // guaranteed not to throw an exception void bar() throw(int); // may throw an exception of type int void baz() throw(...); // may throw an exception of some uns...
[ { "answer_id": 88599, "author": "Branan", "author_id": 13894, "author_profile": "https://Stackoverflow.com/users/13894", "pm_score": 2, "selected": false, "text": "throw()" }, { "answer_id": 88905, "author": "Christopher", "author_id": 3186, "author_profile": "https:/...
2008/09/17
[ "https://Stackoverflow.com/questions/88573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3146/" ]
88,582
<p>For a small project I have to parse pdf files and take a specific part of them (a simple chain of characters). I'd like to use python to do this and I've found several libraries that are capable of doing what I want in some ways.</p> <p>But now after a few researches, I'm wondering what is the real structure of a p...
[ { "answer_id": 57220079, "author": "keithchristian", "author_id": 7396580, "author_profile": "https://Stackoverflow.com/users/7396580", "pm_score": 0, "selected": false, "text": "pdfinfo -layout some_pdf_file.pdf\n some_pdf_file.txt grep -a --color=always \"\\\\\\\\[0-9][0-9][0-9]\" some...
2008/09/17
[ "https://Stackoverflow.com/questions/88582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11544/" ]
88,613
<p>How do I tokenize the string:</p> <pre><code>&quot;2+24*48/32&quot; </code></pre> <p>Into a list:</p> <pre><code>['2', '+', '24', '*', '48', '/', '32'] </code></pre>
[ { "answer_id": 88639, "author": "Cristian", "author_id": 680, "author_profile": "https://Stackoverflow.com/users/680", "pm_score": 2, "selected": false, "text": ">>> import re\n>>> splitter = re.compile(r'([+*/])')\n>>> splitter.split(\"2+24*48/32\")\n" }, { "answer_id": 88663, ...
2008/09/17
[ "https://Stackoverflow.com/questions/88613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,615
<p>Given an arbitrary string, what is an efficient method of finding duplicate phrases? We can say that phrases must be longer than a certain length to be included.</p> <p>Ideally, you would end up with the number of occurrences for each phrase.</p>
[ { "answer_id": 88765, "author": "Sridhar Iyer", "author_id": 13820, "author_profile": "https://Stackoverflow.com/users/13820", "pm_score": 3, "selected": true, "text": "js" }, { "answer_id": 580135, "author": "Community", "author_id": -1, "author_profile": "https://St...
2008/09/17
[ "https://Stackoverflow.com/questions/88615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337/" ]
88,618
<p>We have a medium sized .js file that we include in our web framework that I am porting over to SharePoint. However, I'm not sure how to go about this or what the best practice is. This is for a framework solution that will be used by other client projects, so it's best for it to be self contained and deploy-able, ra...
[ { "answer_id": 93475, "author": "andrew", "author_id": 17767, "author_profile": "https://Stackoverflow.com/users/17767", "pm_score": 0, "selected": false, "text": "<TemplateFiles>\n <TemplateFile Location=\"LAYOUTS\\somescript.js\" />\n</TemplateFiles>\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1685/" ]