qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
355,318
<ol> <li><p><strong>How do i redirect a url to domain .</strong> eg. <a href="http://www.mydomain.com/index.php=HairThing" rel="nofollow noreferrer">http://www.mydomain.com/index.php=HairThing</a> --> <a href="http://www.mydomain.com" rel="nofollow noreferrer">http://www.mydomain.com</a></p></li> <li><p><strong>How do...
[ { "answer_id": 355339, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 2, "selected": false, "text": "#1\nRewriteRule /index.php=HairThing$ http://www.mydomain.com [R=301]\n\n#2\nRewriteCond %{HTTP_HOST} ^mydomain.com \...
2008/12/10
[ "https://Stackoverflow.com/questions/355318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,327
<p>Does thread-safety of SQLite3 mean different threads can modify the same table of a database concurrently?</p>
[ { "answer_id": 2894848, "author": "Jeremiah Rose", "author_id": 234383, "author_profile": "https://Stackoverflow.com/users/234383", "pm_score": 2, "selected": false, "text": "check_same_thread" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26404/" ]
355,333
<p>I have a client that thought a highly dynamic ASP.NET application was a very simple sytem, yet to implement it in the manner in which they needed for future grown it has grown to well over 100 different code files.</p> <p>I am looking for a way, most likely with some sort of static code analysis tool to put some nu...
[ { "answer_id": 2894848, "author": "Jeremiah Rose", "author_id": 234383, "author_profile": "https://Stackoverflow.com/users/234383", "pm_score": 2, "selected": false, "text": "check_same_thread" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13279/" ]
355,343
<p>Does anyone know how to acess a url from a windows application?.</p> <p>I have an address <a href="http://serverport/Page.I" rel="nofollow noreferrer">http://serverport/Page.I</a> want to acess this page from my windows application.</p> <p>Regards, Harsh Suman</p>
[ { "answer_id": 355348, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 2, "selected": false, "text": "WebBrowser" }, { "answer_id": 355380, "author": "Stein G. Strindhaug", "author_id": 26115, "author_profile...
2008/12/10
[ "https://Stackoverflow.com/questions/355343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,355
<p>I am using <a href="http://www.svnkit.com" rel="nofollow noreferrer">SVNKit</a> in my application. I have a scenario wherein certain files should be ignored when doing svn operations. i.e. I need to set the svn:ignore property for certain patterns.</p> <p>How do I do that using SVNKit?</p>
[ { "answer_id": 355363, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 3, "selected": true, "text": "addIgnorePattern()" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35392/" ]
355,358
<p>I can't connect to the default web site in IIS 6.0 using localhost or 127.0.0.1 or by server name. When I telnet to port 80 with one of these names, there's no connection.</p> <p>However other web sites are running and I can telnet using any of the ip addresses. I can ping to localhost where 127.0.0.1 is responding...
[ { "answer_id": 356083, "author": "Samiksha", "author_id": 29515, "author_profile": "https://Stackoverflow.com/users/29515", "pm_score": 0, "selected": false, "text": "*.(your site url)" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5232/" ]
355,365
<p>The Java AtomicInteger class has a method -</p> <pre><code>boolean weakCompareAndSet(int expect,int update) </code></pre> <p>Its documnentation says:</p> <blockquote> <p>May fail spuriously.</p> </blockquote> <p>What does 'failing spuriously' here mean?</p>
[ { "answer_id": 355374, "author": "Michael Burr", "author_id": 12711, "author_profile": "https://Stackoverflow.com/users/12711", "pm_score": 3, "selected": false, "text": "CompareAndSet()" }, { "answer_id": 355392, "author": "VonC", "author_id": 6309, "author_profile":...
2008/12/10
[ "https://Stackoverflow.com/questions/355365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14316/" ]
355,386
<p>Please let me know why there is lot of white space below the page content and also why horizontal scroll bar is displayed. Attaching link to zip folder below. Unzip and open index.html.<br /> <a href="http://shivanand.in/tmp/Basic_Profile.zip" rel="nofollow noreferrer">link text</a></p>
[ { "answer_id": 355421, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 3, "selected": true, "text": "div#content" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34642/" ]
355,398
<p>How do I segment a 2D image into blobs of similar values efficiently? The given input is a n array of integer, which includes hue for non-gray pixels and brightness of gray pixels.</p> <p>I am writing a virtual mobile robot using Java, and I am using segmentation to analyze the map and also the image from the camer...
[ { "answer_id": 355417, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 0, "selected": false, "text": "UNSEGMENTED" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3827/" ]
355,425
<p>I need to write a script to change a filename from aDate.txt to bDate.txt where:</p> <ul> <li>aDate is the current system date in <em>yyyymmdd</em> format and </li> <li>bDate is the current system date - 1 in <em>yyyymmdd</em> format.</li> </ul> <p>I currently have:</p> <pre><code>set yy=%date:~6,2% set mm=%date:...
[ { "answer_id": 355561, "author": "wimh", "author_id": 33499, "author_profile": "https://Stackoverflow.com/users/33499", "pm_score": 3, "selected": false, "text": "@echo off\n\nset yyyy=\n\nset $tok=1-3\nfor /f \"tokens=1 delims=.:/-, \" %%u in ('date /t') do set $d1=%%u\nif \"%$d1:~0,1%\...
2008/12/10
[ "https://Stackoverflow.com/questions/355425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/939/" ]
355,447
<p>I have some documentation written in OpenOffice, and I would like to include some of it as PDF files in the final build deliveries. I would like to do this with the automated build script.</p> <p>Is there a way to create a PDF file from OpenOffice with a command line command?</p>
[ { "answer_id": 355470, "author": "OscarRyz", "author_id": 20654, "author_profile": "https://Stackoverflow.com/users/20654", "pm_score": 5, "selected": true, "text": " File inputFile = new File(\"C:\\\\oreyes\\\\hola.doc\"); \n File outputFile = new File(\"C:\\\\oreyes\\\\ho...
2008/12/10
[ "https://Stackoverflow.com/questions/355447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6482/" ]
355,449
<p>Hey folks - I'm writing a pretty simple iPhone application. The data comes from a plist file (NSDictionary basically), that I'm trying to load into a singleton class and use across my various view controllers to access the data.</p> <p>Here's the implementation for my singleton (heavily modeled after <a href="http...
[ { "answer_id": 355461, "author": "Ashley Clark", "author_id": 4556, "author_profile": "https://Stackoverflow.com/users/4556", "pm_score": 5, "selected": true, "text": "-init" }, { "answer_id": 356125, "author": "Chris Jefferson", "author_id": 27074, "author_profile": ...
2008/12/10
[ "https://Stackoverflow.com/questions/355449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44858/" ]
355,456
<p>Is it possible to get the current source line number in Perl? The equivalent in C++ is <code>__LINE__</code>.</p>
[ { "answer_id": 355464, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 7, "selected": true, "text": "__LINE__" }, { "answer_id": 358293, "author": "bigiain", "author_id": 11590, "author_profile": "htt...
2008/12/10
[ "https://Stackoverflow.com/questions/355456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259/" ]
355,459
<p>I have a big red button and I'm trying to use javascript to perform the following: -</p> <ol> <li>OnMouseDown change image so the button looks depressed</li> <li>OnMouseUp return to the initial image AND reveal a hidden div</li> </ol> <p>I can get the onMouse Down and onMouseUp image changes part to work.</p> <p>...
[ { "answer_id": 355484, "author": "Jonathan Lonowski", "author_id": 15031, "author_profile": "https://Stackoverflow.com/users/15031", "pm_score": 2, "selected": true, "text": "<img src=\"...\" alt=\"...\"\n onmousedown=\"depressed();\"\n onmouseup=\"undepressed(); revealDiv();\" />\n" ...
2008/12/10
[ "https://Stackoverflow.com/questions/355459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,473
<p>I want to handle different types of docs the same way in my application Therefore: I have a generic interface like this.</p> <pre><code>public interface IDocHandler&lt;T&gt;where T: class { T Document { get;set;} void Load(T doc); void Load(string PathToDoc); void Execute(); void Execute(T doc); } </code></pr...
[ { "answer_id": 355525, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 1, "selected": false, "text": "public interface IDocumentHandler { }\npublic interface IDocumentHandler<T> : IDocumentHandler { }\n" }, { "a...
2008/12/10
[ "https://Stackoverflow.com/questions/355473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,477
<p>In Silverlight (and I guess WPF) why are the properties x:name x:fieldmodifier x:uid the only ones with the prefix x. </p> <p>I understand the x prefix is used to refer to the XML namespace but there are a number of other properties that do not use a prefix such as width. Identifying a control is such a common task...
[ { "answer_id": 355503, "author": "DaniCE", "author_id": 19046, "author_profile": "https://Stackoverflow.com/users/19046", "pm_score": 2, "selected": false, "text": "xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" \nxmlns:x=\"http://schemas.microsoft.com/winfx/2006/xam...
2008/12/10
[ "https://Stackoverflow.com/questions/355477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23066/" ]
355,486
<p>I've got a Core Data application that has an Event class, which has a start date and a finish date. It's trivial to bind these to a pair of NSDatePicker widgets, but I wanted to make it work with the NSRangeDateMode available in Leopard.</p> <p>The NSDatePicker has a pair of methods that deal with timeInterval, bu...
[ { "answer_id": 357758, "author": "Ashley Clark", "author_id": 4556, "author_profile": "https://Stackoverflow.com/users/4556", "pm_score": 1, "selected": false, "text": "timeInterval" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/188/" ]
355,492
<p>I have read the following properties from AD,</p> <pre><code>TerminalServicesProfilePath TerminalServicesHomeDirectory TerminalServicesHomeDrive </code></pre> <p>I've tried DirectoryEntry and DirectorySearcher. But they does not include the properties.</p> <p>I found some example in vbscript and VC to read them. ...
[ { "answer_id": 355513, "author": "chriscena", "author_id": 32671, "author_profile": "https://Stackoverflow.com/users/32671", "pm_score": 2, "selected": true, "text": "//user is a DirectoryEntry\nIADsTSUserEx adsiUser = (IADsTSUserEx)user.NativeObject; \n" }, { "answer_id": 355545...
2008/12/10
[ "https://Stackoverflow.com/questions/355492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40214/" ]
355,508
<p>Sorry about the vague subject but I couldn't think what to put.</p> <p>Here's my problem, I'm doing a query on a table that returns me a count of items related to a day. I want to make sure that if I do a query on the DB, I always get a set number of rows. For example, imagine I have the following table that cont...
[ { "answer_id": 355625, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "select d login_date, count(login_date) count\nfrom\n websitelogin wsl\n right outer join (\n select start_date+l-...
2008/12/10
[ "https://Stackoverflow.com/questions/355508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1900/" ]
355,516
<p>When accessing my site, the user has to enter his credentials. They are basically plain directory access credentials. At a certain point I check if a certain file they want to download exists by calling</p> <pre><code>WebRequest req = HttpWebRequest.Create(checkUri.AbsoluteUri); WebResponse res = req.GetResponse();...
[ { "answer_id": 355522, "author": "mookid8000", "author_id": 6560, "author_profile": "https://Stackoverflow.com/users/6560", "pm_score": 3, "selected": false, "text": "req.Credentials = CredentialCache.DefaultCredentials;\n" }, { "answer_id": 356308, "author": "Dave Markle", ...
2008/12/10
[ "https://Stackoverflow.com/questions/355516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
355,526
<p>HI,</p> <p>I have a large table from which i can query to get the following table</p> <pre><code>type no of times type occurs 101 450 102 562 103 245 </code></pre> <p>also i can get another table</p> <pre><code>code no of times code occurs 0 1222 1 ...
[ { "answer_id": 355522, "author": "mookid8000", "author_id": 6560, "author_profile": "https://Stackoverflow.com/users/6560", "pm_score": 3, "selected": false, "text": "req.Credentials = CredentialCache.DefaultCredentials;\n" }, { "answer_id": 356308, "author": "Dave Markle", ...
2008/12/10
[ "https://Stackoverflow.com/questions/355526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31132/" ]
355,531
<p>I am trying to understand if I really have any case for using git/mercurial.</p> <p>The projects I work are java and c# projects, usually with 5-20 people working towards a common goal (the "release"). Most of the developers are professional developers who refactor code <em>all of the time</em>. So where the typic...
[ { "answer_id": 355686, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 5, "selected": true, "text": "a b center\n |\n |\n / Key: / - | \\ = Flow\n/----<---| < > = Fl...
2008/12/10
[ "https://Stackoverflow.com/questions/355531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23691/" ]
355,533
<p>I have two unix partitions under debian which I would like to merge (disk space problems :/). What would be the easiest way to do it? I think it would be best to tar or copy files from one partition to the other, delete one and resize the other. I will use parted to resize but how should I copy the files? There are ...
[ { "answer_id": 355591, "author": "Anders Westrup", "author_id": 36845, "author_profile": "https://Stackoverflow.com/users/36845", "pm_score": 3, "selected": true, "text": "cd /partition2\ntar cf - . | ( cd /partition1 && tar xf - )\n" }, { "answer_id": 440800, "author": "Tedd...
2008/12/10
[ "https://Stackoverflow.com/questions/355533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26943/" ]
355,538
<p>The client has asked for a number of tables to be extracted into csv's, all done no problem. They've just asked we make sure the files are always in UTF 8 format.</p> <p>How do I check this is actually the case. Or even better force it to be so, is it something i can set in a procedure before running a query perha...
[ { "answer_id": 355575, "author": "rics", "author_id": 21047, "author_profile": "https://Stackoverflow.com/users/21047", "pm_score": 4, "selected": true, "text": "select value from nls_database_parameters \nwhere parameter='NLS_CHARACTERSET'\n" }, { "answer_id": 356211, "autho...
2008/12/10
[ "https://Stackoverflow.com/questions/355538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27412/" ]
355,539
<p>If I had a dictionary <code>dict</code> and I wanted to check for <code>dict['key']</code> I could either do so in a <code>try</code> block (bleh!) or use the <code>get()</code> method, with <code>False</code> as a default value.</p> <p>I'd like to do the same thing for <code>object.attribute</code>. That is, I alr...
[ { "answer_id": 355562, "author": "Zoomulator", "author_id": 44563, "author_profile": "https://Stackoverflow.com/users/44563", "pm_score": 4, "selected": false, "text": "hasattr()" }, { "answer_id": 355571, "author": "Community", "author_id": -1, "author_profile": "htt...
2008/12/10
[ "https://Stackoverflow.com/questions/355539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9106/" ]
355,540
<p>I have a special url which I would want only few people to have access to. I have a list of super users stored as an array in the app.yml. How can I use this array in :requirements section of a specific route in the routes.rb file to allow only those super users access to this route? Thanks a lot.</p>
[ { "answer_id": 355562, "author": "Zoomulator", "author_id": 44563, "author_profile": "https://Stackoverflow.com/users/44563", "pm_score": 4, "selected": false, "text": "hasattr()" }, { "answer_id": 355571, "author": "Community", "author_id": -1, "author_profile": "htt...
2008/12/10
[ "https://Stackoverflow.com/questions/355540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44916/" ]
355,550
<p>I have two arrays in PHP. The first array ($author_array) is comprised of user_ids in a particular order, like so: (8, 1, 6)</p> <p>The second array ($user_results) is comprised of an array of objects like so:</p> <pre><code>Array ( [0] =&gt; stdClass Object ( [ID] =&gt; 1 [user...
[ { "answer_id": 355583, "author": "Paul Dixon", "author_id": 6521, "author_profile": "https://Stackoverflow.com/users/6521", "pm_score": 6, "selected": true, "text": "function cmp($a, $b) \n{\n global $author_array;\n\n $pos1=array_search ($a->ID, $author_array);\n $pos2=array_searc...
2008/12/10
[ "https://Stackoverflow.com/questions/355550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44919/" ]
355,560
<p>I have these values: <code>d1, d45, d79, d33, d100</code></p> <p>I want to sort these variables in ascending order from my table.</p> <p>What is the query to get the output as:</p> <pre><code>d1 d33 d45 d79 d100 </code></pre>
[ { "answer_id": 355611, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 0, "selected": false, "text": "select foo from bar order by cast(substring(foo from 2) as int)\n" }, { "answer_id": 356619, "author": "Jonat...
2008/12/10
[ "https://Stackoverflow.com/questions/355560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,576
<p>I would like to get Binding object from web.config or app.config.</p> <p>So, this code works:</p> <pre><code>wcfTestClient = new TestServiceClient("my_endpoint", Url + "/TestService.svc"); </code></pre> <p>but I would like to do the following:</p> <pre><code>Binding binding = DoSomething(); wcfTestClient = new T...
[ { "answer_id": 355709, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": false, "text": "Binding defaultBinding;\nusing(TestServiceClient client = new TestServiceClient()) {\n defaultBinding = client.End...
2008/12/10
[ "https://Stackoverflow.com/questions/355576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28912/" ]
355,602
<p>I've had to create a custom membership provider for my current ASP .Net project in order to fit in with our database schema, and am having problems configuring it to lockout a user if they get their password wrong three times, as is supported by the standard providers.</p> <p>Is this something I need to implement m...
[ { "answer_id": 356106, "author": "Zhaph - Ben Duguid", "author_id": 33051, "author_profile": "https://Stackoverflow.com/users/33051", "pm_score": 2, "selected": false, "text": "IsLockedOut\nFailedPasswordAttemptCount\nFailedPasswordAttemptWindowStart\n" }, { "answer_id": 2064058,...
2008/12/10
[ "https://Stackoverflow.com/questions/355602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40848/" ]
355,619
<p>The common sense tells that the Doxygen comment blocks have to be put in the header files where the classes, structs, enums, functions, declarations are. I agree that this is a sound argument for a libraries that are mean to be distributed without its source (only headers and libs with object code).</p> <p>BUT...I'...
[ { "answer_id": 355646, "author": "eaanon01", "author_id": 36986, "author_profile": "https://Stackoverflow.com/users/36986", "pm_score": 4, "selected": false, "text": "/**\n * \\brief Short about function\n *\n * More about function\n */\nWORD my_fync1(BYTE*);\n" }, { "answer_id":...
2008/12/10
[ "https://Stackoverflow.com/questions/355619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34752/" ]
355,632
<p>On a website I'm working we have an onsite login and a private login, the problem I'm having is that Firefox doesn't seem to be able to differentiate between these login forms.</p> <p>Does anybody know how I can make clear that these are different logins?</p> <p>I already tried giving the form fields different nam...
[ { "answer_id": 355734, "author": "dragonlord21", "author_id": 44931, "author_profile": "https://Stackoverflow.com/users/44931", "pm_score": 1, "selected": false, "text": "<p>" }, { "answer_id": 355856, "author": "Polichism", "author_id": 44544, "author_profile": "http...
2008/12/10
[ "https://Stackoverflow.com/questions/355632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1074/" ]
355,633
<p>I was reading up on Ruby, and learned about its mixins pattern, but couldn't think of many useful mixin functionality (because I'm not used to thinking that way most likely). So I was wondering what would be good examples of useful Mixin functionality?</p> <p>Thanks</p> <p>Edit: A bit of background. I'm Coming fro...
[ { "answer_id": 355698, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 4, "selected": true, "text": "module Persistence\n def load sFileName\n puts \"load code to read #{sFileName} contents into my_data\"\n end\...
2008/12/10
[ "https://Stackoverflow.com/questions/355633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15124/" ]
355,636
<p>I have a problem that I feel is best implimented in a stand alone windows application, but needs to pass data to a web page that is already open. </p> <p>Is it possible to pass the data directly to the web page?</p> <p>If so, what is the best way to go about it?</p> <p>(Its my first question, so go easy on me!)</...
[ { "answer_id": 355698, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 4, "selected": true, "text": "module Persistence\n def load sFileName\n puts \"load code to read #{sFileName} contents into my_data\"\n end\...
2008/12/10
[ "https://Stackoverflow.com/questions/355636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44914/" ]
355,638
<p>I'm using Jquery's toggle event to do some stuff when a user clicks a checkbox, like this:</p> <pre><code>$('input#myId').toggle( function(){ //do stuff }, function(){ //do other stuff } ); </code></pre> <p>The problem is that the checkbox isn't being ticked when I click on the checkbox. (All the stuff I've ...
[ { "answer_id": 355664, "author": "Andreas Grech", "author_id": 44084, "author_profile": "https://Stackoverflow.com/users/44084", "pm_score": 7, "selected": true, "text": "change" }, { "answer_id": 355672, "author": "adam", "author_id": 33604, "author_profile": "https:...
2008/12/10
[ "https://Stackoverflow.com/questions/355638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22946/" ]
355,650
<p>I am looking for template/generator libraries for C++ that are similar to eg. Ruby's Erb, Haml, PHP's Smarty, etc.</p> <p>It would be great if I it would sport some basic features like loops, if/else, int conversion to strings, etc.</p> <p>Parameter passing to template rendering engine is also important if I could...
[ { "answer_id": 15592275, "author": "kirill_igum", "author_id": 390066, "author_profile": "https://Stackoverflow.com/users/390066", "pm_score": 2, "selected": false, "text": "std::cout << format(\"The answers are {} and {}\", 23, 42); \n// => \"The answers are 23 and 42\"\n\nstd::map<std:...
2008/12/10
[ "https://Stackoverflow.com/questions/355650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5731/" ]
355,670
<p>Myself and a colleague have a dispute about which of the following is more elegant. I won't say who's who, so it is impartial. Which is more elegant?</p> <pre><code>public function set hitZone(target:DisplayObject):void { if(_hitZone != target) { _hitZone.removeEventL...
[ { "answer_id": 355684, "author": "xsl", "author_id": 11387, "author_profile": "https://Stackoverflow.com/users/11387", "pm_score": 5, "selected": false, "text": "return" }, { "answer_id": 355812, "author": "Zarkonnen", "author_id": 15255, "author_profile": "https://St...
2008/12/10
[ "https://Stackoverflow.com/questions/355670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11911/" ]
355,673
<p>This is probably a simple question but I am not an ASP.NET developer and I am quite stuck.</p> <p>I have a simple search routine that returns between zero and several hundred results. Each of these must be added to the page as a button and I want to set the text of the button and the CommandArgument property so tha...
[ { "answer_id": 355683, "author": "Ian Oxley", "author_id": 1904, "author_profile": "https://Stackoverflow.com/users/1904", "pm_score": 0, "selected": false, "text": "result.Click += new EventHandler(SearchResultClicked);\n" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44938/" ]
355,691
<p>I've got an extremely long XML file, like</p> <pre><code>&lt;Root&gt; &lt;ele1&gt; &lt;child1&gt;context1&lt;/child1&gt; &lt;child2&gt;test1&lt;/child2&gt; &lt;child1&gt;context1&lt;/child1&gt; &lt;/ele1&gt; &lt;ele2&gt; &lt;child1&gt;context2&lt;/child1&gt; &lt;child2&gt;tes...
[ { "answer_id": 10670314, "author": "ABach", "author_id": 327179, "author_profile": "https://Stackoverflow.com/users/327179", "pm_score": 2, "selected": false, "text": "<child1>" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,700
<p>I want to embed a link to a controller action in my page so I can use it from javascript. Something like</p> <pre><code>var pollAction = '/Mycontroller/CheckStatus' </code></pre> <p>Now I am happy to hardcode it, but it would be really nice if there were a method I could use to create the URL. The AjaxHelper/HtmlE...
[ { "answer_id": 355736, "author": "mapache", "author_id": 41422, "author_profile": "https://Stackoverflow.com/users/41422", "pm_score": 5, "selected": true, "text": "var pollAction = '<%=Url.Action(\"CheckStatus\", \"MyController\") %>';\n" }, { "answer_id": 355824, "author": ...
2008/12/10
[ "https://Stackoverflow.com/questions/355700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22360/" ]
355,723
<p>I'm trying in vain to write a regular expression to match valid ssh connection strings.</p> <p>I really only need to recognise strings of the format:</p> <ul> <li>user@hostname:/some/path</li> </ul> <p>but it would be nice to also match an implicit home directory:</p> <ul> <li>user@hostname:</li> </ul> <p>I've ...
[ { "answer_id": 355750, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 2, "selected": false, "text": "/^[:alnum:]+\\@[:alnum:\\.]\\:(\\/[:alnum:]+)*$/\n" }, { "answer_id": 355753, "author": "Kent Fredric", ...
2008/12/10
[ "https://Stackoverflow.com/questions/355723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,724
<p>Is it possible to embed a DOS console in a Windows Form or User Control in C# 2.0?</p> <p>We have a legacy DOS product that my Windows app has to interact with, and it's been requested that an instance of the legacy product should run within the Windows application.</p> <p>At the moment, I'm using the user32.dll t...
[ { "answer_id": 355749, "author": "TimothyP", "author_id": 28149, "author_profile": "https://Stackoverflow.com/users/28149", "pm_score": 6, "selected": true, "text": "var processStartInfo = new ProcessStartInfo(\"someoldapp.exe\", \"-p someparameters\");\n\nprocessStartInfo.UseShellExecut...
2008/12/10
[ "https://Stackoverflow.com/questions/355724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18895/" ]
355,730
<p>What is the best way to store instances of a class to file/database?</p> <p>We have a base class called Command and loads of derived classes. Users create instances of these classes by adding commands to a graphical designer where they can configure them. (Set the properties).</p> <p>We then need a way to store th...
[ { "answer_id": 355838, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": false, "text": "DataContractSerializer" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28149/" ]
355,732
<p>For example, java.io.File is just a concrete class. My replacement for it supports resolving Windows shortcuts. I need to preprocess constructor parameters to resolve possible .lnk files because the FileSystem object that does normalizing/canonicalision/resolving on the abstract paths is not accessible. The need for...
[ { "answer_id": 355754, "author": "Dan Vinton", "author_id": 21849, "author_profile": "https://Stackoverflow.com/users/21849", "pm_score": 2, "selected": false, "text": "super()" }, { "answer_id": 355774, "author": "bruno conde", "author_id": 31136, "author_profile": "...
2008/12/10
[ "https://Stackoverflow.com/questions/355732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2492/" ]
355,737
<p>How can I rotate the Apache Access and Error logs on a Window 2000 box?</p> <p>I include my batch file below as an answer.</p> <p>Is there a way of doing this directly via the Apache config file? I'm currently using the following customlog command to generate daily logs.</p> <p>CustomLog '|" "*Apache-Path/bin/ro...
[ { "answer_id": 355792, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 0, "selected": false, "text": "logrotate" }, { "answer_id": 355857, "author": "alimack", "author_id": 39447, "author_profile": ...
2008/12/10
[ "https://Stackoverflow.com/questions/355737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39447/" ]
355,775
<p>I'm writing a JavaSCript class that has a method that recursively calls itself.</p> <pre><code>Scheduler.prototype.updateTimer = function () { document.write( this._currentTime ); this._currentTime -= 1000; // recursively calls itself this._updateUITimerHandler = window.setTimeout( arguments.callee ...
[ { "answer_id": 355790, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 1, "selected": false, "text": "function f() \n{\n alert('foo');\n window.setTimeout(arguments.callee,5000);\n}\n\nf();\n" }, { "answer_id": 35...
2008/12/10
[ "https://Stackoverflow.com/questions/355775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9394/" ]
355,787
<p>This is something I'm not much consistent about and always curious about what other people do.</p> <p>How do you access internal properties (private or public)? </p> <p>For example you've got this property :</p> <pre><code>Private _Name As String Public Property Name() As String Get Return _Name ...
[ { "answer_id": 355797, "author": "bezmax", "author_id": 43677, "author_profile": "https://Stackoverflow.com/users/43677", "pm_score": 1, "selected": false, "text": "Name = \"Johny\"\n" }, { "answer_id": 355806, "author": "Jon Skeet", "author_id": 22656, "author_profil...
2008/12/10
[ "https://Stackoverflow.com/questions/355787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40322/" ]
355,796
<p>My relative is studying programming and has a hard time understanding classes. He has trouble understanding for example that you need to instantiate it, that methods cannot access variables in other methods and if you change a variable in one instance of a class it doesn't change for other instances.</p> <p>I've tr...
[ { "answer_id": 355810, "author": "Robert Gould", "author_id": 15124, "author_profile": "https://Stackoverflow.com/users/15124", "pm_score": 5, "selected": true, "text": " // Assembly: Common Classes\n // Namespace: CommonClasses\n\n public interface IAnimal\n {\n strin...
2008/12/10
[ "https://Stackoverflow.com/questions/355796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33468/" ]
355,802
<p>Is there some standard way or has anyone written something that allows you to log a message and have it be displayed either in a small scrolling section on the iphone screen or in a separate window in the iphone simulator?</p> <p>Update: For noobs like me and don't know, use the NSLog methods as decribed below and ...
[ { "answer_id": 355861, "author": "adam", "author_id": 33604, "author_profile": "https://Stackoverflow.com/users/33604", "pm_score": 4, "selected": true, "text": "NSLog(@\"message\");\n" }, { "answer_id": 358233, "author": "Rob", "author_id": 386102, "author_profile": ...
2008/12/10
[ "https://Stackoverflow.com/questions/355802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36510/" ]
355,813
<p>I've got some entities which have decimal properties on them. These entities' properties are displayed in multiple places throughout my UI.</p> <p>Currently I'm finding myself doing:</p> <pre><code>litWeight.Text = person.Weight.ToString("0.00"); </code></pre> <p>all over the place. Now I know for a fact that in ...
[ { "answer_id": 355852, "author": "Toni Ruža", "author_id": 6267, "author_profile": "https://Stackoverflow.com/users/6267", "pm_score": 3, "selected": true, "text": "litWeight.Text = Utility.FormatWeight(person.Weight);\n" }, { "answer_id": 355854, "author": "The Archetypal Pa...
2008/12/10
[ "https://Stackoverflow.com/questions/355813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28543/" ]
355,816
<p>I am using a global named mutex for file access synchronization between an ASP.NET application and a console application.</p> <p>While running the ASP.NET application, the console application fails to acquire mutex - as expected. While running the console application, the ASP.NET application throws <code>Unauthoriz...
[ { "answer_id": 355829, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 5, "selected": true, "text": "MutexSecurity and MutexAccessRule ?\n" }, { "answer_id": 3456066, "author": "Vladislav", "author_id": 155687, ...
2008/12/10
[ "https://Stackoverflow.com/questions/355816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19756/" ]
355,818
<pre><code>ScalarQuery&lt;int&gt; query = new ScalarQuery&lt;int&gt;(typeof(Role), "select count(role.RoleId) from Role as role"); return query.Execute(); </code></pre> <p>It fails with the invalidcast exception but succeeds when count is replaced with max. </p>
[ { "answer_id": 355837, "author": "gcores", "author_id": 40256, "author_profile": "https://Stackoverflow.com/users/40256", "pm_score": 2, "selected": true, "text": "ScalarQuery<long> query = new ScalarQuery<long>(typeof(Role), \n \"select count(r) from Role r\");\...
2008/12/10
[ "https://Stackoverflow.com/questions/355818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38807/" ]
355,830
<p>I would like to create a cache for my php pages on my site. I did find too many solutions but what I want is a script which can generate an HTML page from my database ex:</p> <p>I have a page for categories which grabs all the categories from the DB, so the script should be able to generate an HTML page of the sort...
[ { "answer_id": 355860, "author": "Irmantas", "author_id": 43182, "author_profile": "https://Stackoverflow.com/users/43182", "pm_score": 4, "selected": false, "text": "ob_start();\necho 'some_output';\n$content = ob_get_contents();\nob_end_clean();\n\necho 'Content generated :'.$content;\...
2008/12/10
[ "https://Stackoverflow.com/questions/355830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,833
<p>I have been searching for a simple way to convert a dataset from a <a href="http://en.wikipedia.org/wiki/PostgreSQL" rel="nofollow noreferrer">PostgreSQL</a> database to JSON for use in a project that I am building.</p> <p>This is my first time using JSON, and I have found it really tricky to find a simple way of d...
[ { "answer_id": 5727183, "author": "DineshHona", "author_id": 404315, "author_profile": "https://Stackoverflow.com/users/404315", "pm_score": 0, "selected": false, "text": "public static string GetJSONString(DataTable Dt)\n{\n string[] StrDc = new string[Dt.Columns.Count];\n string ...
2008/12/10
[ "https://Stackoverflow.com/questions/355833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,842
<p>I have the following HandleError filter on my controller:</p> <pre>[HandleError(ExceptionType = typeof(ArgumentException), View = "DestinationError")]</pre> <p>I've set-up the Web.Config so that customErrors are on. The problem I'm having is that the HandleError filter is working fine, when I run the app locally ...
[ { "answer_id": 1230927, "author": "labilbe", "author_id": 1195872, "author_profile": "https://Stackoverflow.com/users/1195872", "pm_score": 0, "selected": false, "text": "Response.TrySkipIisCustomErrors = true;\n" }, { "answer_id": 1236497, "author": "labilbe", "author_id...
2008/12/10
[ "https://Stackoverflow.com/questions/355842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,848
<p>How can I emulate classes (and namespaces) in JavaScript?</p> <p>I need to create a JavaScript library and have limited experience with the language. I always thought that it had native support for classes, but it is less related to Java than I had assumed. It seems that everything in JavaScript is actually a funct...
[ { "answer_id": 355889, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 1, "selected": false, "text": "DoctaJonez.Namespace1 = {};" }, { "answer_id": 356343, "author": "Eugene Lazutkin", "author_id": 26394, ...
2008/12/10
[ "https://Stackoverflow.com/questions/355848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39277/" ]
355,865
<p>I have the following code, which is the core part of my small AJAX application. I am not getting any errors, it is just that nothing happens. I am guessing there is a more efficient way to do what I am trying to do.</p> <p>Here is the code:</p> <pre><code>var xmlHttp var layername function update(layer, part, pk...
[ { "answer_id": 355935, "author": "Stoo", "author_id": 27425, "author_profile": "https://Stackoverflow.com/users/27425", "pm_score": 1, "selected": false, "text": "onclick=\"update(\\'Layer3\\',\\'2\\',\\''.$pk.'\\',\\'0\\',)\">\n" }, { "answer_id": 356282, "author": "Andreas ...
2008/12/10
[ "https://Stackoverflow.com/questions/355865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246613/" ]
355,875
<p>I think I am having a mental block but can someone please enlighten me on how to combine these two LINQ statements into one? </p> <pre><code>/// &lt;summary&gt; /// Returns an array of Types that implement the supplied generic interface in the /// current AppDomain. /// &lt;/summary&gt; /// &lt;param name="interfac...
[ { "answer_id": 355936, "author": "Hath", "author_id": 5186, "author_profile": "https://Stackoverflow.com/users/5186", "pm_score": 1, "selected": false, "text": " public static Type[] GetTypesImplementingGenericInterface(Type interfaceType, bool includeAbstractTypes, bool includeInterf...
2008/12/10
[ "https://Stackoverflow.com/questions/355875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38041/" ]
355,876
<p>I'm working on an ASP .NET 2.0 site which uses a Web Application project file, and therefore compiles to a dll rather than deploying the source code as you do with the older style Web Site projects.</p> <p>The site works fine on my test server (Windows Server 2003 R2, IIS6) when it runs in the root of a website. Ho...
[ { "answer_id": 48753390, "author": "noemi", "author_id": 9351451, "author_profile": "https://Stackoverflow.com/users/9351451", "pm_score": -1, "selected": false, "text": "namespace Rectangle\n{\n class Name\n {\n int length1;\n int width1;\n int sum;\n\n ...
2008/12/10
[ "https://Stackoverflow.com/questions/355876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12277/" ]
355,879
<p>I have the following code:</p> <p><a href="http://www.nomorepasting.com/getpaste.php?pasteid=22615" rel="nofollow noreferrer">http://www.nomorepasting.com/getpaste.php?pasteid=22615</a></p> <p>Which is called by the javascript mentioned in <a href="https://stackoverflow.com/questions/355865/javascript-function-not...
[ { "answer_id": 356019, "author": "spelley", "author_id": 41654, "author_profile": "https://Stackoverflow.com/users/41654", "pm_score": 0, "selected": false, "text": "$query ='';\nif (isset($_GET[\"query\"]))\n$query = $_GET[\"query\"];\n" }, { "answer_id": 356085, "author": "...
2008/12/10
[ "https://Stackoverflow.com/questions/355879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246613/" ]
355,899
<pre><code> String fullName = PATH + "." + name; Class cl= Class.forName(fullName); if(name.equalsIgnoreCase("MobileSearch")){ if(msearchType==null){ msearchType=(SearchInterface)cl.newInstance(); } return msearchType; } if(name...
[ { "answer_id": 355922, "author": "Jacob Schoen", "author_id": 3340, "author_profile": "https://Stackoverflow.com/users/3340", "pm_score": 0, "selected": false, "text": "String fullName = PATH + \".\" + name;\n\nClass cl= Class.forName(fullName); \nif(searchType==null){ ...
2008/12/10
[ "https://Stackoverflow.com/questions/355899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,903
<p>I have a website setup in IIS 6, let's say it's called <strong><a href="http://www.this.com" rel="nofollow noreferrer">http://www.this.com</a></strong>.</p> <p>I have setup a redirection for this website to <strong><a href="http://www.that.com" rel="nofollow noreferrer">http://www.that.com</a></strong> which mainta...
[ { "answer_id": 355912, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 1, "selected": false, "text": "page not found" }, { "answer_id": 355956, "author": "Tomalak", "author_id": 18771, "author_profile"...
2008/12/10
[ "https://Stackoverflow.com/questions/355903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5449/" ]
355,907
<p>I'm aware that in Vim I can often repeat a command by simply adding a number in front of it. For example, one can delete 5 lines by:</p> <pre><code>5dd </code></pre> <p>It's also often possible to specify a range of lines to apply a command to, for example</p> <pre><code>:10,20s:hello:goodbye:gc </code></pre> <p...
[ { "answer_id": 355921, "author": "Svante", "author_id": 31615, "author_profile": "https://Stackoverflow.com/users/31615", "pm_score": 8, "selected": true, "text": ":10,20s/^/,/" }, { "answer_id": 355923, "author": "wimh", "author_id": 33499, "author_profile": "https:/...
2008/12/10
[ "https://Stackoverflow.com/questions/355907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37984/" ]
355,908
<p>For tasks that will take more than a few seconds, a good user interface, in my opinion, should provide a progress bar along with appropriate information on the progress of the operation. (Microsoft kindly provide <a href="http://msdn.microsoft.com/en-us/library/aa511486.aspx" rel="nofollow noreferrer">User Interface...
[ { "answer_id": 357137, "author": "Greg", "author_id": 42882, "author_profile": "https://Stackoverflow.com/users/42882", "pm_score": 1, "selected": false, "text": "StartNewTask(Caption,NumberOfSubtasks)\nEndTask \nSetProgress(Caption,NumberOfSubtasksFinished)\n" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18651/" ]
355,909
<p>(All of the following is to be written in Java)</p> <p>I have to build an application that will take as input XML documents that are, potentially, very large. The document is encrypted -- not with XMLsec, but with my client's preexisting encryption algorithm -- will be processed in three phases:</p> <p>First, the...
[ { "answer_id": 355962, "author": "Joachim Sauer", "author_id": 40342, "author_profile": "https://Stackoverflow.com/users/40342", "pm_score": 2, "selected": false, "text": "BufferedInputStream" }, { "answer_id": 356111, "author": "Nick Holt", "author_id": 41423, "autho...
2008/12/10
[ "https://Stackoverflow.com/questions/355909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23309/" ]
355,916
<p>Please if you have used NHibernate and Entity Frameworks, please contrast your experiences.</p>
[ { "answer_id": 355962, "author": "Joachim Sauer", "author_id": 40342, "author_profile": "https://Stackoverflow.com/users/40342", "pm_score": 2, "selected": false, "text": "BufferedInputStream" }, { "answer_id": 356111, "author": "Nick Holt", "author_id": 41423, "autho...
2008/12/10
[ "https://Stackoverflow.com/questions/355916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19799/" ]
355,917
<p>I have a web app that uses log4net to log errors to a log file. It works well when I publish my website via xcopy but when I build a package installer, log4net does not appear to work when remote users access my site.</p> <p>I use <em>impersonate=true</em> in my web.config and log4net only logs errors when I am the...
[ { "answer_id": 356205, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": " <!-- log4net -->\n <log4net debug=\"false\">\n <appender name=\"RollingFileAppender\" type=\"log4net.Appender.RollingFil...
2008/12/10
[ "https://Stackoverflow.com/questions/355917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,933
<p>I have a ASP.NET project, in which I have a method with 10 local variables. This method calls about 10 other methods. 3 of the called methods need all the variables. Is it considered good practice to turn all those variables into global members, and then they don't have to passed as parameters?</p>
[ { "answer_id": 355954, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": false, "text": "public class Foo {\n public string Key {get;set;}\n public decimal Quantity {get;set;}\n // etc\n}\n" }...
2008/12/10
[ "https://Stackoverflow.com/questions/355933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278/" ]
355,937
<p>I have Widget.title, Widget.publish_ at, and Widget.unpublish_ at. It's a rails app with thinking_sphinx running, indexing once a night. I want to find all Widgets that have 'foo' in the title, and are published (publish _at &lt; Time.now, unpublish _at > Time.now). </p> <p>To get pagination to work properly, I rea...
[ { "answer_id": 356028, "author": "Michael", "author_id": 35500, "author_profile": "https://Stackoverflow.com/users/35500", "pm_score": 3, "selected": false, "text": "class Widget < ActiveRecord::Base\n define_index do\n indexes title\n has publish_at\n has unpublish_at\n ......
2008/12/10
[ "https://Stackoverflow.com/questions/355937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18666/" ]
355,942
<p>I am getting an error while porting my application from VC6 to Visual Studio 2005.</p> <p>Does anyone have any idea what this means?</p> <blockquote> <p>mfcs80.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj)</p> </blockquote>
[ { "answer_id": 2093094, "author": "Ruddy", "author_id": 229904, "author_profile": "https://Stackoverflow.com/users/229904", "pm_score": 2, "selected": false, "text": "#ifdef OMUTILITIES_LINK_STATIC\n #undef AfxGetStaticModuleState\n #define AfxGetStaticModuleState AfxGetModuleState...
2008/12/10
[ "https://Stackoverflow.com/questions/355942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43596/" ]
355,945
<p>Is there a quick and nice way using linq?</p>
[ { "answer_id": 355977, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 8, "selected": true, "text": "var most = list.GroupBy(i=>i).OrderByDescending(grp=>grp.Count())\n .Select(grp=>grp.Key).First();\n" }, { ...
2008/12/10
[ "https://Stackoverflow.com/questions/355945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,958
<p>i have little problem with boost::asio library. My app receive and process data asynchronously, it create threads and run io_service.run() on each of them.</p> <pre><code>boost::asio::io_service io; boost::thread_group thread_pool; ... int cpu_cnt = get_cpu_count(); for (int i = 0; i &lt; cpu_cnt; ++i) { thread...
[ { "answer_id": 416820, "author": "Vlagged", "author_id": 6727, "author_profile": "https://Stackoverflow.com/users/6727", "pm_score": 3, "selected": true, "text": "cpu_cnt" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/355958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42371/" ]
355,967
<p>The following code calls the builtin functions for clz/ctz in GCC and, on other systems, has C versions. Obviously, the C versions are a bit suboptimal if the system has a builtin clz/ctz instruction, like x86 and ARM.</p> <pre><code>#ifdef __GNUC__ #define clz(x) __builtin_clz(x) #define ctz(x) __builtin_ctz(x) #...
[ { "answer_id": 5468852, "author": "sh0dan", "author_id": 681490, "author_profile": "https://Stackoverflow.com/users/681490", "pm_score": -1, "selected": false, "text": "#ifdef _MSC_VER\n#include <intrin.h>\n\nstatic uint32_t __inline ctz( uint32_t x )\n{\n int r = 0;\n _BitScanRevers...
2008/12/10
[ "https://Stackoverflow.com/questions/355967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11206/" ]
355,986
<p>How do we assign null value to int column in LINQ. eg.</p> <pre><code> SQLDBDataContext sqlD = new SQLDBDataContext(); var result = from p in sqlD.loadsRadius(Convert.ToInt32(Request["radius"]), ..... </code></pre> <p>here if Request["radius"] is null gives an error.</p> <p>I could pass 0 via this but I need to ...
[ { "answer_id": 356158, "author": "Pradeep Kumar Mishra", "author_id": 22710, "author_profile": "https://Stackoverflow.com/users/22710", "pm_score": 0, "selected": false, "text": "int radius = -1;\nint.TryParse(Request[\"radius\"],out radius)\nif(radius > 0) // you can remove this clause ...
2008/12/10
[ "https://Stackoverflow.com/questions/355986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
355,988
<p>I'm trying to do this:</p> <pre><code>cmd.exe /C "C:\Program Files\Somewhere\SomeProgram.exe" &gt; "C:\temp\Folder Containing Spaces\SomeProgram.out" </code></pre> <p>However, I have problems which are down to the way cmd.exe works. If you read the help for it, it handles " characters in a special way. See the hel...
[ { "answer_id": 356014, "author": "Scott Langham", "author_id": 11898, "author_profile": "https://Stackoverflow.com/users/11898", "pm_score": 8, "selected": true, "text": "cmd.exe /S /C \" do what you like here, quotes within the outermost quotes will be preserved \"\n" }, { "answ...
2008/12/10
[ "https://Stackoverflow.com/questions/355988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11898/" ]
355,994
<p>I have two medium-sized web applications that I'm merging into one. They are both localized with <code>GetText</code> and have large amout of common strings, so merging them manually would be extremely annoying. What is the fastest way to merge the two <code>PO</code> files?</p>
[ { "answer_id": 356001, "author": "mat", "author_id": 42083, "author_profile": "https://Stackoverflow.com/users/42083", "pm_score": 3, "selected": true, "text": "msgmerge" }, { "answer_id": 7643286, "author": "seanf", "author_id": 14379, "author_profile": "https://Stac...
2008/12/10
[ "https://Stackoverflow.com/questions/355994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38256/" ]
356,000
<p>I'd like to drop a user in a SQL Server script but I'll need to test for existence first or I'll get script errors. When dropping tables or stored procs, I check the sysobjects table like so:</p> <pre><code>IF EXISTS ( SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[up_SetMedOptions]') ...
[ { "answer_id": 356021, "author": "edosoft", "author_id": 6399, "author_profile": "https://Stackoverflow.com/users/6399", "pm_score": 2, "selected": false, "text": "select * from sys.sysusers\n" }, { "answer_id": 356030, "author": "Ed Harper", "author_id": 27825, "auth...
2008/12/10
[ "https://Stackoverflow.com/questions/356000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15592/" ]
356,002
<p>So I'm trying to get rid of my std::vector's by using boost::ptr_vector. Now I'm trying to remove an element from one, and have the removed element deleted as well. The most obvious thing to me was to do:</p> <pre><code>class A { int m; }; boost::ptr_vector&lt;A&gt; vec; A* a = new A; vec.push_back(a); vec.erase(a...
[ { "answer_id": 356016, "author": "Evgeny Lazin", "author_id": 42371, "author_profile": "https://Stackoverflow.com/users/42371", "pm_score": 1, "selected": false, "text": "vec.erase_if( predicate() );\n" }, { "answer_id": 356046, "author": "Pieter", "author_id": 5822, ...
2008/12/10
[ "https://Stackoverflow.com/questions/356002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11449/" ]
356,004
<p>Is it possible to have a singleton in a factory method? I have many domains using the factory method. How do I work around with this. Please help me with an example.</p>
[ { "answer_id": 356018, "author": "mepcotterell", "author_id": 43312, "author_profile": "https://Stackoverflow.com/users/43312", "pm_score": 2, "selected": false, "text": "/**\n * An interface defining objects that can create Singleton\n * instances.\n */\npublic interface SingletonFactor...
2008/12/10
[ "https://Stackoverflow.com/questions/356004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
356,010
<p>I was wondering if there is some option to keep ReSharper from removing just the <code>using System;</code> directive? Perhaps this is configurable somewhere?</p> <p>Also, is there a way to have ReSharper sort the remaining directives just as Visual Studio 2008 does it (alphabetically, I think)?</p> <p>Thanks.</p>...
[ { "answer_id": 356032, "author": "Garry Shutler", "author_id": 6369, "author_profile": "https://Stackoverflow.com/users/6369", "pm_score": 3, "selected": false, "text": "Resharper" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/356010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8205/" ]
356,035
<p>I have a 2D area with "dots" distributed on this area. I now am trying to detect "clusters" of dots, that is, areas with a certain high density of dots.</p> <p>Any thoughts on (or links to articles with thoughts on) how to elegantly detect these areas?</p>
[ { "answer_id": 356069, "author": "krusty.ar", "author_id": 43981, "author_profile": "https://Stackoverflow.com/users/43981", "pm_score": 6, "selected": true, "text": "//load the image\nPImage sample;\nsample = loadImage(\"test.png\");\nsize(sample.width, sample.height);\nimage(sample, 0,...
2008/12/10
[ "https://Stackoverflow.com/questions/356035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6583/" ]
356,039
<p>For a stylesheet I'm writing (actually for a set of them, each generating a different output format), I have the need to evaluate whether a certain value is present in a list of values. In this case, the value being tested is taken from an element's attribute. The list it is to be tested against comes from the invoc...
[ { "answer_id": 356077, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 3, "selected": false, "text": "contains(concat(',' $list, ','), concat(',', $value, ','))\n" }, { "answer_id": 356777, "author": "Dimitre Nov...
2008/12/10
[ "https://Stackoverflow.com/questions/356039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6421/" ]
356,060
<p>I have using the following code for developing tabs.</p> <pre><code>$(document).ready(function() { $('#container-1').tabs(); } .... &lt;div id="container-1"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#fragment-1"&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#fragmen...
[ { "answer_id": 356136, "author": "adam", "author_id": 33604, "author_profile": "https://Stackoverflow.com/users/33604", "pm_score": 0, "selected": false, "text": "$(\"#tabid\").click(function(e) {\n e.preventDefault();\n // Do tab click logic\n});\n" }, { "answer_id": 35615...
2008/12/10
[ "https://Stackoverflow.com/questions/356060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44984/" ]
356,090
<p>I need a way to compute the nth root of a long integer in Python. </p> <p>I tried <code>pow(m, 1.0/n)</code>, but it doesn't work:</p> <blockquote> <p>OverflowError: long int too large to convert to float</p> </blockquote> <p>Any ideas?</p> <p>By long integer I mean REALLY long integers like:</p> <blockquote>...
[ { "answer_id": 356110, "author": "Brian", "author_id": 18192, "author_profile": "https://Stackoverflow.com/users/18192", "pm_score": 0, "selected": false, "text": "1/3" }, { "answer_id": 356187, "author": "gimel", "author_id": 6491, "author_profile": "https://Stackove...
2008/12/10
[ "https://Stackoverflow.com/questions/356090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44988/" ]
356,100
<p>How to wait in a bash script for several subprocesses spawned from that script to finish, and then return exit code <code>!=0</code> when any of the subprocesses ends with code <code>!=0</code>?</p> <p>Simple script:</p> <pre><code>#!/bin/bash for i in `seq 0 9`; do doCalculations $i &amp; done wait </code></pre> ...
[ { "answer_id": 356154, "author": "Luca Tettamanti", "author_id": 42448, "author_profile": "https://Stackoverflow.com/users/42448", "pm_score": 10, "selected": true, "text": "wait" }, { "answer_id": 356229, "author": "Alnitak", "author_id": 6782, "author_profile": "htt...
2008/12/10
[ "https://Stackoverflow.com/questions/356100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42201/" ]
356,121
<p>I want to refactor this mumbo jumbo of a method to make it more readible, it has way to many nested IF's for my liking.</p> <p>How would you refactor this?</p> <pre><code>public static void HandleUploadedFile(string filename) { try { if(IsValidFileFormat(filename) { int folderID = GetFolderIDFrom...
[ { "answer_id": 356148, "author": "David Waters", "author_id": 12148, "author_profile": "https://Stackoverflow.com/users/12148", "pm_score": 6, "selected": true, "text": "try{\n if(IsValidFileFormat(filename) == false){\n DeleteFile(filename);\n LogError(\"invalid file fo...
2008/12/10
[ "https://Stackoverflow.com/questions/356121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
356,122
<p>I am writing a .NET library that for various reasons cannot be registered in the GAC. This dll (let's call it SDK.dll) depends on other DLLs in order to be loaded.</p> <p>When writing a program that uses this SDK.dll, I noticed that my program failed loading the dll with a FileNotFoundException thrown. This happens...
[ { "answer_id": 356466, "author": "Snooganz", "author_id": 28224, "author_profile": "https://Stackoverflow.com/users/28224", "pm_score": 4, "selected": true, "text": "AppDomain.CurrentDomain.AssemblyResolve\n" }, { "answer_id": 1492843, "author": "MauriceL", "author_id": 1...
2008/12/10
[ "https://Stackoverflow.com/questions/356122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12818/" ]
356,126
<p>I am getting 'trailing whitespace' errors trying to commit some files in Git.</p> <p>I want to remove these trailing whitespace characters automatically right before I save Python files.</p> <p>Can you configure Vim to do this? If so, how?</p>
[ { "answer_id": 356130, "author": "Paul D. Eden", "author_id": 3045, "author_profile": "https://Stackoverflow.com/users/3045", "pm_score": 9, "selected": true, "text": "autocmd BufWritePre *.py :%s/\\s\\+$//e\n" }, { "answer_id": 356214, "author": "mat", "author_id": 42083...
2008/12/10
[ "https://Stackoverflow.com/questions/356126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3045/" ]
356,128
<p>If I have several classes with functions that I need but want to store separately for organisation, can I extend a class to have both?</p> <p>i.e. <code>class a extends b extends c</code></p> <p>edit: I know how to extend classes one at a time, but I'm looking for a method to instantly extend a class using multipl...
[ { "answer_id": 356172, "author": "adam", "author_id": 33604, "author_profile": "https://Stackoverflow.com/users/33604", "pm_score": 7, "selected": false, "text": "// this is NOT allowed (for all you google speeders)\nMatron extends Nurse, HumanEntity\n" }, { "answer_id": 356431, ...
2008/12/10
[ "https://Stackoverflow.com/questions/356128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24416/" ]
356,144
<p>I want to use the GridView mode of a ListView to display a set of data that my program will be receiving from an external source. The data will consist of two arrays, one of column names and one of strings values to populate the control.</p> <p>I don't see how to create a suitable class that I can use as the Item ...
[ { "answer_id": 357306, "author": "Robert Macnee", "author_id": 19273, "author_profile": "https://Stackoverflow.com/users/19273", "pm_score": 5, "selected": true, "text": "private void AddColumns(GridView gv, string[] columnNames)\n{\n for (int i = 0; i < columnNames.Length; i++)\n ...
2008/12/10
[ "https://Stackoverflow.com/questions/356144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7989/" ]
356,161
<p>In python do you generally use <a href="http://www.python.org/dev/peps/pep-0008/" rel="noreferrer">PEP 8 -- Style Guide for Python Code</a> as your coding standards/guidelines? Are there any other formalized standards that you prefer?</p>
[ { "answer_id": 356426, "author": "Ryan Cox", "author_id": 620, "author_profile": "https://Stackoverflow.com/users/620", "pm_score": 3, "selected": false, "text": "# dict's setdefault method turns this:\nif key in dictobj:\n dictobj[key].append(val)\nelse:\n dictobj[key] = [val]\n# ...
2008/12/10
[ "https://Stackoverflow.com/questions/356161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52490/" ]
356,164
<p>Image i have a view that is cached with the OutputCache attribute but i still need to increment a counter that records that the page has been viewed, how could i do it?</p> <p>I thought about creating my own Custom ActionFilterAttribute, and using Action Filter Order of Execution to record this .. but i'm not sure ...
[ { "answer_id": 356363, "author": "Dan Esparza", "author_id": 19020, "author_profile": "https://Stackoverflow.com/users/19020", "pm_score": 4, "selected": true, "text": "<img src=\"/controller/action\"> \n" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/356164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
356,167
<p>I could do this myself given time but does anyone have a nice asp.net implementation of an a-z list coming from a sql query. I would like it to come in the form:</p> <p>A<br /> aardvark<br /> anagram<br /> apple</p> <p>B<br /> barry<br /> brown....</p> <p>That is with each entry being a link.</p>
[ { "answer_id": 356176, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 2, "selected": true, "text": "Upper(Substring([myfield],1,1)) AS Letter" }, { "answer_id": 356195, "author": "Shawn", "author_id": 26...
2008/12/10
[ "https://Stackoverflow.com/questions/356167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16989/" ]
356,174
<p><strong>Dup of <a href="https://stackoverflow.com/questions/330709/some-basic-php-questions#330829">Some Basic PHP Questions</a></strong></p> <p>Hello,</p> <p>I have a heap of tinyint fields in a mysql database I need to show with PHP. At the moment I am doing something like this:</p> <pre><code>if ($row['PAYPAL_...
[ { "answer_id": 356182, "author": "lpfavreau", "author_id": 35935, "author_profile": "https://Stackoverflow.com/users/35935", "pm_score": 2, "selected": false, "text": "$paypal = $row['PAYPAL_ACCEPT'] ? 'YES' : 'NO';\n" }, { "answer_id": 356184, "author": "adam", "author_i...
2008/12/10
[ "https://Stackoverflow.com/questions/356174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246613/" ]
356,180
<p>Suppose to feed the filter standard input with these line:</p> <pre><code>line 1 line 2 line 3 line 4 line 5 line 6 line 7 line 8 line 9 line 10 </code></pre> <p>It would be nicer if someone tell me how to write a script that prints only every 4 lines, in the case of the example input above:</p> <pre><code>line...
[ { "answer_id": 356198, "author": "mat", "author_id": 42083, "author_profile": "https://Stackoverflow.com/users/42083", "pm_score": 5, "selected": true, "text": "$ yes | cat -n | head -10 | awk 'NR % 4 == 1'\n 1 y\n 5 y\n 9 y\n" }, { "answer_id": 356203, "author...
2008/12/10
[ "https://Stackoverflow.com/questions/356180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36131/" ]
356,194
<p>I know that I can make a setter that checks to see if a value is NULL and do something. Example:</p> <pre><code>&lt;TextBlock&gt; &lt;TextBlock.Style&gt; &lt;Style&gt; &lt;Style.Triggers&gt; &lt;DataTrigger Binding="{Binding SomeField}" Value="{x:Null}"&gt; &lt;Setter Property="TextBlo...
[ { "answer_id": 356690, "author": "Robert Macnee", "author_id": 19273, "author_profile": "https://Stackoverflow.com/users/19273", "pm_score": 7, "selected": false, "text": "<TextBlock>\n <TextBlock.Resources>\n <conv:IsNullConverter x:Key=\"isNullConverter\"/>\n </TextBlock.R...
2008/12/10
[ "https://Stackoverflow.com/questions/356194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11917/" ]
356,217
<p>I keep seeing code that does checks like this</p> <pre><code>if (IsGood == false) { DoSomething(); } </code></pre> <p>or this</p> <pre><code>if (IsGood == true) { DoSomething(); } </code></pre> <p>I hate this syntax, and always use the following syntax.</p> <pre><code>if (IsGood) { DoSomething(); } </c...
[ { "answer_id": 356223, "author": "Bob", "author_id": 45, "author_profile": "https://Stackoverflow.com/users/45", "pm_score": 2, "selected": false, "text": "!IsGood" }, { "answer_id": 356224, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https:...
2008/12/10
[ "https://Stackoverflow.com/questions/356217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23855/" ]
356,219
<p>Suppose you need to run a program on the world’s fastest supercomputer which will take 10 years to complete. You could:</p> <ul> <li>Spend $250M now</li> <li>Program for 9 years, <a href="http://en.wikipedia.org/wiki/Moore%27s_Law" rel="nofollow noreferrer">Moore’s law</a> speedup (4,000x faster), spend $1M in 10ye...
[ { "answer_id": 356926, "author": "Michael Myers", "author_id": 13531, "author_profile": "https://Stackoverflow.com/users/13531", "pm_score": 4, "selected": true, "text": "endtime(startyear) = startyear + (calculations / speed(startyear))" } ]
2008/12/10
[ "https://Stackoverflow.com/questions/356219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383/" ]
356,243
<p>What I want to do is basically this: on <strong>ONE</strong> page, my customers can click a <strong>VIEW CART</strong> link and the contents of their cart shows below on that same page. Here is my basic link form:</p> <pre><code> &lt;FORM METHOD=post ACTION="http://www.123websiteservices.com/cgi-bin/cybercart.pl"&g...
[ { "answer_id": 356272, "author": "Stephen Wrighton", "author_id": 7516, "author_profile": "https://Stackoverflow.com/users/7516", "pm_score": 1, "selected": false, "text": "< script>\nfunction ShowScript() {\n // Do Your Show cart stuff here \n return false\n}\n< /script>\n\n...\n\n<...
2008/12/10
[ "https://Stackoverflow.com/questions/356243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45002/" ]
356,248
<p>I have a deceptively simple scenario, and I want a simple solution, but it's not obvious which is "most correct" or "most Java".</p> <p>Let's say I have a small authenticate(Client client) method in some class. The authentication could fail for a number of reasons, and I want to return a simple boolean for control ...
[ { "answer_id": 356287, "author": "adam", "author_id": 33604, "author_profile": "https://Stackoverflow.com/users/33604", "pm_score": 4, "selected": false, "text": "try {\n AuthenticateMethod();\n} catch (AuthenticateError ae) { \n // Display ae.getMessage() to user..\n Sy...
2008/12/10
[ "https://Stackoverflow.com/questions/356248", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26334/" ]