qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
139,670
<p>In SQL SERVER Is it possible to store data with carriage return in a table and then retrieve it back again with carriage return.</p> <p>Eg:</p> <pre><code>insert into table values ('test1 test2 test3 test4'); </code></pre> <p>When I retrieve it, I get the message in a line </p> <p>test1 test2 test3 test4<...
[ { "answer_id": 139701, "author": "Axeman", "author_id": 22108, "author_profile": "https://Stackoverflow.com/users/22108", "pm_score": 2, "selected": false, "text": "insert into table values ('test1' + chr(13) + chr(10) + 'test2' );\n" }, { "answer_id": 139706, "author": "Ciri...
2008/09/26
[ "https://Stackoverflow.com/questions/139670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21968/" ]
139,683
<p>I'm dealing with huge glassfish log files (in windows, eek!) and well ... Wordpad isn't cutting it. </p> <p>Are there any tools out there that can handle these log files in a more intelligent manner? Functionality that would be welcome:</p> <ul> <li>View all lines of a certain log level (info, warning, severe)</li...
[ { "answer_id": 655675, "author": "fredarin", "author_id": 25038, "author_profile": "https://Stackoverflow.com/users/25038", "pm_score": 2, "selected": false, "text": "getline $ awk '/^java.*:\\W/ {print $1}' server.log* |sort|uniq -c|sort -nr\n 60 javax.ejb.EJBException:\n 45 java.rmi.Se...
2008/09/26
[ "https://Stackoverflow.com/questions/139683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18673/" ]
139,686
<p>The maintenance problems that uninitialised locals cause (particularly pointers) will be obvious to anyone who has done a bit of c/c++ maintenance or enhancement, but I still see them and occasionally hear performance implications given as their justification.</p> <p>It's easy to demonstrate in c that redundant ini...
[ { "answer_id": 139731, "author": "xtofl", "author_id": 6610, "author_profile": "https://Stackoverflow.com/users/6610", "pm_score": 2, "selected": false, "text": "ftime uninitialized time_t t;\ntime( &t );\n" }, { "answer_id": 139766, "author": "Nils Pipenbrinck", "author_...
2008/09/26
[ "https://Stackoverflow.com/questions/139686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22640/" ]
139,739
<p>I've been doing a massive code review and one pattern I notice all over the place is this:</p> <pre><code>public bool MethodName() { bool returnValue = false; if (expression) { // do something returnValue = MethodCall(); } else { // do something else returnVal...
[ { "answer_id": 139754, "author": "mmattax", "author_id": 1638, "author_profile": "https://Stackoverflow.com/users/1638", "pm_score": 2, "selected": false, "text": "\nreturn expression ? MethodCall() : Expression;\n" }, { "answer_id": 139788, "author": "Nenad Dobrilovic", ...
2008/09/26
[ "https://Stackoverflow.com/questions/139739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20400/" ]
139,752
<p>I'm starting to get comfortable with the idea of fakes, stubs, mocks, and dynamic mocks. But I am still a little iffy in my understanding of when to use partial mocks. </p> <p>It would seem that if you're planning on mocking a service and need to resort to a partial mock then it is a sign of bad design. Is it th...
[ { "answer_id": 378720, "author": "James Mead", "author_id": 2025138, "author_profile": "https://Stackoverflow.com/users/2025138", "pm_score": 2, "selected": false, "text": "Reset Reset Reset" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/139752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
139,759
<p>Is there any way to list all the files that have changed between two tags in CVS?</p> <p>Every time we do a release we apply a tag to all the files in that release. I want to find all the files that changed between releases.</p> <p>It would also work if I could find all files that had changed between two dates.</p...
[ { "answer_id": 139871, "author": "Decio Lira", "author_id": 12423, "author_profile": "https://Stackoverflow.com/users/12423", "pm_score": 6, "selected": true, "text": "cvs diff -N -c -r RELEASE_1_0 -r RELEASE_1_1 > diffs\n RELEASE_1_0 RELEASE_1_1 ;)" }, { "answer_id": 139923, ...
2008/09/26
[ "https://Stackoverflow.com/questions/139759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3464/" ]
139,794
<p>Let's say we have <code>index.php</code> and it is stored in <code>/home/user/public/www</code> and <code>index.php</code> calls the class <code>Foo-&gt;bar()</code> from the file <code>inc/app/Foo.class.php</code>. </p> <p>I'd like the bar function in the <code>Foo</code> class to get a hold of the path <code>/hom...
[ { "answer_id": 139830, "author": "Devon", "author_id": 13850, "author_profile": "https://Stackoverflow.com/users/13850", "pm_score": 4, "selected": false, "text": "class Foo {\n function bar() { \n $trace = debug_backtrace();\n echo \"calling file was \".$trace[0]['file'].\"\\n\"...
2008/09/26
[ "https://Stackoverflow.com/questions/139794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6752/" ]
139,809
<p>I have a Console application hosting a WCF service. I would like to be able to fire an event from a method in the WCF service and handle the event in the hosting process of the WCF service. Is this possible? How would I do this? Could I derive a custom class from ServiceHost?</p>
[ { "answer_id": 139886, "author": "Franci Penov", "author_id": 17028, "author_profile": "https://Stackoverflow.com/users/17028", "pm_score": 5, "selected": true, "text": "ServiceHost ServiceHost ServiceHost MyService svc = new MyService();\nsvc.SomeEvent += new MyEventDelegate(this.OnSome...
2008/09/26
[ "https://Stackoverflow.com/questions/139809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8033/" ]
139,811
<p>What is an algorithm to compare multiple sets of numbers against a target set to determine which ones are the most "similar"?</p> <p>One use of this algorithm would be to compare today's hourly weather forecast against historical weather recordings to find a day that had similar weather.</p> <p>The similarity of t...
[ { "answer_id": 140244, "author": "Adam Hughes", "author_id": 3863, "author_profile": "https://Stackoverflow.com/users/3863", "pm_score": 0, "selected": false, "text": "function calculate_score(historical_set, forecast_set)\n{\n double c = correlation(historical_set, forecast_set);\n ...
2008/09/26
[ "https://Stackoverflow.com/questions/139811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3863/" ]
139,819
<p>The following test fails:</p> <pre><code>#!/usr/bin/env python def f(*args): """ &gt;&gt;&gt; t = 1, -1 &gt;&gt;&gt; f(*map(lambda i: lambda: i, t)) [1, -1] &gt;&gt;&gt; f(*(lambda: i for i in t)) # -&gt; [-1, -1] [1, -1] &gt;&gt;&gt; f(*[lambda: i for i in t]) # -&gt; [-1, -1] [1, -...
[ { "answer_id": 139880, "author": "Brian", "author_id": 9493, "author_profile": "https://Stackoverflow.com/users/9493", "pm_score": 3, "selected": false, "text": "lambda : i\n >>> f(*(lambda i=i: i for i in t)) # -> [-1, -1]\n[1, -1]\n>>> f(*[lambda i=i: i for i in t]) # -> [-1, -1]\n[1, ...
2008/09/26
[ "https://Stackoverflow.com/questions/139819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4279/" ]
139,821
<p>What is the bare minimum I need to put in web.config to get WCF working with REST? I have annotated my methods with [WebGet], but they are not getting the message.</p>
[ { "answer_id": 139965, "author": "willem", "author_id": 22702, "author_profile": "https://Stackoverflow.com/users/22702", "pm_score": 2, "selected": false, "text": " <endpoint address=\"\" binding=\"webHttpBinding\" bindingConfiguration=\"\"\n contract=\"WcfCore.ICustomer\">\n ...
2008/09/26
[ "https://Stackoverflow.com/questions/139821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21784/" ]
139,833
<p>I am using StringReplace to replace &amp;gt and &amp;lt by the char itself in a generated XML like this:</p> <pre><code>StringReplace(xml.Text,'&amp;gt;','&gt;',[rfReplaceAll]) ; StringReplace(xml.Text,'&amp;lt;','&lt;',[rfReplaceAll]) ; </code></pre> <p>The thing is it takes way tooo long to replace every occuren...
[ { "answer_id": 139876, "author": "Jorge Ferreira", "author_id": 6508, "author_profile": "https://Stackoverflow.com/users/6508", "pm_score": 2, "selected": false, "text": "String s = \"&lt;xml&gt;test&lt;/xml&gt;\";\nchar[] input = s.ToCharArray();\nchar[] res = new char[s.Length];\nint j...
2008/09/26
[ "https://Stackoverflow.com/questions/139833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19224/" ]
139,835
<p>I have a C# WinForms borderless window, for which I override WndProc and handle the WM_NCHITTEST message. For an area of that form, my hit test function returns HTSYSMENU. Double-clicking that area successfully closes the form, but right-clicking it does not show the window's system menu, nor does it show up when ri...
[ { "answer_id": 159897, "author": "Bill", "author_id": 14547, "author_profile": "https://Stackoverflow.com/users/14547", "pm_score": 4, "selected": true, "text": "GetWindowLong SetWindowLong OnHandleCreated using System.Runtime.InteropServices;\n\nprotected override void OnHandleCreated(E...
2008/09/26
[ "https://Stackoverflow.com/questions/139835", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4898/" ]
139,837
<p>I know it's possible, and I've seen simple examples in the documentation, but are they being used in the wild? </p> <p>I use attributes at the class and method level all the time, but have never used them on method parameters. What are some real-world examples, and the reasons for the usage?</p> <p>I'm not interes...
[ { "answer_id": 140890, "author": "Kevin Dostalek", "author_id": 22732, "author_profile": "https://Stackoverflow.com/users/22732", "pm_score": 2, "selected": false, "text": " public class ShellController : ControllerBase, IShellController\n {\n public ShellController([StateDe...
2008/09/26
[ "https://Stackoverflow.com/questions/139837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5469/" ]
139,859
<p>On <strong>Linux/NPTL</strong>, threads are created as some kind of process.</p> <p>I can see some of my process have a weird cmdline:</p> <pre><code>cat /proc/5590/cmdline hald-addon-storage: polling /dev/scd0 (every 2 sec) </code></pre> <p>Do you have an idea how I could do that for each thread of my process? Tha...
[ { "answer_id": 139935, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 3, "selected": false, "text": "argv #include <string.h>\n#include <unistd.h>\n\nint\nmain(int argc, char** argv)\n{\n strcpy(argv[0], \"Hello, world!\")...
2008/09/26
[ "https://Stackoverflow.com/questions/139859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1277510/" ]
139,867
<p>Does anyone know of a freely available java 1.5 package that provides a list of ISO 3166-1 country codes as a enum or EnumMap? Specifically I need the "ISO 3166-1-alpha-2 code elements", i.e. the 2 character country code like "us", "uk", "de", etc. Creating one is simple enough (although tedious), but if there's a...
[ { "answer_id": 140235, "author": "McDowell", "author_id": 304, "author_profile": "https://Stackoverflow.com/users/304", "pm_score": 6, "selected": false, "text": "String[] countryCodes = Locale.getISOCountries();\n" }, { "answer_id": 2298525, "author": "Christophe Desguez", ...
2008/09/26
[ "https://Stackoverflow.com/questions/139867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12531/" ]
139,884
<p>Google results on this one are a bit thin, but suggest that it is not easily possible.</p> <p>My specific problem is that I need to renumber the IDs in two tables that are related to each other such that table B has an "table_a_id" column in it. I can't renumber table A first because then its children in B point to...
[ { "answer_id": 139943, "author": "Joel B Fant", "author_id": 22211, "author_profile": "https://Stackoverflow.com/users/22211", "pm_score": 5, "selected": true, "text": "DEFERRABLE CREATE TABLE" }, { "answer_id": 139960, "author": "Liam", "author_id": 18333, "author_pr...
2008/09/26
[ "https://Stackoverflow.com/questions/139884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22715/" ]
139,889
<p>I'm setting up a number sites right now and many of them have multiple domains. The question is: do I alias the domain (with <a href="http://httpd.apache.org/docs/2.0/mod/core.html#serveralias" rel="noreferrer">ServerAlias</a>) or do I <a href="http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect" rel="nore...
[ { "answer_id": 139911, "author": "Paul Dixon", "author_id": 6521, "author_profile": "https://Stackoverflow.com/users/6521", "pm_score": 6, "selected": true, "text": "RewriteCond %{HTTP_HOST} !^www\\.foobar\\.com [NC]\nRewriteCond %{HTTP_HOST} !^$\nRewriteRule ^/(.*) http://ww...
2008/09/26
[ "https://Stackoverflow.com/questions/139889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15948/" ]
139,891
<p>This question is not so much programming related as it is deployment related.</p> <p>I find myself conversing a lot with the group in my company whose job it is to maintain our production Windows servers and deploy our code on them. For legal and compliance reasons, I do not have direct visibility or any control ov...
[ { "answer_id": 139912, "author": "Dean", "author_id": 11802, "author_profile": "https://Stackoverflow.com/users/11802", "pm_score": 0, "selected": false, "text": "<root>:\\WINDOWS\\Microsoft.NET\\Framework v2.0.50727" }, { "answer_id": 139916, "author": "Ed Guiness", "aut...
2008/09/26
[ "https://Stackoverflow.com/questions/139891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2577/" ]
139,909
<p>I have a problem with setting the TTL on my Datagram packets. I am calling the setTTL(...) method on the packet before sending the packet to the multicastSocket but if I capture the packet with ethereal the TTL field is always set to 0</p>
[ { "answer_id": 139917, "author": "pfranza", "author_id": 22221, "author_profile": "https://Stackoverflow.com/users/22221", "pm_score": 4, "selected": true, "text": "-Djava.net.preferIPv4Stack=true\n" }, { "answer_id": 20336403, "author": "Mark Harrison", "author_id": 116,...
2008/09/26
[ "https://Stackoverflow.com/questions/139909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
139,921
<p>I'm using the document.form.submit() function for a rather large input form (hundreds of fields, it's an inventory application). I'm calling this after the user has been idle for a certain amount of time and I would like to save any data they've typed. When I try this the page reloads (the action is #) but any new...
[ { "answer_id": 140035, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 0, "selected": false, "text": "<form action=\"/page.cgi\">\n ...\n <input name=\"Fieldx\" value=\"\"/>\n</form>\n <input name=\"Fieldx\" value=\"#{bean.n...
2008/09/26
[ "https://Stackoverflow.com/questions/139921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22719/" ]
139,926
<p>I was writing some Unit tests last week for a piece of code that generated some SQL statements.</p> <p>I was trying to figure out a regex to match <code>SELECT</code>, <code>INSERT</code> and <code>UPDATE</code> syntax so I could verify that my methods were generating valid SQL, and after 3-4 hours of searching and...
[ { "answer_id": 139959, "author": "J.J.", "author_id": 21204, "author_profile": "https://Stackoverflow.com/users/21204", "pm_score": -1, "selected": false, "text": ".\\* [^\"]* \\" }, { "answer_id": 140094, "author": "David Aldridge", "author_id": 6742, "author_profile...
2008/09/26
[ "https://Stackoverflow.com/questions/139926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20400/" ]
139,927
<p>I have several projects where I need to append strings to a BSTR/CComBSTR/_bstr_t object (e.g. building a dynamic SQL statement). Is there an out-of-the-box type in the WinAPI to buffer the concatenation (like StringBuilder in .NET), or do I have to write my own? From what I know about the append methods, they per...
[ { "answer_id": 139959, "author": "J.J.", "author_id": 21204, "author_profile": "https://Stackoverflow.com/users/21204", "pm_score": -1, "selected": false, "text": ".\\* [^\"]* \\" }, { "answer_id": 140094, "author": "David Aldridge", "author_id": 6742, "author_profile...
2008/09/26
[ "https://Stackoverflow.com/questions/139927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20133/" ]
139,948
<p>I have a page using .NETs server-side input validation controls. This page also has a javascript confirm box that fires when the form is submitted. Currently when the Submit button is selected, the javascript confirm box appears, and once confirmed the ASP.NET server-side validation controls are fired. I would li...
[ { "answer_id": 490584, "author": "cofiem", "author_id": 31567, "author_profile": "https://Stackoverflow.com/users/31567", "pm_score": 3, "selected": false, "text": "confirm onclick confirm <asp:Button ID=\"btnSubmit\" runat=\"server\" Text=\"Submit\" OnClientClick=\"if (Page_ClientValida...
2008/09/26
[ "https://Stackoverflow.com/questions/139948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
139,954
<p>I've started with ASP.NET MVC recently, reading blogs, tutorials, trying some routes, etc. Now, i've stumbled on a issue where i need some help.</p> <p>Basically, i have an URL like /products.aspx?categoryid=foo&amp;productid=bar</p> <p>Most tutorials/examples propose to map this to something like: /products/categ...
[ { "answer_id": 139986, "author": "Ben Scheirman", "author_id": 3381, "author_profile": "https://Stackoverflow.com/users/3381", "pm_score": 4, "selected": true, "text": "routes.MapRoute(\"productsByCategory\", \"products/{category}/{productid}\",\n new { controller=\"products\", action=\...
2008/09/26
[ "https://Stackoverflow.com/questions/139954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19610/" ]
139,964
<p>Does anyone have a method to overcome the 260 character limit of the MSBuild tool for building Visual Studio projects and solutions from the command line? I'm trying to get the build automated using CruiseControl (CruiseControl.NET isn't an option, so I'm trying to tie it into normal ant scripts) and I keep on runni...
[ { "answer_id": 9635709, "author": "doomer", "author_id": 423665, "author_profile": "https://Stackoverflow.com/users/423665", "pm_score": 3, "selected": false, "text": "<BaseIntermediateOutputPath>$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\\..\\..\\..\\Intermediate\\$(Ass...
2008/09/26
[ "https://Stackoverflow.com/questions/139964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16035/" ]
139,972
<p>Kind of a newbie question, but I am having problems using SNVKit. </p> <p>I am using SVNKit in an application to commit changes to files. I have it successfully adding the files and folders to the working copy, but I am having problems committing it to the respository.</p> <p>The command I am trying to run is 'com...
[ { "answer_id": 140116, "author": "Sean", "author_id": 4919, "author_profile": "https://Stackoverflow.com/users/4919", "pm_score": 1, "selected": false, "text": "import checkout add commit -m \"message\"" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/139972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2535/" ]
139,979
<p>I have a C# interface with certain method parameters declared as <code>object</code> types. However, the actual type passed around can differ depending on the class implementing the interface:</p> <pre><code>public interface IMyInterface { void MyMethod(object arg); } public class MyClass1 : IMyInterface { ...
[ { "answer_id": 176441, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": " void Bla<T> (T a, T b);\n" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/139979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2576/" ]
139,991
<p>I have two functions, <code>f</code> and <code>g</code>, which call each other recursively. Unfortunately, when <code>f</code> calls <code>g</code>, it has not yet been declared, so I get an "unbound variable" error. How can I prototype (or whatever the equivalent vocabulary is) this function in SML/NJ?</p>
[ { "answer_id": 140386, "author": "nlucaroni", "author_id": 157, "author_profile": "https://Stackoverflow.com/users/157", "pm_score": 2, "selected": false, "text": "and fun" }, { "answer_id": 140405, "author": "Chris Conway", "author_id": 1412, "author_profile": "https...
2008/09/26
[ "https://Stackoverflow.com/questions/139991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10307/" ]
140,002
<p>I'm trying to return a dictionary from a function. I believe the function is working correctly, but I'm not sure how to utilize the returned dictionary.</p> <p>Here is the relevant part of my function:</p> <pre><code>Function GetSomeStuff() ' ' Get a recordset... ' Dim stuff Set stuff = CreateObject("Sc...
[ { "answer_id": 140064, "author": "Rob", "author_id": 7872, "author_profile": "https://Stackoverflow.com/users/7872", "pm_score": 0, "selected": false, "text": "Dim returnedStuff\nSet returnedStuff = GetSomeStuff()\n" }, { "answer_id": 140141, "author": "tloach", "author_i...
2008/09/26
[ "https://Stackoverflow.com/questions/140002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2441/" ]
140,012
<p>I am currently creating an overnight job that calls a Unix script which in turn creates and transfers a file using <code>ftp</code>. I would like to check all possible return codes. The man page for <code>ftp</code> doesn't list return codes. Does anyone know where to find a list? Anyone with experience with thi...
[ { "answer_id": 140071, "author": "ColinYounger", "author_id": 1223, "author_profile": "https://Stackoverflow.com/users/1223", "pm_score": 4, "selected": true, "text": "ftp" }, { "answer_id": 140390, "author": "jk.", "author_id": 21284, "author_profile": "https://Stack...
2008/09/26
[ "https://Stackoverflow.com/questions/140012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12646/" ]
140,026
<p>I'm writing a server that I expect to be run by many different people, not all of whom I will have direct contact with. The servers will communicate with each other in a cluster. Part of the server's functionality involves selecting a small subset of rows from a potentially very large table. The exact choice of what...
[ { "answer_id": 46762714, "author": "Vikas", "author_id": 137228, "author_profile": "https://Stackoverflow.com/users/137228", "pm_score": 0, "selected": false, "text": "SQLite3 from functools import partial\ndef select_keys(keys, from_):\n return ({k : fun(v, row) for k, (v, fun) in ke...
2008/09/26
[ "https://Stackoverflow.com/questions/140026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12030/" ]
140,033
<p>Assume I have a class foo, and wish to use a std::map to store some boost::shared_ptrs, e.g.:</p> <pre><code>class foo; typedef boost::shared_ptr&lt;foo&gt; foo_sp; typeded std::map&lt;int, foo_sp&gt; foo_sp_map; foo_sp_map m; </code></pre> <p>If I add a new foo_sp to the map but the key used already exists, wil...
[ { "answer_id": 140112, "author": "Harald Scheirich", "author_id": 22080, "author_profile": "https://Stackoverflow.com/users/22080", "pm_score": 1, "selected": false, "text": "m[0] = p2; p foo_sp p(new foo);" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/140033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
140,043
<p>How do I loop into all the resources in the resourcemanager?</p> <p>Ie: foreach (string resource in ResourceManager) //Do something with the recource.</p> <p>Thanks</p>
[ { "answer_id": 140060, "author": "VVS", "author_id": 21038, "author_profile": "https://Stackoverflow.com/users/21038", "pm_score": 6, "selected": true, "text": "IEnumerable IEnumerable<object> Enumerable.Count<T>() using System.Linq;\n\n...\n\nvar resourceSet = resourceManager.GetResourc...
2008/09/26
[ "https://Stackoverflow.com/questions/140043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17766/" ]
140,044
<p>I need to create a user control in either vb.net or c# to search a RightNow CRM database. I have the documentation on their XML API, but I'm not sure how to post to their parser and then catch the return data and display it on the page.</p> <p>Any sample code would be greatly appreciated!</p> <p>Link to API: <a hr...
[ { "answer_id": 148494, "author": "csgero", "author_id": 21764, "author_profile": "https://Stackoverflow.com/users/21764", "pm_score": 1, "selected": false, "text": "using System.Net;\nusing System.Text;\nusing System;\n\nnamespace RightNowSample\n{\n class Program\n {\n stat...
2008/09/26
[ "https://Stackoverflow.com/questions/140044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20483/" ]
140,054
<p>I need to use InstallUtil to install a C# windows service. I need to set the service logon credentials (username and password). All of this needs to be done silently.</p> <p>Is there are way to do something like this:</p> <pre><code>installutil.exe myservice.exe /customarg1=username /customarg2=password </code></p...
[ { "answer_id": 140285, "author": "Dean Hill", "author_id": 3106, "author_profile": "https://Stackoverflow.com/users/3106", "pm_score": 7, "selected": true, "text": "installutil.exe /user=uname /password=pw myservice.exe\n namespace Test\n{\n [RunInstaller(true)]\n public class Test...
2008/09/26
[ "https://Stackoverflow.com/questions/140054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3106/" ]
140,061
<p>When creating a class library in C++, you can choose between dynamic (<code>.dll</code>, <code>.so</code>) and static (<code>.lib</code>, <code>.a</code>) libraries. What is the difference between them and when is it appropriate to use which?</p>
[ { "answer_id": 140444, "author": "bk1e", "author_id": 8090, "author_profile": "https://Stackoverflow.com/users/8090", "pm_score": 8, "selected": false, "text": "mylib.lib a.obj b.obj a.obj b.obj b.obj type_info type_info &typeid() type_info::before()" }, { "answer_id": 1900692, ...
2008/09/26
[ "https://Stackoverflow.com/questions/140061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4055/" ]
140,104
<p>If something goes wrong in a WCF REST call, such as the requested resource is not found, how can I play with the HTTP response code (setting it to something like HTTP 404, for example) in my OperationContract method?</p>
[ { "answer_id": 140154, "author": "Eric Schoonover", "author_id": 3957, "author_profile": "https://Stackoverflow.com/users/3957", "pm_score": 8, "selected": true, "text": "WebOperationContext OutgoingResponse OutgoingWebResponseContext StatusCode WebOperationContext ctx = WebOperationCont...
2008/09/26
[ "https://Stackoverflow.com/questions/140104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21784/" ]
140,111
<p>Linux supports sending an arbitrary Posix-Signal such as <code>SIGINT</code> or <code>SIGTERM</code> to a process using the <code>kill</code>-Command. While <code>SIGINT</code> and <code>SIGTERM</code> are just boring old ways to end a process in a friendly or not-so-friendly kind of way, <code>SIGQUIT</code> is me...
[ { "answer_id": 140174, "author": "Mike Dimmick", "author_id": 6970, "author_profile": "https://Stackoverflow.com/users/6970", "pm_score": 3, "selected": false, "text": "SetConsoleCtrlHandler" }, { "answer_id": 140229, "author": "Bob Nadler", "author_id": 2514, "author...
2008/09/26
[ "https://Stackoverflow.com/questions/140111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19256/" ]
140,113
<p>I want to consume a web service over https from a java client. What steps will i need to take in order to do this?</p>
[ { "answer_id": 163759, "author": "Ian McLaird", "author_id": 18796, "author_profile": "https://Stackoverflow.com/users/18796", "pm_score": 2, "selected": false, "text": "keytool -importcert -v -trustcacerts -alias ServerName -file server_cert_file.crt -keystore client_keystore_file\n" ...
2008/09/26
[ "https://Stackoverflow.com/questions/140113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11612/" ]
140,115
<p>So I have a small C# app that needs to periodically check the contents of directories on multiple machines on the network. I thought I could just read \hostname\C$ as a directory path, but with the normal Directory class there doesn't seem to be a way to authenticate against the other servers so you can access the ...
[ { "answer_id": 140156, "author": "Austin Salonen", "author_id": 4068, "author_profile": "https://Stackoverflow.com/users/4068", "pm_score": 0, "selected": false, "text": "DirectoryInfo di = new DirectoryInfo(@\"\\\\machineName\\c$\\temp\");\n\nFileInfo[] files = di.GetFiles();\n\nforeach...
2008/09/26
[ "https://Stackoverflow.com/questions/140115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/634/" ]
140,131
<p>I am looking for a way to convert a long string (from a dump), that represents hex values into a byte array.</p> <p>I couldn't have phrased it better than the person that posted <a href="http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21062554.html" rel="noreferrer">the same question here</...
[ { "answer_id": 140147, "author": "skaffman", "author_id": 21234, "author_profile": "https://Stackoverflow.com/users/21234", "pm_score": 7, "selected": false, "text": "import org.apache.commons.codec.binary.Hex;\n...\nbyte[] decoded = Hex.decodeHex(\"00A0BF\");\n// 0x00 0xA0 0xBF\n" }, ...
2008/09/26
[ "https://Stackoverflow.com/questions/140131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11798/" ]
140,133
<p>I want to raise an event when a popup window is closed, or preferably, just before closing. I'm storing the popup window object as an object, but I don't know of any way to bind to the close event, or an event just before the window is closed.</p> <pre><code>var popupWindow = window.open("/popup.aspx", "popupWindow...
[ { "answer_id": 140318, "author": "Philip Tinney", "author_id": 14930, "author_profile": "https://Stackoverflow.com/users/14930", "pm_score": 2, "selected": false, "text": "$(window).unload( function () { alert(\"Bye now!\"); } );" }, { "answer_id": 1164449, "author": "Elzo Va...
2008/09/26
[ "https://Stackoverflow.com/questions/140133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/392/" ]
140,137
<p>I'm working on a client site who is using Umbraco as a CMS. I need to create a custom 404 error page. I've tried doing it in the IIS config but umbraco overrides that. </p> <p>Does anyone know how to create a custom 404 error page in Umbraco? Is there a way to create a custom error page for runtime errors?</p>
[ { "answer_id": 140169, "author": "Swati", "author_id": 12682, "author_profile": "https://Stackoverflow.com/users/12682", "pm_score": 4, "selected": false, "text": "/config/umbracoSettings.config <error404>1</error404> <errors>\n <error404>1</error404> \n</errors>\n" }, { "answe...
2008/09/26
[ "https://Stackoverflow.com/questions/140137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20483/" ]
140,149
<p>I have a custom performance counter category. Visual Studio Server Explorer refuses to delete it, claiming it is 'not registered or a system category'. Short of doing it programmatically, how can I delete the category? Is there a registry key I can delete?</p>
[ { "answer_id": 140185, "author": "Jaykul", "author_id": 8718, "author_profile": "https://Stackoverflow.com/users/8718", "pm_score": 6, "selected": true, "text": "[Diagnostics.PerformanceCounterCategory]::Delete( \"Your Category Name\" )\n HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Se...
2008/09/26
[ "https://Stackoverflow.com/questions/140149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16881/" ]
140,161
<p>How can I find out which column and value is violating the constraint? The exception message isn't helpful at all:</p> <blockquote> <p>Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.</p> </blockquote>
[ { "answer_id": 140679, "author": "Joe", "author_id": 13087, "author_profile": "https://Stackoverflow.com/users/13087", "pm_score": 5, "selected": false, "text": "...\ntry\n{\n adapter.Fill(dataTable); // or dataSet\n}\ncatch (ConstraintException)\n{\n LogErrors(dataTable);\n thr...
2008/09/26
[ "https://Stackoverflow.com/questions/140161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11547/" ]
140,162
<p>In a servlet I do the following:</p> <pre><code> Context context = new InitialContext(); value = (String) context.lookup("java:comp/env/propertyName"); </code></pre> <p>On an Apache Geronimo instance (WAS CE 2.1) how do i associate a value with the key <em>propertyName</em>?</p> <p>In Websphere AS 6 i can conf...
[ { "answer_id": 143749, "author": "Mike Spross", "author_id": 17862, "author_profile": "https://Stackoverflow.com/users/17862", "pm_score": 1, "selected": false, "text": "<env-entry> <env-entry>\n <description>My string property</descriptor>\n <env-entry-name>propertyName</env-entry-n...
2008/09/26
[ "https://Stackoverflow.com/questions/140162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985/" ]
140,182
<p>When using regular expressions we generally, if not always use them to extract some kind of information. What I need is to replace the match value with some other value... </p> <p>Right now I'm doing this...</p> <pre><code>def getExpandedText(pattern, text, replaceValue): """ One liner... really ugly b...
[ { "answer_id": 140209, "author": "Swati", "author_id": 12682, "author_profile": "https://Stackoverflow.com/users/12682", "pm_score": 4, "selected": true, "text": "sub (replacement, string[, count = 0])\n p = re.compile( '(blue|white|red)')\n >>> p.sub( 'colour', 'blue socks and re...
2008/09/26
[ "https://Stackoverflow.com/questions/140182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293/" ]
140,204
<p>Given a typical class:</p> <pre> struct Whatever { void Doit(); }; Whatever w; </pre> <p>what is the best way to get the member function to be called by a C void* based callback such as pthread_create() or a signal handler ?</p> <pre> pthread_t pid; pthread_create(&pid, 0, ... &w.Doit() ... ); </pre>
[ { "answer_id": 140232, "author": "Ian G", "author_id": 5764, "author_profile": "https://Stackoverflow.com/users/5764", "pm_score": 3, "selected": false, "text": "int pthread_create(pthread_t *thread, const pthread_attr_t *attr,\n void *(*start_routine)(void*), void *arg...
2008/09/26
[ "https://Stackoverflow.com/questions/140204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22725/" ]
140,205
<p>I'm working on a query that needs to have some data rows combined based on date ranges. These rows are duplicated in all the data values, except the date ranges are split. For example the table data may look like</p> <pre><code>StudentID StartDate EndDate Field1 Field2 1 9/3/2007 10/20/2007 ...
[ { "answer_id": 140226, "author": "Scott Bevington", "author_id": 9544, "author_profile": "https://Stackoverflow.com/users/9544", "pm_score": 0, "selected": false, "text": "SELECT StudentID, MIN(startdate) AS startdate, MAX(enddate), field1, field2\nFROM tablex\nGROUP BY StudentID, field1...
2008/09/26
[ "https://Stackoverflow.com/questions/140205", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18891/" ]
140,217
<p>As a developer, how do you use gdb to track down bugs within your code? What techniques tricks do you use to make your life easier?</p>
[ { "answer_id": 140316, "author": "Andrew Johnson", "author_id": 5109, "author_profile": "https://Stackoverflow.com/users/5109", "pm_score": 2, "selected": false, "text": "gdb> p show_my_struct(struct)\n\nMy custom display of Foo:\n ...\n gdb> watch foo\nWatchpoint4: foo\ngdb>\n" }, ...
2008/09/26
[ "https://Stackoverflow.com/questions/140217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16044/" ]
140,303
<p>What is the cause of this exception in ASP.NET? Obviously it is a viewstate exception, but I can't reproduce the error on the page that is throwing the exception (a simple two TextBox form with a button and navigation links).</p> <p>FWIW, I'm not running a web farm.</p> <h2>Exception</h2> <blockquote> <p>Error...
[ { "answer_id": 141419, "author": "Raelshark", "author_id": 19678, "author_profile": "https://Stackoverflow.com/users/19678", "pm_score": 2, "selected": false, "text": "enableViewStateMac=\"false\" page" }, { "answer_id": 254581, "author": "Jeffrey Harrington", "author_id"...
2008/09/26
[ "https://Stackoverflow.com/questions/140303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17847/" ]
140,329
<p>I am currently working on an web application that uses ASP.NET 2.0 framework. I need to redirect to a certain page, say SessionExpired.aspx, when the user session expires. There are lot of pages in the project, so adding code to every page of the site is not really a good solution. I have MasterPages though, which I...
[ { "answer_id": 140425, "author": "wprl", "author_id": 17847, "author_profile": "https://Stackoverflow.com/users/17847", "pm_score": 0, "selected": false, "text": "<customErrors defaultRedirect=\"url\" mode=\"RemoteOnly\">\n <error statusCode=\"408\" redirect=\"~/SessionExpired.aspx\"/...
2008/09/26
[ "https://Stackoverflow.com/questions/140329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14710/" ]
140,331
<p>I have a following SQL Server 2005 database schema:</p> <pre><code>CREATE TABLE Messages ( MessageID int, Subject varchar(500), Text varchar(max) NULL, UserID NULL ) </code></pre> <p>The column "UserID" - which can be null - is a foreign key and links to the table</p> <pre><code>CREATE TABLE Users ( ...
[ { "answer_id": 140424, "author": "Orion Adrian", "author_id": 7756, "author_profile": "https://Stackoverflow.com/users/7756", "pm_score": 0, "selected": false, "text": ".Include(\"Users\") User Message" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/140331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
140,347
<p>I know there is a function somewhere that will accept a client rect and it will convert it into a window rect for you. I just can't find / remember it!</p> <p>Does anyone know what it is?</p> <p>It will do something similar to:</p> <pre><code>const CRect client(0, 0, 200, 200); const CRect window = ClientRectToWi...
[ { "answer_id": 140373, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 4, "selected": true, "text": "AdjustWindowRectEx() GetWindowRect()" }, { "answer_id": 21004956, "author": "aMarCruz", "author_id": 3174665, ...
2008/09/26
[ "https://Stackoverflow.com/questions/140347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/986/" ]
140,406
<p>Does anyone know of existing software or algorithms to calculate a package size for shipping multiple items?</p> <p>I have a bunch of items in our inventory database with length, width and height dimesions defined. Given these dimensions I need to calculate how many of the purchased items will fit into predefined ...
[ { "answer_id": 46173005, "author": "Ammar", "author_id": 3427844, "author_profile": "https://Stackoverflow.com/users/3427844", "pm_score": 0, "selected": false, "text": "PackingService.Pack() Container Item" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/140406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8754/" ]
140,422
<p>I'm looking for pseudocode, or sample code, to convert higher bit ascii characters (like, Ü which is extended ascii 154) into U (which is ascii 85).</p> <p>My initial guess is that since there are only about 25 ascii characters that are similar to 7bit ascii characters, a translation array would have to be used.</p...
[ { "answer_id": 140531, "author": "Derek Clegg", "author_id": 19783, "author_profile": "https://Stackoverflow.com/users/19783", "pm_score": 1, "selected": false, "text": "static const char xlate[256] = { ..., ['é'] = 'e', ..., ['Ü'] = 'U', ... }\n...\nnew_c = xlate[old_c];\n" }, { ...
2008/09/26
[ "https://Stackoverflow.com/questions/140422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/245/" ]
140,439
<p>How do I authenticate against AD using Python + LDAP. I'm currently using the python-ldap library and all it is producing is tears.</p> <p>I can't even bind to perform a simple query:</p> <pre><code>import sys import ldap Server = "ldap://my-ldap-server" DN, Secret, un = sys.argv[1:4] Base = "dc=mydomain,dc=co,...
[ { "answer_id": 140495, "author": "1729", "author_id": 4319, "author_profile": "https://Stackoverflow.com/users/4319", "pm_score": 7, "selected": true, "text": "l.set_option(ldap.OPT_REFERRALS, 0)\n" }, { "answer_id": 140737, "author": "Johan Buret", "author_id": 15366, ...
2008/09/26
[ "https://Stackoverflow.com/questions/140439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4319/" ]
140,453
<p>My company is considering changing continuous integration servers (I won't say which one we have now, so I won't skew your responses in anyway :) ) I wondering if anybody has any recommendations? Best user experience, level of difficulty to maintain, etc...</p> <p>Our code is all in java, and we use ANT as a build...
[ { "answer_id": 4008659, "author": "yegor256", "author_id": 187141, "author_profile": "https://Stackoverflow.com/users/187141", "pm_score": 0, "selected": false, "text": "ant" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/140453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22221/" ]
140,460
<p>We have a typical web application that is essentially a data entry application with lots of screens some of which have some degree of complexity. We need to provide that standard capability on making sure if the user forgets to click the "Save" button before navigating away or closing their browser they get a warni...
[ { "answer_id": 140508, "author": "Jonny Buchanan", "author_id": 6760, "author_profile": "https://Stackoverflow.com/users/6760", "pm_score": 4, "selected": false, "text": "/**\n * Determines if a form is dirty by comparing the current value of each element\n * with its default value.\n *\...
2008/09/26
[ "https://Stackoverflow.com/questions/140460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22732/" ]
140,462
<p>Is it possible to tell if the user of a website is using multiple monitors? I need to find the position of a popup but it's quite likely the user will have a multiple monitor setup. Whilst <code>window.screenX</code> etc. will give the position of the browser window it's useless for multiple monitors.</p>
[ { "answer_id": 140523, "author": "Till", "author_id": 2859, "author_profile": "https://Stackoverflow.com/users/2859", "pm_score": 0, "selected": false, "text": "screen.width .availWidth screen.height .availHeight" }, { "answer_id": 21305365, "author": "Algy Taylor", "auth...
2008/09/26
[ "https://Stackoverflow.com/questions/140462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21030/" ]
140,468
<p>What is the longest string that can be created in .NET? The docs for the <code>String</code> class are silent on this question as far as I can see, so an authoritative answer might require some knowledge of internals. Would the maximum change on a 64-bit system?</p> <p>[This is asked more for curiosity than for pra...
[ { "answer_id": 140492, "author": "Ryan Farley", "author_id": 1627, "author_profile": "https://Stackoverflow.com/users/1627", "pm_score": 6, "selected": false, "text": "Length System.String Int32 Int32" }, { "answer_id": 140506, "author": "VVS", "author_id": 21038, "au...
2008/09/26
[ "https://Stackoverflow.com/questions/140468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3776/" ]
140,490
<p>Which gets called first - the base constructor or "other stuff here"?</p> <pre><code>public class MyExceptionClass : Exception { public MyExceptionClass(string message, string extrainfo) : base(message) { //other stuff here } } </code></pre>
[ { "answer_id": 140497, "author": "Mastermind", "author_id": 22213, "author_profile": "https://Stackoverflow.com/users/22213", "pm_score": 3, "selected": false, "text": "using System;\nclass Base\n{\n\npublic Base()\n{\n Console.WriteLine(\"BASE 1\");\n}\npublic Base(int x)\n{\n Con...
2008/09/26
[ "https://Stackoverflow.com/questions/140490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16872/" ]
140,550
<p>What is the best way to store a large amount of text in a table in SQL server?</p> <p>Is varchar(max) reliable?</p>
[ { "answer_id": 140652, "author": "Mark Stock", "author_id": 19737, "author_profile": "https://Stackoverflow.com/users/19737", "pm_score": 2, "selected": false, "text": "id text_chunk text_chunk_id CREATE TABLE text_chunk (\n id NUMBER,\n chunk_sequence NUMBER,\n text BIGTEXT)...
2008/09/26
[ "https://Stackoverflow.com/questions/140550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17648/" ]
140,579
<p>How do I detect if my program runs in an Active Directory environment?</p> <p>I'm using C# and .Net 2.0</p>
[ { "answer_id": 140603, "author": "Kevin Fairchild", "author_id": 3743, "author_profile": "https://Stackoverflow.com/users/3743", "pm_score": 2, "selected": false, "text": "string ADServer = Environment.GetEnvironmentVariable(\"LOGONSERVER\"); \n" }, { "answer_id": 140823, "au...
2008/09/26
[ "https://Stackoverflow.com/questions/140579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17766/" ]
140,614
<p>My Ubuntu server has Apache and Subversion installed. I use this server as a staging server, purely for testing purposes. I use Apache to host the web application, and Subversion to keep versioned copies of the source code.</p> <p>My current workflow:</p> <ul> <li>Make changes to a file</li> <li>Commit the file to...
[ { "answer_id": 908042, "author": "Jonas Kölker", "author_id": 58668, "author_profile": "https://Stackoverflow.com/users/58668", "pm_score": 0, "selected": false, "text": "/home/richardhenry/src/mywebsite" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/140614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326176/" ]
140,616
<p>Is there a NAnt task that will echo out all property names and values that are currently set during a build? Something equivalent to the Ant <a href="http://ant.apache.org/manual/Tasks/echoproperties.html" rel="noreferrer">echoproperties</a> task maybe?</p>
[ { "answer_id": 141174, "author": "craigb", "author_id": 18590, "author_profile": "https://Stackoverflow.com/users/18590", "pm_score": 6, "selected": true, "text": "<project>\n <property name=\"foo\" value=\"bar\"/>\n <property name=\"fiz\" value=\"buz\"/>\n\n <script language=\"...
2008/09/26
[ "https://Stackoverflow.com/questions/140616", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1853/" ]
140,627
<p>I just wrote my first web service so lets make the assumption that my web service knowlege is non existant. I want to try to call a dbClass function from the web service. However I need some params that are in the session. Is there any way I can get these call these session variables from the webservice??</p>
[ { "answer_id": 140656, "author": "Metro", "author_id": 18978, "author_profile": "https://Stackoverflow.com/users/18978", "pm_score": 5, "selected": true, "text": "[WebMethod(EnableSession = true)]\npublic void MyWebService()\n{\n Foo foo;\n Session[\"MyObjectName\"] = new Foo();\n ...
2008/09/26
[ "https://Stackoverflow.com/questions/140627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16820/" ]
140,640
<p>Is there an NSIS var to get the path of the currently running installer?</p>
[ { "answer_id": 43888176, "author": "Maxim Suslov", "author_id": 3364871, "author_profile": "https://Stackoverflow.com/users/3364871", "pm_score": 4, "selected": false, "text": "$EXEPATH $EXEDIR $EXEDIR" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/140640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
140,643
<p>When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown. These tables have execute permission for the schema where the view was created. If I execute the view's SQL Statement it works. What am I missing?</p>
[ { "answer_id": 140665, "author": "Steve K", "author_id": 739, "author_profile": "https://Stackoverflow.com/users/739", "pm_score": 5, "selected": true, "text": "grant SELECT on TABLE_NAME to READ_USERNAME;\n" }, { "answer_id": 141219, "author": "Igor Zelaya", "author_id":...
2008/09/26
[ "https://Stackoverflow.com/questions/140643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22769/" ]
140,677
<p>I had a discussion a few weeks back with some co-workers on refactoring, and I seem to be in a minority that believes "Refactor early, refactor often" is a good approach that keeps code from getting messy and unmaintainable. A number of other people thought that it just belongs in the maintenance phases of a project...
[ { "answer_id": 140766, "author": "Chris Cudmore", "author_id": 18907, "author_profile": "https://Stackoverflow.com/users/18907", "pm_score": 2, "selected": false, "text": "temp = array[i];\narray[i] = array[j];\narray[j] = temp;\n" }, { "answer_id": 150433, "author": "Craig P...
2008/09/26
[ "https://Stackoverflow.com/questions/140677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6897/" ]
140,696
<p>I'm wondering which languages support (or don't support) native multithreading, and perhaps get some details about the implementation. Hopefully we can produce a complete overview of this specific functionality.</p>
[ { "answer_id": 59979349, "author": "Umair Riaz", "author_id": 10570437, "author_profile": "https://Stackoverflow.com/users/10570437", "pm_score": 1, "selected": false, "text": "Go Goroutine C-language" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/140696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14032/" ]
140,728
<p>It often happens that characters such as <em>é</em> gets transformed to <em>é</em>, even though the collation for the MySQL DB, table and field is set to utf8_general_ci. The encoding in the <em>Content-Type</em> for the page is also set to UTF8.</p> <p>I know about utf8_encode/decode, but I'm not quite sure about ...
[ { "answer_id": 141011, "author": "Stefan Gehrig", "author_id": 11354, "author_profile": "https://Stackoverflow.com/users/11354", "pm_score": 5, "selected": true, "text": "SET NAMES utf8\n $db=new PDO($dsn, $user, $pass);\n$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, \"SET NAMES utf8\"...
2008/09/26
[ "https://Stackoverflow.com/questions/140728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6681/" ]
140,734
<p>What would be the best practice way to handle the caching of images using PHP.</p> <p>The filename is currently stored in a MySQL database which is renamed to a GUID on upload, along with the original filename and alt tag.</p> <p>When the image is put into the HTML pages it is done so using a url such as '/images/...
[ { "answer_id": 141164, "author": "user18334", "author_id": 18334, "author_profile": "https://Stackoverflow.com/users/18334", "pm_score": 0, "selected": false, "text": "<img src=\"/phpThumb.php?src=/path/to/image.jpg&w=200&amp;h=200\" alt=\"thumbnail\"/>\n" }, { "answer_id": 14122...
2008/09/26
[ "https://Stackoverflow.com/questions/140734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22776/" ]
140,758
<p>In Java you can do <code>File.listFiles()</code> and receive all of the files in a directory. You can then easily recurse through directory trees.</p> <p>Is there an analogous way to do this in Python?</p>
[ { "answer_id": 140778, "author": "florin", "author_id": 18308, "author_profile": "https://Stackoverflow.com/users/18308", "pm_score": 2, "selected": false, "text": ">>> import glob\n>>> glob.glob('./[0-9].*')\n['./1.gif', './2.txt']\n>>> glob.glob('*.gif')\n['1.gif', 'card.gif']\n>>> glo...
2008/09/26
[ "https://Stackoverflow.com/questions/140758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2598/" ]
140,765
<p>I am writing a web server in Java and I want it to support HTTP 1.1 Keep-Alive connections. But how can I tell when the client is done sending requests for a given connection? (like a double end-of-line or something). </p> <p>Lets see how stackoverflow handles this very obscure question -- answers for which, on Goo...
[ { "answer_id": 140889, "author": "Alexander", "author_id": 16724, "author_profile": "https://Stackoverflow.com/users/16724", "pm_score": 1, "selected": false, "text": "Connection: close" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/140765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982630/" ]
140,786
<p>The code is</p> <pre><code>return min + static_cast&lt;int&gt;(static_cast&lt;double&gt;(max - min + 1.0) * (number / (UINT_MAX + 1.0))); </code></pre> <p>number is a random number obtained by rand_s. min and max are ints and represent minimum and maximum values (inclusive).</p> <p>If you provide a solution not...
[ { "answer_id": 140826, "author": "Andrew Stein", "author_id": 13029, "author_profile": "https://Stackoverflow.com/users/13029", "pm_score": -1, "selected": false, "text": "min + number % (max - min + 1)\n" }, { "answer_id": 140848, "author": "jk.", "author_id": 21284, ...
2008/09/26
[ "https://Stackoverflow.com/questions/140786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9403/" ]
140,820
<p>Assuming I'm trying to automate the installation of something on windows and I want to try to test whether another installation is in progress before attempting install. I don't have control over the installer and have to do this in the automation framework. Is there a better way to do this, some win32 api?, than ju...
[ { "answer_id": 22026461, "author": "NBPC77", "author_id": 235100, "author_profile": "https://Stackoverflow.com/users/235100", "pm_score": 2, "selected": false, "text": " /// <summary>\n/// Wait (up to a timeout) for the MSI installer service to become free.\n/// </summary>\n/// <returns...
2008/09/26
[ "https://Stackoverflow.com/questions/140820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/332/" ]
140,825
<p>Can you define a macro that accesses a normal variable, but in a read-only fashion (other than defining it as a call to a function)? For example, can the VALUE macro in the following code be defined in such a way that the dostuff() function causes a compile error?</p> <pre><code>struct myobj { int value; } /* Th...
[ { "answer_id": 140853, "author": "Mark Ransom", "author_id": 5987, "author_profile": "https://Stackoverflow.com/users/5987", "pm_score": 4, "selected": true, "text": "#define VALUE(x) (x+0)\n #define VALUE(x) (x->value+0)\n" }, { "answer_id": 140870, "author": "Andrew Stein",...
2008/09/26
[ "https://Stackoverflow.com/questions/140825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14732/" ]
140,850
<p>I'm using SQL Server 2005, and creating ftp tasks within SSIS. </p> <p>Sometimes there will be files to ftp over, sometimes not. If there are no files, I don't want the task nor the package to fail. I've changed the arrow going from the ftp task to the next to "completion", so the package runs through. I've cha...
[ { "answer_id": 165000, "author": "thursdaysgeek", "author_id": 22523, "author_profile": "https://Stackoverflow.com/users/22523", "pm_score": 2, "selected": false, "text": " Dim ftpStream As StreamWriter = ftpFile.CreateText()\n ftpStream.WriteLine(ftpUser)\n ftpStream.WriteLine(...
2008/09/26
[ "https://Stackoverflow.com/questions/140850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22523/" ]
140,852
<p>I have a nested class. I want to access the outer and nested classes in other class. How to access both class properties and methods and my condition is i want to create object for only one class plz provide the code snippet</p>
[ { "answer_id": 140881, "author": "Craig Eddy", "author_id": 5557, "author_profile": "https://Stackoverflow.com/users/5557", "pm_score": 0, "selected": false, "text": "public class Foo() {\n public Foo() { }\n\n private Bar m_Bar = new Bar(); \n\n public Bar TheBar { get { retur...
2008/09/26
[ "https://Stackoverflow.com/questions/140852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
140,869
<p>I'm on a team maintaining a .Net web app with a SQL Server 2005 back end. The system's been running a little slow in places lately, so after doing all the tuning kind of stuff we could think of (adding indexes, cleaning up really badly written stored procedures, etc.) I ran a typical workload through the Tuning Adv...
[ { "answer_id": 142668, "author": "Nicholas Head", "author_id": 22505, "author_profile": "https://Stackoverflow.com/users/22505", "pm_score": 2, "selected": false, "text": "SELECT\n migs.avg_total_user_cost * (migs.avg_user_impact / 100.0) * (migs.user_seeks + migs.user_scans) AS improve...
2008/09/26
[ "https://Stackoverflow.com/questions/140869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19074/" ]
140,908
<p>Is there any framework for querying XML SQL Syntax, I seriously tire of iterating through node lists. <hr> Or is this just wishful thinking (if not idiotic) and certainly not possible since XML isn't a relational database?</p>
[ { "answer_id": 140914, "author": "Craig Eddy", "author_id": 5557, "author_profile": "https://Stackoverflow.com/users/5557", "pm_score": 2, "selected": false, "text": "ReadXml()" }, { "answer_id": 142491, "author": "Constantin", "author_id": 20310, "author_profile": "h...
2008/09/26
[ "https://Stackoverflow.com/questions/140908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1765/" ]
140,926
<p>I have a data stream that may contain \r, \n, \r\n, \n\r or any combination of them. Is there a simple way to normalize the data to make all of them simply become \r\n pairs to make display more consistent?</p> <p>So something that would yield this kind of translation table:</p> <pre><code>\r --&gt; \r\n \n ...
[ { "answer_id": 140952, "author": "Quintin Robinson", "author_id": 12707, "author_profile": "https://Stackoverflow.com/users/12707", "pm_score": 2, "selected": false, "text": "\\r => \\r \n\\n => \\n \n\\n\\n => \\n\\n \n\\n\\r => \\n\\r \n\\r\\n => \\r\\n \n\\r\\n => \\r\\n \n\\n =...
2008/09/26
[ "https://Stackoverflow.com/questions/140926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13154/" ]
140,935
<p>Anyone knows if is possible to have partial class definition on C++ ?</p> <p>Something like:</p> <p>file1.h:</p> <pre> class Test { public: int test1(); }; </pre> <p>file2.h: </p> <pre> class Test { public: int test2(); }; </pre> <p>For me it seems quite useful for definining multi-p...
[ { "answer_id": 140942, "author": "Jamie", "author_id": 22748, "author_profile": "https://Stackoverflow.com/users/22748", "pm_score": 4, "selected": false, "text": "class AllPlatforms {\npublic:\n int common();\n};\n class PlatformA : public AllPlatforms {\npublic:\n int specific();...
2008/09/26
[ "https://Stackoverflow.com/questions/140935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18623/" ]
140,996
<p>In WPF, I want to create a hyperlink that navigates to the details of an object, and I want the text of the hyperlink to be the name of the object. Right now, I have this:</p> <pre><code>&lt;TextBlock&gt;&lt;Hyperlink Command="local:MyCommands.ViewDetails" CommandParameter="{Binding}"&gt;Object Name&lt;/Hyperlink&g...
[ { "answer_id": 141008, "author": "Bob King", "author_id": 6897, "author_profile": "https://Stackoverflow.com/users/6897", "pm_score": 9, "selected": true, "text": "Hyperlink <Run/> <Run/> TextBlock <TextBlock>\n <Hyperlink Command=\"local:MyCommands.ViewDetails\" CommandParameter=\"{B...
2008/09/26
[ "https://Stackoverflow.com/questions/140996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22789/" ]
141,002
<p>I'm doing some maintenance coding on a webapp and I am getting a javascript error of the form: "[elementname] has no properties"</p> <p>Part of the code is being generated on the fly with an AJAX call that changes innerHTML for part of the page, after this is finished I need to copy a piece of data from a hidden in...
[ { "answer_id": 141075, "author": "user19264", "author_id": 19264, "author_profile": "https://Stackoverflow.com/users/19264", "pm_score": 2, "selected": false, "text": "<div id=\"test2\">\n <input id=\"source\" value=\"0\" />\n</div>\n<input id=\"dest\" value=\"1\" />\n\n<script type=\...
2008/09/26
[ "https://Stackoverflow.com/questions/141002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6153/" ]
141,007
<p>Is there a way to add a resource to a ResourceDictionary from code without giving it a resource key?</p> <p>For instance, I have this resource in XAML:</p> <pre><code>&lt;TreeView.Resources&gt; &lt;HierarchicalDataTemplate DataType="{x:Type xbap:FieldPropertyInfo}" ItemsSource="{Binding Path=Value.Valu...
[ { "answer_id": 141018, "author": "Orion Adrian", "author_id": 7756, "author_profile": "https://Stackoverflow.com/users/7756", "pm_score": 0, "selected": false, "text": "this.Resources.Add(FieldPropertyInfo.GetType(), fieldPropertyTemplate);\n" }, { "answer_id": 141032, "autho...
2008/09/26
[ "https://Stackoverflow.com/questions/141007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12999/" ]
141,045
<p>I want to replace the first occurrence in a given string. </p> <p>How can I accomplish this in .NET?</p>
[ { "answer_id": 141076, "author": "VVS", "author_id": 21038, "author_profile": "https://Stackoverflow.com/users/21038", "pm_score": 7, "selected": false, "text": "string ReplaceFirst(string text, string search, string replace)\n{\n int pos = text.IndexOf(search);\n if (pos < 0)\n {\n ...
2008/09/26
[ "https://Stackoverflow.com/questions/141045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
141,052
<p>I have been looking for documentation related to interacting with MSPaint from the command line. I have only found references to /p, /pt and /wia, but no guidance as to how to use them and their limitations.</p> <p>I am trying to send some graphics files to the printer and when I drop the file on my printer driver ...
[ { "answer_id": 141087, "author": "Vincent McNabb", "author_id": 16299, "author_profile": "https://Stackoverflow.com/users/16299", "pm_score": 3, "selected": true, "text": "mspaint /p filename mspaint /pt filename /wia" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/141052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178/" ]
141,068
<p>I have an Image column (Allow Null = true) in SQL Server 2005. I am using Crystal Reports designer (ver 10.5) that comes with Visual Studio 2008. Crystal sees the column as blob field and puts an image object for the column. When I am trying to limit the record selection by using </p> <pre><code> NOT ISNULL({Empl...
[ { "answer_id": 268068, "author": "David T. Macknet", "author_id": 6850, "author_profile": "https://Stackoverflow.com/users/6850", "pm_score": 1, "selected": false, "text": "ISNULL SWITCH WHERE NOT Employee.Picture IS NULL\n IS NULL" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/141068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18169/" ]
141,088
<p>I've seen a few different ways to iterate over a dictionary in C#. Is there a standard way?</p>
[ { "answer_id": 141098, "author": "Pablo Fernandez", "author_id": 7595, "author_profile": "https://Stackoverflow.com/users/7595", "pm_score": 13, "selected": true, "text": "foreach(KeyValuePair<string, string> entry in myDictionary)\n{\n // do something with entry.Value or entry.Key\n}...
2008/09/26
[ "https://Stackoverflow.com/questions/141088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9311/" ]
141,108
<p>Is it possible to find the <code>foreach</code> index?</p> <p>in a <code>for</code> loop as follows:</p> <pre><code>for ($i = 0; $i &lt; 10; ++$i) { echo $i . ' '; } </code></pre> <p><code>$i</code> will give you the index.</p> <p>Do I have to use the <code>for</code> loop or is there some way to get the inde...
[ { "answer_id": 141114, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 11, "selected": true, "text": "foreach($array as $key=>$value) {\n // do stuff\n}\n $key $array" }, { "answer_id": 141117, "author": "Ólafur Wa...
2008/09/26
[ "https://Stackoverflow.com/questions/141108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18334/" ]
141,126
<p>What is important to keep in mind when designing a database?</p> <p>I don't want to limit your answer to my needs as I am sure that others can benefit from your insights as well. But I am planning a content management system for a multi-client community driven site.</p>
[ { "answer_id": 141226, "author": "jalbert", "author_id": 1360388, "author_profile": "https://Stackoverflow.com/users/1360388", "pm_score": 4, "selected": false, "text": "CHECK NOT NULL FOREIGN KEY PRIMARY KEY DEFAULT" } ]
2008/09/26
[ "https://Stackoverflow.com/questions/141126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19226/" ]
141,128
<p>Does TCP/IP prevent multiple copies of the same packet from reaching the destination? Or is it up to the endpoint to layer idempotency logic above it?</p> <p>Please reference specific paragraphs from the TCP/IP specification if possible.</p>
[ { "answer_id": 863227, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "/// <summary>\n/// Combination of a double-linked-list and a hashset with a max bound; \n/// Works like a bounded queue where ...
2008/09/26
[ "https://Stackoverflow.com/questions/141128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14731/" ]
141,136
<p>I have a .net 2.0 ascx control with a start time and end time textboxes. The data is as follows: </p> <p>txtStart.Text = 09/19/2008 07:00:00</p> <p>txtEnd.Text = 09/19/2008 05:00:00</p> <p>I would like to calculate the total time (hours and minutes) in JavaScript then display it in a textbox on the page. </p>
[ { "answer_id": 141159, "author": "ConroyP", "author_id": 2287, "author_profile": "https://Stackoverflow.com/users/2287", "pm_score": 4, "selected": true, "text": "stringToDate getTime() stringToDate: function(string) {\n var matches;\n if (matches = string.match(/^(\\d{4,4})-(\\d{2...
2008/09/26
[ "https://Stackoverflow.com/questions/141136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4096/" ]
141,140
<p>The following method does not work because the inner block declares a variable of the same name as one in the outer block. Apparently variables belong to the method or class in which they are declared, not to the block in which they are declared, so I therefore can't write a short little temporary block for debuggin...
[ { "answer_id": 141289, "author": "Ricardo Massaro", "author_id": 98102, "author_profile": "https://Stackoverflow.com/users/98102", "pm_score": 5, "selected": false, "text": "void methodName() {\n for (int j = 0; j < 10; j++) {\n int i = j * 2;\n }\n System.out.println(i); // error\...
2008/09/26
[ "https://Stackoverflow.com/questions/141140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18103/" ]
141,146
<p>I want to know if my server is running Subversion 1.5.</p> <p>How can I find that out?</p> <p>Also would be nice to know my SVN client version number. <code>svn help</code> hasn't been helpful.</p> <p><strong>Note:</strong> I don't want my <em>project's</em> revision number, etc. This question is about the <em>Su...
[ { "answer_id": 141479, "author": "PiedPiper", "author_id": 19315, "author_profile": "https://Stackoverflow.com/users/19315", "pm_score": 5, "selected": false, "text": "`svn --version`\n" }, { "answer_id": 142061, "author": "Milen A. Radev", "author_id": 15785, "author...
2008/09/26
[ "https://Stackoverflow.com/questions/141146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
141,154
<p>I'm trying to determine what instances of sql server/sql express I have installed (either manually or programmatically) but all of the examples are telling me to run a SQL query to determine this which assumes I'm already connected to a particular instance.</p>
[ { "answer_id": 141166, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "https://Stackoverflow.com/users/3153", "pm_score": 6, "selected": false, "text": "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\90\\Tools\\ClientSetup\\CurrentVersion\n HKEY_LOCAL_MA...
2008/09/26
[ "https://Stackoverflow.com/questions/141154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327/" ]
141,162
<p>I need to see if a given process id is running, and it must work in either Java or JRuby (preferably a Ruby solution). It can be system dependent for Linux (specifically Debian and/or Ubuntu).</p> <p>I already have the PID I am looking for, just need to see if it is currently running.</p> <hr> <p>UPDATE:</p> <p...
[ { "answer_id": 141663, "author": "Bribles", "author_id": 5916, "author_profile": "https://Stackoverflow.com/users/5916", "pm_score": 0, "selected": false, "text": "def pid_exists? (pid)\n system \"ps -p #{pid} > /dev/null\"\n return $? == 0\nend\n" }, { "answer_id": 141731,...
2008/09/26
[ "https://Stackoverflow.com/questions/141162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122/" ]