qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
249,372
<p>Given two integers <code>a</code> and <code>b</code>, how would I go about calculating the repeating decimal of <code>a / b</code>? This can be in any language; whatever it's easiest for you to express it in.</p>
[ { "answer_id": 251597, "author": "ShreevatsaR", "author_id": 4958, "author_profile": "https://Stackoverflow.com/users/4958", "pm_score": 3, "selected": false, "text": "a / b b O(b) O(b) def divide(a, b):\n '''Returns the decimal representation of the fraction a / b in three parts:\n in...
2008/10/30
[ "https://Stackoverflow.com/questions/249372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15055/" ]
249,374
<p>Is anyone familiar with this?</p> <blockquote> <p>Write a procedure that takes as inputs a procedure that computes f and a positive integer n and returns the procedure that computes the nth repeated application of f. The procedure should be able to be used as follows:</p> <pre><code>((repeated square...
[ { "answer_id": 249490, "author": "Matthias Benkard", "author_id": 15517, "author_profile": "https://Stackoverflow.com/users/15517", "pm_score": 1, "selected": false, "text": "((repeated square 3) 5)\n-> (square ((repeated square 2) 5))\n-> (square (square ((repeated square 1) 5)))\n-> (s...
2008/10/30
[ "https://Stackoverflow.com/questions/249374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30622/" ]
249,375
<p>How do you programmatically set a DataContext that specifies the selected item of a list? </p> <p>More simply, how do you reproduce this type of binding in code?</p> <pre><code>&lt;StackPanel&gt; &lt;ListBox Name="listBox1" /&gt; &lt;TextBox Name="textBox1" DataContext="{Binding ElementName=listBox1, Path=...
[ { "answer_id": 249378, "author": "Ty.", "author_id": 16948, "author_profile": "https://Stackoverflow.com/users/16948", "pm_score": 4, "selected": true, "text": "Binding binding = new Binding();\nbinding.ElementName = \"listBox1\";\nbinding.Path = new PropertyPath(\"SelectedItem\");\nbind...
2008/10/30
[ "https://Stackoverflow.com/questions/249375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25968/" ]
249,388
<p>I'm having trouble getting pictures supported with PIL - it throws me this:</p> <pre><code>IOError: decoder jpeg not available </code></pre> <p>I installed PIL from binary, not realizing I needed libjpeg.</p> <p>I installed libjpeg and freetype2 through fink. </p> <p>I tried to reinstall PIL using instructions f...
[ { "answer_id": 4533995, "author": "Walty Yeung", "author_id": 176423, "author_profile": "https://Stackoverflow.com/users/176423", "pm_score": 0, "selected": false, "text": "file /usr/local/lib/libjpeg.7.dylib \n cd ImageSrc\n\npython setup.py build_ext -i\n\notool -L PIL/_imaging.so \n c...
2008/10/30
[ "https://Stackoverflow.com/questions/249388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20824/" ]
249,392
<p>How would I implement a binary search using just an array? </p>
[ { "answer_id": 249404, "author": "mmcdole", "author_id": 2635, "author_profile": "https://Stackoverflow.com/users/2635", "pm_score": 6, "selected": true, "text": "BinarySearch(A[0..N-1], value, low, high) { \n if (high < low) \n return -1 // not found \n mid = low + ((hig...
2008/10/30
[ "https://Stackoverflow.com/questions/249392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15055/" ]
249,423
<p>Can someone explain to me how XOR swapping of two variables with no temp variable works?</p> <pre><code>void xorSwap (int *x, int *y) { if (x != y) { *x ^= *y; *y ^= *x; *x ^= *y; } } </code></pre> <p>I understand WHAT it does, but can someone walk me through the logic of how it wor...
[ { "answer_id": 249427, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 4, "selected": false, "text": "tmp = x\nx = y\ny = tmp\n x = x xor y\ny = x xor y\nx = x xor y\n ADD 3 A // add 3 to register A\n" }, { "answer_id": 2...
2008/10/30
[ "https://Stackoverflow.com/questions/249423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2635/" ]
249,448
<p>I have a textbox with the <strong>Text</strong> property bound to a dataset column with the DataType set to System.DateTime.<br> The FormatString on the Binding is set to <strong>dd-MM-yyyy</strong>.</p> <p>When the user enters a date it attempts to convert it to a date but can come up with some strange values for ...
[ { "answer_id": 249519, "author": "Joe", "author_id": 13087, "author_profile": "https://Stackoverflow.com/users/13087", "pm_score": 3, "selected": true, "text": "private void textBox1_Validating(object sender, CancelEventArgs e)\n{\n DateTime date;\n if (!DateTime.TryParseExact(text...
2008/10/30
[ "https://Stackoverflow.com/questions/249448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490/" ]
249,452
<p>How to add new item in existing string array in C#.net?</p> <p>I need to preserve the existing data.</p>
[ { "answer_id": 249455, "author": "Ed S.", "author_id": 1053, "author_profile": "https://Stackoverflow.com/users/1053", "pm_score": 7, "selected": false, "text": "List<string> ls = new List<string>();\nls.Add(\"Hello\");\n" }, { "answer_id": 249486, "author": "Ali Ersöz", ...
2008/10/30
[ "https://Stackoverflow.com/questions/249452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
249,460
<p>On Windows Mobile, I am displaying my output in HTML. This includes lots of user-generated strings. Occasionally there are situations where a really large string is part of the output that has no whitespaces or punctuation. </p> <p>Unfortunately the Windows Mobile's HTML view (htmlview.dll, based on Pocket Internet...
[ { "answer_id": 249455, "author": "Ed S.", "author_id": 1053, "author_profile": "https://Stackoverflow.com/users/1053", "pm_score": 7, "selected": false, "text": "List<string> ls = new List<string>();\nls.Add(\"Hello\");\n" }, { "answer_id": 249486, "author": "Ali Ersöz", ...
2008/10/30
[ "https://Stackoverflow.com/questions/249460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27101/" ]
249,461
<p>I want to compute for month difference of 2 dates which will return a float value.</p> <p>example:</p> <p>date1='4/23/2008' date2='12/31/2008'</p> <p>that will be 7.y months. I want to find the y value. can someone give me the formula to make this in sql codes? tnx..</p>
[ { "answer_id": 249477, "author": "a2800276", "author_id": 27408, "author_profile": "https://Stackoverflow.com/users/27408", "pm_score": 1, "selected": false, "text": "to_date()" }, { "answer_id": 249481, "author": "Ali Ersöz", "author_id": 4215, "author_profile": "htt...
2008/10/30
[ "https://Stackoverflow.com/questions/249461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21963/" ]
249,467
<p>I've heard of "error" when using floating point variables. Now I'm trying to solve this puzzle and I think I'm getting some rounding/floating point error. So I'm finally going to figure out the basics of floating point error.</p> <p>What is a simple example of floating point/rounding error (preferably in C++) ?</...
[ { "answer_id": 249498, "author": "Matthew Schinckel", "author_id": 188, "author_profile": "https://Stackoverflow.com/users/188", "pm_score": 4, "selected": false, "text": "Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26) \n[GCC 4.0.1 (Apple Inc. build 5465)] on darwin\nType \"help\", \"c...
2008/10/30
[ "https://Stackoverflow.com/questions/249467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22471/" ]
249,468
<p>I'm looking at stdint.h and given that it has uint16_t and uint_fast16_t, what is the use for uint_least16_t what might you want that couldn't be done equally well with one of the other two?</p>
[ { "answer_id": 249482, "author": "Michael Burr", "author_id": 12711, "author_profile": "https://Stackoverflow.com/users/12711", "pm_score": 5, "selected": true, "text": "unsigned char unsigned short unsigned int uint16_t uint_least16_t uint_fast16_t" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10471/" ]
249,470
<p>What would be a simple implementation of a method to convert a String like "Hello there everyone" to "helloThereEveryone". In JavaME support for String and StringBuffer utility operations are quite limited.</p>
[ { "answer_id": 249512, "author": "PhiLho", "author_id": 15459, "author_profile": "https://Stackoverflow.com/users/15459", "pm_score": 3, "selected": true, "text": "String str = \"Hello, there, everyone?\";\n\nStringBuffer result = new StringBuffer(str.length());\nString strl = str.toLowe...
2008/10/30
[ "https://Stackoverflow.com/questions/249470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22012/" ]
249,489
<p>I hope someone will be able to answer my question.</p> <p>I have Subversion set up, served by Apache2+SSL, doing web development.</p> <p>I want a post-commit hook that runs svn update on my testing server, so when someone commits, it will automatically update the testing site. The hook doesn't work because the cer...
[ { "answer_id": 6049056, "author": "ownking", "author_id": 275443, "author_profile": "https://Stackoverflow.com/users/275443", "pm_score": 0, "selected": false, "text": "svn co file:///path_to/your/repo\n" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
249,499
<p>Evaluate:</p> <pre><code>((((lambda (x) (lambda (y) (lambda (x) (+ x y)))) 3) 4) 5) </code></pre> <p>This is what I did:</p> <ul> <li><p>evaluate <code>((((lambda (x) (lambda (y) (lambda (x) (+ x y)))) 3) 4) 5)</code></p> <ul> <li>evaluate <code>5 -&gt; 5</code></li> </ul></li> <li><p>evaluate <code>(((lambda (x...
[ { "answer_id": 249520, "author": "leppie", "author_id": 15541, "author_profile": "https://Stackoverflow.com/users/15541", "pm_score": 2, "selected": false, "text": "(define part1 (lambda (y) (lambda (x) (+ x y)))) ; basically an adder\n(define part2 (lambda (x) part1)) ; just return par...
2008/10/30
[ "https://Stackoverflow.com/questions/249499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30622/" ]
249,500
<p>OK, I have a somewhat complicated system in C++. In a nutshell, I need to add a method to a third party abstract base class. The third party also provides a ton of derived classes that also need the new functionality.</p> <p>I'm using a library that provides a standard Shape interface, as well as some common shapes...
[ { "answer_id": 249666, "author": "Dave Hillier", "author_id": 1575281, "author_profile": "https://Stackoverflow.com/users/1575281", "pm_score": 3, "selected": false, "text": "class ImprovedShape : public virtual Shape\n{\n virtual double GetArea() const = 0;\n};\n class ThingWithArea ...
2008/10/30
[ "https://Stackoverflow.com/questions/249500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3175/" ]
249,536
<p>FindBugs has found a potential bug in my code. But it is not a bug.</p> <p>Is it possible to mark this occurrence as 'not a bug' AND have it removed from the bug list?</p> <p>I have documented quite clearly why for each case it is not a bug.</p> <p>For example. A class implements the comparable interface. it has ...
[ { "answer_id": 249543, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 3, "selected": false, "text": "<Match>\n <Class name=\"com.foobar.MyClass\" />\n <Method name=\"myMethod\" />\n <Bug pattern=\"EQ_COMPARETO_USE_OBJECT_E...
2008/10/30
[ "https://Stackoverflow.com/questions/249536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/939/" ]
249,540
<p>How do I specify the username and password in order for my program to open a file for reading? The program that needs to access the file is running from an account that does not have read access to the folder the file is in. Program is written in C# and .NET 2, running under XP and file is on a Windows Server 2003 m...
[ { "answer_id": 249594, "author": "James Newton-King", "author_id": 11829, "author_profile": "https://Stackoverflow.com/users/11829", "pm_score": 4, "selected": false, "text": "using (new Impersonator(\"myUsername\", \"myDomainname\", \"myPassword\"))\n{\n string fileText = File.ReadAllT...
2008/10/30
[ "https://Stackoverflow.com/questions/249540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
249,557
<blockquote> <p>If f is a numerical function and n is a positive integer, then we can form the nth repeated application of f, which is defined to be the function whose value at x is f(f(...(f(x))...)). For example, if f is the function x + 1, then the nth repeated application of f is the function x + n. If f is the ope...
[ { "answer_id": 249564, "author": "Matthias Benkard", "author_id": 15517, "author_profile": "https://Stackoverflow.com/users/15517", "pm_score": 1, "selected": false, "text": "((repeated square 3) 5)\n-> (square ((repeated square 2) 5))\n-> (square (square ((repeated square 1) 5)))\n-> (s...
2008/10/30
[ "https://Stackoverflow.com/questions/249557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30622/" ]
249,567
<p>What would be the best way to avoid SQL injection on the C#.net platform.</p> <p>Please post an C# implementation if you have any.</p>
[ { "answer_id": 249582, "author": "Greg Beech", "author_id": 13552, "author_profile": "https://Stackoverflow.com/users/13552", "pm_score": 5, "selected": false, "text": "' '' using (var connection = new SqlConnection(\"...\"))\nusing (var command = new SqlCommand(\"MySprocName\", connecti...
2008/10/30
[ "https://Stackoverflow.com/questions/249567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11135/" ]
249,570
<p>On a particular Debian server, iostat (and similar) report an unexpectedly high volume (in bytes) of disk writes going on. I am having trouble working out which process is doing these writes.</p> <p>Two interesting points:</p> <ol> <li><p>Tried turning off system services one at a time to no avail. Disk activity...
[ { "answer_id": 395362, "author": "Igor Pozgaj", "author_id": 19777, "author_profile": "https://Stackoverflow.com/users/19777", "pm_score": 2, "selected": false, "text": "CONFIG_TASKSTATS=y\nCONFIG_TASK_IO_ACCOUNTING=y\n" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
249,573
<p>There is small system, where a database table as queue on MSSQL 2005. Several applications are writing to this table, and one application is reading and processing in a FIFO manner.</p> <p>I have to make it a little bit more advanced to be able to create a distributed system, where several processing application ca...
[ { "answer_id": 249688, "author": "mjallday", "author_id": 6084, "author_profile": "https://Stackoverflow.com/users/6084", "pm_score": 1, "selected": false, "text": "update mytable with (rowlock) set x=y where a=b\n" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/968/" ]
249,578
<p>I'm writing a bash script that needs to delete old files.</p> <p>It's currently implemented using :</p> <pre><code>find $LOCATION -name $REQUIRED_FILES -type f -mtime +1 -delete </code></pre> <p>This will delete of the files older than 1 day.</p> <p>However, what if I need a finer resolution that 1 day, say like...
[ { "answer_id": 249584, "author": "GavinCattell", "author_id": 21644, "author_profile": "https://Stackoverflow.com/users/21644", "pm_score": 2, "selected": false, "text": "man find\n" }, { "answer_id": 249591, "author": "Paul Dixon", "author_id": 6521, "author_profile"...
2008/10/30
[ "https://Stackoverflow.com/questions/249578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13523/" ]
249,580
<p>What is the recommended practice? Should I add the my sub-folder under the fitnesse folder to version control? </p> <p><em>Context: working on a single developer rails pet project. I've my rails project under version-control (Subversion) however my fitnesse wiki pages lie under the fitnesse program folder.</em><...
[ { "answer_id": 446230, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 6, "selected": true, "text": "-d Fitnesse20081201>run -p 8080 -d c:/projects/MyProjectNeedsAcceptanceTests\n content.txt properties.xml" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695/" ]
249,581
<p>I have checked with the <a href="http://en.wikipedia.org/wiki/Facade_pattern" rel="noreferrer">wikipedia article</a>, and it seems like it is missing the c++ version of a code example. I am not able to fully appreciate the Facade pattern without this, can you please help explain it to me using C++?</p>
[ { "answer_id": 249656, "author": "Dave Hillier", "author_id": 1575281, "author_profile": "https://Stackoverflow.com/users/1575281", "pm_score": 3, "selected": false, "text": "// \"Subsystem ClassA\" \n#include <iostream>\nclass SubSystemOne\n{\npublic:\n void MethodOne()\n {\n ...
2008/10/30
[ "https://Stackoverflow.com/questions/249581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22076/" ]
249,587
<p>I want to scale an image in C# with quality level as good as Photoshop does. Is there any C# image processing library available to do this thing?</p>
[ { "answer_id": 249601, "author": "Hallgrim", "author_id": 15454, "author_profile": "https://Stackoverflow.com/users/15454", "pm_score": 4, "selected": false, "text": "Bitmap original = ...\nBitmap scaled = new Bitmap(new Size(original.Width * 4, original.Height * 4));\nusing (Graphics gr...
2008/10/30
[ "https://Stackoverflow.com/questions/249587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191/" ]
249,607
<p>I am using Visual C++ 2005 Express Edition and get the following linker errors:</p> <pre><code>19&gt;mylib1.lib(mylibsource1.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::exception::_Raise(void)const " (__imp_?_Raise@exception@std@@QBEXXZ) referenced in functio...
[ { "answer_id": 249685, "author": "MSalters", "author_id": 15416, "author_profile": "https://Stackoverflow.com/users/15416", "pm_score": 0, "selected": false, "text": "#define the _HAS_EXCEPTIONS 0" }, { "answer_id": 254069, "author": "Jim Buck", "author_id": 2666, "au...
2008/10/30
[ "https://Stackoverflow.com/questions/249607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2666/" ]
249,618
<p>Can anyone explain to me how to get the visual state manager to work with a WPF application? It's just been added to the new wpftoolkit. I installed it as told, but even the sample doesn't show the VSM. In silverlight it work, but not in WPF. If installed the latest Blend 2 and updated with the SP1. </p>
[ { "answer_id": 249833, "author": "Sorskoot", "author_id": 31722, "author_profile": "https://Stackoverflow.com/users/31722", "pm_score": 2, "selected": false, "text": "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Expression\\Blend\n [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Expression\\Blend]...
2008/10/30
[ "https://Stackoverflow.com/questions/249618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31722/" ]
249,637
<p>Let's suppose I have an applet running within a page in a browser. What happens when the browser is closed by the user?</p> <p>Is the applet notified so that it can perform some kind of close action on its side (closing connections opened to a server, cleaning static variables, ...)?</p> <p>Also, I assume the same...
[ { "answer_id": 249643, "author": "keparo", "author_id": 19468, "author_profile": "https://Stackoverflow.com/users/19468", "pm_score": 3, "selected": true, "text": "public void finalize () {\n destroy();\n}\n" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7218/" ]
249,655
<p>I work on a large project in Delphi 5. Today, after merging two branches of the app together, one of the hundreds of units, UnitMain (the main form's unit, would you guess) stopped recognizing the Application global.</p> <p>This is a rather bizarre problem - I could get the program to compile by defining Applicatio...
[ { "answer_id": 249669, "author": "Re0sless", "author_id": 2098, "author_profile": "https://Stackoverflow.com/users/2098", "pm_score": 2, "selected": false, "text": "unit MyUnit;\n\ninterface\n\nuses\n Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms;\n" }, {...
2008/10/30
[ "https://Stackoverflow.com/questions/249655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15477/" ]
249,657
<p>could someone provide working example (full maven plugin configuration) how to copy built jar file to a specific server(s) at the time of deploy phase?</p> <p>I have tried to look at wagon plugin, but it is hugely undocumented and I was not able to set it up. The build produces standard jar that is being deployed t...
[ { "answer_id": 250021, "author": "Petr Macek", "author_id": 15045, "author_profile": "https://Stackoverflow.com/users/15045", "pm_score": 3, "selected": false, "text": "<plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-dependency-plugin</artifactId>\n <executi...
2008/10/30
[ "https://Stackoverflow.com/questions/249657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15045/" ]
249,664
<p>I found the discussion on <a href="https://stackoverflow.com/questions/105007/do-you-test-private-method">Do you test private method</a> informative.</p> <p>I have decided, that in some classes, I want to have protected methods, but test them. Some of these methods are static and short. Because most of the public m...
[ { "answer_id": 249776, "author": "troelskn", "author_id": 18180, "author_profile": "https://Stackoverflow.com/users/18180", "pm_score": 6, "selected": false, "text": "class Foo {\n protected function stuff() {\n // secret stuff, you want to test\n }\n}\n\nclass SubFoo extends Foo {\...
2008/10/30
[ "https://Stackoverflow.com/questions/249664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32679/" ]
249,667
<p>Say you get a recordset like the following:</p> <pre><code>| ID | Foo | Bar | Red | |-----|------|------|------| | 1 | 100 | NULL | NULL | | 1 | NULL | 200 | NULL | | 1 | NULL | NULL | 300 | | 2 | 400 | NULL | NULL | | ... | ... | ... | ... | -- etc. </code></pre> <p>And you want:</p> <pre><cod...
[ { "answer_id": 249719, "author": "Eoin Campbell", "author_id": 30155, "author_profile": "https://Stackoverflow.com/users/30155", "pm_score": 1, "selected": true, "text": "CREATE TABLE Flatten (\n id int not null,\n foo Nvarchar(10) null,\n bar Nvarchar(10) null,\n red Nvarcha...
2008/10/30
[ "https://Stackoverflow.com/questions/249667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15031/" ]
249,671
<p>I have created the following style for a listbox that will have an image displayed next to some text:</p> <pre><code>&lt;Style x:Key="ImageListBoxStyle" TargetType="{x:Type ListBox}"&gt; &lt;Setter Property="SnapsToDevicePixels" Value="true"/&gt; &lt;Setter Property="BorderThickness" Value="1"/&gt; &lt;...
[ { "answer_id": 258612, "author": "Bijington", "author_id": 32348, "author_profile": "https://Stackoverflow.com/users/32348", "pm_score": 5, "selected": false, "text": "<Setter Property=\"FontWeight\" Value=\"Bold\"/>\n<Setter Property=\"Foreground\" Value=\"White\"/>\n TargetName=\"Displ...
2008/10/30
[ "https://Stackoverflow.com/questions/249671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32348/" ]
249,692
<p>I'm having difficulty parsing some JSON data returned from my server using jQuery.ajax()</p> <p>To perform the AJAX I'm using:</p> <pre><code>$.ajax({ url: myUrl, cache: false, dataType: "json", success: function(data){ ... }, error: function(e, xhr){ ... } }); </code></pre> <p>And if I re...
[ { "answer_id": 249758, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 7, "selected": true, "text": "\"*/json\" \"application/json\"" }, { "answer_id": 250245, "author": "Josh", "author_id": 2204759, "aut...
2008/10/30
[ "https://Stackoverflow.com/questions/249692", "https://Stackoverflow.com", "https://Stackoverflow.com/users/366/" ]
249,701
<p>I have a header file x.h which is included by more than one *.c source files. This header file has some structure variables defined.</p> <p>I have put multiple inclusion prevention guard at the beginning of the header file as:</p> <pre><code>#ifndef X_H #define X_H ... .. //header file declarations and definitons...
[ { "answer_id": 249707, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "extern" }, { "answer_id": 249745, "author": "Roddy", "author_id": 1737, "author_profile": "https://St...
2008/10/30
[ "https://Stackoverflow.com/questions/249701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2759376/" ]
249,703
<p>I have some scripts that ought to have stopped running but hang around forever. Is there some way I can figure out what they're writing to STDOUT and STDERR in a readable way?</p> <p>I tried, for example, to do:</p> <pre><code>$ tail -f /proc/(pid)/fd/1 </code></pre> <p>but that doesn't really work. It was a lo...
[ { "answer_id": 249932, "author": "Thomas Vander Stichele", "author_id": 2900, "author_profile": "https://Stackoverflow.com/users/2900", "pm_score": 6, "selected": false, "text": "creat import time\n\nwhile True:\n print 'test'\n time.sleep(1)\n $ python test.py\n $ ps auxw | grep t...
2008/10/30
[ "https://Stackoverflow.com/questions/249703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2900/" ]
249,704
<p>Has anyone tested sorting with Selenium? I'd like to verify that sorting a table in different ways work (a-z, z-a, state, date, etc.). Any help would be very much appreciated.</p> <p>/Göran</p>
[ { "answer_id": 296686, "author": "krosenvold", "author_id": 23691, "author_profile": "https://Stackoverflow.com/users/23691", "pm_score": 0, "selected": false, "text": " //div[@id='sortResult']/div[1]/div (this'd be row 1 of the search result)\n //div[@id='sortResult']/div[2]/div ( ro...
2008/10/30
[ "https://Stackoverflow.com/questions/249704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
249,709
<p>How can i, in a bash script, execute a command when the user stops the script (with ctrl - c)?</p> <p>Currently, i have this:</p> <pre><code>afplay file.mp3 while true: do osascript -e "set volume 10" end </code></pre> <p>But i would like it to execute <code>killall afplay</code> when the user is finished with i...
[ { "answer_id": 249733, "author": "Vebjorn Ljosa", "author_id": 17498, "author_profile": "https://Stackoverflow.com/users/17498", "pm_score": 4, "selected": true, "text": "trap 'killall afplay' EXIT" }, { "answer_id": 249736, "author": "CesarB", "author_id": 28258, "au...
2008/10/30
[ "https://Stackoverflow.com/questions/249709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2592/" ]
249,718
<p>Already implemented performance boosters : - Get compatible image of GraphicsConfiguration to draw on - Enable OpenGL pipeline in 1.5: Not possible due to severe artifacts</p> <p>So far I am fine, the main profiled bottleneck of the program is drawing an image with several thousand tiles. Unfortunately it is not re...
[ { "answer_id": 249920, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "import javax.swing.*;\nimport java.awt.*;\nimport java.awt.event.WindowAdapter;\nimport java.awt.event.WindowEvent;\nimport ja...
2008/10/30
[ "https://Stackoverflow.com/questions/249718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
249,720
<p>I'm using the Lengauer and Tarjan algorithm with path compression to calculate the dominator tree for a graph where there are millions of nodes. The algorithm is quite complex and I have to admit I haven't taken the time to fully understand it, I'm just using it. Now I have a need to calculate the dominator trees of...
[ { "answer_id": 252927, "author": "jfs", "author_id": 4279, "author_profile": "https://Stackoverflow.com/users/4279", "pm_score": 4, "selected": true, "text": "boost::lengauer_tarjan_dominator_tree_without_dfs" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15379/" ]
249,721
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/249760/how-to-convert-unix-timestamp-to-datetime-and-vice-versa">How to convert UNIX timestamp to DateTime and vice versa?</a> </p> </blockquote> <p>I've got the following class:</p> <pre><code>[DataContractAt...
[ { "answer_id": 251804, "author": "Dan Esparza", "author_id": 19020, "author_profile": "https://Stackoverflow.com/users/19020", "pm_score": 2, "selected": false, "text": "new System.DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(1221818565);\n {9/19/2008 10:02:45 AM}\n Date: {9/19/2008 12...
2008/10/30
[ "https://Stackoverflow.com/questions/249721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/986/" ]
249,724
<p>How can I customise the Site Actions menu to remove or rename 'standard' menu items? Where are the site actions menu items defined? </p>
[ { "answer_id": 257789, "author": "Lachlan Wetherall", "author_id": 32701, "author_profile": "https://Stackoverflow.com/users/32701", "pm_score": 2, "selected": false, "text": "ConfigMenu=\"Delete\" <ConsoleNode ConfigMenu=\"Delete\" ChangedNodeID=\"wsaCreateSite\" />\n" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32701/" ]
249,729
<p>I am writing a Jython script to sort a list of URLs.</p> <p>I have a list that looks like this:</p> <p><a href="http://www.domain.com/folder1/folder2/|,1" rel="nofollow noreferrer">http://www.domain.com/folder1/folder2/|,1</a><br /> <a href="http://www.domain.com/folder1/|,1" rel="nofollow noreferrer">http://www.d...
[ { "answer_id": 249754, "author": "bobince", "author_id": 18936, "author_profile": "https://Stackoverflow.com/users/18936", "pm_score": 3, "selected": true, "text": "urls.sort(lambda a, b: cmp(len(a), len(b)))\n urllengths= [(len(url), url) for url in urls]\nurllengths.sort()\nurls= [url ...
2008/10/30
[ "https://Stackoverflow.com/questions/249729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30786/" ]
249,760
<p>There is this example code, but then it starts talking about millisecond / nanosecond problems.</p> <p>The same question is on MSDN, <em><a href="https://learn.microsoft.com/archive/blogs/brada/seconds-since-the-unix-epoch-in-c" rel="noreferrer">Seconds since the Unix epoch in C#</a></em>.</p> <p>This is what I've...
[ { "answer_id": 250400, "author": "ScottCher", "author_id": 24179, "author_profile": "https://Stackoverflow.com/users/24179", "pm_score": 11, "selected": true, "text": "public static DateTime UnixTimeStampToDateTime( double unixTimeStamp )\n{\n // Unix timestamp is seconds past epoch\n...
2008/10/30
[ "https://Stackoverflow.com/questions/249760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/986/" ]
249,775
<p>Say I have an input file, and a target directory. How do I determine if the input file is on the same hard-drive (or partition) as the target directory?</p> <p>What I want to do is the copy a file if it's on a different, but move it if it's the same. For example:</p> <pre><code>target_directory = "/Volumes/externa...
[ { "answer_id": 249796, "author": "CesarB", "author_id": 28258, "author_profile": "https://Stackoverflow.com/users/28258", "pm_score": 5, "selected": true, "text": "stat() st_dev os.stat import os\ndef same_partition(f1, f2):\n return os.stat(f1).st_dev == os.stat(f2).st_dev\n" }, ...
2008/10/30
[ "https://Stackoverflow.com/questions/249775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745/" ]
249,779
<p>I'm using a <code>BindingList&lt;T&gt;</code> in my Windows Forms that contains a list of "<code>IComparable&lt;Contact&gt;</code>" Contact-objects. Now I'd like the user to be able to sort by any column displayed in the grid.</p> <p>There is a way described on MSDN online which shows how to implement a custom coll...
[ { "answer_id": 281324, "author": "Matthias Meid", "author_id": 17713, "author_profile": "https://Stackoverflow.com/users/17713", "pm_score": 5, "selected": false, "text": "BindingList<T> ApplySortCore protected override void ApplySortCore(PropertyDescriptor property, ListSortDirection di...
2008/10/30
[ "https://Stackoverflow.com/questions/249779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17713/" ]
249,780
<p>I have a really simple search form with the following</p> <ul> <li>Label ("Search")</li> <li>Textbox (fixed width)</li> <li>Submit button</li> <li>"Advanced" link</li> </ul> <p>Label, textbox and submit are all on one horizontal line and centered. Now I would like my advanced link to be under the submit button.</p...
[ { "answer_id": 249790, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 3, "selected": true, "text": " Search [xxxxxxxxxxxxxxxx] [Submit]\n Advanced\n <div style=\"width: 300px...
2008/10/30
[ "https://Stackoverflow.com/questions/249780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
249,785
<p>Simply moving the file to <code>~/.Trash/</code> will not work, as if the file os on an external drive, it will move the file to the main system drive..</p> <p>Also, there are other conditions, like files on external drives get moved to <code>/Volumes/.Trash/501/</code> (or whatever the current user's ID is)</p> <...
[ { "answer_id": 251566, "author": "Dave Dribin", "author_id": 26825, "author_profile": "https://Stackoverflow.com/users/26825", "pm_score": 4, "selected": true, "text": "url = NSURL.fileURLWithPath(path)\nfinder = SBApplication.applicationWithBundleIdentifier(\"com.apple.Finder\")\nitem =...
2008/10/30
[ "https://Stackoverflow.com/questions/249785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745/" ]
249,786
<p>I'm at a client doing some quick fixes to their access application. It was a while I had a go with access, but I'm recovering quickly. However, I've discovered an interesting problem:</p> <p>For some reports, I get a "Record is deleted" error. I've checked the reports, and it seems like there's a problem with one t...
[ { "answer_id": 252357, "author": "David-W-Fenton", "author_id": 9787, "author_profile": "https://Stackoverflow.com/users/9787", "pm_score": 2, "selected": false, "text": " Me!txtMyMemo = Me!MyMemo\n Me!MyMemo = Me!txtMyMemo\n Me.Dirty = False ' save the whole record\n" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17436/" ]
249,791
<p>How do I get the substring <code>" It's big \"problem "</code> using a regular expression?</p> <pre><code>s = ' function(){ return " It\'s big \"problem "; }'; </code></pre>
[ { "answer_id": 249804, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": false, "text": "/([\"\\']).*?(?<!\\\\)(\\\\\\\\)*\\1/is\n" }, { "answer_id": 249937, "author": "PhiLho", "author_id": 15459, ...
2008/10/30
[ "https://Stackoverflow.com/questions/249791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
249,794
<p>I'me looking for a function that would receive a time and would round it to the next/previous hour / half-hour / quarter / minute.</p>
[ { "answer_id": 249828, "author": "IAdapter", "author_id": 30453, "author_profile": "https://Stackoverflow.com/users/30453", "pm_score": 6, "selected": true, "text": "CREATE FUNCTION [dbo].[RoundTime] (@Time datetime, @RoundTo float)\nRETURNS datetime\nAS\nBEGIN\n DECLARE @RoundedTime s...
2008/10/30
[ "https://Stackoverflow.com/questions/249794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1842864/" ]
249,797
<p>I'm currently using the ActiveRecord-based session store for my Rails app and I have a background process which clears out inactive sessions every 30 minutes.</p> <p>I'd like to switch to Rails' new cookie-based session store but how do I set the expiry time of the session to 30 minutes, as opposed to the default '...
[ { "answer_id": 249966, "author": "Codebeef", "author_id": 12037, "author_profile": "https://Stackoverflow.com/users/12037", "pm_score": -1, "selected": false, "text": "session :session_key => 'my_session_key'\nsession :session_expires => 1.day.from_now\n ActionController::Base.session_op...
2008/10/30
[ "https://Stackoverflow.com/questions/249797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1174/" ]
249,819
<p>I have the following sql query for transforming data but is it possible to save the value of the int in some variable to avoid casting multiple times?</p> <pre><code>update prospekts set sni_kod = case when cast(sni_kod as int) &gt;= 1000 and cast(sni_kod as int) &lt;= 1499 or cast(sni_kod as int) &gt;= ...
[ { "answer_id": 249836, "author": "Dave Markle", "author_id": 24995, "author_profile": "https://Stackoverflow.com/users/24995", "pm_score": 1, "selected": false, "text": "With xxx AS (\n i_sni_kod = cast(sni_kod as int)\n ...)\nUPDATE prospekts set sni_kod = case \n when i_sni_...
2008/10/30
[ "https://Stackoverflow.com/questions/249819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22092/" ]
249,847
<p>I am wondering how to use NUnit correctly. First, I created a separate test project that uses my main project as reference. But in that case, I am not able to test private methods. My guess was that I need to include my test code into my main code?! - That doesn't seem to be the correct way to do it. (I dislike the ...
[ { "answer_id": 9035421, "author": "user1039513", "author_id": 1039513, "author_profile": "https://Stackoverflow.com/users/1039513", "pm_score": 6, "selected": false, "text": "private MethodInfo GetMethod(string methodName)\n{\n if (string.IsNullOrWhiteSpace(methodName))\n Asser...
2008/10/30
[ "https://Stackoverflow.com/questions/249847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32726/" ]
249,860
<p>How can i restrict adding controls in Panel in C# window controls? I have to restrict user to add controls in a panel at design time.</p>
[ { "answer_id": 249934, "author": "Rune Grimstad", "author_id": 30366, "author_profile": "https://Stackoverflow.com/users/30366", "pm_score": 1, "selected": false, "text": "class MyPanel : Panel\n{\n\n public MyPanel()\n { }\n\n protected override void OnControlAdded(ControlEvent...
2008/10/30
[ "https://Stackoverflow.com/questions/249860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31159/" ]
249,865
<p>We're seeing the error message ORA-00936 Missing Expression for the following SQL:</p> <p>Note that this is just a cut-down version of a much bigger SQL so rewriting it to a inner join or similar is not really in the scope of this:</p> <p>This is the SQL that fails:</p> <pre><code>select (select count(*) from gt_...
[ { "answer_id": 249915, "author": "Tony Andrews", "author_id": 18747, "author_profile": "https://Stackoverflow.com/users/18747", "pm_score": 2, "selected": true, "text": "SQL> select (select count(*) from emp2 where empdeptno = deptno)\n 2 from dept\n 3 where deptno=10\n 4 /\n\n(SEL...
2008/10/30
[ "https://Stackoverflow.com/questions/249865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/267/" ]
249,866
<p>I'm creating a <code>Path</code> in <em>Silverlight</em>, and adding elements to it on mouse events. But, although the elements are there in memory, the screen doesn't get updated until something else causes a screen repaint to happen.</p> <p>Here's the relevant code - I'm responding to a mouse event, and I keep a ...
[ { "answer_id": 250873, "author": "Bryant", "author_id": 10893, "author_profile": "https://Stackoverflow.com/users/10893", "pm_score": 0, "selected": false, "text": "<UserControl x:Class=\"SilverlightTesting.Page\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" \...
2008/10/30
[ "https://Stackoverflow.com/questions/249866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6483/" ]
249,867
<p>I was wondering if in Java I would get any odd behaviour if I synchronise twice on the same object?</p> <p>The scenario is as follows</p> <pre><code>pulbic class SillyClassName { object moo; ... public void method1(){ synchronized(moo) { .... method2(); ...
[ { "answer_id": 249888, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "synchronized" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20400/" ]
249,868
<p>I'd like to have a page in php that normally displays information based on the GET request sent to it. However, I'd like for it to also be able to process certain POST requests. So, how can I tell if any data was sent by POST so I can act on it?</p>
[ { "answer_id": 249873, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 6, "selected": true, "text": "$_SERVER['REQUEST_METHOD'] $_POST" }, { "answer_id": 249879, "author": "moo", "author_id": 23107, "author_p...
2008/10/30
[ "https://Stackoverflow.com/questions/249868", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25680/" ]
249,878
<p>If it said "oneword", then I could write "#oneword", but what do I write when there is a space in the word?</p>
[ { "answer_id": 249887, "author": "Philip Morton", "author_id": 21709, "author_profile": "https://Stackoverflow.com/users/21709", "pm_score": 5, "selected": false, "text": "<p class=\"one two\">lalala</p>\n\n.one {\n color: black;\n}\n\n.two {\n font-weight: bold;\n} \n" }, {...
2008/10/30
[ "https://Stackoverflow.com/questions/249878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9328/" ]
249,883
<p>I have two XML files with two different XSD schemas and different namespaces. They have both an identical substructure. And now i need to copy that node (and all childs) from one XML document to the other one. </p> <p>Clone would do, if the namespaces were the same. Is there a nice way to do it? (The substructure ...
[ { "answer_id": 250057, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 3, "selected": true, "text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<test xmlns=\"http://tempuri.org/ns_old\">\n <child attrib=\"value\">text</c...
2008/10/30
[ "https://Stackoverflow.com/questions/249883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32726/" ]
249,901
<p>What is the equivalent to web controls in frameworks other than ASP.Net?</p> <p>Specifically I'd like to know about Java, PHP and Ruby on Rails.</p> <p>What are the relative merits/faults of each of these frameworks for web development?</p> <p>I've had some exposure to ASP.Net and have been asked to look into dev...
[ { "answer_id": 249949, "author": "Jon Limjap", "author_id": 372, "author_profile": "https://Stackoverflow.com/users/372", "pm_score": 1, "selected": false, "text": "<input> <submit>" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20400/" ]
249,916
<p>The <code>java.net.InetAddress.GetByName(String host)</code> method can only return <code>A</code> records so to lookup other record types I need to be able to send DNS queries using the <code>dnsjava</code> library.</p> <p>However that normally relies on being able to parse <code>/etc/resolv.conf</code> or similar...
[ { "answer_id": 385806, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 3, "selected": false, "text": "WiFiManager wifi = (WifiManager) getSystemService(WIFI_SERVICE); \nDhcpInfo info = wifi.getDhcpInfo(); \n" }, { ...
2008/10/30
[ "https://Stackoverflow.com/questions/249916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6782/" ]
249,926
<pre><code>&lt;a id="lblShowTimings" runat="server" title='&lt;%# Eval("SHOW_Name") %&gt;' onclick='PopulateTicketDiv(&lt;%#Eval("SHOW_ID") %&gt;)'&gt; &lt;-- this is the problem %#Eval("SHOW_Time") %&gt; &lt;/a&gt; </code></pre> <p>Can Eval be passed as an argument to a javascript function? If so wh...
[ { "answer_id": 249986, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 6, "selected": true, "text": "onclick='<%# \"PopulateTicketDiv(\" +Eval(\"SHOW_ID\") + \" );\" %>'\n" }, { "answer_id": 250004, "author": ...
2008/10/30
[ "https://Stackoverflow.com/questions/249926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17447/" ]
249,927
<p>How can I restart(recycle) IIS Application Pool from C# (.net 2)?</p> <p>Appreciate if you post sample code?</p>
[ { "answer_id": 249942, "author": "dove", "author_id": 30913, "author_profile": "https://Stackoverflow.com/users/30913", "pm_score": 7, "selected": true, "text": "// Gets the application pool collection from the server.\n[ModuleServiceMethod(PassThrough = true)]\npublic ArrayList GetAppli...
2008/10/30
[ "https://Stackoverflow.com/questions/249927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
249,928
<p>I have an executable that is started by a windows service, this program will be run on a customers machine and will need to connect to a remote share to perform a particular task. This share is specified by the customer via a UI, so we do not know this in advance meaning it can't be "hard-coded", or the share mapped...
[ { "answer_id": 249951, "author": "Treb", "author_id": 22114, "author_profile": "https://Stackoverflow.com/users/22114", "pm_score": 0, "selected": false, "text": "cmd.exe" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15297/" ]
249,968
<p>I have written a web app in PHP which makes use of Ajax requests (made using YUI.util.Connect.asyncRequest).</p> <p>Most of the time, this works fine. The request is sent with an <strong>X-Requested-With</strong> value of <strong>XMLHttpRequest</strong>. My PHP controller code uses apache_request_headers() to che...
[ { "answer_id": 250242, "author": "Till", "author_id": 2859, "author_profile": "https://Stackoverflow.com/users/2859", "pm_score": 0, "selected": false, "text": "$_SERVER" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24106/" ]
249,971
<p>Having some Geometry data and a Transform how can the transform be applied to the Geometry to get a new Geometry with it's data transformed ?</p> <p>Ex: I Have a Path object that has it's Path.Data set to a PathGeometry object, I want to tranform <strong>the points</strong> of the PathGeometry object <strong>in pla...
[ { "answer_id": 250587, "author": "Todd White", "author_id": 30833, "author_profile": "https://Stackoverflow.com/users/30833", "pm_score": 5, "selected": true, "text": "PathGeometry geometry = new PathGeometry();\ngeometry.Figures.Add(new PathFigure(new Point(10, 10), new PathSegment[] { ...
2008/10/30
[ "https://Stackoverflow.com/questions/249971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4685/" ]
249,979
<p>In the below code snippet can i replace char * to const char * and remove the strdup() function call and directly take the optarg value set by getopt()? I am advised to use const char * to skip the strdup function usage. Appreciate the help in advance.</p> <pre><code>/* Code Snippet */ char *dir = NULL; char *bld ...
[ { "answer_id": 250587, "author": "Todd White", "author_id": 30833, "author_profile": "https://Stackoverflow.com/users/30833", "pm_score": 5, "selected": true, "text": "PathGeometry geometry = new PathGeometry();\ngeometry.Figures.Add(new PathFigure(new Point(10, 10), new PathSegment[] { ...
2008/10/30
[ "https://Stackoverflow.com/questions/249979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18657/" ]
249,987
<p>We'd like to start our bug numbers to something other than 1 for a new Bugzilla installation. Is there a way to do this?</p>
[ { "answer_id": 250130, "author": "Richard Morgan", "author_id": 2258, "author_profile": "https://Stackoverflow.com/users/2258", "pm_score": 3, "selected": false, "text": "ALTER TABLE bugs AUTO_INCREMENT = 100;\n" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/249987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2258/" ]
249,991
<p>I am trying to read a custom (non-standard) CSS property, set in a stylesheet (not the inline style attribute) and get its value. Take this CSS for example:</p> <pre><code>#someElement { foo: 'bar'; } </code></pre> <p>I have managed to get its value with the currentStyle property in IE7:</p> <pre><code>var elem...
[ { "answer_id": 265566, "author": "scunliffe", "author_id": 6144, "author_profile": "https://Stackoverflow.com/users/6144", "pm_score": 2, "selected": false, "text": "var firstSS = document.styleSheets[0];\nvar firstSSRule = firstSS.rules[0];\nif(typeof(firstSSRule.style.bar) != 'undefine...
2008/10/30
[ "https://Stackoverflow.com/questions/249991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27741/" ]
249,994
<p>I have a dump of a windows service i made. The exception is that my code can't move a file (for some reason). Now, in my code there's a number of places where i move files around the filesystem. So, using Windbg, i'm trying to see the code where the exception occurs.</p> <p>here's my !clrstack dump..</p> <pre><cod...
[ { "answer_id": 265566, "author": "scunliffe", "author_id": 6144, "author_profile": "https://Stackoverflow.com/users/6144", "pm_score": 2, "selected": false, "text": "var firstSS = document.styleSheets[0];\nvar firstSSRule = firstSS.rules[0];\nif(typeof(firstSSRule.style.bar) != 'undefine...
2008/10/30
[ "https://Stackoverflow.com/questions/249994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
250,000
<p>We all know that alerts are bad. If you didn't know it read <a href="http://www.codinghorror.com/blog/archives/000114.html" rel="nofollow noreferrer">this</a></p> <p>Alerts are used to communicate with the user. So if we don't use them what is a good alternative? </p> <p>I'd like to get a nice list of good alterna...
[ { "answer_id": 250181, "author": "John Rudy", "author_id": 14048, "author_profile": "https://Stackoverflow.com/users/14048", "pm_score": 0, "selected": false, "text": "Text * ErrorMessage ValidationSummary Text ErrorMessage ValidationSummary ErrorProvider ErrorProvider" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/250000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22673/" ]
250,001
<p>Can someone define what exactly 'POCO' means? I am encountering the term more and more often, and I'm wondering if it is only about plain classes or it means something more?</p>
[ { "answer_id": 250006, "author": "David Mohundro", "author_id": 4570, "author_profile": "https://Stackoverflow.com/users/4570", "pm_score": 9, "selected": true, "text": "public class Person\n{\n public string Name { get; set; }\n\n public int Age { get; set; }\n}\n public class Per...
2008/10/30
[ "https://Stackoverflow.com/questions/250001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30726/" ]
250,033
<p>C++: Since a struct is a class with everything "public", are default -ctors created and called?</p> <p>The reason I ask is to understand the overhead, if any, that C++ may have over C, when structs are used. An opinion I have heard is that classes have some overhead that structs don't, in C++, but I question this.<...
[ { "answer_id": 250426, "author": "Steve Jessop", "author_id": 13005, "author_profile": "https://Stackoverflow.com/users/13005", "pm_score": 4, "selected": false, "text": "struct sPOD {\n int foo;\n float bar;\n char baz[23];\n};\n sPOD s1;\n" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/250033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
250,037
<p>I have a gridview and I need to sort its elements when the user clicks on the header.<br> Its datasource is a List object.</p> <p>The aspx is defined this way :</p> <pre><code>&lt;asp:GridView ID="grdHeader" AllowSorting="true" AllowPaging="false" AutoGenerateColumns="false" Width="780" runat="server" OnSort...
[ { "answer_id": 250571, "author": "Michael DeLorenzo", "author_id": 1383003, "author_profile": "https://Stackoverflow.com/users/1383003", "pm_score": 1, "selected": false, "text": "List<V_ReportPeriodStatusEntity> items = GetPeriodStatusesForScreenSelection(); items.Sort(new Helpers.Gener...
2008/10/30
[ "https://Stackoverflow.com/questions/250037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28544/" ]
250,055
<p>I'd like to warn users when they <strong>try to close a browser window</strong> if they <strong>didn't save</strong> the changes they made in the web form.</p> <p>I'm using ASP.NET 3.5 (with ASP.NET Ajax).</p> <p>Is there a common solution which I could easily implement?</p> <p><em>EDIT: maybe my question wasn't ...
[ { "answer_id": 250078, "author": "Anders", "author_id": 25515, "author_profile": "https://Stackoverflow.com/users/25515", "pm_score": 0, "selected": false, "text": "<body onunload=\"onPageUnload();\"> <script language=\"text/javascript\">\n function onPageUnload() {\n var oConfi...
2008/10/30
[ "https://Stackoverflow.com/questions/250055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6461/" ]
250,062
<p>I have been hearing a lot about Ruby and possibly even Javascript being "true" object oriented languages as opposed to C++ and C# which are class oriented (or template based) languages. What is meant by true OO and what are the advantages of this over the class/template approach?</p>
[ { "answer_id": 250098, "author": "Firas Assaad", "author_id": 23153, "author_profile": "https://Stackoverflow.com/users/23153", "pm_score": 5, "selected": true, "text": "1.to_s str(1) String.valueOf(1)" }, { "answer_id": 277066, "author": "Johannes Schaub - litb", "author...
2008/10/30
[ "https://Stackoverflow.com/questions/250062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31188/" ]
250,082
<p>I have a makefile template to compile a single DLL (for a plugin system). The makefile of the user looks like this:</p> <pre><code>EXTRA_SRCS=file1 file2 include makefile.in </code></pre> <p>In the <code>makefile.in</code> I have:</p> <pre><code>plugin.dll: plugin.os $(patsubst %,%.os,$(EXTRA_SRCS)) </code></pre>...
[ { "answer_id": 250163, "author": "JesperE", "author_id": 13051, "author_profile": "https://Stackoverflow.com/users/13051", "pm_score": 5, "selected": true, "text": "$(wildcard *.h)\n $(wildcard $(HEADER_FILES))\n" }, { "answer_id": 250795, "author": "m0j0", "author_id": 3...
2008/10/30
[ "https://Stackoverflow.com/questions/250082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7136/" ]
250,096
<p>I'm trying to code opposite action to this:</p> <pre><code>std::ostream outs; // properly initialized of course std::set&lt;int&gt; my_set; // ditto outs &lt;&lt; my_set.size(); std::copy( my_set.begin(), my_set.end(), std::ostream_iterator&lt;int&gt;( outs ) ); </code></pre> <p>it should be something like this:<...
[ { "answer_id": 250380, "author": "Dominik Grabiec", "author_id": 3719, "author_profile": "https://Stackoverflow.com/users/3719", "pm_score": 2, "selected": false, "text": "std::istream ins;\nstd::set<int> my_set;\nstd::vector<int> my_vec;\n\nstruct read_functor\n{\n read_functor(std::...
2008/10/30
[ "https://Stackoverflow.com/questions/250096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21009/" ]
250,134
<p>What is the difference between <code>int *a[3]</code> and <code>int (*a)[3]</code>?</p>
[ { "answer_id": 250164, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 4, "selected": false, "text": "int a[3] int (a)[3] a int int *a[3] int (*a)[3] int int" }, { "answer_id": 250174, "author": "CAdaker", ...
2008/10/30
[ "https://Stackoverflow.com/questions/250134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
250,137
<p>I have the following legacy code:</p> <pre><code>public class MyLegacyClass { private static final String jndiName = "java:comp/env/jdbc/LegacyDataSource" public static SomeLegacyClass doSomeLegacyStuff(SomeOtherLegacyClass legacyObj) { // do stuff using jndiName } } </code></pre> <p>This c...
[ { "answer_id": 250272, "author": "David Santamaria", "author_id": 24097, "author_profile": "https://Stackoverflow.com/users/24097", "pm_score": 1, "selected": false, "text": "DataSource datasource = (DataSource)initialContext.lookup(DATASOURCE_CONTEXT);\n BasicDataSource dataSource = n...
2008/10/30
[ "https://Stackoverflow.com/questions/250137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32749/" ]
250,151
<p>When I see Lua, the only thing I ever read is "great for embedding", "fast", "lightweight" and more often than anything else: "World of Warcraft" or in short "WoW".</p> <p>Why is it limited to embedding the whole thing into another application? Why not write general-purpose scripts like you do with Python or Perl?<...
[ { "answer_id": 326660, "author": "Norman Ramsey", "author_id": 41661, "author_profile": "https://Stackoverflow.com/users/41661", "pm_score": 3, "selected": false, "text": "osutil os.quote os.runf os.capture os.execve posixutil.lua" }, { "answer_id": 1537777, "author": "Arthur...
2008/10/30
[ "https://Stackoverflow.com/questions/250151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32756/" ]
250,157
<p>When you have a complex property, should you instantiate it or leave it to the user to instantiate it?</p> <p>For example (C#)</p> <p>A)</p> <pre><code> class Xyz{ List&lt;String&gt; Names {get; set;} } </code></pre> <p>When I try to use, I have to set it.</p> <pre><code>... Xyz xyz = new Xyz(); xyz.Name ...
[ { "answer_id": 250193, "author": "kͩeͣmͮpͥ ͩ", "author_id": 26479, "author_profile": "https://Stackoverflow.com/users/26479", "pm_score": 2, "selected": false, "text": "class XYZ \n{\n public XYZ () { Names = new List<string>(); }\n public List<string> Names { get; private set; }\n}\...
2008/10/30
[ "https://Stackoverflow.com/questions/250157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2017/" ]
250,166
<p>I have an application that I'm trying to wrap into a jar for easier deployment. The application compiles and runs fine (in a Windows cmd window) when run as a set of classes reachable from the CLASSPATH. But when I jar up my classes and try to run it with java 1.6 in the same cmd window, I start getting exceptions...
[ { "answer_id": 8838405, "author": "g_tom", "author_id": 1145934, "author_profile": "https://Stackoverflow.com/users/1145934", "pm_score": 5, "selected": false, "text": "-jar java -cp MyJar.jar;C:\\externalJars\\* mainpackage.MyMainClass" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/250166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13140/" ]
250,175
<p>When writing my own auto updater, is there a general framework that I should be following?</p> <p>A while ago I was reading up on how one should create a 'boot strapper' that will load first before the main application (since a running appilation can't be updated due to file locks etc.)</p> <p>So any tips/best pra...
[ { "answer_id": 1220670, "author": "Cheeso", "author_id": 48082, "author_profile": "https://Stackoverflow.com/users/48082", "pm_score": 1, "selected": false, "text": " _Updater = new AppUpdater.SimpleAppUpdater(_MyManifestUrl);\n _Updater.Startup(App.CommandLineArgs);\n _Worker = new ...
2008/10/30
[ "https://Stackoverflow.com/questions/250175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
250,189
<p>I'm currently installing and configuring an open source project on a test server. I've been well trained to use source control, and I want to make sure everything I do is managed properly (both for me, the sole dev/admin, and for future maintaners). The open source project is available as a source download or by svn...
[ { "answer_id": 1220670, "author": "Cheeso", "author_id": 48082, "author_profile": "https://Stackoverflow.com/users/48082", "pm_score": 1, "selected": false, "text": " _Updater = new AppUpdater.SimpleAppUpdater(_MyManifestUrl);\n _Updater.Startup(App.CommandLineArgs);\n _Worker = new ...
2008/10/30
[ "https://Stackoverflow.com/questions/250189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8092/" ]
250,191
<p>I have a menu of product brands that I want to split over 4 columns. So if I have 39 brands, then I want the maximum item count for each column to be 10 (with a single gap in the last column. Here's how I'm calculating the item count for a column (using C#):</p> <pre><code>int ItemCount = Convert.ToInt32(Math.Cei...
[ { "answer_id": 250205, "author": "GavinCattell", "author_id": 21644, "author_profile": "https://Stackoverflow.com/users/21644", "pm_score": 3, "selected": false, "text": "ItemCount = BrandCount / 4;\nif (BrandCount%4 > 0) ItemCount++;\n" }, { "answer_id": 250206, "author": "k...
2008/10/30
[ "https://Stackoverflow.com/questions/250191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/203/" ]
250,197
<p>I am attempting to compose a style sheet that, given an XML input (obviously) and a parameter that specifies a "target", will produce a list of commands that match that target. Here is the style sheet as written:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Tr...
[ { "answer_id": 250337, "author": "Tim C", "author_id": 7585, "author_profile": "https://Stackoverflow.com/users/7585", "pm_score": 6, "selected": true, "text": "xsltproc --stringparam target cora_cmd gen-commands.xsl commands.xml\n" }, { "answer_id": 259119, "author": "ChuckB...
2008/10/30
[ "https://Stackoverflow.com/questions/250197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19674/" ]
250,207
<p>How to host the WCF service in windows service?</p> <p>Thanks Sekar</p>
[ { "answer_id": 250231, "author": "John Sibly", "author_id": 1078, "author_profile": "https://Stackoverflow.com/users/1078", "pm_score": 3, "selected": false, "text": " [RunInstaller(true)]\n public class ProjectInstaller : Installer\n {\n }\n installutil myservicename.exe\n" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/250207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
250,209
<p>I'm relatively new to the Python world, but this seems very straight forward.</p> <p>Google is yelling at me that this code needs to be optimized:</p> <pre><code>class AddLinks(webapp.RequestHandler): def post(self): # Hash the textarea input to generate pseudo-unique value hash = md5.new(...
[ { "answer_id": 250294, "author": "monkut", "author_id": 24718, "author_profile": "https://Stackoverflow.com/users/24718", "pm_score": 2, "selected": false, "text": "unsplitlinks = self.request.get('links')\n" }, { "answer_id": 250322, "author": "Andre Bossard", "author_id...
2008/10/30
[ "https://Stackoverflow.com/questions/250209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9094/" ]
250,214
<p>I am updating a VBA program (excel). At startup the program checks if it can find a directory which is on the office file server using:</p> <pre><code>FileSystemObject.FolderExists("\\servername\path") </code></pre> <p>If this is not found the program switches to offline mode and saves its output to the local hard...
[ { "answer_id": 11306581, "author": "Rob Gibson", "author_id": 1498067, "author_profile": "https://Stackoverflow.com/users/1498067", "pm_score": 0, "selected": false, "text": "Dir Dir(\"\\\\Servername\\aFolder\\\", vbDirectory)\n" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/250214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32763/" ]
250,216
<p>Is there a good way to determine if a person has a popup blocker enabled? I need to maintain a web application that unfortunately has tons of popups throughout it and I need to check if the user has popup blockers enabled.</p> <p>The only way I've found to do this is to open a window from javascript, check to see i...
[ { "answer_id": 250267, "author": "Andre Bossard", "author_id": 21027, "author_profile": "https://Stackoverflow.com/users/21027", "pm_score": 4, "selected": true, "text": "var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');\nif(mine)\n var popUpsBlocked = false...
2008/10/30
[ "https://Stackoverflow.com/questions/250216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2849/" ]
250,228
<p>I have a page with many forms on it. could be 1..200. None of these forms have buttons and they are built programatically. I am using jquery to submit all the forms that are checked.</p> <pre><code> function FakeName() { $("input:checked").parent("form").submit(); } </code></pre> <p>My forms l...
[ { "answer_id": 250259, "author": "Gareth", "author_id": 31582, "author_profile": "https://Stackoverflow.com/users/31582", "pm_score": 3, "selected": true, "text": "onsubmit processRow() .submit() <form> <form>" }, { "answer_id": 250315, "author": "Brian G", "author_id": 3...
2008/10/30
[ "https://Stackoverflow.com/questions/250228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3208/" ]
250,238
<p>We have a git project which has quite a big history.</p> <p>Specifically, early in the project there were quite a lot of binary resource files in the project, these have now been removed as they're effectively external resources.</p> <p>However, the size of our repository is >200MB (the total checkout is currently...
[ { "answer_id": 250365, "author": "JesperE", "author_id": 13051, "author_profile": "https://Stackoverflow.com/users/13051", "pm_score": 3, "selected": false, "text": "git-fast-export NAME\n git-fast-export - Git data exporter\n\nSYNOPSIS\n git-fast-export [options] | git-fast-import\n...
2008/10/30
[ "https://Stackoverflow.com/questions/250238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31582/" ]
250,244
<p>I have a simple application with the following code:</p> <pre><code> FileInfo[] files = (new DirectoryInfo(initialDirectory)).GetFiles(); List&lt;Thread&gt; threads = new List&lt;Thread&gt;(files.Length); foreach (FileInfo f in files) { Thread t = new Thread(delegate() { Consol...
[ { "answer_id": 250249, "author": "Stewart Johnson", "author_id": 6408, "author_profile": "https://Stackoverflow.com/users/6408", "pm_score": 5, "selected": true, "text": "f" }, { "answer_id": 250260, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "htt...
2008/10/30
[ "https://Stackoverflow.com/questions/250244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30006/" ]
250,256
<p>I have problem in some JavaScript that I am writing where the Switch statement does not seem to be working as expected.</p> <pre><code>switch (msg.ResultType) { case 0: $('#txtConsole').val("Some Val 0"); break; case 1: $('#txtConsole').val("Some Val 1"); break; case 2: $('#txtConsole').te...
[ { "answer_id": 250279, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 2, "selected": false, "text": "switch (msg.ResultType-0) {\n case 0:\n $('#txtConsole').val(\"Some Val 0\");\n break;\n case 1:\n $('#txtCon...
2008/10/30
[ "https://Stackoverflow.com/questions/250256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4820/" ]
250,271
<p>How can I get the start and end positions of all matches using the <code>re</code> module? For example given the pattern <code>r'[a-z]'</code> and the string <code>'a1b2c3d4'</code> I'd want to get the positions where it finds each letter. Ideally, I'd like to get the text of the match back too.</p>
[ { "answer_id": 250303, "author": "Peter Hoffmann", "author_id": 720, "author_profile": "https://Stackoverflow.com/users/720", "pm_score": 9, "selected": true, "text": "import re\np = re.compile(\"[a-z]\")\nfor m in p.finditer('a1b2c3d4'):\n print(m.start(), m.group())\n" }, { ...
2008/10/30
[ "https://Stackoverflow.com/questions/250271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13009/" ]
250,283
<p>What's the most pythonic way to scp a file in Python? The only route I'm aware of is </p> <pre><code>os.system('scp "%s" "%s:%s"' % (localfile, remotehost, remotefile) ) </code></pre> <p>which is a hack, and which doesn't work outside Linux-like systems, and which needs help from the Pexpect module to avoid passw...
[ { "answer_id": 250786, "author": "Pat Notz", "author_id": 825, "author_profile": "https://Stackoverflow.com/users/825", "pm_score": 4, "selected": false, "text": "# This connects to the openbsd ftp site and\n# downloads the recursive directory listing.\nimport pexpect\nchild = pexpect.sp...
2008/10/30
[ "https://Stackoverflow.com/questions/250283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4105/" ]