qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
282,226
<p>I'm working on a time sheet application, where I'd like the user to be able to enter times in TextBoxes, e.g.: 8 a or 8:00 a or the like, just like you can in Excel.</p> <p>Now if you enter a <em>date</em> in a TextBox and then use DateTime.TryParse, you can enter it in several formats (Jan 31, 2007; 1/31/2007; 31/...
[ { "answer_id": 282296, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 2, "selected": false, "text": "DateTime blah = DateTime.Parse(\"1/1/0001 \" + myTimeString);\n" } ]
2008/11/11
[ "https://Stackoverflow.com/questions/282226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5486/" ]
282,228
<p>We have encountered a very strange situation when we deployed an application at a customer site. This application is implemented as a service using C# on .NET 3. The application communicates with a web service that is written using gSOAP. In our .NET application, the classes that wrap the web service were created by...
[ { "answer_id": 282296, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 2, "selected": false, "text": "DateTime blah = DateTime.Parse(\"1/1/0001 \" + myTimeString);\n" } ]
2008/11/11
[ "https://Stackoverflow.com/questions/282228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
282,245
<p>What order of precedence are events handled in JavaScript?</p> <p>Here are the events in alphabetical order...</p> <ol> <li>onabort - Loading of an image is interrupted</li> <li>onblur - An element loses focus</li> <li>onchange - The user changes the content of a field</li> <li>onclick - Mouse clicks an object</li...
[ { "answer_id": 69429589, "author": "Friedrich", "author_id": 11769765, "author_profile": "https://Stackoverflow.com/users/11769765", "pm_score": 2, "selected": false, "text": "<input onclick=\"console.log('onclick - Mouse clicks an object')\" \n ondblclick=\"console.log('ondblclick ...
2008/11/11
[ "https://Stackoverflow.com/questions/282245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13930/" ]
282,252
<p>I have multiple ordered lists. Unfortunately, the order of the items isn't a simple alpha or numeric comparison, otherwise this is trivial. So what I have is something like:</p> <pre><code>List #1 List #2 List #3 groundhog groundhog easter mothersday mayday mothersday midsummer ...
[ { "answer_id": 297198, "author": "Phil", "author_id": 38343, "author_profile": "https://Stackoverflow.com/users/38343", "pm_score": 1, "selected": false, "text": "groundhog mothersday mothersday midsummer midsummer christmas" } ]
2008/11/11
[ "https://Stackoverflow.com/questions/282252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8173/" ]
282,280
<p>Is there a way to force the flash garbage collector to clean up freed memory? I've seen that it takes a lot of time for flash to clean up not referenced memory...</p>
[ { "answer_id": 31196731, "author": "user5075924", "author_id": 5075924, "author_profile": "https://Stackoverflow.com/users/5075924", "pm_score": 0, "selected": false, "text": "var antiGC:Dictionary = new Dictionary(false);\n\nvar loaderwidth:Tween = new Tween(maskbox, \"width\", Regular....
2008/11/11
[ "https://Stackoverflow.com/questions/282280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26521/" ]
282,298
<p>I have an htaccess file that uses mod_rewrite to redirect /controller to /index.php?controller=%controller%</p> <p>Like this:</p> <pre><code># Various rewrite rules. &lt;IfModule mod_rewrite.c&gt; RewriteEngine on # Rewrite current-style URLs of the form 'index.php?controller=x&amp;action=y'. RewriteCond %{...
[ { "answer_id": 282364, "author": "Mark S.", "author_id": 13968, "author_profile": "https://Stackoverflow.com/users/13968", "pm_score": 1, "selected": false, "text": "if (in_array($controllerString, $configuration['protected']))\n{\n $authenticated = false;\n if (!isset($_SERVER['PH...
2008/11/11
[ "https://Stackoverflow.com/questions/282298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13968/" ]
282,308
<p>I'm working with an ASP.net 2.0 GridView control that is bound to the results of a sql query, so it looks something like this:</p> <pre><code>&lt;asp:GridView ID="MySitesGridView" runat="server" AutoGenerateColumns="False" DataSourceID="InventoryDB" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines=...
[ { "answer_id": 282324, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 1, "selected": false, "text": "<asp:TemplateField>\n <ItemTemplate>\n <a href='<%#Eval(\"PublicIP\")/<%# Eval(\"Customer\") %>'>Go to ...
2008/11/11
[ "https://Stackoverflow.com/questions/282308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2327/" ]
282,317
<p>In C# I sometimes wish I could make special methods for certain "instantiations" of generic classes.</p> <p><strong>UPDATE: The following code is just a dumb example of a more abstract problem - don't focus too much on time series, just the principles of "adding extra methods" for certain T</strong>.</p> <p>Exampl...
[ { "answer_id": 282506, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 1, "selected": false, "text": " TimeSeriesDouble tsD = new TimeSeriesDouble();\n TimeSeriesDouble subTSD = tsD.Slice(...) as TimeSeriesDouble;\n" },...
2008/11/11
[ "https://Stackoverflow.com/questions/282317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31890/" ]
282,322
<p>Suppose I have a SELECT statement that returns some set of results. Is there some way I can number my results in the following way:</p> <blockquote> <p>SELECT TOP 3 Name FROM PuppyNames ORDER BY NumberOfVotes</p> </blockquote> <p>would give me...</p> <blockquote> <p>Fido</p> <p>Rover</p> <p>Freddy Krueger</p> </blo...
[ { "answer_id": 282350, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 4, "selected": true, "text": "ROW_NUMBER() IDENTITY" }, { "answer_id": 282358, "author": "Eric Sabine", "author_id": 1493157, "au...
2008/11/11
[ "https://Stackoverflow.com/questions/282322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10675/" ]
282,329
<p>There's been a cluster of Perl-hate on Stack Overflow lately, so I thought I'd bring my "<a href="http://use.perl.org/~brian_d_foy/journal/32556" rel="nofollow noreferrer">Five things you hate about your favorite language</a>" question to Stack Overflow. Take your favorite language and tell me five things you hate a...
[ { "answer_id": 282342, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 7, "selected": false, "text": "lock Acquire GetHashCode() Equals() System.Object IdentityComparer IComparer<T> IComparable<T> IEqualityComparer<T> IEqu...
2008/11/11
[ "https://Stackoverflow.com/questions/282329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2766176/" ]
282,332
<p>Background: we have a system that was written in an older CMS based on Java back during the 2002-2003 days. We want to keep moving forward with our new stuff, using tomcat, stripes, and sitemesh. We have navigation, layouts, "pods", js, css, etc, that we've taken out of the old CMS and into a few of our new apps s...
[ { "answer_id": 282342, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 7, "selected": false, "text": "lock Acquire GetHashCode() Equals() System.Object IdentityComparer IComparer<T> IComparable<T> IEqualityComparer<T> IEqu...
2008/11/11
[ "https://Stackoverflow.com/questions/282332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31172/" ]
282,363
<p>I run a series of time consuming operations on a background worker thread. At various stages I update a (windows form) progress bar by invoking a delegate. However, one of the more time operations occurs on a single line of code.</p> <p>Is it possible to :</p> <p>a) Update the UI while that single line of code i...
[ { "answer_id": 282380, "author": "jons911", "author_id": 34375, "author_profile": "https://Stackoverflow.com/users/34375", "pm_score": 3, "selected": true, "text": "public void DoWork() {\n System.Threading.Thread.Sleep(10000);\n\n // won't execute until the sleep is over\n bgWo...
2008/11/11
[ "https://Stackoverflow.com/questions/282363", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2680373/" ]
282,369
<p>Recently I had to move one of my web applications to a new hosting provider. The mail and web service is still held on the old hosting site however, when I try to send an email from the new server,I get an error; </p> <p>"The server rejected one or more recipient addresses. The server response was:</p> <pre><code>...
[ { "answer_id": 282387, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 2, "selected": false, "text": "$ telnet new-pop-server.com 110\nConnected to new-pop-server.com.\nEscape character is '^]'.\n+OK\nUSER <username>\n+OK \nPASS ...
2008/11/11
[ "https://Stackoverflow.com/questions/282369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26300/" ]
282,372
<p>want to pass boost::bind to a method expecting a plain function pointer (same signature).</p> <pre><code>typedef void TriggerProc_type(Variable*,void*); void InitVariable(TriggerProc_type *proc); boost::function&lt;void (Variable*, void*)&gt; triggerProc ... InitVariable(triggerProc); error C2664: 'InitVariable' :...
[ { "answer_id": 282433, "author": "coryan", "author_id": 33325, "author_profile": "https://Stackoverflow.com/users/33325", "pm_score": 4, "selected": false, "text": "#include <boost/function.hpp>\n#include <iostream>\n\nint f(int x)\n{\n return x + x;\n}\n\ntypedef int (*pointer_to_func)...
2008/11/11
[ "https://Stackoverflow.com/questions/282372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20003/" ]
282,377
<p>In Visual Studio, How do I show all classes inherited from a base class? </p> <p><strong>For example</strong>, in ASP.NET MVC there are several '<a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult.aspx" rel="noreferrer">ActionResult</a>' types -- and they all inherit from / implement the b...
[ { "answer_id": 11210689, "author": "Lzh", "author_id": 1041631, "author_profile": "https://Stackoverflow.com/users/1041631", "pm_score": 4, "selected": false, "text": "//Go through all the types and either add them to a tree node, or add a tree\n//node or more to them depending whether t...
2008/11/11
[ "https://Stackoverflow.com/questions/282377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19020/" ]
282,391
<p>.NET 3.5, C#</p> <p>I have a web app with a "search" feature. Some of the fields that are searchable are first-class columns in the table, but some of them are in fact nested fields inside an XML data type. </p> <p>Previously, I built a system for dynamically constructing the SQL for my search. I had a nice clas...
[ { "answer_id": 282514, "author": "Daniel M", "author_id": 36559, "author_profile": "https://Stackoverflow.com/users/36559", "pm_score": 5, "selected": true, "text": "xmlColumn.value" }, { "answer_id": 23779525, "author": "user1620076", "author_id": 1620076, "author_pr...
2008/11/11
[ "https://Stackoverflow.com/questions/282391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17803/" ]
282,393
<p>I have a rather complex decorator written by someone else. What I want to do is call a decorated version of the function one time based on a descision or call the original function (not decorated) another time. Is this possible?</p>
[ { "answer_id": 282399, "author": "Ali Afshar", "author_id": 28380, "author_profile": "https://Stackoverflow.com/users/28380", "pm_score": 6, "selected": true, "text": "decorator(original_function)()\n original_function()\n" }, { "answer_id": 282816, "author": "tzot", "aut...
2008/11/11
[ "https://Stackoverflow.com/questions/282393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7883/" ]
282,406
<p>I am just getting started with IoC containers so apologies if this is a stupid question.</p> <p>I have code like the following in an app</p> <pre><code>internal static class StaticDataHandlerFactory { public static IStaticDataHandler CreateHandler(StaticDataUpdate staticDataUpdate) { ...
[ { "answer_id": 282481, "author": "Paul Sonier", "author_id": 28053, "author_profile": "https://Stackoverflow.com/users/28053", "pm_score": 2, "selected": false, "text": "m_officeUpdateHandler m_officeUpdateHandler m_officeUpdateHandler" }, { "answer_id": 284685, "author": "dv...
2008/11/11
[ "https://Stackoverflow.com/questions/282406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17194/" ]
282,422
<p>I have a Flash application that is hosted from within a Drupal page. Some parts of the Flash application should be available to all users, but some should only be available to a logged-in user. (The specific role doesn't matter, just that they are any authorized user of the site).</p> <p>From within Flash, I can ...
[ { "answer_id": 282462, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 2, "selected": false, "text": "<?php\n// myservices.info\n name = My Services\n description = Expose basic services\n core = 6.x\n\n<?php\n// myservices...
2008/11/11
[ "https://Stackoverflow.com/questions/282422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4540/" ]
282,429
<p>What happens if the browser receives a redirect response to an ajax request?</p>
[ { "answer_id": 282450, "author": "jishi", "author_id": 33663, "author_profile": "https://Stackoverflow.com/users/33663", "pm_score": 3, "selected": false, "text": "ajax-request .responseText .responseXML status-code location-header readyState" }, { "answer_id": 65227261, "aut...
2008/11/11
[ "https://Stackoverflow.com/questions/282429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7883/" ]
282,444
<p>Is it possible to detect, on the client side, whether the user is using an encrypted page or not?</p> <p>Put another way -- I want to know if the URL of the current page starts with http or https.</p>
[ { "answer_id": 282454, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 7, "selected": true, "text": "window.location.protocol https: function isSecure()\n{\n return window.location.protocol == 'https:';\n}\n function is...
2008/11/11
[ "https://Stackoverflow.com/questions/282444", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
282,448
<p>I'm developing a SOAP application that integrates with a 3rd party. I think the WSDL of this third party is very strange. I'm pretty new to SOAP, so I don't want to go asking them to fix it if it isn't broken. Here's some things I've noticed that I consider wrong about it, though I'm sure it's technically a valid...
[ { "answer_id": 5268619, "author": "chenhong ", "author_id": 654676, "author_profile": "https://Stackoverflow.com/users/654676", "pm_score": 1, "selected": false, "text": "typedef double xsd_double;\nint ns__add(xsd_double a, xsd_double b, xsd_double &result);\nint ns__sub(xsd_double a, x...
2008/11/11
[ "https://Stackoverflow.com/questions/282448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10861/" ]
282,451
<p>I have a .net transaction with a SQL insert to a SQL Server 2005 database. The table has an identity primary key. </p> <p>When an error occurs within the transaction, <code>Rollback()</code> is called. The row inserts are rolled back correctly, however the next time I insert data to the table, the identity is incre...
[ { "answer_id": 282495, "author": "Jason Jackson", "author_id": 13103, "author_profile": "https://Stackoverflow.com/users/13103", "pm_score": 8, "selected": true, "text": "User 1\n------------\nbegin transaction\ninsert into A ...\ninsert into B ...\nupdate C ...\ninsert into D ...\ncommi...
2008/11/11
[ "https://Stackoverflow.com/questions/282451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19763/" ]
282,457
<p>I am working on a small project to take a CSV file and then insert its data into a HTML table (I would use datagrid and dataset or datatable, but the system I will be talking to does not support ASP.NET uploads for sending newsletters).</p> <p>Anyway, I will use the file.readalllines method to return the contents o...
[ { "answer_id": 282488, "author": "Gary Willoughby", "author_id": 13227, "author_profile": "https://Stackoverflow.com/users/13227", "pm_score": -1, "selected": false, "text": "String.Split(Convert.ToChar(\",\"));\n" }, { "answer_id": 282497, "author": "tvanfosson", "author...
2008/11/11
[ "https://Stackoverflow.com/questions/282457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32484/" ]
282,459
<p>I know of <code>is</code> and <code>as</code> for <code>instanceof</code>, but what about the reflective <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#isInstance(java.lang.Object)" rel="noreferrer">isInstance()</a> method?</p>
[ { "answer_id": 282469, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 7, "selected": true, "text": "obj.getClass().isInstance(otherObj) bool result = obj.GetType().IsAssignableFrom(otherObj.GetType());\n java.lang.Clas...
2008/11/11
[ "https://Stackoverflow.com/questions/282459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36744/" ]
282,460
<p>How can I determine current version of my repository to see if I need to upgrade it (svnadmin upgrade)?</p> <p>In reality I'm hosting SVN with 3rd party and I want to find out if I need to ask them to upgrade my repos or not.</p> <p>I'm asking since 1.5 server will keep repo version at 1.4, unless I miss something...
[ { "answer_id": 282484, "author": "bdumitriu", "author_id": 35415, "author_profile": "https://Stackoverflow.com/users/35415", "pm_score": 6, "selected": false, "text": "<REPO>/db/format format 3\nlayout sharded 1000\n 2\n" }, { "answer_id": 282496, "author": "Ken Gentle", ...
2008/11/11
[ "https://Stackoverflow.com/questions/282460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19124/" ]
282,468
<p>The following C# code takes 5 minutes to run:</p> <pre><code>int i = 1; string fraction = ""; while (fraction.Length &lt; 1000000) { fraction += i.ToString(); i++; } </code></pre> <p>"Optimising it" like this causes it to run in 1.5 seconds:</p> <pre><code>int i = 1; string fraction = ""; while (fraction....
[ { "answer_id": 282476, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 3, "selected": false, "text": "StringBuilder // e.g. Initialise to 10MB\nStringBuilder fraction = new StringBuilder(10000000);\n" }, { "answe...
2008/11/11
[ "https://Stackoverflow.com/questions/282468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15537/" ]
282,475
<p>Consider the following trivial HTML page that throws an error:</p> <pre><code>&lt;html&gt;&lt;head&gt;&lt;script&gt; throw new Error('oops'); alert('should not reach here'); &lt;/script&gt;&lt;/head&gt;&lt;/html&gt; </code></pre> <p>The user I am logged into Vista with is a member of both the Administrators an...
[ { "answer_id": 282476, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 3, "selected": false, "text": "StringBuilder // e.g. Initialise to 10MB\nStringBuilder fraction = new StringBuilder(10000000);\n" }, { "answe...
2008/11/11
[ "https://Stackoverflow.com/questions/282475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2766/" ]
282,489
<p>What is a good way to set up a single container div with some border images surrounding it (in my case only on the left, bottom, and right sides)? I have it centered at the top of the page, overlapping everything else (so like that OSX-style slide-down dialog).</p> <p>Here's the basic layout:</p> <p><img src="http...
[ { "answer_id": 282476, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 3, "selected": false, "text": "StringBuilder // e.g. Initialise to 10MB\nStringBuilder fraction = new StringBuilder(10000000);\n" }, { "answe...
2008/11/11
[ "https://Stackoverflow.com/questions/282489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5291/" ]
282,499
<p>Does this pattern:</p> <pre><code>setTimeout(function(){ // do stuff }, 0); </code></pre> <p>Actually return control to the UI from within a loop? When are you supposed to use it? Does it work equally well in all browsers?</p>
[ { "answer_id": 282544, "author": "Kornel", "author_id": 27009, "author_profile": "https://Stackoverflow.com/users/27009", "pm_score": 3, "selected": true, "text": "<script> <script>compute_last_pi_digit()</script> <!-- blocking -->\n\n<script>setTimeout(compute_last_pi_digit,0)</script> ...
2008/11/11
[ "https://Stackoverflow.com/questions/282499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1169746/" ]
282,503
<p>The <code>PropertyGrid</code> control is very useful for editing objects at run-time. I'm using it as follows:</p> <pre><code>Form form = new Form(); form.Parent = this; form.Text = "Editing MyMemberVariable"; PropertyGrid p = new PropertyGrid(); p.Parent = form; p.Dock = DockStyle.Fill; p.SelectedObject = _MyMemb...
[ { "answer_id": 282863, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "//designer code excluded\npublic partial class Form1 : Form\n{\n public Form1()\n {\n InitializeComponent();\n\n ...
2008/11/11
[ "https://Stackoverflow.com/questions/282503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2683/" ]
282,522
<p>In Ant is there any way to do something like this:</p> <pre><code>&lt;arguments id="arg-list"&gt; &lt;arg value="arg1" /&gt; &lt;arg value="arg2" /&gt; &lt;/arguments&gt; &lt;property name="prop1" refid="arg-list" /&gt; </code></pre> <p>I'm trying to write a macro for psexec and I'm looking for a nice way...
[ { "answer_id": 282583, "author": "Richard A", "author_id": 24355, "author_profile": "https://Stackoverflow.com/users/24355", "pm_score": 4, "selected": true, "text": "<macrodef name=\"example\">\n <attribute name=\"args\"/>\n <sequential>\n <exec executable=\"example.exe\">\n <...
2008/11/11
[ "https://Stackoverflow.com/questions/282522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18437/" ]
282,526
<p>I've noticed, using visual studio 2003, that I can "comment out" my comments to make them no longer be comments. This one needs an example:</p> <p>If I have:</p> <pre><code>/* int commented_out = 0; */ </code></pre> <p>I can comment out the /* and */ with // and code within the /* and */ is no longer "commented o...
[ { "answer_id": 282533, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 3, "selected": false, "text": "// #if 0 #if 1 #if 0\n int commented_out = 0;\n#endif\n" }, { "answer_id": 282553, "author": "Adam Rosenf...
2008/11/11
[ "https://Stackoverflow.com/questions/282526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29703/" ]
282,531
<p>I'm looking for a .NET library that will allow creation of a Word document. I need to export HTML based content to a Word doc (97-2003 format, not docx).</p> <p>I know that there are the Microsoft Office Automation libraries and Office interop, but as far as I can tell, they require that you have office actually i...
[ { "answer_id": 283932, "author": "Fionnuala", "author_id": 2548, "author_profile": "https://Stackoverflow.com/users/2548", "pm_score": 4, "selected": true, "text": "<html>\n<head>\n<STYLE type=\"text/css\">\n h1 {text-align:center; font-size:12.0pt; font-family:Arial; font-weight:bold...
2008/11/11
[ "https://Stackoverflow.com/questions/282531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194/" ]
282,539
<p>I was wondering if there is a way to implement an action listener for a Jbutton without a name. For example, I have the following for loop that creates a button for each letter of the alphabet.</p> <pre><code>for (int i = 65; i &lt; 91; i++){ alphabetPanel.add(new JButton("&lt;html&gt;&lt;center&gt;" + (char)i...
[ { "answer_id": 282558, "author": "John Gardner", "author_id": 13687, "author_profile": "https://Stackoverflow.com/users/13687", "pm_score": 3, "selected": true, "text": "ActionListener listener = something;\n\nfor (int i = 65; i < 91; i++){\n JButton button = new JButton(\"<html><cen...
2008/11/11
[ "https://Stackoverflow.com/questions/282539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29326/" ]
282,545
<p>I'm writing my first Windows CE app using the .NET Compact Framework v3.5.<br> I need the app to be able to do an HTTP POST to a URL.<br> It appears that the .NET CF does not have System.Web.<br> So, I could use some guidence on how to accomplish and HTTP Posts using the .Net CF. Thanks, Greg</p>
[ { "answer_id": 282749, "author": "Craig Norton", "author_id": 24804, "author_profile": "https://Stackoverflow.com/users/24804", "pm_score": 2, "selected": true, "text": "Try\n Dim Request As HttpWebRequest = CType(WebRequest.Create(\"<The server>\"), HttpWebRequest)\n\n Request.Allow...
2008/11/11
[ "https://Stackoverflow.com/questions/282545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23823/" ]
282,570
<p>Simple question, hopefully an easy way and just want to verify I'm doing it the correct / efficient way.</p> <p>I have a class T object, which is typically put into a vector that is created in my main() function. It can be any kind of data, string, int, float.. etc. I'm reading from a file... which is inputted fr...
[ { "answer_id": 282596, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 1, "selected": false, "text": ".eof() while while(myFile >> object)\n insert(v, object, U);\n U insert" }, { "answer_id": 28259...
2008/11/11
[ "https://Stackoverflow.com/questions/282570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28392/" ]
282,571
<p>I'm trying to design a homepage for an MVC site that has two different views, based on if the user is logged in or not.</p> <p>So image the default (not logged in) view is showing general, nonspecific info. If i'm logged in, the view is showing mostly personal stuff instead.</p> <p>What's the best practice to hand...
[ { "answer_id": 282585, "author": "Adrian Clark", "author_id": 148, "author_profile": "https://Stackoverflow.com/users/148", "pm_score": 5, "selected": true, "text": "public ActionResult Index()\n\n If (User.IsLoggedOn)\n {\n // Do user-specific controller stuff here...\n\n ...
2008/11/11
[ "https://Stackoverflow.com/questions/282571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
282,575
<p>I have a system which sits on a web server and generates files on the fly in response to HTTP requests. This is currently implemented as an HTTPHandler.</p> <p>Once the files are generated, they don't change very often, so I'd like to implement a cache.</p> <p>Ideally, I'd like the web server to look at the cache ...
[ { "answer_id": 282617, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 1, "selected": false, "text": "<customErrors mode=\"On\">\n <error statusCode=\"404\" redirect=\"FileGeneratorHandler.ashx\" />\n</customErrors>\n" ...
2008/11/11
[ "https://Stackoverflow.com/questions/282575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/475/" ]
282,576
<p>How does one do namespaced controllers in Merb, for instance to create an admin section to the site? In Rails one would use Admin::CategoriesController, is this similar in Merb or is this another recommended way of doing it?</p>
[ { "answer_id": 283197, "author": "Laz", "author_id": 34991, "author_profile": "https://Stackoverflow.com/users/34991", "pm_score": 3, "selected": true, "text": "namespace :admin do\n resources :categories\nend\n module Admin\n class Categories < Application\n def index\n ...\n ...
2008/11/11
[ "https://Stackoverflow.com/questions/282576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34991/" ]
282,600
<p>For large <code>n</code> (see below for how to determine what's large enough), it's safe to treat, by the central limit theorem, the distribution of the sample mean as normal (gaussian) but I'd like a procedure that gives a confidence interval for any <code>n</code>. The way to do that is to use a Student T distrib...
[ { "answer_id": 282634, "author": "John D. Cook", "author_id": 25188, "author_profile": "https://Stackoverflow.com/users/25188", "pm_score": 3, "selected": false, "text": "[mean - 1.96*stdev, mean + 1.96*stdev] [mean - c(n)*stdev, mean + c(n)*stdev] c(n) c(n) n g(0.025, n-1) g 1-alpha alp...
2008/11/12
[ "https://Stackoverflow.com/questions/282600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4234/" ]
282,603
<p>I'm using a logging module that can have reporting enabled/disabled at runtime. Calls generally go something like:</p> <pre><code>WARN( "Danger Will Robinson! There are " + boost::lexical_cast&lt;string&gt;(minutes) + " minutes of oxygen left!" ); </code></pre> <p>I'm using an inline function for WA...
[ { "answer_id": 282611, "author": "Mr Fooz", "author_id": 25050, "author_profile": "https://Stackoverflow.com/users/25050", "pm_score": 1, "selected": false, "text": "inline void warnFunc(some_boost_lambda &message_generator) {\n if (WARNINGS_ENABLED) {\n cerr << message_generator() <...
2008/11/12
[ "https://Stackoverflow.com/questions/282603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3594/" ]
282,615
<p>I'm a new to MSBuild and wanted to play around with it a bit, but I just cannot figure out why this isn't working.</p> <p>So my solution has two projects: "Model" and "BuildTasks". BuildTasks just has a single class:</p> <pre><code>using Microsoft.Build.Utilities; namespace BuildTasks { public class Test : T...
[ { "answer_id": 282626, "author": "Aaron Powell", "author_id": 11388, "author_profile": "https://Stackoverflow.com/users/11388", "pm_score": 0, "selected": false, "text": "bin\\Configuration Type\\BuildTasks.dll" }, { "answer_id": 282777, "author": "Todd", "author_id": 319...
2008/11/12
[ "https://Stackoverflow.com/questions/282615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34715/" ]
282,619
<p>We have a My_list class that has a list of pointers to Abstract_things. To optimize on memory usage, all derived Things use one memory pool that is established with the "new and delete" stereotype. In order to size the pool properly during the initization of the application, the builder figures out which Thing is ...
[ { "answer_id": 282640, "author": "Rob Walker", "author_id": 3631, "author_profile": "https://Stackoverflow.com/users/3631", "pm_score": 2, "selected": false, "text": "template<class T>\nclass RegisterPoolClass\n{\npublic:\n RegisterPoolClass() { init_pool.Register(sizeof(T)); }\n};\n\...
2008/11/12
[ "https://Stackoverflow.com/questions/282619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36756/" ]
282,622
<p>It seems that everybody knows you're supposed to have a clear distinction between the GUI, the business logic, and the data access. I recently talked to a programmer who bragged about always having a clean data access layer. I looked at this code, and it turns out his data access layer is just a small class wrappi...
[ { "answer_id": 10088435, "author": "AD - Stop Putin -", "author_id": 494775, "author_profile": "https://Stackoverflow.com/users/494775", "pm_score": 0, "selected": false, "text": "DRO DataRetrieverObject DRO DataRetrieverFactory DataRetrieverFactory <TableNameAndKey>DR <TableNameAndKey>D...
2008/11/12
[ "https://Stackoverflow.com/questions/282622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/681/" ]
282,627
<p>I'm attempting to utilize <a href="http://en.wikipedia.org/wiki/VBScript" rel="nofollow noreferrer">VBScript</a> to connect pull the <code>physicalDeliveryOfficeName</code> attribute in <a href="http://en.wikipedia.org/wiki/Active_Directory" rel="nofollow noreferrer">Active Directory</a> by providing the email addre...
[ { "answer_id": 288873, "author": "Otus", "author_id": 36613, "author_profile": "https://Stackoverflow.com/users/36613", "pm_score": 2, "selected": false, "text": "<LDAP://SERVERNAME/DC=bobdom,DC=net>;(&(objectClass=user)(mail=mike.spencer@kenblanchard.com));\n <LDAP://SERVERNAME/DC=bobdo...
2008/11/12
[ "https://Stackoverflow.com/questions/282627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18853/" ]
282,644
<p>What is the correct way to convert ASP.NET SOAP-based web services to JSON-based responses? ...And then call these from jQuery?</p> <p>What are "best practices" when integrating jQuery based AJAX and ASP.NET? Articles? Books?</p>
[ { "answer_id": 282695, "author": "Frank Schwieterman", "author_id": 32203, "author_profile": "https://Stackoverflow.com/users/32203", "pm_score": 3, "selected": true, "text": "using System.Runtime.Serialization;\nusing System.Runtime.Serialization.Json;\n\npublic class JsonSerializer\n{\...
2008/11/12
[ "https://Stackoverflow.com/questions/282644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36590/" ]
282,647
<p>In PHP, I can write:</p> <pre><code>$vname = 'phone'; $$vname = '555-1234'; print $phone; </code></pre> <p>... And the script will output "555-1234".</p> <p>Is there any equivalent in Perl?</p> <p>Is there any way to constrain <code>$phone</code> to the scope of the local block, as if I'd written <code>my $phone...
[ { "answer_id": 282668, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 3, "selected": false, "text": "$vname = \"phone\";\n$$vname = \"555-1234\";\nprint $phone;\n" }, { "answer_id": 282689, "author": ...
2008/11/12
[ "https://Stackoverflow.com/questions/282647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3528/" ]
282,650
<p>You can set the HcDynamicCompressionLevel anywhere from 0-10. I've heard 10 is bad (high CPU usage), but what's the magic number that works the best? </p>
[ { "answer_id": 10051876, "author": "Kevin P. Rice", "author_id": 733805, "author_profile": "https://Stackoverflow.com/users/733805", "pm_score": 2, "selected": false, "text": "httpCompression .config dynamicCompressionDisableCpuUsage=\"90\"\ndynamicCompressionEnableCpuUsage=\"80\"\n\nsta...
2008/11/12
[ "https://Stackoverflow.com/questions/282650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36400/" ]
282,653
<p>Something that confuses me, but has never caused any problems... the recommended way to dispatch an event is as follows:</p> <pre><code>public event EventHandler SomeEvent; ... { .... if(SomeEvent!=null)SomeEvent(); } </code></pre> <p>In a multi-threaded environment, how does this code guarantee that anoth...
[ { "answer_id": 282661, "author": "denis phillips", "author_id": 748, "author_profile": "https://Stackoverflow.com/users/748", "pm_score": 2, "selected": false, "text": "EventHandler tmpEvent = SomeEvent;\nif (tmpEvent != null)\n{\n tmpEvent();\n}\n" }, { "answer_id": 282741, ...
2008/11/12
[ "https://Stackoverflow.com/questions/282653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14357/" ]
282,667
<p>I'm relatively new to programming and I have to write a function that reads in input from the user and to fill two arrays then compare them. I guess what I'm confused on is how to read in both arrays.</p> <p>This is what I'm supposed to do,</p> <p>Write a table_diff function that compares two arrays of integers an...
[ { "answer_id": 282754, "author": "Daniel Spiewak", "author_id": 9815, "author_profile": "https://Stackoverflow.com/users/9815", "pm_score": 1, "selected": false, "text": "while((r = scanf(\"%i\", &value)) != 1 && ptra < endptra)\n{\n *(ptra++) = value; \n\n i...
2008/11/12
[ "https://Stackoverflow.com/questions/282667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
282,670
<p>If I have a list like this:</p> <pre><code>&lt;ul id="mylist"&gt; &lt;li id="list-item1"&gt;text 1&lt;/li&gt; &lt;li id="list-item2"&gt;text 2&lt;/li&gt; &lt;li id="list-item3"&gt;text 3&lt;/li&gt; &lt;li id="list-item4"&gt;text 4&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>What's the easiest way to re...
[ { "answer_id": 282711, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 8, "selected": true, "text": "var list = document.getElementById('mylist');\n\nvar items = list.childNodes;\nvar itemsArr = [];\nfor (var i in items) {\n ...
2008/11/12
[ "https://Stackoverflow.com/questions/282670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21677/" ]
282,676
<p>I have some shapefile (demographic/heat map data in the USA, such as crime in New York) data imported into a sql server 2008 database, field data type: <em>Geography</em>.</p> <p>How can i get this data, from a <em>select</em> query, in a format which i can then display on google maps or microsoft virtual earth?</p...
[ { "answer_id": 577600, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": true, "text": "select SHAPE.STX as X\n ,SHAPE.STY as Y\n ,SHAPE.STAsText() as WKT\n ,SHAPE.AsGml() as GML\nfrom dpu.SW_SERVICE_LOCATI...
2008/11/12
[ "https://Stackoverflow.com/questions/282676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
282,692
<p>How can you express X of Y are true, in boolean logic? a rule like 2 of the following must be true (A, B, C, D, E, F) is it a form of multiplcation or set operations?<br> the end result is all the permutations like AB OR AC OR AD, if you said 3 of following it is like ABC, ABD, ABE, etc.. so it is like (A,B,C)^2?</...
[ { "answer_id": 282728, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 2, "selected": false, "text": "(A & B & C & ~D & ~E) |\n(A & B & ~C & D & ~E) |\n(A & B & ~C & ~D & E) | ...\n(~A & ~B & C & D & E)\n"...
2008/11/12
[ "https://Stackoverflow.com/questions/282692", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5111/" ]
282,700
<p>I'm working on a school project and I'm getting some weird errors from Xcode. I'm using TextMate's Command+R function to compile the project. Compilation seems to work okay but linking fails with an error message I don't understand. </p> <p>ld output:</p> <blockquote> <p>ld: duplicate symbol text_field(std::basi...
[ { "answer_id": 282717, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 6, "selected": true, "text": "main.o generics.o io_functions.cpp main.cpp generics.cpp io_functions.h io_functions.cpp" }, { "answer_id": 59873...
2008/11/12
[ "https://Stackoverflow.com/questions/282700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16204/" ]
282,712
<p>I'm quite confused about the basic concepts of a Hash table. If I were to code a hash how would I even begin? What is the difference between a Hash table and just a normal array? </p> <p>Basically if someone answered this question I think all my questions would be answered: If I had 100 randomly generated numbers (...
[ { "answer_id": 282722, "author": "Daniel Spiewak", "author_id": 9815, "author_profile": "https://Stackoverflow.com/users/9815", "pm_score": 4, "selected": false, "text": "int[] arr = ...\nfor (int i = 0; i < arr.length; i++) {\n System.out.println(arr[i] + 1);\n}\n i Hashtable<String,...
2008/11/12
[ "https://Stackoverflow.com/questions/282712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36545/" ]
282,729
<p>I was wondering if someone would be able to help me write a CQL query for NDepend that will show me all the methods in my form class that handle the form events. So I would like to be able to find all the methods that look like this:</p> <pre><code>Private Sub AddFolderButton_Click(ByVal sender As System.Object, B...
[ { "answer_id": 282931, "author": "Nathan W", "author_id": 6335, "author_profile": "https://Stackoverflow.com/users/6335", "pm_score": 0, "selected": false, "text": "SELECT METHODS WHERE NameLike \"_\" OR NameLike \"EventArgs\" AND !IsSpecialName AND IsPrivate \n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/282729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6335/" ]
282,740
<p>Currently we have a DLL that checks whether a username/password is a valid Windows user using the Windows API LogonUser method. We need to enhance it so it checks whether the user belongs to a specified group as well. Is there a Windows method that does that?</p> <p>Given a Windows username and password, find out w...
[ { "answer_id": 282914, "author": "Robo", "author_id": 26305, "author_profile": "https://Stackoverflow.com/users/26305", "pm_score": 1, "selected": true, "text": "unit GetGroupsForUserUnit;\n\ninterface\n\nuses\n Windows, SysUtils, Classes, ShellAPI;\n\ntype\n {$EXTERNALSYM NET_API_STAT...
2008/11/12
[ "https://Stackoverflow.com/questions/282740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26305/" ]
282,746
<p>I'm writing C# code that needs to connect to COM events. I implemented the use of IConnectionPointContainer and IConnectionPoint thus:</p> <pre><code> IConnectionPointContainer connectionPointContainer = internalGenerator as IConnectionPointContainer; if (connectionPointContainer == null) { ...
[ { "answer_id": 1333190, "author": "SPARQLGuy", "author_id": 162598, "author_profile": "https://Stackoverflow.com/users/162598", "pm_score": 0, "selected": false, "text": "internal void QuickActivate(UnsafeNativeMethods.tagQACONTAINER pQaContainer, UnsafeNativeMethods.tagQACONTROL pQaCont...
2008/11/12
[ "https://Stackoverflow.com/questions/282746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36694/" ]
282,758
<p>Sometimes you have strings that must fit within a certain pixel width. This function attempts to do so efficiently. Please post your suggestions or refactorings below :)</p> <pre><code>function fitStringToSize(str,len) { var shortStr = str; var f = document.createElement("span"); f.style.display = 'hidd...
[ { "answer_id": 283994, "author": "some", "author_id": 36866, "author_profile": "https://Stackoverflow.com/users/36866", "pm_score": 6, "selected": true, "text": "/ 5 font-family font-size str diff substring hidden style.display none offsetWidth style.visibility=\"hidden\" &lt;/abbr&gt; c...
2008/11/12
[ "https://Stackoverflow.com/questions/282758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13289/" ]
282,779
<p>I was wondering if there was some kind of J tool in the java swing library that opens up a file browser window and allows a user to choose a file. Then the ouput of the file would be the absolute path of the chosen file.</p> <p>Thanks in advance,</p>
[ { "answer_id": 282793, "author": "Tomek", "author_id": 29326, "author_profile": "https://Stackoverflow.com/users/29326", "pm_score": 4, "selected": false, "text": "final JFileChooser fc = new JFileChooser();\nfc.showOpenDialog(this);\n\ntry {\n // Open an input stream\n Scanner rea...
2008/11/12
[ "https://Stackoverflow.com/questions/282779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29326/" ]
282,791
<ul> <li><p>How do I utilize a ?: operator in the SELECT clause of a LINQ query? If this can't be done, how can I emulate one? The goal is to get a CASE block in my select clause. As you might suspect, I'm getting an error: <em>Invalid anonymous type member declarator. Anonymous type members must be declared with a m...
[ { "answer_id": 282806, "author": "LeppyR64", "author_id": 16592, "author_profile": "https://Stackoverflow.com/users/16592", "pm_score": 0, "selected": false, "text": "var query =\n from a in db.tblActivities\n from i in a.tblIPs\n from u in i.tblUsers \n select new\n {\n ...
2008/11/12
[ "https://Stackoverflow.com/questions/282791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11112/" ]
282,800
<p>I don't even know where to go with this. Google wasn't very helpful. As with my previous question. I'm using TextMate's Command+R to compile the project.</p> <blockquote> <p>game.h:16:error: declaration of ‘Player* HalfSet::Player() const’</p> <p>players.h:11:error: changes meaning of ‘Player’ from ‘class Player’</p...
[ { "answer_id": 283463, "author": "MSalters", "author_id": 15416, "author_profile": "https://Stackoverflow.com/users/15416", "pm_score": 3, "selected": false, "text": "HalfSet::setPlayer(Player*) Player class HalfSet Player HalfSet::Player global class ::Player ::Player HalfSet::Player" ...
2008/11/12
[ "https://Stackoverflow.com/questions/282800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16204/" ]
282,802
<p>I know that I can <code> svn diff -r a:b repo </code> to view the changes between the two specified revisions. What I'd like is a diff for every revision that changed the file. Is such a command available?</p>
[ { "answer_id": 282887, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 5, "selected": false, "text": "git-svn git log -p filename" }, { "answer_id": 282956, "author": "Community", "author_id": -1, "autho...
2008/11/12
[ "https://Stackoverflow.com/questions/282802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23071/" ]
282,831
<p>I am trying to see what are the gotchas in using XmlHttpWebRequest such that it works for Safari, Firefox and IE?</p>
[ { "answer_id": 282842, "author": "Corey Trager", "author_id": 9328, "author_profile": "https://Stackoverflow.com/users/9328", "pm_score": 1, "selected": false, "text": " // Create the request object; Microsoft failed to properly\n // implement the XMLHttpRequest in IE7, so we use t...
2008/11/12
[ "https://Stackoverflow.com/questions/282831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
282,832
<p>I am trying to do something like this</p> <pre><code>public void GetData(ref Dictionary&lt;T,V&gt; dataDictionary) { } </code></pre> <p>Where T can be GUID, string, or int and V is custom user or item object.</p>
[ { "answer_id": 282846, "author": "jons911", "author_id": 34375, "author_profile": "https://Stackoverflow.com/users/34375", "pm_score": 0, "selected": false, "text": "public void GetData<T, V>(ref Dictionary<T, V> dataDictionary) {\n if (typeof(T) == typeof(string) || typeof(T) == type...
2008/11/12
[ "https://Stackoverflow.com/questions/282832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
282,838
<p>I know this question had been asked more than a few times, but so far I haven't been able to find a good solution for it.</p> <p>I've got a panel with other control on it.<br> I want to draw a line on it and on top of all the controls in the panel</p> <p>I came across 3 types of solutions (non of them worked the w...
[ { "answer_id": 282891, "author": "asponge", "author_id": 19449, "author_profile": "https://Stackoverflow.com/users/19449", "pm_score": 2, "selected": false, "text": "panel.Paint += new PaintEventHandler(panel_Paint);\nbutton.Paint += new PaintEventHandler(button_Paint);\n\nprotected void...
2008/11/12
[ "https://Stackoverflow.com/questions/282838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36777/" ]
282,851
<p>I just read <a href="https://stackoverflow.com/questions/72271/no-newline-at-end-of-file-compiler-warning">this post</a> about why new-line warnings exist, but to be honest my team has people working on several different platforms and with several different editors (everyone uses what bests suites them), so the warn...
[ { "answer_id": 21864095, "author": "bames53", "author_id": 365496, "author_profile": "https://Stackoverflow.com/users/365496", "pm_score": 2, "selected": false, "text": "-Wno-eof-newline\n -Wno-eof-newline -Weof-newline -Wnewline-eof -Wc++98-compat-pedantic -Weverything -Wno-newline-eof ...
2008/11/12
[ "https://Stackoverflow.com/questions/282851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15124/" ]
282,858
<p>In standard php or source code based projects we easily keep all of the code in SVN and each developer can checkout their own copy and collaborate on the same code. </p> <p>When developing a Drupal site however, much of the work is in "setup". Besides the theme and modules you don't really have any "source code"....
[ { "answer_id": 414442, "author": "Stewart Robinson", "author_id": 47424, "author_profile": "https://Stackoverflow.com/users/47424", "pm_score": 5, "selected": true, "text": "function ec_install() {\n $ret = array();\n $num = 0;\n while (1) {\n $version = 6000 + $num;\n $funcname =...
2008/11/12
[ "https://Stackoverflow.com/questions/282858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36780/" ]
282,859
<p>I remember from way back at university using a switch with 'binary search' or 'binary switch'. Something like that, My google foo is broken today. Anyway it goes down like this: You define an array of possible options (Strings usually), some magic happens, and those options in the array become the cases in the switc...
[ { "answer_id": 282869, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 4, "selected": true, "text": "public enum Day {\n SUNDAY, MONDAY, TUESDAY, WEDNESDAY, \n THURSDAY, FRIDAY, SATURDAY \n}\n\npublic class EnumTest...
2008/11/12
[ "https://Stackoverflow.com/questions/282859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3431280/" ]
282,862
<p>Is there a way to have a function return a editable reference to some internal data. Here's an example I hope helps show what I mean.</p> <pre><code>class foo { public int value; } class bar { bar() { m_foo = new foo(); m_foo.value = 42; } private m_foo; foo getFoo(){return m_...
[ { "answer_id": 282878, "author": "jpoh", "author_id": 4368, "author_profile": "https://Stackoverflow.com/users/4368", "pm_score": 0, "selected": false, "text": "foo getFoo getFoo foo bar" }, { "answer_id": 282880, "author": "Corey Trager", "author_id": 9328, "author_p...
2008/11/12
[ "https://Stackoverflow.com/questions/282862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36782/" ]
282,876
<p>Ok, this is driving me nuts.</p> <p>I've done just about everything I can to enable step through debugging of stored procedures of a sql server 2005 database.</p> <p><a href="http://arjunachith.blogspot.com/2007/05/debugging-stored-procedures-debug.html" rel="noreferrer">http://arjunachith.blogspot.com/2007/05/deb...
[ { "answer_id": 2385462, "author": "Sethupathi", "author_id": 286949, "author_profile": "https://Stackoverflow.com/users/286949", "pm_score": 1, "selected": false, "text": "Allow SQL/CLR Debugging" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/282876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/750/" ]
282,883
<p>We need to start adding internationalisation to our program. Thankfully not the whole thing yet, just a few bits, but I want the way we do it to scale up to potentially cover the whole program. The thing is, our program is based on plugins, so not all strings belong in the same place.</p> <p>As far as I understand ...
[ { "answer_id": 282919, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 2, "selected": false, "text": "MyProgramStrings MyProgramStrings_fr MyProgramStrings_de public static void main(String[] args) {\n\n ResourceBundle bundl...
2008/11/12
[ "https://Stackoverflow.com/questions/282883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1000/" ]
282,899
<p>If you have a particular line of C code in mind to examine in the machine output, how would you locate it in objdump output. Here is an example</p> <pre><code>if (cond) foo; bar(); </code></pre> <p>and I want to see if bar was inlined as I'd like. Or would you use some alternative tool instead of objdump?</...
[ { "answer_id": 282934, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 4, "selected": true, "text": "-S \"objdump -Sd a.out\" int main(void) {\n int a = 0;\n asm(\"#\");\n return a;\n}\n .file ...
2008/11/12
[ "https://Stackoverflow.com/questions/282899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30636/" ]
282,904
<p>I have this PHP script that I wrote to automatically follow users that post messages with certain terms. It works 100% of the time on a bunch of test accounts but then does not work on the account I'd like to use it with. </p> <p>I've checked the account's API rate limit and it's well within the boundaries. I've ...
[ { "answer_id": 284875, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "curl_setopt($ch, CURLOPT_VERBOSE, 1);\n" }, { "answer_id": 286961, "author": "Till", "author_id": 2859, ...
2008/11/12
[ "https://Stackoverflow.com/questions/282904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30098/" ]
282,905
<p>I'm looking for an alternative, since I find emacs difficult to use. I'd rather use an editor that supports all the usual shortcuts I'm used to, such as arrow keys to move the cursor around, CTRL+SHIFT+RightArrow to select the next word, etc.</p> <p>Basically, I don't want to have to relearn all my familiar shortcu...
[ { "answer_id": 293255, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 1, "selected": false, "text": ":set ai lisp aw\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/282905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23341/" ]
282,907
<p>I'm going to try out turbogears however I'm on windows vista. however due to firewall proxy problems, it seems i can't download .egg files which is required for setup turbogears to get installed in my windows environment. I do have a bootable, or I can make a bootable Linux USB, I can try cygwin but I am not sure wh...
[ { "answer_id": 283174, "author": "gimel", "author_id": 6491, "author_profile": "https://Stackoverflow.com/users/6491", "pm_score": 2, "selected": false, "text": "tgsetup.py .egg .rpm" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/282907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1345527/" ]
282,916
<p>I am extremely new at php and I was wondering if someone could help me use either a <code>for()</code> or <code>while()</code> loop to create an array of 10 elements.</p>
[ { "answer_id": 282917, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 5, "selected": false, "text": "$array = array();\n$array2 = array();\n\n// for example\nfor ($i = 0; $i < 10; ++$i) {\n $array[] = 'new element';\n}\n\n// ...
2008/11/12
[ "https://Stackoverflow.com/questions/282916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
282,938
<p>What is the best way to give the user feedback for a color selection?<br> I have a dialog with a "Select Color" push button which pops a <code>QColorDialog</code>. After the selection is made I want to show the user the color selected.<br> Usually I do this using a <code>QLabel</code> and changing it's background co...
[ { "answer_id": 283262, "author": "Jérôme", "author_id": 2796, "author_profile": "https://Stackoverflow.com/users/2796", "pm_score": 3, "selected": false, "text": "const QString COLOR_STYLE(\"QPushButton { background-color : %1; color : %2; }\");\n\nQColor ChosenColor; // Color chosen by ...
2008/11/12
[ "https://Stackoverflow.com/questions/282938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9611/" ]
282,943
<p>Does anyone have a good way of implementing something like a sequence in SQL server?</p> <p>Sometimes you just don't want to use a GUID, besides the fact that they are ugly as heck. Maybe the sequence you want isn't numeric? Besides, inserting a row and then asking the DB what the number is just seems so hackish.<...
[ { "answer_id": 282958, "author": "Corey Trager", "author_id": 9328, "author_profile": "https://Stackoverflow.com/users/9328", "pm_score": 3, "selected": false, "text": "BEGIN TRANSACTION \nSELECT number from plain old table.. \nUPDATE plain old table, set the number to be the next numb...
2008/11/12
[ "https://Stackoverflow.com/questions/282943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3453/" ]
282,968
<p>I need to write some Prolog programs for a class.</p> <p>Any recommendations?</p>
[ { "answer_id": 10800170, "author": "Karl Adler", "author_id": 1059828, "author_profile": "https://Stackoverflow.com/users/1059828", "pm_score": 2, "selected": false, "text": "% swipl\n?- emacs.\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/282968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30626/" ]
282,977
<p>Suppose that I have a Java class with a static method, like so:</p> <pre> class A { static void foo() { // Which class invoked me? } } </pre> <p>And suppose further that class A has an arbitrary number of subclasses:</p> <pre> class B extends A { } class C extends A { } class D extends A { } ....
[ { "answer_id": 283008, "author": "Daniel Spiewak", "author_id": 9815, "author_profile": "https://Stackoverflow.com/users/9815", "pm_score": 4, "selected": true, "text": "A.foo() B.foo() foo() A.foo()" }, { "answer_id": 283518, "author": "Georgy Bolyuba", "author_id": 4052...
2008/11/12
[ "https://Stackoverflow.com/questions/282977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36794/" ]
282,983
<p>I'm following several tutorials and references trying to get my kernel set up. I've come across some unfamiliar code in a tutorial that isn't explaining it at all. It's code that I'm told maps the <code>16 IRQs (0-15)</code> to ISR locations <code>32-47</code>:</p> <pre><code>void irq_remap(void) { outportb(0x2...
[ { "answer_id": 283033, "author": "Evan Teran", "author_id": 13430, "author_profile": "https://Stackoverflow.com/users/13430", "pm_score": 5, "selected": true, "text": "outb outportb(0x20, 0x11); /* write ICW1 to PICM, we are gonna write commands to PICM */\noutportb(0xA0, 0x11); /* write...
2008/11/12
[ "https://Stackoverflow.com/questions/282983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19521/" ]
282,984
<p>Consider two tables transaction and category each having their own ID and information.</p> <p>A transaction can have more than one category, I have read creating a 3rd table to link transaction and category using their IDs is best. But what would you call this table, assuming you would have many like it?</p> <p>tr...
[ { "answer_id": 282994, "author": "WW.", "author_id": 14663, "author_profile": "https://Stackoverflow.com/users/14663", "pm_score": 3, "selected": true, "text": "student_class enrollment transaction_category category_transaction" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/282984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34435/" ]
282,992
<p>Of course, the immediate answer for most situations is <strong>"yes"</strong>, and I am a firm believer that a process should correctly cleanup any resources it has allocated, but what I have in my situation is a long-running system daemon that opens a fixed number of file descriptors at the startup, and closes them...
[ { "answer_id": 283002, "author": "Evan Teran", "author_id": 13430, "author_profile": "https://Stackoverflow.com/users/13430", "pm_score": 2, "selected": false, "text": "....\nAll open stdio(3) streams are flushed and closed. Files created by tmpfile(3) are removed.\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/282992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23643/" ]
282,993
<p>I'd like to give customers a choice of the database engine, but also want to minimize my troubles of such a decision.<br> The engines in question are MySQL (5 or later) and SQL Server (2005 or later).</p>
[ { "answer_id": 283074, "author": "MusiGenesis", "author_id": 14606, "author_profile": "https://Stackoverflow.com/users/14606", "pm_score": 2, "selected": false, "text": "SELECT [ORDER], [Why This Name] FROM [Table From Hell]\n SELECT \"ORDER\", \"Why This Name\" FROM \"Table From Hell\"\...
2008/11/12
[ "https://Stackoverflow.com/questions/282993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28098/" ]
283,004
<p>I'm building an ORM library with reuse and simplicity in mind; everything goes fine except that I got stuck by a stupid inheritance limitation. Please consider the code below:</p> <pre><code>class BaseModel { /* * Return an instance of a Model from the database. */ static public function get (/* v...
[ { "answer_id": 283094, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 8, "selected": true, "text": "debug_backtrace() class Base {\n public static function whoAmI() {\n return get_called_class();\n }\n}\n\nclass Use...
2008/11/12
[ "https://Stackoverflow.com/questions/283004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36797/" ]
283,024
<p>Is it possible to free memory allocated by C's alloca() explicitly, before the current function exits? If so,how?</p>
[ { "answer_id": 283039, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 4, "selected": false, "text": "alloca" }, { "answer_id": 29658582, "author": "Michael", "author_id": 543873, "author_profile": "https...
2008/11/12
[ "https://Stackoverflow.com/questions/283024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23903/" ]
283,027
<p>I am working on a WPF application that opens and displays XPS documents. When the application closes, the specification is the application should delete the opened XPS document for clean up. However, when opening a certain XPS document, the application throws an exception that the file is still in use when it tries ...
[ { "answer_id": 1370213, "author": "Tim Erickson", "author_id": 8787, "author_profile": "https://Stackoverflow.com/users/8787", "pm_score": 3, "selected": false, "text": "var myXpsFile = @\"c:\\path\\to\\My XPS File.xps\";\nvar myXpsDocument = new XpsDocument(myXpsFile);\nMyDocumentViewer...
2008/11/12
[ "https://Stackoverflow.com/questions/283027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
283,032
<p>I am using UIActivityIndicatorView to showing user that there is something going on, let them wait. But UIActivityIndicatorView looks small, do not have background color, and not very obvious to the user. While in iPhone SDK's UIImagePickerController, it uses the similar mechanism, but with the black background as w...
[ { "answer_id": 283119, "author": "leonho", "author_id": 30883, "author_profile": "https://Stackoverflow.com/users/30883", "pm_score": 4, "selected": false, "text": "[activityIndicator setBackgroundColor:[UIColor blackColor]];\n" }, { "answer_id": 20995452, "author": "Rajesh L...
2008/11/12
[ "https://Stackoverflow.com/questions/283032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32096/" ]
283,035
<p>I have a Windows application (VS2005/C#) which comes in two versions, Enterprise and Pro. In the Pro version, some of the features and menus are disabled. Currently, I'm doing this by commenting out the disabling code to create the Enterprise version, then I copy each executable file to another location. Obviously t...
[ { "answer_id": 283097, "author": "Jeff Donnici", "author_id": 821, "author_profile": "https://Stackoverflow.com/users/821", "pm_score": 0, "selected": false, "text": "enum LicenseLevel {\n Eval = 0,\n Pro = 1,\n Enterprise = 2\n}\n\n// later... \n\nfor(i=0; i < widgets.Count; i++) ...
2008/11/12
[ "https://Stackoverflow.com/questions/283035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5255/" ]
283,045
<p>I need help writing the following method:</p> <pre><code>def get_new_location(current_location, target_location, distance_travelled): ... ... return new_location </code></pre> <p>where all locations are (lat,long)</p> <p>I realize that there are different models for the earth (WGS-84, GRS-80, ...) whi...
[ { "answer_id": 290674, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 2, "selected": false, "text": "def get_new_location(current_location, target_location, percent_traveled):\n # convert locations into cartiesian co-ord...
2008/11/12
[ "https://Stackoverflow.com/questions/283045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20498/" ]
283,061
<p>My installation of APEX has come pear shaped on a Oracle 9.2.0.5.0 instance, all the packages are invalid.</p> <p>I've tried recompiling everything with DBMS_UTILITY.compile_schema, but still all the packages are invalid. So, tried recompiling individual packages,</p> <pre><code>SQL&gt; ALTER PACKAGE FLOWS_020000....
[ { "answer_id": 283085, "author": "Gary Myers", "author_id": 25714, "author_profile": "https://Stackoverflow.com/users/25714", "pm_score": 2, "selected": false, "text": "SHOW ERRORS PACKAGE BODY FLOWS_020000.WWV_FLOW_QUERY\n" }, { "answer_id": 283118, "author": "WW.", "aut...
2008/11/12
[ "https://Stackoverflow.com/questions/283061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3839/" ]
283,063
<p>Given the following simple example:</p> <pre><code> List&lt;string&gt; list = new List&lt;string&gt;() { "One", "Two", "Three", "three", "Four", "Five" }; CaseInsensitiveComparer ignoreCaseComparer = new CaseInsensitiveComparer(); var distinctList = list.Distinct(ignoreCaseComparer as IEqualityComparer...
[ { "answer_id": 283188, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 9, "selected": true, "text": "StringComparer List<string> list = new List<string>() {\n \"One\", \"Two\", \"Three\", \"three\", \"Four\", \"Five\...
2008/11/12
[ "https://Stackoverflow.com/questions/283063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5023/" ]
283,087
<p>I am looking to parse INSERT and UPDATE MySQL SQL queries in PHP to determine what changes where made from what original data. Now this would be pretty easy to create, but I want to see if there are any existing libraries in PHP to do this.</p> <p>Basically what I have is a table with all of the above queries that ...
[ { "answer_id": 414671, "author": "Dan Soap", "author_id": 25253, "author_profile": "https://Stackoverflow.com/users/25253", "pm_score": 2, "selected": false, "text": "timestamp, user, field, old_value, new_value\n table\n" } ]
2008/11/12
[ "https://Stackoverflow.com/questions/283087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
283,090
<p>I'd like to popup a simple dialog with an editor box, to let user enter some value then just return. I am wondering whether iPhone SDK has that kind of support.</p> <p>Thanks.</p>
[ { "answer_id": 286049, "author": "BlueDolphin", "author_id": 32096, "author_profile": "https://Stackoverflow.com/users/32096", "pm_score": 4, "selected": true, "text": "UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@\"Your title here\" message:@\"this gets covered\" deleg...
2008/11/12
[ "https://Stackoverflow.com/questions/283090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32096/" ]
283,103
<p>DDL for Database Tables:</p> <pre><code> Users: id - int - identity name - varchar - unique PCs: id - int - idnetity name - varchar - unique userid - FK to Users Apps: id - int - identity name - varchar pcid - FK to PCs </code></pre> <p>I created a DataContext using the...
[ { "answer_id": 283157, "author": "Ali Ersöz", "author_id": 4215, "author_profile": "https://Stackoverflow.com/users/4215", "pm_score": 3, "selected": true, "text": "var query = from u in db.Users\n join p in db.PCs on p.UserId == u.Id\n join a in db.Apps on a.PCId =...
2008/11/12
[ "https://Stackoverflow.com/questions/283103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16592/" ]
283,120
<p>I want to assign default values to a column in my select sql query so that if the value of that column is null I get that default value in my recordset. Is there anyway to do this?</p> <p>Example:</p> <pre><code>select col1 (some default value) from tblname; </code></pre>
[ { "answer_id": 283129, "author": "LeppyR64", "author_id": 16592, "author_profile": "https://Stackoverflow.com/users/16592", "pm_score": 3, "selected": false, "text": "select\n isnull(col1, defaultvalue)\nfrom\n tblname;\n" }, { "answer_id": 283151, "author": "Alexander Prok...
2008/11/12
[ "https://Stackoverflow.com/questions/283120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
283,128
<p>I'm writing a wrapper class for a command line executable. This exe accepts input from <code>stdin</code> until I hit <code>Ctrl+C</code> in the command prompt shell, in which case it prints output to <code>stdout</code> based on the input. I want to simulate that <code>Ctrl+C</code> press in C# code, sending the ...
[ { "answer_id": 283137, "author": "Alon L", "author_id": 30884, "author_profile": "https://Stackoverflow.com/users/30884", "pm_score": -1, "selected": false, "text": " [DllImport(\"user32.dll\")]\n public static extern int SendMessage(\n int hWnd, // handle to des...
2008/11/12
[ "https://Stackoverflow.com/questions/283128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19252/" ]
283,131
<p>Can anyone help me to put a vertical scroll bar for an <code>&lt;asp:CheckBoxList&gt;</code>?</p>
[ { "answer_id": 283137, "author": "Alon L", "author_id": 30884, "author_profile": "https://Stackoverflow.com/users/30884", "pm_score": -1, "selected": false, "text": " [DllImport(\"user32.dll\")]\n public static extern int SendMessage(\n int hWnd, // handle to des...
2008/11/12
[ "https://Stackoverflow.com/questions/283131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29867/" ]