qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
259,532
<p>I'm getting something pretty strange going on when trying to read some data using the MySql .net connector. Here's the code:</p> <pre><code>IDataReader reader = null; using (MySqlConnection connection = new MySqlConnection(this.ConnectionString)) { String getSearch = "select * from organization"; MySqlComm...
[ { "answer_id": 259595, "author": "Bogdan Maxim", "author_id": 23795, "author_profile": "https://Stackoverflow.com/users/23795", "pm_score": 0, "selected": false, "text": "cmd.ExecuteReader(); Typed DataSet DataSet optimizations Connection ExecuteReader using IDisposable Command IDisposab...
2008/11/03
[ "https://Stackoverflow.com/questions/259532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33721/" ]
259,534
<p>Thanks for going to answer my question. I have the folowing pages.</p> <ul> <li>login.aspx</li> <li>default.aspx</li> <li>xxx.aspx</li> </ul> <p>After logging into application default.aspx will be displayed. Now if the user is trying to open <a href="http://server/" rel="nofollow noreferrer">http://server/</a><str...
[ { "answer_id": 259541, "author": "Markus Nigbur", "author_id": 33231, "author_profile": "https://Stackoverflow.com/users/33231", "pm_score": 0, "selected": false, "text": "Response.Redirect(Request.UrlReferrer.ToString());\n" }, { "answer_id": 259579, "author": "wonderchook",...
2008/11/03
[ "https://Stackoverflow.com/questions/259534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33722/" ]
259,536
<p>Does anyone has a good solution for a C# version of the C++ __FUNCTION__ macro? The compiler does not seem to like it.</p>
[ { "answer_id": 259544, "author": "Eoin Campbell", "author_id": 30155, "author_profile": "https://Stackoverflow.com/users/30155", "pm_score": 6, "selected": true, "text": "System.Reflection.MethodBase.GetCurrentMethod().Name\n __LINE__ __FUNCTION__" }, { "answer_id": 259545, "...
2008/11/03
[ "https://Stackoverflow.com/questions/259536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21704/" ]
259,540
<p>It seems that the following piece of HTML is ignored in IE7 but works ok in IE6/FF. It supposes to override all the html links to be opened in the desired frame</p> <pre><code>&lt;HEAD&gt; &lt;title&gt;LeftPane&lt;/title&gt; &lt;base target="rightFrame"&gt; &lt;/HEAD&gt; </code></pre> <p>The above code i...
[ { "answer_id": 259549, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 1, "selected": false, "text": "href=\"\"" }, { "answer_id": 260172, "author": "Oscar Cabrero", "author_id": 14440, "author_profile": "ht...
2008/11/03
[ "https://Stackoverflow.com/questions/259540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14440/" ]
259,547
<p>If I have a table like this:</p> <pre><code>CREATE TABLE sizes ( name ENUM('small', 'medium', 'large') ); </code></pre> <p>Is MySQL going to store those strings in every row, or internally will it use something smaller like integers to know which enum value to refer to?</p> <p>I want to use an enum in a table...
[ { "answer_id": 259561, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 6, "selected": true, "text": "SELECT mycolumn + 0" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/259547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13009/" ]
259,562
<p>I'm an old hand at embedded programming but new to CE and having a lot of trouble doing reasonably simple things, because I am not familiar with the API and struggling to understand the obscure MSDN docs.</p> <p>All I want to do is minimize and maximise two separate applications that are running from one of the app...
[ { "answer_id": 259582, "author": "Craig Nicholson", "author_id": 28305, "author_profile": "https://Stackoverflow.com/users/28305", "pm_score": 1, "selected": false, "text": "HWND hWnd = ::FindWindow( _T(\"Notepad\"), NULL); \n::ShowWindow(hWnd, SW_HIDE); \n" }, { "answer_id": 268...
2008/11/03
[ "https://Stackoverflow.com/questions/259562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33720/" ]
259,575
<p>I am writing a java program that needs a file open dialog. The file open dialog isn't difficult, I'm hoping to use a <code>JFileChooser</code>. My problem is that I would like to have a dual pane <code>JFrame</code> (consisting of 2 <code>JPanels</code>). The left panel would have a <code>JList</code>, and the ri...
[ { "answer_id": 259583, "author": "Steve Kuo", "author_id": 24396, "author_profile": "https://Stackoverflow.com/users/24396", "pm_score": 5, "selected": true, "text": "JFileChooser fc = ...\nJPanel panel ...\npanel.add(fc);\n" }, { "answer_id": 264697, "author": "Community", ...
2008/11/03
[ "https://Stackoverflow.com/questions/259575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33725/" ]
259,587
<p>We have 3 applications using 3 different spring configuration files. But we have one database and one datasource, so one session factory.Hhow can we import the session factory bean into the 3 different spring config files?</p>
[ { "answer_id": 259599, "author": "Paul Croarkin", "author_id": 18995, "author_profile": "https://Stackoverflow.com/users/18995", "pm_score": 2, "selected": false, "text": "<import resource=\"database-config.xml\"/>\n" }, { "answer_id": 259779, "author": "Dan Vinton", "aut...
2008/11/03
[ "https://Stackoverflow.com/questions/259587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
259,600
<p>I've read quite a bit of the Red Bean Software SVN Book, and some of the questions here on SO, but I want to make sure I'm going about this in the right way the first time around step-by-step before I begin using it. Is this correct?</p> <ol> <li>Install SVN.</li> <li><p>Create SVN repository at /usr/local/svn. Dir...
[ { "answer_id": 259628, "author": "Davide Gualano", "author_id": 28582, "author_profile": "https://Stackoverflow.com/users/28582", "pm_score": 4, "selected": true, "text": "svn mkdir /usr/local/svn svn mkdir file:///usr/local/svn/projects -m \"Parent dir for projects created\"\n" }, {...
2008/11/03
[ "https://Stackoverflow.com/questions/259600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
259,613
<p>I'm considering migrating a project to managed code, but I've heard that the .NET runtime is huge--several times larger than my executable binary, in fact. That just seems like the tail wagging the dog to me. But I've also been told that some CLR implementations, such as Mono, are modular, and you can create a cus...
[ { "answer_id": 259652, "author": "Bogdan Maxim", "author_id": 23795, "author_profile": "https://Stackoverflow.com/users/23795", "pm_score": 1, "selected": false, "text": "ClickOnce" }, { "answer_id": 259880, "author": "Orion Edwards", "author_id": 234, "author_profile...
2008/11/03
[ "https://Stackoverflow.com/questions/259613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32914/" ]
259,622
<p>How do I send mail via PHP with attachment of HTML file? -> Content of HTML file (code) is in string in DB. Is there some easy way or free script to do this? I don't want to store the file localy, I need to read it out of DB and send it straightaway as attachment (not included in body).</p>
[ { "answer_id": 259690, "author": "Georg Zimmer", "author_id": 3569719, "author_profile": "https://Stackoverflow.com/users/3569719", "pm_score": 2, "selected": false, "text": "<?\ninclude('Mail.php');\ninclude('Mail/mime.php');\n$text = 'Text version of email';\n$html = '<html><body>HTML ...
2008/11/03
[ "https://Stackoverflow.com/questions/259622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21209/" ]
259,634
<p>ok so basically I am asking the question of their name I want this to be one input rather than Forename and Surname.</p> <p>Now is there any way of splitting this name? and taking just the last word from the "Sentence" e.g.</p> <pre><code>name = "Thomas Winter" print name.split() </code></pre> <p>and what would ...
[ { "answer_id": 259638, "author": "JesperE", "author_id": 13051, "author_profile": "https://Stackoverflow.com/users/13051", "pm_score": 2, "selected": false, "text": "print name.split()[-1]\n" }, { "answer_id": 259639, "author": "Adam Alexander", "author_id": 33164, "a...
2008/11/03
[ "https://Stackoverflow.com/questions/259634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
259,656
<p>I'm running through an XML document, selecting all the elements, and creating links based on the ancestor which is usually two nodes up in the tree, but occasionally 3 or 4 nodes up. For the majority of the elements, using <code>&lt;xsl:value-of select="translate(../../@name,$uc,$lc)" /&gt;</code> works just fin...
[ { "answer_id": 259664, "author": "Chris Marasti-Georg", "author_id": 96, "author_profile": "https://Stackoverflow.com/users/96", "pm_score": 3, "selected": true, "text": "<xsl:value-of select=\"translate(ancestor::s4:package/@name,$uc,$lc)\" />\n <xsl:value-of select=\"translate(ancestor...
2008/11/03
[ "https://Stackoverflow.com/questions/259656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26257/" ]
259,673
<p><strong>What is the best way to share Delphi source files among projects?</strong></p> <p><em>Clarification: We want to use a single source file in multiple Delphi projects. We've been using our SCM tool to put the same file into multiple folders, but this is not a super-elegant experience and we are also consider...
[ { "answer_id": 295322, "author": "vrad", "author_id": 12891, "author_profile": "https://Stackoverflow.com/users/12891", "pm_score": 1, "selected": false, "text": "\\Main\n \\Project1\n \\Project2\n ...\n \\CommonUnits\n" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/259673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32841/" ]
259,676
<ol> <li><p>In a simple winform application, I call a function that endlessy create files on a button click event. I add Application.DoEvents() to the loop.</p></li> <li><p>I press the red X to close the form.</p></li> <li><p>the form closes, but files continue to be created ... </p></li> </ol> <p>I think its on the b...
[ { "answer_id": 259695, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "Application.DoEvents CancelAsync CancellationPending" }, { "answer_id": 259703, "author": "Bogdan Maxim", ...
2008/11/03
[ "https://Stackoverflow.com/questions/259676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/195/" ]
259,709
<p>I the following styles:</p> <pre><code>a.button { background-color: orange; margin: .2cm; padding: .2cm; color: black; font-family: sans-serif; text-decoration: none; font-weight: bold; border: solid #000000; } a.buttonMouseover { background-color: darkGoldenRod; margin: .2c...
[ { "answer_id": 259712, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 4, "selected": true, "text": "hover a.button {\n background-color: orange;\n margin: .2cm;\n padding: .2cm;\n color: black;\n font-family: s...
2008/11/03
[ "https://Stackoverflow.com/questions/259709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2598/" ]
259,719
<p>I'm building an XML document with PHP's SimpleXML extension, and I'm adding a token to the file:</p> <pre><code>$doc-&gt;addChild('myToken'); </code></pre> <p>This generates (what I know as) a self-closing or single tag:</p> <pre><code>&lt;myToken/&gt; </code></pre> <p>However, the aging web-service I'm communic...
[ { "answer_id": 259754, "author": "Piskvor left the building", "author_id": 19746, "author_profile": "https://Stackoverflow.com/users/19746", "pm_score": 3, "selected": true, "text": "<?php\n$sxe = new SimpleXMLElement($someData, LIBXML_NOEMPTYTAG);\n\n// some processing here\n\n$out = $s...
2008/11/03
[ "https://Stackoverflow.com/questions/259719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33739/" ]
259,726
<p>I am using XmlSerializer to write and read an object to xml in C#. I currently use the attributes <code>XmlElement</code> and <code>XmlIgnore</code> to manipulate the serialization of the object.</p> <p>If my xml file is missing an xml element that I require, my object still deserializes (xml -> object) just fine....
[ { "answer_id": 259969, "author": "Richard Nienaber", "author_id": 9539, "author_profile": "https://Stackoverflow.com/users/9539", "pm_score": 4, "selected": false, "text": "static T Deserialize<T>(string xml, XmlSchemaSet schemas)\n{\n //List<XmlSchemaException> exceptions = new List<...
2008/11/03
[ "https://Stackoverflow.com/questions/259726", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6180/" ]
259,751
<p>Need a function like: </p> <pre><code>function isGoogleURL(url) { ... } </code></pre> <p>that returns true iff URL belongs to Google. No false positives; no false negatives.</p> <p>Luckily there's <a href="http://www.google.com/supported_domains" rel="nofollow noreferrer">this</a> as a reference:</p> <blockquote...
[ { "answer_id": 259788, "author": "luiscubal", "author_id": 32775, "author_profile": "https://Stackoverflow.com/users/32775", "pm_score": 0, "selected": false, "text": "<script>\nvar elem = document.getElementById(\"a\");\nvar regex = new RegExp(\"(http://)?(www\\\\.)?google\\\\.com\");\n...
2008/11/03
[ "https://Stackoverflow.com/questions/259751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11208/" ]
259,753
<p>I can't get the inner div (with Hello World) to fit inside the "box" div in this code example (also at <a href="http://www.toad-software.com/test.html" rel="nofollow noreferrer">http://www.toad-software.com/test.html</a>).</p> <p>Despite the body being set to 100%, the inner div will not be contained! This is a tes...
[ { "answer_id": 259761, "author": "Javier", "author_id": 11649, "author_profile": "https://Stackoverflow.com/users/11649", "pm_score": 4, "selected": false, "text": "overflow:hidden; <div>" }, { "answer_id": 260792, "author": "Steve Perks", "author_id": 16124, "author_...
2008/11/03
[ "https://Stackoverflow.com/questions/259753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/335036/" ]
259,784
<p>Compiling a program on Linux that calls POSIX timer functions (eg: timer_create, timer_settime) returns errors such as:</p> <pre> In function `foo': timer.c:(.text+0xbb): undefined reference to `timer_create' timer.c:(.text+0x187): undefined reference to `timer_settime' collect2: ld returned 1 exit status </pre> <...
[ { "answer_id": 259789, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "-lrt" }, { "answer_id": 552654, "author": "Community", "author_id": -1, "author_profile": "https://Stackov...
2008/11/03
[ "https://Stackoverflow.com/questions/259784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
259,798
<p>I've got a (SQL Server 2005) database where I'd like to create views on-the-fly. In my code, I'm building a CREATE VIEW statement, but the only way I can get it to work is by building the entire query string and running it bare. I'd like to use parameters, but this:</p> <pre><code>SqlCommand cmd = new SqlCommand(...
[ { "answer_id": 259808, "author": "friol", "author_id": 23034, "author_profile": "https://Stackoverflow.com/users/23034", "pm_score": 2, "selected": true, "text": "viewname=\"foo\";\nviewwhere=\"* from bar\";\n\nSqlCommand cmd = new SqlCommand(\"CREATE VIEW \"+viewname+\" AS SELECT \"+vie...
2008/11/03
[ "https://Stackoverflow.com/questions/259798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26286/" ]
259,800
<p>What exception should I throw if I encounter an illegal state - for instance, an initialization method that should only be called once being called a second time? I don't really see any built-in exception that makes sense. This seems like something that should be in the framework - am I not poking in the right spo...
[ { "answer_id": 51556216, "author": "Maarten Bodewes", "author_id": 589259, "author_profile": "https://Stackoverflow.com/users/589259", "pm_score": 1, "selected": false, "text": "SystemException SystemException InvalidOperationException ToString" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/259800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/96/" ]
259,803
<p>Let's say I have a simple stored procedure that looks like this (note: this is just an example, not a practical procedure):</p> <pre><code>CREATE PROCEDURE incrementCounter AS DECLARE @current int SET @current = (select CounterColumn from MyTable) + 1 UPDATE MyTable SET CounterColumn = current GO </code><...
[ { "answer_id": 259931, "author": "Dave Cluderay", "author_id": 30933, "author_profile": "https://Stackoverflow.com/users/30933", "pm_score": 4, "selected": false, "text": "BEGIN TRANSACTION END TRANSACTION SERIALIZABLE READ COMMITTED SET TRANSACTION ISOLATION LEVEL SERIALIZABLE\n" }, ...
2008/11/03
[ "https://Stackoverflow.com/questions/259803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30006/" ]
259,819
<p>I want to create a view that consists solely of a <code>UITextView</code>. When the view is first shown, by default, I'd like the keyboard to be visible and ready for text entry. This way, the user does not have to touch the <code>UITextView</code> first in order to begin editing.</p> <p>Is this possible? I see the...
[ { "answer_id": 259842, "author": "Adam Alexander", "author_id": 33164, "author_profile": "https://Stackoverflow.com/users/33164", "pm_score": 7, "selected": true, "text": "- (void)viewWillAppear:(BOOL)animated {\n [super viewWillAppear:animated];\n [textField becomeFirstResponder];...
2008/11/03
[ "https://Stackoverflow.com/questions/259819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543/" ]
259,836
<p>What is the best way to convert an array of bytes declared as TBytes to a unicode string in Delphi 2009? In my particular case, the TBytes array has UTF-16 encoded data already (2 bytes for each char).</p> <p>Since TBytes doesn't store a null terminator, the following will only work if the array happens to have #0 ...
[ { "answer_id": 259973, "author": "Jeremy Mullin", "author_id": 7893, "author_profile": "https://Stackoverflow.com/users/7893", "pm_score": 5, "selected": true, "text": "TEncoding.Unicode.GetString( MyByteArray );\n" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/259836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7893/" ]
259,841
<p>The company I work for writes a lot smallish Perl and Bash scripts to massage data into something usable for our software. These scripts, like any code, can change. I provided them CVS because of the file versioning rather than repository versioning. Anyway, I am thinking out a deploy tool to get the scripts from...
[ { "answer_id": 259899, "author": "Ilya", "author_id": 6807, "author_profile": "https://Stackoverflow.com/users/6807", "pm_score": 2, "selected": true, "text": "make dist\n cvs up -An \n grep -c ^[MCAR] \n" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/259841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28714/" ]
259,850
<p>I am performing two validations on the client side on the samve event. I have defined my validations as shown below</p> <pre><code>btnSearch.Attributes["OnClick"] = "javascript:return prepareSave(); return prepareSearch();" </code></pre> <p>Pseudo code for </p> <pre><code>prepareSave(): { if (bPendingchanges) ...
[ { "answer_id": 259869, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 1, "selected": true, "text": "return javascript:return prepareSave() btnSearch.Attributes[\"OnClick\"] = javascript: return prepareSave() && prepareSearch()...
2008/11/03
[ "https://Stackoverflow.com/questions/259850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13370/" ]
259,853
<p>As Scott Myers wrote, you can take advantage of a relaxation in C++'s type-system to declare clone() to return a pointer to the actual type being declared:</p> <pre><code>class Base { virtual Base* clone() const = 0; }; class Derived : public Base { virtual Derived* clone() const }; </code></pre> <p>The c...
[ { "answer_id": 259946, "author": "coppro", "author_id": 16855, "author_profile": "https://Stackoverflow.com/users/16855", "pm_score": 4, "selected": true, "text": "clone clone" }, { "answer_id": 260054, "author": "Matt Cruikshank", "author_id": 8643, "author_profile":...
2008/11/03
[ "https://Stackoverflow.com/questions/259853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1674/" ]
259,883
<p>I'd like to strip out occurrences of a specific tag, leaving the inner XML intact. I'd like to do this with one pass (rather than searching, replacing, and starting from scratch again). For instance, from the source:</p> <pre><code>&lt;element&gt; &lt;RemovalTarget Attribute="Something"&gt; Content Here...
[ { "answer_id": 259987, "author": "user7116", "author_id": 7116, "author_profile": "https://Stackoverflow.com/users/7116", "pm_score": 3, "selected": true, "text": "var elements = doc.Descendants(\"RemovalTarget\").ToList().Reverse();\n/* reverse on the IList<T> may be faster than Reverse...
2008/11/03
[ "https://Stackoverflow.com/questions/259883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1807/" ]
259,884
<p>I have a very standard <code>Gridview</code>, with Edit and Delete buttons auto-generated. It is bound to a <code>tableadapter</code> which is linked to my <code>RelationshipTypes</code> table.</p> <pre><code>dbo.RelationshipTypes: ID, Name, OriginConfigTypeID, DestinationConfigTypeID </code></pre> <p>I wish to us...
[ { "answer_id": 259987, "author": "user7116", "author_id": 7116, "author_profile": "https://Stackoverflow.com/users/7116", "pm_score": 3, "selected": true, "text": "var elements = doc.Descendants(\"RemovalTarget\").ToList().Reverse();\n/* reverse on the IList<T> may be faster than Reverse...
2008/11/03
[ "https://Stackoverflow.com/questions/259884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13959/" ]
259,886
<p>I want to assign a resource I already have a second name, similar to using the BasedOn property of Styles. Specifically I have a brush that I use for a group of elements called ForegroundColor and I would like to use it in a control template (a ComboBox) calling it MouseOverBackgroundBrush. I would like to do someth...
[ { "answer_id": 259976, "author": "Amanda Mitchell", "author_id": 26628, "author_profile": "https://Stackoverflow.com/users/26628", "pm_score": 3, "selected": true, "text": "Resources[\"MouseOverBackgroundBrush\"] = Resources[\"ForegroundColor\"];\n" }, { "answer_id": 259992, ...
2008/11/03
[ "https://Stackoverflow.com/questions/259886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21186/" ]
259,887
<p>In writing the code that throws the exception I asked about <a href="https://stackoverflow.com/questions/259800/is-there-a-built-in-net-exception-that-indicates-an-illegal-object-state">here</a>, I came to the end of my message, and paused at the punctuation. I realized that nearly every exception message I've ever...
[ { "answer_id": 259917, "author": "Bogdan", "author_id": 24022, "author_profile": "https://Stackoverflow.com/users/24022", "pm_score": 2, "selected": false, "text": "throw new MagicalException(getText(\"magical.exception.text\"));\n" }, { "answer_id": 259919, "author": "ericks...
2008/11/03
[ "https://Stackoverflow.com/questions/259887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/96/" ]
259,889
<p>If I have a button like the one in this image :</p> <p><strong><a href="http://www.freeimagehosting.net/image.php?4cd775814c.png" rel="nofollow noreferrer">http://www.freeimagehosting.net/image.php?4cd775814c.png</a></strong></p> <p>how could I make the text display itself vertically ? As in </p> <pre> j B u t t ...
[ { "answer_id": 259928, "author": "asalamon74", "author_id": 21348, "author_profile": "https://Stackoverflow.com/users/21348", "pm_score": 4, "selected": true, "text": "button = new JButton(\"<html>J<br>b<br>u<br>t<br>t<br>o<br>n<br>1</html>\");\n" }, { "answer_id": 260099, "a...
2008/11/03
[ "https://Stackoverflow.com/questions/259889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31610/" ]
259,890
<p>How do you draw the following dynamic <strong>3D</strong> array with OpenGL <strong>glDrawPixels()</strong>? You can find the documentation here: <a href="http://opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawpixels.html" rel="nofollow noreferrer">http://opengl.org/documentation/specs/man_pages/har...
[ { "answer_id": 261776, "author": "unwind", "author_id": 28169, "author_profile": "https://Stackoverflow.com/users/28169", "pm_score": 3, "selected": true, "text": "malloc() glDrawPixels() malloc() float *array3d;\narray3d = malloc(scene.camera.hres * scene.camera.vres * 3 * sizeof *array...
2008/11/03
[ "https://Stackoverflow.com/questions/259890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13937/" ]
259,897
<p>This question is related to <a href="https://stackoverflow.com/questions/259663/vba-password-protection-how-it-works-is-it-secure-are-there-any-alternatives">my previous one</a>.</p> <p>Can you explain or provide a link to an explanation of how Excel VBA code password protection actually works in versions prior to ...
[ { "answer_id": 260619, "author": "Phil.Wheeler", "author_id": 15609, "author_profile": "https://Stackoverflow.com/users/15609", "pm_score": 5, "selected": true, "text": "vbext_pp_locked vbext_pp_locked" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/259897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/578/" ]
259,900
<p>Check it out: this little .NET Console Program yields interesting results...notice how I'm converting a float to an integer in two different ways:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CastVsConvert { class Program { static vo...
[ { "answer_id": 259906, "author": "Andrew Bullock", "author_id": 28543, "author_profile": "https://Stackoverflow.com/users/28543", "pm_score": 4, "selected": false, "text": "cast convert" }, { "answer_id": 259937, "author": "OwenP", "author_id": 2547, "author_profile":...
2008/11/03
[ "https://Stackoverflow.com/questions/259900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33754/" ]
259,902
<p>I have the following solution project structure:</p> <blockquote> <p>Application.Core.Entities</p> <p>Application.Xtend.CustomerName.Entities</p> </blockquote> <p>In the Core project I have an entity <strong>Customer</strong> defiend. In the XTend project, I have an entity defined that subclasses Customer named <str...
[ { "answer_id": 261820, "author": "kͩeͣmͮpͥ ͩ", "author_id": 26479, "author_profile": "https://Stackoverflow.com/users/26479", "pm_score": 2, "selected": false, "text": "extends <class> .hbm.xml" }, { "answer_id": 262419, "author": "NotMyself", "author_id": 303, "autho...
2008/11/03
[ "https://Stackoverflow.com/questions/259902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/303/" ]
259,941
<p>Wondering if my approach is ok or could be improved:</p> <pre><code>Public Class Company private _id as Integer private _name as String private _location as String Public Function LoadMultipleByLocation(Byval searchStr as String) as List(Of Company) 'sql etc here to build the list End Function End...
[ { "answer_id": 259964, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 1, "selected": false, "text": "public class Company : EntityBase\n{\n private int _id;\n private string _name;\n private string _location;\n}\n...
2008/11/03
[ "https://Stackoverflow.com/questions/259941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
259,943
<p>I have to simultaneously load data into a table and run queries on it. Because of data nature, I can trade integrity for performance. How can I minimize the overhead of transactions?</p> <p>Unfortunately, alternatives like MySQL cannot be used (due to non-technical reasons). </p>
[ { "answer_id": 262111, "author": "Leigh Riffel", "author_id": 27010, "author_profile": "https://Stackoverflow.com/users/27010", "pm_score": 2, "selected": true, "text": "No Archive Log /*+ APPEND */ RAID 0 RAID 10" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/259943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18174/" ]
259,956
<p>What is the best way to tokenize/split a NSString in Objective-C?</p>
[ { "answer_id": 259966, "author": "Adam Alexander", "author_id": 33164, "author_profile": "https://Stackoverflow.com/users/33164", "pm_score": 9, "selected": true, "text": "NSString *string = @\"oop:ack:bork:greeble:ponies\";\nNSArray *chunks = [string componentsSeparatedByString: @\":\"]...
2008/11/03
[ "https://Stackoverflow.com/questions/259956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
259,968
<p>Consider the following file</p> <pre><code>var1 var2 variable3 1 2 3 11 22 33 </code></pre> <p>I would like to load the numbers into a matrix, and the column titles into a variable that would be equivalent to:</p> <pre><code>variable_names = char('var1', 'var2', 'variable3'); </code></pre> <p>I don't...
[ { "answer_id": 260016, "author": "Robert Van Hoose", "author_id": 460599, "author_profile": "https://Stackoverflow.com/users/460599", "pm_score": 1, "selected": false, "text": "fid = fopen(filename,'r');\nheading = textscan(fid,'%s %s %s',1);\nfgetl(fid); %advance the file pointer one li...
2008/11/03
[ "https://Stackoverflow.com/questions/259968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17523/" ]
259,972
<p>I am trying to create an instance of a COM object. I have the class name that implements the interface and I get a CLSID by using CLSIDFromProgID(). So since I am getting a CLSID I thought everything should be fine from now on. However when I do a call to CreateInstance and pass in the CLSID, I get an error saying "...
[ { "answer_id": 1742446, "author": "RandomNickName42", "author_id": 67819, "author_profile": "https://Stackoverflow.com/users/67819", "pm_score": 0, "selected": false, "text": "var shl = (Shell) Activator.CreateInstance(Type.GetTypeFromProgID(\"Shell.Application\"));\n var shl2 = (Shell) ...
2008/11/03
[ "https://Stackoverflow.com/questions/259972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8661/" ]
260,008
<p>Is there a way to <strong>increase the font-size</strong> in the Firefox extension Firebug?</p>
[ { "answer_id": 12217650, "author": "Nat Ritmeyer", "author_id": 2032500, "author_profile": "https://Stackoverflow.com/users/2032500", "pm_score": 0, "selected": false, "text": "extensions.firebug.textSize about:config 0" }, { "answer_id": 17988316, "author": "Ankur Saxena", ...
2008/11/03
[ "https://Stackoverflow.com/questions/260008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6461/" ]
260,010
<p>If I have a query to return all matching entries in a DB that have "news" in the searchable column (i.e. <code>SELECT * FROM table WHERE column LIKE %news%</code>), and one particular row has an entry starting with "In recent World news, Somalia was invaded by ...", can I return a specific "chunk" of an SQL entry? K...
[ { "answer_id": 260023, "author": "Rockcoder", "author_id": 5290, "author_profile": "https://Stackoverflow.com/users/5290", "pm_score": 2, "selected": false, "text": "SELECT SUBSTRING(column, 1,20) FROM table WHERE column LIKE %news%\n" }, { "answer_id": 260029, "author": "Bob...
2008/11/03
[ "https://Stackoverflow.com/questions/260010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25515/" ]
260,040
<p>I want to make a transparent dialog. I capture the OnCtlColor message in a CDialog derived class...this is the code:</p> <pre><code>HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); if(bSetBkTransparent_) { pDC-&gt;SetBkMode(...
[ { "answer_id": 68690192, "author": "Mecanik", "author_id": 6583298, "author_profile": "https://Stackoverflow.com/users/6583298", "pm_score": 0, "selected": false, "text": "case WM_CTLCOLORSTATIC: \n{\n HDC hDC = (HDC)wParam;\n SetTextColor(hDC, RGB(255, 255, 255));\n SetBkMode(h...
2008/11/03
[ "https://Stackoverflow.com/questions/260040", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14053/" ]
260,043
<p>I want to display from cache for a long time and I want a slightly different behavior on page render vs loading the page from cache. Is there an easy way I can determine this with JavaScript?</p>
[ { "answer_id": 260108, "author": "Will Dieterich", "author_id": 31233, "author_profile": "https://Stackoverflow.com/users/31233", "pm_score": 1, "selected": false, "text": "timestamp cacheLength timestamp timestamp+cacheLength" }, { "answer_id": 13390644, "author": "Reactgula...
2008/11/03
[ "https://Stackoverflow.com/questions/260043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30099/" ]
260,056
<p>I'm trying to figure out if there's a reasonably efficient way to perform a lookup in a dictionary (or a hash, or a map, or whatever your favorite language calls it) where the keys are regular expressions and strings are looked up against the set of keys. For example (in Python syntax):</p> <pre><code>&gt;&gt;&gt;...
[ { "answer_id": 260079, "author": "Moe", "author_id": 3051, "author_profile": "https://Stackoverflow.com/users/3051", "pm_score": 0, "selected": false, "text": ">>> regex_dict['FileNfoo']\n" }, { "answer_id": 260085, "author": "Eli Courtwright", "author_id": 1694, "aut...
2008/11/03
[ "https://Stackoverflow.com/questions/260056", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33775/" ]
260,064
<p>Published Date returned from Twitter Search API Atom Feed as 2008-11-03T21:30:06Z which needs to be converted to "X seconds/minutes/hours/days ago" for showing how long ago twitter messages were posted.</p> <p>Think this can be done with php date() function using DATE_ATOM value?</p>
[ { "answer_id": 260199, "author": "Jack", "author_id": 24998, "author_profile": "https://Stackoverflow.com/users/24998", "pm_score": 3, "selected": true, "text": "function time_since($your_timestamp) {\n $unix_timestamp = strtotime($your_timestamp);\n $seconds = time() - $unix_times...
2008/11/03
[ "https://Stackoverflow.com/questions/260064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
260,094
<p>I've been developing a few JSF applications lately and am disturbed with the inconsistency in the web component APIs. </p> <p>I've noticed that there is extremely unpredictable behavior when calling .getValue() or .getSubmittedValue() on a JSF component object in server side code. Sometimes when I call .getValue() ...
[ { "answer_id": 1145620, "author": "Dr. Nichols", "author_id": 140412, "author_profile": "https://Stackoverflow.com/users/140412", "pm_score": 6, "selected": true, "text": "submit" }, { "answer_id": 46676231, "author": "Andrew", "author_id": 1599699, "author_profile": ...
2008/11/03
[ "https://Stackoverflow.com/questions/260094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/318/" ]
260,122
<p>I am trying to add a "title" element but am getting a NO_MODIFICATION_ALLOWED_ERR error...</p> <pre><code>private static void saveDoc(String f) throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(f)...
[ { "answer_id": 260178, "author": "Bogdan", "author_id": 24022, "author_profile": "https://Stackoverflow.com/users/24022", "pm_score": 0, "selected": false, "text": "Document newDoc = doc.cloneNode(true);\n newDoc.setReadOnly(false,true);\n// ^^^^ also sets children\...
2008/11/03
[ "https://Stackoverflow.com/questions/260122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5653/" ]
260,125
<p>You'll have to forgive my ignorance, but I'm not used to using wide character sets in c++, but is there a way that I can use wide string literals in c++ without putting an L in front of each literal?</p> <p>If so, how?</p>
[ { "answer_id": 260135, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 1, "selected": false, "text": "const char* const wchar_t* TEXT() \n#ifdef UNICODE\n#define TEXT(s) L ## s\n#else\n#define TEXT(s) s\n#endif\n _T() ...
2008/11/03
[ "https://Stackoverflow.com/questions/260125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23553/" ]
260,150
<p>I am trying to use an XML-RPC server on my Drupal (PHP) backend to make it easier for my Perl backend to talk to it. However, I've run into an issue and I'm not sure which parts, if any, are bugs. Essentially, some of the variables I need to pass to Drupal are strings that sometimes are strings full of numbers and...
[ { "answer_id": 260283, "author": "Leon Timmermans", "author_id": 4727, "author_profile": "https://Stackoverflow.com/users/4727", "pm_score": 1, "selected": false, "text": "9876352345" }, { "answer_id": 260289, "author": "Owen", "author_id": 4853, "author_profile": "ht...
2008/11/03
[ "https://Stackoverflow.com/questions/260150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31240/" ]
260,165
<p>A colleague is looking to generate UML class diagrams from heaps of Python source code. He's primarily interested in the inheritance relationships, and mildly interested in compositional relationships, and doesn't care much about class attributes that are just Python primitives.</p> <p>The source code is pretty st...
[ { "answer_id": 7554457, "author": "Nicolas Chauvat", "author_id": 964956, "author_profile": "https://Stackoverflow.com/users/964956", "pm_score": 8, "selected": false, "text": "pyreverse -o png -p yourpackage .\n ." } ]
2008/11/03
[ "https://Stackoverflow.com/questions/260165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16056/" ]
260,195
<p>I have a query in which I am pulling the runtime of an executable. The database contains its start time and its end time. I would like to get the total time for the run. So far I have:</p> <pre><code>SELECT startTime, endTime, cast(datediff(hh,starttime,endtime) as varchar) +':' +cast(datediff(mi,starttime,endtime)...
[ { "answer_id": 260209, "author": "DOK", "author_id": 27637, "author_profile": "https://Stackoverflow.com/users/27637", "pm_score": 1, "selected": false, "text": "-- Find Hours, Minutes and Seconds in between two datetime\nDECLARE @First datetime\nDECLARE @Second datetime\nSET @First = '0...
2008/11/03
[ "https://Stackoverflow.com/questions/260195", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33727/" ]
260,210
<p>I'm using jQuery and wanting to target the nth &lt;li&gt; in a list after clicking the nth link.</p> <pre><code>&lt;ul id="targetedArea"&gt; &lt;li&gt;&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="clickedItems"&gt; &lt;a&gt;&lt;/a&gt; &lt;a&gt;&lt;...
[ { "answer_id": 260242, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 3, "selected": true, "text": "$('#clickedItems a').click(function() {\n// figure out what position this element is in\n var n = $('#clickedItems a').index($...
2008/11/03
[ "https://Stackoverflow.com/questions/260210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16124/" ]
260,217
<p>How can i draw a dotted line in .NET/WinForms/GDI+?</p> <pre><code>Pen p = new Pen (Color.Black) </code></pre> <p>gives me only solid line pen. </p> <p>I am trying to have a dotted (or dashed) lines; can't seem to be able to google it up successfully.</p> <p>Will much appreciate any help on this one.</p>
[ { "answer_id": 260221, "author": "cfeduke", "author_id": 5645, "author_profile": "https://Stackoverflow.com/users/5645", "pm_score": 6, "selected": true, "text": "p.DashStyle = DashStyle.Dash;\n" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/260217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19584/" ]
260,229
<p>I want to select records that are 1 month old or newer.</p> <p>The query is: SELECT * FROM foobar WHERE created_at > DATE_SUB(curdate(), INTERVAL 1 MONTH)</p> <p>Using Propel in Symfony, I do:</p> <blockquote> <p>$c = new Criteria<br> $c->add(FoobarPeer::CREATED_AT, "DATE_SUB(curdate(), INTERVAL 1 MONTH)", Cr...
[ { "answer_id": 260263, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 3, "selected": true, "text": "$con = Propel::getConnection(DATABASE_NAME);\n\n$sql = \"SELECT foobar.* FROM foobar WHERE created_at > DATE_SUB...
2008/11/03
[ "https://Stackoverflow.com/questions/260229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2706/" ]
260,233
<p>I've created a Visual Basic WPF Application project that contains Toy.edmx, an ADO.NET Entity Data Model generated from a database called Toy.</p> <p>Its <em>Window1.xaml.vb</em> file looks like this:</p> <pre> 1 Class Window1 2 3 Private Sub Window1_Loaded( _ 4 ByVal sender As System.Object, _ 5 ...
[ { "answer_id": 260784, "author": "Amy B", "author_id": 8155, "author_profile": "https://Stackoverflow.com/users/8155", "pm_score": 2, "selected": false, "text": "Partial Public Class Client\n Public Shared Function IsWashington(query As IQueryable(Of Client)) As IQueryable(Of Client)\n ...
2008/11/03
[ "https://Stackoverflow.com/questions/260233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83/" ]
260,235
<p>Consider the following simple C program that read a file into a buffer and displays that buffer to the console:</p> <pre><code>#include&lt;stdio.h&gt; main() { FILE *file; char *buffer; unsigned long fileLen; //Open file file = fopen("HelloWorld.txt", "rb"); if (!file) { fprintf(s...
[ { "answer_id": 260243, "author": "JesperE", "author_id": 13051, "author_profile": "https://Stackoverflow.com/users/13051", "pm_score": 6, "selected": true, "text": "buffer[fileLen] = 0;\n" }, { "answer_id": 260300, "author": "George Eadon", "author_id": 30530, "author...
2008/11/03
[ "https://Stackoverflow.com/questions/260235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5640/" ]
260,236
<p>I know that php has md5(), sha1(), and the hash() functions, but I want to create a hash using the MySQL PASSWORD() function. So far, the only way I can think of is to just query the server, but I want a function (preferably in php or Perl) that will do the same thing without querying MySQL at all.</p> <p>For exam...
[ { "answer_id": 1543873, "author": "defines", "author_id": 120990, "author_profile": "https://Stackoverflow.com/users/120990", "pm_score": 5, "selected": false, "text": "// The following is free for any use provided credit is given where due.\n// This code comes with NO WARRANTY of any ki...
2008/11/03
[ "https://Stackoverflow.com/questions/260236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
260,252
<p>I have a web-app that I would like to extend to support multiple languages with new URLs. For example, www.example.com/home.do stays English, but www.example.com/es/home.do is Spanish. My first thought was to create a Filter which rewrites incoming urls like /es/home.do to /home.do (and sets the Locale in the Requ...
[ { "answer_id": 260371, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 2, "selected": true, "text": "getContextPath() ServletContext.getContextPath() getRequestURI()" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/260252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7867/" ]
260,253
<p>A little example</p> <pre><code>TTest&lt;T&gt; = class private f : T; public function ToString : string; end; </code></pre> <p>If is an object then this should work</p> <pre><code>TTest&lt;T&gt;.ToString; begin Result := f.ToString; end; </code></pre> <p>But what happens when is say an integer? This woul...
[ { "answer_id": 260266, "author": "Toon Krijthe", "author_id": 18061, "author_profile": "https://Stackoverflow.com/users/18061", "pm_score": 2, "selected": false, "text": "TTest<T: TObject>.ToString;\nbegin\n Result := T.ToString;\nend;\n type\n TToString<T> = reference to function(cons...
2008/11/03
[ "https://Stackoverflow.com/questions/260253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22712/" ]
260,254
<p>I'm writing a simple C++ class in which I would like cache picture thumbnails versions of images downloaded from the web. As such, I would like to use a hash function which takes in URL strings and outputs a unique string suitable as a filename.</p> <p>Is there a simple way to do this without re-writing the functi...
[ { "answer_id": 260262, "author": "JesperE", "author_id": 13051, "author_profile": "https://Stackoverflow.com/users/13051", "pm_score": 2, "selected": true, "text": "#include <cctype>\n\nchar *safe_url(const char *str) {\n char *safe = strdup(str);\n for (int i = 0; i < strlen(str);...
2008/11/03
[ "https://Stackoverflow.com/questions/260254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33791/" ]
260,260
<p>I'm in need of a macro that will enter data into a webpage search field and than copy the results to excel.</p>
[ { "answer_id": 260297, "author": "Joel Spolsky", "author_id": 4, "author_profile": "https://Stackoverflow.com/users/4", "pm_score": 2, "selected": false, "text": "http://finance.yahoo.com/q?s=MSFT" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/260260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33792/" ]
260,270
<p>Folks,</p> <p>I am pulling all my Flash (pure AS3 project, not Flash CS3) content from a Drupal back-end for SEO purposes. This works great, except the HTML rendering built into the TextField object leaves a lot to be desired. Could anyone recommend any libraries that would allow me to display HTML elements? At ...
[ { "answer_id": 329914, "author": "aaaidan", "author_id": 26331, "author_profile": "https://Stackoverflow.com/users/26331", "pm_score": 2, "selected": false, "text": "DisplayObject flash.html.HTMLLoader HTMLLoader" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/260270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
260,273
<p>I have a file and I don't know how big it's going to be (it could be quite large, but the size will vary greatly). I want to search the last 10 lines or so to see if any of them match a string. I need to do this as quickly and efficiently as possible and was wondering if there's anything better than:</p> <pre><co...
[ { "answer_id": 260312, "author": "Ryan Ginstrom", "author_id": 10658, "author_profile": "https://Stackoverflow.com/users/10658", "pm_score": 3, "selected": false, "text": "file_handle = open(\"somefile\")\nfile_size = file_handle.tell()\nfile_handle.seek(max(file_size - 2*1024, 0))\n\n# ...
2008/11/03
[ "https://Stackoverflow.com/questions/260273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1057/" ]
260,285
<p>I've got a canvas that's 800x600 inside a window that's 300x300. When I press a certain key, I want it the canvas to move in that direction.<br> I've done this inside the window's code behind:</p> <pre> protected override void OnKeyDown(KeyEventArgs e) { base.OnKeyDown(e); Key keyPressed = e.Key; if (k...
[ { "answer_id": 260295, "author": "Tigraine", "author_id": 21699, "author_profile": "https://Stackoverflow.com/users/21699", "pm_score": 1, "selected": false, "text": "private static DateTime nextUpdate\n\nif (nextUpdate <= DateTime.Now)\n{\n//Move\nnextUpdate = DateTime.Now.AddMillisecon...
2008/11/03
[ "https://Stackoverflow.com/questions/260285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33324/" ]
260,335
<p>How does an application perform a proximity search? For example, a user types in a postal code, then the application lists all the businesses within 20 miles ordered by proximity.</p> <p>I want to build something like that in PHP and MySQL. Is this approach correct?</p> <ol> <li>Get the addresses for locations I'm...
[ { "answer_id": 260430, "author": "wonderchook", "author_id": 32113, "author_profile": "https://Stackoverflow.com/users/32113", "pm_score": 4, "selected": false, "text": "SELECT\n [DistanceRadius]=\n 69.09 *\n DEGREES(\n ACOS(\n SIN( RADIANS(latitu...
2008/11/03
[ "https://Stackoverflow.com/questions/260335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27305/" ]
260,337
<p>Why does this test program result in a <code>java.lang.IllegalMonitorStateException</code>?</p> <pre><code>public class test { static Integer foo = new Integer(1); public static void main(String[] args) { synchronized(foo) { foo++; foo.notifyAll(); } System.er...
[ { "answer_id": 260343, "author": "erickson", "author_id": 3474, "author_profile": "https://Stackoverflow.com/users/3474", "pm_score": 7, "selected": true, "text": "notifyAll notifyAll foo wait" }, { "answer_id": 260362, "author": "matt b", "author_id": 4249, "author_p...
2008/11/03
[ "https://Stackoverflow.com/questions/260337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29264/" ]
260,342
<p>I'm currently in the process of testing our solution that has the whole "gamut" of layers: UI, Middle, and the omnipresent Database.</p> <p>Before my arrival on my current team, query testing was done by the testers manually crafting queries that would theoretically return a result set that the stored procedure sho...
[ { "answer_id": 260608, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 1, "selected": false, "text": "TestCase TestCase" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/260342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14409/" ]
260,356
<p>I am experimenting for the first time with css layouts and my experience with CSS is very basic. What I want to achieve is a 2 column layout: left panel and content.<br> I have found this:</p> <pre><code>#leftcontent { position: absolute; left: 10px; top: 10px; width: 170px; border: 1px solid #C...
[ { "answer_id": 260364, "author": "Samir Talwar", "author_id": 20856, "author_profile": "https://Stackoverflow.com/users/20856", "pm_score": 3, "selected": true, "text": "#leftcontent {\n float: left;\n width:170px;\n border:1px solid #C0C0C0;\n padding: 2px;\n...
2008/11/03
[ "https://Stackoverflow.com/questions/260356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16989/" ]
260,372
<p>I occasionally work on an old project that uses classic asp as a front end and an access database as a backend.</p> <p>I'd like to create a new column in one of the tables that contains logic to calculate its value from the other columns in the row.</p> <p>I know how to do this in a more modern DBMS, but I don't t...
[ { "answer_id": 260631, "author": "pro3carp3", "author_id": 7899, "author_profile": "https://Stackoverflow.com/users/7899", "pm_score": 2, "selected": false, "text": "SELECT Table1.Col_1, Table1.Col_2, [Col_1]*[Col_2] AS Col_3\nFROM Table1;\n" } ]
2008/11/03
[ "https://Stackoverflow.com/questions/260372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
260,380
<p>I have a base class with an optional virtual function</p> <pre><code>class Base { virtual void OnlyImplementThisSometimes(int x) {} }; </code></pre> <p>When I compile this I get a warning about the unused param x. Is there some other way I should have implemented the virtual function? I have re-written it li...
[ { "answer_id": 260412, "author": "nlativy", "author_id": 33635, "author_profile": "https://Stackoverflow.com/users/33635", "pm_score": 6, "selected": true, "text": "virtual void OnlyImplementThisSometimes(int ) { }\n" }, { "answer_id": 260425, "author": "EvilTeach", "auth...
2008/11/03
[ "https://Stackoverflow.com/questions/260380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20889/" ]
260,387
<p>I am using the code below to display all the files from a directory in a drop down menu. Does anyone know how to make this alphabetical? I presume it has something to do with the sort function, I just can't figure out how!</p> <pre><code>&lt;?php $dirname = "images/"; $images = scandir($dirname); $dh = opendir($dir...
[ { "answer_id": 260400, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 3, "selected": false, "text": "<?php\n\n$dirname = \"images/\";\n$images = scandir($dirname);\n\n// This is how you sort an array, see http://php.net/sor...
2008/11/04
[ "https://Stackoverflow.com/questions/260387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32972/" ]
260,391
<p>I have an iphone app where I call these three functions in appDidFinishLaunching:</p> <pre><code>glMatrixMode(GL_PROJECTION); glOrthof(0, rect.size.width, 0, rect.size.height, -1, 1); glMatrixMode(GL_MODELVIEW); </code></pre> <p>When stepping through with the debugger I get EXC BAD ACCESS when I execute the first ...
[ { "answer_id": 266005, "author": "Brad Larson", "author_id": 19679, "author_profile": "https://Stackoverflow.com/users/19679", "pm_score": 3, "selected": true, "text": "context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];\n\nif (!context || ![EAGLContext setCurrentCont...
2008/11/04
[ "https://Stackoverflow.com/questions/260391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22471/" ]
260,398
<p>I have a list of stores, departments within the stores, and sales for each department, like so (created using max(sales) in a subquery, but that's not terribly important here I don't think):</p> <pre><code>toronto baskets 500 vancouver baskets 350 halifax baskets 100 toronto noodles 275 vancouver noodles...
[ { "answer_id": 260419, "author": "Noah Yetter", "author_id": 30080, "author_profile": "https://Stackoverflow.com/users/30080", "pm_score": 2, "selected": false, "text": "select store\n , max(department) keep(dense_rank last order by sales)\n , max(sales)\n from (\n ...que...
2008/11/04
[ "https://Stackoverflow.com/questions/260398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
260,399
<p>I know you cannot use a alias column in the where clause for T-SQL; however, has Microsoft provided some kind of workaround for this?</p> <blockquote> <p><strong>Related Questions:</strong> </p> <ul> <li><a href="https://stackoverflow.com/questions/200200/can-you-use-an-alias-in-the-where-clause-in-mysql"...
[ { "answer_id": 260437, "author": "Jim V.", "author_id": 33819, "author_profile": "https://Stackoverflow.com/users/33819", "pm_score": 6, "selected": true, "text": "select *\nfrom \n (\n select a + b as aliased_column\n from table\n ) dt\nwhere dt.aliased_column = something.\n" ...
2008/11/04
[ "https://Stackoverflow.com/questions/260399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1632/" ]
260,403
<p><strong>Short version</strong></p> <p>If I split my users into shards, how do I offer a "user search"? Obviously, I don't want every search to hit every shard.</p> <p><strong>Long version</strong></p> <p>By shard, I mean have multiple databases where each contains a fraction of the total data. For (a naive) exa...
[ { "answer_id": 267470, "author": "SquareCog", "author_id": 15962, "author_profile": "https://Stackoverflow.com/users/15962", "pm_score": 4, "selected": false, "text": "\"lastname='Smith' OR lastname='Jones'\"" } ]
2008/11/04
[ "https://Stackoverflow.com/questions/260403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
260,406
<p>I have a C program with an embedded Perl interpreter. I want to be able to precompile some Perl code from within the program. How do I do that?</p> <p>Rationale (if anyone is interested) is to be able to compile it once, store the parse tree, and execute many times (as long as the compiled code does not change).</p...
[ { "answer_id": 267979, "author": "Osama Al-Maadeed", "author_id": 25544, "author_profile": "https://Stackoverflow.com/users/25544", "pm_score": 2, "selected": false, "text": "-lperl -llibperl" } ]
2008/11/04
[ "https://Stackoverflow.com/questions/260406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
260,432
<p>I have the following method in my unit test project:</p> <pre><code> [TestMethod] [HostType("ASP.NET")] [UrlToTest("http://localhost:3418/Web/SysCoord/ChooseEPA.aspx")] [AspNetDevelopmentServerHost("%PathToWebRoot%")] public void TestMethod1() { Page page = TestContext.RequestedPage; ...
[ { "answer_id": 269052, "author": "cfeduke", "author_id": 5645, "author_profile": "https://Stackoverflow.com/users/5645", "pm_score": 1, "selected": false, "text": "MyApplicationFramework.Profile.EmployeeSearchCriteria" }, { "answer_id": 761403, "author": "Community", "aut...
2008/11/04
[ "https://Stackoverflow.com/questions/260432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12260/" ]
260,436
<p>Disclaimer: the following is a sin against XML. That's why I'm trying to change it with XSLT :)</p> <p>My XML currently looks like this:</p> <pre><code>&lt;root&gt; &lt;object name="blarg" property1="shablarg" property2="werg".../&gt; &lt;object name="yetanotherobject" .../&gt; &lt;/root&gt; </code></pre>...
[ { "answer_id": 29782321, "author": "n611x007", "author_id": 611007, "author_profile": "https://Stackoverflow.com/users/611007", "pm_score": 0, "selected": false, "text": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE elemke [\n<!ATTLIST brush wood CDATA #REQUIRE...
2008/11/04
[ "https://Stackoverflow.com/questions/260436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2555346/" ]
260,439
<p>I currently have two text boxes which accept any number. I have a text block that takes the two numbers entered and calculates the average. </p> <p>I was wondering if there was a way I could bind this text block to both text boxes and utilize a custom converter to calculate the average? I currently am catching the ...
[ { "answer_id": 260445, "author": "Jacob Carpenter", "author_id": 26627, "author_profile": "https://Stackoverflow.com/users/26627", "pm_score": 7, "selected": true, "text": "MultiBinding XAML <TextBlock>\n <TextBlock.Text>\n <MultiBinding Converter=\"{StaticResource myConverter}\">\n ...
2008/11/04
[ "https://Stackoverflow.com/questions/260439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23939/" ]
260,441
<p>In class, we are all 'studying' databases, and everyone is using Access. Bored with this, I am trying to do what the rest of the class is doing, but with raw SQL commands with MySQL instead of using Access.</p> <p>I have managed to create databases and tables, but now how do I make a relationship between two tables...
[ { "answer_id": 260453, "author": "Eric Hogue", "author_id": 4137, "author_profile": "https://Stackoverflow.com/users/4137", "pm_score": 8, "selected": true, "text": "CREATE TABLE accounts(\n account_id INT NOT NULL AUTO_INCREMENT,\n customer_id INT( 4 ) NOT NULL ,\n account_type...
2008/11/04
[ "https://Stackoverflow.com/questions/260441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2592/" ]
260,464
<p>I'm running my C++ program in gdb. I'm not real experienced with gdb, but I'm getting messages like:</p> <pre><code>warning: HEAP[test.exe]: warning: Heap block at 064EA560 modified at 064EA569 past requested size of 1 </code></pre> <p>How can I track down where this is happening at? Viewing the memory doesn't giv...
[ { "answer_id": 16990738, "author": "Rafał", "author_id": 1048556, "author_profile": "https://Stackoverflow.com/users/1048556", "pm_score": 0, "selected": false, "text": "itemsetList_t ** iteration_isets; iteration_isets = realloc(iteration_isets, sizeof(itemsetList_t *) * max_elem); iter...
2008/11/04
[ "https://Stackoverflow.com/questions/260464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3175/" ]
260,484
<p>How do I query the iPhone's current IP address?</p>
[ { "answer_id": 2913328, "author": "Krumelur", "author_id": 292477, "author_profile": "https://Stackoverflow.com/users/292477", "pm_score": 4, "selected": false, "text": "\n/*\nReturns the local IP, or NULL on failure.\n*/\nconst char* GetLocalIP() {\n char buf[256];\n if(gethostname(bu...
2008/11/04
[ "https://Stackoverflow.com/questions/260484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
260,491
<p>I'm developing a library for use in other apps and this library has lots of debugging and logging statements thanks to NLog.</p> <p>Is it possible to exclude the reference to NLog.dll when I switch to release mode?</p> <p>Cheers,</p>
[ { "answer_id": 860601, "author": "Sander Rijken", "author_id": 5555, "author_profile": "https://Stackoverflow.com/users/5555", "pm_score": 6, "selected": true, "text": "<Reference Include=\"NLog\" Condition=\"'$(Configuration)' == 'Debug'\" />\n" } ]
2008/11/04
[ "https://Stackoverflow.com/questions/260491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17211/" ]
260,504
<p>Question: Is there an easy way (library function) to perform a bitwise AND or OR on numbers larger than 32-bit in ActionScript? </p> <p>From the docs: "Bitwise operators internally manipulate floating-point numbers to change them into 32-bit integers. The exact operation performed depends on the operator, but all ...
[ { "answer_id": 1879659, "author": "THF", "author_id": 228625, "author_profile": "https://Stackoverflow.com/users/228625", "pm_score": 1, "selected": false, "text": "public class NumberUtils\n{\n public static const MSB_CONV : Number = Math.pow(2, 32);\n\n public static function bitwise...
2008/11/04
[ "https://Stackoverflow.com/questions/260504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25303/" ]
260,511
<p>Here is my short implementation of <a href="http://en.wikipedia.org/wiki/Ancient_Egyptian_multiplication" rel="noreferrer">Russian Peasant Multiplication</a>. How can it be improved?</p> <p><em>Restrictions</em> : only works when a>0,b>0</p> <pre><code>for(p=0;p+=(a&amp;1)*b,a!=1;a&gt;&gt;=1,b&lt;&lt;=1); </code><...
[ { "answer_id": 260546, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "p a a" }, { "answer_id": 260552, "author": "Airsource Ltd", "author_id": 18017, "author_profile": "ht...
2008/11/04
[ "https://Stackoverflow.com/questions/260511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34051/" ]
260,518
<p>I have some cross platform DNS client code that I use for doing end to end SMTP and on windows I can find the current DNS server ip addresses by looking in the registry. On the Mac I can probably use the SystemConfiguration framework as mentioned in the first answer, however the exact method of doing so is not immed...
[ { "answer_id": 26982170, "author": "kmdent", "author_id": 786282, "author_profile": "https://Stackoverflow.com/users/786282", "pm_score": 3, "selected": false, "text": "// Get native iOS System Resolvers\nres_ninit(&_res);\nres_state res = &_res;\n\nfor (int i = 0; i < res->nscount; i++)...
2008/11/04
[ "https://Stackoverflow.com/questions/260518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33847/" ]
260,521
<p>I am having a problem getting a list of fields from a query defined at run time by the users of my program. I let my users enter a SQL query into a memo control and then I want to let them go through the fields that will return and do such things as format the output, sum column values and so forth. So, I have to ...
[ { "answer_id": 260582, "author": "Richard A", "author_id": 24355, "author_profile": "https://Stackoverflow.com/users/24355", "pm_score": 1, "selected": false, "text": "for i := 0 to Qry.Params.Count - 1 do \nbegin\n if VarType(Qry.Params[i].value) and varTypeMask = varDate then\n begin...
2008/11/04
[ "https://Stackoverflow.com/questions/260521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25315/" ]
260,523
<p>I am developing an iPhone application, in my table view I wanted custom color for Cell Selection Style, I read the <em>UITableViewCell Class Reference</em> but there are only three constants defined for Selection style (Blue, Gray, None). I saw one application that used a different color than those defined in the re...
[ { "answer_id": 260697, "author": "Jeffrey Forbes", "author_id": 28019, "author_profile": "https://Stackoverflow.com/users/28019", "pm_score": 2, "selected": false, "text": "UIView* selectedView; //inside your header\n\n- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(N...
2008/11/04
[ "https://Stackoverflow.com/questions/260523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/451867/" ]
260,525
<p>if i decide to use the 'publish' option for my ASP.NET website, instead of a Web Deployment Project, can i do custom msbuild things? Or do i need to stick with WDP's if i want to do custom msbuild stuff during compile/deployment.</p>
[ { "answer_id": 262007, "author": "MartinHN", "author_id": 2972, "author_profile": "https://Stackoverflow.com/users/2972", "pm_score": 2, "selected": false, "text": "Release.AspNetCompiler.VirtualPath = \"/PrecompiledWeb\"\nRelease.AspNetCompiler.PhysicalPath = \"..\\Web\\\"\nRelease.AspN...
2008/11/04
[ "https://Stackoverflow.com/questions/260525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
260,531
<p>How have you explained nested arrays to a programmer. I'm thinking someone that has an entry level understanding of programming, but is trying to do more complicated coding.</p> <p>The array with array works, but they can't quite get their mind around the idea.</p> <p><strong>Edit:</strong> example of a nested arr...
[ { "answer_id": 260551, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 1, "selected": false, "text": "X int x[5][5] = {\n { 1,0,0,0,1 },\n { 0,1,0,1,0 },\n { 0,0,1,0,0 },\n { 0,1,0,1,0 },\n { 1,0,0,0,1 }\n};\n...
2008/11/04
[ "https://Stackoverflow.com/questions/260531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
260,540
<p>Please advise how to scrape AJAX pages.</p>
[ { "answer_id": 260614, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "https://Stackoverflow.com/users/3153", "pm_score": 7, "selected": true, "text": "<script type=\"text/javascript\">\nfunction ajaxFunction()\n{\nvar xmlHttp;\ntry\n {\n // Firefox, Opera 8.0+, Safar...
2008/11/04
[ "https://Stackoverflow.com/questions/260540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34051/" ]
260,561
<p>Whats the normal procedure of clearing a form after POST? Just loop through the textboxes and cleat all text? I have an ASP.NET application with several forms and I am trying to avoid them sending the data twice?</p> <p>Thanks</p>
[ { "answer_id": 260570, "author": "Gulzar Nazim", "author_id": 4337, "author_profile": "https://Stackoverflow.com/users/4337", "pm_score": 1, "selected": false, "text": "document.forms[0].reset();\ndocument.forms[1].reset();\n" } ]
2008/11/04
[ "https://Stackoverflow.com/questions/260561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23667/" ]
260,593
<p>I'm tasked with replicating a production environment to create many test/sit environments.</p> <p>One of the things I need to do is build up Perl, with all the modules which have been installed (including internal and external modules) over the years. I could just use CPAN.pm autobundle, but this will result in the...
[ { "answer_id": 267783, "author": "Schwern", "author_id": 14660, "author_profile": "https://Stackoverflow.com/users/14660", "pm_score": 7, "selected": false, "text": "cpan> install MSCHWERN/Test-Simple-0.62.tar.gz\n cpan> o conf urllist push http://backpan.perl.org/\n" }, { "answe...
2008/11/04
[ "https://Stackoverflow.com/questions/260593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3839/" ]
260,594
<p>My question is how do I configure an EJB 3.0 style message driven bean to use a configured JMS datasource in jboss. </p> <p>For example, my MDB looks something like:</p> <pre><code>@MessageDriven(mappedName = "ExampleMDB", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", pr...
[ { "answer_id": 267783, "author": "Schwern", "author_id": 14660, "author_profile": "https://Stackoverflow.com/users/14660", "pm_score": 7, "selected": false, "text": "cpan> install MSCHWERN/Test-Simple-0.62.tar.gz\n cpan> o conf urllist push http://backpan.perl.org/\n" }, { "answe...
2008/11/04
[ "https://Stackoverflow.com/questions/260594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33864/" ]
260,597
<p>I'd like to receive error logs via email. For example, if a <code>Warning-level</code> error message should occur, I'd like to get an email about it.</p> <p>How can I get that working in CodeIgniter?</p>
[ { "answer_id": 260655, "author": "Adam", "author_id": 13320, "author_profile": "https://Stackoverflow.com/users/13320", "pm_score": 5, "selected": true, "text": "class MY_Exceptions extends CI_Exceptions {\n\n function __construct()\n {\n parent::__construct();\n }\n\n ...
2008/11/04
[ "https://Stackoverflow.com/questions/260597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
260,605
<p>Is there a PHP class/library that would allow me to query an XHTML document with CSS selectors? I need to scrape some pages for data that is very easily accessible if I could somehow use CSS selectors (jQuery has spoiled me!). Any ideas?</p>
[ { "answer_id": 301155, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": " $doc = new DOMDocument();\n $doc->loadHTML($html);\n\n $elements = $doc->getElementsByTagName(\"div\");\n foreach ($elements ...
2008/11/04
[ "https://Stackoverflow.com/questions/260605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5291/" ]