qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
196,390
<p>I heard somewhere that you can drop down to C++ directly inside C# code. How is this done? Or did I hear wrong?</p> <p>Note: I do not mean C++ / CLI.</p>
[ { "answer_id": 196397, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 4, "selected": true, "text": "unsafe" } ]
2008/10/13
[ "https://Stackoverflow.com/questions/196390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
196,407
<p>From within a DLL that's being called by a C#.NET web app, how do you find the base url of the web app?</p>
[ { "answer_id": 196464, "author": "Alexander Kojevnikov", "author_id": 712, "author_profile": "https://Stackoverflow.com/users/712", "pm_score": 5, "selected": true, "text": "HttpContext.Current.Request.Url\n HttpContext.Current.Request.Url.GetComponents(UriComponents.SchemeAndServer, Uri...
2008/10/13
[ "https://Stackoverflow.com/questions/196407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463/" ]
196,415
<p>For a current project I am working I need to return an aggregate report based on date ranges. </p> <p>I have 3 types of reports, yearly, monthly and daily.</p> <p>To assist in returning this report I need a function that will return all of the sub-ranges of datetimes, within a big range.</p> <p>So for example if ...
[ { "answer_id": 196416, "author": "Sam Saffron", "author_id": 17174, "author_profile": "https://Stackoverflow.com/users/17174", "pm_score": 3, "selected": true, "text": "create function dbo.fnGetDateRanges\n(\n @type char(1),\n @start datetime,\n @finish datetime\n)\nreturns @ran...
2008/10/13
[ "https://Stackoverflow.com/questions/196415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17174/" ]
196,418
<p>I know of many utilities that can tell me the bitrate of an MP3 file, but I've never seen one that can tell me whether or not the MP3 file is VBR (variable bit rate - the bit rate fluctuates within the file) or a CBR (constant bit rate - the bit rate stays the same within the file). My guess is that most programs ar...
[ { "answer_id": 196447, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 2, "selected": false, "text": "...\nboolVBitRate = LoadVBRHeader(bytVBitRate);\n...\n" } ]
2008/10/13
[ "https://Stackoverflow.com/questions/196418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2577/" ]
196,424
<p>Should I be using this method of throwing errors:</p> <pre><code>if (isset($this-&gt;dbfields[$var])) { return $this-&gt;dbfields[$var]; } else { throw new FieldNotFoundException($var); } </code></pre> <p>or this style:</p> <pre><code>try { return $this-&gt;dbfields[$var]; } catch (Exception $e) { ...
[ { "answer_id": 196428, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 4, "selected": true, "text": "try catch try except" }, { "answer_id": 196431, "author": "yfeldblum", "author_id": 12349, "author_p...
2008/10/13
[ "https://Stackoverflow.com/questions/196424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
196,465
<p>The <a href="http://en.wikipedia.org/wiki/Effect_system" rel="noreferrer">Wikipedia article on <em>Effect system</em></a> is currently just a short stub and I've been wondering for a while as to what is an effect system. </p> <ul> <li>Are there any languages that have an effect system in addition to a type system? ...
[ { "answer_id": 196748, "author": "Chris Conway", "author_id": 1412, "author_profile": "https://Stackoverflow.com/users/1412", "pm_score": 5, "selected": true, "text": "close void close close File open(String name) [+File]; // open creates a new file handle\nvoid close(File f) [-f] ...
2008/10/13
[ "https://Stackoverflow.com/questions/196465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1659/" ]
196,468
<p>I am using the Maven (2) Cobertura plug-in to create reports on code coverage, and I have the following stub I am using in a method:</p> <pre><code>try { System.exit(0); } catch (final SecurityException exception) { exception.printStackTrace(); } System.err.println("The program never exited!"); </code></pre...
[ { "answer_id": 16798306, "author": "Bruno D. Rodrigues", "author_id": 661475, "author_profile": "https://Stackoverflow.com/users/661475", "pm_score": 0, "selected": false, "text": "try {\n System.exit(0);\n} catch (final SecurityException exception) {\n exception.printStackTrace();...
2008/10/13
[ "https://Stackoverflow.com/questions/196468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8026/" ]
196,480
<p>I have a table with two fields of interest for this particular exercise: a CHAR(3) ID and a DATETIME. The ID identifies the submitter of the data - several thousand rows. The DATETIME is not necessarily unique, either. (The primary keys are other fields of the table.)</p> <p>Data for this table is submitted ever...
[ { "answer_id": 196499, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 1, "selected": false, "text": "select * from (\n select T.submitterId,\n (select count(*) \n from TABLE T1\n where T1.datefi...
2008/10/13
[ "https://Stackoverflow.com/questions/196480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27290/" ]
196,488
<p>Hey all I'm hoping someone has enough experience with Cake PHP to make this work. </p> <p>I'm working on something that at the moment could affectionately be called a twitter clone. Essentially I have a set up like this. </p> <p>Users have many friends. This is a many to many relationship to the user table. It is ...
[ { "answer_id": 197040, "author": "neilcrookes", "author_id": 9968, "author_profile": "https://Stackoverflow.com/users/9968", "pm_score": 3, "selected": true, "text": "function findTipsByUserAndFriends($userId) {\n //FriendsUser is automagically created by CakePHP \"with\" association\n ...
2008/10/13
[ "https://Stackoverflow.com/questions/196488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7018/" ]
196,498
<p>I have a text file in the root of my web app <em><a href="http://localhost/foo.txt" rel="noreferrer">http://localhost/foo.txt</a></em> and I'd like to load it into a variable in javascript.. in groovy I would do this:</p> <pre><code>def fileContents = 'http://localhost/foo.txt'.toURL().text; println fileContents; <...
[ { "answer_id": 196510, "author": "Edward Z. Yang", "author_id": 23845, "author_profile": "https://Stackoverflow.com/users/23845", "pm_score": 8, "selected": true, "text": "var client = new XMLHttpRequest();\nclient.open('GET', '/foo.txt');\nclient.onreadystatechange = function() {\n ale...
2008/10/13
[ "https://Stackoverflow.com/questions/196498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031/" ]
196,500
<p>I have a WordPress installation with an <code>.htaccess</code> file that looks like this:</p> <pre><code># BEGIN WordPress &lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] &lt;/IfModule&gt; # END WordPr...
[ { "answer_id": 196553, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 2, "selected": false, "text": "# BEGIN WordPress\n<IfModule mod_rewrite.c>\n RewriteEngine On\n RewriteBase /\n RewriteCond %{REQUEST_URI} !^/blog2/.*\n R...
2008/10/13
[ "https://Stackoverflow.com/questions/196500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12765/" ]
196,505
<p>Is there a way to use <strong>THE LOOP</strong> in <strong>Wordpress</strong> to load pages instead of posts?</p> <p>I would like to be able to query a set of child pages, and then use <strong>THE LOOP</strong> function calls on it - things like <code>the_permalink()</code> and <code>the_title()</code>.</p> <p>Is ...
[ { "answer_id": 196742, "author": "Simon Lehmann", "author_id": 27011, "author_profile": "https://Stackoverflow.com/users/27011", "pm_score": 7, "selected": true, "text": "query_posts(array('showposts' => <number_of_pages_to_show>, 'post_parent' => <ID of the parent page>, 'post_type' => ...
2008/10/13
[ "https://Stackoverflow.com/questions/196505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22306/" ]
196,509
<p>I want to delete <strong>all</strong> the previously created indices. I am using <code>Lucene.net</code>.</p> <p>I tried the following:</p> <pre><code>Term term = new Term(); //empty because I want to delete all the indices IndexReader rdr = IndexReader.Open(_directory); rdr.DeleteDocuments(term); rdr.Close(); </...
[ { "answer_id": 3242491, "author": "Jeremy Cade", "author_id": 99240, "author_profile": "https://Stackoverflow.com/users/99240", "pm_score": 1, "selected": false, "text": "DirectoryInfo directoryInfo = new DirectoryInfo(@\"IndexLocation\");\nParallel.ForEach(directoryInfo.GetFiles(), file...
2008/10/13
[ "https://Stackoverflow.com/questions/196509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
196,512
<p>I'm looking for a container that keeps all its items in order. I looked at SortedList, but that requires a separate key, and does not allow duplicate keys. I could also just use an unsorted container and explicitly sort it after each insert.</p> <p>Usage:</p> <ul> <li>Occasional insert</li> <li>Frequent traversa...
[ { "answer_id": 196539, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": -1, "selected": false, "text": "System.Collections.ObjectModel.KeyedCollection<TKey, TItem>" }, { "answer_id": 196615, "author": "Perry P...
2008/10/13
[ "https://Stackoverflow.com/questions/196512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8701/" ]
196,518
<p>Problem with dynamic controls</p> <p>Hello all,</p> <p>I'm wanting to create some dynamic controls, and have them persist their viewstate across page loads. Easy enough, right? All I have to do is re-create the controls upon each page load, using the same IDs. HOWEVER, here's the catch - in my PreRender event, ...
[ { "answer_id": 196568, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 0, "selected": false, "text": "Page.RegisterRequiresControlState() RequiresControlState()" }, { "answer_id": 196614, "author": "Samuel Kim"...
2008/10/13
[ "https://Stackoverflow.com/questions/196518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27293/" ]
196,520
<p>What's the best/most efficient way to extract text set between parenthesis? Say I wanted to get the string "text" from the string "ignore everything except this (text)" in the most efficient manner possible.</p> <p>So far, the best I've come up with is this:</p> <pre><code>$fullString = "ignore everything except t...
[ { "answer_id": 196536, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 8, "selected": true, "text": "$text = 'ignore everything except this (text)';\npreg_match('#\\((.*?)\\)#', $text, $match);\nprint $match[1];\n" }, { "...
2008/10/13
[ "https://Stackoverflow.com/questions/196520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5291/" ]
196,521
<p>There's something I want to customize in the System.Web.Script.Services.ScriptHandlerFactory and other .NET stuff inside an internal class. Unfortunately, it's an internal class. What options do I have when trying to customize a method in this class?</p>
[ { "answer_id": 196525, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 3, "selected": false, "text": "internal" }, { "answer_id": 196551, "author": "Kris", "author_id": 18565, "author_profile": "https...
2008/10/13
[ "https://Stackoverflow.com/questions/196521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10352/" ]
196,522
<p>I've programmed C and C++ for a long time and so far I've never used exceptions and try / catch. What are the benefits of using that instead of just having functions return error codes? </p>
[ { "answer_id": 196537, "author": "Eclipse", "author_id": 8701, "author_profile": "https://Stackoverflow.com/users/8701", "pm_score": 4, "selected": false, "text": "int DoSomeThings()\n{\n int error = 0;\n HandleA hA;\n error = CreateAObject(&ha);\n if (error)\n goto cle...
2008/10/13
[ "https://Stackoverflow.com/questions/196522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13676/" ]
196,566
<p>I am trying to connect to a webservice over ssl with a client certificate. Is there an elegant way of doing this apart from shoving things like "javax.net.ssl.keyStore" into System.properties.</p> <p>Any pointers to code examples would be appreciated.</p>
[ { "answer_id": 196537, "author": "Eclipse", "author_id": 8701, "author_profile": "https://Stackoverflow.com/users/8701", "pm_score": 4, "selected": false, "text": "int DoSomeThings()\n{\n int error = 0;\n HandleA hA;\n error = CreateAObject(&ha);\n if (error)\n goto cle...
2008/10/13
[ "https://Stackoverflow.com/questions/196566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22888/" ]
196,567
<p>I have a mockup layout for something <a href="http://www.mylittlepwnage.com/misc/forms-editor.html" rel="nofollow noreferrer">here</a>. Essentially there are sections, columns and fields, which are all written as a combination of <code>&lt;ul&gt;</code> and <code>&lt;li&gt;</code> elements. This is done specifically...
[ { "answer_id": 196571, "author": "Joe Basirico", "author_id": 20795, "author_profile": "https://Stackoverflow.com/users/20795", "pm_score": 2, "selected": false, "text": "<UL> <li>" }, { "answer_id": 196573, "author": "Dimitry", "author_id": 27073, "author_profile": "...
2008/10/13
[ "https://Stackoverflow.com/questions/196567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1666/" ]
196,585
<p>I've got some LINQ to SQL that sometimes throws a </p> <blockquote> <p>"Cannot insert duplicate key row in object 'dbo.Table' with unique index 'IX_Indexname'.The statement has been terminated."</p> </blockquote> <p>Is there some way I can turn on logging or at least debug into the datacontext to see what sql ...
[ { "answer_id": 196594, "author": "Aaron Powell", "author_id": 11388, "author_profile": "https://Stackoverflow.com/users/11388", "pm_score": 1, "selected": false, "text": "context.GetChangedSet();\n" }, { "answer_id": 196607, "author": "Bradley Grainger", "author_id": 2363...
2008/10/13
[ "https://Stackoverflow.com/questions/196585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2975/" ]
196,591
<p>I need to pad the output of an integer to a given length.</p> <p>For example, with a length of 4 digits, the output of the integer 4 is "0004" instead of "4". How can I do this in C# 2.0?</p>
[ { "answer_id": 196599, "author": "Stephen Wrighton", "author_id": 7516, "author_profile": "https://Stackoverflow.com/users/7516", "pm_score": 6, "selected": true, "text": "output = String.Format(\"{0:0000}\", intVariable); \n" }, { "answer_id": 68529323, "author": "Rob Hoff",...
2008/10/13
[ "https://Stackoverflow.com/questions/196591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20910/" ]
196,603
<p>My company has a large application written in VB6, and for historical reasons, the application is navigated with the Enter key instead of with the Tab key. I don't know VB6, but I know that they currently set the focus for each control in a big select statement in the Form's KeyUp event if it's an EnterKey. Now we...
[ { "answer_id": 196599, "author": "Stephen Wrighton", "author_id": 7516, "author_profile": "https://Stackoverflow.com/users/7516", "pm_score": 6, "selected": true, "text": "output = String.Format(\"{0:0000}\", intVariable); \n" }, { "answer_id": 68529323, "author": "Rob Hoff",...
2008/10/13
[ "https://Stackoverflow.com/questions/196603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12897/" ]
196,626
<p>I need to do a query that search for a text with <strong>'Nome % teste \ / '</strong> as prefix. I'm doing the query using:</p> <p><strong>where "name" ILIKE 'Nome a% teste \ /%' ESCAPE 'a'</strong> (using a as escape character).</p> <p>There is a row that match this, but this query returns nothing. Removing the ...
[ { "answer_id": 196631, "author": "Adam Pierce", "author_id": 5324, "author_profile": "https://Stackoverflow.com/users/5324", "pm_score": 1, "selected": false, "text": "where \"name\" ILIKE 'Nome \\% teste \\\\\\/';\n" }, { "answer_id": 196648, "author": "Kent Fredric", "a...
2008/10/13
[ "https://Stackoverflow.com/questions/196626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18403/" ]
196,628
<p>I have the following problem in my <i>Data Structures and Problem Solving using Java</i> book:</p> <blockquote> <p>Write a routine that uses the Collections API to print out the items in any Collection in reverse order. Do not use a ListIterator.</p> </blockquote> <p>I'm not putting it up here because I want so...
[ { "answer_id": 196638, "author": "AdamC", "author_id": 16476, "author_profile": "https://Stackoverflow.com/users/16476", "pm_score": 2, "selected": false, "text": "void printReverseList(Collection col) {}\n" }, { "answer_id": 196642, "author": "ddimitrov", "author_id": 18...
2008/10/13
[ "https://Stackoverflow.com/questions/196628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14013/" ]
196,661
<p>I was hoping to do something like this, but it appears to be illegal in C#:</p> <pre><code>public Collection MethodThatFetchesSomething&lt;T&gt;() where T : SomeBaseClass { return T.StaticMethodOnSomeBaseClassThatReturnsCollection(); } </code></pre> <p>I get a compile-time error:</p> <blockquote> <p>'T' is a...
[ { "answer_id": 196977, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 7, "selected": true, "text": "T.StaticMethodOnSomeBaseClassThatReturnsCollection\n SomeBaseClass.StaticMethodOnSomeBaseClassThatReturnsCollection\n" }...
2008/10/13
[ "https://Stackoverflow.com/questions/196661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8169/" ]
196,664
<p>I have a form that has multiple fields, and for testing purposes is there a way I could print out the values entered in all the fields, without having to individually print each value.</p>
[ { "answer_id": 196672, "author": "defeated", "author_id": 16997, "author_profile": "https://Stackoverflow.com/users/16997", "pm_score": 6, "selected": true, "text": "var_dump($_REQUEST);" }, { "answer_id": 196714, "author": "Paolo Bergantino", "author_id": 16417, "aut...
2008/10/13
[ "https://Stackoverflow.com/questions/196664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26130/" ]
196,668
<p>I'm working on a system that includes a large number of reports, generated using <a href="http://jasperforge.org/plugins/project/project_home.php?group_id=102" rel="noreferrer">JasperReports</a>. One of the newer features is that you can define styles for reports.</p> <p>From the available docs I believe there is s...
[ { "answer_id": 206403, "author": "Jamie Love", "author_id": 27308, "author_profile": "https://Stackoverflow.com/users/27308", "pm_score": 6, "selected": true, "text": ".jrtx styles.jrtx <?xml version=\"1.0\"?>\n<!DOCTYPE jasperTemplate\n PUBLIC \"-//JasperReports//DTD Template//EN\"\n ...
2008/10/13
[ "https://Stackoverflow.com/questions/196668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27308/" ]
196,684
<p>All right, say I have this:</p> <pre><code>&lt;select id='list'&gt; &lt;option value='1'&gt;Option A&lt;/option&gt; &lt;option value='2'&gt;Option B&lt;/option&gt; &lt;option value='3'&gt;Option C&lt;/option&gt; &lt;/select&gt; </code></pre> <p>What would the selector look like if I wanted to get "Opti...
[ { "answer_id": 196687, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 11, "selected": true, "text": "list value 2 option list $(\"#list option[value='2']\").text()\n" }, { "answer_id": 196689, "author": "Andrew Moor...
2008/10/13
[ "https://Stackoverflow.com/questions/196684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16417/" ]
196,702
<p>Say I have a fairly hefty JavaScript file, packed down to roughly 100kb or so. By file I mean it’s an external file that would be linked in via <code>&lt;script src="..."&gt;</code>, not pasted into the HTML itself.</p> <p>Where’s the best place to put this in the HTML?</p> <pre><code>&lt;html&gt; &lt;head&gt; ...
[ { "answer_id": 196933, "author": "bart", "author_id": 19966, "author_profile": "https://Stackoverflow.com/users/19966", "pm_score": 2, "selected": false, "text": "x.js x.js.gz src" }, { "answer_id": 23476758, "author": "martynas", "author_id": 3300831, "author_profile...
2008/10/13
[ "https://Stackoverflow.com/questions/196702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
196,713
<p>I need to match something in the form </p> <pre><code>&lt;a href="pic/5" id="piclink"&gt;&lt;img src="thumb/5" /&gt;&lt;/a&gt; </code></pre> <p>to find the number, in this case 5, using JavaScript. I have no idea how to use regexes, so I was wondering if anyone here could help out.</p>
[ { "answer_id": 196717, "author": "num1", "author_id": 306, "author_profile": "https://Stackoverflow.com/users/306", "pm_score": 1, "selected": false, "text": "'<a href=\"pic/5\" id=\"piclink\"><img src=\"thumb/5\" /></a>'.match(/[0-9]/);\n" }, { "answer_id": 196743, "author":...
2008/10/13
[ "https://Stackoverflow.com/questions/196713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/306/" ]
196,721
<p>I'm trying to configure my WAR project build to fail if the line or branch coverage is below given thresholds. I've been using the configuration provided on page 455 of the excellent book <a href="http://oreilly.com/catalog/9780596527938/" rel="noreferrer">Java Power Tools</a>, but with no success. Here's the releva...
[ { "answer_id": 1618213, "author": "Pascal Thivent", "author_id": 70604, "author_profile": "https://Stackoverflow.com/users/70604", "pm_score": 5, "selected": true, "text": "<haltOnFailure> true haltOnFailure <execution> verify <execution> <project>\n ...\n <build>\n ...\n <plugin...
2008/10/13
[ "https://Stackoverflow.com/questions/196721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10433/" ]
196,729
<p>I'm developing an operating system and rather than programming the kernel, I'm designing the kernel. This operating system is targeted at the x86 architecture and my target is for modern computers. The estimated number of required RAM is 256Mb or more.</p> <p>What is a good size to make the stack for each thread ru...
[ { "answer_id": 6001984, "author": "Peter Teoh", "author_id": 315046, "author_profile": "https://Stackoverflow.com/users/315046", "pm_score": 2, "selected": false, "text": "./arch/cris/include/asm/processor.h:\n#define KERNEL_STACK_SIZE PAGE_SIZE\n\n./arch/ia64/include/asm/ptrace.h:\n# de...
2008/10/13
[ "https://Stackoverflow.com/questions/196729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19521/" ]
196,730
<p>I need to extract only the 2nd level part of the domain from request.servervariables("HTTP_HOST") what is the best way to do this?</p>
[ { "answer_id": 196752, "author": "Brian Boatright", "author_id": 3747, "author_profile": "https://Stackoverflow.com/users/3747", "pm_score": 1, "selected": false, "text": "If Len(strHostDomain) > 0 Then \n aryDomain = Split(strHostDomain,\".\")\n\n If uBound(aryDomain) >= 1 Th...
2008/10/13
[ "https://Stackoverflow.com/questions/196730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3747/" ]
196,732
<p>I've inherited a piece of code with a snippet which empties the database as follows:</p> <pre><code>dbmopen (%db,"file.db",0666); foreach $key (keys %db) { delete $db{$key}; } dbmclose (%db); </code></pre> <p>This is usually okay but sometimes the database grows very large before this cleanup code is called and ...
[ { "answer_id": 196816, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 3, "selected": false, "text": "dbmopen (%db,\"file.db\",0666);\n%db = ();\ndbmclose (%db);\n" }, { "answer_id": 196884, "author": "paxdiabl...
2008/10/13
[ "https://Stackoverflow.com/questions/196732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14860/" ]
196,733
<p>I have code like this:</p> <pre><code>class RetInterface {...} class Ret1: public RetInterface {...} class AInterface { public: virtual boost::shared_ptr&lt;RetInterface&gt; get_r() const = 0; ... }; class A1: public AInterface { public: boost::shared_ptr&lt;Ret1&gt; get_r() const {...} ....
[ { "answer_id": 196744, "author": "Mr Fooz", "author_id": 25050, "author_profile": "https://Stackoverflow.com/users/25050", "pm_score": 2, "selected": false, "text": "A1::get_r boost::shared_ptr<RetInterface>" }, { "answer_id": 197157, "author": "Anthony Williams", "author...
2008/10/13
[ "https://Stackoverflow.com/questions/196733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19501/" ]
196,737
<p>I've been working with the Joomla framework and I have noticed that they use a convention to designate private or protected methods (they put an underscore "<code>_</code>" in front of the method name), but they do not explicitly declare any methods <code>public</code>, <code>private</code>, or <code>protected</code...
[ { "answer_id": 4299774, "author": "naught101", "author_id": 210945, "author_profile": "https://Stackoverflow.com/users/210945", "pm_score": 2, "selected": false, "text": "private" } ]
2008/10/13
[ "https://Stackoverflow.com/questions/196737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3831/" ]
196,741
<p>How are arrays manipulated in D?</p>
[ { "answer_id": 196799, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 2, "selected": false, "text": "int[7] a;\nint[] b;\nb = a[5..7];\n int[7] a;\nint[2] b;\nb[0..1] = a[5..7];\n" }, { "answer_id": 269166, "a...
2008/10/13
[ "https://Stackoverflow.com/questions/196741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13295/" ]
196,754
<p>I've seen some horrific code written in Perl, but I can't make head nor tail of this one:</p> <pre><code>select((select(s),$|=1)[0]) </code></pre> <p>It's in some networking code that we use to communicate with a server and I assume it's something to do with buffering (since it sets <code>$|</code>).</p> <p>But I...
[ { "answer_id": 196768, "author": "Dan", "author_id": 17121, "author_profile": "https://Stackoverflow.com/users/17121", "pm_score": 7, "selected": true, "text": "select() (select($s),$|=1) select $| = 1 (...)[0] select select use IO::Handle;\n$fh->autoflush;\n" }, { "answer_id": 1...
2008/10/13
[ "https://Stackoverflow.com/questions/196754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14860/" ]
196,755
<p>Given a string of keywords, such as "Python best practices", I would like to obtain the first 10 Stack Overflow questions that contain that keywords, sorted by relevance (?), say from a Python script. My goal is to end up with a list of tuples (title, URL).</p> <p>How can I accomplish this? Would you consider query...
[ { "answer_id": 196763, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 3, "selected": false, "text": "<h3><a href=\"/questions/5119/what-are-the-best-rss-feeds-for-programmersdevelopers#5150\" class=\"answer-title\">What are...
2008/10/13
[ "https://Stackoverflow.com/questions/196755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18770/" ]
196,771
<p>I have a PHP application which needs to output a python script, more specifically a bunch of variable assignment statements, eg.</p> <pre><code>subject_prefix = 'This String From User Input' msg_footer = """This one too.""" </code></pre> <p>The contents of subject_prefix et al need to be written to take user input...
[ { "answer_id": 196783, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": -1, "selected": false, "text": "function escape_string($text, $type) {\n // Escape backslashes for all types of strings?\n $text = str_replace('\\\...
2008/10/13
[ "https://Stackoverflow.com/questions/196771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3528/" ]
196,776
<p>I need to be able to send encrypted data between a Ruby client and a Python server (and vice versa) and have been having trouble with the <a href="http://rubyforge.org/projects/ruby-aes" rel="nofollow noreferrer">ruby-aes</a> gem/library. The library is very easy to use but we've been having trouble passing data bet...
[ { "answer_id": 196794, "author": "mhawke", "author_id": 21945, "author_profile": "https://Stackoverflow.com/users/21945", "pm_score": 1, "selected": false, "text": "f = open('/path/to/file', 'rb')\n f = open('/path/to/file', 'wb')\nf.write(encrypted_data)\n" }, { "answer_id": 196...
2008/10/13
[ "https://Stackoverflow.com/questions/196776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/422/" ]
196,788
<p>I'm trying to implement search result highlighting for pdfs in a web app. I have the original pdfs, and small png versions that are used in search results. Essentially I'm looking for an api like:</p> <pre><code>pdf_document.find_offsets('somestring') # =&gt; { top: 501, left: 100, bottom: 520, right: 150 }, { ... ...
[ { "answer_id": 203553, "author": "Chris Dolan", "author_id": 14783, "author_profile": "https://Stackoverflow.com/users/14783", "pm_score": 2, "selected": false, "text": "use CAM::PDF;\nmy $pdf = CAM::PDF->new('my.pdf') or die $CAM::PDF::errstr;\nfor my $pagenum (1 .. $pdf->numPages) {\n ...
2008/10/13
[ "https://Stackoverflow.com/questions/196788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3624/" ]
196,820
<p>I need a cross-platform editor control to use as GUI-part in an in-house tool. The control may be commercial, but with reasonable price.</p> <p>Required features:</p> <ul> <li>Platforms: Win32, OS X, Linux</li> <li>UTF-8 support</li> <li>Fine-grained run-time control to the text style (or at least color)</li> <li>...
[ { "answer_id": 196856, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 3, "selected": true, "text": "GtkTextView QTextEdit" }, { "answer_id": 197714, "author": "PhiLho", "author_id": 15459, "author_pr...
2008/10/13
[ "https://Stackoverflow.com/questions/196820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6236/" ]
196,824
<p>How do you process information in Java that was input from a file. For Example: suppose you have a file input.txt. The contents of this file is: abcdefghizzzzjklmnop azzbcdefghijklmnop</p> <p>My hope would be that the information would be put into the argument array of strings such that the following code would...
[ { "answer_id": 196831, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 3, "selected": false, "text": "System.in javac Test.java; java Test < Test.java class Test\n{\n public static void main (String[] args)\n {\n ...
2008/10/13
[ "https://Stackoverflow.com/questions/196824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
196,830
<p>Some ways to iterate through the characters of a string in Java are:</p> <ol> <li>Using <code>StringTokenizer</code>?</li> <li>Converting the <code>String</code> to a <code>char[]</code> and iterating over that.</li> </ol> <p>What is the easiest/best/most correct way to iterate?</p>
[ { "answer_id": 196834, "author": "jjnguy", "author_id": 2598, "author_profile": "https://Stackoverflow.com/users/2598", "pm_score": 10, "selected": true, "text": "charAt() charAt() String s = \"...stuff...\";\n\nfor (int i = 0; i < s.length(); i++){\n char c = s.charAt(i); \n ...
2008/10/13
[ "https://Stackoverflow.com/questions/196830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85/" ]
196,840
<p>I am looking for a way to add a drop down list in WPF to a menu. This used to be really easy in winforms and so I am expecting you experts to know just now to do it in WPF. Thanks.</p> <p>Sorry if this is a bad question, it is late and I don't want to think.</p>
[ { "answer_id": 196873, "author": "Jobi Joy", "author_id": 8091, "author_profile": "https://Stackoverflow.com/users/8091", "pm_score": 6, "selected": true, "text": "<Menu>\n <MenuItem Header=\"File\">\n <MenuItem Header=\"Open\"/>\n <MenuItem Header=\"Close\"/>\n <...
2008/10/13
[ "https://Stackoverflow.com/questions/196840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22914/" ]
196,841
<p>In Python, you can do this:</p> <pre><code>print &quot;Hi! I'm %(name)s, and I'm %(age)d years old.&quot; % ({&quot;name&quot;:&quot;Brian&quot;,&quot;age&quot;:30}) </code></pre> <p>What's the closest, simplest Ruby idiom to replicate this behavior? (No monkeypatching the String class, please.)</p> <p>One of the ...
[ { "answer_id": 196847, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 2, "selected": false, "text": "puts \"Hi! I'm #{name}, and I'm #{age} years old.\"\n" }, { "answer_id": 196854, "author": "Honza", "auth...
2008/10/13
[ "https://Stackoverflow.com/questions/196841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16034/" ]
196,859
<p>I need to change color of TextBox whenever its required field validator is fired on Clicking the Submit button</p>
[ { "answer_id": 196916, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 0, "selected": false, "text": "<html>\n <head>\n <script type=\"text/javascript\">\n function mkclr(cntl,clr) {\n document.getElementBy...
2008/10/13
[ "https://Stackoverflow.com/questions/196859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
196,876
<p>Just looking at ways of getting named constants in python.</p> <pre><code>class constant_list: (A_CONSTANT, B_CONSTANT, C_CONSTANT) = range(3) </code></pre> <p>Then of course you can refer to it like so: </p> <pre><code>constant_list.A_CONSTANT </code></pre> <p>I suppose you could use a dictionary, using st...
[ { "answer_id": 196881, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 5, "selected": true, "text": "class Enumerate(object):\n def __init__(self, names):\n for number, name in enumerate(names.split()):\n setattr(se...
2008/10/13
[ "https://Stackoverflow.com/questions/196876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61/" ]
196,883
<p>I am having an ASP.net page in my page i am having this as my code behind files. on first access the page the page preinit, init, load methods are called. on postbacks the preinit, init, load methods are called.</p> <p>My question is LoadViewstate and control state events (Overridden methods) are not firing after p...
[ { "answer_id": 196881, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 5, "selected": true, "text": "class Enumerate(object):\n def __init__(self, names):\n for number, name in enumerate(names.split()):\n setattr(se...
2008/10/13
[ "https://Stackoverflow.com/questions/196883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22162/" ]
196,885
<p>How can I determine if I'm running on a 32bit or a 64bit version of matlab?</p> <p>I have some pre-compiled mex-files which need different path's depending on 32/64bit matlab.</p>
[ { "answer_id": 206927, "author": "Adrian", "author_id": 28406, "author_profile": "https://Stackoverflow.com/users/28406", "pm_score": 2, "selected": false, "text": "if regexp(computer,'..$','match','64'),\n % setup 64bit options\nelse,\n % 32bit options\nend\n" }, { "answer_i...
2008/10/13
[ "https://Stackoverflow.com/questions/196885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27331/" ]
196,890
<p>I'm having performance oddities with Java2D. I know of the sun.java2d.opengl VM parameter to enable 3D acceleration for 2D, but even using that has some weird issues. </p> <p>Here are results of tests I ran:</p> <p>Drawing a 25x18 map with 32x32 pixel tiles on a JComponent<br> Image 1 = .bmp format, Image 2 = A .p...
[ { "answer_id": 197060, "author": "Consty", "author_id": 1191472, "author_profile": "https://Stackoverflow.com/users/1191472", "pm_score": 7, "selected": true, "text": "private BufferedImage toCompatibleImage(BufferedImage image)\n{\n // obtain the current system graphical settings\n ...
2008/10/13
[ "https://Stackoverflow.com/questions/196890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1191472/" ]
196,897
<p>I noticed when a file is executed on Windows (.exe or .dll), it is locked and cannot be deleted, moved or modified.</p> <p>Linux, on the other hand, does not lock executing files and you <em>can</em> delete, move, or modify them.</p> <p>Why does Windows lock when Linux does not? Is there an advantage to locking?</...
[ { "answer_id": 30273566, "author": "Thorsten Schöning", "author_id": 2055163, "author_profile": "https://Stackoverflow.com/users/2055163", "pm_score": 2, "selected": false, "text": "dwShareMode" } ]
2008/10/13
[ "https://Stackoverflow.com/questions/196897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27332/" ]
196,925
<p>JavaScript doesn't seem to have a native <code>trim()</code> method. How can I trim white spaces at the start and end of a string with JavaScript?</p>
[ { "answer_id": 196926, "author": "Pat", "author_id": 238, "author_profile": "https://Stackoverflow.com/users/238", "pm_score": 5, "selected": false, "text": "return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n" }, { "answer_id": 196928, "author": "Peter Boughton", ...
2008/10/13
[ "https://Stackoverflow.com/questions/196925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1896/" ]
196,930
<p>How, in the simplest possible way, distinguish between Windows XP and Windows Vista, using Python and <a href="http://python.net/crew/mhammond/win32/Downloads.html" rel="noreferrer">pywin32</a> or <a href="http://www.wxpython.org/" rel="noreferrer">wxPython</a>?</p> <p>Essentially, I need a function that called wil...
[ { "answer_id": 196931, "author": "DzinX", "author_id": 18745, "author_profile": "https://Stackoverflow.com/users/18745", "pm_score": 3, "selected": false, "text": "import sys\n\ndef isWindowsVista():\n '''Return True iff current OS is Windows Vista.'''\n if sys.platform != \"win32\...
2008/10/13
[ "https://Stackoverflow.com/questions/196930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18745/" ]
196,936
<p>I'm writing some code for a class constructor which loops through all the properties of the class and calls a generic static method which populates my class with data from an external API. So I've got this as an example class:</p> <pre><code>public class MyClass{ public string Property1 { get; set; } public int...
[ { "answer_id": 196945, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 5, "selected": true, "text": "var properties = this.GetType().GetProperties();\nforeach (PropertyInfo p in properties)\n{\n object value = typeof...
2008/10/13
[ "https://Stackoverflow.com/questions/196936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11388/" ]
196,946
<p>I was trying the following example, but with external URLs: <a href="http://android-developers.blogspot.com/2008/09/using-webviews.html" rel="nofollow noreferrer">Using WebViews</a></p> <p>The example shows how to load an HTML file from assets folder (<code>file:// url</code>) and display it in a WebView. </p> <p>...
[ { "answer_id": 198662, "author": "Tahir Akhtar", "author_id": 18027, "author_profile": "https://Stackoverflow.com/users/18027", "pm_score": 6, "selected": true, "text": "<uses-permission android:name=\"android.permission.INTERNET\"></uses-permission>\n" }, { "answer_id": 679774, ...
2008/10/13
[ "https://Stackoverflow.com/questions/196946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18027/" ]
196,949
<p>I have an application that I have to run as Administrator.</p> <p>One small part of that application is to start other applications with Process.Start</p> <p>The started applications will also be run as administrators, but I'd rather see them run as the 'normal' user.</p> <p>How do I accomplish that?</p> <p>/joh...
[ { "answer_id": 196959, "author": "Greg Dean", "author_id": 1200558, "author_profile": "https://Stackoverflow.com/users/1200558", "pm_score": 3, "selected": false, "text": "//---------------------------------------------------------------------\n// This file is part of the Microsoft .NET...
2008/10/13
[ "https://Stackoverflow.com/questions/196949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21761/" ]
196,960
<p>I have a dict, which I need to pass key/values as keyword arguments.. For example..</p> <pre><code>d_args = {'kw1': 'value1', 'kw2': 'value2'} example(**d_args) </code></pre> <p>This works fine, <em>but</em> if there are values in the d_args dict that are not accepted by the <code>example</code> function, it obvio...
[ { "answer_id": 196978, "author": "DzinX", "author_id": 18745, "author_profile": "https://Stackoverflow.com/users/18745", "pm_score": 5, "selected": false, "text": "def func(one, two=\"value\"):\n y = one, two\n return y\nprint func.func_code.co_varnames[:func.func_code.co_argcount]...
2008/10/13
[ "https://Stackoverflow.com/questions/196960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745/" ]
196,966
<p>I need to develop a generic jQuery-based search plugin for the ASP.NET MVC application I'm building, but I can't figure out how it's supposed to fit, or what the best practice is. I want to do the following:</p> <pre><code>$().ready(function() { $('#searchHolder').customSearch('MyApp.Models.User'); }); </code>...
[ { "answer_id": 200410, "author": "roryf", "author_id": 270, "author_profile": "https://Stackoverflow.com/users/270", "pm_score": 1, "selected": false, "text": "partials switch UpdatePanel" } ]
2008/10/13
[ "https://Stackoverflow.com/questions/196966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192/" ]
196,972
<p>Is there a simple way to convert a string to Title Case? E.g. <code>john smith</code> becomes <code>John Smith</code>. I'm not looking for something complicated like <a href="http://ejohn.org/blog/title-capitalization-in-javascript/" rel="noreferrer">John Resig's solution</a>, just (hopefully) some kind of one- or t...
[ { "answer_id": 196989, "author": "PhiLho", "author_id": 15459, "author_profile": "https://Stackoverflow.com/users/15459", "pm_score": 3, "selected": false, "text": "var toMatch = \"john w. smith\";\nvar result = toMatch.replace(/(\\w)(\\w*)/g, function (_, i, r) {\n return i.toUpper...
2008/10/13
[ "https://Stackoverflow.com/questions/196972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1896/" ]
196,976
<p>I have an old project that was built using visual studio 2003 and I recompiled it with vs2005 recently. However, during runtime, I get the following error:</p> <p>list iterator not incrementable</p> <p>I traced the program to this function:</p> <pre><code>void InputQueue::update() { list&lt;PCB&gt;::iterator...
[ { "answer_id": 196988, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 3, "selected": false, "text": "iter->arrivalTime == 0 end()" }, { "answer_id": 196994, "author": "1800 INFORMATION", "author_id": 3146, ...
2008/10/13
[ "https://Stackoverflow.com/questions/196976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
196,980
<p>The rich text editor must be implemented in Java, provide Swing support, and preferably be open source.</p> <p>I'm looking to integrate it into an existing Java/Swing application. </p> <p>Thanks.</p>
[ { "answer_id": 197036, "author": "dalyons", "author_id": 16925, "author_profile": "https://Stackoverflow.com/users/16925", "pm_score": 5, "selected": false, "text": "jpane.getSelectionStart() jpane.getSelectionEnd() history.push(jpane.getText()) jpane.setText(history.pop())" }, { ...
2008/10/13
[ "https://Stackoverflow.com/questions/196980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27344/" ]
196,993
<p>i have a wordpress blog and want to give people the same user experience for adding comments that is in stackoverflow. There are a number of comments ajax plugins out there but i can't find a working one that allows you to inline on the main page, go in and add comments without first drilling down into a seperate s...
[ { "answer_id": 207140, "author": "coderGeek", "author_id": 28426, "author_profile": "https://Stackoverflow.com/users/28426", "pm_score": 4, "selected": true, "text": "<?php the_content(''); ?>\n <?php ajax_comments_link(); ?>\n<?php ajax_comments_div(); ?>\n if ($comment_count == '1') {\...
2008/10/13
[ "https://Stackoverflow.com/questions/196993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4653/" ]
197,009
<p>A python script is running two parallel python processes ( created via os.fork() ) each of which eventually tries to check out a subversion repository leaf into the same working copy dir.</p> <p>Before running 'svn co ...' command in a sub-process ( via python subprocess module ) the parent python code checks if th...
[ { "answer_id": 199791, "author": "zaphod", "author_id": 13871, "author_profile": "https://Stackoverflow.com/users/13871", "pm_score": 3, "selected": true, "text": "svn svn svn import os, errno\n\n# ...\n\ntry:\n os.mkdir(dirName)\nexcept OSError, e:\n if e.errno != errno.EEXIST: raise ...
2008/10/13
[ "https://Stackoverflow.com/questions/197009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140995/" ]
197,027
<p>I would like to declare a dropdown box in a view in an ASP.NET MVC application, for letting the user select a lookup value. I know how to declare plain text boxes but is there an official helper for declaring dropdown boxes (date time pickers and the rest)?.</p> <p>I also don't know what structure I should pass to ...
[ { "answer_id": 197549, "author": "Elijah Manor", "author_id": 4481, "author_profile": "https://Stackoverflow.com/users/4481", "pm_score": 1, "selected": false, "text": "<%= Html.DropDownList(\"Select One\", \"CategoryId\", ViewData.Model.Categories, \"Id\", \"Name\", ViewData.Model.Selec...
2008/10/13
[ "https://Stackoverflow.com/questions/197027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2812/" ]
197,028
<p>neither</p> <pre><code>&lt;?php system('php file.php'); ?&gt; </code></pre> <p>nor</p> <pre><code>&lt;?php system('/usr/bin/php file.php'); ?&gt; </code></pre> <p>worked. Why?</p> <p>I tried with <code>-q</code>, with <code>!#/usr/bin/php</code> etc.</p>
[ { "answer_id": 197034, "author": "Vegard Larsen", "author_id": 1606, "author_profile": "https://Stackoverflow.com/users/1606", "pm_score": 2, "selected": false, "text": "<?php system('/usr/bin/php -f file.php'); ?>\n" }, { "answer_id": 197038, "author": "Tahir Akhtar", "a...
2008/10/13
[ "https://Stackoverflow.com/questions/197028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7398/" ]
197,033
<p>Where is the location of my oracle event log (on a default Linux installation)?</p>
[ { "answer_id": 197108, "author": "cagcowboy", "author_id": 19629, "author_profile": "https://Stackoverflow.com/users/19629", "pm_score": 5, "selected": true, "text": "select value from v$parameter where name = 'background_dump_dest'\n" }, { "answer_id": 197120, "author": "And...
2008/10/13
[ "https://Stackoverflow.com/questions/197033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27346/" ]
197,045
<p>Is it possible to set a default value for columns in JPA, and if, how is it done using annotations?</p>
[ { "answer_id": 375202, "author": "Cameron Pope", "author_id": 1385388, "author_profile": "https://Stackoverflow.com/users/1385388", "pm_score": 9, "selected": true, "text": "columnDefinition @Column @Column(name=\"Price\", columnDefinition=\"Decimal(10,2) default '100.00'\")\n" }, { ...
2008/10/13
[ "https://Stackoverflow.com/questions/197045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16152/" ]
197,047
<p>What is the difference between <code>&lt;% %&gt;</code> and <code>&lt;%= %&gt;</code> in ASP.NET MVC? And when to use which?</p>
[ { "answer_id": 197055, "author": "Erik van Brakel", "author_id": 909, "author_profile": "https://Stackoverflow.com/users/909", "pm_score": 3, "selected": false, "text": "protected string SayHello()\n{\n return \"Hello!\";\n}\n first: <%= SayHello() %>\nsecond: <% SayHello() %>\n first...
2008/10/13
[ "https://Stackoverflow.com/questions/197047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
197,048
<p>Now that <code>shared_ptr</code> is in tr1, what do you think should happen to the use of <code>std::auto_ptr</code>? They both have different use cases, but all use cases of <code>auto_ptr</code> can be solved with <code>shared_ptr</code>, too. Will you abandon <code>auto_ptr</code> or continue to use it in cases w...
[ { "answer_id": 197054, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "shared_ptr auto_ptr" }, { "answer_id": 197083, "author": "Konrad Rudolph", "author_id": 1968, "author_pr...
2008/10/13
[ "https://Stackoverflow.com/questions/197048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11449/" ]
197,057
<p>Is it possible to access the Abstract Syntax Tree(AST) inside the javac.exe programmatically? Could you provide an example?</p>
[ { "answer_id": 197588, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 3, "selected": false, "text": "-cp tools.jar tools.jar import com.sun.source.util.Trees;\nimport javax.tools.JavaCompiler;\nimport javax.tools.StandardJava...
2008/10/13
[ "https://Stackoverflow.com/questions/197057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15441/" ]
197,059
<p>What is the most efficient way of turning the list of values of a dictionary into an array?</p> <p>For example, if I have a <code>Dictionary</code> where <code>Key</code> is <code>String</code> and <code>Value</code> is <code>Foo</code>, I want to get <code>Foo[]</code></p> <p>I am using VS 2005, C# 2.0</p>
[ { "answer_id": 197062, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 8, "selected": true, "text": "// dict is Dictionary<string, Foo>\n\nFoo[] foos = new Foo[dict.Count];\ndict.Values.CopyTo(foos, 0);\n\n// or in C# 3.0:...
2008/10/13
[ "https://Stackoverflow.com/questions/197059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4653/" ]
197,070
<p>Could you provide an example of accessing the Eclipse Abstract Syntax Tree programmatically for a given piece of code?</p> <p>eg getting the AST for:</p> <hr> <h2>Class1.java</h2> <pre><code>package parseable; public class Class1 { /** * @param args */ public static void main(String[] args) { System.out....
[ { "answer_id": 6565258, "author": "johncip", "author_id": 353434, "author_profile": "https://Stackoverflow.com/users/353434", "pm_score": 1, "selected": false, "text": "// get an ICompilationUnit by some means\n// you might drill down from an IJavaProject, for instance \nICompilationUnit...
2008/10/13
[ "https://Stackoverflow.com/questions/197070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15441/" ]
197,081
<p>How can I do the Ruby method <a href="http://www.ruby-doc.org/core/classes/Array.html#M002241" rel="noreferrer">"Flatten" Ruby Method</a> in C#. This method flattens a jagged array into a single-dimensional array.</p> <p>For example:</p> <pre><code>s = [ 1, 2, 3 ] #=&gt; [1, 2, 3] t = [ 4, 5, 6, [7, 8] ]...
[ { "answer_id": 197087, "author": "Alexander Kojevnikov", "author_id": 712, "author_profile": "https://Stackoverflow.com/users/712", "pm_score": 5, "selected": true, "text": "IEnumerable Flatten(IEnumerable array)\n{\n foreach(var item in array)\n {\n if(item is IEnumerable)\...
2008/10/13
[ "https://Stackoverflow.com/questions/197081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4455/" ]
197,088
<p>In WPF, there are two ways to set the focus to an element.<br> You can either call the .Focus() method of the input element, or call Keyboard.Focus() with the input element as parameter.</p> <pre><code>// first way: item.Focus(); // alternate way: Keyboard.Focus(item); </code></pre> <p>What is the difference betwe...
[ { "answer_id": 197309, "author": "decasteljau", "author_id": 12082, "author_profile": "https://Stackoverflow.com/users/12082", "pm_score": 0, "selected": false, "text": "DependencyObject focusScope = FocusManager.GetFocusScope(item);\nif (FocusManager.GetFocusedElement(focusScope) == nul...
2008/10/13
[ "https://Stackoverflow.com/questions/197088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7021/" ]
197,095
<p>The following code has a simple binding which binds the Text of the TextBlock named MyTextBlock to TextBox's Text and ToolTip property using the exact same Binding notation:</p> <pre><code>&lt;StackPanel&gt; &lt;TextBlock x:Name="MyTextBlock"&gt;Foo Bar&lt;/TextBlock&gt; &lt;TextBox Text="{Binding Elemen...
[ { "answer_id": 197130, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 7, "selected": false, "text": "<TextBox ...>\n <TextBox.ToolTip>\n <ToolTip \n Content=\"{Binding ElementName=myTextBlock,Path=Text}\"\n ...
2008/10/13
[ "https://Stackoverflow.com/questions/197095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39/" ]
197,096
<p>In a SQL-database I make some selects, that get an duration (as result of a subtraction between two dates) in seconds as an int. But I want to format this result in a human-readable form like 'hh:mm' or 'dd:hh'. Is that possible in SQL and how can I realize this?</p>
[ { "answer_id": 197138, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": " select convert(varchar(8), dateadd(second, [SecondsColumn], 0), 108)\n case when SecondsColumn> (24*60*60) \n then ...
2008/10/13
[ "https://Stackoverflow.com/questions/197096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21005/" ]
197,097
<p>I'm having a bit of trouble with the UTL_MAIL package in Oracle 10g, and was wondering if anyone had any solutions?</p> <p>I connect to my DB as SYSMAN and load the following two scripts;</p> <p><strong>@C:\oracle\product\10.2.0\db_1\rdbms\admin\utlmail.sql</strong></p> <p><strong>@C:\oracle\product\10.2.0\db_1\r...
[ { "answer_id": 197103, "author": "cagcowboy", "author_id": 19629, "author_profile": "https://Stackoverflow.com/users/19629", "pm_score": 2, "selected": false, "text": "CREATE PUBLIC SYNONYM UTL_MAIL FOR SYSMAN.UTL_MAIL;\n" }, { "answer_id": 197197, "author": "cagcowboy", ...
2008/10/13
[ "https://Stackoverflow.com/questions/197097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5827/" ]
197,099
<p>I'm trying to select data from a table defined similar to the following :</p> <pre><code>Column | Data Type ------------------------- Id | Int DataType | Int LoggedData | XML </code></pre> <p>but I only want to select those rows with a specific DataType value, and that contain a string (o...
[ { "answer_id": 197106, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 0, "selected": false, "text": "SELECT\n Id, \n LoggedData \nFROM\n myTable \nWHERE\n DataType = 29 \n AND LoggedData.exist('RootNode/ns1:ChildNode[@...
2008/10/13
[ "https://Stackoverflow.com/questions/197099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/377/" ]
197,111
<p>What is an example of a fast SQL to get duplicates in datasets with hundreds of thousands of records. I typically use something like:</p> <pre><code>SELECT afield1, afield2 FROM afile a WHERE 1 &lt; (SELECT count(afield1) FROM afile b WHERE a.afield1 = b.afield1); </code></pre> <p>But this is quite slow.</p>
[ { "answer_id": 197114, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 7, "selected": true, "text": "select afield1,count(afield1) from atable \ngroup by afield1 having count(afield1) > 1\n" }, { "answer_id": 1...
2008/10/13
[ "https://Stackoverflow.com/questions/197111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3535708/" ]
197,112
<p>This <a href="http://my.php.net/static" rel="nofollow noreferrer">example</a> is from php.net:</p> <pre><code>&lt;?php function Test() { static $a = 0; echo $a; $a++; } ?&gt; </code></pre> <p>And this is my code:</p> <pre><code>function getNextQuestionID() { static $idx = 0; return $idx++; } <...
[ { "answer_id": 197126, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "echo getNextQuestionID() . \", \" getNextQuestionID() . \", \" getNextQuestionID();\n" }, { "answer_id": 197600, "a...
2008/10/13
[ "https://Stackoverflow.com/questions/197112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15345/" ]
197,121
<p>I'm trying to do the following without too much special case code to deal with invalidated POSITIONs etc:</p> <p>What's the best way to fill in the blanks?</p> <pre><code>void DeleteUnreferencedRecords(CAtlMap&lt;Record&gt;&amp; records) { for(____;____;____) { if( NotReferencedElsewhere(record) ) ...
[ { "answer_id": 197209, "author": "Rob", "author_id": 9236, "author_profile": "https://Stackoverflow.com/users/9236", "pm_score": 0, "selected": false, "text": "GetNext" }, { "answer_id": 198050, "author": "Head Geek", "author_id": 12193, "author_profile": "https://Sta...
2008/10/13
[ "https://Stackoverflow.com/questions/197121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11898/" ]
197,122
<p>I am fairly new to WPF. I want to develop a datagrid control which supports databinding.</p> <p>There is a lot of information available about databinding to existing controls, but I cannot find any information how to develop a control from scratch which supports databinding. </p> <p>I do not expect a simple answer...
[ { "answer_id": 249080, "author": "Scott Weinstein", "author_id": 25201, "author_profile": "https://Stackoverflow.com/users/25201", "pm_score": 0, "selected": false, "text": "AffectsArrange List<string> INotifyCollectionChanged FirstName List<Person> DataTable" } ]
2008/10/13
[ "https://Stackoverflow.com/questions/197122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10329/" ]
197,127
<p>How do I make my application always use English when displaying win32/.net exceptions messages?</p> <p>I got this message, it looks like someone used babelfish to translate it (it's Swedish): "System.ComponentModel.Win32Exception: Programmet kunde inte starta eftersom programmets sida-vid-sidakonfiguration är felak...
[ { "answer_id": 197141, "author": "Alexander Kojevnikov", "author_id": 712, "author_profile": "https://Stackoverflow.com/users/712", "pm_score": 4, "selected": true, "text": "Thread.CurrentThread.CurrentUICulture .CurrentCulture CultureInfo(\"en-US\")" }, { "answer_id": 197262, ...
2008/10/13
[ "https://Stackoverflow.com/questions/197127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17413/" ]
197,135
<p>My application is implemented as a service (running under services.exe). I am adding a new feature which requires being notified when the user sends an SMS.</p> <p>I have tried using <code>IMAPIAdviseSink</code>, registering with both <code>IMAPISession</code> and <code>IMsgStore</code>, but I do not get any notifi...
[ { "answer_id": 207796, "author": "Mark Cheeseborough", "author_id": 13570, "author_profile": "https://Stackoverflow.com/users/13570", "pm_score": 3, "selected": true, "text": "IMAPIAdviseSink" } ]
2008/10/13
[ "https://Stackoverflow.com/questions/197135", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13570/" ]
197,150
<p>I can write a trivial script to do this but in my ongoing quest to get more familliar with unix I'd like to learn efficient methods using built in commands instead.</p> <p>I need to deal with very large files that have a variable number of header lines. the last header line consists of the text 'LastHeaderLine'. I ...
[ { "answer_id": 197169, "author": "Avi", "author_id": 1605, "author_profile": "https://Stackoverflow.com/users/1605", "pm_score": 4, "selected": false, "text": "sed -ne '/LastHeaderLine/,$p' <inputfile\n perl -ne 'if ($flag) {print;} if (/LastHeaderFile/) {$flag=1;}' <inputfile\n" }, ...
2008/10/13
[ "https://Stackoverflow.com/questions/197150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
197,162
<p>How does Windows with NTFS perform with large volumes of files and directories?</p> <p>Is there any guidance around limits of files or directories you can place in a single directory before you run into performance problems or other issues? </p> <p>E.g. is having a folder with 100,000 folders inside of it an OK th...
[ { "answer_id": 26205776, "author": "Spoc", "author_id": 3746069, "author_profile": "https://Stackoverflow.com/users/3746069", "pm_score": 5, "selected": false, "text": "(FOPS = File Operations per Second)\n(DOPS = Directory Operations per Second)\n\n#Files lg(#) FOPS FOPS2 DOPS ...
2008/10/13
[ "https://Stackoverflow.com/questions/197162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11829/" ]
197,164
<p>In my views I use a helper that takes arbitrary HTML as a block:</p> <pre><code>&lt;% some_block_helper do %&gt; Some arbitrary HTML and ERB variables here. More HTML here. &lt;% end %&gt; </code></pre> <p>My helper does a bunch of things to the passed block of HTML before rendering it back to the view (Markdo...
[ { "answer_id": 249295, "author": "Cameron Booth", "author_id": 14873, "author_profile": "https://Stackoverflow.com/users/14873", "pm_score": 3, "selected": false, "text": "describe SomeHelper do\n it 'should do something' do\n helper.some_block_helper { the_block_code }.should XXXX\n...
2008/10/13
[ "https://Stackoverflow.com/questions/197164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21702/" ]
197,170
<p>When I <kbd>Alt</kbd>+<kbd>Tab</kbd> to my VM from my host the VM does not get keyboard input until I click inside it. This is causing me an issue as it looks like the VM has control of the input (as the cursor is flashing away). If while in this state, VMWare server has the focus rather then the application insid...
[ { "answer_id": 197186, "author": "Argalatyr", "author_id": 18484, "author_profile": "https://Stackoverflow.com/users/18484", "pm_score": 2, "selected": false, "text": "vmware.exe" } ]
2008/10/13
[ "https://Stackoverflow.com/questions/197170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26792/" ]
197,171
<p>Not too long ago, I had a problem which required me to <a href="https://stackoverflow.com/questions/186237/program-only-crashes-as-release-build-how-to-debug">set WinDbg.exe as the default post-mortem debugger</a>. Now that I've fixed that and am back doing normal work, it would be really nice if I could set VS to ...
[ { "answer_id": 197208, "author": "MvdD", "author_id": 18044, "author_profile": "https://Stackoverflow.com/users/18044", "pm_score": 4, "selected": true, "text": "1. Start Registry Editor and locate the following Registry subkey in the HKEY_LOCAL_MACHINE subtree:\n\n\\SOFTWARE\\MICROSOFT...
2008/10/13
[ "https://Stackoverflow.com/questions/197171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14302/" ]
197,190
<p>So, I understand <i>that</i> the following doesn't work, but <i>why</i> doesn't it work?</p> <pre><code>interface Adapter&lt;E&gt; {} class Adaptulator&lt;I&gt; { &lt;E, A extends I &amp; Adapter&lt;E&gt;&gt; void add(Class&lt;E&gt; extl, Class&lt;A&gt; intl) { addAdapterFactory(new AdapterFactory&lt;E...
[ { "answer_id": 197391, "author": "Bruno De Fraine", "author_id": 6918, "author_profile": "https://Stackoverflow.com/users/6918", "pm_score": 6, "selected": true, "text": "max public static <T extends Comparable<? super T>> T max(Collection<? extends T> coll)\n public static Comparable ma...
2008/10/13
[ "https://Stackoverflow.com/questions/197190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27358/" ]
197,199
<p>We're running a Rails site at <a href="http://hansard.millbanksystems.com" rel="nofollow noreferrer">http://hansard.millbanksystems.com</a>, on a dedicated Accelerator. We currently have Apache setup with mod-proxy-balancer, proxying to four mongrels running the application.</p> <p>Some requests are rather slow and...
[ { "answer_id": 393331, "author": "James Brady", "author_id": 29903, "author_profile": "https://Stackoverflow.com/users/29903", "pm_score": 2, "selected": false, "text": "mod_proxy_balancer" } ]
2008/10/13
[ "https://Stackoverflow.com/questions/197199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20035/" ]
197,211
<p>what is the best way to put a container class or a some other class inside a class as private or a public member?</p> <p>Requirements:</p> <p>1.Vector&lt; someclass> inside my class</p> <p>2.Add and count of vector is needed interface</p>
[ { "answer_id": 197250, "author": "xtofl", "author_id": 6610, "author_profile": "https://Stackoverflow.com/users/6610", "pm_score": 1, "selected": false, "text": "vector class ContWrapper {\n std::vector<int> _ints;\npublic:\n class Action {\n public: \n virtual void accep...
2008/10/13
[ "https://Stackoverflow.com/questions/197211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22076/" ]
197,215
<p>Does anyone know of any reverse proxy solutions that allow the content/data of an HTTP response to be directly modified before being relayed to the requesting client?</p> <p>As an example:</p> <p>Proxy relays client request for pdf document to another server, response received by proxy, watermark added to pages of...
[ { "answer_id": 197272, "author": "Mark Brackett", "author_id": 2199, "author_profile": "https://Stackoverflow.com/users/2199", "pm_score": 2, "selected": false, "text": "mod_proxy mod_proxy_html" } ]
2008/10/13
[ "https://Stackoverflow.com/questions/197215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27376/" ]
197,218
<p>I am trying to get system date in a C program on a MSVC++ 6.0 compiler. I am using a system call:</p> <p><strong>system("date /T")</strong> (output is e.g. 13-Oct-08 which is date on my system in the format i have set) </p> <p>but this prints the date to the i/o console. </p> <p>How do i make take this date as ...
[ { "answer_id": 197230, "author": "Constantin", "author_id": 20310, "author_profile": "https://Stackoverflow.com/users/20310", "pm_score": 1, "selected": false, "text": "#include <windows.h>\n#include <iostream>\n\nint main() {\n\n SYSTEMTIME systmDateTime = {};\n ::GetLocalTime(&systmD...
2008/10/13
[ "https://Stackoverflow.com/questions/197218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2759376/" ]
197,220
<p>I've got an ASP.NET 2.0 website that connects to a SQL database. I've upgraded the SQL server from 2000 to 2008 and since then, one page refuses to work. </p> <p>I've worked out the problem is that the call to SqlDataReader.HasRows is returning false even though the dataset is not empty and removing the check allow...
[ { "answer_id": 197964, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 1, "selected": false, "text": "HasRows image/BLOB Stored Procedure" }, { "answer_id": 198127, "author": "shahkalpesh", "author_id": 2...
2008/10/13
[ "https://Stackoverflow.com/questions/197220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27377/" ]
197,224
<p>I wanted to edit a log comment in the repository browser and received an error message that no pre-revprop-change hook exists for the repository. Besides having a scary name, what is a pre-revprop-change hook, and how do I create it?</p>
[ { "answer_id": 468475, "author": "patmortech", "author_id": 19090, "author_profile": "https://Stackoverflow.com/users/19090", "pm_score": 8, "selected": false, "text": "pre-revprop-change.bat \\hooks @ECHO OFF\n:: Set all parameters. Even though most are not used, in case you want to add...
2008/10/13
[ "https://Stackoverflow.com/questions/197224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2133/" ]
197,228
<p>I'm using the jquery library to load the content of an html file. Something like this:</p> <p>$("#Main").load("login.html")</p> <p>If the file (in this case 'login.html') does not exist, I would like to detect it so that I can redirect the user to an error page for example. Any ideas how I can detect if the file t...
[ { "answer_id": 197237, "author": "redsquare", "author_id": 6440, "author_profile": "https://Stackoverflow.com/users/6440", "pm_score": 5, "selected": true, "text": "$(\"#someDivId\").ajaxComplete(function(request, settings){\n if (settings.status===404){\n //redirect here\n ...
2008/10/13
[ "https://Stackoverflow.com/questions/197228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15928/" ]