qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
181,130
<p>I've just found out about Stack Overflow and I'm just checking if there are ideas for a constraint I'm having with some friends in a project, though this is more of a theoretical question to which I've been trying to find an answer for some time.</p> <p>I'm not much given into cryptography but if I'm not clear enou...
[ { "answer_id": 181144, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "$salt = \"123-=asd\";\n$address = \"3412 g ave\";\n\n$sql = \"INSERT INTO addresses (address) VALUES ('\" . md5($salt . $addre...
2008/10/08
[ "https://Stackoverflow.com/questions/181130", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26004/" ]
181,132
<p>On my homepage I got:</p> <pre><code>&lt;ul id="login"&gt; &lt;li&gt; &lt;a id="loginswitch" href="./login-page"&gt;log-in&lt;/a&gt; | &lt;/li&gt; &lt;li&gt; &lt;a id="signupswitch" href="./signup-page"&gt;sign-up&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Via MooTools, I get these anchor elements by i...
[ { "answer_id": 181137, "author": "ephemient", "author_id": 20713, "author_profile": "https://Stackoverflow.com/users/20713", "pm_score": 1, "selected": false, "text": "#" }, { "answer_id": 196643, "author": "keparo", "author_id": 19468, "author_profile": "https://Stac...
2008/10/08
[ "https://Stackoverflow.com/questions/181132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24744/" ]
181,136
<p>I have a text file with multiple records. I want to search a name and date, for example if I typed <code>JULIUS CESAR</code> as name then the whole data about <code>JULIUS</code> will be extracted. What if I want only to extract information?</p> <pre><code>Record number: 1 Date: 08-Oct-08 Time: 23:45:01 Name: JULIU...
[ { "answer_id": 181156, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "$name = \"JULIUS CESAR\";\n /$name/i \n /Record number: (\\d+) Date: (\\d+)-(\\w+)-(\\d+) Time: (\\d+):(\\d+):(\\d+) Name: $na...
2008/10/08
[ "https://Stackoverflow.com/questions/181136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
181,158
<p>i have a databound GridView in asp.net 2.0 with a row-selection link. When a row is selected, I want to programmatically add a table row below the selected row, in order to nest another grid et al.</p> <p>I am researching this for a client and for an article, and i think my google-fu is not strong tonight. Any sugg...
[ { "answer_id": 181168, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 4, "selected": true, "text": "protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)\n{\n if (e.Row.RowType == DataControlR...
2008/10/08
[ "https://Stackoverflow.com/questions/181158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9345/" ]
181,159
<p>I'm trying to generate a unique ID in php in order to store user-uploaded content on a FS without conflicts. I'm using php, and at the moment this little snippet is responsible for generating the UID:</p> <pre><code>$id = tempnam (".", ""); unlink($id); $id = substr($id, 2); </code></pre> <p>This code is hideous:...
[ { "answer_id": 181163, "author": "Xenph Yan", "author_id": 264, "author_profile": "https://Stackoverflow.com/users/264", "pm_score": 5, "selected": true, "text": "string uniqid ([ string $prefix [, bool $more_entropy ]] )\n USAGE: $id = uniqid(rand(), true);\n" }, { "answer_id": ...
2008/10/08
[ "https://Stackoverflow.com/questions/181159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1266/" ]
181,188
<p>In VB.NET I often <code>Catch…When</code>:</p> <pre><code>Try … Catch e As ArgumentNullException When e.ParamName.ToUpper() = "SAMPLES" … End Try </code></pre> <p>Is there a C# equivalent to <code>Catch…When</code>?</p> <p>I don't want to resort to using an <code>if</code> statement inside a <code>catch</...
[ { "answer_id": 181190, "author": "cruizer", "author_id": 6441, "author_profile": "https://Stackoverflow.com/users/6441", "pm_score": 4, "selected": false, "text": "Catch…When if catch try\n{\n …\n}\ncatch (ArgumentNullException e)\n{\n if (\"SAMPLES\" == e.ParamName.ToUpper())\n ...
2008/10/08
[ "https://Stackoverflow.com/questions/181188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8280/" ]
181,189
<p>After being through numerous forums available on the net for last 5 days, I am still not able to completely track down the browser close event. My requirement is to generate a popup message, when user tries to close the browser.</p> <p>I have called my javascript function on body 'onbeforeunload' event. And I have h...
[ { "answer_id": 190449, "author": "Stein G. Strindhaug", "author_id": 26115, "author_profile": "https://Stackoverflow.com/users/26115", "pm_score": 1, "selected": false, "text": "document.onclick = function()\n {\n //To check if user is navigating from the page by clicking on a ...
2008/10/08
[ "https://Stackoverflow.com/questions/181189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
181,191
<p>Let me preface this by saying I'm a complete amateur when it comes to RegEx and only started a few days ago. I'm trying to solve a problem formatting a file and have hit a hitch with a particular type of data. The input file is structured like this:</p> <pre> Two words,Word,Word,Word,"Number, number" </pre> <p>Wha...
[ { "answer_id": 181208, "author": "ephemient", "author_id": 20713, "author_profile": "https://Stackoverflow.com/users/20713", "pm_score": 2, "selected": true, "text": "s/,([^ ])/\",\"$1/ , \\1 $1 s/,(?! )/\",\"/ ," }, { "answer_id": 181255, "author": "Markus Jarderot", "au...
2008/10/08
[ "https://Stackoverflow.com/questions/181191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25045/" ]
181,209
<p>I have a function that looks like this</p> <pre><code>class NSNode { function insertAfter(NSNode $node) { ... } } </code></pre> <p>I'd like to be able to use that function to indicate that the node is being inserted at the start, therefore it is after <em>nothing</em>. The way I think about that is...
[ { "answer_id": 181223, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 4, "selected": true, "text": "function(NSNode $node = null) {\n// stuff....\n}\n $obj->insertAfter(); // no error\n$obj->insertAfter(new NSNode); // no error\...
2008/10/08
[ "https://Stackoverflow.com/questions/181209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
181,210
<p>I have an asp.net text form that contains numerous decimal fields that are optional. I want to selectively update the database but not inserting a "0" for fields that do not have data (maintaining the null status). </p> <p>Typically, I would create multiple functions, each with a different signature to handle this....
[ { "answer_id": 181229, "author": "Jon Limjap", "author_id": 372, "author_profile": "https://Stackoverflow.com/users/372", "pm_score": 1, "selected": false, "text": "DBNull" }, { "answer_id": 181310, "author": "Vivek", "author_id": 7418, "author_profile": "https://Stac...
2008/10/08
[ "https://Stackoverflow.com/questions/181210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3149/" ]
181,214
<p>Implementing a file upload under html is fairly simple, but I just noticed that there is an 'accept' attribute that can be added to the <code>&lt;input type="file" ...&gt;</code> tag.</p> <p>Is this attribute useful as a way of limiting file uploads to images, etc? What is the best way to use it?</p> <p>Alternativ...
[ { "answer_id": 181507, "author": "PhiLho", "author_id": 15459, "author_profile": "https://Stackoverflow.com/users/15459", "pm_score": 3, "selected": false, "text": "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"100000\"> UPLOAD_ERR_FORM_SIZE" }, { "answer_id": 4197455, ...
2008/10/08
[ "https://Stackoverflow.com/questions/181214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/691/" ]
181,222
<p>I have a script which calls <code>mysql_connect()</code> to connect to a MySQL DB. When I run the script in a browser, it works. However, when I run it from a command line I receive the following error:</p> <pre><code>Call to undefined function mysql_connect() </code></pre> <p>This seems completely paradoxical. A...
[ { "answer_id": 181236, "author": "Darryl Hein", "author_id": 5441, "author_profile": "https://Stackoverflow.com/users/5441", "pm_score": 4, "selected": false, "text": "php -c /etc/php.ini /path/to/script.php\n /etc/php.ini phpinfo();" }, { "answer_id": 23510870, "author": "He...
2008/10/08
[ "https://Stackoverflow.com/questions/181222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24059/" ]
181,225
<p>I'm looking for a reasonably fast event handling mechanism in Java to generate and handle events across different JVMs running on different hosts.</p> <p>For event handling across multiple threads in a single JVM, I found some good candidates like Jetlang. But in my search for a distributed equivalent , I couldn't ...
[ { "answer_id": 247657, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "public class Sample implements MessageListener {\n\n public static void main(String[] args) { \n Sample sample = new...
2008/10/08
[ "https://Stackoverflow.com/questions/181225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21647/" ]
181,226
<p>I am using an authentication attribute on some of my actions in an asp.net mvc page to refer people to a login screen if they have not authenticated. My problem is returning them to the referring page after they have logged in. I was just keeping track of the referring action and referring controller but that beco...
[ { "answer_id": 181774, "author": "Casper", "author_id": 18729, "author_profile": "https://Stackoverflow.com/users/18729", "pm_score": 2, "selected": false, "text": "var urlReferrer = Request.UrlReferrer;\nif (urlReferrer != null)\n{\n var url = \"~\" + Server.UrlDecode(urlReferrer.Pat...
2008/10/08
[ "https://Stackoverflow.com/questions/181226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/361/" ]
181,241
<p>Every time I use the "at" command, I get this message:</p> <pre><code>warning: commands will be executed using /bin/sh </code></pre> <p>What is it trying to warn me about? More importantly, how do I turn the warning off?</p>
[ { "answer_id": 181245, "author": "Jerub", "author_id": 14648, "author_profile": "https://Stackoverflow.com/users/14648", "pm_score": 4, "selected": false, "text": "username@hostname$ at 23:00 \nwarning: commands will be executed using /bin/sh\nat> rm **/*.pyc\nat> <EOT>\njob 1 at 200...
2008/10/08
[ "https://Stackoverflow.com/questions/181241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7598/" ]
181,254
<p>If I have a style defined</p> <pre><code>.style1 { width: 140px; } </code></pre> <p>can I reference it from a second style?</p> <pre><code>.style2 { ref: .style1; } </code></pre> <p>Or is there a way via javascript/jQuery?</p> <p>--- Edit</p> <p>To clarify the problem, I am trying to apply whatever style...
[ { "answer_id": 181269, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 5, "selected": true, "text": "$('.style2').addClass ('style1');\n" }, { "answer_id": 181271, "author": "Owen", "author_id": 4853, ...
2008/10/08
[ "https://Stackoverflow.com/questions/181254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25372/" ]
181,268
<p>I have a simple iphone app that's based on the CrashLanding sample app. So basically you tap the title screen and do some stuff... all on the same "view". I want to add an "options" screen/page/view whatever with a few UISwitches. What's the easiest way to do this?</p> <p>Cheers!</p>
[ { "answer_id": 181327, "author": "fmsf", "author_id": 26004, "author_profile": "https://Stackoverflow.com/users/26004", "pm_score": 2, "selected": true, "text": "@implementation myOptions\n\n-(void)awakeFromNib\n{\n...\n @implementation previousController\n-(void)awakeFromNib\n{\n men...
2008/10/08
[ "https://Stackoverflow.com/questions/181268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22471/" ]
181,272
<p>When we execute <code>select count(*) from table_name</code> it returns the number of rows.</p> <p>What does <code>count(1)</code> do? What does <code>1</code> signify here? Is this the same as <code>count(*)</code> (as it gives the same result on execution)?</p>
[ { "answer_id": 181280, "author": "ChrisHDog", "author_id": 25719, "author_profile": "https://Stackoverflow.com/users/25719", "pm_score": 3, "selected": false, "text": "SELECT * FROM table_name and SELECT 1 FROM table_name. \n SELECT 1 FROM table_name\n count(*) count(1) count(8) count(c...
2008/10/08
[ "https://Stackoverflow.com/questions/181272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11614/" ]
181,279
<p>How does TCP/IP report errors when packet delivery fails permanently? All Socket.write() APIs I've seen simply pass bytes to the underlying TCP/IP output buffer and transfer the data asynchronously. How then is TCP/IP supposed to notify the developer if packet delivery fails permanently (i.e. the destination host is...
[ { "answer_id": 181293, "author": "ephemient", "author_id": 20713, "author_profile": "https://Stackoverflow.com/users/20713", "pm_score": 2, "selected": false, "text": "shutdown close" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14731/" ]
181,284
<p>I've read somewhere that functional programming is suitable to take advantage of multi-core trend in computing. I didn't really get the idea. Is it related to the lambda calculus and von neumann architecture?</p>
[ { "answer_id": 181296, "author": "DGentry", "author_id": 4761, "author_profile": "https://Stackoverflow.com/users/4761", "pm_score": 3, "selected": false, "text": "a = foo(b, c);\nd = bar(e, f);\n" }, { "answer_id": 181302, "author": "John Millikin", "author_id": 3560, ...
2008/10/08
[ "https://Stackoverflow.com/questions/181284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17685/" ]
181,285
<p>Is it a problem if you use the global keyword on variables you don't end up using? Compare:</p> <pre><code>function foo() { global $fu; global $bah; if (something()) { $fu-&gt;doSomething(); } else { $bah-&gt;doSomething(); } } function bar() { if (something()) { glo...
[ { "answer_id": 181290, "author": "Matthew Scharley", "author_id": 15537, "author_profile": "https://Stackoverflow.com/users/15537", "pm_score": 4, "selected": true, "text": "bar()" }, { "answer_id": 181472, "author": "Darryl Hein", "author_id": 5441, "author_profile":...
2008/10/08
[ "https://Stackoverflow.com/questions/181285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
181,309
<p>In a nutshell, there's a global stylesheet:</p> <pre><code>a { font-family: Arial; } </code></pre> <p>I want to use a different font family for a particular link:</p> <pre><code>&lt;a href="..." style="font-family: Helvetica;"&gt;...&lt;/a&gt; </code></pre> <p>or</p> <pre><code>&lt;span style="font-family: Helv...
[ { "answer_id": 181336, "author": "Kip", "author_id": 18511, "author_profile": "https://Stackoverflow.com/users/18511", "pm_score": 3, "selected": false, "text": "a { font-family: Arial; }\na .noticed { font-family: Helvetica; }\n <a class=\"noticed\" href=\"...\">...</a>\n <font>" }, ...
2008/10/08
[ "https://Stackoverflow.com/questions/181309", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17216/" ]
181,313
<p>Is there a command within the bash shell of fedora that will give me the currently assigned IP address?</p>
[ { "answer_id": 1967327, "author": "incognitus", "author_id": 239315, "author_profile": "https://Stackoverflow.com/users/239315", "pm_score": 0, "selected": false, "text": "ipconfig getifaddr eth0\n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13930/" ]
181,341
<p>At my workplace, the traffic blocker/firewall has been getting progressively worse. I can't connect to my home machine on port 22, and lack of ssh access makes me sad. I was previously able to use SSH by moving it to port 5050, but I think some recent filters now treat this traffic as IM and redirect it through an...
[ { "answer_id": 185365, "author": "Alexander", "author_id": 16724, "author_profile": "https://Stackoverflow.com/users/16724", "pm_score": 4, "selected": true, "text": "CONNECT stunnel" }, { "answer_id": 185414, "author": "Brian", "author_id": 8959, "author_profile": "h...
2008/10/08
[ "https://Stackoverflow.com/questions/181341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20713/" ]
181,342
<p>What is the best way to automatically install an MSI file or installer .exe? We want to do some automated testing from our build system on the installed copy of the product. Our installer has the usual license acceptance screen, install location, etc.</p> <hr> <p>As FryHard pointed out there are two options in par...
[ { "answer_id": 181365, "author": "FryHard", "author_id": 231, "author_profile": "https://Stackoverflow.com/users/231", "pm_score": 4, "selected": false, "text": "Myproduct.MSI /?\n" }, { "answer_id": 181434, "author": "Franci Penov", "author_id": 17028, "author_profil...
2008/10/08
[ "https://Stackoverflow.com/questions/181342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18437/" ]
181,344
<p>We get sometimes the following error from our partner's database:</p> <pre><code>&lt;i&gt;ORA-01438: value larger than specified precision allows for this column&lt;/i&gt; </code></pre> <p>The full response looks like the following:</p> <pre><code>&lt;?xml version="1.0" encoding="windows-1251"?&gt; &lt;response&g...
[ { "answer_id": 2741455, "author": "Gary Myers", "author_id": 25714, "author_profile": "https://Stackoverflow.com/users/25714", "pm_score": 4, "selected": false, "text": "select cast (10 as number(1,2)) from dual\n *\nERROR at line 1:\nORA-01438: value larger than specified pr...
2008/10/08
[ "https://Stackoverflow.com/questions/181344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11104/" ]
181,348
<p>Let me start with a specific example of what I'm trying to do.</p> <p>I have an array of year, month, day, hour, minute, second and millisecond components in the form <code>[ 2008, 10, 8, 00, 16, 34, 254 ]</code>. I'd like to instantiate a Date object using the following standard constructor:</p> <pre><code>new Da...
[ { "answer_id": 181680, "author": "AnthonyWJones", "author_id": 17516, "author_profile": "https://Stackoverflow.com/users/17516", "pm_score": 3, "selected": false, "text": "function writeLn(s)\n{\n //your code to write a line to stdout\n WScript.Echo(s)\n}\n\nvar a = [ 2008, 10, 8,...
2008/10/08
[ "https://Stackoverflow.com/questions/181348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23501/" ]
181,354
<p>In a Test project in Visual Studio 2008 (Pro), I created a Test project, and I want to configure the project properties to give a command line argument to the tests. I set the properties, but then realized I have no idea how to actually use the argument. </p> <p>How do you get the arguments from MSTest?</p>
[ { "answer_id": 181404, "author": "JTew", "author_id": 25372, "author_profile": "https://Stackoverflow.com/users/25372", "pm_score": 2, "selected": true, "text": "mytest.dll\nmytest.dll.config\nlib.dll\nlib.dll.config\n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3279/" ]
181,356
<p>What am I doing wrong here?</p> <pre><code>string q = "john s!"; string clean = Regex.Replace(q, @"([^a-zA-Z0-9]|^\s)", string.Empty); // clean == "johns". I want "john s"; </code></pre>
[ { "answer_id": 181371, "author": "John Sheehan", "author_id": 1786, "author_profile": "https://Stackoverflow.com/users/1786", "pm_score": 4, "selected": false, "text": "string clean = Regex.Replace(q, @\"[^a-zA-Z0-9\\s]\", string.Empty);\n" }, { "answer_id": 6628211, "author"...
2008/10/08
[ "https://Stackoverflow.com/questions/181356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1786/" ]
181,374
<p>I have a .net app that I've written in c#. On some forms I frequent update the display fields. In some cases every field on the form (textboxes, labels, picturebox, etc) has its value changed. Plus the frequency of the changes could possibly be every second. However, currently there is a horrible flickering everytim...
[ { "answer_id": 181384, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 3, "selected": false, "text": "SetStyle(ControlStyles.OptimizedDoubleBuffer, true);\n" }, { "answer_id": 213017, "author": "Brian Hasden...
2008/10/08
[ "https://Stackoverflow.com/questions/181374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
181,406
<p>I have been using Ruby for a while now and I find, for bigger projects, it can take up a fair amount of memory. What are some best practices for reducing memory usage in Ruby?</p> <ul> <li>Please, let each answer have one "best practice" and let the community vote it up.</li> </ul>
[ { "answer_id": 181445, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 5, "selected": true, "text": "def method(x)\n x.split( doesn't matter what the args are )\nend\n def method(x)\n x.gsub( doesn't matter what the args...
2008/10/08
[ "https://Stackoverflow.com/questions/181406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5004/" ]
181,408
<p>What is the best way to write bytes in the middle of a file using Java?</p>
[ { "answer_id": 181416, "author": "anjanb", "author_id": 11142, "author_profile": "https://Stackoverflow.com/users/11142", "pm_score": 3, "selected": false, "text": "RandomAccessFile" }, { "answer_id": 185076, "author": "jjnguy", "author_id": 2598, "author_profile": "h...
2008/10/08
[ "https://Stackoverflow.com/questions/181408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2598/" ]
181,413
<p>Before I begin, I want to clarify that this is not a command-line tool, but an application that accepts commands through it's own command-line interface.</p> <p><strong>Edit:</strong> I must apologize about my explanation from before, apparently I didn't do a very good job at explaining it. One more time...</p> <p...
[ { "answer_id": 181428, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 3, "selected": false, "text": "signal \n#include <signal.h>\n\nvoid signal_handler(int sig)\n{\n // Handle the signal\n}\n\nint main(void)\n{\n /...
2008/10/08
[ "https://Stackoverflow.com/questions/181413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16313/" ]
181,426
<p>I'm making a Stored Procedure that basically concatenates a long string with data from many records.</p> <p>I want to do:</p> <pre><code>set @output = @output + 'aaa' + LINEBREAK </code></pre> <p>How do I specify that line break?</p>
[ { "answer_id": 181430, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 6, "selected": true, "text": "DECLARE @LINEBREAK AS varchar(2)\nSET @LINEBREAK = CHAR(13) + CHAR(10)\n" }, { "answer_id": 181431, "author":...
2008/10/08
[ "https://Stackoverflow.com/questions/181426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3314/" ]
181,427
<p>I am currently having a hardtime understanding and implementing events in C# using delagates. I am used to the Java way of doing things:</p> <ol> <li>Define an interface for a listener type which would contain a number of method definitions</li> <li>Define adapter class for that interface to make things easier if ...
[ { "answer_id": 181451, "author": "jop", "author_id": 11830, "author_profile": "https://Stackoverflow.com/users/11830", "pm_score": 3, "selected": false, "text": "public delegate void ComputerEvent(object sender, ComputerEventArgs e);\n public class ComputerEventArgs : EventArgs\n{\n /...
2008/10/08
[ "https://Stackoverflow.com/questions/181427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15075/" ]
181,432
<p>The class method to create an index path with one or more nodes is:</p> <pre><code>+ (id)indexPathWithIndexes:(NSUInteger *)indexes length:(NSUInteger)length </code></pre> <p>How do we create the "indexes" required in the first parameter? </p> <p>The documentation listed it as <em>Array of indexes to make up the ...
[ { "answer_id": 184463, "author": "Barry Wark", "author_id": 2140, "author_profile": "https://Stackoverflow.com/users/2140", "pm_score": 7, "selected": true, "text": "NSUInteger indexArr[] = {1,2,3,4};\n\nNSIndexPath *indexPath = [NSIndexPath indexPathWithIndexes:indexArr length:4];\n" ...
2008/10/08
[ "https://Stackoverflow.com/questions/181432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1987/" ]
181,442
<p>Actually, I wanted a custom cell which contains 2 image objects and 1 text object, and I decided to make a container for those objects. </p> <p>So is it possible to hold a image in object and insert that object in any of the collection objects, and later use that object to display inside cell?</p>
[ { "answer_id": 183750, "author": "lajos", "author_id": 3740, "author_profile": "https://Stackoverflow.com/users/3740", "pm_score": 3, "selected": true, "text": "//create a UIImage from a jpeg image\nUIImage *myImage = [UIImage imageWithContentsOfFile:@\"myImage.jpg\"];\nNSArray *myArray ...
2008/10/08
[ "https://Stackoverflow.com/questions/181442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/451867/" ]
181,459
<p>Is there a better way to do this?</p> <pre><code>-(NSDate *)getMidnightTommorow { NSCalendarDate *now = [NSCalendarDate date]; NSCalendarDate *tomorrow = [now dateByAddingYears:0 months:0 days:1 hours:0 minutes:0 seconds:0]; return [NSCalendarDate dateWithYear:[tomorrow yearOfCommonEra] ...
[ { "answer_id": 181495, "author": "mmalc", "author_id": 23233, "author_profile": "https://Stackoverflow.com/users/23233", "pm_score": 6, "selected": true, "text": "NSDate *today = [NSDate date];\n\nNSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]...
2008/10/08
[ "https://Stackoverflow.com/questions/181459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23033/" ]
181,471
<p>The new awesome <kbd>Ctrl</kbd> + <kbd>.</kbd> keyboard shortcut to show smart tags has suddenly stopped working, a week or so after I discovered it :( </p> <p>I am missing it badly, having had to revert back to <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>F10</kbd>, which really just isn't the same.</p> <p>I recently ...
[ { "answer_id": 181495, "author": "mmalc", "author_id": 23233, "author_profile": "https://Stackoverflow.com/users/23233", "pm_score": 6, "selected": true, "text": "NSDate *today = [NSDate date];\n\nNSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]...
2008/10/08
[ "https://Stackoverflow.com/questions/181471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5302/" ]
181,485
<p>I've incorporated Apple's Reachability sample into my own project so I know whether or not I have a network connection - if I don't have a network connection, I don't bother sending out and requests. I decided to go with the status notification implementation because it seemed easier to have the reachablity updated ...
[ { "answer_id": 181529, "author": "Chris Lundie", "author_id": 20685, "author_profile": "https://Stackoverflow.com/users/20685", "pm_score": 5, "selected": true, "text": "- (void) checkReachability {\n BOOL connected = ([[Reachability sharedReachability] localWiFiConnectionStatus] == R...
2008/10/08
[ "https://Stackoverflow.com/questions/181485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24168/" ]
181,498
<p>I need to sort tuples according to the second element of each tuple but apparently usort/1 only works with the first element. So I have to swap the elements, usort them and swap back.Is there an easier way?Also is there a way to sort in descending order (I know sorting and reversing can be done, but just want to kno...
[ { "answer_id": 181520, "author": "bmdhacks", "author_id": 14032, "author_profile": "https://Stackoverflow.com/users/14032", "pm_score": 0, "selected": false, "text": "qsort([]) -> [];\nqsort([Pivot|Tail]) ->\n {PivotFirst, PivotSecond} = Pivot,\n qsort([{FirstElement, SecondElement...
2008/10/08
[ "https://Stackoverflow.com/questions/181498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2727/" ]
181,530
<p>Sometimes I break long conditions in <code>if</code>s onto several lines. The most obvious way to do this is:</p> <pre><code> if (cond1 == 'val1' and cond2 == 'val2' and cond3 == 'val3' and cond4 == 'val4'): do_something </code></pre> <p>Isn't very very appealing visually, because the action blends wi...
[ { "answer_id": 181553, "author": "Federico A. Ramponi", "author_id": 18770, "author_profile": "https://Stackoverflow.com/users/18770", "pm_score": 5, "selected": false, "text": "allCondsAreOK = (cond1 == 'val1' and cond2 == 'val2' and\n cond3 == 'val3' and cond4 == 'val4'...
2008/10/08
[ "https://Stackoverflow.com/questions/181530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
181,532
<p>I have a text string value that I'd like to persist from one web page to another without using query strings or the session/view states. I've been trying to get the ASP http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hiddenfield.aspx">HiddenField control to pass information from one web form to a ...
[ { "answer_id": 181645, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 2, "selected": false, "text": "protected void Page_Load(object sender, EventArgs e)\n{\n Server.Transfer(\"~/secondpage.aspx\");\n}\n protect...
2008/10/08
[ "https://Stackoverflow.com/questions/181532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26037/" ]
181,537
<p>So basically we have lots of SharePoint usage log files generated by our SharePoint 2007 site and we would like to make sense of them. For that we're thinking of reading the log files and dumping into a database with the appropriate columns and all. Now I was going to make an SSIS package to read all the text files ...
[ { "answer_id": 181771, "author": "massimogentilini", "author_id": 11673, "author_profile": "https://Stackoverflow.com/users/11673", "pm_score": 2, "selected": false, "text": "LogParser \"SELECT * INTO <TABLENAME> FROM <LogFileName>\" -o:SQL -server:<servername> -database:<databasename> -...
2008/10/08
[ "https://Stackoverflow.com/questions/181537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1688440/" ]
181,543
<p>There seems to be a lot of heated discussion on the net about the changes to the reduce() function in python 3.0 and how it should be removed. I am having a little difficulty understanding why this is the case; I find it quite reasonable to use it in a variety of cases. If the contempt was simply subjective, I canno...
[ { "answer_id": 181646, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 5, "selected": false, "text": "reduce() functools reduce()" }, { "answer_id": 181706, "author": "DzinX", "author_id": 18745, "aut...
2008/10/08
[ "https://Stackoverflow.com/questions/181543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24530/" ]
181,551
<p>I'm working with JIntegra java com bridge. I have an object of type Object which true coclass is unknown. I need to check if that object can be casted to specific COM interface (which has a proxy class generated by JIntegra).</p>
[ { "answer_id": 189463, "author": "James Schek", "author_id": 17871, "author_profile": "https://Stackoverflow.com/users/17871", "pm_score": 2, "selected": true, "text": "queryInterface()" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26042/" ]
181,556
<p>When using py2exe to distribute Python applications with wxPython, some MSVC DLLs are usually needed to make the .exe work on freshly installed machines. In particular, the two most common DLLs are msvcp71.dll and msvcr71.dll</p> <p>The former can be included in the .exe using <a href="http://www.py2exe.org/index.c...
[ { "answer_id": 181583, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 4, "selected": true, "text": "msvcr71.dll py2exe" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
181,573
<p>I would like to be able to display <code>Notebook</code> and a <code>TxtCtrl</code> wx widgets in a single frame. Below is an example adapted from the wxpython wiki; is it possible to change their layout (maybe with something like <code>wx.SplitterWindow</code>) to display the text box below the <code>Notebook</cod...
[ { "answer_id": 181626, "author": "DzinX", "author_id": 18745, "author_profile": "https://Stackoverflow.com/users/18745", "pm_score": 4, "selected": true, "text": "Notebook class Notebook(wx.Frame):\n def __init__(self, parent, id, title):\n wx.Frame.__init__(self, parent, id, t...
2008/10/08
[ "https://Stackoverflow.com/questions/181573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11596/" ]
181,579
<p>List Comprehension is a very useful code mechanism that is found in several languages, such as Haskell, Python, and Ruby (just to name a few off the top of my head). I'm familiar with the construct.</p> <p>I find myself working on an Open Office Spreadsheet and I need to do something fairly common: I want to count ...
[ { "answer_id": 187158, "author": "sdkpoly", "author_id": 15640, "author_profile": "https://Stackoverflow.com/users/15640", "pm_score": 2, "selected": true, "text": "=If(AND({list_cell}>=MinVal; {list_cell}<=MaxVal); 1; 0)\n" }, { "answer_id": 70291061, "author": "tzot", "...
2008/10/08
[ "https://Stackoverflow.com/questions/181579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19182/" ]
181,581
<p>How do you generate a X.509 public and private key pair and a signing request (CSR file) to be sent to a CA for signing in C#?</p>
[ { "answer_id": 187158, "author": "sdkpoly", "author_id": 15640, "author_profile": "https://Stackoverflow.com/users/15640", "pm_score": 2, "selected": true, "text": "=If(AND({list_cell}>=MinVal; {list_cell}<=MaxVal); 1; 0)\n" }, { "answer_id": 70291061, "author": "tzot", "...
2008/10/08
[ "https://Stackoverflow.com/questions/181581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15158/" ]
181,585
<p>I'm using PowersHell to automate iTunes but find the error handling / waiting for com objects handling to be less than optimal.</p> <p>Example code</p> <pre><code>#Cause an RPC error $iTunes = New-Object -ComObject iTunes.Application $LibrarySource = $iTunes.LibrarySource # Get "playlist" objects for main sections...
[ { "answer_id": 217082, "author": "Emperor XLII", "author_id": 2495, "author_profile": "https://Stackoverflow.com/users/2495", "pm_score": 2, "selected": true, "text": "function retry( [scriptblock]$action, [int]$wait=2, [int]$maxRetries=100 ) {\n $results = $null\n\n $currentRetry = 0\...
2008/10/08
[ "https://Stackoverflow.com/questions/181585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5330/" ]
181,596
<p>How do you convert a numerical number to an Excel column name in C# without using automation getting the value directly from Excel.</p> <p>Excel 2007 has a possible range of 1 to 16384, which is the number of columns that it supports. The resulting values should be in the form of excel column names, e.g. A, AA, AAA...
[ { "answer_id": 181610, "author": "Franci Penov", "author_id": 17028, "author_profile": "https://Stackoverflow.com/users/17028", "pm_score": 3, "selected": false, "text": "int nCol = 127;\nstring sChars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nstring sCol = \"\";\nwhile (nCol >= 26)\n{\n int...
2008/10/08
[ "https://Stackoverflow.com/questions/181596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3851/" ]
181,597
<p>We are in the process of nutting out the design guidelines we would like to use in our development team and got into a discussion today around how ASP.NET controls should be named. I am talking about our good friends Label, TextBox, Button etc.</p> <p>We came up with the following three possibilities that we voted ...
[ { "answer_id": 181823, "author": "WebDude", "author_id": 15360, "author_profile": "https://Stackoverflow.com/users/15360", "pm_score": 5, "selected": false, "text": "Abbr - Control\n\nbtn - Button\ncb - CheckBox\ncbl - CheckBoxList\ndd - DropDownList\ngv - GridView\nhl ...
2008/10/08
[ "https://Stackoverflow.com/questions/181597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202/" ]
181,605
<p>I wrote a wrapper for a COM object that only excepted strings as input, so in good OOP practice I wrapped the string up in a function so that it was easier to build and call.</p> <p>I was just wondering if anyone could think of a better way to do the following code. </p> <pre><code> Public Function OpenTable(By...
[ { "answer_id": 181616, "author": "Alexander Morland", "author_id": 4013, "author_profile": "https://Stackoverflow.com/users/4013", "pm_score": 0, "selected": false, "text": "function OpenTable( options As array) {\n if (options is not array or options is empty) {\n Throw except...
2008/10/08
[ "https://Stackoverflow.com/questions/181605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6335/" ]
181,613
<p>This is the unabashed attempt of a similar <a href="https://stackoverflow.com/questions/9033/hidden-features-of-c">C#</a> question.</p> <p>So what are your favorite F# hidden (or not) features?</p> <p>Most of the features I've used so far aren't exactly hidden but have been quite refreshing. Like how trivial it is...
[ { "answer_id": 1846680, "author": "kvb", "author_id": 82959, "author_profile": "https://Stackoverflow.com/users/82959", "pm_score": 2, "selected": false, "text": "type 'a Wrapper = Wrapper of 'a with\n static member inline (+)(Wrapper(a),Wrapper(b)) = Wrapper(a + b)\n static member inl...
2008/10/08
[ "https://Stackoverflow.com/questions/181613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8280/" ]
181,615
<p>I have a program 'foo' running different threads, fooT1, fooT2, .. fooTn.</p> <p>Now if I want write another program 'bar', which could kill the thread fooTr, is that possible?</p> <p>Reason: One of the thread fooTr tracks product license. If this thread is killed; one may run this product indefinitely. And killin...
[ { "answer_id": 188822, "author": "Alexander", "author_id": 16724, "author_profile": "https://Stackoverflow.com/users/16724", "pm_score": 2, "selected": false, "text": "Thread.getAllStackTraces Thread.enumerate stop() Thread.stop jdb jdb" }, { "answer_id": 874335, "author": "l...
2008/10/08
[ "https://Stackoverflow.com/questions/181615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18768/" ]
181,624
<p>I'm working on a commercial (not open source) C++ project that runs on a linux-based system. I need to do some regex within the C++ code. (I know: I now have 2 problems.)</p> <p>QUESTION: What libraries do people who regularly do regex from C/C++ recommend I look into? A quick search has brought the following...
[ { "answer_id": 8560856, "author": "matiu", "author_id": 602340, "author_profile": "https://Stackoverflow.com/users/602340", "pm_score": 4, "selected": false, "text": "clang++ -std=c++11 -lc++ -I/usr/include/c++/v1 ..." } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13022/" ]
181,643
<p>I basically need to show a wait window to the user. For this i have put two seperate window forms in the application. the first form is the main form with a button. The second one is a empty one with just a label text. On click of the button in Form1 i do the below </p> <pre><code>Form2 f = new Form2(); f.Show(); T...
[ { "answer_id": 181683, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 2, "selected": false, "text": "f.Refresh();\n Timer t = new Timer();\nt.Interval = 2000;\nt.Tick += delegate { Close(); t.Stop();};\nt.Start();\...
2008/10/08
[ "https://Stackoverflow.com/questions/181643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20951/" ]
181,648
<p>I have problems opening a berkeley db in python using bdtables. As bdtables is used by the library I am using to access the database, I need it to work.</p> <p>The problem seems to be that the db environment I am trying to open (I got a copy of the database to open), is version 4.4 while libdb is version 4.6. I get...
[ { "answer_id": 185678, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 3, "selected": true, "text": "bsddb.dbtables.bsdTableDB([dbname],[folder], create=1)\n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3355/" ]
181,652
<p>Let's say I have this model named <em>Product</em> with a field named <em>brand</em>. Suppose the values of <em>brand</em> are stored in the format <em>this_is_a_brand</em>. Can I define a method in the model (or anywhere else) that allows me to modify the value of <em>brand</em> before it is called. For example, if...
[ { "answer_id": 181665, "author": "Josh Moore", "author_id": 5004, "author_profile": "https://Stackoverflow.com/users/5004", "pm_score": 0, "selected": false, "text": "brand def brand\n#code to modify the value that is stored in brand\nreturn modified_brand\nend\n" }, { "answer_id...
2008/10/08
[ "https://Stackoverflow.com/questions/181652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9776/" ]
181,690
<p>my java application has a loading task which requires two server calls which can be parallelized. So I launch a Thread t1 (doing <strong>task1</strong>) and a Thread t2 (for <strong>task2</strong>). I want then to do a specific task, <strong>task3</strong> when both other tasks (1 &amp; 2) are over. Naturally I can'...
[ { "answer_id": 181692, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "join t1 t2" }, { "answer_id": 181725, "author": "mitchnull", "author_id": 18645, "author_profile": "http...
2008/10/08
[ "https://Stackoverflow.com/questions/181690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2965/" ]
181,693
<p>Apparently ;-) the standard containers provide some form of guarantees.</p> <p>What type of guarantees and what exactly are the differences between the different types of container?</p> <p>Working from <a href="http://www.sgi.com/tech/stl/" rel="noreferrer">the SGI page</a> (about <a href="http://en.wikipedia.org/wi...
[ { "answer_id": 26395804, "author": "Nayana Adassuriya", "author_id": 1268258, "author_profile": "https://Stackoverflow.com/users/1268258", "pm_score": 8, "selected": true, "text": "vector<T> v; Make an empty vector. O(1)\nvector<T> v(n); ...
2008/10/08
[ "https://Stackoverflow.com/questions/181693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14065/" ]
181,697
<p>We have an application where people can type in multiple langugaes. Though we only have one database to store all the data. We have text columns as nvarchar ( assuming we only want text data to be in multiple languages and not all dates etc.)</p> <p>Do you think this is a feasbile solution and are there any other p...
[ { "answer_id": 182667, "author": "Josef", "author_id": 5581, "author_profile": "https://Stackoverflow.com/users/5581", "pm_score": 1, "selected": false, "text": "NVARCHAR SQL_MixDiction_CP1253_CS_AS" }, { "answer_id": 1034191, "author": "Yordan Georgiev", "author_id": 657...
2008/10/08
[ "https://Stackoverflow.com/questions/181697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2528/" ]
181,718
<p>When I add a breakpoint and hit F5 to run in the debugger (I am using my debug build), a dialog pops up telling my my web.config file does not have debug=true in it (which is does) and I get 2 choices a) run without the debugger or b) let visual studio update my web.config file. If I choose b) the web.config is upda...
[ { "answer_id": 181736, "author": "liggett78", "author_id": 19762, "author_profile": "https://Stackoverflow.com/users/19762", "pm_score": 3, "selected": true, "text": "<compilation defaultLanguage=\"c#\" debug=\"true\" />\n" }, { "answer_id": 181755, "author": "naspinski", ...
2008/10/08
[ "https://Stackoverflow.com/questions/181718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4012/" ]
181,719
<p>How do I start a process, such as launching a URL when the user clicks a button?</p>
[ { "answer_id": 181821, "author": "GvS", "author_id": 11492, "author_profile": "https://Stackoverflow.com/users/11492", "pm_score": 4, "selected": false, "text": "Process.Start(\"Test.Txt\");\n" }, { "answer_id": 181857, "author": "Andy McCluggage", "author_id": 3362, ...
2008/10/08
[ "https://Stackoverflow.com/questions/181719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
181,724
<p>Since Python is a dynamic, interpreted language you don't have to compile your code before running it. Hence, it's very easy to simply write your code, run it, see what problems occur, and fix them. Using hotkeys or macros can make this incredibly quick.</p> <p>So, because it's so easy to immediately see the output...
[ { "answer_id": 181768, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 3, "selected": false, "text": "log.debug() import pdb\npdb.set_trace ()\n" }, { "answer_id": 182010, "author": "S.Lott", "author_id":...
2008/10/08
[ "https://Stackoverflow.com/questions/181724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18676/" ]
181,731
<p>i need to get the color at a particular coordinate from a texture. There are 2 ways i can do this, by getting and looking at the raw png data, or by sampling my generated opengl texture. Is it possible to sample an opengl texture to get the color (RGBA) at a given UV or XY coord? If so, how?</p>
[ { "answer_id": 181747, "author": "Serafina Brocious", "author_id": 4977, "author_profile": "https://Stackoverflow.com/users/4977", "pm_score": 2, "selected": false, "text": "float3 sample(float2 coord, texture tex) {\n float x = tex.w * coord.x; // Get X coord in texture\n int ix =...
2008/10/08
[ "https://Stackoverflow.com/questions/181731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25893/" ]
181,745
<p>Often when making changes to a VS2008 ASP.net project we get a message like:</p> <p>BC30560: 'mymodule_ascx' is ambiguous in the namespace 'ASP'.</p> <p>This goes away after a recompile or sometimes just waiting 10 seconds and refreshing the page. </p> <p>Any way to get rid of it?</p>
[ { "answer_id": 300955, "author": "Nathan", "author_id": 24954, "author_profile": "https://Stackoverflow.com/users/24954", "pm_score": 1, "selected": false, "text": "<%@ Page Inherits=\"_Default\" %>\n <%@ Page ClassName=\"_Default\" %>\n" }, { "answer_id": 300972, "author": "...
2008/10/08
[ "https://Stackoverflow.com/questions/181745", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23066/" ]
181,775
<p>Not sure what exactly is going on here, but seems like in .NET 1.1 an uninitialized event delegate can run without issues, but in .NET 2.0+ it causes a NullReferenceException. Any ideas why. The code below will run fine without issues in 1.1, in 2.0 it gives a NullReferenceException. I'm curious why does it behav...
[ { "answer_id": 181790, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": true, "text": " Console.WriteLine(\"Before\");\n ChartJoinedRowAdded(new object());\n Console.WriteLine(\"After\");\n" }, ...
2008/10/08
[ "https://Stackoverflow.com/questions/181775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26050/" ]
181,780
<p>I have an app where I would like to support device rotation in certain views but other don't particularly make sense in Landscape mode, so as I swapping the views out I would like to force the rotation to be set to portrait.</p> <p>There is an undocumented property setter on UIDevice that does the trick but obvious...
[ { "answer_id": 183348, "author": "Martin Gordon", "author_id": 2481, "author_profile": "https://Stackoverflow.com/users/2481", "pm_score": -1, "selected": false, "text": "- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation\n NO" }, { "answe...
2008/10/08
[ "https://Stackoverflow.com/questions/181780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4496/" ]
181,805
<p>What's the difference between absolute path &amp; relative path when using any web server or Tomcat?</p>
[ { "answer_id": 181811, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 6, "selected": true, "text": "/foo.html\n ../part2/quux.html\n part2/blue.html\n" }, { "answer_id": 181914, "author": "Kent Fredric", ...
2008/10/08
[ "https://Stackoverflow.com/questions/181805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15177/" ]
181,808
<p>I have created a Dynamic Web Project in my Eclipse workspace. It is also a Maven project, and under SVN control. But in "Open Resource" (Ctrl+Alt+R) no file from this project appears, unless I check from the window's options (top right drop-down) "Show Derived Resources".</p> <p>I have checked on some of the projec...
[ { "answer_id": 490825, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "<modules><module>main-module</module><module>integration-test</module>" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22013/" ]
181,810
<p>I am writing a custom ant task that extends Task. I am using the log() method in the task. What I want to do is use a unit test while deveoping the task, but I don't know how to set up a context for the task to run in to initialise the task as if it were running in ant.</p> <p>This is the custom Task:</p> <pre><co...
[ { "answer_id": 185806, "author": "abarax", "author_id": 24390, "author_profile": "https://Stackoverflow.com/users/24390", "pm_score": 2, "selected": true, "text": "public void log(String msg) {\n log(msg, Project.MSG_INFO);\n}\n public void log(String msg, int msgLevel) {\n if (getP...
2008/10/08
[ "https://Stackoverflow.com/questions/181810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26063/" ]
181,818
<p>According to the <a href="http://feedparser.org/docs/introduction.html" rel="noreferrer">feedparser documentation</a>, I can turn an RSS feed into a parsed object like this:</p> <pre><code>import feedparser d = feedparser.parse('http://feedparser.org/docs/examples/atom10.xml') </code></pre> <p>but I can't find any...
[ { "answer_id": 181832, "author": "Andrea Ambu", "author_id": 21384, "author_profile": "https://Stackoverflow.com/users/21384", "pm_score": 0, "selected": false, "text": "from xml.dom import minidom\n\ndoc= minidom.parse('./your/file.xml')\nprint doc.toxml()\n" }, { "answer_id": 1...
2008/10/08
[ "https://Stackoverflow.com/questions/181818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15371/" ]
181,829
<p>I'm working in a web application using VB.NET. There is also VisualBasic code mixed in it, in particular the Date variable and the Month function of VB.</p> <p>The problem is this part:</p> <pre><code>Month("10/01/2008") </code></pre> <p>On the servers, I get 10 (October) as the month (which is supposed to be cor...
[ { "answer_id": 181860, "author": "Jan", "author_id": 25727, "author_profile": "https://Stackoverflow.com/users/25727", "pm_score": 2, "selected": false, "text": "Month(#10/01/2008#) \n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12984/" ]
181,842
<p>After discovering <a href="http://clojure.org" rel="noreferrer">Clojure</a> I have spent the last few days immersed in it.</p> <p>What project types lend themselves to Java over Clojure, vice versa, and in combination?</p> <p>What are examples of programs which you would have never attempted before Clojure?</p>
[ { "answer_id": 1565514, "author": "pmf", "author_id": 112125, "author_profile": "https://Stackoverflow.com/users/112125", "pm_score": 2, "selected": false, "text": "gen-class proxy" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4857/" ]
181,845
<p>I met a problem when deveoping a photo viewer application. I use ListBox to Show Images, which is contained in a ObservableCollection. I bind the ListBox's ItemsSource to the ObservableCollection.</p> <pre><code> &lt;DataTemplate DataType="{x:Type modeldata:ImageInfo}"&gt; &lt;Image Margin="6"...
[ { "answer_id": 182827, "author": "Joel B Fant", "author_id": 22211, "author_profile": "https://Stackoverflow.com/users/22211", "pm_score": 2, "selected": false, "text": "IValueConverter DecodePixelWidth DecodePixelHeight BitmapImage class PathToThumbnailConverter : IValueConverter {\n ...
2008/10/08
[ "https://Stackoverflow.com/questions/181845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25749/" ]
181,853
<p>I am using Moq to mock my Repository layer so I can unit test.</p> <p>My repository layer Insert methods update the Id property of my entities when a successful db insert occurs.</p> <p>How do I configure moq to update the Id property of the entity when the Insert method is called? </p> <p>Repository code:-</p> ...
[ { "answer_id": 181863, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 4, "selected": true, "text": "accountRepository\n .Expect(r => r.InsertAccount(account))\n .Callback(() => account.ID = 1);\n" }, { "answ...
2008/10/08
[ "https://Stackoverflow.com/questions/181853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5691/" ]
181,855
<p>Does anyone know of a nice (and preferably free) way to integrate Prolog and C#?</p> <p>Im looking to create a Prolog dll or similar to call from my managed code, and retrieve an answer once all the processing has been complete. Im looking for it to be predominantly one sided (c# calls Prolog).</p> <p>I have seen ...
[ { "answer_id": 181936, "author": "zuber", "author_id": 9812, "author_profile": "https://Stackoverflow.com/users/9812", "pm_score": 3, "selected": false, "text": "yield Variable" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1816/" ]
181,892
<p>The situation is this: I have a USB device (a custom device I'm trying to talk to) with two endpoints, one writing to the device, one reading from the device. Both are bulk transfers. Every communication transaction takes the form of (1) Write a command to the device (2) Read the response. I'm using libusb (version ...
[ { "answer_id": 188140, "author": "John Nilsson", "author_id": 24243, "author_profile": "https://Stackoverflow.com/users/24243", "pm_score": 1, "selected": false, "text": "SUBSYSTEM==\"usb\" ATTRS{idVendor}==\"0a81\", ATTRS{idProduct}==\"0701\", \\\n MODE=\"0666\" SYMLINK+=...
2008/10/08
[ "https://Stackoverflow.com/questions/181892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25541/" ]
181,894
<p>I'm testing the speed of some queries in MySQL. The database is caching these queries making it difficult for me to get reliable results when testing how fast these queries are.</p> <p>Is there a way to disable caching for a query?</p> <p>System: MySQL 4 on Linux webhosting, I have access to PHPMyAdmin.</p> <p>Th...
[ { "answer_id": 181905, "author": "Jarod Elliott", "author_id": 1061, "author_profile": "https://Stackoverflow.com/users/1061", "pm_score": 9, "selected": false, "text": "SELECT SQL_NO_CACHE * FROM TABLE\n" }, { "answer_id": 190348, "author": "djt", "author_id": 26677, ...
2008/10/08
[ "https://Stackoverflow.com/questions/181894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
181,898
<p>In order to lighten Apache's load people often suggest using lighttpd to serve up static content.</p> <p>e.g. <a href="http://www.linux.com/feature/51673" rel="noreferrer">http://www.linux.com/feature/51673</a></p> <p>In this setup Apache passes requests for static content back to lighttpd via mod_proxy, while ser...
[ { "answer_id": 181955, "author": "Andre Bossard", "author_id": 21027, "author_profile": "https://Stackoverflow.com/users/21027", "pm_score": 2, "selected": false, "text": "Scaling" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26069/" ]
181,901
<p>I try to add an addons system to my Windows.Net application using Reflection; but it fails when there is addon with dependencie.<br><br> Addon class have to implement an interface 'IAddon' and to have an empty constructor.<br> Main program load the addon using Reflection:</p> <pre><code>Assembly assembly = Assembl...
[ { "answer_id": 181907, "author": "Kent Boogaart", "author_id": 5380, "author_profile": "https://Stackoverflow.com/users/5380", "pm_score": 1, "selected": false, "text": "AppDomain.AssemblyResolve AppDomain System.AddIn" }, { "answer_id": 181941, "author": "Andreas Tschager", ...
2008/10/08
[ "https://Stackoverflow.com/questions/181901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26071/" ]
181,909
<p>Are there any free tools for scripting MSSQL table data? I'll gladly write one, but am hoping it's been done, and the app matured a bit before/</p>
[ { "answer_id": 181942, "author": "ConcernedOfTunbridgeWells", "author_id": 15401, "author_profile": "https://Stackoverflow.com/users/15401", "pm_score": 4, "selected": false, "text": "-- ====================================================================\n-- === reverse_engineer_2005.sq...
2008/10/08
[ "https://Stackoverflow.com/questions/181909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8741/" ]
181,921
<p>When working on a big C/C++ project, do you have some specific rules regarding the <em>#include</em> within source or header files?</p> <p>For instance, we can imagine to follow one of these two excessive rules:</p> <ol> <li><em>#include</em> are forbidden in <em>.h</em> files; it is up to each <em>.c</em> file to...
[ { "answer_id": 181927, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 3, "selected": false, "text": "<iosfwd> // observer.hpp\n\nclass Observer; // Forward declaration.\n\n#ifndef MYLIB_OBSERVER_HPP\n#define MYLIB_OBSE...
2008/10/08
[ "https://Stackoverflow.com/questions/181921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26074/" ]
181,930
<p>We have two Tables:</p> <ul> <li>Document: id, title, document_type_id, showon_id</li> <li>DocumentType: id, name</li> <li>Relationship: DocumentType hasMany Documents. (Document.document_type_id = DocumentType.id)</li> </ul> <p>We wish to retrieve a list of all document types for one given ShowOn_Id. </p> <p>We ...
[ { "answer_id": 181974, "author": "wmasm", "author_id": 26079, "author_profile": "https://Stackoverflow.com/users/26079", "pm_score": 4, "selected": false, "text": "SELECT DISTINCT DocumentType.*\nFROM DocumentType\nINNER JOIN Document\nON DocumentType.id=Document.document_type_id\nWHERE ...
2008/10/08
[ "https://Stackoverflow.com/questions/181930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5005/" ]
181,953
<p>The more I learn about WPF and XAML, the more I realize that you can do pretty much all of your GUI initialization and event handling glue in either XAML or in code (say C# code or VB.Net code). </p> <p>My question is to those who have been working on WPF for longer and ideally those who have shipped apps with it ...
[ { "answer_id": 182016, "author": "Arcturus", "author_id": 900, "author_profile": "https://Stackoverflow.com/users/900", "pm_score": 2, "selected": false, "text": "ControlTemplate DataTemplates" }, { "answer_id": 2919537, "author": "akjoshi", "author_id": 45382, "autho...
2008/10/08
[ "https://Stackoverflow.com/questions/181953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
181,956
<p>How can I prevent a user from resizing GridViewColumns withing a ListView control?</p>
[ { "answer_id": 17161092, "author": "Jonathan Alfaro", "author_id": 2495728, "author_profile": "https://Stackoverflow.com/users/2495728", "pm_score": 5, "selected": false, "text": "<GridView.ColumnHeaderContainerStyle>\n <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n <Sette...
2008/10/08
[ "https://Stackoverflow.com/questions/181956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20227/" ]
181,966
<p>I want to use a template engine in a struts application and would like to know if using TILES can be recommended instead of FREEMARKER or VELOCITY.</p>
[ { "answer_id": 181983, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "Hello ${name}" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
181,967
<p>I am currently working on a leave application (which is a subset of my e-scheduler project) and I have my database design as follows:</p> <pre><code>event (event_id, dtstart, dtend... *follows icalendar standard*) event_leave (event_id*, leave_type_id*, total_days) _leave_type (leave_type_id, name, max_carry_forw...
[ { "answer_id": 182149, "author": "Mark Brackett", "author_id": 2199, "author_profile": "https://Stackoverflow.com/users/2199", "pm_score": 2, "selected": false, "text": "User { User_Id (PK) }\n\n// Year may be a tricky business logic issue here...Do you charge the Start or End year\n// i...
2008/10/08
[ "https://Stackoverflow.com/questions/181967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5742/" ]
181,970
<p>I would like to send a (as yet undetermined) SIGnal from a bash script to a Gambas program when a specific file has been changed. </p> <p>How can I get my Gambas program to process this SIGnal?</p>
[ { "answer_id": 56855728, "author": "Benoît", "author_id": 11730064, "author_profile": "https://Stackoverflow.com/users/11730064", "pm_score": 1, "selected": false, "text": "gb.signal" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/181970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
181,975
<p>the function addresses (Rva+Base) in my MAP-file from visual studio doesn't match the one I see in the debugger (or when I manually inspect my stack frame).</p> <p>What could be causing this?</p> <p>/A.B.</p>
[ { "answer_id": 182269, "author": "Suma", "author_id": 16673, "author_profile": "https://Stackoverflow.com/users/16673", "pm_score": 1, "selected": false, "text": "static void KnownFunctionAddress(){}\n\n...\n\n// check an address of a known function\n// and compare this to the value read...
2008/10/08
[ "https://Stackoverflow.com/questions/181975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
181,977
<p>Does anyone know of a whirlwind tour of Eclipse that would help a (former) Visual Studio user get up to speed with it?</p> <p>I just want something that tells me where all the basic features are and what all the cool stuff I've heard so much about is?</p> <p>So far I've been using it mostly as a text editor and ha...
[ { "answer_id": 182269, "author": "Suma", "author_id": 16673, "author_profile": "https://Stackoverflow.com/users/16673", "pm_score": 1, "selected": false, "text": "static void KnownFunctionAddress(){}\n\n...\n\n// check an address of a known function\n// and compare this to the value read...
2008/10/08
[ "https://Stackoverflow.com/questions/181977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20400/" ]
181,986
<p>Every software development professional (and especially project managers) has to deal with a never ending stream of e-mails. What is the best way of organising them in MS Outlook?</p> <p>Obviously some fancy issue tracking tools give more flexibility but I am interested in plain vanilla approach that can be deploye...
[ { "answer_id": 195968, "author": "Scott James", "author_id": 6715, "author_profile": "https://Stackoverflow.com/users/6715", "pm_score": 4, "selected": true, "text": "Sub MoveToDone()\n On Error Resume Next\n\n Dim objFolder As Outlook.MAPIFolder, objInbox As Outlook.MAPIFolder\n ...
2008/10/08
[ "https://Stackoverflow.com/questions/181986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22088/" ]
181,990
<p>I'm setting up an online ordering system but I'm in Australia and for international customers I'd like to show prices in US dollars or Euros so they don't have to make the mental effort to convert from Australian dollars.</p> <p>Does anyone know if I can pull up to date exchange rates off the net somewhere in an ea...
[ { "answer_id": 182045, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 7, "selected": true, "text": "http://download.finance.yahoo.com/d/quotes.csv?s=GBPEUR=X&f=sl1d1t1ba&e=.csv" }, { "answer_id": 11968565, "author"...
2008/10/08
[ "https://Stackoverflow.com/questions/181990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5324/" ]
181,994
<p>In order to verify the data coming from the <a href="http://code.google.com/apis/safebrowsing/developers_guide.html" rel="nofollow noreferrer">Google Safe Browsing API</a>, you can calculate a Message Authentication Code (MAC) for each update. The instructions to do this (from Google) are:</p> <blockquote> <p>Th...
[ { "answer_id": 182099, "author": "Anders Waldenborg", "author_id": 24082, "author_profile": "https://Stackoverflow.com/users/24082", "pm_score": 2, "selected": true, "text": "c=\"8eirwN1kTwCzgWA2HxTaRQ==\".decode('base64')\n" }, { "answer_id": 184617, "author": "Tony Meyer", ...
2008/10/08
[ "https://Stackoverflow.com/questions/181994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4966/" ]
182,011
<p>When accessing an object in a DataTable retrieved from a database, are there any reasons not to cast the object into your desired type, or are there reasons to use convert? I know the rule is cast when we know what data type we're working with, and convert when attempting to change the data type to something it isn'...
[ { "answer_id": 182029, "author": "Joe", "author_id": 13087, "author_profile": "https://Stackoverflow.com/users/13087", "pm_score": 3, "selected": true, "text": "INSERT INTO MyTable ...\nSELECT CAST(SCOPE_IDENTITY() AS INT)\n" }, { "answer_id": 182031, "author": "Galwegian", ...
2008/10/08
[ "https://Stackoverflow.com/questions/182011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2179408/" ]
182,034
<p>XP-specific answers preferred, but others are welcome too.</p>
[ { "answer_id": 182052, "author": "jop", "author_id": 11830, "author_profile": "https://Stackoverflow.com/users/11830", "pm_score": 3, "selected": true, "text": "%windir%\\System32\\Shell32.dll" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/182034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20310/" ]
182,035
<p>Internet explorer 6 seems totally ignore CSS classes or rules on select, option or optgroup tags.</p> <p>Is there a way to bypass that limitation (except install a recent version of IE) ?</p> <p><strong>Edit</strong> : to be more precise, I'm trying to build a hierarchy between options like that example:</p> <p>H...
[ { "answer_id": 183213, "author": "Matt", "author_id": 17020, "author_profile": "https://Stackoverflow.com/users/17020", "pm_score": 4, "selected": true, "text": "&nbsp ; \n <!--[if lt IE 7]><![endif]--> \n <!--[if IE 6]><![endif]--> \n Level 1\n<!--[if lt IE 7]>-<![endif]-->Level 2 \n<!-...
2008/10/08
[ "https://Stackoverflow.com/questions/182035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3122/" ]
182,040
<p>I want to create a route in my rails application along the lines of</p> <pre><code>/panda/blog /tiger/blog /dog/blog </code></pre> <p>where panda, tiger, and dog are all permalinks (for an animal class)</p> <p>The normal way of doing this</p> <pre><code>map.resources :animals do |animal| animal.resource :blog e...
[ { "answer_id": 6201691, "author": "edgerunner", "author_id": 311941, "author_profile": "https://Stackoverflow.com/users/311941", "pm_score": 4, "selected": true, "text": "path => \"\" resource resources resources :animals, :path => \"\"\n $ rake routes\n\n animals GET / ...
2008/10/08
[ "https://Stackoverflow.com/questions/182040", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7473/" ]