qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
166,340
<p>I need to zip and password-protect a file. Is there a good (free) library for this?</p> <p>This needs to be opened by a third party, so the password protection needs to work with standard tools.</p>
[ { "answer_id": 13055556, "author": "Marc", "author_id": 97438, "author_profile": "https://Stackoverflow.com/users/97438", "pm_score": 2, "selected": false, "text": "import de.idyl.winzipaes.AesZipFileEncrypter;\nimport de.idyl.winzipaes.impl.AESEncrypterBC;\n\nFile aNewZipFile = new File...
2008/10/03
[ "https://Stackoverflow.com/questions/166340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23447/" ]
166,347
<p>I have some simple shell scripting tasks that I want to do </p> <p>For example: Selecting a file in the working directory from a list of the files matching some regular expression.</p> <p>I know that I can do this sort of thing using standard bash and grep but I would be nice to be able to hack quick scripts tha...
[ { "answer_id": 166357, "author": "Matthew Scharley", "author_id": 15537, "author_profile": "https://Stackoverflow.com/users/15537", "pm_score": 3, "selected": false, "text": "#!/path/to/ruby\n chmod a+x myscript.rb\n" }, { "answer_id": 166373, "author": "Vasil", "author_i...
2008/10/03
[ "https://Stackoverflow.com/questions/166347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24773/" ]
166,356
<p>This semester, I took a course in computer graphics at my University. At the moment, we're starting to get into some of the more advanced stuff like heightmaps, averaging normals, tesselation etc.</p> <p>I come from an object-oriented background, so I'm trying to put everything we do into reusable classes. I've had...
[ { "answer_id": 166613, "author": "timday", "author_id": 24283, "author_profile": "https://Stackoverflow.com/users/24283", "pm_score": 2, "selected": false, "text": " glPushAttrib(GL_ALL_ATTRIB_BITS);\n glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS);\n glPopClientAttrib();\n glPopAttr...
2008/10/03
[ "https://Stackoverflow.com/questions/166356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12828/" ]
166,360
<p>Not too practical maybe, but still interesting.</p> <p>Having some abstract question on matrix multiplication I have quickly implemented a matrix for ints, then tested my assumptions.</p> <p>And here I noticed that just int matrix is not good, if I occasionally want to use it with decimal or double. Of course, I <...
[ { "answer_id": 168524, "author": "Ihar Bury", "author_id": 18001, "author_profile": "https://Stackoverflow.com/users/18001", "pm_score": 2, "selected": false, "text": "public interface ICalculator<T>\n{\n\n T Add(T x, T y);\n T Multiply(T x, T y);\n\n}\n\npublic class MatrixMultiplie...
2008/10/03
[ "https://Stackoverflow.com/questions/166360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21603/" ]
166,364
<p>I am running a Django through mod_python on Apache on a linux box. I have a custom authentication backend, and middleware that requires authentication for all pages, except static content.</p> <p>My problem is that after I log in, I will still randomly get the log in screen now and again. It seems to me that each a...
[ { "answer_id": 166539, "author": "tghw", "author_id": 2363, "author_profile": "https://Stackoverflow.com/users/2363", "pm_score": 2, "selected": false, "text": "MaxRequestsPerChild" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/166364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3355/" ]
166,370
<p>I wonder what's the best deployment directory for Rails apps? Some developers use directories such as <code>/u/apps/#{appname}</code>. Are there <strong>any</strong> advantages when using <code>/u/apps/#{appname}</code> instead of <code>/var/www/#{appname}</code> or other OS default directories?</p> <p>Obviously I ...
[ { "answer_id": 166415, "author": "changelog", "author_id": 5646, "author_profile": "https://Stackoverflow.com/users/5646", "pm_score": 2, "selected": false, "text": "www-data /home/mephisto/www /home/warehouse/www" }, { "answer_id": 171184, "author": "Grant Hutchins", "au...
2008/10/03
[ "https://Stackoverflow.com/questions/166370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20467/" ]
166,411
<p>I was wondering if it would be possible to retrieve the complete list of security roles defined in a web.xml file in the java code? And if so how to do it?</p> <p>I am aware of the 'isUserInRole' method but I also want to handle cases where a role is requested but not defined (or spelled differently) in the web.xml...
[ { "answer_id": 167140, "author": "Ian McLaird", "author_id": 18796, "author_profile": "https://Stackoverflow.com/users/18796", "pm_score": 3, "selected": true, "text": "protected List<String> getSecurityRoles() {\n List<String> roles = new ArrayList<String>();\n ServletContext sc =...
2008/10/03
[ "https://Stackoverflow.com/questions/166411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18702/" ]
166,418
<p>I have asked our hosting provider to add mod_python to our httpd server. The server appears to be in an hsphere cluster and they appear to use yum to administer it. He is reporting some dependencies missing and I do't quite understand how that could have come about.</p> <p>versions (this is as much as I have been...
[ { "answer_id": 321653, "author": "warren", "author_id": 4418, "author_profile": "https://Stackoverflow.com/users/4418", "pm_score": 0, "selected": false, "text": "yum update apache yum update yum install mod_python" }, { "answer_id": 953856, "author": "GuiSim", "author_id...
2008/10/03
[ "https://Stackoverflow.com/questions/166418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24039/" ]
166,424
<p>I have a web application that generates a long report and I need to print it. If I just print the page it will break at the end of the physical page. How can I calculate where to make a break in the web page so that the page breaks line up with the physical pages when they print?</p>
[ { "answer_id": 166448, "author": "Andre Bossard", "author_id": 21027, "author_profile": "https://Stackoverflow.com/users/21027", "pm_score": 0, "selected": false, "text": "page-break-before/after" }, { "answer_id": 166459, "author": "slashnick", "author_id": 21030, "a...
2008/10/03
[ "https://Stackoverflow.com/questions/166424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12386/" ]
166,431
<p>I find it annoying that I can't clear a list. In this example:</p> <pre><code>a = [] a.append(1) a.append(2) a = [] </code></pre> <p>The second time I initialize a to a blank list, it creates a new instance of a list, which is in a different place in memory, so I can't use it to reference the first, not to mentio...
[ { "answer_id": 166441, "author": "Thomas Wouters", "author_id": 17624, "author_profile": "https://Stackoverflow.com/users/17624", "pm_score": 6, "selected": true, "text": "del L[:]\n" }, { "answer_id": 57217653, "author": "Community", "author_id": -1, "author_profile"...
2008/10/03
[ "https://Stackoverflow.com/questions/166431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18909/" ]
166,438
<p>I have been looking for a logging framework for .net (c#) and decided to give log4net a go after reading up on a few question/answer threads here on stackoverflow. I see people mentioning over and over that they use a wrapper class for log4net and I am wonder what that would look like.</p> <p>I have my code split u...
[ { "answer_id": 166477, "author": "cfeduke", "author_id": 5645, "author_profile": "https://Stackoverflow.com/users/5645", "pm_score": 6, "selected": false, "text": "public interface ILogger\n{\n void Debug(object message);\n bool IsDebugEnabled { get; }\n\n // continue for all me...
2008/10/03
[ "https://Stackoverflow.com/questions/166438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15771/" ]
166,452
<p>Is there any performance comparison of System.IO.File.ReadAllxxx / WriteAllxxx methods vs StreamReader / StremWriter classes available on web. What you think is the best way(from a performance perspective) to read/write text files in .net 3.0?</p> <p>When I checked the <strong><a href="http://msdn.microsoft.com/en-...
[ { "answer_id": 166513, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 0, "selected": false, "text": "public static string ReadAllText(string path, Encoding encoding)\n{\n using (StreamReader reader = new StreamReader(path, enc...
2008/10/03
[ "https://Stackoverflow.com/questions/166452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22016/" ]
166,472
<p>I have never quite understood how/why I would use Maven modules (reactor builds).</p> <p>We have tens of libraries that we share (as dependencies) among our products, and between libraries as well. If we were to switch to making them Maven modules, how would we set it up, both in SVN and in our working copies?</p>...
[ { "answer_id": 169048, "author": "Hugo", "author_id": 972, "author_profile": "https://Stackoverflow.com/users/972", "pm_score": 2, "selected": true, "text": "relativePath parent svn:externals" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/166472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24795/" ]
166,474
<p>In a C++ file, I have a code like this:</p> <pre><code>#if ACTIVATE # pragma message( "Activated" ) #else # pragma message( "Not Activated") #endif </code></pre> <p>I want to set this ACTIVE define to 1 with the msbuild command line.</p> <p>It tried this but it doesn't work:</p> <pre><code>msbuild /p:DefineC...
[ { "answer_id": 166505, "author": "Matt Howells", "author_id": 16881, "author_profile": "https://Stackoverflow.com/users/16881", "pm_score": 4, "selected": false, "text": "/p:DefineConstants=ACTIVATE\n" }, { "answer_id": 166524, "author": "Robert Deml", "author_id": 9516, ...
2008/10/03
[ "https://Stackoverflow.com/questions/166474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6605/" ]
166,482
<p>I have a website which uses the custom 404 error handling in PHP/Apache to display specific pages.<br> e.g. <a href="http://metachat.org/recent" rel="nofollow noreferrer">http://metachat.org/recent</a> </p> <p>I've a feeling this is a bad way of doing this, but it's code I inherited...</p> <p>Although the page dis...
[ { "answer_id": 166496, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 3, "selected": true, "text": "RewriteEngine On\nRewriteCond %{REQUEST_URI} !-f\nRewriteCond %{REQUEST_URI} !-d\nRewriteRule (.*) index.php?missing_...
2008/10/03
[ "https://Stackoverflow.com/questions/166482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1726/" ]
166,491
<p>I have a .bat and inside the .bat i would like to execute a special code if there's some modification inside the svn repository (for example, compile).</p>
[ { "answer_id": 166514, "author": "Jonathan Lonowski", "author_id": 15031, "author_profile": "https://Stackoverflow.com/users/15031", "pm_score": 1, "selected": false, "text": "svn st \"C:\\path\\to\\working\\directory\\\" >> C:\\path\\to\\working\\project.log\n" }, { "answer_id":...
2008/10/03
[ "https://Stackoverflow.com/questions/166491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6605/" ]
166,503
<p>How do I set the code page to UTF-8 in a C Windows program? </p> <p>I have a third party library that uses fopen to open files. I can use wcstombs to convert my Unicode filenames to the current code page, however if the user has a filename with a character outside the code page then this breaks. </p> <p>Ideally ...
[ { "answer_id": 166926, "author": "Ben Straub", "author_id": 1319, "author_profile": "https://Stackoverflow.com/users/1319", "pm_score": 4, "selected": false, "text": "std::wstring Utf8ToUtf16(const char* u8string)\n{\n int wcharcount = strlen(u8string);\n wchar_t *tempWstr = new wc...
2008/10/03
[ "https://Stackoverflow.com/questions/166503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2651243/" ]
166,506
<p>How can I find local IP addresses (i.e. 192.168.x.x or 10.0.x.x) in Python platform independently and using only the standard library?</p>
[ { "answer_id": 166520, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 10, "selected": true, "text": "import socket\nsocket.gethostbyname(socket.gethostname())\n 127.0.0.1 /etc/hosts 127.0.0.1 socket.getfqdn()" }, ...
2008/10/03
[ "https://Stackoverflow.com/questions/166506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115/" ]
166,508
<p>Is there any way so that i can echo password when asked for in unix shell without use of external binaries ? Something like simple function triggered when password prompt is displayed</p>
[ { "answer_id": 166520, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 10, "selected": true, "text": "import socket\nsocket.gethostbyname(socket.gethostname())\n 127.0.0.1 /etc/hosts 127.0.0.1 socket.getfqdn()" }, ...
2008/10/03
[ "https://Stackoverflow.com/questions/166508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24789/" ]
166,530
<p>Does NetworkStream.DataAvailable know whether the sender's send buffer is empty? Or does it simply indicate whether the receiver's read buffer has data? My assumption is the latter...</p> <p>Specifically, for some socket work involving an ongoing conversation, I currently use a length-prefix so the the receiver kno...
[ { "answer_id": 167399, "author": "Joel B Fant", "author_id": 22211, "author_profile": "https://Stackoverflow.com/users/22211", "pm_score": 4, "selected": true, "text": "DataAvailable Read()" }, { "answer_id": 167895, "author": "Lounges", "author_id": 8918, "author_pro...
2008/10/03
[ "https://Stackoverflow.com/questions/166530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23354/" ]
166,542
<p>We are using c++ to develop an application that runs in Windows CE 4 on an embedded system.</p> <p>One of our constraint is that all the memory used by the application shall be allocated during <b>startup only</b>. We wrote a lot of containers and algorithms that are using only preallocated memory instead of alloca...
[ { "answer_id": 169755, "author": "Ted", "author_id": 8965, "author_profile": "https://Stackoverflow.com/users/8965", "pm_score": 4, "selected": false, "text": "smart_ptr boost::bind" }, { "answer_id": 44555988, "author": "ulatekh", "author_id": 603828, "author_profile...
2008/10/03
[ "https://Stackoverflow.com/questions/166542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18800/" ]
166,545
<p>How can I find the public facing IP for my net work in Python?</p>
[ { "answer_id": 166552, "author": "UnkwnTech", "author_id": 115, "author_profile": "https://Stackoverflow.com/users/115", "pm_score": 5, "selected": true, "text": "import urllib\nip = urllib.urlopen('http://automation.whatismyip.com/n09230945.asp').read()\n <?php echo $_SERVER['REMOTE_ADD...
2008/10/03
[ "https://Stackoverflow.com/questions/166545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115/" ]
166,550
<p>This is a minor style question, but every bit of readability you add to your code counts.</p> <p>So if you've got:</p> <pre><code>if (condition) then { // do stuff } else { // do other stuff } </code></pre> <p>How do you decide if it's better like that, or like this:</p> <pre><code> if (!condition) then ...
[ { "answer_id": 166564, "author": "cfeduke", "author_id": 5645, "author_profile": "https://Stackoverflow.com/users/5645", "pm_score": 5, "selected": true, "text": "if (condition)\n return;\n\nDoSomething();\n" }, { "answer_id": 166573, "author": "Oli", "author_id": 1287...
2008/10/03
[ "https://Stackoverflow.com/questions/166550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14663/" ]
166,600
<p>In java, when using SimpleDateFormat with the pattern:</p> <pre><code>yyyy-MM-dd'T'HH:mm:ss.SSSZ </code></pre> <p>the date is outputted as:</p> <pre><code>"2002-02-01T18:18:42.703-0700" </code></pre> <p>In xquery, when using the xs:dateTime function, it gives the error:</p> <pre><code>"Invalid lexical value [er...
[ { "answer_id": 166725, "author": "Sietse", "author_id": 6400, "author_profile": "https://Stackoverflow.com/users/6400", "pm_score": 0, "selected": false, "text": "static public String formatISO8601(Calendar cal) {\nMessageFormat format = new MessageFormat(\"{0,time}{1,number,+00;-00}:{2,...
2008/10/03
[ "https://Stackoverflow.com/questions/166600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
166,607
<p>I need to either find a file in which the version is encoded or a way of polling it across the web so it reveals its version. The server is running at a host who will not provide me command line access, although I can browse the install location via FTP.</p> <p>I have tried HEAD and do not get a version number repo...
[ { "answer_id": 166619, "author": "Paul Dixon", "author_id": 6521, "author_profile": "https://Stackoverflow.com/users/6521", "pm_score": 8, "selected": true, "text": "HEAD / HTTP/1.0\n HTTP/1.1 200 OK\nDate: Fri, 03 Oct 2008 12:39:43 GMT\nServer: Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.0 PHP/...
2008/10/03
[ "https://Stackoverflow.com/questions/166607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24039/" ]
166,615
<p>I am currently plowing my way through <a href="http://www-128.ibm.com/developerworks/edu/os-dw-os-php-cake1.html" rel="nofollow noreferrer">IBM's tutorial on CakePHP</a></p> <p>At one point I run into this snippet of code:</p> <pre><code>&lt;?php class Dealer extends AppModel { var $name = 'Dealer'; var $h...
[ { "answer_id": 166627, "author": "Matthew Scharley", "author_id": 15537, "author_profile": "https://Stackoverflow.com/users/15537", "pm_score": 2, "selected": false, "text": "$hasMany = array ('Product' => array(\n'className' => 'Product',\n'conditions'=> null, // is this allowed?\n'orde...
2008/10/03
[ "https://Stackoverflow.com/questions/166615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24218/" ]
166,617
<p>I am attempting to write an application that uses libCurl to post soap requests to a secure web service. This Windows application is built against libCurl version 7.19.0 which, in turn, is built against openssl-0.9.8i. The pertinent curl related code follows:</p> <blockquote> <pre> FILE *input_file = fopen(curren...
[ { "answer_id": 37317423, "author": "vidstige", "author_id": 363437, "author_profile": "https://Stackoverflow.com/users/363437", "pm_score": 0, "selected": false, "text": "curl_easy_setopt(curl_, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2));\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/166617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19674/" ]
166,623
<p>I have some problems comparing an array with Norwegian characters with a utf8 character.</p> <p>All characters except the special Norwegian characters(æ, ø, å) works fine.</p> <pre><code>function isNorwegianChar($Char) { $aNorwegianChars = array('a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'g', ...
[ { "answer_id": 166640, "author": "Gilles", "author_id": 10024, "author_profile": "https://Stackoverflow.com/users/10024", "pm_score": 2, "selected": false, "text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n<html>\n<head><title>norvegian utf-8 test</title>\n<meta http-equiv=\...
2008/10/03
[ "https://Stackoverflow.com/questions/166623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24811/" ]
166,630
<p>I want to insert 'n' spaces (or any string) at the beginning of a string in C++. Is there a direct way to do this using either std::strings or char* strings?</p> <p>E.g., in Python you could simply do</p> <pre><code>&gt;&gt;&gt; &quot;.&quot; * 5 + &quot;lolcat&quot; '.....lolcat' </code></pre>
[ { "answer_id": 166646, "author": "luke", "author_id": 16434, "author_profile": "https://Stackoverflow.com/users/16434", "pm_score": 8, "selected": false, "text": "std::string(size_type count, CharT ch) std::string(5, '.') + \"lolcat\"\n" }, { "answer_id": 166668, "author": "R...
2008/10/03
[ "https://Stackoverflow.com/questions/166630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
166,641
<p>In the following example should I expect that <code>values.size()</code> will be called every time around the loop? In which case it might make sense to introduce a temporary <code>vectorSize</code> variable. Or should a modern compiler be able to optimize the calls away by recognising that the vector size cannot ch...
[ { "answer_id": 166704, "author": "Richard Harrison", "author_id": 19624, "author_profile": "https://Stackoverflow.com/users/19624", "pm_score": 2, "selected": false, "text": "for (int i=v.size()-1; i>=0 ;i--)\n{\n ...\n}\n" }, { "answer_id": 166774, "author": "Curro", "...
2008/10/03
[ "https://Stackoverflow.com/questions/166641", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3229/" ]
166,658
<p>I am using <a href="http://nant.sourceforge.net/release/0.85-rc2/help/fundamentals/listeners.html#MailLogger" rel="nofollow noreferrer">MailLogger</a> to send a message about a failed/successful release. I would like to make the mail body simple and easy to read. How can I suppress output for some particular tasks?<...
[ { "answer_id": 166704, "author": "Richard Harrison", "author_id": 19624, "author_profile": "https://Stackoverflow.com/users/19624", "pm_score": 2, "selected": false, "text": "for (int i=v.size()-1; i>=0 ;i--)\n{\n ...\n}\n" }, { "answer_id": 166774, "author": "Curro", "...
2008/10/03
[ "https://Stackoverflow.com/questions/166658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2361/" ]
166,695
<p>I know I can cycle through my tabs using cmd+{ or cmd+}, but is it possible to select a specific tab (i.e. cmd+3 for the third tab in iTerm) in Leopards' Terminal.app? </p>
[ { "answer_id": 953105, "author": "Topher Fangio", "author_id": 85309, "author_profile": "https://Stackoverflow.com/users/85309", "pm_score": -1, "selected": false, "text": ".screenrc defscrollback 1024\nhardstatus on\nhardstatus alwayslastline\nhardstatus string \"%{.bW}%-w%{.rW}%n %t%{-...
2008/10/03
[ "https://Stackoverflow.com/questions/166695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16685/" ]
166,712
<p>I have noticed that some apps like Safari and Mail show a loading indicator in the status bar (the bar at the very top of the phone) when they are accessing the network. Is there a way to do the same thing in SDK apps, or is this an Apple only thing?</p>
[ { "answer_id": 166734, "author": "Stephen Darlington", "author_id": 2998, "author_profile": "https://Stackoverflow.com/users/2998", "pm_score": 9, "selected": true, "text": "[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;\n [UIApplication sharedApplication].netwo...
2008/10/03
[ "https://Stackoverflow.com/questions/166712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6044/" ]
166,718
<p><strong>Background</strong></p> <p>I am trying to create a copy of a business object I have created in VB.NET. I have implemented the ICloneable interface and in the Clone function, I create a copy of the object by serializing it with a BinaryFormatter and then de-serializing straight back out into another object ...
[ { "answer_id": 166883, "author": "cfeduke", "author_id": 5645, "author_profile": "https://Stackoverflow.com/users/5645", "pm_score": 0, "selected": false, "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApplication1\n{\n public class N...
2008/10/03
[ "https://Stackoverflow.com/questions/166718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6165/" ]
166,722
<p>I know the name of the table I want to find. I'm using Microsoft SQL Server Management Studio 2005, and I want to search all databases in the database server that I'm attached to in the studio. Is this possible? Do I need to query the system tables?</p>
[ { "answer_id": 166866, "author": "Mauro", "author_id": 2208, "author_profile": "https://Stackoverflow.com/users/2208", "pm_score": 1, "selected": false, "text": "SELECT name, DbID \nFROM master..sysdatabases\nWHERE name NOT IN ('northwind', 'pubs')\nAND (status & 32) <> 32 ...
2008/10/03
[ "https://Stackoverflow.com/questions/166722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5716/" ]
166,739
<p>I've got a byte() array returned as result of directx sound capture, but for other parts of my program I want to treat the results as single(). Is trundling down the array item by item the fastest way of doing it or is there a clever way to do it ? </p> <p>The code that gets it is</p> <pre><code>CType(Me._applicat...
[ { "answer_id": 166755, "author": "MusiGenesis", "author_id": 14606, "author_profile": "https://Stackoverflow.com/users/14606", "pm_score": -1, "selected": false, "text": "float f = BitConverter.ToSingle(bytearray, 0);\n Dim single s;\ns = BitConverter.ToSingle(bytearray, 0);\n" }, { ...
2008/10/03
[ "https://Stackoverflow.com/questions/166739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2135219/" ]
166,742
<p>I would like to make a list of remarkable robot simulation environments including advantages and disadvantages of them. Some examples I know of are <a href="http://www.cyberbotics.com/" rel="noreferrer">Webots</a> and <a href="http://playerstage.sourceforge.net/" rel="noreferrer">Player/Stage</a>.</p>
[ { "answer_id": 1685675, "author": "Barrett Ames", "author_id": 204392, "author_profile": "https://Stackoverflow.com/users/204392", "pm_score": 3, "selected": false, "text": "rviz nav_view" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/166742", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21047/" ]
166,752
<p>Does anyone know the full list of C# compiler number literal modifiers?</p> <p>By default declaring '0' makes it an Int32 and '0.0' makes it a 'Double'. I can use the literal modifier 'f' at the end to ensure something is treated as a 'Single' instead. For example like this...</p> <pre><code>var x = 0; // x is ...
[ { "answer_id": 166762, "author": "user7116", "author_id": 7116, "author_profile": "https://Stackoverflow.com/users/7116", "pm_score": 7, "selected": true, "text": "var y = 0f; // y is single\nvar z = 0d; // z is double\nvar r = 0m; // r is decimal\nvar i = 0U; // i is unsigned int\nvar j...
2008/10/03
[ "https://Stackoverflow.com/questions/166752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6276/" ]
166,802
<p>Has anyone ever had the issue where trying to "View Designer" on a windows form in Visual Studio .NET causes the error: <strong>"Could not load file or assembly…"</strong> ?</p> <p>In this case, the assembly in question was <code>XYZ.dll</code>. I managed to fix this by adding <code>XYZ.dll</code> and all its refer...
[ { "answer_id": 166867, "author": "TcKs", "author_id": 20382, "author_profile": "https://Stackoverflow.com/users/20382", "pm_score": 5, "selected": false, "text": "TypeLoadException devenv.exe" }, { "answer_id": 7854643, "author": "J Collins", "author_id": 576262, "aut...
2008/10/03
[ "https://Stackoverflow.com/questions/166802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
166,823
<p>Suppose I have a base class B, and a derived class D. I wish to have a method foo() within my base class that returns a new object of whatever type the instance is. So, for example, if I call B.foo() it returns an object of type B, while if I call D.foo() it returns an object of type D; meanwhile, the implementati...
[ { "answer_id": 166849, "author": "Garth Gilmour", "author_id": 2635682, "author_profile": "https://Stackoverflow.com/users/2635682", "pm_score": 2, "selected": false, "text": " public B instance() throws Exception {\n return getClass().newInstance();\n }\n" }, { "ans...
2008/10/03
[ "https://Stackoverflow.com/questions/166823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10675/" ]
166,836
<p>If we put aside the rights and wrongs of putting demo data into a live system for a minute (that's a whole separate discussion!), we are being asked to store some demo data in our live system so that it can be credibly demonstrated without the appearance of smoke + mirrors (we want to use the same login page for exa...
[ { "answer_id": 291101, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "SELECT * FROM tableA \n SELECT * FROM (SELECT * FROM tableA WHERE Data_quality = 'PROD' <or however you do it>\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/166836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19629/" ]
166,841
<p>I have a xml blob that's checked against a schema in sql 2005. My website uses xsl to transform and display the blob. How do I add a hyperlink to the xml (in any node) without the sql 2005 schema complaining a node was found in the wrong place? Or the xsl thinking that the hyperlink is a valid xml node?</p> <p>than...
[ { "answer_id": 291101, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "SELECT * FROM tableA \n SELECT * FROM (SELECT * FROM tableA WHERE Data_quality = 'PROD' <or however you do it>\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/166841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5433/" ]
166,844
<p>I'm working on an integration testing project in .NET. The testing framework executable starts a service and then needs to wait for the service to complete an operation.</p> <p>What is the best approach for the exe to wait on the service to complete its task (the service itself will not exit upon task completion)?<...
[ { "answer_id": 166951, "author": "Christoffer Lette", "author_id": 11808, "author_profile": "https://Stackoverflow.com/users/11808", "pm_score": 4, "selected": true, "text": "Semaphore Release() WaitOne() Semaphore s = new Semaphore(1, 1, \"MyNamedSemaphore\");\n// start service, passing...
2008/10/03
[ "https://Stackoverflow.com/questions/166844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1683/" ]
166,855
<p>What is the PHP preg_replace in C#?</p> <p>I have an array of string that I would like to replace by an other array of string. Here is an example in PHP. How can I do something like that in C# without using .Replace("old","new").</p> <pre><code>$patterns[0] = '/=C0/'; $patterns[1] = '/=E9/'; $patterns[2] = '/=C9/'...
[ { "answer_id": 166889, "author": "Matthew Scharley", "author_id": 15537, "author_profile": "https://Stackoverflow.com/users/15537", "pm_score": 2, "selected": false, "text": "System.Text.RegularExpressions using System.Text.RegularExpressions;\n\nRegex r = new Regex(\"=C0\");\nstring out...
2008/10/03
[ "https://Stackoverflow.com/questions/166855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13913/" ]
166,876
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/76760/vs2008-setup-project-shared-by-all-users-application-data-files">VS2008 Setup Project: Shared (By All Users) Application Data Files?</a> </p> </blockquote> <p>Please can someone advice what is the best pl...
[ { "answer_id": 166881, "author": "JC.", "author_id": 3615, "author_profile": "https://Stackoverflow.com/users/3615", "pm_score": 2, "selected": false, "text": "Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)\n" }, { "answer_id": 166906, "author": "A...
2008/10/03
[ "https://Stackoverflow.com/questions/166876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23671/" ]
166,884
<p>Why would someone want to use a linked-list over an array?</p> <p>Coding a linked-list is, no doubt, a bit more work than using an array and one may wonder what would justify the additional effort.</p> <p>I think insertion of new elements is trivial in a linked-list but it's a major chore in an array. Are there ot...
[ { "answer_id": 166978, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 3, "selected": false, "text": "#include <vector>" }, { "answer_id": 167448, "author": "Brian", "author_id": 9493, "author_profile...
2008/10/03
[ "https://Stackoverflow.com/questions/166884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2820/" ]
166,895
<p>Is it possible to have a different set of dependencies in a maven pom.xml file for different profiles?</p> <p>e.g.</p> <pre><code>mvn -P debug mvn -P release </code></pre> <p>I'd like to pick up a different dependency jar file in one profile that has the same class names and different implementations of the same ...
[ { "answer_id": 167284, "author": "Aleksandar Dimitrov", "author_id": 11797, "author_profile": "https://Stackoverflow.com/users/11797", "pm_score": 9, "selected": true, "text": "release debug" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/166895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/974/" ]
166,897
<p>I have a problem similar to the one found here : <a href="https://stackoverflow.com/questions/86531/jsf-selectitem-label-formatting">JSF selectItem label formatting</a>. </p> <p>What I want to do is to accept a double as a value for my and display it with two decimals. Can this be done in an easy way? </p> <p>I'v...
[ { "answer_id": 168092, "author": "Grant Wagner", "author_id": 9254, "author_profile": "https://Stackoverflow.com/users/9254", "pm_score": 5, "selected": true, "text": "<h:inputText id=\"text1\" value=\"#{...}\">\n <f:convertNumber pattern=\"#,###,##0.00\"/>\n</h:inputText>\n pattern" ...
2008/10/03
[ "https://Stackoverflow.com/questions/166897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24828/" ]
166,941
<p>I am trying to get <a href="http://selenium-rc.openqa.org/tutorial.html" rel="nofollow noreferrer">Selenium RC</a> working with Firefox 3 on Linux with PHP/Apache but am experiencing problems. Here's what I've done:</p> <ul> <li>I have installed the Firefox Selenium-IDE extension.</li> <li>On the web server (which...
[ { "answer_id": 168964, "author": "Peter Howe", "author_id": 24106, "author_profile": "https://Stackoverflow.com/users/24106", "pm_score": 5, "selected": true, "text": "java -jar selenium-server.jar php -d include_path=\".:/usr/share/php:/usr/share/php/Selenium/PEAR\" test.php require_onc...
2008/10/03
[ "https://Stackoverflow.com/questions/166941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24106/" ]
166,944
<p>I have a Python script I recently wrote that I call using the command line with some options. I now want a very thin web interface to call this script locally on my Mac.</p> <p>I don't want to go through the minor trouble of installing mod_python or mod_wsgi on my Mac, so I was just going to do a system() or popen(...
[ { "answer_id": 167200, "author": "Andru Luvisi", "author_id": 5922, "author_profile": "https://Stackoverflow.com/users/5922", "pm_score": 8, "selected": true, "text": "preg_replace('/[^a-zA-Z0-9]/', '', $str)\n" }, { "answer_id": 11601572, "author": "Idealmind", "author_i...
2008/10/03
[ "https://Stackoverflow.com/questions/166944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2999/" ]
166,996
<p>I have a table class that creates modifies a table of items. I want to display those items in a JTable using a table model. To me table model belongs to my GUI package but table needs table model in order to fire changes and table model needs table class in order to display it so I can not separate the two. if you n...
[ { "answer_id": 167945, "author": "oxbow_lakes", "author_id": 16853, "author_profile": "https://Stackoverflow.com/users/16853", "pm_score": 2, "selected": false, "text": "TableModel AbstractTableModel getRowCount getColumnCount getValueAt AbstractTableModel.fireTableDataChanged DefaultTab...
2008/10/03
[ "https://Stackoverflow.com/questions/166996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
167,003
<p>I generally stay away from <code>regular expressions</code> because I seldom find a good use for them. But in this case, I don't think I have choice. </p> <p>I need a regex for the following situation. I will be looking at three character strings. It will be a match if the first character is <code>1-9 or the lett...
[ { "answer_id": 167005, "author": "Blair Conrad", "author_id": 1199, "author_profile": "https://Stackoverflow.com/users/1199", "pm_score": 3, "selected": false, "text": "[1-9ondOND][123][0-9]\n ^ $ o n d O N D re.match('[1-9ond][123][0-9]', inputstring, re.IGNORECASE)\n re.match ^" }, ...
2008/10/03
[ "https://Stackoverflow.com/questions/167003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19038/" ]
167,004
<p>I am attempting to set up an nmake makefile to export our balsamiq mockup files to png files automatically, but I'm afraid I can't make heads nor tails of how to make a generic rule for doing so, without explicitly listing all the files I want exported.</p> <p><a href="http://www.balsamiq.com/blog/?p=231" rel="nofol...
[ { "answer_id": 631724, "author": "David Pokluda", "author_id": 223, "author_profile": "https://Stackoverflow.com/users/223", "pm_score": 0, "selected": false, "text": "export : *.bmml\n \"C:\\Program Files\\Balsamiq Mockups\\Balsamiq Mockups.exe\" export $** $(**B).png\n nmake /A\n ex...
2008/10/03
[ "https://Stackoverflow.com/questions/167004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/267/" ]
167,007
<p>As a new Eclipse user, I am constantly annoyed by how long it takes compiler error messages to display. This is mostly only a problem for long errors that don't fit in the status bar or the "Problems" tab. But I get enough long errors in Java&mdash;especially with generics&mdash;that this is a nagging issue. (Note: ...
[ { "answer_id": 167571, "author": "shyam", "author_id": 7616, "author_profile": "https://Stackoverflow.com/users/7616", "pm_score": 0, "selected": false, "text": "Ctrl+1" }, { "answer_id": 168913, "author": "Craig Angus", "author_id": 15352, "author_profile": "https://...
2008/10/03
[ "https://Stackoverflow.com/questions/167007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412/" ]
167,014
<p>Our team (5-10 developers) plans to <strong>adopt Subversion</strong> for our .NET (Visual Studio) projects/solutions (VisualSVN Server, TortoiseSVN / VisualSVN).</p> <p>What is the best way to <strong>organize a new repository tree</strong>? Is it okay to use <em>one big repository</em> or is it better to create ...
[ { "answer_id": 174883, "author": "Frew Schmidt", "author_id": 12448, "author_profile": "https://Stackoverflow.com/users/12448", "pm_score": 1, "selected": false, "text": "[general]\nanon-access = none\nauth-access = write\npassword-db = ../../conf/passwd\nauthz-db = ../../conf/authz\n [g...
2008/10/03
[ "https://Stackoverflow.com/questions/167014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6461/" ]
167,027
<p>I have a need to display many numerical values in columns. These values need to be easily editable so I cannot just display them in a table. I am using textboxes to display them. Is there a way for me to right-justify the text displayed in a textbox? It would also be nice if when the user is entering data for it to ...
[ { "answer_id": 167037, "author": "Chris Marasti-Georg", "author_id": 96, "author_profile": "https://Stackoverflow.com/users/96", "pm_score": 8, "selected": true, "text": "input {\n text-align:right;\n}\n <html>\n <head>\n <title>Blah</title>\n <style type=\"text/css\"...
2008/10/03
[ "https://Stackoverflow.com/questions/167027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16292/" ]
167,031
<p>Does anyone know the API call I can use to change the keyboard layout on a windows machine to Dvorak? Doing it through the UI is easy but I'd like to have a script that I can run on new VM's to automate the process. </p>
[ { "answer_id": 167052, "author": "pkaeding", "author_id": 4257, "author_profile": "https://Stackoverflow.com/users/4257", "pm_score": 3, "selected": false, "text": "[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Keyboard Layout]\n\"ScanCode Map\"=hex:00,00,00,00,00,00,00,00,22,...
2008/10/03
[ "https://Stackoverflow.com/questions/167031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23283/" ]
167,053
<p>I'm trying to understand the best way to get the connection to my databases.</p> <p>At the moment I've got a method which parses the URL (depending on the URL called the application has to connect to a different database, like customer1.example.com will connect to the customer1 database) and calls </p> <pre><code>...
[ { "answer_id": 167265, "author": "Ken", "author_id": 20621, "author_profile": "https://Stackoverflow.com/users/20621", "pm_score": 1, "selected": false, "text": "class xx < ActiveRecord.base\n\ndef self.table_name\n \"otherdatabase.table\"\nend\n" }, { "answer_id": 170708, "...
2008/10/03
[ "https://Stackoverflow.com/questions/167053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22083/" ]
167,067
<p>Given a SCHEMA for implementing tags</p> <p>ITEM ItemId, ItemContent</p> <p>TAG TagId, TagName</p> <p>ITEM_TAG ItemId, TagId</p> <p>What is the best way to limit the number of ITEMS to return when selecting with tags?</p> <pre><code>SELECT i.ItemContent, t.TagName FROM item i INNER JOIN ItemTag it ON i.id = it...
[ { "answer_id": 167156, "author": "GSerg", "author_id": 11683, "author_profile": "https://Stackoverflow.com/users/11683", "pm_score": 1, "selected": false, "text": "select i.ItemContent, t.TagName from (SELECT ItemId, ItemContent FROM item limit 10) i\nINNER JOIN ItemTag it ON i.ItemId = ...
2008/10/03
[ "https://Stackoverflow.com/questions/167067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22277/" ]
167,074
<p>I changed the MembershipProvider in my ASP.net MVC website, and now the stylesheet for the login page isn't referenced correctly. Below is a copy of the forms tag in my web.config if that could be the reason. It looks identical though to the one generated by a new project with the exception of the name and timeout a...
[ { "answer_id": 167264, "author": "Ian Oxley", "author_id": 1904, "author_profile": "https://Stackoverflow.com/users/1904", "pm_score": 1, "selected": false, "text": "<link href=\"<%= ResolveClientUrl(\"../../content/Site.css\") %> rel=\"stylesheet\" type=\"text/css\" />\n" }, { "...
2008/10/03
[ "https://Stackoverflow.com/questions/167074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24841/" ]
167,084
<p>What is the the best of detecting and later altering the screen resolution and multiple desktop within .net</p> <p>I have a small app that while runs at work on my multiple monitor/high(ish) resolution however what I want to be able to detect is the users primary monitor and set the application to that (main object...
[ { "answer_id": 167102, "author": "Bob King", "author_id": 6897, "author_profile": "https://Stackoverflow.com/users/6897", "pm_score": 3, "selected": true, "text": " System.Windows.Forms.Screen.PrimaryScreen\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11802/" ]
167,088
<p>I'm creating a webservice, and I want to name it appropriately.</p> <p>Right now my service is named Service as per the /App_Code/Service.cs</p> <p>Should I rename it to something like: <em>com.example.MyWebService.cs</em>?</p> <p>How do I get around the class file not excepting '.' in the file name?</p>
[ { "answer_id": 167123, "author": "Sir Code-A-Lot", "author_id": 13148, "author_profile": "https://Stackoverflow.com/users/13148", "pm_score": 0, "selected": false, "text": "namespace Com.Example\n{\n public class MyWebService\n {\n // class contents\n }\n}\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
167,096
<p>Is it safe to assume that two itterations over the same collection will return the objects in the same order? Obviously, it is assumed that the collection has not otherwise been changed.</p>
[ { "answer_id": 167130, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 3, "selected": false, "text": "IEnumerable foreach (int i in new Shuffler(1, 2, 3, 4, 5, 6, 7, 8, 9))\n Console.WriteLine(i);\n" }, { "an...
2008/10/03
[ "https://Stackoverflow.com/questions/167096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18978/" ]
167,106
<p>In there an easy way to do this in PHP. I want to make sure that only web requests from certain countries are able to access my website.</p> <p>Any ideas?</p>
[ { "answer_id": 28089465, "author": "P. Bos", "author_id": 4482631, "author_profile": "https://Stackoverflow.com/users/4482631", "pm_score": 2, "selected": false, "text": "if (!in_array(substr($country, 0, 2), $allowed_countries)) {\n if(!in_array($country, $allowed_countries)) {\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3208/" ]
167,109
<p>Consider these two C++ header cases:</p> <p>Case 1:</p> <pre><code>class Test { public: static int TEST_DATA[]; }; int Test::TEST_DATA[] = { 1, 2, 3, 4 }; </code></pre> <p>Case 2:</p> <pre><code>class Test { public: static int const TEST_DATA[]; }; int const Test::TEST_DATA[] = { 1, 2, 3, 4 }; </code...
[ { "answer_id": 167307, "author": "James Hopkin", "author_id": 11828, "author_profile": "https://Stackoverflow.com/users/11828", "pm_score": 0, "selected": false, "text": "struct Test\n{\n static int const TEST;\n};\nint const Test::TEST = 7;\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18721/" ]
167,120
<p>This is really only easy to explain with an example, so to remove the intersection of a list from within a dict I usually do something like this:</p> <pre><code>a = {1:'', 2:'', 3:'', 4:''} exclusion = [3, 4, 5] # have to build up a new list or the iteration breaks toRemove = [] for var in a.iterkeys(): if var...
[ { "answer_id": 167134, "author": "Blair Conrad", "author_id": 1199, "author_profile": "https://Stackoverflow.com/users/1199", "pm_score": 5, "selected": true, "text": "for key in exclusion:\n a.pop(key, None)\n None key" }, { "answer_id": 167158, "author": "SpoonMeiser", ...
2008/10/03
[ "https://Stackoverflow.com/questions/167120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18909/" ]
167,129
<p>What is the functional programming approach to convert an <code>IEnumerable&lt;string&gt;</code> to a delimited string? I know I can use a loop, but I'm trying to wrap my head around functional programming. </p> <p>Here's my example: </p> <pre><code>var selectedValues = from ListItem item in checkboxL...
[ { "answer_id": 167141, "author": "Tom Ritter", "author_id": 8435, "author_profile": "https://Stackoverflow.com/users/8435", "pm_score": 5, "selected": false, "text": "string.Join(\", \", string[] enumerable)\n" }, { "answer_id": 167142, "author": "yfeldblum", "author_id":...
2008/10/03
[ "https://Stackoverflow.com/questions/167129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10693/" ]
167,152
<p>How can you get MSSQL server to accept Unicode data by default into a VARCHAR or NVARCHAR column?</p> <p>I know that you can do it by placing a N in front of the string to be placed in the field but to by quite honest this seems a bit archaic in 2008 and particuarily with using SQL Server 2005.</p>
[ { "answer_id": 167290, "author": "Brannon", "author_id": 5745, "author_profile": "https://Stackoverflow.com/users/5745", "pm_score": 3, "selected": true, "text": "N N'Unicode string'\n'ANSI string'\n N N" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6244/" ]
167,165
<p>I've been asked to maintain a large C++ codebase full of memory leaks. While poking around, I found out that we have a lot of buffer overflows that lead to the leaks (how it got this bad, I don't ever want to know). </p> <p>I've decided to removing the buffer overflows first, starting with the dangerous functions. ...
[ { "answer_id": 167181, "author": "DGentry", "author_id": 4761, "author_profile": "https://Stackoverflow.com/users/4761", "pm_score": 2, "selected": false, "text": "uint32_t foo[3];\nfoo[3] = WALKED_OFF_END_OF_ARRAY;\n" }, { "answer_id": 167182, "author": "hayalci", "autho...
2008/10/03
[ "https://Stackoverflow.com/questions/167165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1599/" ]
167,193
<p>I have 2 tables:</p> <pre><code>A s_id(key) name cli type B sa_id(key) s_id user pwd </code></pre> <p>So in Jpa I have:</p> <pre><code>@Entity class A...{ @OneToMany(fetch=FetchType.EAGER) @JoinTable( name="A_B", joinColumns={@JoinColumn(name="a_id", table="a",unique=false)}, inverseJoinColumns=...
[ { "answer_id": 218612, "author": "Vincent Ramdhanie", "author_id": 27439, "author_profile": "https://Stackoverflow.com/users/27439", "pm_score": 2, "selected": true, "text": "@Entity class A...{ \n@OneToMany(fetch=FetchType.EAGER) \nCollection getB(){...} }\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22763/" ]
167,206
<p>Is there a PHP module that you can use to programmatically read a torrent to find out information about it, Seeders for instance?</p>
[ { "answer_id": 601710, "author": "Constantin", "author_id": 20310, "author_profile": "https://Stackoverflow.com/users/20310", "pm_score": 3, "selected": false, "text": "hash_info tracker_url" }, { "answer_id": 601765, "author": "Svish", "author_id": 39321, "author_pro...
2008/10/03
[ "https://Stackoverflow.com/questions/167206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3208/" ]
167,224
<p>I have a variable of type Number, and i like to obtain the sign (if is '-' i like to have -1 and if '+' i like to have 1). So, i made this:</p> <pre><code>var sign = Math.abs(n) / n; </code></pre> <p>But, there is any other way? Better than this?</p>
[ { "answer_id": 167255, "author": "bobwienholt", "author_id": 24257, "author_profile": "https://Stackoverflow.com/users/24257", "pm_score": 5, "selected": true, "text": "var sign = n < 0 ? -1 : 1;\n" }, { "answer_id": 167258, "author": "davr", "author_id": 14569, "auth...
2008/10/03
[ "https://Stackoverflow.com/questions/167224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20601/" ]
167,232
<p>Is there a way to configure a Visual Studio 2005 Web Deployment Project to install an application into a named Application Pool rather than the default app pool for a given web site?</p>
[ { "answer_id": 168362, "author": "Zachary Yates", "author_id": 8360, "author_profile": "https://Stackoverflow.com/users/8360", "pm_score": 5, "selected": true, "text": "Private Sub assignApplicationPool(ByVal WebSite As String, ByVal Vdir As String, ByVal appPool As String)\n Try\n ...
2008/10/03
[ "https://Stackoverflow.com/questions/167232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7872/" ]
167,233
<pre><code>rsync -auve ssh --backup --suffix='2008-10-03-1514539' --backup-dir='/tmp/' module.pm root@web1:/path/to/module.pm </code></pre> <p>I run this command without the --backup-dir option and when it copies the file over, it creates a backup with a current timestamp. When I include the --backup-dir option, it ma...
[ { "answer_id": 10918859, "author": "Paperghost", "author_id": 1330572, "author_profile": "https://Stackoverflow.com/users/1330572", "pm_score": 1, "selected": false, "text": "# Backup\nmkdir -p /tmp/`date +\\%Y-\\%m-\\%d`-`date +\\%A`/\nrsync -avz /tmp/`date --date=yesterday +\\%Y-\\%m-\...
2008/10/03
[ "https://Stackoverflow.com/questions/167233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3404/" ]
167,238
<p>The question is not how to tell in a oneliner. If you're writing the code in a one-liner, <em>you know</em> you are. But how does a module, included by <code>-MMy::Module::Name</code> know that it all started from a oneliner. </p> <p>This is mine. It's non-portable though and relies on UNIX standard commands (altho...
[ { "answer_id": 167267, "author": "Dan", "author_id": 17121, "author_profile": "https://Stackoverflow.com/users/17121", "pm_score": 6, "selected": true, "text": "$0 \"-e\" -e" }, { "answer_id": 169726, "author": "Eric Wilhelm", "author_id": 11580, "author_profile": "ht...
2008/10/03
[ "https://Stackoverflow.com/questions/167238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11289/" ]
167,247
<p>How do I stop a function/procedure in a superclass from been overridden in a subclass in Delphi (2007)?</p> <p>I want to mark it so it can not be altered, I believe there is a final keyword but can not for the life of me find the documentation for it, so I am not 100% sure that's what I need.</p>
[ { "answer_id": 167295, "author": "Lars Truijens", "author_id": 1242, "author_profile": "https://Stackoverflow.com/users/1242", "pm_score": 5, "selected": true, "text": "final type\n TSomeClass = class\n protected\n procedure SomeVirtualMethod; virtual;\n end;\n\n TOtherClass = cla...
2008/10/03
[ "https://Stackoverflow.com/questions/167247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2098/" ]
167,254
<p>Is there a better way to watch for new entries in a table besides selecting from it every n ticks of time or something like that?</p> <p>I have a table that an external program updates very often, and clients can watch for this new data as it arrive, how can I make that without having to set a fixed period of repea...
[ { "answer_id": 167423, "author": "Rob Allen", "author_id": 149, "author_profile": "https://Stackoverflow.com/users/149", "pm_score": 3, "selected": false, "text": "add column Last_Modified TIMESTAMP ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP \n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/167254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18623/" ]
167,262
<p>I suppose this is a strange question to the huge majority of programmers that work daily with Java. I don't. I know Java-the-language, because I worked on Java projects, but not Java-the-world. I never made a web app from scratch in Java. If I have to do it with Python, Ruby, I know where to go (Django or Rails), bu...
[ { "answer_id": 610595, "author": "Joe W.", "author_id": 3459, "author_profile": "https://Stackoverflow.com/users/3459", "pm_score": 3, "selected": false, "text": "(GET \"/post/:id/:slug\"\n (some-function-that-returns-html :id :slug))\n" }, { "answer_id": 3272200, "author": ...
2008/10/03
[ "https://Stackoverflow.com/questions/167262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6068/" ]
167,282
<p>If two users are accessing same database table, how do we prevent users from overwriting each other’s data?</p>
[ { "answer_id": 167318, "author": "DL Redden", "author_id": 20610, "author_profile": "https://Stackoverflow.com/users/20610", "pm_score": 1, "selected": false, "text": "last_actv_dtm last_actv_dtm UPDATE tab1\nSET\n col1 = ?\n , col2 = ?\n , last_actv_dtm = GETDATE()\nWHERE\n ...
2008/10/03
[ "https://Stackoverflow.com/questions/167282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
167,294
<p>I have a https link that requires user login &amp; password. If I run it in FX like this: <a href="https://usernameassword@www.example.com/link/sublink" rel="nofollow noreferrer">https://usernameassword@www.example.com/link/sublink</a></p> <p>it will return the xml data as expected.</p> <p>However, what i'm trying...
[ { "answer_id": 167318, "author": "DL Redden", "author_id": 20610, "author_profile": "https://Stackoverflow.com/users/20610", "pm_score": 1, "selected": false, "text": "last_actv_dtm last_actv_dtm UPDATE tab1\nSET\n col1 = ?\n , col2 = ?\n , last_actv_dtm = GETDATE()\nWHERE\n ...
2008/10/03
[ "https://Stackoverflow.com/questions/167294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/196874/" ]
167,302
<p>I have an application in which attr_accessor is being used to keep temporary data for a model which will be passed to a rake task. Seeing there is not a database field for these attributes and they are not being calculated from database data, will the attr_accessor data persist and be available to the rake task? W...
[ { "answer_id": 168246, "author": "Daniel Beardsley", "author_id": 13216, "author_profile": "https://Stackoverflow.com/users/13216", "pm_score": 4, "selected": true, "text": "class Thing < ActiveRecord::Base\n attr_accessor :data\nend\n\n#try this in script/console\nthing = Thing.find(:f...
2008/10/03
[ "https://Stackoverflow.com/questions/167302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13710/" ]
167,304
<p>I am wondering if it is possible to use LINQ to pivot data from the following layout:</p> <pre><code>CustID | OrderDate | Qty 1 | 1/1/2008 | 100 2 | 1/2/2008 | 200 1 | 2/2/2008 | 350 2 | 2/28/2008 | 221 1 | 3/12/2008 | 250 2 | 3/15/2008 | 2150 </code></pre> <p>into something like t...
[ { "answer_id": 167937, "author": "Amy B", "author_id": 8155, "author_profile": "https://Stackoverflow.com/users/8155", "pm_score": 9, "selected": true, "text": "List<CustData> myList = GetCustData();\n\nvar query = myList\n .GroupBy(c => c.CustId)\n .Select(g => new {\n Cust...
2008/10/03
[ "https://Stackoverflow.com/questions/167304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2833/" ]
167,316
<p>I'm trying to achieve the last possible time of a particular day eg for Date of 2008-01-23 00:00:00.000 i would need 2008-01-23 23:59:59.999 perhaps by using the dateadd function on the Date field?</p>
[ { "answer_id": 167338, "author": "Shaun Bowe", "author_id": 1514, "author_profile": "https://Stackoverflow.com/users/1514", "pm_score": 4, "selected": false, "text": "SELECT DATEADD(ms, -2, DATEADD(dd, 1, DATEDIFF(dd, 0, GetDate())))\n DateTime now = DateTime.Now;\nDateTime endofDay = no...
2008/10/03
[ "https://Stackoverflow.com/questions/167316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21004/" ]
167,323
<p>I am still having problems with figuring out how to create winforms in a separate UI thread that I discussed <a href="https://stackoverflow.com/questions/164789/winforms-implementation-question-for-having-my-ui-run-independently-of-my-bll-l">here</a>.</p> <p>In trying to figure this out I wrote the following simple...
[ { "answer_id": 167377, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 5, "selected": true, "text": "public void StartUiThread()\n{\n using (Form1 _form = new Form1())\n {\n Application.Run(_form);\n }\n...
2008/10/03
[ "https://Stackoverflow.com/questions/167323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
167,330
<p>I have a 'Purchase Order' class. It contains information about a single purchase order. I have a DAO class for database methods.</p> <p>Where should the responsibility reside for the methods that will load and update the purchase order?</p> <p>Should the PurchaseOrder class have '.update', 'insert', 'delete', and ...
[ { "answer_id": 167731, "author": "Sklivvz", "author_id": 7028, "author_profile": "https://Stackoverflow.com/users/7028", "pm_score": 0, "selected": false, "text": "PurchaseOrder po;\nPurchaseOrderController poc;\npoc = PurchaseOrderControllerFactory.Instance.Create();\npo = poc.GetPurcha...
2008/10/03
[ "https://Stackoverflow.com/questions/167330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6624/" ]
167,343
<p>I have quickly read over the <a href="http://msdn.microsoft.com/en-us/library/bb397687.aspx" rel="noreferrer">Microsoft Lambda Expression</a> documentation.</p> <p>This kind of example has helped me to understand better, though: </p> <pre><code>delegate int del(int i); del myDelegate = x =&gt; x * x; int j = myDel...
[ { "answer_id": 167363, "author": "Joseph Daigle", "author_id": 507, "author_profile": "https://Stackoverflow.com/users/507", "pm_score": 7, "selected": false, "text": " List<string> people = new List<string> { \"name1\", \"name2\", \"joe\", \"another name\", \"etc\" };\n string person = ...
2008/10/03
[ "https://Stackoverflow.com/questions/167343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13913/" ]
167,371
<p>I just want to see what files were modded/added/deleted between 2 arbitrary revisions. How do I do this?</p> <p>Can I do this in tortoise as well?</p>
[ { "answer_id": 167378, "author": "Max Cantor", "author_id": 16034, "author_profile": "https://Stackoverflow.com/users/16034", "pm_score": 6, "selected": true, "text": "svn log -v -rX:Y .\n" }, { "answer_id": 5736542, "author": "Elias Zamaria", "author_id": 28324, "aut...
2008/10/03
[ "https://Stackoverflow.com/questions/167371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1946/" ]
167,397
<p>What are the popular (ok, popular is relative) web frameworks for the various flavours of LISP?</p>
[ { "answer_id": 13457783, "author": "battlemidget", "author_id": 415485, "author_profile": "https://Stackoverflow.com/users/415485", "pm_score": 2, "selected": false, "text": "RESTAS is a Common Lisp web application framework. Its key features are:\n\nRESTAS was developed to simplify deve...
2008/10/03
[ "https://Stackoverflow.com/questions/167397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1432/" ]
167,406
<p>I have a "Date of Birth" field, and trying to use the <code>timespan()</code> method to get the age in years. But returns "28 Years, 2 Months, 2 Weeks, 3 Days, 15 Hours, 16 Minutes".</p> <p>Any idea how I can just get the "28 Years" portion?</p>
[ { "answer_id": 167463, "author": "Kevin Chan", "author_id": 1877, "author_profile": "https://Stackoverflow.com/users/1877", "pm_score": 0, "selected": false, "text": "$date = '28 Years, 2 Months, 2 Weeks, 3 Days, 15 Hours, 16 Minutes';\n $yearsPart = substr($date, 0, strpos($date, 'Years...
2008/10/03
[ "https://Stackoverflow.com/questions/167406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
167,414
<p>On POSIX systems rename(2) provides for an atomic rename operation, including overwriting of the destination file if it exists and if permissions allow.</p> <p>Is there any way to get the same semantics on Windows? I know about MoveFileTransacted() on Vista and Server 2008, but I need this to support Win2k and up.<...
[ { "answer_id": 2368286, "author": "edg", "author_id": 284924, "author_profile": "https://Stackoverflow.com/users/284924", "pm_score": 5, "selected": false, "text": "ReplaceFile()" }, { "answer_id": 51737582, "author": "Craig Barkhouse", "author_id": 10194831, "author_...
2008/10/03
[ "https://Stackoverflow.com/questions/167414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14739/" ]
167,416
<p>Hi I want to have two tables each have an INT "id" column which will auto-increment but I don't want either "id" columns to ever share the same number. What is this called and what's the best way to do it? Sequence? Iterator? Index? Incrementor?</p> <p>Motivation: we're migrating from one schema to a another and ha...
[ { "answer_id": 167421, "author": "Galwegian", "author_id": 3201, "author_profile": "https://Stackoverflow.com/users/3201", "pm_score": 2, "selected": false, "text": "SELECT NEWID()\n" }, { "answer_id": 167532, "author": "Pittsburgh DBA", "author_id": 10224, "author_pr...
2008/10/03
[ "https://Stackoverflow.com/questions/167416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24881/" ]
167,426
<p>I wrote small Python+Ajax programs (listed at the end) with socket module to study the COMET concept of asynchronous communications.<br/></p> <p>The idea is to allow browsers to send messages real time each others via my python program.<br/></p> <p>The trick is to let the "GET messages/..." connection opened waiti...
[ { "answer_id": 170005, "author": "Florian Bösch", "author_id": 19435, "author_profile": "https://Stackoverflow.com/users/19435", "pm_score": 2, "selected": false, "text": "index = '''\n<html>\n <head>\n </head>\n <body>\n <form action=\"/\" method=\"POST\">\n <...
2008/10/03
[ "https://Stackoverflow.com/questions/167426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
167,427
<p>What's the best way to go about creating a vertical and horizontal ruler bars in an SDI app? Would you make it part of the frame or the view? Derive it from CControlBar, or is there a better method?</p> <p>The vertical ruler must also be docked to a pane and not the frame.</p> <p>To make it a little clearer as t...
[ { "answer_id": 169261, "author": "Alf Zimmerman", "author_id": 24612, "author_profile": "https://Stackoverflow.com/users/24612", "pm_score": 0, "selected": false, "text": "m_wndSplitter.CreateStatic(this, 1, 3);\n\nm_wndLeftPane.Create(&m_wndSplitter,WS_CHILD|WS_VISIBLE,m_wndSplitter.IdF...
2008/10/03
[ "https://Stackoverflow.com/questions/167427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24612/" ]
167,432
<p>Example</p> <p>G76 I0.4779 J270 K7 C90</p> <p>X20 Y30 </p> <p>If a number begins with I J K C X Y and it doesn't have a decimal then add decimal. Above example should look like:</p> <p>G76 I0.4779 J270 K7. C90.</p> <p>X20. Y30.</p> <p>Purpose of this code is to convert CNC code for an older Fanuc OPC controlle...
[ { "answer_id": 167530, "author": "tloach", "author_id": 14092, "author_profile": "https://Stackoverflow.com/users/14092", "pm_score": 2, "selected": false, "text": "Set RegEx = New RegExp\nRegEx.Global = True\nRegEx.Pattern = \"([IJKCXY]\\d+)([^\\.]|$)\"\nnewVar = RegEx.Replace (oldStrin...
2008/10/03
[ "https://Stackoverflow.com/questions/167432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
167,439
<p><strong>Update:</strong> Thanks for the suggestions guys. After further research, I’ve reformulated the question here: <a href="https://stackoverflow.com/questions/217020/pythoneditline-on-os-x-163-sign-seems-to-be-bound-to-ed-prev-word">Python/editline on OS X: £ sign seems to be bound to ed-prev-word</a></p> <p>O...
[ { "answer_id": 167515, "author": "Patrick McElhaney", "author_id": 437, "author_profile": "https://Stackoverflow.com/users/437", "pm_score": 3, "selected": false, "text": " pound = u'\\u00A3'\n" }, { "answer_id": 167998, "author": "indentation", "author_id": 7706, "au...
2008/10/03
[ "https://Stackoverflow.com/questions/167439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20578/" ]
167,453
<p>I'm exploring the XML -> XSLT -> HTML meme for producing web content. I have very little XSLT experience.</p> <p>I'm curious what mechanisms are available in XSLT to handle abstractions or "refactoring".</p> <p>For example, with generic HTML and a service side include, many pages can be templated and decomposed to...
[ { "answer_id": 167468, "author": "Andre Bossard", "author_id": 21027, "author_profile": "https://Stackoverflow.com/users/21027", "pm_score": 3, "selected": false, "text": "Its rule based." }, { "answer_id": 167545, "author": "Swati", "author_id": 12682, "author_profil...
2008/10/03
[ "https://Stackoverflow.com/questions/167453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13663/" ]
167,464
<p>I am currently investigating how to make a connection to a SQL Server database from my Java EE web application using Windows Authentication instead of SQL Server authentication. I am running this app off of Tomcat 6.0, and am utilizing the Microsoft JDBC driver. My connection properties file looks as follows:</p> <...
[ { "answer_id": 356456, "author": "Jerome Delattre", "author_id": 27762, "author_profile": "https://Stackoverflow.com/users/27762", "pm_score": 7, "selected": true, "text": "jdbc:sqlserver://localhost;integratedSecurity=true;\n" }, { "answer_id": 801113, "author": "opensas", ...
2008/10/03
[ "https://Stackoverflow.com/questions/167464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/318/" ]
167,471
<p>In Oracle, given a simple data table:</p> <pre><code>create table data ( id VARCHAR2(255), key VARCHAR2(255), value VARCHAR2(511)); </code></pre> <p>suppose I want to "insert or update" a value. I have something like:</p> <pre><code>merge into data using dual on (id='someid' and key...
[ { "answer_id": 167518, "author": "Tony Andrews", "author_id": 18747, "author_profile": "https://Stackoverflow.com/users/18747", "pm_score": 3, "selected": false, "text": "data_pkg.merge_data ('someid', 'testKey', 'someValue');\n begin\n insert into data (...) values (...);\nexception\n...
2008/10/03
[ "https://Stackoverflow.com/questions/167471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5309/" ]
167,485
<p>Is it possible to have a HasMany relationship of a basic type such as String, on an ActiveRecord class, without the need for creating another entity such as (TodoListItem) to hold the value.</p> <pre><code>[ActiveRecord] public class TodoList { [PrimaryKey] public int Id { get { return _id; } set { _...
[ { "answer_id": 167591, "author": "akmad", "author_id": 1314, "author_profile": "https://Stackoverflow.com/users/1314", "pm_score": -1, "selected": false, "text": "[ActiveRecord(Table = \"MyTable\")]\npublic class MyClass : ActiveRecordBase<MyClass>\n{\n [Property]\n public int Id {...
2008/10/03
[ "https://Stackoverflow.com/questions/167485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4642/" ]
167,491
<p>How do I in SQL Server 2005 use the DateAdd function to add a day to a date</p>
[ { "answer_id": 167501, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 5, "selected": false, "text": "DECLARE @MyDate datetime\n\n-- ... set your datetime's initial value ...'\n\nDATEADD(d, 1, @MyDate)\n" }, { "a...
2008/10/03
[ "https://Stackoverflow.com/questions/167491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21004/" ]