qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
67,835
<p>Using VBA, how can I:</p> <ol> <li>test whether a file exists, and if so,</li> <li>delete it?</li> </ol>
[ { "answer_id": 67853, "author": "Leo Moore", "author_id": 6336, "author_profile": "https://Stackoverflow.com/users/6336", "pm_score": 3, "selected": false, "text": "Dir Kill test = Dir(Filename)\nIf Not test = \"\" Then\n Kill (Filename)\nEnd If\n" }, { "answer_id": 67858, ...
2008/09/15
[ "https://Stackoverflow.com/questions/67835", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10439/" ]
67,859
<p>I am trying to create a query string of variable assignments separated by the <code>&amp;</code> symbol (ex: <code>"var1=x&amp;var2=y&amp;..."</code>). I plan to pass this string into an embedded flash file.</p> <p>I am having trouble getting an <code>&amp;</code> symbol to show up in XSLT. If I just type <code>&am...
[ { "answer_id": 67876, "author": "Thunder3", "author_id": 2832, "author_profile": "https://Stackoverflow.com/users/2832", "pm_score": 3, "selected": false, "text": "disable-output-escaping=\"yes\" value-of" }, { "answer_id": 67892, "author": "tomasr", "author_id": 10292, ...
2008/09/15
[ "https://Stackoverflow.com/questions/67859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
67,879
<p>I have an application that runs as a child application in a virtual directory.</p> <p>I want to pass a value from the parent application, but I believe that Session is keyed per application, and won't work.</p> <p>To further complicate things, the parent application is WebForms, while the child is NVelocity MVC.</...
[ { "answer_id": 67935, "author": "foxxtrot", "author_id": 10369, "author_profile": "https://Stackoverflow.com/users/10369", "pm_score": 0, "selected": false, "text": "HttpWebRequest req = (HttpWebRequest)WebRequest.Create(\"/ASPSession.ASP?SessionVar=\" + SessionVarName);\nreq.Headers.Add...
2008/09/15
[ "https://Stackoverflow.com/questions/67879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
67,890
<p>I'm writing a web app that points to external links. I'm looking to create a non-sequential, non-guessable id for each document that I can use in the URL. I did the obvious thing: treating the url as a string and str#crypt on it, but that seems to choke on any non-alphanumberic characters, like the slashes, dots and...
[ { "answer_id": 67900, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "Digest::MD5.hexdigest(my_url)\n" }, { "answer_id": 68028, "author": "manveru", "author_id": 8367, "author_p...
2008/09/15
[ "https://Stackoverflow.com/questions/67890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10461/" ]
67,894
<p>Why do we need to use:</p> <pre><code>extern "C" { #include &lt;foo.h&gt; } </code></pre> <p><strong>Specifically:</strong> </p> <ul> <li><p>When should we use it?</p></li> <li><p>What is happening at the compiler/linker level that requires us to use it? </p></li> <li><p>How in terms of compilation/linking does...
[ { "answer_id": 67930, "author": "gnkdl_gansklgna", "author_id": 10470, "author_profile": "https://Stackoverflow.com/users/10470", "pm_score": 8, "selected": true, "text": "printf() _Zprintf extern \"C\" {...} extern extern \"C\"" }, { "answer_id": 67932, "author": "Trent", ...
2008/09/15
[ "https://Stackoverflow.com/questions/67894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1597/" ]
67,916
<p>I have something that is driving me absolutely crazy...</p> <pre><code> Public Function GetAccountGroups() As IList(Of AccountGroup) Dim raw_account_groups As IList(Of AccountGroup) raw_account_groups = _repository.GetAccountGroups().ToList() Dim parents = (From ag In raw_account_groups _...
[ { "answer_id": 68795, "author": "Jeff Moser", "author_id": 1869, "author_profile": "https://Stackoverflow.com/users/1869", "pm_score": 0, "selected": false, "text": "Module Module1\n Sub Main()\n End Sub\nEnd Module\n\nClass AccountGroup\n Public parent_id As Integer\n Public...
2008/09/15
[ "https://Stackoverflow.com/questions/67916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10479/" ]
67,937
<p>Does anyone know an easy way to import a raw, XML RSS feed into C#? Am looking for an easy way to get the XML as a string so I can parse it with a Regex.</p> <p>Thanks, -Greg</p>
[ { "answer_id": 68008, "author": "Darrel Miller", "author_id": 6819, "author_profile": "https://Stackoverflow.com/users/6819", "pm_score": 4, "selected": false, "text": "using System.Net \n\nWebClient wc = new WebClient();\n\nStream st = wc.OpenRead(“http://example.com/feed.rss”);\n\nusin...
2008/09/15
[ "https://Stackoverflow.com/questions/67937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8855/" ]
67,959
<p>I've run into a few gotchas when doing C# XML serialization that I thought I'd share:</p> <ul> <li>You can't serialize items that are read-only (like KeyValuePairs)</li> <li>You can't serialize a generic dictionary. Instead, try this wrapper class (from <a href="http://weblogs.asp.net/pwelter34/archive/2006/05/03/4...
[ { "answer_id": 68476, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "IEnumerables<T>" }, { "answer_id": 69072, "author": "user7116", "author_id": 7116, "author_profile": "https...
2008/09/15
[ "https://Stackoverflow.com/questions/67959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/109/" ]
67,980
<p>I need to pass a UUID instance via http request parameter. Spring needs a custom type converter (from String) to be registered. How do I register one?</p>
[ { "answer_id": 69314, "author": "alexei.vidmich", "author_id": 7199, "author_profile": "https://Stackoverflow.com/users/7199", "pm_score": 2, "selected": false, "text": "@InitBinder\npublic void initBinder(WebDataBinder binder) {\n binder.registerCustomEditor(UUID.class, new UUIDEdito...
2008/09/15
[ "https://Stackoverflow.com/questions/67980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7199/" ]
68,012
<p>I am relatively new to JavaScript and am trying to understand how to use it correctly.</p> <p>If I wrap JavaScript code in an anonymous function to avoid making variables <code>public</code> the functions within the JavaScript are not available from within the html that includes the JavaScript. </p> <p>On initiall...
[ { "answer_id": 68046, "author": "HFLW", "author_id": 252822, "author_profile": "https://Stackoverflow.com/users/252822", "pm_score": 1, "selected": false, "text": "<script type=\"text/javascript\">\n(function() {\n var private = \"private var\";\n window.onload = function() {\n ...
2008/09/15
[ "https://Stackoverflow.com/questions/68012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,018
<p>If I have a Resource bundle property file:</p> <p>A.properties:</p> <pre><code>thekey={0} This is a test </code></pre> <p>And then I have java code that loads the resource bundle:</p> <pre><code>ResourceBundle labels = ResourceBundle.getBundle("A", currentLocale); labels.getString("thekey"); </code></pre> <p>Ho...
[ { "answer_id": 68075, "author": "user10544", "author_id": 10544, "author_profile": "https://Stackoverflow.com/users/10544", "pm_score": 5, "selected": true, "text": "MessageFormat.format(\"{0} This {1} a test\", new Object[] {\"Yes!!!\", \"is\"});\n MessageFormat.format(\"{0} This {1} a ...
2008/09/15
[ "https://Stackoverflow.com/questions/68018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10522/" ]
68,029
<p>Got this from some mysql queries, puzzled since error 122 is usually a 'out of space' error but there's plenty of space left on the server... any ideas?</p>
[ { "answer_id": 28057763, "author": "Archil", "author_id": 4476218, "author_profile": "https://Stackoverflow.com/users/4476218", "pm_score": 2, "selected": false, "text": "quotaoff -a\n" } ]
2008/09/15
[ "https://Stackoverflow.com/questions/68029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,042
<p>Let's say that on the C++ side my function takes a variable of type <code>jstring</code> named <code>myString</code>. I can convert it to an ANSI string as follows:</p> <pre><code>const char* ansiString = env-&gt;GetStringUTFChars(myString, 0); </code></pre> <p>is there a way of getting</p> <p><code>const wchar_t...
[ { "answer_id": 68065, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "wchar_t" }, { "answer_id": 1666532, "author": "Benj", "author_id": 193128, "author_profile": "https://Sta...
2008/09/15
[ "https://Stackoverflow.com/questions/68042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,067
<p>I'm using BlogEngine.NET (a fine, fine tool) and I was playing with the TinyMCE editor and noticed that there's a place for me to create a list of external links, but it has to be a javascript file:</p> <p><code>external_link_list_url : "example_link_list.js"</code></p> <p>this is great, of course, but the list of...
[ { "answer_id": 68132, "author": "JustAsItSounds", "author_id": 10586, "author_profile": "https://Stackoverflow.com/users/10586", "pm_score": 2, "selected": false, "text": "context.Response.ContentType = \"text/javascript\";\n" }, { "answer_id": 68831, "author": "JustAsItSound...
2008/09/15
[ "https://Stackoverflow.com/questions/68067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7173/" ]
68,103
<p>I have a XULRunner application that needs to copy image data to the clipboard. I have figured out how to handle copying text to the clipboard, and I can paste PNG data from the clipboard. What I can't figure out is how to get data from a data URL into the clipboard so that it can be pasted into other applications.</...
[ { "answer_id": 130880, "author": "Joel Anair", "author_id": 7441, "author_profile": "https://Stackoverflow.com/users/7441", "pm_score": 3, "selected": true, "text": "dataURL var newImg=document.createElement('img');\nnewImg.src=dataURL;\n\ndocument.popupNode=newImg;\n\nvar command='cmd_c...
2008/09/16
[ "https://Stackoverflow.com/questions/68103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7441/" ]
68,109
<p>My professor did an informal benchmark on a little program and the Java times were: 1.7 seconds for the first run, and 0.8 seconds for the runs thereafter. </p> <ul> <li><p>Is this due entirely to the loading of the runtime environment into the operating environment ?</p> <p>OR </p></li> <li><p>Is it influenced b...
[ { "answer_id": 68602, "author": "big_peanut_horse", "author_id": 10720, "author_profile": "https://Stackoverflow.com/users/10720", "pm_score": 2, "selected": false, "text": "java.lang.String.equals(...)" } ]
2008/09/16
[ "https://Stackoverflow.com/questions/68109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10577/" ]
68,113
<p>I've just inherited a java application that needs to be installed as a service on XP and vista. It's been about 8 years since I've used windows in any form and I've never had to create a service, let alone from something like a java app (I've got a jar for the app and a single dependency jar - log4j). What is the m...
[ { "answer_id": 10756495, "author": "11101101b", "author_id": 875305, "author_profile": "https://Stackoverflow.com/users/875305", "pm_score": 6, "selected": false, "text": "MyServiceName.exe MyServiceNamew.exe RCEDIT.exe > RCEDIT.exe /I MyServiceName.exe customIcon.ico\n> RCEDIT.exe /I My...
2008/09/16
[ "https://Stackoverflow.com/questions/68113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10273/" ]
68,120
<p>I'm not overly familiar with Tomcat, but my team has inherited a complex project that revolves around a Java Servlet being hosted in Tomcat across many servers. Custom configuration management software is used to write out the server.xml, and various resources (connection pools, beans, server variables, etc) written...
[ { "answer_id": 10756495, "author": "11101101b", "author_id": 875305, "author_profile": "https://Stackoverflow.com/users/875305", "pm_score": 6, "selected": false, "text": "MyServiceName.exe MyServiceNamew.exe RCEDIT.exe > RCEDIT.exe /I MyServiceName.exe customIcon.ico\n> RCEDIT.exe /I My...
2008/09/16
[ "https://Stackoverflow.com/questions/68120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10452/" ]
68,150
<p>I took a data structures class in C++ last year, and consequently implemented all the major data structures in templated code. I saved it all on a flash drive because I have a feeling that at some point in my life, I'll use it again. I imagine <em>something</em> I end up programming will need a B-Tree, or is that ...
[ { "answer_id": 68170, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 2, "selected": false, "text": "junk/" } ]
2008/09/16
[ "https://Stackoverflow.com/questions/68150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7545/" ]
68,160
<p>Is it possible to get gdb or use some other tools to create a core dump of a running process and it's symbol table? It would be great if there's a way to do this without terminating the process. </p> <p>If this is possible, what commands would you use? (I'm trying to do this on a Linux box)</p>
[ { "answer_id": 14279282, "author": "Alex Zeffertt", "author_id": 779147, "author_profile": "https://Stackoverflow.com/users/779147", "pm_score": 6, "selected": false, "text": "gcore $(pidof processname)" }, { "answer_id": 43099251, "author": "dev", "author_id": 2456048, ...
2008/09/16
[ "https://Stackoverflow.com/questions/68160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
68,165
<p>I have a link on a long HTML page. When I click it, I wish a <code>div</code> on another part of the page to be visible in the window by scrolling into view.</p> <p>A bit like <code>EnsureVisible</code> in other languages.</p> <p>I've checked out <code>scrollTop</code> and <code>scrollTo</code> but they seem like...
[ { "answer_id": 68175, "author": "mjallday", "author_id": 6084, "author_profile": "https://Stackoverflow.com/users/6084", "pm_score": 4, "selected": false, "text": "<a href=\"#myAnchorALongWayDownThePage\">Click here to scroll</a>\n\n<A name='myAnchorALongWayDownThePage\"></a>\n" }, {...
2008/09/16
[ "https://Stackoverflow.com/questions/68165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,234
<p>Let’s say I'm developing a helpdesk application that will be used by multiple departments. Every URL in the application will include a key indicating the specific department. The key will always be the first parameter of every action in the system. For example</p> <pre><code>http://helpdesk/HR/Members http://helpde...
[ { "answer_id": 72330, "author": "Craig Stuntz", "author_id": 7714, "author_profile": "https://Stackoverflow.com/users/7714", "pm_score": 0, "selected": false, "text": "public abstract class BaseController : Controller \n{\n}\n\npublic class DerivedController : BaseController \n{\n}\n" ...
2008/09/16
[ "https://Stackoverflow.com/questions/68234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,243
<p>I'm looking to write a programming language for fun, however most of the resource I have seen are for writing a context free language, however I wish to write a language that, like python, uses indentation, which to my understanding means it can't be context free.</p>
[ { "answer_id": 68362, "author": "Daniel Spiewak", "author_id": 9815, "author_profile": "https://Stackoverflow.com/users/9815", "pm_score": 0, "selected": false, "text": "my_essay = << END_STR\nThis is within the string\nEND_STR\n\n<< self\n def other_method\n ...\n end\nend\n def do...
2008/09/16
[ "https://Stackoverflow.com/questions/68243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,247
<p>I sometimes need to modify OSS code or other peoples' code (usually C-based, but sometimes C++/Java) and find myself "grep"ing headers for types, function declarations etc. as I follow code flow and try to understand the system. Is there a good tool that exists to aid in code browsing. I'd love to be able to click...
[ { "answer_id": 68367, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": " Find this C symbol:\n Find this function definition:\n Find functions called by this function:\n Find functions callin...
2008/09/16
[ "https://Stackoverflow.com/questions/68247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,282
<p>When defining a method on a class in Python, it looks something like this:</p> <pre><code>class MyClass(object): def __init__(self, x, y): self.x = x self.y = y </code></pre> <p>But in some other languages, such as C#, you have a reference to the object that the method is bound to with the "thi...
[ { "answer_id": 68320, "author": "Ryan", "author_id": 8819, "author_profile": "https://Stackoverflow.com/users/8819", "pm_score": 6, "selected": false, "text": ">>> class C:\n... def foo(self):\n... print(\"Hi!\")\n...\n>>>\n>>> def bar(self):\n... print(\"Bork bork bork!\...
2008/09/16
[ "https://Stackoverflow.com/questions/68282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
68,283
<p>What's a quick and easy way to view and edit ID3 tags (artist, album, etc.) using C#?</p>
[ { "answer_id": 68407, "author": "mmcdole", "author_id": 2635, "author_profile": "https://Stackoverflow.com/users/2635", "pm_score": 6, "selected": false, "text": "class MusicID3Tag\n\n{\n\n public byte[] TAGID = new byte[3]; // 3\n public byte[] Title = new byte[30]; // ...
2008/09/16
[ "https://Stackoverflow.com/questions/68283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10606/" ]
68,291
<p>If you were running a news site that created a list of 10 top news stories, and you wanted to make tweaks to your algorithm and see if people liked the new top story mix better, how would you approach this? </p> <p>Simple Click logging in the DB associated with the post entry? </p> <p>A/B testing where you would s...
[ { "answer_id": 68407, "author": "mmcdole", "author_id": 2635, "author_profile": "https://Stackoverflow.com/users/2635", "pm_score": 6, "selected": false, "text": "class MusicID3Tag\n\n{\n\n public byte[] TAGID = new byte[3]; // 3\n public byte[] Title = new byte[30]; // ...
2008/09/16
[ "https://Stackoverflow.com/questions/68291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/281/" ]
68,323
<p>Working on a project at the moment and we have to implement soft deletion for the majority of users (user roles). We decided to add an <code>is_deleted='0'</code> field on each table in the database and set it to <code>'1'</code> if particular user roles hit a delete button on a specific record.</p> <p>For future m...
[ { "answer_id": 68328, "author": "David J. Sokol", "author_id": 1390, "author_profile": "https://Stackoverflow.com/users/1390", "pm_score": 7, "selected": true, "text": "WHERE IS_DELETED='0'" }, { "answer_id": 68338, "author": "ctcherry", "author_id": 10322, "author_pr...
2008/09/16
[ "https://Stackoverflow.com/questions/68323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10583/" ]
68,327
<p>I create a new Button object but did not specify the <code>command</code> option upon creation. Is there a way in Tkinter to change the command (onclick) function after the object has been created?</p>
[ { "answer_id": 68455, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 2, "selected": false, "text": "bind from Tkinter import Tk, Button\n\nroot = Tk()\nbutton = Button(root, text=\"Click Me!\")\nbutton.pack()\n\ndef c...
2008/09/16
[ "https://Stackoverflow.com/questions/68327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/680/" ]
68,335
<p>I have a text file on my local machine that is generated by a daily Python script run in cron. </p> <p>I would like to add a bit of code to have that file sent securely to my server over SSH.</p>
[ { "answer_id": 68365, "author": "pdq", "author_id": 8598, "author_profile": "https://Stackoverflow.com/users/8598", "pm_score": 7, "selected": true, "text": "scp subprocess.run import subprocess\nsubprocess.run([\"scp\", FILE, \"USER@SERVER:PATH\"])\n#e.g. subprocess.run([\"scp\", \"foo....
2008/09/16
[ "https://Stackoverflow.com/questions/68335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10668/" ]
68,346
<p>Here's a problem I've been trying to solve at work. I'm not a database expert, so that perhaps this is a bit sophomoric. All apologies.</p> <p>I have a given database D, which has been duplicated on another machine (in a perhaps dubious manner), resulting in database D'. It is my task to check that database D an...
[ { "answer_id": 2533784, "author": "user303677", "author_id": 303677, "author_profile": "https://Stackoverflow.com/users/303677", "pm_score": 2, "selected": false, "text": "SELECT s.name, s.type \nFROM \n(\n SELECT s1.name, s1.type\n FROM syscolumns s1\n WHERE object_name(s1.id) ...
2008/09/16
[ "https://Stackoverflow.com/questions/68346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10675/" ]
68,352
<p>I use this question in interviews and I wonder what the best solution is.</p> <p>Write a Perl sub that takes <em>n</em> lists, and then returns 2^<em>n</em>-1 lists telling you which items are in which lists; that is, which items are only in the first list, the second, list, both the first and second list, and all ...
[ { "answer_id": 68417, "author": "nohat", "author_id": 3101, "author_profile": "https://Stackoverflow.com/users/3101", "pm_score": 0, "selected": false, "text": "sub list_compare {\n my (@lists) = @_;\n my %compare;\n my $bit = 1;\n foreach my $list (@lists) {\n $compar...
2008/09/16
[ "https://Stackoverflow.com/questions/68352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3101/" ]
68,372
<p>We all know how to use <code>&lt;ctrl&gt;-R</code> to reverse search through history, but did you know you can use <code>&lt;ctrl&gt;-S</code> to forward search if you set <code>stty stop ""</code>? Also, have you ever tried running bind -p to see all of your keyboard shortcuts listed? There are over 455 on Mac OS...
[ { "answer_id": 68388, "author": "HFLW", "author_id": 252822, "author_profile": "https://Stackoverflow.com/users/252822", "pm_score": 4, "selected": false, "text": "watch --interval=10 lynx -dump http://dslrouter/stats.html\n" }, { "answer_id": 68390, "author": "ctcherry", ...
2008/09/16
[ "https://Stackoverflow.com/questions/68372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3499/" ]
68,391
<p>In an effort to reduce code duplication in my little Rails app, I've been working on getting common code between my models into it's own separate module, so far so good.</p> <p>The model stuff is fairly easy, I just have to include the module at the beginning, e.g.:</p> <pre><code>class Iso &lt; Sale include Sha...
[ { "answer_id": 68934, "author": "hoyhoy", "author_id": 3499, "author_profile": "https://Stackoverflow.com/users/3499", "pm_score": 3, "selected": false, "text": "# maybe put this in environment.rb or in your module declaration\nclass ActiveRecord::Base\n include Iso\nend\n\n# applicatio...
2008/09/16
[ "https://Stackoverflow.com/questions/68391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/841/" ]
68,408
<p>Is there any <strong>simple algorithm</strong> to determine the likeliness of 2 names representing the same person? </p> <p>I'm not asking for something of the level that Custom department might be using. Just a simple algorithm that would tell me if 'James T. Clark' is most likely the same name as 'J. Thomas Clark...
[ { "answer_id": 68570, "author": "Stanislav Kniazev", "author_id": 10757, "author_profile": "https://Stackoverflow.com/users/10757", "pm_score": 3, "selected": true, "text": "PartialStringComparer cmp = new PartialStringComparer();\ntbResult.Text = cmp.Compare(textBox1.Text, textBox2.Text...
2008/09/16
[ "https://Stackoverflow.com/questions/68408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3610/" ]
68,444
<p>We have a program that produces several SWF files, some CSS and XML files, all of which need to be deployed for the thing to work.</p> <p>Is there a program or technique out there for wrapping all these files together into a single SWF file?</p>
[ { "answer_id": 192919, "author": "Theo", "author_id": 1109, "author_profile": "https://Stackoverflow.com/users/1109", "pm_score": 1, "selected": false, "text": "mxmlc package {\n\n\n public class Assets {\n\n [Embed(source=\"another.swf\")]\n public var another : Class;\n\n }\n\n...
2008/09/16
[ "https://Stackoverflow.com/questions/68444", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6277/" ]
68,447
<p>From the Displays pane in System Preferences, I can manually change the main monitor by dragging the menu bar from one display to the other. I'd like to automate this and make it part of an AppleScript.</p>
[ { "answer_id": 1906298, "author": "Laurent Etiemble", "author_id": 121278, "author_profile": "https://Stackoverflow.com/users/121278", "pm_score": 2, "selected": false, "text": "/Library/Preferences/com.apple.windowserver.plist DisplayMainOnInternal DisplaySets IOFlags /Library/Preferenc...
2008/09/16
[ "https://Stackoverflow.com/questions/68447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6311/" ]
68,477
<p>Is there a way to send a file using POST from a Python script?</p>
[ { "answer_id": 68502, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 5, "selected": false, "text": "urllib2 multipart/form-data user_agent = \"image uploader\"\ndefault_message = \"Image $current of $total\"\n\nimport l...
2008/09/16
[ "https://Stackoverflow.com/questions/68477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
68,485
<p>In <b>Prototype</b> I can show a "loading..." image with this code:</p> <pre><code>var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: showLoad, onComplete: showResponse} ); function showLoad () { ... } </code></pre> <p>In <b>jQuery</b>, I can load a server page into an element w...
[ { "answer_id": 68503, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 11, "selected": true, "text": "$('#loadingDiv')\n .hide() // Hide it initially\n .ajaxStart(function() {\n $(this).show();\n })\n .ajaxSto...
2008/09/16
[ "https://Stackoverflow.com/questions/68485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4639/" ]
68,509
<p>If I use the following code I lose the ability to right click on variables in the code behind and refactor (rename in this case) them</p> <pre><code>&lt;a href='&lt;%# "/Admin/Content/EditResource.aspx?ResourceId=" + Eval("Id").ToString() %&gt;'&gt;Edit&lt;/a&gt; </code></pre> <p>I see this practice everywhere but...
[ { "answer_id": 70100, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<a href='<%# DataBinder.Eval(Container.DataItem,\"Id\",\"\"/Admin/Content/EditResource.aspx?ResourceId={0}\") %'>\n" } ]
2008/09/16
[ "https://Stackoverflow.com/questions/68509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6084/" ]
68,537
<p>A basic problem I run into quite often, but ever found a clean solution to, is one where you want to code behaviour for interaction between different objects of a common base class or interface. To make it a bit concrete, I'll throw in an example;</p> <p><em>Bob has been coding on a strategy game which supports "co...
[ { "answer_id": 68560, "author": "Jiaaro", "author_id": 2908, "author_profile": "https://Stackoverflow.com/users/2908", "pm_score": 0, "selected": false, "text": " boat = new\niUnit(\"watercraft\") field = new\niTerrain(\"grass\")\nfield.effects(boat) \npublic class hovercraft : unit {\n ...
2008/09/16
[ "https://Stackoverflow.com/questions/68537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2166173/" ]
68,541
<p>When trying to use <code>libxml2</code> as myself I get an error saying the package cannot be found. If I run as as super user I am able to import fine.</p> <p>I have installed <code>python25</code> and all <code>libxml2</code> and <code>libxml2-py25</code> related libraries via fink and own the entire path includi...
[ { "answer_id": 69513, "author": "Ana Betts", "author_id": 5728, "author_profile": "https://Stackoverflow.com/users/5728", "pm_score": 2, "selected": false, "text": "'echo $PATH'\n" }, { "answer_id": 77114, "author": "Community", "author_id": -1, "author_profile": "htt...
2008/09/16
[ "https://Stackoverflow.com/questions/68541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,543
<p>So, I am kinda new to ASP.net development still, and I already don't like the stock ASP.net controls for displaying my database query results in table format. (I.e. I would much rather handle the HTML myself and so would the designer!)</p> <p>So my question is: What is the best and most secure practice for doing th...
[ { "answer_id": 68556, "author": "David J. Sokol", "author_id": 1390, "author_profile": "https://Stackoverflow.com/users/1390", "pm_score": 3, "selected": true, "text": "<Repeater>" } ]
2008/09/16
[ "https://Stackoverflow.com/questions/68543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/506/" ]
68,561
<p>1, Create and build a default Windows Forms project and look at the project properties. It says that the project is targetting .NET Framework 2.0. </p> <p>2, Create a Setup project that installs just the single executable from the Windows Forms project. </p> <p>3, Run that installer and it always says that it need...
[ { "answer_id": 71018, "author": "Phil Wright", "author_id": 6276, "author_profile": "https://Stackoverflow.com/users/6276", "pm_score": 1, "selected": false, "text": "\"Deployable\"\n{\n \"CustomAction\"\n {\n }\n \"DefaultFeature\"\n {\n \"Name\" = \"8:DefaultFeature\"...
2008/09/16
[ "https://Stackoverflow.com/questions/68561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6276/" ]
68,565
<p>I like the XMLReader class for it's simplicity and speed. But I like the xml_parse associated functions as it better allows for error recovery. It would be nice if the XMLReader class would throw exceptions for things like invalid entity refs instead of just issuinng a warning.</p>
[ { "answer_id": 68615, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 3, "selected": true, "text": "<p>\n Here is <strong>a very simple</strong> XML document.\n</p>\n" }, { "answer_id": 77607, "author": "Community...
2008/09/16
[ "https://Stackoverflow.com/questions/68565", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,569
<p>I am a C++/C# developer and never spent time working on web pages. I would like to put text (randomly and diagonally perhaps) in large letters across the background of some pages. I want to be able to read the foreground text and also be able to read the "watermark". I understand that is probably more of a functi...
[ { "answer_id": 68591, "author": "dawnerd", "author_id": 69503, "author_profile": "https://Stackoverflow.com/users/69503", "pm_score": 2, "selected": false, "text": "<style type=\"text/css\">\n.watermark{background:url(urltoimage.png);}\n</style>\n<div class=\"watermark\">\n<p>this is som...
2008/09/16
[ "https://Stackoverflow.com/questions/68569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10755/" ]
68,572
<p>I have a question that I may be over thinking at this point but here goes...</p> <p>I have 2 classes Users and Groups. Users and groups have a many to many relationship and I was thinking that the join table group_users I wanted to have an IsAuthorized property (because some groups are private -- users will need au...
[ { "answer_id": 68591, "author": "dawnerd", "author_id": 69503, "author_profile": "https://Stackoverflow.com/users/69503", "pm_score": 2, "selected": false, "text": "<style type=\"text/css\">\n.watermark{background:url(urltoimage.png);}\n</style>\n<div class=\"watermark\">\n<p>this is som...
2008/09/16
[ "https://Stackoverflow.com/questions/68572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385358/" ]
68,578
<p>Is there a way to fall through multiple case statements without stating <code>case value:</code> repeatedly?</p> <p>I know this works:</p> <pre><code>switch (value) { case 1: case 2: case 3: // Do some stuff break; case 4: case 5: case 6: // Do some different stuff break; ...
[ { "answer_id": 68620, "author": "Neal", "author_id": 7071, "author_profile": "https://Stackoverflow.com/users/7071", "pm_score": 6, "selected": false, "text": "Dim number As Integer = 8\nSelect Case number\n Case 1 To 5\n Debug.WriteLine(\"Between 1 and 5, inclusive\")\n ...
2008/09/16
[ "https://Stackoverflow.com/questions/68578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7870/" ]
68,583
<p>I have the following code snippet.</p> <pre><code>$items['A'] = "Test"; $items['B'] = "Test"; $items['C'] = "Test"; $items['D'] = "Test"; $index = 0; foreach($items as $key =&gt; $value) { echo "$index is a $key containing $value\n"; $index++; } </code></pre> <p>Expected output:</p> <pre><code>0 is a A c...
[ { "answer_id": 68647, "author": "dawnerd", "author_id": 69503, "author_profile": "https://Stackoverflow.com/users/69503", "pm_score": 2, "selected": false, "text": "$items[A] = \"Test\";\n$items[B] = \"Test\";\n$items[C] = \"Test\";\n$items[D] = \"Test\";\n\nfor($i=0;$i<count($items);$i+...
2008/09/16
[ "https://Stackoverflow.com/questions/68583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/264/" ]
68,598
<p>I've seen this done in Borland's <a href="https://en.wikipedia.org/wiki/Turbo_C++" rel="noreferrer">Turbo C++</a> environment, but I'm not sure how to go about it for a C# application I'm working on. Are there best practices or gotchas to look out for?</p>
[ { "answer_id": 68722, "author": "Judah Gabriel Himango", "author_id": 536, "author_profile": "https://Stackoverflow.com/users/536", "pm_score": 6, "selected": false, "text": "DragEnter AllowedEffect e.Effect = DragDropEffects.Move DragDrop" }, { "answer_id": 89470, "author": ...
2008/09/16
[ "https://Stackoverflow.com/questions/68598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,610
<p>I am having problems getting text within a table to appear centered in IE. </p> <p>In Firefox 2, 3 and Safari everything work fine, but for some reason, the text doesn't appear centered in IE 6 or 7. </p> <p>I'm using:</p> <pre class="lang-css prettyprint-override"><code>h2 { font: 300 12px "Helvetica", serif; ...
[ { "answer_id": 68637, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 0, "selected": false, "text": "text-align: center font" }, { "answer_id": 68643, "author": "1077", "author_id": 10776, "author_profile": "...
2008/09/16
[ "https://Stackoverflow.com/questions/68610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10761/" ]
68,614
<p>I have a large application that uses EJB 2.x entity beans (BMP). This is well-known to be a horrible persistence strategy (I can elaborate if necessary).</p> <p>I'd like to start migrating this application to use a much more expressive, transparent, and non-invasive persistence strategy, and given my company's prev...
[ { "answer_id": 68637, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 0, "selected": false, "text": "text-align: center font" }, { "answer_id": 68643, "author": "1077", "author_id": 10776, "author_profile": "...
2008/09/16
[ "https://Stackoverflow.com/questions/68614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10433/" ]
68,617
<p>This is re-posted from something I posted on the DDD Yahoo! group.</p> <p>All things being equal, do you write phone.dial(phoneNumber) or phoneNumber.dialOn(phone)? Keep in mind possible future requirements (account numbers in addition to phone numbers, calculators in addition to phones).</p> <p>The choice tends t...
[ { "answer_id": 68625, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 4, "selected": false, "text": "phone.dial()" }, { "answer_id": 69023, "author": "Steven A. Lowe", "author_id": 9345, "author_profile...
2008/09/16
[ "https://Stackoverflow.com/questions/68617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10759/" ]
68,624
<p>I would like to parse a string such as <code>p1=6&amp;p2=7&amp;p3=8</code> into a <code>NameValueCollection</code>.</p> <p>What is the most elegant way of doing this when you don't have access to the <code>Page.Request</code> object?</p>
[ { "answer_id": 68648, "author": "Guy Starbuck", "author_id": 2194, "author_profile": "https://Stackoverflow.com/users/2194", "pm_score": 10, "selected": true, "text": "// C#\nNameValueCollection qscoll = HttpUtility.ParseQueryString(querystring);\n ' VB.NET\nDim qscoll As NameValueCollec...
2008/09/16
[ "https://Stackoverflow.com/questions/68624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4998/" ]
68,630
<p>Is there any performance difference between tuples and lists when it comes to instantiation and retrieval of elements? </p>
[ { "answer_id": 68712, "author": "dF.", "author_id": 3002, "author_profile": "https://Stackoverflow.com/users/3002", "pm_score": 8, "selected": false, "text": "$ python -m timeit \"x=(1,2,3,4,5,6,7,8)\"\n10000000 loops, best of 3: 0.0388 usec per loop\n\n$ python -m timeit \"x=[1,2,3,4,5,...
2008/09/16
[ "https://Stackoverflow.com/questions/68630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
68,633
<p>I need a Regex that will match a java method declaration. I have come up with one that will match a method declaration, but it requires the opening bracket of the method to be on the same line as the declaration. If you have any suggestions to improve my regex or simply have a better one then please submit an answer...
[ { "answer_id": 68669, "author": "Mike Stone", "author_id": 122, "author_profile": "https://Stackoverflow.com/users/122", "pm_score": 3, "selected": true, "text": "(?:(?:public)|(?:private)|(?:static)|(?:protected)\\s+)*\n" }, { "answer_id": 68697, "author": "akdom", "auth...
2008/09/16
[ "https://Stackoverflow.com/questions/68633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340/" ]
68,640
<p>Is it possible in C# to have a Struct with a member variable which is a Class type? If so, where does the information get stored, on the Stack, the Heap, or both?</p>
[ { "answer_id": 68681, "author": "Eric Z Beard", "author_id": 1219, "author_profile": "https://Stackoverflow.com/users/1219", "pm_score": 6, "selected": true, "text": "using System;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n ...
2008/09/16
[ "https://Stackoverflow.com/questions/68640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10722/" ]
68,645
<p>How do I create class (i.e. <a href="https://en.wikipedia.org/wiki/Method_(computer_programming)#Static_methods" rel="nofollow noreferrer">static</a>) variables or methods in Python?</p>
[ { "answer_id": 68672, "author": "Blair Conrad", "author_id": 1199, "author_profile": "https://Stackoverflow.com/users/1199", "pm_score": 12, "selected": true, "text": ">>> class MyClass:\n... i = 3\n...\n>>> MyClass.i\n3 \n i i >>> m = MyClass()\n>>> m.i = 4\n>>> MyClass.i, m.i\n>>> ...
2008/09/16
[ "https://Stackoverflow.com/questions/68645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2246/" ]
68,651
<p>If I pass PHP variables with <code>.</code> in their names via $_GET PHP auto-replaces them with <code>_</code> characters. For example:</p> <pre><code>&lt;?php echo "url is ".$_SERVER['REQUEST_URI']."&lt;p&gt;"; echo "x.y is ".$_GET['x.y'].".&lt;p&gt;"; echo "x_y is ".$_GET['x_y'].".&lt;p&gt;"; </code></pre> <p>....
[ { "answer_id": 68742, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 7, "selected": true, "text": "<?php\n$varname.ext; /* invalid variable name */\n?>\n" }, { "answer_id": 1939911, "author": "crb", "author...
2008/09/16
[ "https://Stackoverflow.com/questions/68651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,664
<p>Suppose I have:</p> <ol> <li>Toby</li> <li>Tiny</li> <li>Tory</li> <li>Tily</li> </ol> <p>Is there an algorithm that can easily create a list of common characters in the same positions in all these strings? (in this case the common characters are 'T' at position 0 and 'y' at position 3)</p> <p>I tried looking at...
[ { "answer_id": 68752, "author": "Josh Smeaton", "author_id": 10583, "author_profile": "https://Stackoverflow.com/users/10583", "pm_score": 1, "selected": false, "text": "str[] = { \"Toby\", \"Tiny\", \"Tory\", \"Tily\" };\nresult = null;\nlargestString = str.getLargestString(); // Made u...
2008/09/16
[ "https://Stackoverflow.com/questions/68664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9825/" ]
68,666
<p>Why does the following code sometimes causes an Exception with the contents "CLIPBRD_E_CANT_OPEN":</p> <pre><code>Clipboard.SetText(str); </code></pre> <p>This usually occurs the first time the Clipboard is used in the application and not after that.</p>
[ { "answer_id": 69081, "author": "Robert Wagner", "author_id": 10784, "author_profile": "https://Stackoverflow.com/users/10784", "pm_score": 6, "selected": false, "text": "for (int i = 0; i < 10; i++)\n{\n try\n {\n Clipboard.SetText(str);\n return;\n }\n catch {...
2008/09/16
[ "https://Stackoverflow.com/questions/68666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10784/" ]
68,677
<p>I'm using SQL Server 2000 to print out some values from a table using <code>PRINT</code>. With most non-string data, I can cast to nvarchar to be able to print it, but binary values attempt to convert using the bit representation of characters. For example:</p> <pre><code>DECLARE @binvalue binary(4) SET @binvalue...
[ { "answer_id": 68858, "author": "Ricardo C", "author_id": 232589, "author_profile": "https://Stackoverflow.com/users/232589", "pm_score": 2, "selected": false, "text": "DECLARE @binvalue binary(4)\nSET @binvalue = 0x61000000\nPRINT @binvalue \nPRINT cast('a' AS binary(4))\nPRINT cast(0x6...
2008/09/16
[ "https://Stackoverflow.com/questions/68677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3750/" ]
68,691
<p>After cleaning a folder full of HTML files with TIDY, how can the tables content be extracted for further processing?</p>
[ { "answer_id": 73418, "author": "pdc", "author_id": 8925, "author_profile": "https://Stackoverflow.com/users/8925", "pm_score": 2, "selected": true, "text": "Content-Type application/ms-vnd.excel" } ]
2008/09/16
[ "https://Stackoverflow.com/questions/68691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1359937/" ]
68,711
<p>any idea how if the following is possible in PHP as a single line ?:</p> <pre><code>&lt;?php $firstElement = functionThatReturnsAnArray()[0]; </code></pre> <p>... It doesn't seem to 'take'. I need to do this as a 2-stepper:</p> <pre><code>&lt;?php $allElements = functionThatReturnsAnArray(); $firstElement = $allE...
[ { "answer_id": 68745, "author": "calebbrown", "author_id": 7007, "author_profile": "https://Stackoverflow.com/users/7007", "pm_score": 4, "selected": true, "text": "<?php\n$firstElement = reset(functionThatReturnsAnArray());\n" }, { "answer_id": 68828, "author": "Scott Reynen...
2008/09/16
[ "https://Stackoverflow.com/questions/68711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,749
<p>Using .Net (C#), how can you work with USB devices? </p> <p>How can you detect USB events (connections/disconnections) and how do you communicate with devices (read/write).</p> <p>Is there a native .Net solution to do this?</p>
[ { "answer_id": 13829628, "author": "Syn", "author_id": 1895588, "author_profile": "https://Stackoverflow.com/users/1895588", "pm_score": 4, "selected": false, "text": "class USBControl : IDisposable\n {\n // used for monitoring plugging and unplugging of USB devices.\n p...
2008/09/16
[ "https://Stackoverflow.com/questions/68749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5903/" ]
68,750
<p>This should hopefully be a simple one.</p> <p>I would like to add an extension method to the System.Web.Mvc.ViewPage&lt; T > class.</p> <p>How should this extension method look?</p> <p>My first intuitive thought is something like this:</p> <pre><code>namespace System.Web.Mvc { public static class ViewPageExt...
[ { "answer_id": 68772, "author": "David Thibault", "author_id": 5903, "author_profile": "https://Stackoverflow.com/users/5903", "pm_score": 5, "selected": true, "text": "namespace System.Web.Mvc\n{\n public static class ViewPageExtensions\n {\n public static string GetDefault...
2008/09/16
[ "https://Stackoverflow.com/questions/68750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364/" ]
68,774
<p>I want to open a TCP client socket in Python. Do I have to go through all the low-level BSD create-socket-handle / connect-socket stuff or is there a simpler one-line way?</p>
[ { "answer_id": 68796, "author": "The.Anti.9", "author_id": 2128, "author_profile": "https://Stackoverflow.com/users/2128", "pm_score": 7, "selected": true, "text": "import socket\nsock = socket.socket()\nsock.connect((address, port))\n send() recv()" }, { "answer_id": 68911, ...
2008/09/16
[ "https://Stackoverflow.com/questions/68774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5324/" ]
68,821
<p>I want to dynamically hide/show some of the columns in a NSTableView, based on the data that is going to be displayed - basically, if a column is empty I'd like the column to be hidden. I'm currently populating the table with a controller class as the delegate for the table.</p> <p>Any ideas? I see that I can set t...
[ { "answer_id": 71609, "author": "amrox", "author_id": 4468, "author_profile": "https://Stackoverflow.com/users/4468", "pm_score": 2, "selected": false, "text": "NSTableColumn *aColumn = [[NSTableColumn alloc] initWithIdentifier:attr];\n[aColumn setWidth:DEFAULTCOLWIDTH];\n[aColumn setMin...
2008/09/16
[ "https://Stackoverflow.com/questions/68821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3857/" ]
68,843
<p>How does the compiler know the prototype of sleep function or even printf function, when I did not include any header file in the first place?</p> <p>Moreover, if I specify <code>sleep(1,1,"xyz")</code> or any arbitrary number of arguments, the compiler still compiles it. But the strange thing is that gcc is able t...
[ { "answer_id": 68861, "author": "Jason Dagit", "author_id": 5113, "author_profile": "https://Stackoverflow.com/users/5113", "pm_score": 2, "selected": false, "text": "int sleep(int);\n" }, { "answer_id": 68874, "author": "Ben Collins", "author_id": 3279, "author_profi...
2008/09/16
[ "https://Stackoverflow.com/questions/68843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
68,851
<p>I am trying out FirePHP.</p> <p>I installed it and restarted Firefox, enabled Firebug for my localhost, moved the demo <code>oo.php</code> file that comes with the download into an IIS virtual directory, changed the include path, removed the <code>apache_request_headers()</code> call since I am running IIS, and the...
[ { "answer_id": 78174, "author": "djn", "author_id": 9673, "author_profile": "https://Stackoverflow.com/users/9673", "pm_score": 1, "selected": false, "text": "fb.php ob_start() fb($myErrorVariable, 'My brand new error', FirePHP::ERROR);\n" } ]
2008/09/16
[ "https://Stackoverflow.com/questions/68851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
68,907
<p>How can you measure the amount of time a function will take to execute? </p> <p>This is a relatively short function and the execution time would probably be in the millisecond range.</p> <p>This particular question relates to an embedded system, programmed in C or C++.</p>
[ { "answer_id": 68919, "author": "Galen", "author_id": 7894, "author_profile": "https://Stackoverflow.com/users/7894", "pm_score": 2, "selected": false, "text": "start_time = timer\nfunction()\nexec_time = timer - start_time\n" }, { "answer_id": 68925, "author": "Mike Stone", ...
2008/09/16
[ "https://Stackoverflow.com/questions/68907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10703/" ]
68,964
<p>So for e.g. 0110 has bits 1 and 2 set, 1000 has bit 3 set 1111 has bits 0,1,2,3 set</p>
[ { "answer_id": 69007, "author": "Mladen Janković", "author_id": 6300, "author_profile": "https://Stackoverflow.com/users/6300", "pm_score": 2, "selected": false, "text": "for( int i = 0; variable ; ++i, variable >>= 1 ) {\n if( variable & 1 )\n // store bit index - i\n}\n" }, { ...
2008/09/16
[ "https://Stackoverflow.com/questions/68964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8884/" ]
68,993
<p>Say I have a line in an emacs buffer that looks like this:</p> <pre><code>foo -option1 value1 -option2 value2 -option3 value3 \ -option4 value4 ... </code></pre> <p>I want it to look like this:</p> <pre><code>foo -option1 value1 \ -option2 value2 \ -option3 value3 \ -option4 value4 \ ... </cod...
[ { "answer_id": 76888, "author": "Bryan Oakley", "author_id": 7432, "author_profile": "https://Stackoverflow.com/users/7432", "pm_score": 3, "selected": true, "text": "(defun tcl-multiline-options ()\n \"spread option/value pairs across multiple lines with continuation characters\"\n (i...
2008/09/16
[ "https://Stackoverflow.com/questions/68993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7432/" ]
68,999
<p>I'm using a Java socket, connected to a server. If I send a HEADER http request, how can I measure the response time from the server? Must I use a provided java timer, or is there an easier way?</p> <p>I'm looking for a short answer, I don't want to use other protocols etc. Obviously do I neither want to have a so...
[ { "answer_id": 69105, "author": "hoyhoy", "author_id": 3499, "author_profile": "https://Stackoverflow.com/users/3499", "pm_score": 4, "selected": false, "text": "time curl -I 'http://server:3000'\n" }, { "answer_id": 69195, "author": "Dave Cheney", "author_id": 6449, ...
2008/09/16
[ "https://Stackoverflow.com/questions/68999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10889/" ]
69,000
<p>I have a WPF application in VS 2008 with some web service references. For varying reasons (max message size, authentication methods) I need to manually define a number of settings in the WPF client's app.config for the service bindings.</p> <p>Unfortunately, this means that when I update the service references in t...
[ { "answer_id": 69654, "author": "Wiren", "author_id": 2538222, "author_profile": "https://Stackoverflow.com/users/2538222", "pm_score": 3, "selected": true, "text": "REM generate meta data\ncall \"SVCUTIL.EXE\" /t:metadata \"MyProject.dll\" /reference:\"MyReference.dll\"\n\nREM making su...
2008/09/16
[ "https://Stackoverflow.com/questions/69000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10890/" ]
69,016
<p>I have an array of objects that when another object hits one of them, the object will be removed. I have removed it from the stage using removeChild() and removed from the array using splice(), but somehow the object is still calling some of its functions which is causing errors. How do I completely get rid of an ob...
[ { "answer_id": 75679, "author": "Theo", "author_id": 1109, "author_profile": "https://Stackoverflow.com/users/1109", "pm_score": 2, "selected": false, "text": "stage.removeEventListener(...) stage.addEventListener(...) Event.ENTER_FRAME setInterval removeChild stop halt cleanup finalize ...
2008/09/16
[ "https://Stackoverflow.com/questions/69016", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
69,030
<p>I have a script for OS X 10.5 that focuses the Search box in the Help menu of any application. I have it on a key combination and, much like Spotlight, I want it to toggle when I run the script. So, I want to detect if the search box is already focused for typing, and if so, type Esc instead of clicking the Help m...
[ { "answer_id": 69404, "author": "tjw", "author_id": 11029, "author_profile": "https://Stackoverflow.com/users/11029", "pm_score": 3, "selected": true, "text": "focused menu item text field menu item selected tell application \"System Events\"\n tell (first process whose frontmost is t...
2008/09/16
[ "https://Stackoverflow.com/questions/69030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10906/" ]
69,063
<p>Most of our Eclipse projects have multiple source folders, for example:</p> <ul> <li>src/main/java</li> <li>src/test/java</li> </ul> <p>When you right-click on a class and choose New JUnit Test, the default source folder for the new test is "src/main/java" (presumably the first source folder listed in the project ...
[ { "answer_id": 5400024, "author": "fastcodejava", "author_id": 184730, "author_profile": "https://Stackoverflow.com/users/184730", "pm_score": 0, "selected": false, "text": "src/test/java" } ]
2008/09/16
[ "https://Stackoverflow.com/questions/69063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10433/" ]
69,068
<p>How can I split long commands over multiple lines in a batch file?</p>
[ { "answer_id": 69079, "author": "Wayne", "author_id": 8236, "author_profile": "https://Stackoverflow.com/users/8236", "pm_score": 11, "selected": true, "text": "^ copy file1.txt file2.txt\n copy file1.txt^\n file2.txt\n" }, { "answer_id": 4455750, "author": "jeb", "author...
2008/09/16
[ "https://Stackoverflow.com/questions/69068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
69,073
<p>When attempting to print using the SSRS Viewer Web Part in SharePoint I get the following error.</p> <blockquote> <p>An error occured during printing. (0x8007F303)</p> </blockquote> <p>The settings we are using in this box (production) are exactly the same as the settings in testing where this works perfectly fi...
[ { "answer_id": 69731, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 1, "selected": false, "text": "[HKEY_CURRENT_USER\\Software\\Microsoft\\Microsoft SQL Server\\80\\Reporting Services] \"LogRSClientPrintInfo\"=dword:0...
2008/09/16
[ "https://Stackoverflow.com/questions/69073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
69,089
<p>We have a web application that uses SQL Server 2008 as the database. Our users are able to do full-text searches on particular columns in the database. SQL Server's full-text functionality does not seem to provide support for hit highlighting. Do we need to build this ourselves or is there perhaps some library or kn...
[ { "answer_id": 127080, "author": "xnagyg", "author_id": 2622295, "author_profile": "https://Stackoverflow.com/users/2622295", "pm_score": 1, "selected": false, "text": " search_kiemeles=replace(lcase(search),\"\"\"\",\"\")\n do while not rs.eof 'The search result l...
2008/09/16
[ "https://Stackoverflow.com/questions/69089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1899/" ]
69,104
<p>A J2ME client is sending HTTP POST requests with chunked transfer encoding.</p> <p>When ASP.NET (in both IIS6 and WebDev.exe.server) tries to read the request it sets the Content-Length to 0. I guess this is ok because the Content-length is unknown when the request is loaded.</p> <p>However, when I read the Reques...
[ { "answer_id": 80576, "author": "Andrew", "author_id": 15127, "author_profile": "https://Stackoverflow.com/users/15127", "pm_score": 1, "selected": false, "text": "string responseText = null;\nWebRequest rabbits= WebRequest.Create(uri);\nusing (Stream resp = rabbits.GetResponse().GetResp...
2008/09/16
[ "https://Stackoverflow.com/questions/69104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/209/" ]
69,107
<p>What is the best way to refactor the attached code to accommodate multiple email addresses?</p> <p>The attached HTML/jQuery is complete and works for the first email address. I can setup the other two by copy/pasting and changing the code. But I would like to just refactor the existing code to handle multiple email...
[ { "answer_id": 69148, "author": "Pandincus", "author_id": 2273, "author_profile": "https://Stackoverflow.com/users/2273", "pm_score": 3, "selected": true, "text": "<div>\n <label for=\"Email_Address_1\">Friend #1</label></div>\n <input type=\"text\" class=\"email\">\n <span></sp...
2008/09/16
[ "https://Stackoverflow.com/questions/69107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3747/" ]
69,115
<p>Below is my current char* to hex string function. I wrote it as an exercise in bit manipulation. It takes ~7ms on a AMD Athlon MP 2800+ to hexify a 10 million byte array. Is there any trick or other way that I am missing?</p> <p>How can I make this faster?</p> <p>Compiled with -O3 in g++</p> <pre><code>static con...
[ { "answer_id": 69126, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "https://Stackoverflow.com/users/3153", "pm_score": 2, "selected": false, "text": "16 bitshift << 4 std::string delete" }, { "answer_id": 69197, "author": "C. K. Young", "author_id": 13...
2008/09/16
[ "https://Stackoverflow.com/questions/69115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/716/" ]
69,159
<p>I'm using MediaTemple's Grid Server (shared/grid hosting) to run some MySQL/PHP sites I'm writing and noticed that I wasn't closing one of my MySQL connections, which caused my site to error out: </p> <pre><code>"Too Many Connections" </code></pre> <p>I can't log in anywhere to close the connections manually. </p>...
[ { "answer_id": 69179, "author": "hoyhoy", "author_id": 3499, "author_profile": "https://Stackoverflow.com/users/3499", "pm_score": 0, "selected": false, "text": "max_connections=500\n show status show processlist" }, { "answer_id": 69244, "author": "Larry OBrien", "author...
2008/09/16
[ "https://Stackoverflow.com/questions/69159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9803/" ]
69,188
<p><a href="http://stephenwalther.com/blog/archive/2008/07/01/asp-net-mvc-tip-12-faking-the-controller-context.aspx" rel="nofollow noreferrer">http://stephenwalther.com/blog/archive/2008/07/01/asp-net-mvc-tip-12-faking-the-controller-context.aspx</a></p> <p>This post shows how to test setting a cookie and then seeing ...
[ { "answer_id": 69535, "author": "dimarzionist", "author_id": 10778, "author_profile": "https://Stackoverflow.com/users/10778", "pm_score": -1, "selected": false, "text": "function ReadCookie(cookieName) {\n var theCookie=\"\"+document.cookie;\n var ind=theCookie.indexOf(cookieName);\n if...
2008/09/16
[ "https://Stackoverflow.com/questions/69188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/438/" ]
69,192
<p>Suppose we have two stacks and no other temporary variable.</p> <p>Is to possible to "construct" a queue data structure using only the two stacks?</p>
[ { "answer_id": 69436, "author": "Dave L.", "author_id": 3093, "author_profile": "https://Stackoverflow.com/users/3093", "pm_score": 10, "selected": false, "text": "inbox outbox inbox outbox inbox outbox outbox public class Queue<E>\n{\n\n private Stack<E> inbox = new Stack<E>();\n ...
2008/09/16
[ "https://Stackoverflow.com/questions/69192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7086/" ]
69,209
<p>Is it possible to delete a middle node in the single linked list when the only information available we have is the pointer to the node to be deleted and not the pointer to the previous node?After deletion the previous node should point to the node next to deleted node. </p>
[ { "answer_id": 69235, "author": "Eltariel", "author_id": 584, "author_profile": "https://Stackoverflow.com/users/584", "pm_score": 0, "selected": false, "text": "next previous->next current->next current" }, { "answer_id": 69306, "author": "Ben Combee", "author_id": 1323,...
2008/09/16
[ "https://Stackoverflow.com/questions/69209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7086/" ]
69,250
<p>In most C or C++ environments, there is a "debug" mode and a "release" mode compilation.<br> Looking at the difference between the two, you find that the debug mode adds the debug symbols (often the -g option on lots of compilers) but it also disables most optimizations.<br> In "release" mode, you usually have all s...
[ { "answer_id": 69252, "author": "Benoit", "author_id": 10703, "author_profile": "https://Stackoverflow.com/users/10703", "pm_score": 6, "selected": true, "text": "\nvoid foo() {\n1: int i;\n2: for(i = 0; i < 2; )\n3: i++;\n4: return;\n int* ptr = 0xdeadbeef; // some address t...
2008/09/16
[ "https://Stackoverflow.com/questions/69250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10703/" ]
69,262
<p>I am wondering if there is a method or format string I'm missing in .NET to convert the following:</p> <pre><code> 1 to 1st 2 to 2nd 3 to 3rd 4 to 4th 11 to 11th 101 to 101st 111 to 111th </code></pre> <p><a href="http://www.dotnet-friends.com/fastcode/csharp/fastcodeincsc3bd4149-03d0-40fe-90fd-63bc...
[ { "answer_id": 69284, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 6, "selected": false, "text": "function ordinal($num) {\n $ones = $num % 10;\n $tens = floor($num / 10) % 10;\n if ($tens == 1) {\n $suff = \"...
2008/09/16
[ "https://Stackoverflow.com/questions/69262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364/" ]
69,275
<p>I'm trying to draw a graph on an ASP webpage. I'm hoping an API can be helpful, but so far I have not been able to find one. </p> <p>The graph contains labeled nodes and unlabeled directional edges. The ideal output would be something like <a href="http://en.wikipedia.org/wiki/Image:6n-graf.svg" rel="noreferrer">th...
[ { "answer_id": 74815, "author": "wxs", "author_id": 12981, "author_profile": "https://Stackoverflow.com/users/12981", "pm_score": 4, "selected": true, "text": "graph untitled {\n graph[bgcolor=\"transparent\"];\n node [fontname=\"Bitstream Vera Sans\", fontsize=\"22.00\", shape=cir...
2008/09/16
[ "https://Stackoverflow.com/questions/69275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165305/" ]
69,277
<p>I have an Enumerable array</p> <pre><code>int meas[] = new double[] {3, 6, 9, 12, 15, 18}; </code></pre> <p>On each successive call to the mock's method that I'm testing I want to return a value from that array.</p> <pre><code>using(_mocks.Record()) { Expect.Call(mocked_class.GetValue()).Return(meas); } using(...
[ { "answer_id": 69382, "author": "vrdhn", "author_id": 414441, "author_profile": "https://Stackoverflow.com/users/414441", "pm_score": 0, "selected": false, "text": "get_next() {\n foreach( float x in meas ) {\n yield x;\n }\n}\n" }, { "answer_id": 69642, "author": "Darre...
2008/09/16
[ "https://Stackoverflow.com/questions/69277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
69,281
<p>I've recently started using Eclipse Ganymede CDT for C development and I couldn't like it more. I'm aware the learning curve could be sort of pronounced, therefore and with your help, my goal is to flatten it as much as possible. I'm looking for the best hacks, hints, tips, tricks, and best practices to really unlea...
[ { "answer_id": 69335, "author": "Daniel Spiewak", "author_id": 9815, "author_profile": "https://Stackoverflow.com/users/9815", "pm_score": 5, "selected": true, "text": ".h .cpp typedef struct class" } ]
2008/09/16
[ "https://Stackoverflow.com/questions/69281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6992/" ]
69,296
<p>I have a a property defined as:</p> <pre><code>[XmlArray("delete", IsNullable = true)] [XmlArrayItem("contact", typeof(ContactEvent)), XmlArrayItem("sms", typeof(SmsEvent))] public List&lt;Event&gt; Delete { get; set; } </code></pre> <p>If the List&lt;> Delete has no items</p> <pre><code>&lt;delete /&gt; </code>...
[ { "answer_id": 811038, "author": "theahuramazda", "author_id": 99290, "author_profile": "https://Stackoverflow.com/users/99290", "pm_score": 4, "selected": false, "text": "public List<Event> Delete { get; set; }\n[XMLIgnore]\npublic bool DeleteSpecified\n{\n get\n {\n bool isRendered =...
2008/09/16
[ "https://Stackoverflow.com/questions/69296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2281/" ]
69,316
<p>What are the biggest pros and cons of <a href="http://incubator.apache.org/thrift/" rel="noreferrer">Apache Thrift</a> vs <a href="http://code.google.com/apis/protocolbuffers/" rel="noreferrer">Google's Protocol Buffers</a>?</p>
[ { "answer_id": 69374, "author": "hazzen", "author_id": 5066, "author_profile": "https://Stackoverflow.com/users/5066", "pm_score": 7, "selected": false, "text": "Set" }, { "answer_id": 296349, "author": "eishay", "author_id": 16201, "author_profile": "https://Stackove...
2008/09/16
[ "https://Stackoverflow.com/questions/69316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
69,332
<p>I suspect that one of my applications eats more CPU cycles than I want it to. The problem is - it happens in bursts, and just looking at the task manager doesn't help me as it shows immediate usage only.</p> <p>Is there a way (on Windows) to track the history of CPU &amp; Memory usage for some process. E.g. I will ...
[ { "answer_id": 69416, "author": "Martin08", "author_id": 8203, "author_profile": "https://Stackoverflow.com/users/8203", "pm_score": 9, "selected": true, "text": "perfmon" }, { "answer_id": 10515335, "author": "Rich Kreider", "author_id": 1384476, "author_profile": "h...
2008/09/16
[ "https://Stackoverflow.com/questions/69332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
69,352
<p>What I'm doing is I have a full-screen form, with no title bar, and consequently lacks the minimize/maximize/close buttons found in the upper-right hand corner. I'm wanting to replace that functionality with a keyboard short-cut and a context menu item, but I can't seem to find an event to trigger to minimize the fo...
[ { "answer_id": 69359, "author": "JP Richardson", "author_id": 10333, "author_profile": "https://Stackoverflow.com/users/10333", "pm_score": 5, "selected": false, "text": "FormName.WindowState = FormWindowState.Minimized;\n" }, { "answer_id": 69362, "author": "Craig Eddy", ...
2008/09/16
[ "https://Stackoverflow.com/questions/69352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7516/" ]
69,391
<p>In OS X, in order to quickly get at menu items from the keyboard, I want to be able to type a key combination, have it run a script, and have the script focus the Search field in the Help menu. It should work just like the key combination for Spotlight, so if I run it again, it should dismiss the menu. I can run t...
[ { "answer_id": 69393, "author": "easeout", "author_id": 10906, "author_profile": "https://Stackoverflow.com/users/10906", "pm_score": 2, "selected": true, "text": "tell application \"System Events\"\n tell (first process whose frontmost is true)\n click menu \"Help\" of menu ba...
2008/09/16
[ "https://Stackoverflow.com/questions/69391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10906/" ]
69,411
<p>What is the best way to copy a directory (with sub-dirs and files) from one remote Linux server to another remote Linux server? I have connected to both using SSH client (like Putty). I have root access to both. </p>
[ { "answer_id": 69419, "author": "John Douthat", "author_id": 2774, "author_profile": "https://Stackoverflow.com/users/2774", "pm_score": 2, "selected": false, "text": "man scp man rsync scp file1 file2 dir3 user@remotehost:path\n" }, { "answer_id": 69421, "author": "Serafina ...
2008/09/16
[ "https://Stackoverflow.com/questions/69411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
69,430
<p>I'm building an HTML UI with some text elements, such as tab names, which look bad when selected. Unfortunately, it's very easy for a user to double-click a tab name, which selects it by default in many browsers.</p> <p>I might be able to solve this with a JavaScript trick (I'd like to see those answers, too) -- bu...
[ { "answer_id": 69474, "author": "Dave Rutledge", "author_id": 2486915, "author_profile": "https://Stackoverflow.com/users/2486915", "pm_score": 3, "selected": false, "text": "display:box" }, { "answer_id": 69494, "author": "dimarzionist", "author_id": 10778, "author_p...
2008/09/16
[ "https://Stackoverflow.com/questions/69430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3561/" ]