qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
183,114
<p>I have a folder that is my working copy. How do I remove all SVN functionality from this folder? There is a reason for me doing this, somehow my master folder that contains all my working copies of sites, has somehow been turned into a working copy itself, so I have a working copy within itself as such.</p> <p>So, ...
[ { "answer_id": 183193, "author": "Scott Kramer", "author_id": 3522, "author_profile": "https://Stackoverflow.com/users/3522", "pm_score": 2, "selected": false, "text": "for /f \"tokens=* delims=\" %%i in ('dir /s /b /a:d \".svn\"') do rd /s /q \"%%i\"\n" }, { "answer_id": 189805,...
2008/10/08
[ "https://Stackoverflow.com/questions/183114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26107/" ]
183,115
<p>I'm writing a shell script to do some web server configuration. I need to disable all currently active virtual hosts. <code>a2dissite</code> doesn't accept multiple arguments, so I can't do</p> <pre><code>a2dissite `ls /etc/apache2/sites-enabled` </code></pre> <p>Should I use <code>find</code>? Is it safe to manua...
[ { "answer_id": 183188, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 5, "selected": true, "text": " find /etc/apache2/sites-enabled/ -type l -exec rm -i \"{}\" \\;\n" }, { "answer_id": 183210, "author": "...
2008/10/08
[ "https://Stackoverflow.com/questions/183115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3757/" ]
183,118
<p>I've got an application that is very graphics intensive and built on DirectX and Windows Forms. It has an automation and replay framework around which is built an automated testing system. Unfortunately, when the tests run unattended during a nightly build, the display is inactive or tied up with the screensaver, an...
[ { "answer_id": 183354, "author": "korona", "author_id": 25731, "author_profile": "https://Stackoverflow.com/users/25731", "pm_score": 0, "selected": false, "text": "GetDIBits" }, { "answer_id": 186255, "author": "faulty", "author_id": 20007, "author_profile": "https:/...
2008/10/08
[ "https://Stackoverflow.com/questions/183118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1382162/" ]
183,124
<p>I need to generate multiple random values under SQL Server 2005 and somehow this simply wont work</p> <pre><code>with Random(Value) as ( select rand() Value union all select rand() from Random )select top 10 * from Random </code></pre> <p>Whats the preffered workaround?</p>
[ { "answer_id": 183138, "author": "Torbjörn Gyllebring", "author_id": 21182, "author_profile": "https://Stackoverflow.com/users/21182", "pm_score": 0, "selected": false, "text": "with Random(Value) as\n(\n select rand(checksum(newid())) Value\n union all\n select rand(checksu...
2008/10/08
[ "https://Stackoverflow.com/questions/183124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21182/" ]
183,153
<p>We are using Visual Studio 2008 as our primary development IDE. Our security team has set up McAfee to scan files in our \Local Settings\Temp folder. Unfortunately VS uses this directory during code builds which is slowing the developers down. We've reached an impasse with the security team on this, and wonder if...
[ { "answer_id": 1255303, "author": "Cory Grimster", "author_id": 69104, "author_profile": "https://Stackoverflow.com/users/69104", "pm_score": 3, "selected": false, "text": "<compilation debug=\"true\" tempDirectory=\"C:\\Foo\">\n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/183153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26165/" ]
183,161
<p>What's the best way to break from nested loops in Javascript?</p> <pre><code>//Write the links to the page. for (var x = 0; x &lt; Args.length; x++) { for (var Heading in Navigation.Headings) { for (var Item in Navigation.Headings[Heading]) { if (Args[x] == Navigation.Headings[Heading][It...
[ { "answer_id": 183168, "author": "swilliams", "author_id": 736, "author_profile": "https://Stackoverflow.com/users/736", "pm_score": 8, "selected": false, "text": "return" }, { "answer_id": 183197, "author": "ephemient", "author_id": 20713, "author_profile": "https://...
2008/10/08
[ "https://Stackoverflow.com/questions/183161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13227/" ]
183,179
<p>I have a table that is created in a DataList in ASP.Net. This table has three fields of text, then a field with an edit button, and a field with a delete button. When a person clicks the delete button, it posts back, deletes the items, and then binds the DataList again. The DataList is in an UpdatePanel so the item ...
[ { "answer_id": 183257, "author": "Marko Dumic", "author_id": 5817, "author_profile": "https://Stackoverflow.com/users/5817", "pm_score": 0, "selected": false, "text": "$(\"form\").submit(function() {\n\n // if user initiated delete action \n // do your thing with deleted row (effec...
2008/10/08
[ "https://Stackoverflow.com/questions/183179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3226/" ]
183,185
<p>Is it possible to make hibernate do "the right thing" for some value of "right" in this situation?</p> <pre><code>from ClassA a, ClassB b where a.prop = b.prop </code></pre> <p>The thing is that prop is a UserType with different representation in the joined tables. In table A it is represented as an integer and in...
[ { "answer_id": 183436, "author": "Vineet Bhatia", "author_id": 18716, "author_profile": "https://Stackoverflow.com/users/18716", "pm_score": -1, "selected": false, "text": "public boolean equals(Object x, Object y) throws HibernateException {\n boolean retValue = false;\n if (x == ...
2008/10/08
[ "https://Stackoverflow.com/questions/183185", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24243/" ]
183,190
<p>I have one question maybe someone here can help me. If i do "ps aux --sort user" on linux console I have one list of users and their processes runing on the machine. My question is how do I remove the users name and print that list like this <strong>in a C program</strong>:</p> <p>for example:</p> <pre><code>(…) -...
[ { "answer_id": 183200, "author": "bmdhacks", "author_id": 14032, "author_profile": "https://Stackoverflow.com/users/14032", "pm_score": 2, "selected": false, "text": "ps aux --sort user | perl -npe 's/^(\\w+)//g; if ($user ne $1) {$user=$1; print \"user: \" . uc($user) . \"\\n\";}'\n" ...
2008/10/08
[ "https://Stackoverflow.com/questions/183190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
183,201
<p>Oftentimes a developer will be faced with a choice between two possible ways to solve a problem -- one that is idiomatic and readable, and another that is less intuitive, but may perform better. For example, in C-based languages, there are two ways to multiply a number by 2:</p> <pre><code>int SimpleMultiplyBy2(in...
[ { "answer_id": 185394, "author": "Andy Lester", "author_id": 8454, "author_profile": "https://Stackoverflow.com/users/8454", "pm_score": 0, "selected": false, "text": "x*2 x<<1" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/183201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1674/" ]
183,209
<p>I have unmanaged C++ calling a managed delegate via the function pointer provided by Marshal::GetFunctionPointerForDelegate. This delegate has the potential to throw an exception. I need to be able to properly handle this exception in my unmanaged C++ to ensure things like pointer cleanup, and potentially rethrow ...
[ { "answer_id": 183241, "author": "Bert Huijben", "author_id": 2094, "author_profile": "https://Stackoverflow.com/users/2094", "pm_score": 2, "selected": false, "text": "try\n{\n throw gcnew InvalidOperationException();\n}\ncatch(InvalidOperationException^ e)\n{\n // Process e\n throw;...
2008/10/08
[ "https://Stackoverflow.com/questions/183209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24965/" ]
183,214
<p>I'm having some trouble with plain old JavaScript (no frameworks) in referencing my object in a callback function.</p> <pre><code>function foo(id) { this.dom = document.getElementById(id); this.bar = 5; var self = this; this.dom.addEventListener("click", self.onclick, false); } foo.prototype = { ...
[ { "answer_id": 183247, "author": "Sergey Ilinsky", "author_id": 23815, "author_profile": "https://Stackoverflow.com/users/23815", "pm_score": 4, "selected": false, "text": "this.dom.addEventListener(\"click\", function(event) {\n self.onclick(event)\n}, false);\n" }, { "answer...
2008/10/08
[ "https://Stackoverflow.com/questions/183214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18146/" ]
183,231
<p>I'm looking to execute a series of queries as part of a migration project. The scripts to be generated are produced from a tool which analyses the legacy database then produces a script to map each of the old entities to an appropriate new record. THe scripts run well for small entities but some have records in the ...
[ { "answer_id": 183259, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 0, "selected": false, "text": "INSERT" }, { "answer_id": 183756, "author": "Cade Roux", "author_id": 18255, "author_profile": "http...
2008/10/08
[ "https://Stackoverflow.com/questions/183231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
183,249
<p>.Net contains a nice control called <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.documentviewer.aspx" rel="noreferrer"><code>DocumentViewer</code></a>. it also offers a subcontrol for finding text in the loaded document (that's at least what it is supposed to do).</p> <p>When inserting <...
[ { "answer_id": 860709, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "// Add to xaml: <DocumentViewer x:Name=\"documentViewer\" />\n// Add project references to \"ReachFramework\" and \"System.Prin...
2008/10/08
[ "https://Stackoverflow.com/questions/183249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20227/" ]
183,250
<p>I have a c# object with a property called Gender which is declared as a char.</p> <pre><code>private char _Gender; public char Gender { get{ return _Gender; } set{ _Gender = value; } } </code></pre> <p>What string is returned/created when I call MyObject.Gender.ToString()?</p> <p>I ask because I am calli...
[ { "answer_id": 183270, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": false, "text": "string s = c == 0 ? \"\" : c.ToString();\n char? c; // a field\n...\nstring s = c.ToString(); // is \"\"\nc = 'a';\ns...
2008/10/08
[ "https://Stackoverflow.com/questions/183250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1970/" ]
183,254
<p>I'm making my way into web development and have seen the word <strong><em>postback</em></strong> thrown around. Coming from a non-web based background, <strong>what does a new web developer have to know about postbacks? (i.e. what are they and when do they arise?)</strong> </p> <p>Any more information you'd like to...
[ { "answer_id": 183309, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 4, "selected": false, "text": "<form>" }, { "answer_id": 183700, "author": "Chris Cudmore", "author_id": 18907, "author_profile":...
2008/10/08
[ "https://Stackoverflow.com/questions/183254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4916/" ]
183,277
<p>I have an object that I'm passing in a method call. Say I'm using a language that only allows you to pass objects by reference, like Java or PHP. If the method makes changes to the object, it will affect the caller. I don't want this to happen. So it seems like I need to make a copy of the object.</p> <p>My questio...
[ { "answer_id": 183994, "author": "Jeffrey L Whitledge", "author_id": 10174, "author_profile": "https://Stackoverflow.com/users/10174", "pm_score": 0, "selected": false, "text": "void RemoveZeroDollarPayments(Order order)\n Order CloneOrderAndRemoveZeroDollarPaymentsFromClone(Order order)...
2008/10/08
[ "https://Stackoverflow.com/questions/183277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4321/" ]
183,292
<p>Is it possible to specify a Java <code>classpath</code> that includes a JAR file contained within another JAR file?</p>
[ { "answer_id": 7362930, "author": "ecbrodie", "author_id": 814576, "author_profile": "https://Stackoverflow.com/users/814576", "pm_score": 5, "selected": false, "text": "<jar destfile=\"your.jar\" basedir=\"java/dir\">\n ...\n <zipgroupfileset dir=\"dir/of/jars\" />\n</jar>\n" }, {...
2008/10/08
[ "https://Stackoverflow.com/questions/183292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7648/" ]
183,316
<p>How do I go about the <code>[HandleError]</code> filter in asp.net MVC Preview 5?<br> I set the customErrors in my Web.config file</p> <pre><code>&lt;customErrors mode="On" defaultRedirect="Error.aspx"&gt; &lt;error statusCode="403" redirect="NoAccess.htm"/&gt; &lt;error statusCode="404" redirect="FileNotFound....
[ { "answer_id": 192371, "author": "Elijah Manor", "author_id": 4481, "author_profile": "https://Stackoverflow.com/users/4481", "pm_score": 8, "selected": true, "text": "[HandleError]\n [HandleError(ExceptionType = typeof(SqlException), View = \"DatabaseError\")]\n[HandleError(ExceptionTyp...
2008/10/08
[ "https://Stackoverflow.com/questions/183316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
183,325
<p>For some reason, Section 1 works but Section 2 does not. When run in the opposite order (2 before 1), Section 1 (Affiliation) is not run at all. All the data is the same.</p> <pre><code>//Section 1 UserService.DsUserAttributes dsAffiliation = us_service.GetUserAttributeDropDown(systemId, "Affiliation"...
[ { "answer_id": 183357, "author": "bdukes", "author_id": 2688, "author_profile": "https://Stackoverflow.com/users/2688", "pm_score": 3, "selected": true, "text": "us_service.GetUserAttributeDropDown(systemId, \"Country\") dsCountry.tblDropDownValues" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/183325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24565/" ]
183,338
<p>I'm looking for something that will monitor Windows directories for size and file count over time. I'm talking about a handful of servers and a few thousand folders (millions of files).</p> <p>Requirements:</p> <ul> <li>Notification on X increase in size over Y time</li> <li>Notification on X increase in file coun...
[ { "answer_id": 183464, "author": "Steven Murawski", "author_id": 1233, "author_profile": "https://Stackoverflow.com/users/1233", "pm_score": 3, "selected": true, "text": "$size = 0\n$count = 0\n$path = '\\\\unc\\path\\to\\directory\\to\\monitor'\nget-childitem -path $path -recurse | Wher...
2008/10/08
[ "https://Stackoverflow.com/questions/183338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9861/" ]
183,353
<p>Passing an undimensioned array to the VB6's Ubound function will cause an error, so I want to check if it has been dimensioned yet before attempting to check its upper bound. How do I do this?</p>
[ { "answer_id": 183356, "author": "raven", "author_id": 4228, "author_profile": "https://Stackoverflow.com/users/4228", "pm_score": 4, "selected": false, "text": "Dim someArray() As Integer\n\nIf ((Not someArray) = -1) Then\n Debug.Print \"this array is NOT initialized\"\nEnd If\n" }, ...
2008/10/08
[ "https://Stackoverflow.com/questions/183353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4228/" ]
183,367
<p>Is it possible to unsubscribe an anonymous method from an event?</p> <p>If I subscribe to an event like this:</p> <pre><code>void MyMethod() { Console.WriteLine("I did it!"); } MyEvent += MyMethod; </code></pre> <p>I can un-subscribe like this:</p> <pre><code>MyEvent -= MyMethod; </code></pre> <p>But if I ...
[ { "answer_id": 183389, "author": "casademora", "author_id": 5619, "author_profile": "https://Stackoverflow.com/users/5619", "pm_score": 3, "selected": false, "text": "public class SomeClass\n{\n private readonly IList<Action> _eventList = new List<Action>();\n\n ...\n\n public event A...
2008/10/08
[ "https://Stackoverflow.com/questions/183367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2610/" ]
183,369
<p>I'm looking for a XPath library to query over XML documents in FF, IE, Opera and Safari... and couldn't find one. Have you seen any?</p>
[ { "answer_id": 7476028, "author": "Cheeso", "author_id": 48082, "author_profile": "https://Stackoverflow.com/users/48082", "pm_score": 2, "selected": false, "text": "// xpath.js\n// ------------------------------------------------------------------\n//\n// a cross-browser xpath class.\n/...
2008/10/08
[ "https://Stackoverflow.com/questions/183369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26183/" ]
183,391
<p>I have a project where I am taking some particularly ugly "live" HTML and forcing it into a formal XML DOM with the HTML Agility Pack. What I would like to be able to do is then query over this with Linq to XML so that I can scrape out the bits I need. I'm using the method described <a href="http://vijay.screaming...
[ { "answer_id": 183403, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 5, "selected": true, "text": "LocalName var ns = \"{http://www.w3.org/1999/xhtml}\";\nvar x = xDoc.Root.Descendants(ns + \"div\");\n var namespaces = ...
2008/10/08
[ "https://Stackoverflow.com/questions/183391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24608/" ]
183,406
<p>How can I add a line break to text when it is being set as an attribute i.e.:</p> <pre><code>&lt;TextBlock Text="Stuff on line1 \n Stuff on line2" /&gt; </code></pre> <p>Breaking it out into the exploded format isn't an option for my particular situation. What I need is some way to emulate the following:</p> <pr...
[ { "answer_id": 183435, "author": "Bob King", "author_id": 6897, "author_profile": "https://Stackoverflow.com/users/6897", "pm_score": 10, "selected": true, "text": "<TextBlock Text=\"Stuff on line1&#x0a;Stuff on line 2\"/>\n vbCrLf &#x0d;&#x0a;" }, { "answer_id": 541600, "aut...
2008/10/08
[ "https://Stackoverflow.com/questions/183406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/93/" ]
183,407
<p>Code and preview: <img src="https://i.stack.imgur.com/3J6CX.gif" alt="what i have"></p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Testing some CSS&lt;/title&gt; &lt;style type="text/css"&gt; .dDay { font-size:205% } .dMon { font-weight:bold; font-variant:small-caps; font-size:130%; margi...
[ { "answer_id": 183425, "author": "willasaywhat", "author_id": 12234, "author_profile": "https://Stackoverflow.com/users/12234", "pm_score": 3, "selected": true, "text": "<html>\n<head>\n<title>Testing some CSS</title>\n<style type=\"text/css\">\n.dDay {\n font-size:205%\n}\n.dMon {\n ...
2008/10/08
[ "https://Stackoverflow.com/questions/183407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25515/" ]
183,409
<p>Let's say I have a java program that makes an HTTP request on a server using HTTP 1.1 and doesn't close the connection. I make one request, and read all data returned from the input stream I have bound to the socket. However, upon making a second request, I get no response from the server (or there's a problem with...
[ { "answer_id": 183457, "author": "Ates Goral", "author_id": 23501, "author_profile": "https://Stackoverflow.com/users/23501", "pm_score": 0, "selected": false, "text": "Connection: keep-alive Content-Length Content-Length" }, { "answer_id": 185281, "author": "Alexander", ...
2008/10/08
[ "https://Stackoverflow.com/questions/183409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4924/" ]
183,415
<p>A table row is generated using an asp:Repeater:</p> <pre><code>&lt;asp:repeater ID="announcementsRepeater" OnItemDataBound="announcementsRepeater_ItemDataBound" runat="Server"&gt; &lt;itemtemplate&gt; &lt;tr id="announcementRow" class="announcementItem" runat="server"&gt;...&lt;/tr&gt; &lt;/itemtemplate...
[ { "answer_id": 183438, "author": "Geoff", "author_id": 1097, "author_profile": "https://Stackoverflow.com/users/1097", "pm_score": 0, "selected": false, "text": "HtmlTableRow row = (HtmlTableRow)e.Item.FindControl(\"announcementRow\");\n" }, { "answer_id": 183460, "author": "...
2008/10/08
[ "https://Stackoverflow.com/questions/183415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
183,428
<p>I have a batch file that uses this idiom (many times) to read a registry value into an environment variable:</p> <pre><code>FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKLM\SOFTWARE\Path\To\Key" /v ValueName') DO SET MyVariable=%%B </code></pre> <p>(There's a tab character after <code>delims=</code>)</p> <p>...
[ { "answer_id": 183465, "author": "agnul", "author_id": 6069, "author_profile": "https://Stackoverflow.com/users/6069", "pm_score": 0, "selected": false, "text": "/F cmd /e:on\n HKCU\\Software\\Microsoft\\Command Processor\\EnableExtensions\n help for help cmd" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/183428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13012/" ]
183,446
<p>How do I fix that error once and for all? I just want to be able to do unions in MySQL. </p> <p>(I'm looking for a shortcut, like an option to make MySQL ignore that issue or take it's best guess, not looking to change collations on 100s of tables ... at least not today)</p>
[ { "answer_id": 183624, "author": "kristof", "author_id": 3241, "author_profile": "https://Stackoverflow.com/users/3241", "pm_score": 4, "selected": true, "text": "select column1 from tableWithProperCollation\nunion all\nselect column1 COLLATE SQL_Latin1_General_CP1_CI_AS from tableWithDi...
2008/10/08
[ "https://Stackoverflow.com/questions/183446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13009/" ]
183,461
<p>In this particular situation, there are 9 automated steps in a process that take varying lengths of time. We currently have a number showing percentage in the center of a progress bar, but it suffers from the common stop-and-go problem of racing up to 33%, waiting a long time, racing up to 55%, waiting an even longe...
[ { "answer_id": 410730, "author": "Roger Lipscombe", "author_id": 8446, "author_profile": "https://Stackoverflow.com/users/8446", "pm_score": 1, "selected": false, "text": "UserControl ProgressBar inner public partial class ZenoProgressBar : UserControl\n{\n private const int DEFAULT_F...
2008/10/08
[ "https://Stackoverflow.com/questions/183461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23427/" ]
183,480
<p>Still 'diving in' to Python, and want to make sure I'm not overlooking something. I wrote a script that extracts files from several zip files, and saves the extracted files together in one directory. To prevent duplicate filenames from being over-written, I wrote this little function - and I'm just wondering if ther...
[ { "answer_id": 183528, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 2, "selected": false, "text": "base_name, ext = os.path.splitext(file_name) \n file_name = \"%s_%d%s\" % (base_name, str(counter), ext)\n" }, { "a...
2008/10/08
[ "https://Stackoverflow.com/questions/183480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26196/" ]
183,485
<p>I need to convert the punycode <code>NIATO-OTABD</code> to <code>nñiñatoñ</code>.</p> <p>I found <a href="http://0xcc.net/jsescape/" rel="noreferrer">a text converter in JavaScript</a> the other day, but the punycode conversion doesn't work if there's a dash in the middle.</p> <p>Any suggestion to fix the "dash" i...
[ { "answer_id": 301287, "author": "some", "author_id": 36866, "author_profile": "https://Stackoverflow.com/users/36866", "pm_score": 7, "selected": true, "text": "xn-- utf16-class ToASCII ToUnicode //Javascript Punycode converter derived from example in RFC3492.\n//This implementation is ...
2008/10/08
[ "https://Stackoverflow.com/questions/183485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23520/" ]
183,488
<p>We are doing some performance tests on our website and we are getting the following error a lot:</p> <pre><code>*** 'C:\inetpub\foo.plex' log message at: 2008/10/07 13:19:58 DBD::ODBC::st execute failed: [Microsoft][SQL Native Client]String data, right truncation (SQL-22001) at C:\inetpub\foo.plex line 25. </code><...
[ { "answer_id": 183518, "author": "Chris Driver", "author_id": 5217, "author_profile": "https://Stackoverflow.com/users/5217", "pm_score": 6, "selected": true, "text": "ZIP_CODE ZIP_CODE CITY CITY ?" }, { "answer_id": 72255401, "author": "luca.vercelli", "author_id": 51163...
2008/10/08
[ "https://Stackoverflow.com/questions/183488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12448/" ]
183,496
<p>I've recently come across this piece of JavaScript code:</p> <pre><code>if (",&gt;=,&lt;=,&lt;&gt;,".indexOf("," + sCompOp + ",") != -1) </code></pre> <p>I was intrigued, because to write this test I would have done:</p> <pre><code>if (/(&gt;=|&lt;=|&lt;&gt;)/.test(sCompOp)) </code></pre> <p>Is this just a styli...
[ { "answer_id": 183645, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 5, "selected": true, "text": "sCompOp sCompOp sCompOp /^(>=|<=|<>)$/\n function Time(fn, iter)\n{\n var start = new Date();\n for (var i=0; i<iter; ++i)\n ...
2008/10/08
[ "https://Stackoverflow.com/questions/183496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12559/" ]
183,499
<p>One of the things that always bugs me about using Readers and Streams in Java is that the <code>close()</code> method can throw an exception. Since it's a good idea to put the close method in a finally block, that necessitates a bit of an awkward situation. I usually use this construction:</p> <pre><code>FileReader...
[ { "answer_id": 183520, "author": "Steve B.", "author_id": 19479, "author_profile": "https://Stackoverflow.com/users/19479", "pm_score": 1, "selected": false, "text": "try\n{\n try{\n ...\n }\n catch(IOException e)\n {\n ..\n }\n}\ncatch(Exception e)\n{\n // we could read, but n...
2008/10/08
[ "https://Stackoverflow.com/questions/183499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23669/" ]
183,527
<p>I have a dtsx package with a precedence constraint that evaluates an expression and a constraint. The constraint is "success" and the expression is "@myVariable" == 3. myVariable is an int32, and when set in Visual Studio's design GUI the package executes fine. There are two other paths that check for the value t...
[ { "answer_id": 195183, "author": "Michael Entin", "author_id": 19880, "author_profile": "https://Stackoverflow.com/users/19880", "pm_score": 1, "selected": false, "text": "dtexec ... /SET \\Package.Variables[User::myVariable].Value;3\n .Value .Properties[Value] .Value .Properties[Value]"...
2008/10/08
[ "https://Stackoverflow.com/questions/183527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26197/" ]
183,532
<p>I would like to ask for some simple examples showing the uses of <code>&lt;div&gt;</code> and <code>&lt;span&gt;</code>. I've seen them both used to mark a section of a page with an <code>id</code> or <code>class</code>, but I'm interested in knowing if there are times when one is preferred over the other.</p>
[ { "answer_id": 183535, "author": "Jason Bunting", "author_id": 1790, "author_profile": "https://Stackoverflow.com/users/1790", "pm_score": 6, "selected": false, "text": "<div> <span> <span> <div> <div> <div id=\"Chapter1\">\n <p>Lorem ipsum dolor sit amet, <span id=\"SomeSpecialText1\"...
2008/10/08
[ "https://Stackoverflow.com/questions/183532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3676/" ]
183,560
<p>I have been trying to use the Perl utility/module &quot;prove&quot; as a test harness for some unit tests. The unit tests are a little more &quot;system&quot; than &quot;unit&quot; as I need to fork off some background processes as part of the test, Using the following...</p> <pre><code>sub SpinupMonitor{ my $bas...
[ { "answer_id": 183673, "author": "Kyle", "author_id": 2237619, "author_profile": "https://Stackoverflow.com/users/2237619", "pm_score": 4, "selected": false, "text": "fork() $pid $cmd exec() sh -c monitor_real.pl KillMonitor" }, { "answer_id": 184929, "author": "Tanktalus", ...
2008/10/08
[ "https://Stackoverflow.com/questions/183560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3720/" ]
183,567
<p>I have a User class which may or may not have an associated Department. This is referenced through the foreign key DepartmentId, and the relevant field in the User table is set to allow nulls.</p> <p>When I set up my "Create User" form and select no Department, I get a conflict error on SubmitChanges():</p> <pre>...
[ { "answer_id": 183639, "author": "tags2k", "author_id": 192, "author_profile": "https://Stackoverflow.com/users/192", "pm_score": 2, "selected": true, "text": "UsersController.Create // Snipped UpdateModel call\nif (form[\"User.DepartmentId\"].Length == 0)\n{\n createdUser.DepartmentI...
2008/10/08
[ "https://Stackoverflow.com/questions/183567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192/" ]
183,578
<p>I am trying to install newgem on my linux box (sudo gem install newgem) and i am getting the following error:</p> <pre><code>Building native extensions. This could take a while... ERROR: Error installing newgem: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb install newgem extconf.rb:1:...
[ { "answer_id": 183875, "author": "ephemient", "author_id": 20713, "author_profile": "https://Stackoverflow.com/users/20713", "pm_score": 4, "selected": true, "text": "mkmf ruby1.8-dev mkmf.rb ruby -e'print $:.join(\"\\n\")'" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/183578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18811/" ]
183,585
<p>I'm moving DB from MySQL (used ODBC) to MS SQL and I want to "translate" SQL queries to LINQ. Can someone help me with this (it should SUM Charge column for every location and group result by months):</p> <pre><code>SELECT sum(case when Location="Location1" then Charge else 0 end) as Location1, sum(case when Locati...
[ { "answer_id": 184032, "author": "Amy B", "author_id": 8155, "author_profile": "https://Stackoverflow.com/users/8155", "pm_score": 4, "selected": true, "text": "context.log_sales\n.GroupBy(s => new {Year = OrderTime.Year, Month = OrderTime.Month})\n.Select\n( g => new {\n Date = new Dat...
2008/10/08
[ "https://Stackoverflow.com/questions/183585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23280/" ]
183,589
<p>I'm currently in the process of writing my first Windows Forms application. I've read a few C# books now so I've got a relatively good understanding of what language features C# has to deal with exceptions. They're all quite theoretical however so what I haven't got yet is a feel for how to translate the basic conce...
[ { "answer_id": 183626, "author": "Echostorm", "author_id": 12862, "author_profile": "https://Stackoverflow.com/users/12862", "pm_score": 2, "selected": false, "text": "void Main()\n{\n try {\n DoStuff();\n }\n catch(Exception ex) {\n LogStuff(ex.ToString());\n }\n\nvoid DoStuff...
2008/10/08
[ "https://Stackoverflow.com/questions/183589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4019/" ]
183,604
<p>Let's say I'm writing a Library application for a publishing company who already has a People application.</p> <p>So in my Library application I have</p> <pre><code>class Person &lt; ActiveResource::Base self.site = "http://api.people.mypublisher.com/" end </code></pre> <p>and now I want to store <code>Article<...
[ { "answer_id": 183617, "author": "James A. Rosen", "author_id": 1190, "author_profile": "https://Stackoverflow.com/users/1190", "pm_score": 3, "selected": false, "text": "class Person < ActiveResource::Base\n self.site = \"http://api.people.mypublisher.com/\"\n\n def articles\n Arti...
2008/10/08
[ "https://Stackoverflow.com/questions/183604", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1190/" ]
183,606
<p>In the <a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml" rel="noreferrer">Google C++ Style Guide</a>, the <a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Operator_Overloading" rel="noreferrer">section on Operator Overloading</a> recommends against overloading <em>any</e...
[ { "answer_id": 183653, "author": "James Curran", "author_id": 12725, "author_profile": "https://Stackoverflow.com/users/12725", "pm_score": 3, "selected": false, "text": "class MyClass {....}\n\nclass LessThanMyClass : std:binary_function<MyClass, MyClass, bool>\n{\n public bool opera...
2008/10/08
[ "https://Stackoverflow.com/questions/183606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12193/" ]
183,622
<p>I need to compare strings in shell:</p> <pre><code>var1="mtu eth0" if [ "$var1" == "mtu *" ] then # do something fi </code></pre> <p>But obviously the "*" doesn't work in Shell. Is there a way to do it?</p>
[ { "answer_id": 183647, "author": "ephemient", "author_id": 20713, "author_profile": "https://Stackoverflow.com/users/20713", "pm_score": 4, "selected": true, "text": "bash if [[ \"$var1\" = \"mtu \"* ]]\n [[ ]] [ ] bash --posix if [ \"${var1:0:4}\" == \"mtu \" ]\n ${var1:0:4} $var1 /bin/...
2008/10/08
[ "https://Stackoverflow.com/questions/183622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23420/" ]
183,636
<p>Is there a way to select manually a node in virtualizing TreeView and then bring it into view?</p> <p>The data model I'm using with my TreeView is implemented based on the VM-M-V model. Each TreeViewItem's IsSelected property is binded to a corresponing property in ViewModel. I've also created a listener for TreeVi...
[ { "answer_id": 183687, "author": "Micah", "author_id": 17744, "author_profile": "https://Stackoverflow.com/users/17744", "pm_score": 0, "selected": false, "text": " {\n\n Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background,\n\n (System.Windo...
2008/10/08
[ "https://Stackoverflow.com/questions/183636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19982/" ]
183,638
<p>I have this code that performs an ajax call and loads the results into two duplicate divs every time a dropdown is changed. I want the results to be faded into the div, to give a more obvious indication that something has changed, as its so seamless its sometimes hard to notice the change!</p> <pre><code>print("$('...
[ { "answer_id": 183644, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 7, "selected": true, "text": "hide() fadeIn() $(\"#charges-gsm-faq\").hide().html(html).fadeIn();\n$(\"#charges-gsm-prices\").hide().html(html).fad...
2008/10/08
[ "https://Stackoverflow.com/questions/183638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26107/" ]
183,642
<pre><code>select distinct constraint_type from user_constraints; C - C P R U </code></pre> <p>Seems P means primary key and R means foreign key, correct? What are U and C? </p>
[ { "answer_id": 183664, "author": "dacracot", "author_id": 13930, "author_profile": "https://Stackoverflow.com/users/13930", "pm_score": 7, "selected": true, "text": "Code Description Acts On Level\n---------------------------------------------\nC Check on a table ...
2008/10/08
[ "https://Stackoverflow.com/questions/183642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13930/" ]
183,675
<p>my goal is to write a stored proc that can collect all field values from multiple rows into one single output variable (maybe varchar(some_length)). It may seem strange solution but i've quite positive its the only one i can use at that situation im in. I have not used Firebird before and stored procs look way diffe...
[ { "answer_id": 184142, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 4, "selected": true, "text": "SET TERM !!;\nCREATE PROCEDURE concat_names\n RETURNS (concat VARCHAR(2000))\nAS\nDECLARE VARIABLE name VARCHAR(100);\...
2008/10/08
[ "https://Stackoverflow.com/questions/183675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26207/" ]
183,685
<p>Does anyone know if there is a good equivalent to Java's <code>Set</code> collection in C#? I know that you can somewhat mimic a set using a <code>Dictionary</code> or a <code>HashTable</code> by populating but ignoring the values, but that's not a very elegant way. </p>
[ { "answer_id": 183696, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 9, "selected": false, "text": "HashSet<T>" }, { "answer_id": 1801031, "author": "thecoop", "author_id": 79439, "author_profile": "h...
2008/10/08
[ "https://Stackoverflow.com/questions/183685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20400/" ]
183,686
<p>Whenever I restore a backup of my database in SQL Server I am presented with the following error:</p> <pre><code>Msg 3101, Level 16, State 1, Line 1 Exclusive access could not be obtained because the database is in use. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally. </code></pre> <...
[ { "answer_id": 183754, "author": "mattlant", "author_id": 14642, "author_profile": "https://Stackoverflow.com/users/14642", "pm_score": 5, "selected": true, "text": "EXEC sp_dboption N'yourDatabase', N'offline', N'true'\n ALTER DATABASE [yourDatabase] SET OFFLINE WITH\nROLLBACK AFTER 60 ...
2008/10/08
[ "https://Stackoverflow.com/questions/183686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/648/" ]
183,698
<p>I'm using DB2, although a solution using any flavor of SQL would likely be easy enough for me to convert.</p> <p>I didn't design this database, or the application that uses the database. I haven't the power to change this application, how it works, or the data. Because it defies what I consider to be conventional...
[ { "answer_id": 183718, "author": "Kip", "author_id": 18511, "author_profile": "https://Stackoverflow.com/users/18511", "pm_score": 2, "selected": false, "text": "SELECT * FROM table_name\nWHERE START_DATE < '7/1/2005' AND (END_DATE > '7/1/2005' OR END_DATE IS NULL);\n" }, { "answ...
2008/10/08
[ "https://Stackoverflow.com/questions/183698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4606/" ]
183,702
<p>Something like</p> <pre><code>var life= { users : { guys : function(){ this.SOMETHING.mameAndDestroy(this.girls); }, girls : function(){ this.SOMETHING.kiss(this.boys); }, }, mameAndDestroy : function(group){ }, kiss : function(group){ } }; </code></pre> <p...
[ { "answer_id": 183737, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 4, "selected": false, "text": "life life parent var death = { residents : life.users };\nlife.users.smallFurryCreaturesFromAlphaCentauri = { exist : function()...
2008/10/08
[ "https://Stackoverflow.com/questions/183702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1825034/" ]
183,742
<p>Let's look at an example - books. A book can have 1..n authors. An author can have 1..m books. What is a good way to represent all of the authors of a book?</p> <p>I came up with an idea to create a Books table and an Authors table. The Authors table has a primary AuthorID key the author's name. The Books table has...
[ { "answer_id": 11609545, "author": "dakhota", "author_id": 946792, "author_profile": "https://Stackoverflow.com/users/946792", "pm_score": 0, "selected": false, "text": "create table books (\n book_id integer primary key,\n title varchar not null\n);\n\ncreate table aliases (\n alias_...
2008/10/08
[ "https://Stackoverflow.com/questions/183742", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
183,773
<p>A program receives a list of Messages (base type). Each message in the list has to be processed according to it's type (descendant type). However, different messages need different inputs in order to be processed correctly.</p> <p>What is the following technique called? (I haven't checked this code in a compiler...
[ { "answer_id": 183836, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 4, "selected": true, "text": "abstract class MessageProcessorFactory\n { public abstract MessageProcessor GetProcessor\n ...
2008/10/08
[ "https://Stackoverflow.com/questions/183773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9825/" ]
183,780
<p>What would you consider best practice for organizing JUnit tests in a project, and why? For example, do you keep your tests next to the classes they test? Do you put them in a separate but parallel package structure? Do you use a different organization strategy entirely?</p>
[ { "answer_id": 184056, "author": "Aleksandar Dimitrov", "author_id": 11797, "author_profile": "https://Stackoverflow.com/users/11797", "pm_score": 3, "selected": false, "text": "mvn archetype:create -DgroupId=com.yoyodyne -DartifactId=UberApp\n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/183780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4287/" ]
183,783
<p>I have a database driven website serving about 50,000 pages.</p> <p>I want to track each webpage/record hit. I will do this by creating logs, and then batch processing the logs once a day. I am not concerned with how I will do the batch process, only with the quickest way to log.</p> <p>How would you log, which do...
[ { "answer_id": 183828, "author": "Richard Harrison", "author_id": 19624, "author_profile": "https://Stackoverflow.com/users/19624", "pm_score": 2, "selected": false, "text": "DB time: 2.1695\nDB time: 2.3869\nDB time: 2.4305\nDB time: 2.5864\nDB time: 2.7465\nDB time: 3.0182\nDB time: 3....
2008/10/08
[ "https://Stackoverflow.com/questions/183783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
183,788
<p>I've worked on many projects where I've been given code by others to update. More often than not I compile it and get about 1,000+ compiler warnings. When I see compiler warnings they make me feel dirty, so my first task is to clean up the code and remove them all. Typically I find about a dozen problems like uninit...
[ { "answer_id": 183884, "author": "jwfearn", "author_id": 10559, "author_profile": "https://Stackoverflow.com/users/10559", "pm_score": 4, "selected": false, "text": "#pragma typedef struct _X * X; // from external header, not 64-bit portable\n\n#pragma warning( push )\n#pragma warning( d...
2008/10/08
[ "https://Stackoverflow.com/questions/183788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13676/" ]
183,791
<p>I have two collections which have property <code>Email</code> in both collections. I need to get a list of the items in the first list where <code>Email</code> does not exist in the second list. With SQL I would just use "not in", but I do not know the equivalent in LINQ. How is that done?</p> <p>So far I have a jo...
[ { "answer_id": 183804, "author": "Robert Rouse", "author_id": 25129, "author_profile": "https://Stackoverflow.com/users/25129", "pm_score": 9, "selected": true, "text": "NorthwindDataContext dc = new NorthwindDataContext(); \ndc.Log = Console.Out;\n\nvar query = \n from c in dc....
2008/10/08
[ "https://Stackoverflow.com/questions/183791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10366/" ]
183,830
<p>I'm writing a Java app that is accepting URL parameter values that may or may not be encoded. I need an easy way to tell whether or not I need to encode the parameter string.</p> <p>In other words, I want a function <code>boolean needsEncoding(String param)</code>, which will return true if I pass in the String "f...
[ { "answer_id": 184664, "author": "shadit", "author_id": 9925, "author_profile": "https://Stackoverflow.com/users/9925", "pm_score": 0, "selected": false, "text": "java.net.URLDecoder URLDecoder boolean boolean URLDecoder" }, { "answer_id": 24109456, "author": "Mike", "aut...
2008/10/08
[ "https://Stackoverflow.com/questions/183830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8217/" ]
183,853
<p>Is there a benefit to using one over the other? In Python 2, they both seem to return the same results:</p> <pre><code>&gt;&gt;&gt; 6/3 2 &gt;&gt;&gt; 6//3 2 </code></pre>
[ { "answer_id": 183863, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 3, "selected": false, "text": "//" }, { "answer_id": 183865, "author": "Mark Roddy", "author_id": 9940, "author_profile": "http...
2008/10/08
[ "https://Stackoverflow.com/questions/183853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872/" ]
183,856
<p>Is there any way to clean up this type of loop using LINQ?</p> <pre><code> List&lt;Car&gt; result; List&lt;string&gt; makes; List&lt;string&gt; models; for (int i = 0; i &lt; makes.Count() &amp;&amp; i &lt; models.Count(); i++) { result.Add(new Car() { Make = makes[i], Model = models[i] }); } </code...
[ { "answer_id": 183891, "author": "Bradley Grainger", "author_id": 23633, "author_profile": "https://Stackoverflow.com/users/23633", "pm_score": 4, "selected": true, "text": "Enumerable.Range List<Car> result = Enumerable.Range(0, Math.Min(makes.Count, models.Count))\n .Select(i => new...
2008/10/08
[ "https://Stackoverflow.com/questions/183856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327/" ]
183,859
<p>Our base Masterpage has something like the following</p> <pre><code> &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;script type="text/javascript" src="&lt;%= Page.ResolveClientURL("~/javascript/actions.js")%&gt;"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;%= Page.ResolveCl...
[ { "answer_id": 183905, "author": "Shawn Miller", "author_id": 247, "author_profile": "https://Stackoverflow.com/users/247", "pm_score": 3, "selected": false, "text": "<script type=\"text/javascript\" src='<%= Page.ResolveClientUrl(\"~/javascript/actions.js\") %>'></script>\n" }, { ...
2008/10/08
[ "https://Stackoverflow.com/questions/183859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439/" ]
183,881
<p>I'm working on a home project that involves comparing images to a database of images (using a quadrant - or so - histogram approach). I wanted to know what my options are in regards to web cams or other image capture devices that:</p> <ul> <li>Are easy to work with with the Windows SDK (particularly <a href="http:...
[ { "answer_id": 183905, "author": "Shawn Miller", "author_id": 247, "author_profile": "https://Stackoverflow.com/users/247", "pm_score": 3, "selected": false, "text": "<script type=\"text/javascript\" src='<%= Page.ResolveClientUrl(\"~/javascript/actions.js\") %>'></script>\n" }, { ...
2008/10/08
[ "https://Stackoverflow.com/questions/183881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5645/" ]
183,882
<p>I'm currently in the process of choosing a project for a grad-level compiler course to be done over the next 8 weeks. I'd like to do something related to optimization since I haven't worked much in that area before, but anything in the field is fair game. </p> <p>What was the most interesting compiler-related proje...
[ { "answer_id": 184156, "author": "leppie", "author_id": 15541, "author_profile": "https://Stackoverflow.com/users/15541", "pm_score": 2, "selected": false, "text": ":)" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/183882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1891/" ]
183,887
<p>Every once in a while, typically when I stop debugging in our UI assembly, I get the following error which requires a restart of Visual Studio 2008 and it's killing my productivity:</p> <blockquote> <p>Error 13 Unable to copy file [UI assembly] to [output directory]. The process cannot access the file ...
[ { "answer_id": 550359, "author": "Bryan", "author_id": 22033, "author_profile": "https://Stackoverflow.com/users/22033", "pm_score": 1, "selected": false, "text": "<hostingEnvironment shadowCopyBinAssemblies=\"false\"/>\n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/183887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549/" ]
183,898
<p>How do I do forward referencing / declaration in C++ to avoid circular header file references?</p> <p>I have the #ifndef guard in the header file, yet memory tells me I need this forward referencing thing - which i've used before >&lt; but can't remember how. </p>
[ { "answer_id": 183908, "author": "antik", "author_id": 1625, "author_profile": "https://Stackoverflow.com/users/1625", "pm_score": 5, "selected": true, "text": "//#include \"Foo.h\" // including Foo.h causes circular reference\nclass Foo;\n\nclass Bar\n{\n...\n};\n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/183898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/209/" ]
183,901
<p>Is there a way to start PowerShell in a specific folder from Windows Explorer, e.g. to right-click in a folder and have an option like "Open PowerShell in this Folder"?</p> <p>It's really annoying to have to change directories to my project folder the first time I run MSBuild every day.</p>
[ { "answer_id": 183955, "author": "EBGreen", "author_id": 1358, "author_profile": "https://Stackoverflow.com/users/1358", "pm_score": 7, "selected": false, "text": "ii .\n start .\n" }, { "answer_id": 6599296, "author": "Ashwin Nanjappa", "author_id": 1630, "author_pro...
2008/10/08
[ "https://Stackoverflow.com/questions/183901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549/" ]
183,904
<p>In the following code below:</p> <pre><code>Image img = new Image(); img.Source = new BitmapImage(new Uri("http://someURL/somefilename.jpg", UriKind.Absolute)); </code></pre> <p>how can I determine if the image successfully loaded (when there's a valid URI)? i.e., The URI is a valid format, but the file may not ex...
[ { "answer_id": 184069, "author": "Joel B Fant", "author_id": 22211, "author_profile": "https://Stackoverflow.com/users/22211", "pm_score": 1, "selected": false, "text": "Image ImageFailed BitmapSource BitmapImage IsDownloading DownloadProgress DownloadCompleted DownloadFailed" }, { ...
2008/10/08
[ "https://Stackoverflow.com/questions/183904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26218/" ]
183,907
<p>Say you've loaded a text file into a string, and you'd like to convert all Unicode escapes into actual Unicode characters inside of the string. </p> <p>Example:</p> <blockquote> <p>"The following is the top half of an integral character in Unicode '\u2320', and this is the lower half '\U2321'."</p> </blockquote>...
[ { "answer_id": 183909, "author": "jr.", "author_id": 2415, "author_profile": "https://Stackoverflow.com/users/2415", "pm_score": 7, "selected": true, "text": "Regex rx = new Regex( @\"\\\\[uU]([0-9A-F]{4})\" );\nresult = rx.Replace( result, match => ((char) Int32.Parse(match.Value.Subst...
2008/10/08
[ "https://Stackoverflow.com/questions/183907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2415/" ]
183,914
<pre><code>echo $_POST["name"]; //returns the value a user typed into the "name" field </code></pre> <p>I would like to be able to also return the text of the key. In this example, I want to return the text "name". Can I do this?</p>
[ { "answer_id": 183917, "author": "Matthias Winkelmann", "author_id": 4494, "author_profile": "https://Stackoverflow.com/users/4494", "pm_score": 1, "selected": false, "text": "array_keys($_POST)\n" }, { "answer_id": 184104, "author": "Mark Biek", "author_id": 305, "au...
2008/10/08
[ "https://Stackoverflow.com/questions/183914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16292/" ]
183,921
<p>I'd like all queries like</p> <pre><code>http://mysite.com/something/otherthing?foo=bar&amp;x=y </code></pre> <p>to be rewritten as</p> <pre><code>http://mysite.com/something/otherthing.php?foo=bar&amp;x=y </code></pre> <p>In other words, just make the .php extension optional, universally.</p>
[ { "answer_id": 183931, "author": "theraccoonbear", "author_id": 7210, "author_profile": "https://Stackoverflow.com/users/7210", "pm_score": 0, "selected": false, "text": "RewriteRule /something/(.+)?(.+) /something/$1.php?$2\n" }, { "answer_id": 183969, "author": "dreeves", ...
2008/10/08
[ "https://Stackoverflow.com/questions/183921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4234/" ]
183,923
<p>I have a class that has a Generic type "G"</p> <p>In my class model i have</p> <pre><code>public class DetailElement : ElementDefinition </code></pre> <p>Let's say i have a method like this</p> <pre><code> public void DoSomething&lt;G&gt;(G generic) where G : ElementDefinition { ...
[ { "answer_id": 183949, "author": "benjismith", "author_id": 22979, "author_profile": "https://Stackoverflow.com/users/22979", "pm_score": 1, "selected": false, "text": "DetailElement detail = generic as DetailElement;\nif (detail == null) {\n // process other types of ElementDefinition...
2008/10/08
[ "https://Stackoverflow.com/questions/183923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20335/" ]
183,928
<p>How do I create subdomain like <code>http://user.mywebsite.example</code>? Do I have to access <code>.htaccess</code> somehow? Is it actually simply possible to create it via pure PHP code or I need to use some external script-server side language?</p> <p>To those who answered: Well, then, should I ask my hosting if...
[ { "answer_id": 183971, "author": "Mark Biek", "author_id": 305, "author_profile": "https://Stackoverflow.com/users/305", "pm_score": 8, "selected": true, "text": "*.mywebsite.example IN A 127.0.0.1\n 127.0.0.1 server_name .mywebsite.example ServerAlias *.mywebsite.example HT...
2008/10/08
[ "https://Stackoverflow.com/questions/183928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21209/" ]
183,932
<p>I have an app using PHP and the PayPal API. The basic way it works to get a payment is that you do a web service call to PayPal to get a token and then do a browser redirect to PayPal with that token for the user to pay. After the payment details have been confirmed, PayPal redirects back to the URL you originally s...
[ { "answer_id": 184429, "author": "pmg", "author_id": 25324, "author_profile": "https://Stackoverflow.com/users/25324", "pm_score": 3, "selected": true, "text": "session.referer_check session.referer_check" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/183932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6010/" ]
183,950
<p>I am developing a WebPart (it will be used in a SharePoint environment, although it does not use the Object Model) that I want to expose AJAX functionality in. Because of the nature of the environment, Adding the Script Manager directly to the page is not an option, and so must be added programmatically. I have at...
[ { "answer_id": 184262, "author": "Kyle Trauberman", "author_id": 21461, "author_profile": "https://Stackoverflow.com/users/21461", "pm_score": 6, "selected": true, "text": "protected override void OnInit(EventArgs e)\n{\n Page.Init += delegate(object sender, EventArgs e_Init)\n ...
2008/10/08
[ "https://Stackoverflow.com/questions/183950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21461/" ]
183,953
<p>I'm trying to determine how to open/edit existing SQL Server Reporting Services (SSRS) 2005 report projects (.rptproj) and reports (.rdl) with Visual Studio 2008, <em>without</em> having to install SQL Business Intelligence Development Studio (BIDS) 2005.</p>
[ { "answer_id": 55810066, "author": "Rakesh Bhanderi", "author_id": 10284669, "author_profile": "https://Stackoverflow.com/users/10284669", "pm_score": 0, "selected": false, "text": ".rptproj porject not installed error message displaying during open report project.\n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/183953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5487/" ]
183,991
<p>I wonder if there's a way to do the following: I have a structure containing a member which is a pointer to a block of memory allocated by the kernel when I pass the structure to an API function (the structure is a WAVEHDR, the member is the <em>reserved</em> field.)</p> <p>I can set a data breakpoint on the value ...
[ { "answer_id": 184607, "author": "Rob Walker", "author_id": 3631, "author_profile": "https://Stackoverflow.com/users/3631", "pm_score": 3, "selected": true, "text": " Dim e As EnvDTE.Expression\n\n e = DTE.Debugger.GetExpression(\"<my expression>\", True)\n\n If e.IsValidValue T...
2008/10/08
[ "https://Stackoverflow.com/questions/183991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9047/" ]
184,002
<p>In the following piece of code (taken from the <a href="http://groovy-lang.org/semantics.html#_while_loop" rel="noreferrer">Groovy Semantics Manual page</a>), why prefix the assignment with the keyword <code>def</code>?</p> <pre><code>def x = 0 def y = 5 while ( y-- &gt; 0 ) { println "" + x + " " + y x++ ...
[ { "answer_id": 184023, "author": "Ben Hoffstein", "author_id": 4482, "author_profile": "https://Stackoverflow.com/users/4482", "pm_score": 5, "selected": false, "text": "def Object" }, { "answer_id": 185879, "author": "Ted Naleid", "author_id": 8912, "author_profile":...
2008/10/08
[ "https://Stackoverflow.com/questions/184002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15649/" ]
184,009
<p>I can't find this anywhere in the Domino Designer help. It seems so straightforward!</p> <p>All I need to do is find the position of a character in a string.</p>
[ { "answer_id": 195251, "author": "molasses", "author_id": 11293, "author_profile": "https://Stackoverflow.com/users/11293", "pm_score": 1, "selected": true, "text": "REM {\n S Source string\n F Character to find\n R Location of character in string or 0\n};\n\nS := \"My string...
2008/10/08
[ "https://Stackoverflow.com/questions/184009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273/" ]
184,014
<p>Can an XML attribute be the empty string?</p> <p>In other words, is</p> <pre><code>&lt;element att="" /&gt; </code></pre> <p>valid XML?</p>
[ { "answer_id": 184024, "author": "Bradley Grainger", "author_id": 23633, "author_profile": "https://Stackoverflow.com/users/23633", "pm_score": 4, "selected": false, "text": "test.xml" }, { "answer_id": 184030, "author": "Greg Hewgill", "author_id": 893, "author_profi...
2008/10/08
[ "https://Stackoverflow.com/questions/184014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1447/" ]
184,034
<p>What do you do to pass information between forms? Forward is straight forward (sorry) using Properties or maybe parameters in a New() or DoStuff() method, but what about sending something <strong><em>back</em></strong> when the user is done with the second form? (IE. ID of the item selected) We have used all these...
[ { "answer_id": 184077, "author": "chills42", "author_id": 23855, "author_profile": "https://Stackoverflow.com/users/23855", "pm_score": 2, "selected": false, "text": "NewForm myForm = new NewForm();\nmyForm.ShowDialog();\nstring x = myform.MyProperty;\n" }, { "answer_id": 1182528...
2008/10/08
[ "https://Stackoverflow.com/questions/184034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24991/" ]
184,074
<p>When I debug locally in fire fox 2.0x many times my page won't have the styles added properly or the page will not completely render (the end is seemingly cut off). Sometimes it takes multiple refreshes or shift-refreshes to fix this. Is this a common issue or is it just me? Any solutions?</p> <p>I want to add that...
[ { "answer_id": 493356, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 2, "selected": false, "text": "about:config network.dns.disableIPv6 true localhost network.dns.ipv4OnlyDomains C:\\Windows\\System32\\drivers\\etc\\hosts\...
2008/10/08
[ "https://Stackoverflow.com/questions/184074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18926/" ]
184,084
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/19147/what-is-the-correct-way-to-create-a-single-instance-application">What is the correct way to create a single instance application?</a> </p> </blockquote> <p>How to force C# .net app to run only one instanc...
[ { "answer_id": 184143, "author": "Mitchel Sellers", "author_id": 13279, "author_profile": "https://Stackoverflow.com/users/13279", "pm_score": 7, "selected": false, "text": "using System.Threading;\n\n[DllImport(\"user32.dll\")]\n[return: MarshalAs(UnmanagedType.Bool)]\nstatic extern boo...
2008/10/08
[ "https://Stackoverflow.com/questions/184084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1316/" ]
184,092
<p>Within emacs, what are the best options out there for navigating to a specific function whose name might show up across several different files? Within etags, you are only allowed to cycle through the tags one-at-a-time which could take a while if the function name you are looking for is popular.</p>
[ { "answer_id": 7304934, "author": "Drew", "author_id": 729907, "author_profile": "https://Stackoverflow.com/users/729907", "pm_score": 0, "selected": false, "text": "icicle-find-tag find-tag tags-loop-continue tags-apropos list-tags icicle-find-tag" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/184092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18415/" ]
184,096
<p>Suppose there is a fully populated array of data String[n][3] myData.</p> <p>I want to do this:</p> <pre><code>for (String[] row : myData) { SQL = "update mytable set col3 = row[2] where col1 = row[0] and col2=row[1];" } </code></pre> <p>Obviously I've left a lot out, but I want to express the idea as succ...
[ { "answer_id": 184123, "author": "fmsf", "author_id": 26004, "author_profile": "https://Stackoverflow.com/users/26004", "pm_score": 1, "selected": false, "text": "for (String[] row : myData)\n{\n SQL += \"update mytable set col3 = row[2]\n where col1 = row[0] and col2=row[1];\" \n}\n...
2008/10/08
[ "https://Stackoverflow.com/questions/184096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18907/" ]
184,099
<p>I want to have a reusable button which can be registered for one of many different callbacks, determined by an external source. When a new callback is set, I want to remove the old. I also want to be able to clear the callback externally at any time.</p> <pre><code>public function registerButtonCallback(function:Fu...
[ { "answer_id": 184331, "author": "Simon", "author_id": 24039, "author_profile": "https://Stackoverflow.com/users/24039", "pm_score": 3, "selected": false, "text": "<mx:Button click=\"doCallback()\" .../>\n\npublic var onClickFunction:Function = null;\nprivate function doCallback():void\n...
2008/10/08
[ "https://Stackoverflow.com/questions/184099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
184,108
<p>I have a very simple TCP server written in C. It runs indefinitely, waiting for connections. On Windows, I use <code>select</code> to check for activity on the socket, and if there isn't any, I have the following code to allow me to quit by hitting 'q' on the keyboard:</p> <pre><code>if( kbhit() ) { char c = get...
[ { "answer_id": 184346, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "read( f, &c, 1 )\n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/184108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1821/" ]
184,112
<p>Any <a href="http://en.wikipedia.org/wiki/Salt_%28cryptography%29" rel="noreferrer">salt</a> at all will obviously help when salting and hashing a user's password. Are there any best practices for how long the salt should be? I'll be storing the salt in my user table, so I would like the best tradeoff between stor...
[ { "answer_id": 9669140, "author": "multitask landscape", "author_id": 355491, "author_profile": "https://Stackoverflow.com/users/355491", "pm_score": 3, "selected": false, "text": "128 / 4 = 32" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/184112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3351/" ]
184,132
<p>I need some help from the shell-script gurus out there.</p> <p>I have a .txt file (log) that traces the IP addresses of clients on several lines, in a format similar to this one:</p> <pre><code>Line1 - Client IP [192.168.0.1] Other data Line2 - Client IP [192.168.0.2] Other data Line3 - Client IP [192.168.0.3] Oth...
[ { "answer_id": 184154, "author": "Robert Elwell", "author_id": 23102, "author_profile": "https://Stackoverflow.com/users/23102", "pm_score": 2, "selected": false, "text": " cat yourfile.txt | sed 's/*\\[//g' | sed 's/\\]*//g' | sort | uniq > newfile.txt\n" }, { "answer_id": 18416...
2008/10/08
[ "https://Stackoverflow.com/questions/184132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23034/" ]
184,147
<p>Is there any advantage of using</p> <p><a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CountDownLatch.html" rel="noreferrer"><strong>java.util.concurrent.CountdownLatch</strong></a> </p> <p>instead of</p> <p><a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Semaphore....
[ { "answer_id": 184441, "author": "Spencer Kormos", "author_id": 8528, "author_profile": "https://Stackoverflow.com/users/8528", "pm_score": 0, "selected": false, "text": "CountdownLatch await() Latch Semaphore Semaphore" }, { "answer_id": 184566, "author": "James Schek", ...
2008/10/08
[ "https://Stackoverflow.com/questions/184147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12048/" ]
184,162
<p>I'm trying to find the best way to use 'top' as semi-permanent instrumentation in the development of a box running embedded Linux. (The instrumentation will be removed from the final-test and production releases.)</p> <p>My first pass is to simply add this to init.d:</p> <pre><code>top -b -d 15 &gt;/tmp/toploop.ou...
[ { "answer_id": 184465, "author": "terson", "author_id": 22974, "author_profile": "https://Stackoverflow.com/users/22974", "pm_score": 1, "selected": false, "text": "man proc" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/184162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14028/" ]
184,178
<p>I want to do an HTTP POST that looks like an HMTL form posted from a browser. Specifically, post some text fields and a file field.</p> <p>Posting text fields is straightforward, there's an example right there in the net/http rdocs, but I can't figure out how to post a file along with it.</p> <p>Net::HTTP doesn't ...
[ { "answer_id": 184303, "author": "kch", "author_id": 13989, "author_profile": "https://Stackoverflow.com/users/13989", "pm_score": 3, "selected": false, "text": "require 'yaml'\nrequire 'curb'\n\n# prepare post data\npost_data = fields_hash.map { |k, v| Curl::PostField.content(k, v.to_s)...
2008/10/08
[ "https://Stackoverflow.com/questions/184178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13989/" ]
184,187
<p>I would like to write some scripts in python that do some automated changes to source code. If the script determines it needs to change the file I would like to first check it out of perforce. I don't care about checking in because I will always want to build and test first. </p>
[ { "answer_id": 184193, "author": "Matt Price", "author_id": 852, "author_profile": "https://Stackoverflow.com/users/852", "pm_score": 3, "selected": false, "text": "import os\n\ndef CreateNewChangeList(description):\n \"Create a new changelist and returns the changelist number as a st...
2008/10/08
[ "https://Stackoverflow.com/questions/184187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/852/" ]
184,195
<p>I'm getting married soon and am busy with the seating plan, and am running into the usual issues of who sits where: X and Y <em>must</em> sit together, but A and B cannot stand each other etc.</p> <p>The numbers I'm dealing with aren't huge (so the manual option will work just fine), but being of the geeky persuasi...
[ { "answer_id": 184224, "author": "Tom Ritter", "author_id": 8435, "author_profile": "https://Stackoverflow.com/users/8435", "pm_score": 0, "selected": false, "text": "fact GateRules {\n all g:Gate | one g.loc // Gates have 1 Location\n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/184195", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18177/" ]
184,216
<p>Full disclaimer: I'm a CS student, and this question is related to a recently assigned Java program for Object-Oriented Programming. Although we've done some console stuff, this is the first time we've worked with a GUI and Swing or Awt. We were given some code that created a window with some text and a button that ...
[ { "answer_id": 184372, "author": "Patrick Huizinga", "author_id": 15200, "author_profile": "https://Stackoverflow.com/users/15200", "pm_score": 2, "selected": true, "text": "resetButton.addActionListener(this);\n resetButton.addActionListener(new ActionListener() {\n public void actio...
2008/10/08
[ "https://Stackoverflow.com/questions/184216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26237/" ]
184,253
<p>We may start converting an old VS2003 MFC project to use the fancy new features provided by the MFC Feature Pack and VS2008. Several of the new UI controls would be very nice except for one thing - they automatically save their information to the registry. I don't have a problem with the registry, but for the multip...
[ { "answer_id": 184455, "author": "Rob", "author_id": 9236, "author_profile": "https://Stackoverflow.com/users/9236", "pm_score": 0, "selected": false, "text": "CMFCRegistrySP StateCollection" }, { "answer_id": 203016, "author": "ChrisN", "author_id": 3853, "author_pro...
2008/10/08
[ "https://Stackoverflow.com/questions/184253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12567/" ]
184,254
<p>I am using a Session Parameter on an ObjectDataSource. It works fine on the local development machine but I get this error after copying the website to the production server:</p> <p>Type 'System.Web.UI.WebControls.SessionParameter' does not have a public property named 'DbType'.</p>
[ { "answer_id": 8916585, "author": "renlo", "author_id": 1157060, "author_profile": "https://Stackoverflow.com/users/1157060", "pm_score": 1, "selected": false, "text": "DBType =\"AnsiString\" \n Type=\"String\" \n" } ]
2008/10/08
[ "https://Stackoverflow.com/questions/184254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7316/" ]