qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
397,692
<p>I'd like to display the binary (or hexadecimal) representation of a floating point number. I know how to convert by hand (using the method <a href="http://en.wikipedia.org/wiki/Floating_point#Implementation_in_actual_computers:_IEEE_floating-point" rel="noreferrer">here</a>), but I'm interested in seeing code sampl...
[ { "answer_id": 397700, "author": "cletus", "author_id": 18393, "author_profile": "https://Stackoverflow.com/users/18393", "pm_score": 6, "selected": true, "text": "union ufloat {\n float f;\n unsigned u;\n};\n\nufloat u1;\nu1.f = 0.3f;\n" }, { "answer_id": 397710, "author":...
2008/12/29
[ "https://Stackoverflow.com/questions/397692", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1288/" ]
397,708
<p>I am trying to write a MySQL query that retrieves one record from table "projects" that has a one-to-many relationship with table "tags". My application uses 4 tables to do this:</p> <pre><code>Projects - the projects table Entities - entity table; references several application resources Tags - tags table Tag_enti...
[ { "answer_id": 397716, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": false, "text": "DECLARE @csv varchar(max)\nSET @csv = ''\nSELECT @csv = @csv + ',' + foo.SomeColumn\nFROM [FOO] foo\nWHERE foo.Som...
2008/12/29
[ "https://Stackoverflow.com/questions/397708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11568/" ]
397,721
<p>Is it possible to add a jQuery function so that a click in a table cell will invoke a hidden &lt;a href="javascript: ..." /&gt; element (that is a descendant of the TD) ?</p> <p>I've tried with </p> <p>$('#table td').click(function() { $(this).find('a').click(); });</p> <p>An other variants, but to no luc...
[ { "answer_id": 397742, "author": "Zach Langley", "author_id": 45230, "author_profile": "https://Stackoverflow.com/users/45230", "pm_score": 3, "selected": false, "text": "href" }, { "answer_id": 397838, "author": "Corey Downie", "author_id": 44861, "author_profile": "...
2008/12/29
[ "https://Stackoverflow.com/questions/397721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2732/" ]
397,723
<p>I have a collection of movies and TV shows in iTunes, and I'd like to rename them to an <a href="http://xbmc.org/wiki/?title=TV_Shows" rel="nofollow noreferrer">XBMC compatible naming convention</a> without breaking the links in iTunes.</p> <p>All the necessary metadata (season number, show name, episode number, et...
[ { "answer_id": 397746, "author": "Dan Williams", "author_id": 4230, "author_profile": "https://Stackoverflow.com/users/4230", "pm_score": 2, "selected": false, "text": "var ITTrackKindFile = 1;\nvar iTunesApp = WScript.CreateObject(\"iTunes.Application\");\nvar deletedTracks = 0;\nva...
2008/12/29
[ "https://Stackoverflow.com/questions/397723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42404/" ]
397,736
<p>I want to globalize my application. I have created a small form which asks the user their language. I have a number of problems :</p> <p>Problem 1:</p> <p>In program.cs</p> <pre><code>new SplashScreen(_tempAL); new LangForm(_lang); Application.Run(new Form1(_tempAL, _lang)); </code></pre> <p>I want the applicat...
[ { "answer_id": 397746, "author": "Dan Williams", "author_id": 4230, "author_profile": "https://Stackoverflow.com/users/4230", "pm_score": 2, "selected": false, "text": "var ITTrackKindFile = 1;\nvar iTunesApp = WScript.CreateObject(\"iTunes.Application\");\nvar deletedTracks = 0;\nva...
2008/12/29
[ "https://Stackoverflow.com/questions/397736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42782/" ]
397,738
<p>Last weekend I changed webhosts for my website. The host server I was on was a 32-bit OS and the one I moved to is 64-bit. Unexpectedly, some of my PHP scripts started giving incorrect results. </p> <p>In my case the &lt;&lt; and >> (bit shift) operations were the culprit. I ended up having to mask the result with ...
[ { "answer_id": 1175041, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": " 0010 >> 1 = 0001 [ 1 dec ]\n0000 0010 >> 1 = 0000 0001 [ 1 dec ]\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/397738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30176/" ]
397,741
<p>My Microsoft SQL Server Management Studio is slow. And by slow I mean >1minute to render a context menu-slow. All other things work perfectly fine. The connection to the database itself is not slow (my app works just fine and context menus don't need connection to the DB anyway I guess)..</p> <p>Anybody has any ide...
[ { "answer_id": 1175041, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": " 0010 >> 1 = 0001 [ 1 dec ]\n0000 0010 >> 1 = 0000 0001 [ 1 dec ]\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/397741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
397,744
<p>I have a windows service written in c#. It has a timer inside, which fires some functions on a regular basis. So the skeleton of my service:</p> <pre><code>public partial class ArchiveService : ServiceBase { Timer tickTack; int interval = 10; ... protected override void OnStart(string[] args) {...
[ { "answer_id": 397770, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": false, "text": "private void tickTack_Elapsed(object sender, ElapsedEventArgs e)\n{\n CheckForRecycle();\n // ... actual code\n...
2008/12/29
[ "https://Stackoverflow.com/questions/397744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/968/" ]
397,753
<p>I've a need to add method that will calculate a weighted sum of worker salary and his superior salary. I would like something like this:</p> <pre><code>class CompanyFinanse { public decimal WeightedSumOfWorkerSalaryAndSuperior(Worker WorkerA, Worker Superior) { return WorkerA.Salary + Superio...
[ { "answer_id": 397782, "author": "Shawn", "author_id": 26, "author_profile": "https://Stackoverflow.com/users/26", "pm_score": 3, "selected": false, "text": "public class Worker {\n public Worker Superior {get;set;}\n public readonly decimal WeightedSalary {\n get {\n ...
2008/12/29
[ "https://Stackoverflow.com/questions/397753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49836/" ]
397,754
<p>Is there a way to record the screen, either desktop or window, using .NET technologies.</p> <p>My goal is something free. I like the idea of small, low cpu usage, and simple, but would consider other options if they created a better final product.</p> <p>In a nutshell, I know how to take a screenshot in C#, but ho...
[ { "answer_id": 397812, "author": "driis", "author_id": 13627, "author_profile": "https://Stackoverflow.com/users/13627", "pm_score": 5, "selected": true, "text": " private Image CaptureScreen()\n {\n Rectangle screenSize = Screen.PrimaryScreen.Bounds;\n Bitmap target ...
2008/12/29
[ "https://Stackoverflow.com/questions/397754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23294/" ]
397,759
<p>I have two bitmaps, produced by different variations of an algorithm. I'd like to create a third bitmap by subtracting one from the other to show the differences.</p> <p>How can this be done in .NET? I've looked over the Graphics class and all its options, including the ImageAttributes class, and I have a hunch it ...
[ { "answer_id": 397783, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 1, "selected": false, "text": "LockBits" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/397759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/267/" ]
397,760
<p>What does the <code>[string]</code> indexer of <code>Dictionary</code> return when the key doesn't exist in the Dictionary? I am new to C# and I can't seem to find a reference as good as the Javadocs.</p> <p>Do I get <code>null</code>, or do I get an exception?</p>
[ { "answer_id": 397772, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": false, "text": "Dictionary<TKey,TValue>" }, { "answer_id": 397776, "author": "Marc Gravell", "author_id": 23354, "au...
2008/12/29
[ "https://Stackoverflow.com/questions/397760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2598/" ]
397,788
<p>I'm trying to find URLs in some text, using javascript code. The problem is, the regular expression I'm using uses \w to match letters and digits inside the URL, but it doesn't match non-english characters (in my case - Hebrew letters). </p> <p>So what can I use instead of \w to match all letters in all languages?<...
[ { "answer_id": 397801, "author": "David Koelle", "author_id": 2197, "author_profile": "https://Stackoverflow.com/users/2197", "pm_score": 5, "selected": true, "text": "\\w" }, { "answer_id": 400253, "author": "Jan Goyvaerts", "author_id": 33358, "author_profile": "htt...
2008/12/29
[ "https://Stackoverflow.com/questions/397788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3389/" ]
397,815
<p>I am attempting to manage an ajax connection by calling a button onclick method on a separate web part in order to force the partial postback on the consumer. </p> <p>Web part A (Provider) invokes the method on Web Part B (Consumer)</p> <p>Web Part A</p> <p>Type t = myButton.GetType(); object[] p = n...
[ { "answer_id": 555544, "author": "Mike", "author_id": 62248, "author_profile": "https://Stackoverflow.com/users/62248", "pm_score": 0, "selected": false, "text": "document.getElementById('ElID').onclick();\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/397815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
397,817
<p>I upgraded to Ubuntu Intrepid Ibex yesterday and suddenly some of the Perl modules that I installed (on the Hardy Heron) have all gone missing!</p> <p>I get the usual "Can't locate module in @INC" error. Has any of the CPAN repositories changed or something for Intrepid? Google doesn't help at all.</p> <p>Thanks i...
[ { "answer_id": 398152, "author": "Trochee", "author_id": 49890, "author_profile": "https://Stackoverflow.com/users/49890", "pm_score": 3, "selected": false, "text": "cpan" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/397817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49847/" ]
397,837
<p>Im trying to sum an expression in visual studio and just keep getting an #error but not sure why as this si the first time i have tried to sum an expression, only ever done it on a single field before. Any Suggestions!!!</p> <pre><code> =IIf(Fields!STATUS.value = "Completed" AND Fields!DONOTINVOICE.value = True, Fi...
[ { "answer_id": 23648005, "author": "user3635498", "author_id": 3635498, "author_profile": "https://Stackoverflow.com/users/3635498", "pm_score": 0, "selected": false, "text": "=Sum(IIf(Fields!STATUS.value = \"Completed\" AND Fields!DONOTINVOICE.value = 1.0, Fields!ORDERCOST.Value, 0.0))\...
2008/12/29
[ "https://Stackoverflow.com/questions/397837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
397,839
<p>I'm working on Visual Studio Extensibility and I need to set the "shell" language from code. In other words, I'm looking for an API to do the same you can do "by hand" with the <em>Tools -> Options... -> Environment -> International Settings</em> property page.<br/> Up to now I didn't find any reference: hints and s...
[ { "answer_id": 23648005, "author": "user3635498", "author_id": 3635498, "author_profile": "https://Stackoverflow.com/users/3635498", "pm_score": 0, "selected": false, "text": "=Sum(IIf(Fields!STATUS.value = \"Completed\" AND Fields!DONOTINVOICE.value = 1.0, Fields!ORDERCOST.Value, 0.0))\...
2008/12/29
[ "https://Stackoverflow.com/questions/397839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49582/" ]
397,851
<p>I'm making a winform in C# using Visual Studio 2008.</p> <p>Currently, I have a tabcontrol, containing 2 tabs. In the first the, there is a button. When I click it, I must be taken to the second tab.</p> <p>Problem is, I don't know how. I've tried debugging, looking into al kinds of Properties and messing around w...
[ { "answer_id": 397857, "author": "Matt Brunell", "author_id": 24970, "author_profile": "https://Stackoverflow.com/users/24970", "pm_score": 5, "selected": true, "text": "tabControl1.SelectedTab = logTab;\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/397851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11795/" ]
397,864
<p>What are the different ways of communication between asp.net page and a popup page? Query strings etc. Which is most secure?</p>
[ { "answer_id": 397931, "author": "Mark Brittingham", "author_id": 15592, "author_profile": "https://Stackoverflow.com/users/15592", "pm_score": 2, "selected": true, "text": "<img style='cursor:hand;' alt=\"Open Note\" onclick=\"javascript:window.open('NoteEdit.aspx?T=3&UID=<%#NoteUID%>',...
2008/12/29
[ "https://Stackoverflow.com/questions/397864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1688440/" ]
397,867
<p>George Marsaglia has written an excellent random number generator that is extremely fast, simple, and has a much higher period than the Mersenne Twister. Here is the code with a description:</p> <p><a href="http://school.anhb.uwa.edu.au/personalpages/kwessen/shared/Marsaglia03.html" rel="noreferrer">good C random n...
[ { "answer_id": 397960, "author": "Jason S", "author_id": 44330, "author_profile": "https://Stackoverflow.com/users/44330", "pm_score": 5, "selected": true, "text": "a=18782" }, { "answer_id": 73439958, "author": "Nayuki", "author_id": 839689, "author_profile": "https:...
2008/12/29
[ "https://Stackoverflow.com/questions/397867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48181/" ]
397,895
<p>How can I create a list in C++? I need it to create a linked list. How would I go about doing that? Are there good tutorials or examples I could follow?</p>
[ { "answer_id": 397908, "author": "mepcotterell", "author_id": 43312, "author_profile": "https://Stackoverflow.com/users/43312", "pm_score": 3, "selected": false, "text": "#include <list>\n\n// in some function, you now do...\nstd::list<int> mylist; // integer list\n" }, { "answer...
2008/12/29
[ "https://Stackoverflow.com/questions/397895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49609/" ]
397,900
<p>I have a folder with subfolders of files. I would like to get the newest filename by modified time. Is there a more efficient way of finding this short of looping through each folder and file to find it? </p>
[ { "answer_id": 397961, "author": "jwmiller5", "author_id": 7824, "author_profile": "https://Stackoverflow.com/users/7824", "pm_score": 0, "selected": false, "text": "dir -r | select Name, LastWriteTime | sort LastWriteTime -DESC | select -first 1\n" }, { "answer_id": 397966, ...
2008/12/29
[ "https://Stackoverflow.com/questions/397900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49860/" ]
397,918
<p>Could someone tell me how the field "Task Group" is used in standard SharePoint Task Lists?</p>
[ { "answer_id": 4773764, "author": "Ahmed Said", "author_id": 586326, "author_profile": "https://Stackoverflow.com/users/586326", "pm_score": 1, "selected": false, "text": "<Where>" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/397918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43506/" ]
397,926
<p>I would like to take a set of controls (INPUT, SELECT, TEXTAREA) which are contained within a DIV and send their values as JSON via Ajax to a server. This is easy enough with jQuery's <a href="http://docs.jquery.com/Ajax/serializeArray" rel="nofollow noreferrer">serializeArray</a>.</p> <p>However I then want the s...
[ { "answer_id": 398270, "author": "Pim Jager", "author_id": 35197, "author_profile": "https://Stackoverflow.com/users/35197", "pm_score": 2, "selected": false, "text": "$(\"*[name='\" + controlname + \"']\").val( value);\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/397926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17516/" ]
397,927
<p>In openmoko (stable hybrid release, SHR), how do you programatically turn-off the screensaver (the dimmed/blank screen after a few seconds of inactivity) just while your app is running?</p>
[ { "answer_id": 398343, "author": "codelogic", "author_id": 43427, "author_profile": "https://Stackoverflow.com/users/43427", "pm_score": 1, "selected": false, "text": "xset s off\n" }, { "answer_id": 765344, "author": "Baruch Even", "author_id": 85036, "author_profile...
2008/12/29
[ "https://Stackoverflow.com/questions/397927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46478/" ]
397,933
<p>most of social networks does this. when you register one of them for example twitter it says why dont you invite your friends from hotmail or yahoo or gmail. and expect us to give our credentials and send those mails. I want to implement same feature in java.</p> <p>I tried <a href="http://code.google.com/p/contact...
[ { "answer_id": 398386, "author": "Ole", "author_id": 49540, "author_profile": "https://Stackoverflow.com/users/49540", "pm_score": 1, "selected": false, "text": "http://mail.google.com/mail/contacts/data/export" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/397933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
397,934
<p>How can I get an application to write debug text to the Event Log window in the Delphi IDE (Borland Developer Studio 2006)?</p> <p>How does one change the color of the text?</p>
[ { "answer_id": 397979, "author": "amo", "author_id": 49065, "author_profile": "https://Stackoverflow.com/users/49065", "pm_score": 3, "selected": false, "text": "OutputDebugString" }, { "answer_id": 400104, "author": "Jk.", "author_id": 50149, "author_profile": "https...
2008/12/29
[ "https://Stackoverflow.com/questions/397934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17560/" ]
397,944
<p>For the following code:</p> <pre><code>&lt;% foreach (Entities.Core.Location loc in locations){ %&gt; &lt;div class="place_meta"&gt; &lt;img src="~/static/images/stars/star_25_sml.gif" runat="server" class="star_rating"/&gt; &lt;/div&gt; &lt;% }; %&gt; </code></pre> <p>I would like to display the star rating image...
[ { "answer_id": 397974, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 0, "selected": false, "text": "runat=\"server\"" }, { "answer_id": 397995, "author": "Fabrizio C.", "author_id": 49582, "author_pr...
2008/12/29
[ "https://Stackoverflow.com/questions/397944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32372/" ]
397,955
<p>I have an xml in which i have stored some html under comments like this</p> <pre><code> &lt;root&gt; &lt;node&gt; &lt;!-- &lt;a href="mailto:some@one.com"&gt; Mail me &lt;/a&gt; --&gt; &lt;/node&gt; &lt;/root&gt; </code></pre> <p>now in my Transform Xslt code of mine i am giving XPathNa...
[ { "answer_id": 399600, "author": "diciu", "author_id": 2811, "author_profile": "https://Stackoverflow.com/users/2811", "pm_score": 3, "selected": true, "text": "<xsl:template match=\"/\">\n<xsl:value-of select=\"/root/node/comment()\" disable-output-escaping=\"yes\"/>\n</xsl:template>\n"...
2008/12/29
[ "https://Stackoverflow.com/questions/397955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6351/" ]
397,998
<p>I have a table (T1) in t-sql with a column (C1) that contains almost 30,000 rows of data. Each column contains values like MSA123, MSA245, MSA299, etc. I need to run an update script so the MSA part of the string changes to CMA. How can I do this?</p>
[ { "answer_id": 398005, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 3, "selected": true, "text": "update t1\nset c1 = replace(c1,\"MSA\",\"CMA\")\nwhere c1 like \"MSA%\"\n" }, { "answer_id": 398011, "author...
2008/12/29
[ "https://Stackoverflow.com/questions/397998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33690/" ]
398,008
<p>We have a rails application in subversion that we deploy with Capistrano but have noticed that we can access the files in '/.svn', which presents a security concern. </p> <p>I wanted to know what the best way to do this. A few ideas:</p> <ul> <li>Global Apache configuration to deny access </li> <li>Adding .htacce...
[ { "answer_id": 398249, "author": "csexton", "author_id": 19839, "author_profile": "https://Stackoverflow.com/users/19839", "pm_score": 5, "selected": false, "text": "RedirectMatch 404 /\\\\.svn(/|$)\n" }, { "answer_id": 3251448, "author": "Riccardo Galli", "author_id": 21...
2008/12/29
[ "https://Stackoverflow.com/questions/398008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19839/" ]
398,010
<p>I have a project in Xcode that contains multiple targets. One of these builds a sync schema bundle, and another one builds a Foundation command-line tool that initiates a sync session using the schema defined in the bundle.</p> <p>The schema bundle template creates <code>Schema-strings.h</code> and <code>Schema-str...
[ { "answer_id": 398249, "author": "csexton", "author_id": 19839, "author_profile": "https://Stackoverflow.com/users/19839", "pm_score": 5, "selected": false, "text": "RedirectMatch 404 /\\\\.svn(/|$)\n" }, { "answer_id": 3251448, "author": "Riccardo Galli", "author_id": 21...
2008/12/29
[ "https://Stackoverflow.com/questions/398010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2399475/" ]
398,021
<p>I want to change the text of a radio button (HTML element), not an ASP.NET component.</p> <p>How can I change it from ASP.NET?</p>
[ { "answer_id": 398026, "author": "Dillie-O", "author_id": 71, "author_profile": "https://Stackoverflow.com/users/71", "pm_score": 5, "selected": true, "text": "runat=\"server\"\n" }, { "answer_id": 398030, "author": "steve_c", "author_id": 769, "author_profile": "http...
2008/12/29
[ "https://Stackoverflow.com/questions/398021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44973/" ]
398,028
<p>I would like to know how to do performance testing for the old asp pages. Any tools out there that you've used?</p>
[ { "answer_id": 398077, "author": "TravisO", "author_id": 35116, "author_profile": "https://Stackoverflow.com/users/35116", "pm_score": 3, "selected": false, "text": "<%\n' Start the timer\nstarttime = timer()\n%>\n\n<!-- HTML and Code Here -->\n\n<%\n' End the timer\nendtime = timer()\n'...
2008/12/29
[ "https://Stackoverflow.com/questions/398028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49881/" ]
398,032
<p>What API or tools can I use to query the capabilities of the system and choose the most appropriate on for putting the PC to Sleep, Hibernate or shutdown mode?</p> <p>Thanks for any pointers.</p>
[ { "answer_id": 398062, "author": "Leon Tayson", "author_id": 18413, "author_profile": "https://Stackoverflow.com/users/18413", "pm_score": 4, "selected": true, "text": "Application.SetSuspendState(PowerState.Hibernate, true, true);\n" }, { "answer_id": 13329017, "author": "ds...
2008/12/29
[ "https://Stackoverflow.com/questions/398032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3811/" ]
398,037
<p>When I start a new ASP.NET project in Visual Studio, I can create an ASP.NET Web Application or I can create an ASP.NET Web Site.</p> <p>What is the difference between ASP.NET Web Application and ASP.NET Web Site? Why would I choose one over other?</p> <p>Is the answer different based on which version of Visual St...
[ { "answer_id": 398154, "author": "Daniel Auger", "author_id": 1644, "author_profile": "https://Stackoverflow.com/users/1644", "pm_score": 5, "selected": false, "text": "app_code" }, { "answer_id": 12152820, "author": "Nagaraj P", "author_id": 1235202, "author_profile"...
2008/12/29
[ "https://Stackoverflow.com/questions/398037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7565/" ]
398,069
<p>My code is built to multiple .dll files, and I have a template class that has a static member variable.</p> <p>I want the same instance of this static member variable to be available in all dlls, but it doesn't work: I see different instance (different value) in each of them.</p> <p>When I don't use templates, the...
[ { "answer_id": 398132, "author": "Dominik Grabiec", "author_id": 3719, "author_profile": "https://Stackoverflow.com/users/3719", "pm_score": 1, "selected": false, "text": "template <class T> class Foo;\ntemplate<> class Foo<int> {};\n" }, { "answer_id": 398164, "author": "lsa...
2008/12/29
[ "https://Stackoverflow.com/questions/398069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44673/" ]
398,100
<p>It's quite possible a question like this has been asked before, but I can't think of the terms to search for.</p> <p>I'm working on a photo gallery application, and want to display 9 thumbnails showing the context of the current photo being shown (in a 3x3 grid with the current photo in the centre, unless the curre...
[ { "answer_id": 398115, "author": "Charles Bretana", "author_id": 32632, "author_profile": "https://Stackoverflow.com/users/32632", "pm_score": 0, "selected": false, "text": " Select * From Photos P\n Where (Select Count(*) From Photos\n Where id <= P.Id)\n Between (Select Co...
2008/12/29
[ "https://Stackoverflow.com/questions/398100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20972/" ]
398,110
<p>How can you modify the URL for the current page that gets passed to Google Analytics? </p> <p>(I need to strip the extensions from certain pages because for different cases a page can be requested with or without it and GA sees this as two different pages.) </p> <p>For example, if the page URL is <code>http://my...
[ { "answer_id": 398548, "author": "Athena", "author_id": 17846, "author_profile": "https://Stackoverflow.com/users/17846", "pm_score": 4, "selected": true, "text": "pageTracker._trackPageview('/cake/ilikecake');\n" }, { "answer_id": 492243, "author": "pelms", "author_id": ...
2008/12/29
[ "https://Stackoverflow.com/questions/398110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18228/" ]
398,111
<p>What's a surefire way of detecting whether a user has Firebug enabled?</p>
[ { "answer_id": 398120, "author": "Andreas Grech", "author_id": 44084, "author_profile": "https://Stackoverflow.com/users/44084", "pm_score": 7, "selected": true, "text": "console" }, { "answer_id": 399149, "author": "David Brockman", "author_id": 38912, "author_profil...
2008/12/29
[ "https://Stackoverflow.com/questions/398111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5123/" ]
398,117
<p>Given two shorts (<code>System.Int16</code>)</p> <pre><code>short left = short.MaxValue; short right = 1; </code></pre> <p>I want to get an <code>OverflowException</code> when adding them.</p> <pre><code>checked(left+right) </code></pre> <p>does not work, because the result of <code>left+right</code> is an <code...
[ { "answer_id": 398155, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": true, "text": "using System;\nusing System.Linq.Expressions;\n\nclass Test\n{\n static void Main(string[] args)\n {\n short...
2008/12/29
[ "https://Stackoverflow.com/questions/398117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48722/" ]
398,137
<p>Hi What is the best way to do nested try &amp; finally statements in delphi?</p> <pre><code>var cds1 : TClientDataSet; cds2 : TClientDataSet; cds3 : TClientDataSet; cds4 : TClientDataSet; begin cds1 := TClientDataSet.Create(application ); try cds2 := TClientDataSet.Create(applicati...
[ { "answer_id": 398161, "author": "skamradt", "author_id": 9217, "author_profile": "https://Stackoverflow.com/users/9217", "pm_score": 6, "selected": true, "text": "var cds1 : TClientDataSet;\n cds2 : TClientDataSet;\n cds3 : TClientDataSet;\n cds4 : TClientDataSet;\nbegin\n ...
2008/12/29
[ "https://Stackoverflow.com/questions/398137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17560/" ]
398,144
<p>I'm baffled how to do this.</p> <p>I need to take a datetime object and get the duration in hours, days, whatever, to the current time.</p> <p>Thank you.</p>
[ { "answer_id": 398165, "author": "Sören Kuklau", "author_id": 1600, "author_profile": "https://Stackoverflow.com/users/1600", "pm_score": 4, "selected": true, "text": ">> foo = Time.new\n=> Mon Dec 29 18:23:51 +0100 2008\n>> bar = Time.new\n=> Mon Dec 29 18:23:56 +0100 2008\n>> print bar...
2008/12/29
[ "https://Stackoverflow.com/questions/398144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33287/" ]
398,163
<p>Let's say I have my pizza application with Topping and Pizza classes and they show in Django Admin like this:</p> <pre><code>PizzaApp - Toppings &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Add / Change Pizzas &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Add / Change </code></pre> <p>But I want them...
[ { "answer_id": 5345760, "author": "Roberto", "author_id": 665167, "author_profile": "https://Stackoverflow.com/users/665167", "pm_score": 6, "selected": false, "text": "class Topping(models.Model):\n .\n .\n .\n class Meta:\n verbose_name_plural = \"2. Toppings\"\n\ncl...
2008/12/29
[ "https://Stackoverflow.com/questions/398163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49898/" ]
398,170
<p>Simple question... is there a way to change the Assembly Version of a compiled .NET assembly?</p> <p>I'd actually be fine with a way to change the Assembly File Version.</p>
[ { "answer_id": 34045871, "author": "Georgi Atanassov", "author_id": 5630761, "author_profile": "https://Stackoverflow.com/users/5630761", "pm_score": 4, "selected": false, "text": ".custom instance void [mscorlib]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = ( 01 00 07 ...
2008/12/29
[ "https://Stackoverflow.com/questions/398170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2848/" ]
398,188
<p>We're having a small issue and could use some help - we have the need to combine multiple resultsets from one stored procedure into one resultset (the limitation of our Java reporting framework). We've looked at Union, etc. but the problem is that the stored procedure resultsets are multiple crosstab results and the...
[ { "answer_id": 398196, "author": "Charles Bretana", "author_id": 32632, "author_profile": "https://Stackoverflow.com/users/32632", "pm_score": 2, "selected": true, "text": " Select ID, Name as value1, null as value2\n From TableA \n Union\n Select ID, FName as value1, LName as valu...
2008/12/29
[ "https://Stackoverflow.com/questions/398188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35309/" ]
398,192
<p>"Title" field is sealed. Any attempts to update the default value resets the value back to "null"</p> <hr> <p>Thanks for your time.</p> <p>Your idea of doing "RemoveFieldRef and FieldRef it right back in" would be the same as setting the properties "Required" and "Default Value" through the interface for the "Doc...
[ { "answer_id": 408045, "author": "stlawrence", "author_id": 48924, "author_profile": "https://Stackoverflow.com/users/48924", "pm_score": 2, "selected": false, "text": " <ContentType ...>\n <FieldRefs>\n <FieldRef ID=\"{fa564e0f-0c70-4ab9-b863-0177e6ddd247}\" Name=\"Title\" Disp...
2008/12/29
[ "https://Stackoverflow.com/questions/398192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35175/" ]
398,203
<p>One of my coworkers is having a problem pushing changes from git on his machine. If he logs into another machine, he can push just fine - but from his machine, when he tries to push he gets the following error</p> <pre> D:\Projects\test1\best-practices>git push Counting objects: 4, done. Compressing ob...
[ { "answer_id": 398852, "author": "Pat Notz", "author_id": 825, "author_profile": "https://Stackoverflow.com/users/825", "pm_score": 4, "selected": true, "text": "git" }, { "answer_id": 399133, "author": "Paul", "author_id": 23356, "author_profile": "https://Stackoverf...
2008/12/29
[ "https://Stackoverflow.com/questions/398203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1322/" ]
398,212
<p>I normally use C# and I'm attempting to convert a qbasic programmer to the joys of object oriented programming by easing him into VB 2005.</p> <p>Below is a extremely simplified version of what I'm trying to accomplish. It successfully compiles, but all members in the array of card objects are set to "Nothing". T...
[ { "answer_id": 398217, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": true, "text": "Class Deck\n Public cards(51) As Card\n\n Public Sub New()\n For i As Integer = 0 To cards.Length-1\n ...
2008/12/29
[ "https://Stackoverflow.com/questions/398212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18043/" ]
398,215
<p>Our application uses Hibernate for ORM, and stores data in several schemas, accessing them with a user whose grants are customized for the application.</p> <p>The schema names are determined at runtime based on data; it's not feasible to include their names in the entity mapping documents. This means that I need a...
[ { "answer_id": 550663, "author": "paulmurray", "author_id": 63189, "author_profile": "https://Stackoverflow.com/users/63189", "pm_score": 1, "selected": false, "text": "ALTER SESSION SET CURRENT_SCHEMA = 'someotherschema'\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/398215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23309/" ]
398,221
<p>A <a href="https://stackoverflow.com/questions/397817/unable-to-find-perl-modules-in-intrepid-ibex-ubuntu">recent question</a> here on SO got me thinking.</p> <p>On most Linux distributions that I tried, some Perl modules would be available through the package manager. Others, of course, not. For quite a while I wo...
[ { "answer_id": 398397, "author": "brian d foy", "author_id": 2766176, "author_profile": "https://Stackoverflow.com/users/2766176", "pm_score": 5, "selected": false, "text": "$ perl5.10.0 program.pl\n" }, { "answer_id": 401109, "author": "Tom Feiner", "author_id": 13523, ...
2008/12/29
[ "https://Stackoverflow.com/questions/398221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7498/" ]
398,223
<p>How do I make my Apache 2 server force a browser to open a file transfer dialogue if the URL points to a file with a .pln or .psa extension?</p> <p>I have a simple LAMP server with CentOS 5, Apache 2, MYSQL 5, PHP 5, recently built CentOS 5.2 i386 installation CDs. My web application generates files to be downloade...
[ { "answer_id": 398230, "author": "palehorse", "author_id": 312, "author_profile": "https://Stackoverflow.com/users/312", "pm_score": 3, "selected": false, "text": "<FilesMatch \"\\.(?i:pin)$\">\n Header set Content-Disposition attachment\n</FilesMatch>\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/398223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
398,231
<p>I'm using an ObjectDataSource to bind data to a GridView; it works fine except that it always creates a new object to use as a data source. I can do all the setup just fine but I cannot use an instance of an existing object to specify as the "data source" for it. Is it possible to do this? If so, how? </p> <p>I...
[ { "answer_id": 398261, "author": "George", "author_id": 8803, "author_profile": "https://Stackoverflow.com/users/8803", "pm_score": 4, "selected": true, "text": "protected void ObjectDataSource1_ObjectCreating(object sender, ObjectDataSourceEventArgs e)\n{\n e.ObjectInstance = myObjec...
2008/12/29
[ "https://Stackoverflow.com/questions/398231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4068/" ]
398,237
<p>In a web application I am working on, the user can click on a link to a CSV file. There is no header set for the mime-type, so the browser just renders it as text. I would like for this file to be sent as a .csv file, so the user can directly open it with calc, excel, gnumeric, etc. </p> <pre><code>header('Conte...
[ { "answer_id": 398239, "author": "Sean Bright", "author_id": 21926, "author_profile": "https://Stackoverflow.com/users/21926", "pm_score": 9, "selected": true, "text": "header('Content-type: text/csv');\nheader('Content-disposition: attachment;filename=MyVerySpecial.csv');\necho \"cell 1...
2008/12/29
[ "https://Stackoverflow.com/questions/398237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
398,259
<p>I am trying to create a hyperlink using LaTeX. When I use the command pdflatex to compile the file, I get an error.</p> <p>The relevant lines of the document are:</p> <pre><code>\documentclass[12pt]{article} \usepackage{hyperref} \begin{document} ... \href{http://www.cs.utah.edu/dept/old/texinfo/as/gprof_toc.html}...
[ { "answer_id": 398283, "author": "dreeves", "author_id": 4234, "author_profile": "https://Stackoverflow.com/users/4234", "pm_score": 2, "selected": false, "text": "\\usepackage{url}\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/398259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
398,299
<p>A friend was in need of an algorithm that would let him loop through the elements of an NxM matrix (N and M are odd). I came up with a solution, but I wanted to see if my fellow SO'ers could come up with a better solution.</p> <p>I'm posting my solution as an answer to this question.</p> <p><strong>Example Output:...
[ { "answer_id": 398302, "author": "Can Berk Güder", "author_id": 2119, "author_profile": "https://Stackoverflow.com/users/2119", "pm_score": 7, "selected": true, "text": "def spiral(X, Y):\n x = y = 0\n dx = 0\n dy = -1\n for i in range(max(X, Y)**2):\n if (-X/2 < x <= ...
2008/12/29
[ "https://Stackoverflow.com/questions/398299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2119/" ]
398,316
<p>I have string that I want to chop to array of substrings of given length n. I am not interested in remainder (if length of string cannot be divided by n without remainder)</p> <pre><code>let ChopString (myString : string) n = let res = seq{ for i = 0 to myString.Length / n - 1 do ...
[ { "answer_id": 398417, "author": "Juliet", "author_id": 40516, "author_profile": "https://Stackoverflow.com/users/40516", "pm_score": 4, "selected": true, "text": "stringInstance.[start..end]" }, { "answer_id": 399343, "author": "zendar", "author_id": 25732, "author_p...
2008/12/29
[ "https://Stackoverflow.com/questions/398316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25732/" ]
398,325
<p>I have a custom type that I created, which should be persisted in a database (in this case, SQL server) as a guid (though this question is just as valid for an object that could be stored as a string, integer, etc). </p> <p>When I pass this type as a parameter to a DbCommand object, I get an exception:</p> <blockq...
[ { "answer_id": 10697710, "author": "S. Galiamov", "author_id": 1006517, "author_profile": "https://Stackoverflow.com/users/1006517", "pm_score": 1, "selected": false, "text": "\n public interface ICustomDbValue\n {\n object Value { get; }\n }\n\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/398325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7913/" ]
398,332
<p>Everyone uses source-code control to manage versions (right?) and this provides some level of backup. There are times, however, when your local copy is out of sync with the repository. Moreover, some sandbox-type projects may not have yet ;-) made it into SCC.</p> <p><strong>EDIT</strong>: I have multiple projec...
[ { "answer_id": 398355, "author": "rp.", "author_id": 2536, "author_profile": "https://Stackoverflow.com/users/2536", "pm_score": 3, "selected": false, "text": "@echo off\n\necho Stop and start SQL Server\necho -------------------------\n\nnet stop \"SQL Server (SQLEXPRESS)\"\nnet stop \"...
2008/12/29
[ "https://Stackoverflow.com/questions/398332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12950/" ]
398,333
<p>I am crash-learning PHP for a project, and I have a ton of stupid questions to make. The first is the following. I have a structure like this:</p> <ul> <li>index.php</li> <li>header.php</li> <li>images/</li> <li>data <ul> <li>data.php</li> </ul></li> </ul> <p>Now, the problem is that I want to include the heade...
[ { "answer_id": 398341, "author": "Glenn", "author_id": 25191, "author_profile": "https://Stackoverflow.com/users/25191", "pm_score": 0, "selected": false, "text": "$_SERVER['PATH_TRANSLATED']" }, { "answer_id": 398370, "author": "Andreas Grech", "author_id": 44084, "a...
2008/12/29
[ "https://Stackoverflow.com/questions/398333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2309/" ]
398,344
<p>I'm looking for something that runs in a terminal and allows me to track time. I'd like it to be open source but that isn't necessary. </p> <p>Most time tracking apps I've found are either web or gui based and there for take longer to enter data then I'd like.</p>
[ { "answer_id": 398431, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 4, "selected": false, "text": "$ echo `date`\": what I'm doing now\" >> timelog.txt\n" }, { "answer_id": 398449, "author": "flolo", ...
2008/12/29
[ "https://Stackoverflow.com/questions/398344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14744/" ]
398,347
<p>I have some settings I need in a Javascript file -- servers to connect to -- that changes based on my environment. For <code>development</code>, <code>test</code>, and <code>staging</code>, I want to use the staging servers; for <code>production</code>, the production servers. I already have the settings in Ruby (...
[ { "answer_id": 398523, "author": "salt.racer", "author_id": 757, "author_profile": "https://Stackoverflow.com/users/757", "pm_score": 3, "selected": true, "text": "<% javascript_include_file \"#{RAILS_ENV}.js\" %>\n" }, { "answer_id": 399113, "author": "Priit", "author_id...
2008/12/29
[ "https://Stackoverflow.com/questions/398347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1190/" ]
398,351
<p>i want to call a server side method using __DoPostBack and generating the HTML, but i dont want a hidden ASP runat server control in my page its possible to call a server side method by its name not by the name of the control that trigger it ??</p>
[ { "answer_id": 7237931, "author": "rick schott", "author_id": 58856, "author_profile": "https://Stackoverflow.com/users/58856", "pm_score": 1, "selected": false, "text": "WebMethod" }, { "answer_id": 55262181, "author": "Protector one", "author_id": 125938, "author_pr...
2008/12/29
[ "https://Stackoverflow.com/questions/398351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
398,353
<p>I know that WPF 3.5 SP1 supports a <code>StringFormat</code> in a binding, but can Silverlight do the same? I thought it could, but damned if I can make it work!</p> <p>Here's a snippet of my XAML:</p> <pre><code>&lt;TextBlock Text="{Binding StartTime, StringFormat=t}" /&gt; </code></pre> <p>It compiles OK, but I...
[ { "answer_id": 1891904, "author": "Simon_Weaver", "author_id": 16940, "author_profile": "https://Stackoverflow.com/users/16940", "pm_score": 5, "selected": false, "text": " <data:DataGridTextColumn Header=\"Date\" \n Binding=\"{Binding CreateDt, StringFormat=\\{0:d\\}}\" />\n" } ...
2008/12/29
[ "https://Stackoverflow.com/questions/398353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14537/" ]
398,378
<p>What is the most efficient way to display the last 10 lines of a very large text file (this particular file is over 10GB). I was thinking of just writing a simple C# app but I'm not sure how to do this effectively.</p>
[ { "answer_id": 398432, "author": "biozinc", "author_id": 30698, "author_profile": "https://Stackoverflow.com/users/30698", "pm_score": 1, "selected": false, "text": "FileInfo.Length" }, { "answer_id": 398512, "author": "jason", "author_id": 45914, "author_profile": "h...
2008/12/29
[ "https://Stackoverflow.com/questions/398378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2849/" ]
398,388
<p>How can i convert an array of bitmaps into a brand new image of TIFF format, adding all the bitmaps as frames in this new tiff image?</p> <p>using .NET 2.0.</p>
[ { "answer_id": 398529, "author": "Otávio Décio", "author_id": 48684, "author_profile": "https://Stackoverflow.com/users/48684", "pm_score": 7, "selected": true, "text": "Bitmap bitmap = (Bitmap)Image.FromFile(file);\n" }, { "answer_id": 7675996, "author": "Skadoosh", "aut...
2008/12/29
[ "https://Stackoverflow.com/questions/398388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35286/" ]
398,395
<p>Why do most C programmers name variables like this:</p> <pre><code>int *myVariable; </code></pre> <p>rather than like this:</p> <pre><code>int* myVariable; </code></pre> <p>Both are valid. It seems to me that the asterisk is a part of the type, not a part of the variable name. Can anyone explain this logic?</p>
[ { "answer_id": 398403, "author": "biozinc", "author_id": 30698, "author_profile": "https://Stackoverflow.com/users/30698", "pm_score": 7, "selected": false, "text": "*myVariable" }, { "answer_id": 398409, "author": "Greg Rogers", "author_id": 5963, "author_profile": "...
2008/12/29
[ "https://Stackoverflow.com/questions/398395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26149/" ]
398,425
<p>Say I have at database table containing information about a news article in each row. The table has an integer "sort" column to dictate the order in which the articles are to be presented on a web site. How do I best implement and maintain this sort order.</p> <p>The problem I want to avoid is having the the articl...
[ { "answer_id": 398709, "author": "Alkini", "author_id": 47522, "author_profile": "https://Stackoverflow.com/users/47522", "pm_score": 3, "selected": false, "text": "UPDATE Articles\nSET sort_number = sort_number + 1\nWHERE sort_number BETWEEN :new_sort_number and :current_sort_number - 1...
2008/12/29
[ "https://Stackoverflow.com/questions/398425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
398,441
<p>I'm playing around with Project Euler's <a href="http://projecteuler.net/index.php?section=problems&amp;id=220" rel="nofollow noreferrer">Problem 220</a>, and I'm a little confused about the Wikipedia article on the topic, <a href="http://en.wikipedia.org/wiki/Dragon_curve" rel="nofollow noreferrer">Dragon Curve</a>...
[ { "answer_id": 398526, "author": "Ned Batchelder", "author_id": 14343, "author_profile": "https://Stackoverflow.com/users/14343", "pm_score": 1, "selected": false, "text": "def k_and_m(n):\n k, m = n, 0\n while (k % 2) == 0:\n k >>= 1\n m += 1\n return k, m\n" } ...
2008/12/29
[ "https://Stackoverflow.com/questions/398441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13051/" ]
398,458
<p>I am trying to build a board game ... And looks like it has to be implemented using a state machine.. </p> <p>I know of the <a href="http://en.wikipedia.org/wiki/State_pattern" rel="nofollow noreferrer">State pattern</a> from GoF, but I am sure there must be other ways to implement state machine. Please let me know...
[ { "answer_id": 398527, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "public delegate void ProcessEvent<TEvent>(TEvent ev);\n\npublic abstract class StateMachine<TEvent>\n{\n private ProcessEve...
2008/12/29
[ "https://Stackoverflow.com/questions/398458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30917/" ]
398,468
<p>I've got a sql query (using Firebird as the RDBMS) in which I need to order the results by a field, EDITION. I need to order by the contents of the field, however. i.e. "NE" goes first, "OE" goes second, "OP" goes third, and blanks go last. Unfortunately, I don't have a clue how this could be accomplished. All I've ...
[ { "answer_id": 398484, "author": "Peter T. LaComb Jr.", "author_id": 8513, "author_profile": "https://Stackoverflow.com/users/8513", "pm_score": 3, "selected": false, "text": "Edition Rank\nNE 1\nOE 2\nOP 3\n" }, { "answer_id": 398486, "author": "Pulsehead"...
2008/12/29
[ "https://Stackoverflow.com/questions/398468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48957/" ]
398,476
<p>I'm trying to edit the output joomla main_menu module so I can make a custom dropdown menu. At the moment it currently outputs html like this:</p> <pre><code>&lt;ul class="menu"&gt; &lt;li class="active item1" id="current"&gt;&lt;a href="#"&gt;&lt;span&gt;First Level Item &lt;/span&lt;/a&gt;&lt;/li&gt; &lt;li cl...
[ { "answer_id": 477167, "author": "Jerph", "author_id": 1701, "author_profile": "https://Stackoverflow.com/users/1701", "pm_score": 3, "selected": false, "text": "ob_start();\nmodMainMenuHelper::render($params, 'modMainMenuXMLCallback');\n$mainMenuContent = ob_get_clean();\necho str_repla...
2008/12/29
[ "https://Stackoverflow.com/questions/398476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28672/" ]
398,491
<p>I've been tasked with fixing a dotnetnuke installation that was simply copied from one server to another and the first thing I need to do is figure out which version it is.</p> <p>What's the easiest way?</p>
[ { "answer_id": 398885, "author": "Ian Robinson", "author_id": 326, "author_profile": "https://Stackoverflow.com/users/326", "pm_score": 5, "selected": false, "text": "select top 1 * from version order by createddate desc\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/398491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/335036/" ]
398,509
<p>What are the advantages of replacing <code>(int)reader[0]</code> with <code>reader.GetInt32(0)</code>? I'm sure such casting functions are there for a reason, but other than it feeling more aesthetically pleasing to avoid the cast myself, I'm not sure what those reasons are.</p>
[ { "answer_id": 398605, "author": "StingyJack", "author_id": 16391, "author_profile": "https://Stackoverflow.com/users/16391", "pm_score": 4, "selected": true, "text": " void OneWay()\n {\n System.Data.SqlClient.SqlDataReader reader = null;\n int i = re...
2008/12/29
[ "https://Stackoverflow.com/questions/398509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18192/" ]
398,518
<p>I don't know if it's legit at StackOverflow to post your own answer to a question, but I saw nobody had asked this already. I went looking for a C# Glob and didn't find one, so I wrote one that others might find useful.</p>
[ { "answer_id": 398522, "author": "Mark Maxham", "author_id": 49737, "author_profile": "https://Stackoverflow.com/users/49737", "pm_score": 4, "selected": false, "text": " /// <summary>\n /// return a list of files that matches some wildcard pattern, e.g. \n /// C:\\p4\\software\...
2008/12/29
[ "https://Stackoverflow.com/questions/398518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49737/" ]
398,538
<p>I'm looking at building some web user controls with an eye toward re-use, but I can't seem to add a Web User Control in my class library in VS2008. Is there a way to work around this problem, or is there a better approach to creating reusable controls?</p>
[ { "answer_id": 398598, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "[DefaultProperty(\"Text\")]\n[Category(\"...\")]\n[DefaultValue(\"\")]\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/398538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23276/" ]
398,543
<p>While learning different languages, I've often seen objects allocated on the fly, most often in Java and C#, like this:</p> <pre><code>functionCall(new className(initializers)); </code></pre> <p>I understand that this is perfectly legal in memory-managed languages, but can this technique be used in C++ without cau...
[ { "answer_id": 398562, "author": "Harper Shelby", "author_id": 21196, "author_profile": "https://Stackoverflow.com/users/21196", "pm_score": 0, "selected": false, "text": "new T();\n" }, { "answer_id": 398637, "author": "JohnMcG", "author_id": 1674, "author_profile": ...
2008/12/29
[ "https://Stackoverflow.com/questions/398543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1256/" ]
398,547
<p>Assume a requirement of implementing a class "CAR".</p> <p>Now, this class contains various states like "un-ignited", "ignited", "broken-down", "punctured", etc.,</p> <p>The way I look at to implement this requirement is to have boolean flags aka "properties" in the class and 'check the state' using these boolean ...
[ { "answer_id": 398554, "author": "OscarRyz", "author_id": 20654, "author_profile": "https://Stackoverflow.com/users/20654", "pm_score": 2, "selected": false, "text": "//These are the states of the \"Pet\" class\n//sleep -> wake up -> play -> dinner -> sleep -> wake up .. etc. \nclass Pe...
2008/12/29
[ "https://Stackoverflow.com/questions/398547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
398,560
<p>How can I split by word boundary in a regex engine that doesn't support it?</p> <p>python's re can match on \b but doesn't seem to support splitting on it. I seem to recall dealing with other regex engines that had the same limitation.</p> <p>example input:</p> <pre><code>"hello, foo" </code></pre> <p>expected o...
[ { "answer_id": 398570, "author": "gnud", "author_id": 27204, "author_profile": "https://Stackoverflow.com/users/27204", "pm_score": 0, "selected": false, "text": ">>> re.compile(r'\\W\\b').split('hello, foo')\n['hello,', 'foo']\n" }, { "answer_id": 398584, "author": "Christia...
2008/12/29
[ "https://Stackoverflow.com/questions/398560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41613/" ]
398,571
<p>You know, what you normally get when typing ctrl-alt-del or ctrl-alt-end. Except in this scenario I can't press those keys, but I want to launch that box. Specifically I want to be able to pull up the change password dialog from the command line.</p> <p>Thanks</p>
[ { "answer_id": 7916160, "author": "Raymond Chen", "author_id": 902497, "author_profile": "https://Stackoverflow.com/users/902497", "pm_score": 2, "selected": false, "text": "Shell.WindowsSecurity" }, { "answer_id": 24028982, "author": "Ben Key", "author_id": 2532437, ...
2008/12/29
[ "https://Stackoverflow.com/questions/398571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/362693/" ]
398,621
<p>See subject, note that this question only applies to the .NET <strong>compact</strong> framework. This happens on the emulators that ship with Windows Mobile 6 Professional SDK as well as on my English HTC Touch Pro (all .NET CF 3.5). iso-8859-1 stands for Western European (ISO), which is probably the most important...
[ { "answer_id": 398683, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 4, "selected": false, "text": "System.Text.Encoding.GetEncoding(1252)\n" }, { "answer_id": 24618827, "author": "hdkrus", "author_id": 1195...
2008/12/29
[ "https://Stackoverflow.com/questions/398621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
398,641
<p>I have a factory that builds the objects with longest lifetime in my application. These have types, lets say, <code>ClientA</code> and <code>ClientB</code>, which depend on <code>Provider</code> (an abstract class with many possible implementations), so both clients have a reference to Provider as member.</p> <p>Ac...
[ { "answer_id": 398652, "author": "Stefan", "author_id": 48003, "author_profile": "https://Stackoverflow.com/users/48003", "pm_score": 0, "selected": false, "text": "delete provider;\nprovider = NULL;\n" }, { "answer_id": 398829, "author": "Rasmus Faber", "author_id": 5542...
2008/12/29
[ "https://Stackoverflow.com/questions/398641", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23477/" ]
398,648
<p>I want to make a table that simply has two integer columns to serve as a mapping table between two different data sets and I wish to put the correct constraints on it.</p> <p>I initially set the two columns as a compound primary key, but then realized that represents a many to many, only keeping duplicate many to m...
[ { "answer_id": 398659, "author": "Charles Bretana", "author_id": 32632, "author_profile": "https://Stackoverflow.com/users/32632", "pm_score": 2, "selected": true, "text": "CREATE TABLE [dbo].[test](\n [x] [int] NOT NULL,\n [y] [int] NOT NULL,\n CONSTRAINT [PK_test] PRIMARY KEY...
2008/12/29
[ "https://Stackoverflow.com/questions/398648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21367/" ]
398,664
<p>It seems vsize() and length() return the same results. Does anyone know of a practical example of when to use vsize instead of length?</p> <pre><code>select vsize(object_name), length(object_name) from user_objects </code></pre> <p>Result:</p> <pre><code>/468ba408_LDAPHelper 20 20 /de807749_LDAPHelper 20 ...
[ { "answer_id": 400392, "author": "David Aldridge", "author_id": 6742, "author_profile": "https://Stackoverflow.com/users/6742", "pm_score": 4, "selected": true, "text": "drop table daa_test;\ncreate table daa_test as select sysdate dt from dual;\nalter session set nls_date_format = 'YYYY...
2008/12/29
[ "https://Stackoverflow.com/questions/398664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/700/" ]
398,665
<p>I'm working on a demo that makes use of Spring.NET IoC capability in ASP.NET MVC . It's kind of like the MyBlog application presented on pair programming video tutorial on www.asp.net site. I've completed the same demo using Microsoft's Unity framework and now want to try out the Spring container. To that end I've i...
[ { "answer_id": 398749, "author": "Matthias Hryniszak", "author_id": 49970, "author_profile": "https://Stackoverflow.com/users/49970", "pm_score": 3, "selected": true, "text": "<!-- Controlers -->\n<object name=\"Home\" type=\"MyBlog.Controllers.HomeController\">\n <property name=\"Blo...
2008/12/29
[ "https://Stackoverflow.com/questions/398665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49970/" ]
398,682
<p>I have a macro that looks like this:</p> <pre><code>#define coutError if (VERBOSITY_SETTING &gt;= VERBOSITY_ERROR) ods() </code></pre> <p>where ods() is a class that behaves similarly to cout, and VERBOSITY_SETTING is a global variable. There are a few of these for different verbosity settings, and it allows...
[ { "answer_id": 398742, "author": "Roddy", "author_id": 1737, "author_profile": "https://Stackoverflow.com/users/1737", "pm_score": 3, "selected": true, "text": "#define coutError {} if (VERBOSITY_SETTING >= VERBOSITY_ERROR) ods()\n" }, { "answer_id": 398789, "author": "Dougla...
2008/12/29
[ "https://Stackoverflow.com/questions/398682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28776/" ]
398,708
<p>I'm working on wrapping my head around the factory pattern by using it in a simple data storage project in my free time. The idea is to take simple data and save it to a database using a simple factory pattern in VB.NET. I think I have a basic understanding of the pattern itself, however, what I'm struggling with ...
[ { "answer_id": 400055, "author": "Giraffe", "author_id": 50136, "author_profile": "https://Stackoverflow.com/users/50136", "pm_score": 1, "selected": false, "text": "public class FooConsumer1\n{\n public void DoStuff()\n {\n IFoo myFoo = new Foo();\n myFoo.Bar();\n ...
2008/12/29
[ "https://Stackoverflow.com/questions/398708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13955/" ]
398,734
<p>How can I specify a <code>td</code> tag should span all columns (when the exact amount of columns in the table will be variable/difficult to determine when the HTML is being rendered)? <a href="http://www.w3schools.com/tags/att_td_colspan.asp" rel="noreferrer">w3schools</a> mentions you can use <code>colspan="0"</co...
[ { "answer_id": 398763, "author": "George Stocker", "author_id": 16587, "author_profile": "https://Stackoverflow.com/users/16587", "pm_score": 4, "selected": false, "text": "colspan=\"5\"" }, { "answer_id": 1470950, "author": "Community", "author_id": -1, "author_profi...
2008/12/29
[ "https://Stackoverflow.com/questions/398734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45/" ]
398,747
<p>We have a database (SQL Server 2005) which we would like to get under source control. As part of that we are going to have a version table to store the current version number of the database. Is there a way to limit that table to only holding one row? Or is storing the version number in a table a bad idea? </p> ...
[ { "answer_id": 398765, "author": "Ole", "author_id": 49540, "author_profile": "https://Stackoverflow.com/users/49540", "pm_score": 1, "selected": false, "text": "SELECT v.version FROM version v ORDER by v.date DESC LIMIT 1;\n" }, { "answer_id": 398769, "author": "WOPR", "...
2008/12/29
[ "https://Stackoverflow.com/questions/398747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1973027/" ]
398,748
<p>I've created a new J2SE project in NetBeans, and I can run it from the IDE, but when I try to run it using Ant on the command line, I get the following problem:</p> <p>&lt;snip&gt;</p> <pre><code>run: [java] Exception in thread "main" java.lang.NoClassDefFoundError: IndexBuilder [java] Java Result: 1 </c...
[ { "answer_id": 604861, "author": "Eddie", "author_id": 57752, "author_profile": "https://Stackoverflow.com/users/57752", "pm_score": 1, "selected": false, "text": "IndexBuilder" }, { "answer_id": 604894, "author": "Steven Levine", "author_id": 63013, "author_profile":...
2008/12/29
[ "https://Stackoverflow.com/questions/398748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4203/" ]
398,760
<p>What's the difference between the following two pieces of HTML (apologies if there are any typos as I'm typing this freehand)?</p> <p>Using jQuery:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $("#clickme").click(function() { alert("clicked!"); ...
[ { "answer_id": 398797, "author": "orip", "author_id": 37020, "author_profile": "https://Stackoverflow.com/users/37020", "pm_score": 3, "selected": false, "text": "click" }, { "answer_id": 398800, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https:...
2008/12/29
[ "https://Stackoverflow.com/questions/398760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
398,781
<p>I want to build a nice API (C#) to make it easier for people to consume, I think I've seen this before and want to know how to do this:</p> <pre><code>MyNamespace.Cars car = null; if(someTestCondition) car = new Honda(); else car = new Toyota(); car.Drive(40); </code></pre> <p>Is this possible?...
[ { "answer_id": 398792, "author": "Otávio Décio", "author_id": 48684, "author_profile": "https://Stackoverflow.com/users/48684", "pm_score": 4, "selected": true, "text": "Interface Car\n{\nvoid Drive(int miles);\n}\n\nclass Honda : Car\n{\n...\n}\nclass Toyota : Car\n{\n...\n}\n" }, {...
2008/12/29
[ "https://Stackoverflow.com/questions/398781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
398,801
<p>I was wondering what everyone thinks of this. Is the code easy to follow? Or is there a better way to do this? By the way, this is how I am currently doing validation at the moment with ASP.NET MVC. I can follow it, but I am the one who wrote it. For some reason SO is removing the line breaks between the validators....
[ { "answer_id": 398877, "author": "thrashr888", "author_id": 46443, "author_profile": "https://Stackoverflow.com/users/46443", "pm_score": 0, "selected": false, "text": "email" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/398801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43380/" ]
398,802
<p>Has anyone attempted to use SQL Server Database as a Subversion file system back end? So that all Subversion Repositories would be stored in a SQL Database instead of a flat file system? Make for easier backups and reporting?</p>
[ { "answer_id": 398877, "author": "thrashr888", "author_id": 46443, "author_profile": "https://Stackoverflow.com/users/46443", "pm_score": 0, "selected": false, "text": "email" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/398802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7911/" ]
398,803
<p>I have two report parameters that were set up automatically when I created their associated datasets. They are ReportID and CompanyID. The user selects a Company Name from a list box and a Report Name from another list box. The standard SELECT ID, Name FROM TableName query was used to fill the respective list boxes....
[ { "answer_id": 398832, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 6, "selected": true, "text": "=Parameters!Farm.Label\n" }, { "answer_id": 15030288, "author": "Darren Griffith", "author_id": 770065, ...
2008/12/29
[ "https://Stackoverflow.com/questions/398803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
398,804
<p>I've got an existing Access MDB. I'm adding a command button to an existing Form that runs an existing report. The change being made is that this button needs to pass in a parameter containing the ID of the record being reported on - currently the report runs on every record in the MDB.</p> <p>I've altered the Qu...
[ { "answer_id": 398854, "author": "Fionnuala", "author_id": 2548, "author_profile": "https://Stackoverflow.com/users/2548", "pm_score": 6, "selected": true, "text": "DoCmd.OpenReport\"rptReport\", acViewPreview,,\"ID=\" & Me.ID\n" }, { "answer_id": 399338, "author": "Knox", ...
2008/12/29
[ "https://Stackoverflow.com/questions/398804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19074/" ]
398,806
<p>I have a view that I want to add some custom drawing to.</p> <p>I know how to do this with a View that isn't connected to a Nib/Xib file </p> <ul> <li>you write the drawing code in the <code>-drawRect:</code> method.</li> </ul> <p>But if I <code>init</code> the view using</p> <pre><code>[[MyView alloc] initWithN...
[ { "answer_id": 399027, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 2, "selected": false, "text": "addSubView:" }, { "answer_id": 399236, "author": "Chris Hanson", "author_id": 714, "author_profile": "...
2008/12/29
[ "https://Stackoverflow.com/questions/398806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1075/" ]
398,811
<p>I naively imagined that I could build a suffix trie where I keep a visit-count for each node, and then the deepest nodes with counts greater than one are the result set I'm looking for.</p> <p>I have a really really long string (hundreds of megabytes). I have about 1 GB of RAM.</p> <p>This is why building a suffix ...
[ { "answer_id": 398938, "author": "FryGuy", "author_id": 28776, "author_profile": "https://Stackoverflow.com/users/28776", "pm_score": 2, "selected": false, "text": "void LongSubstrings(string data, string prefix, IEnumerable<int> positions)\n{\n Dictionary<char, DiskBackedBuffer> buff...
2008/12/29
[ "https://Stackoverflow.com/questions/398811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15721/" ]
398,816
<p>I'm trying to write javascript to find page elements relative to a given element by using parentNode, firstChild, nextSibling, childNodes[], and so on. Firefox messes this up by inserting text nodes between each html element. I've read that I can defeat this by removing all whitespace between elements but I've tried...
[ { "answer_id": 398842, "author": "Ady", "author_id": 31395, "author_profile": "https://Stackoverflow.com/users/31395", "pm_score": 0, "selected": false, "text": "" }, { "answer_id": 398893, "author": "Jader Dias", "author_id": 48465, "author_profile": "https://Stackov...
2008/12/29
[ "https://Stackoverflow.com/questions/398816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44394/" ]
398,866
<p>I am running into a design disagreement with a co-worker and would like people's opinion on object constructor design. In brief, which object construction method would you prefer and why? </p> <pre><code> public class myClass { Application m_App; public myClass(ApplicationObject app) ...
[ { "answer_id": 399010, "author": "Robert C. Barth", "author_id": 9209, "author_profile": "https://Stackoverflow.com/users/9209", "pm_score": 3, "selected": true, "text": "Do.It(universe)\n" } ]
2008/12/29
[ "https://Stackoverflow.com/questions/398866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2916/" ]