qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
40,873
<p>I have a table which is full of arbitrarily formatted phone numbers, like this</p> <pre><code>027 123 5644 021 393-5593 (07) 123 456 042123456 </code></pre> <p>I need to search for a phone number in a similarly arbitrary format ( e.g. <code>07123456</code> should find the entry <code>(07) 123 456</code></p> <p>The w...
[ { "answer_id": 40904, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 0, "selected": false, "text": "\"(027) 123 456\" 027 12 3456 027123456 \"^[\\D]+0[\\D]+2[\\D]+7[\\D]+1[\\D]+2[\\D]+3[\\D]+4[\\D]+5[\\D]+6$\"\n \\D" },...
2008/09/02
[ "https://Stackoverflow.com/questions/40873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/234/" ]
40,884
<p>How can I go about storing a vb.net user defined object in a sql database. I am not trying to replicate the properties with columns. I mean something along the lines of converting or encoding my object to a byte array and then storing that in a field in the db. Like when you store an instance of an object in session...
[ { "answer_id": 41126, "author": "Jas", "author_id": 777, "author_profile": "https://Stackoverflow.com/users/777", "pm_score": 0, "selected": false, "text": " #'res is my object to serialize\n Dim xml_serializer As System.Xml.Serialization.XmlSerializer\n Dim string_writer As New...
2008/09/02
[ "https://Stackoverflow.com/questions/40884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/777/" ]
40,912
<p>I'm looking for a way to check within <code>pageLoad()</code> if this method is raised during load event because of a postback/async postback or because of being loaded and access the first time.</p> <p>This is similar to <code>Page.IsPostback</code> property within code behind page.</p> <p>TIA, Ricky</p>
[ { "answer_id": 40981, "author": "Ricky Supit", "author_id": 4191, "author_profile": "https://Stackoverflow.com/users/4191", "pm_score": 2, "selected": false, "text": " function pageLoad(sender, arg) {\n if (!arg.get_isPartialLoad()) {\n //code to be executed only on the f...
2008/09/02
[ "https://Stackoverflow.com/questions/40912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4191/" ]
40,913
<p>I am having problems manually looping through xml data that is received via an HTTPService call, the xml looks something like this: </p> <pre><code>&lt;DataTable&gt; &lt;Row&gt; &lt;text&gt;foo&lt;/text&gt; &lt;/Row&gt; &lt;Row&gt; &lt;text&gt;bar&lt;/text&gt; &lt;/Row&gt; &lt;/DataT...
[ { "answer_id": 40930, "author": "dlamblin", "author_id": 459, "author_profile": "https://Stackoverflow.com/users/459", "pm_score": 2, "selected": false, "text": "if (exists(event.result.DataTable) && exists(event.result.DataTable.Row)){\n if (exists(event.result.DataTable.Row.length)) {...
2008/09/02
[ "https://Stackoverflow.com/questions/40913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
40,923
<p>I have a framework written in Perl that sets a bunch of environment variables to support interprocess (typically it is sub process) communication. We keep a sets of key/value pairs in XML-ish files. We tried to make the key names camel-case <code>somethingLikeThis</code>. This all works well.</p> <p>Recently we...
[ { "answer_id": 73849, "author": "piCookie", "author_id": 8763, "author_profile": "https://Stackoverflow.com/users/8763", "pm_score": 2, "selected": false, "text": "my %env = map {/(.*?)=(.*)/;} `set`;\nprint join(' ', sort keys %env);\n" } ]
2008/09/02
[ "https://Stackoverflow.com/questions/40923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
40,943
<p>What code do you need to add in PHP to automatically have the browser download a file to the local machine when a link is visited?</p> <p>I am specifically thinking of functionality similar to that of download sites that prompt the user to save a file to disk once you click on the name of the software?</p>
[ { "answer_id": 40945, "author": "grom", "author_id": 486, "author_profile": "https://Stackoverflow.com/users/486", "pm_score": 5, "selected": false, "text": "header('Content-type: application/pdf');\nheader('Content-Disposition: attachment; filename=\"' . basename($filename) . '\"');\nhe...
2008/09/03
[ "https://Stackoverflow.com/questions/40943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277/" ]
40,957
<p>I'm early in development on a web application built in VS2008. I have both a desktop PC (where most of the work gets done) and a laptop (for occasional portability) on which I use AnkhSVN to keep the project code synced. What's the best way to keep my development database (SQL Server Express) synced up as well?</p> ...
[ { "answer_id": 40963, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 2, "selected": false, "text": "use master\ngo\n\nif exists (select * from master.dbo.sysdatabases where name = 'your_db')\nbegin\n alter database your_db set...
2008/09/03
[ "https://Stackoverflow.com/questions/40957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4160/" ]
40,962
<p>I have a need to close a parent form from within child form from a Windows application. What would be the best way to do this?</p>
[ { "answer_id": 41579, "author": "Ed Schwehm", "author_id": 1206, "author_profile": "https://Stackoverflow.com/users/1206", "pm_score": 0, "selected": false, "text": "private Form pForm;\npublic ChildForm(ref Form parentForm)\n{\n pForm = parentForm;\n}\n\nprivate closeParent()\n{\n ...
2008/09/03
[ "https://Stackoverflow.com/questions/40962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2062/" ]
40,966
<p>I have a javascript function that manipulates the DOM when it is called (adds CSS classes, etc). This is invoked when the user changes some values in a form. When the document is first loading, I want to invoke this function to prepare the initial state (which is simpler in this case than setting up the DOM from t...
[ { "answer_id": 40972, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 4, "selected": true, "text": "onload" }, { "answer_id": 41008, "author": "John Millikin", "author_id": 3560, "author_profile": "ht...
2008/09/03
[ "https://Stackoverflow.com/questions/40966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122/" ]
40,999
<p>Here's a quick question I've been banging my head against today.</p> <p>I'm trying to convert a .Net dataset into an XML stream, transform it with an xsl file in memory, then output the result to a new XML file. </p> <p>Here's the current solution:</p> <pre><code> string transformXML = @"pathToXslDocument"...
[ { "answer_id": 41012, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 4, "selected": true, "text": " BufferedStream stream = new BufferedStream(new MemoryStream());\n stream.Write(Encoding.ASCII.GetBytes(\"<xml>foo</xml>\"),...
2008/09/03
[ "https://Stackoverflow.com/questions/40999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2916/" ]
41,010
<p><strong>A Little Background Information</strong>:<br> I've been looking at a few PHP framework recently, and it came down to two. The Zend Framework or CodeIgniter. </p> <p>I prefer CodeIgniter, because of its simple design. It's very bare bone, and it is just kept simple. The thing I don't like though is the weak ...
[ { "answer_id": 30263642, "author": "Luca Mori Polpettini", "author_id": 2270716, "author_profile": "https://Stackoverflow.com/users/2270716", "pm_score": 0, "selected": false, "text": "<?php\nif ( ! defined('BASEPATH')) exit('No direct script access allowed');\n\nrequire_once(APPPATH.'th...
2008/09/03
[ "https://Stackoverflow.com/questions/41010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2976/" ]
41,018
<p>Grails makes it very easy to configure datasources for different environments (development, test, production) in its DataSources.groovy file, but there seems to be no facility for configuring multiple datasources in one environment. What to I do if I need to access several databases from the same Grails application?...
[ { "answer_id": 12075345, "author": "anataliocs", "author_id": 555177, "author_profile": "https://Stackoverflow.com/users/555177", "pm_score": 2, "selected": false, "text": "dataSource {\n pooled = true\n driverClassName = \"org.h2.Driver\"\n username = \"sa\"\n password = \"\...
2008/09/03
[ "https://Stackoverflow.com/questions/41018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453/" ]
41,027
<p>I am looking for a little bit of JQuery or JS that allows me to produce a horizontally scrolling "news ticker" list.</p> <p>The produced HTML needs to be standards compliant as well.</p> <p>I have tried <a href="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/scrollanimate.html" rel...
[ { "answer_id": 40595802, "author": "tj001", "author_id": 7052915, "author_profile": "https://Stackoverflow.com/users/7052915", "pm_score": 0, "selected": false, "text": "<li>&nbsp;</li>" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/41027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364/" ]
41,039
<p>Is there a way to search the latest version of every file in TFS for a specific string or regex? This is probably the only thing I miss from Visual Source Safe... </p> <p>Currently I perform a Get Latest on the entire codebase and use Windows Search, but this gets quite painful with over 1GB of code in 75,000 file...
[ { "answer_id": 78966, "author": "granth", "author_id": 11210, "author_profile": "https://Stackoverflow.com/users/11210", "pm_score": 7, "selected": true, "text": "foo foo OR bar class:WebRequest" }, { "answer_id": 23023410, "author": "Vijayanand Settin", "author_id": 2125...
2008/09/03
[ "https://Stackoverflow.com/questions/41039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/952/" ]
41,045
<p>As a general rule, I prefer using value rather than pointer semantics in C++ (ie using <code>vector&lt;Class&gt;</code> instead of <code>vector&lt;Class*&gt;</code>). Usually the slight loss in performance is more than made up for by not having to remember to delete dynamically allocated objects.</p> <p>Unfortunate...
[ { "answer_id": 41059, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 6, "selected": true, "text": "vector<shared_ptr<Parent>> vec;\nvec.push_back(shared_ptr<Parent>(new Child()));\n" }, { "answer_id": 41103, ...
2008/09/03
[ "https://Stackoverflow.com/questions/41045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2994/" ]
41,089
<p>I have a vb6 form with an ocx control on it. The ocx control has a button on it that I want to press from code. How do I do this?</p> <p>I have:</p> <pre><code>Dim b As CommandButton Set b = ocx.GetButton("btnPrint") SendMessage ocx.hwnd, WM_COMMAND, GetWindowLong(b.hwnd, GWL_ID), b.hwnd </code></pre> <p>but it d...
[ { "answer_id": 41521, "author": "DAC", "author_id": 1111, "author_profile": "https://Stackoverflow.com/users/1111", "pm_score": 3, "selected": true, "text": "Dim b As CommandButton\nSet b = ocx.GetButton(\"btnPrint\")\nb = True\n CommandButton CheckBox CommandButton Value Click ToggleBut...
2008/09/03
[ "https://Stackoverflow.com/questions/41089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4495/" ]
41,097
<p>The question sort of says it all.</p> <p>Whether it's for code testing purposes, or you're modeling a real-world process, or you're trying to impress a loved one, what are some algorithms that folks use to generate interesting time series data? Are there any good resources out there with a consolidated list? No con...
[ { "answer_id": 41521, "author": "DAC", "author_id": 1111, "author_profile": "https://Stackoverflow.com/users/1111", "pm_score": 3, "selected": true, "text": "Dim b As CommandButton\nSet b = ocx.GetButton(\"btnPrint\")\nb = True\n CommandButton CheckBox CommandButton Value Click ToggleBut...
2008/09/03
[ "https://Stackoverflow.com/questions/41097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4069/" ]
41,107
<p>I've been looking for a <em>simple</em> Java algorithm to generate a pseudo-random alpha-numeric string. In my situation it would be used as a unique session/key identifier that would "likely" be unique over <code>500K+</code> generation (my needs don't really require anything much more sophisticated). </p> <p>Id...
[ { "answer_id": 41156, "author": "erickson", "author_id": 3474, "author_profile": "https://Stackoverflow.com/users/3474", "pm_score": 12, "selected": true, "text": "public class RandomString {\n\n /**\n * Generate a random string.\n */\n public String nextString() {\n ...
2008/09/03
[ "https://Stackoverflow.com/questions/41107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3803/" ]
41,134
<p>Here is the deal. </p> <p>$ gem --version</p> <blockquote> <p>1.1.0</p> </blockquote> <p>$ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config</p> <blockquote> <p>Bulk updating Gem source index for: <a href="http://gems.rubyforge.org/" rel="nofollow noreferrer">http://gems.rubyf...
[ { "answer_id": 41160, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 2, "selected": false, "text": "gem update --system\n" }, { "answer_id": 223708, "author": "James A. Rosen", "author_id": 1190, "auth...
2008/09/03
[ "https://Stackoverflow.com/questions/41134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1797/" ]
41,155
<p>In the process of developing my first WCF service and when I try to use it I get "Method not Allowed" with no other explanation. </p> <p>I've got my interface set up with the ServiceContract and OperationContract:</p> <pre><code> [OperationContract] void FileUpload(UploadedFile file); </code></pre> <p>Alon...
[ { "answer_id": 41205, "author": "Jeremy McGee", "author_id": 3546, "author_profile": "https://Stackoverflow.com/users/3546", "pm_score": 2, "selected": false, "text": "byte int string [DataContract]" }, { "answer_id": 41301, "author": "Ubiguchi", "author_id": 2562, "a...
2008/09/03
[ "https://Stackoverflow.com/questions/41155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/831/" ]
41,159
<p>Given the following:</p> <pre><code>List&lt;List&lt;Option&gt;&gt; optionLists; </code></pre> <p>what would be a quick way to determine the subset of Option objects that appear in all N lists? Equality is determined through some string property such as option1.Value == option2.Value.</p> <p>So we should end up wi...
[ { "answer_id": 41175, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 4, "selected": true, "text": "var x = from list in optionLists\n from option in list\n where optionLists.All(l => l.Any(o => o.Value == op...
2008/09/03
[ "https://Stackoverflow.com/questions/41159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3615/" ]
41,179
<p>I have a number of users with multi-megabyte files that need to be processed before they can be uploaded. I am trying to find a way to do this without having to install any executable software on their machines. </p> <p>If every machine shipped with, say, Python it would be easy. I could have a Python script do eve...
[ { "answer_id": 51186981, "author": "Isaac", "author_id": 9816472, "author_profile": "https://Stackoverflow.com/users/9816472", "pm_score": 0, "selected": false, "text": "fs nodeJS" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/41179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4262/" ]
41,198
<p>How can I get an image to stretch the height of a <code>DIV</code> class?</p> <p>Currently it looks like this:</p> <p><img src="https://i.stack.imgur.com/DcrXC.png" width="650" /></p> <p>However, I would like the <code>DIV</code> to be stretched so the <code>image</code> fits properly, but I do not want to resize...
[ { "answer_id": 41201, "author": "DevelopingChris", "author_id": 1220, "author_profile": "https://Stackoverflow.com/users/1220", "pm_score": 1, "selected": false, "text": "display:inline \nfloat:left \n" }, { "answer_id": 41203, "author": "John Millikin", "author_id": 35...
2008/09/03
[ "https://Stackoverflow.com/questions/41198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2592/" ]
41,204
<p>Is there a fast and clean way of returning a JSON hash back from any node in a Ruby on Rails' acts_as_nested_set without using recursion?</p> <p>Here's the recursive solution for reference:</p> <pre><code>class Node &lt; ActiveRecord::Base has_many :products def json_hash if children.size &gt; 0 chil...
[ { "answer_id": 41275, "author": "Mike Stone", "author_id": 122, "author_profile": "https://Stackoverflow.com/users/122", "pm_score": 2, "selected": false, "text": "{ node.name => node.products.find(:all).collect(&:name) }.to_json\n { node.name => node.products.find(:all).collect!(&:name)...
2008/09/03
[ "https://Stackoverflow.com/questions/41204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3499/" ]
41,207
<p>For debugging and testing I'm searching for a JavaScript shell with auto completion and if possible object introspection (like ipython). The online <a href="http://www.squarefree.com/shell/" rel="nofollow noreferrer">JavaScript Shell</a> is really nice, but I'm looking for something local, without the need for an br...
[ { "answer_id": 1812416, "author": "Cheeso", "author_id": 48082, "author_profile": "https://Stackoverflow.com/users/48082", "pm_score": 3, "selected": false, "text": "// shell.js\n// ------------------------------------------------------------------\n//\n// implements an interactive javas...
2008/09/03
[ "https://Stackoverflow.com/questions/41207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/720/" ]
41,218
<p>I am running MAMP locally on my laptop, and I like to test as much as I can locally. Unfortunately, since I work on e-commerce stuff (PHP), I normally force ssl in most of the checkout forms and it just fails on my laptop. Is there any easy configuration that I might be missing to allow "https" to run under MAMP? Pl...
[ { "answer_id": 41272, "author": "David Crow", "author_id": 2783, "author_profile": "https://Stackoverflow.com/users/2783", "pm_score": 2, "selected": false, "text": "/Applications/MAMP/bin/apache2/bin$ ./apachectl stop\n/Applications/MAMP/bin/apache2/bin$ sudo ./apachectl startssl\n" }...
2008/09/03
[ "https://Stackoverflow.com/questions/41218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4247/" ]
41,233
<p>I'm attracted to the neatness that a single file database provides. What driver/connector library is out there to connect and use SQLite with Java.</p> <p>I've discovered a wrapper library, <a href="http://www.ch-werner.de/javasqlite/" rel="noreferrer">http://www.ch-werner.de/javasqlite</a>, but are there other mor...
[ { "answer_id": 593137, "author": "Bernie Perez", "author_id": 1992, "author_profile": "https://Stackoverflow.com/users/1992", "pm_score": 8, "selected": false, "text": "java -cp .:sqlitejdbc-v056.jar Test package com.rungeek.sqlite;\n\nimport java.sql.Connection;\nimport java.sql.DriverM...
2008/09/03
[ "https://Stackoverflow.com/questions/41233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1915/" ]
41,239
<p>I am pretty sure that the settings that I am using are correct, so all possible things can be wrong which I should check out so that I can make authentication with our Active Directory work.</p>
[ { "answer_id": 41247, "author": "grom", "author_id": 486, "author_profile": "https://Stackoverflow.com/users/486", "pm_score": 1, "selected": false, "text": "<?php\n$ds = ldap_connect('host.ad.lan', 389);\nldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);\nldap_set_option($ds, LDAP_OPT...
2008/09/03
[ "https://Stackoverflow.com/questions/41239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/380/" ]
41,244
<p>I found an example in the <a href="http://msdn2.microsoft.com/en-us/bb330936.aspx" rel="noreferrer">VS2008 Examples</a> for Dynamic LINQ that allows you to use a SQL-like string (e.g. <code>OrderBy(&quot;Name, Age DESC&quot;))</code> for ordering. Unfortunately, the method included only works on <code>IQueryable&lt;...
[ { "answer_id": 41262, "author": "Kjetil Watnedal", "author_id": 4116, "author_profile": "https://Stackoverflow.com/users/4116", "pm_score": 6, "selected": false, "text": "IEnumerable<T> myEnumerables\nvar query=from enumerable in myenumerables\n where some criteria\n or...
2008/09/03
[ "https://Stackoverflow.com/questions/41244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1786/" ]
41,290
<p>I have a file which is an XML representation of some data that is taken from a Web service and cached locally within a Web Application. The idea being is that this data is <em>very</em> static, but just <em>might</em> change. So I have set it up to cache to a file, and stuck a monitor against it to check if it has b...
[ { "answer_id": 41559, "author": "Eric Z Beard", "author_id": 1219, "author_profile": "https://Stackoverflow.com/users/1219", "pm_score": 4, "selected": true, "text": " /// <summary>\n /// Blocks until the file is not locked any more.\n /// </summary>\n /// <param name=\"fullP...
2008/09/03
[ "https://Stackoverflow.com/questions/41290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/832/" ]
41,300
<p>How do you run Emacs in Windows?</p> <p>What is the best flavor of Emacs to use in Windows, and where can I download it? And where is the .emacs file located?</p>
[ { "answer_id": 3679058, "author": "cristobalito", "author_id": 376700, "author_profile": "https://Stackoverflow.com/users/376700", "pm_score": 5, "selected": false, "text": "C-h v user-init-file\n (find-file user-init-file)\n" }, { "answer_id": 14307654, "author": "mkasberg",...
2008/09/03
[ "https://Stackoverflow.com/questions/41300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473/" ]
41,304
<p>I know in ASP.NET I can get an item from a DropDownList by using</p> <pre><code>DropDownList1.Items.FindByText </code></pre> <p>Is there a similar method I can use in WPF for a ComboBox?</p> <p>Here's the scenario.</p> <p>I have a table called RestrictionFormat that contains a column called RestrictionType, the ...
[ { "answer_id": 41305, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 2, "selected": false, "text": " <ComboBox Name=\"combo\">\n <ComboBoxItem Name=\"item1\" >1</ComboBoxItem>\n <ComboBoxItem Name=\"item2\">2</Co...
2008/09/03
[ "https://Stackoverflow.com/questions/41304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/71/" ]
41,319
<p>What's the "best" (taking both speed and readability into account) way to determine if a list is empty? Even if the list is of type <code>IEnumerable&lt;T&gt;</code> and doesn't have a Count property.</p> <p>Right now I'm tossing up between this:</p> <pre><code>if (myList.Count() == 0) { ... } </code></pre> <p>an...
[ { "answer_id": 41324, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 8, "selected": true, "text": "public static Boolean IsEmpty<T>(this IEnumerable<T> source)\n{\n if (source == null)\n return true; // or th...
2008/09/03
[ "https://Stackoverflow.com/questions/41319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/615/" ]
41,330
<p>How do I detect if the system has a default recording device installed? I bet this can be done through some calls to the Win32 API, anyone has any experience with this?</p> <p>I'm talking about doing this through code, not by opening the control panel and taking a look under sound options.</p>
[ { "answer_id": 41385, "author": "Jeff Hillman", "author_id": 3950, "author_profile": "https://Stackoverflow.com/users/3950", "pm_score": 2, "selected": true, "text": "#include <tchar.h>\n#include <windows.h>\n#include \"mmsystem.h\"\n\nint _tmain( int argc, wchar_t *argv[] )\n{\n UINT...
2008/09/03
[ "https://Stackoverflow.com/questions/41330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1509946/" ]
41,355
<p>Has anybody got any kind of experience with dynamic programming using WCF. By dynamic programming I mean runtime consumption of WSDL's. I have found one blog entry/tool: <a href="http://blogs.msdn.com/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/vipu...
[ { "answer_id": 169485, "author": "Cuyler", "author_id": 25041, "author_profile": "https://Stackoverflow.com/users/25041", "pm_score": 3, "selected": true, "text": "Execute() ChannelFactory<IFoo>" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/41355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4189/" ]
41,397
<p>Right, I know I am totally going to look an idiot with this one, but my brain is just <em>not</em> kicking in to gear this morning.</p> <p>I want to have a method where I can say &quot;if it goes bad, come back with this type of Exception&quot;, right?</p> <p>For example, something like (<strong>and this doesn't wor...
[ { "answer_id": 41402, "author": "Jon Limjap", "author_id": 372, "author_profile": "https://Stackoverflow.com/users/372", "pm_score": 0, "selected": false, "text": "static T TestException<Exception>(string message)\n{}\n" }, { "answer_id": 41404, "author": "samjudson", "au...
2008/09/03
[ "https://Stackoverflow.com/questions/41397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/832/" ]
41,400
<p>I am looking to do this in C/C++. I came across <a href="http://www.swig.org/Doc1.3/Varargs.html" rel="nofollow noreferrer"><strong>Variable Length Arguments</strong></a>, but this suggests a solution with Python and C using <a href="http://sourceware.org/libffi/" rel="nofollow noreferrer">libffi</a>.</p> <p>Now, if...
[ { "answer_id": 41414, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 1, "selected": false, "text": "void f(varargs va) {\n BOOST_FOREACH(varargs::iterator i, va)\n cout << *i << \" \";\n}\n\nf(args = 1, 2, 3,...
2008/09/03
[ "https://Stackoverflow.com/questions/41400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/123/" ]
41,406
<p>I'm trying to write a page that calls PHP that's stored in a MySQL database. The page that is stored in the MySQL database contains PHP (and HTML) code which I want to run on page load.</p> <p>How could I go about doing this?</p>
[ { "answer_id": 41440, "author": "Michał Niedźwiedzki", "author_id": 2169, "author_profile": "https://Stackoverflow.com/users/2169", "pm_score": 3, "selected": false, "text": "eval() eval execute() ->execute()" }, { "answer_id": 1472666, "author": "Community", "author_id":...
2008/09/03
[ "https://Stackoverflow.com/questions/41406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654/" ]
41,407
<p>I'm currently working on a parser for our internal log files (generated by log4php, log4net and log4j). So far I have a nice regular expression to parse the logs, except for one annoying bit: Some log messages span multiple lines, which I can't get to match properly. The regex I have now is this:</p> <pre><code>(?&...
[ { "answer_id": 41412, "author": "samjudson", "author_id": 1908, "author_profile": "https://Stackoverflow.com/users/1908", "pm_score": 0, "selected": false, "text": "RegexOptions" }, { "answer_id": 41428, "author": "Jeff Hillman", "author_id": 3950, "author_profile": "...
2008/09/03
[ "https://Stackoverflow.com/questions/41407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/909/" ]
41,424
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/307291/how-does-the-google-did-you-mean-algorithm-work">How does the Google “Did you mean?” Algorithm work?</a> </p> </blockquote> <p>Suppose you have a search system already in your website. How can you implem...
[ { "answer_id": 302727, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": " string = \"my haert wil go on\"\n\n string.gsub(/[\\w\\']+/) do |word|\n if !speller.check(word)\n # word is wrong\...
2008/09/03
[ "https://Stackoverflow.com/questions/41424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2644/" ]
41,449
<p>The exact error is as follows</p> <blockquote> <p>Could not load file or assembly 'Microsoft.SqlServer.Replication, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. An attempt was made to load a program with an incorrect format.</p> </blockquote> <p>I've rece...
[ { "answer_id": 2926982, "author": "bboyle1234", "author_id": 213256, "author_profile": "https://Stackoverflow.com/users/213256", "pm_score": 9, "selected": false, "text": "ChilkatDotNet2" }, { "answer_id": 4023955, "author": "Community", "author_id": -1, "author_profi...
2008/09/03
[ "https://Stackoverflow.com/questions/41449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2012/" ]
41,453
<p>I'd like to be able to introspect a C++ class for its name, contents (i.e. members and their types) etc. I'm talking native C++ here, not managed C++, which has reflection. I realise C++ supplies some limited information using RTTI. Which additional libraries (or other techniques) could supply this information?</p>
[ { "answer_id": 41865, "author": "KeithB", "author_id": 2298, "author_profile": "https://Stackoverflow.com/users/2298", "pm_score": 4, "selected": false, "text": "namespace {\n static bool b2 = Filter::Filterable<const MyObj>::Register(\"MyObject\");\n} \n\nbool MyObj::BuildMap()\n{\n F...
2008/09/03
[ "https://Stackoverflow.com/questions/41453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3233/" ]
41,469
<p>I am planning on creating a small website for my personal book collection. To automate the process a little bit, I would like to create the following functionality:</p> <p>The website will ask me for the ISBN number of the book and will then automatically fetch the title and add it to my database.</p> <p>Although ...
[ { "answer_id": 41473, "author": "Giovanni Galbo", "author_id": 4050, "author_profile": "https://Stackoverflow.com/users/4050", "pm_score": 3, "selected": false, "text": "- Cataloguing home book collections\n- Building and verifying bookstores' inventories\n- Empowering forums and online ...
2008/09/03
[ "https://Stackoverflow.com/questions/41469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2644/" ]
41,479
<p>After discussion with colleagues regarding the use of the 'var' keyword in C# 3 I wondered what people's opinions were on the appropriate uses of type inference via var?</p> <p>For example I rather lazily used var in questionable circumstances, e.g.:-</p> <pre><code>foreach(var item in someList) { // ... } // Type...
[ { "answer_id": 41486, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 6, "selected": false, "text": "foreach (var c in list) { ... }\n foreach (var customer in list) { ... }\n var x = SaveFoo(foo);\n var saveSucceeded = Sa...
2008/09/03
[ "https://Stackoverflow.com/questions/41479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3394/" ]
41,492
<p>Is it possible to determine which property of an ActiveX control is the default property? For example, what is the default property of the VB6 control CommandButton and how would I found out any other controls default!</p> <p><strong>/EDIT:</strong> Without having source to the object itself</p>
[ { "answer_id": 41612, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 1, "selected": false, "text": "Attribute Value.VB_UserMemId = 0\n" }, { "answer_id": 54239, "author": "John T", "author_id": 5553, ...
2008/09/03
[ "https://Stackoverflow.com/questions/41492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1111/" ]
41,498
<p>We recently lost a database and I want to recover the data from de Production.log.</p> <p>Every request is logged like this:</p> <p>Processing ChamadosController#create (for XXX.XXX.XXX.40 at 2008-07-30 11:07:30) [POST] Session ID: 74c865cefa0fdd96b4e4422497b828f9 Parameters: {"commit"=>"Gravar", "action"=>"cr...
[ { "answer_id": 7872075, "author": "parasew", "author_id": 298982, "author_profile": "https://Stackoverflow.com/users/298982", "pm_score": 2, "selected": false, "text": "file = File.open(\"location_of_your_production.log\", \"rb\")\ncontents = file.read\ncontents.scan(/(Started POST \\\"(...
2008/09/03
[ "https://Stackoverflow.com/questions/41498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4384/" ]
41,499
<p>In Java, static and transient fields are not serialized. However, I found out that initialization of static fields causes the generated serialVersionUID to be changed. For example, <code>static int MYINT = 3;</code> causes the serialVersionUID to change. In this example, it makes sense because different versions of ...
[ { "answer_id": 41515, "author": "Alfred B. Thordarson", "author_id": 3379, "author_profile": "https://Stackoverflow.com/users/3379", "pm_score": 0, "selected": false, "text": "serialVersionUID static int MYINT = 3 MYINT = 3 serialVersionUID serialVersionUID private static final long seri...
2008/09/03
[ "https://Stackoverflow.com/questions/41499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3150/" ]
41,513
<p>I am going to be using Subversion for source control on a new J2EE web application. What directory structure will you recommend for organizing code, tests and documentation?</p>
[ { "answer_id": 41524, "author": "Mendelt", "author_id": 3320, "author_profile": "https://Stackoverflow.com/users/3320", "pm_score": 4, "selected": false, "text": "/project\n /trunk\n /src\n /doc\n /...\n /branches\n /feature1\n /src\n ...
2008/09/03
[ "https://Stackoverflow.com/questions/41513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
41,525
<p>If not, what are the significant differences?</p> <hr> <p><strong>Edit:</strong> Daren Thomas asks:</p> <blockquote> <p>which ones?</p> <p>I use gvim on Windows and MacVim on the mac. Seem similar enough to be the same to me...</p> </blockquote> <p>By which ones, I'm guessing that you mean a specific impl...
[ { "answer_id": 41529, "author": "Daren Thomas", "author_id": 2260, "author_profile": "https://Stackoverflow.com/users/2260", "pm_score": 0, "selected": false, "text": "gvim MacVim" }, { "answer_id": 41545, "author": "Daren Thomas", "author_id": 2260, "author_profile":...
2008/09/03
[ "https://Stackoverflow.com/questions/41525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
41,547
<p>I am working on a small intranet site for a small company, where user should be able to post. I have imagined a very simple authentication mechanism where people just enter their email address, and gets sent a unique login url, that sets a cookie that will always identify them for future requests.</p> <p>In my temp...
[ { "answer_id": 41555, "author": "David Webb", "author_id": 3171, "author_profile": "https://Stackoverflow.com/users/3171", "pm_score": 2, "selected": false, "text": "request.user authenticate() login() locals() request request.user" }, { "answer_id": 269249, "author": "zalun"...
2008/09/03
[ "https://Stackoverflow.com/questions/41547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3355/" ]
41,561
<p>I'm trying to understand how namespaces work in XML. When I have an element like foo:bar, the attributes will often not have namespaces on them. But sometimes they will. Are the attribute in the namespace of the element, even when the default namespace has been declared? Looking over the xsd for xhtml it seems the a...
[ { "answer_id": 43226, "author": "jelovirt", "author_id": 2679, "author_profile": "https://Stackoverflow.com/users/2679", "pm_score": 4, "selected": false, "text": "<bar xmlns:foo=\"http://www.foo.com/\"\n foo:baz=\"baz\"\n qux=\"qux\"/>\n<bar xmlns=\"http://www.foo.com/\" xmlns:foo...
2008/09/03
[ "https://Stackoverflow.com/questions/41561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4315/" ]
41,568
<p>this kind of follows on from another <a href="https://stackoverflow.com/questions/41290/file-access-strategy-in-a-multi-threaded-environment-web-app">question</a> of mine.</p> <p>Basically, once I have the code to access the file (will review the answers there in a minute) what would be the best way to <strong>test<...
[ { "answer_id": 41589, "author": "Anthony Mastrean", "author_id": 3619, "author_profile": "https://Stackoverflow.com/users/3619", "pm_score": 5, "selected": true, "text": "ThreadPool ManualResetEvent AutoResetEvent ThreadStart public static void MultiThreadedTest()\n{\n Thread[] thread...
2008/09/03
[ "https://Stackoverflow.com/questions/41568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/832/" ]
41,590
<p>I come from a Java background, where packages are used, not namespaces. I'm used to putting classes that work together to form a complete object into packages, and then reusing them later from that package. But now I'm working in C++.</p> <p>How do you use namespaces in C++? Do you create a single namespace for the...
[ { "answer_id": 41598, "author": "Mark Ingram", "author_id": 986, "author_profile": "https://Stackoverflow.com/users/986", "pm_score": 8, "selected": true, "text": "namespace MyNamespace\n{\n class MyClass\n {\n };\n}\n MyNamespace::MyClass* pClass = new MyNamespace::MyClass();\n using...
2008/09/03
[ "https://Stackoverflow.com/questions/41590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1585/" ]
41,594
<p>I have a table in an access table which contains Product entries, one of the columns has a jpg image stored as an OLE Object. I am trying to import this table to MySQL but nothing seems to work. I have tried the MySQL migration tool but that has a known issue with Access and OLE Objects. (The issue being it does...
[ { "answer_id": 41985, "author": "SecretDeveloper", "author_id": 2720, "author_profile": "https://Stackoverflow.com/users/2720", "pm_score": 3, "selected": true, "text": " Private Function GetImageFromRow(ByRef row As DataRowView, ByVal columnName As String) As Bitmap\n Dim oImage A...
2008/09/03
[ "https://Stackoverflow.com/questions/41594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2720/" ]
41,630
<p>I would like to execute an OS command from my ruby script but I want to add an argument from a ruby variable.</p> <p>I know that's possible by using keyword <em>system</em> like that :</p> <pre><code>#!/usr/bin/env ruby directory = '/home/paulgreg/' system 'ls ' + directory </code></pre> <p>but is that possible b...
[ { "answer_id": 41635, "author": "Jordi Bunster", "author_id": 4272, "author_profile": "https://Stackoverflow.com/users/4272", "pm_score": 4, "selected": true, "text": "ls directory #!/usr/bin/env ruby\ndirectory = '/home/paulgreg/'\n`ls #{directory}`\n" }, { "answer_id": 41892, ...
2008/09/03
[ "https://Stackoverflow.com/questions/41630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3122/" ]
41,638
<p>The current system that I am working on makes use of Castle Activerecord to provide ORM (Object Relational Mapping) between the Domain objects and the database. This is all well and good and at most times actually works well!</p> <p>The problem comes about with Castle Activerecords support for asynchronous executio...
[ { "answer_id": 169708, "author": "ZeroBugBounce", "author_id": 11314, "author_profile": "https://Stackoverflow.com/users/11314", "pm_score": 3, "selected": false, "text": "public static T ChangeType<S, T>(this S source) where T : class, new()\n public static T ChangeType<S, T>(this S sou...
2008/09/03
[ "https://Stackoverflow.com/questions/41638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/231/" ]
41,640
<p>I am in need of a way to mute a specific application in Vista.</p> <p>Example: Mute just Firefox, but not all of the other application. Much similar to muting a specific program from within the volume mixer in vista. </p> <p>If there is a program that will do this, i would appreciate that. Otherwise if there is ...
[ { "answer_id": 29990633, "author": "Devin", "author_id": 4854726, "author_profile": "https://Stackoverflow.com/users/4854726", "pm_score": 0, "selected": false, "text": "#NoEnv ;// Recommended for new scripts\n#Persistent ;// Recommended for new scripts\nSendMode Input ;// Recommended f...
2008/09/03
[ "https://Stackoverflow.com/questions/41640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4394/" ]
41,647
<p>When using the php include function the include is succesfully executed, but it is also outputting a char before the output of the include is outputted, the char is of hex value 3F and I have no idea where it is coming from, although it seems to happen with every include. </p> <p>At first I thbought it was file enc...
[ { "answer_id": 41655, "author": "Thomas Owens", "author_id": 572, "author_profile": "https://Stackoverflow.com/users/572", "pm_score": 0, "selected": false, "text": "hello, world" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/41647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1111/" ]
41,652
<p>We have got a custom <code>MembershipProvider</code> in <code>ASP.NET</code>. Now there are 2 possible scenario the user can be validated:</p> <ol> <li><p>User login via <code>login.aspx</code> page by entering his username/password. I have used <strong>Login control</strong> and linked it with the <code>MyMembersh...
[ { "answer_id": 42151, "author": "JasonS", "author_id": 1865, "author_profile": "https://Stackoverflow.com/users/1865", "pm_score": 2, "selected": false, "text": "FormsAuthenticationTicket if (provider != null) {\n if (provider.ValidateUser(ticket)) {\n // Login Success\n ...
2008/09/03
[ "https://Stackoverflow.com/questions/41652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191/" ]
41,659
<p>Is there any way in the Servlet API to access properties specified in web.xml (such as initialization parameters) from within a Bean or Factory class that is not associated at all with the web container?</p> <p>For example, I'm writing a Factory class, and I'd like to include some logic within the Factory to check ...
[ { "answer_id": 41814, "author": "toolkit", "author_id": 3295, "author_profile": "https://Stackoverflow.com/users/3295", "pm_score": 4, "selected": true, "text": "public class FactoryInitialisingServletContextListener implements ServletContextListener {\n\n public void contextDestroyed...
2008/09/03
[ "https://Stackoverflow.com/questions/41659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4249/" ]
41,665
<p>Is there any way to convert a bmp image to jpg/png without losing the quality in C#? Using Image class we can convert bmp to jpg but the quality of output image is very poor. Can we gain the quality level as good as an image converted to jpg using photoshop with highest quality?</p>
[ { "answer_id": 41672, "author": "GateKiller", "author_id": 383, "author_profile": "https://Stackoverflow.com/users/383", "pm_score": 0, "selected": false, "text": "Bitmap.InterpolationMode = InterpolationMode.HighQualityBicubic;\n Bitmap.CompositingQuality = CompositingQuality.HighQualit...
2008/09/03
[ "https://Stackoverflow.com/questions/41665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191/" ]
41,674
<p>In Visual Studio you can create a template XML document from an existing schema. The new <a href="http://msdn.microsoft.com/en-us/library/cc716766.aspx" rel="noreferrer">XML Schema Explorer</a> in VS2008 SP1 takes this a stage further and can create a sample XML document complete with data. Is there a class library ...
[ { "answer_id": 245461, "author": "Andrew Theken", "author_id": 32238, "author_profile": "https://Stackoverflow.com/users/32238", "pm_score": 3, "selected": false, "text": "DataSet ds = new DataSet();\nds.ReadXmlSchema(\"c:/xsdfile.xsd\");\n\nforeach(DataTable t in ds.Tables)\n{\nvar row ...
2008/09/03
[ "https://Stackoverflow.com/questions/41674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3873/" ]
41,686
<p>I've got some Java code using a servlet and Apache Commons FileUpload to upload a file to a set directory. It's working fine for character data (e.g. text files) but image files are coming out garbled. I can open them but the image doesn't look like it should. Here's my code:</p> <p>Servlet</p> <pre><code>protec...
[ { "answer_id": 41748, "author": "Ben", "author_id": 1417, "author_profile": "https://Stackoverflow.com/users/1417", "pm_score": 0, "selected": false, "text": "getBytes() doPost() byte[] bytes = StreamUtils.getBytes(stream);\n public static byte[] getBytes(InputStream src, int buffsize)\n...
2008/09/03
[ "https://Stackoverflow.com/questions/41686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1900/" ]
41,699
<p>So creating a Windows service using Visual Studio is fairly trivial. My question goes a bit deeper as to what actually makes an executable installable as a service &amp; how to write a service as a straight C application. I couldn't find a lot of references on this, but I'm presuming there has to be some interface...
[ { "answer_id": 43161, "author": "Ferruccio", "author_id": 4086, "author_profile": "https://Stackoverflow.com/users/4086", "pm_score": 2, "selected": false, "text": "SERVICE_TABLE_ENTRY ServiceStartTable[] =\n{\n { \"ServiceName\", ServiceMain },\n { 0, 0 }\n};\n\nif (!StartServiceCtr...
2008/09/03
[ "https://Stackoverflow.com/questions/41699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/634/" ]
41,701
<p>I have a method in my Python code that returns a tuple - a row from a SQL query. Let's say it has three fields: (jobId, label, username)</p> <p>For ease of passing it around between functions, I've been passing the entire tuple as a variable called 'job'. Eventually, however, I want to get at the bits, so I've been...
[ { "answer_id": 41707, "author": "Chris Upchurch", "author_id": 2600, "author_profile": "https://Stackoverflow.com/users/2600", "pm_score": 5, "selected": true, "text": "job={}\njob['jobid'], job['label'], job['username']=<querycode>\n" }, { "answer_id": 41709, "author": "dF."...
2008/09/03
[ "https://Stackoverflow.com/questions/41701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397/" ]
41,715
<p>Right now I'm working with an ASP.NET website that automatically generates images and stores them in a temporary folder. When working on my local system these go going into a temporary folder that gets picked up by Visual Source Safe which then wants to check them in. As such, I am wondering if there is a way to jus...
[ { "answer_id": 778985, "author": "Min", "author_id": 14461, "author_profile": "https://Stackoverflow.com/users/14461", "pm_score": 0, "selected": false, "text": "C:\\tempfiles" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/41715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1185/" ]
41,717
<p>Like many others on this site I am considering a move to ASP.NET MVC for future projects. Currently my sites are running the traditional ASP.NET 2.0 Web Forms, and it works OK for us, so my other option is just to stick with what I know and make the move to ASP.NET 3.5 with the integrated AJAX stuff.</p> <p>I'm wo...
[ { "answer_id": 41722, "author": "Nick Berardi", "author_id": 17, "author_profile": "https://Stackoverflow.com/users/17", "pm_score": 4, "selected": true, "text": "<% Html.RenderPartial(\"~/Views/Shared/MyControl.ascx\", {data model object}) %>\n <%= Html.RenderUserControl(\"~/Views/Share...
2008/09/03
[ "https://Stackoverflow.com/questions/41717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1219/" ]
41,724
<p>I'm hearing more and more about domain specific languages being thrown about and how they change the way you treat business logic, and I've seen <a href="http://ayende.com/blog/tags/domain-specific-languages" rel="noreferrer">Ayende's blog posts</a> and things, but I've never really gotten exactly why I would take m...
[ { "answer_id": 41742, "author": "Staale", "author_id": 3355, "author_profile": "https://Stackoverflow.com/users/3355", "pm_score": 1, "selected": false, "text": "NewsDAO.writtenBy(\"someUser\").before(\"someDate\").updateStatus(\"Deleted\")\n" }, { "answer_id": 41743, "author...
2008/09/03
[ "https://Stackoverflow.com/questions/41724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3717/" ]
41,733
<p>Say I have an array of records which I want to sort based on one of the fields in the record. What's the best way to achieve this?</p> <pre><code>TExample = record SortOrder : integer; SomethingElse : string; end; var SomeVar : array of TExample; </code></pre>
[ { "answer_id": 41951, "author": "Barry Kelly", "author_id": 3712, "author_profile": "https://Stackoverflow.com/users/3712", "pm_score": 6, "selected": true, "text": "TList TList.Sort IComparer<TExample> TArray.Sort<TExample>(SomeVar , TDelegatedComparer<TExample>.Construct(\n function(c...
2008/09/03
[ "https://Stackoverflow.com/questions/41733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1008/" ]
41,763
<p>What is the best way to calculate Age using Flex?</p>
[ { "answer_id": 41845, "author": "Richard Braxton", "author_id": 4393, "author_profile": "https://Stackoverflow.com/users/4393", "pm_score": 4, "selected": false, "text": "private function getYearsOld(dob:Date):uint { \n var now:Date = new Date(); \n var yearsOld:uint = Number(now...
2008/09/03
[ "https://Stackoverflow.com/questions/41763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4393/" ]
41,766
<p>I just saw a really cool WPF twitter client that I think is developed by the Herding Code podcast guys <a href="http://www.herdingcode.com/" rel="noreferrer">HerdingCode</a> called <a href="http://code.google.com/p/wittytwitter/" rel="noreferrer">Witty</a>. (or at least, I see a lot of those guys using this client)...
[ { "answer_id": 41771, "author": "jodonnell", "author_id": 4223, "author_profile": "https://Stackoverflow.com/users/4223", "pm_score": 4, "selected": false, "text": "svn checkout http://wittytwitter.googlecode.com/svn/trunk\n" }, { "answer_id": 41774, "author": "Tim Howland", ...
2008/09/03
[ "https://Stackoverflow.com/questions/41766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2858/" ]
41,781
<p>I've worked with T-SQL for years but I've just moved to an organisation that is going to require writing some Oracle stuff, probably just simple CRUD operations at least until I find my feet. I'm not going to be migrating databases from one to the other simply interacting with existing Oracle databases from an Appli...
[ { "answer_id": 54420302, "author": "Lukas Eder", "author_id": 521799, "author_profile": "https://Stackoverflow.com/users/521799", "pm_score": 0, "selected": false, "text": "$ java -cp jooq-3.11.9.jar org.jooq.ParserCLI -t ORACLE -s \"SELECT substring('abcde', 2, 3)\"\nselect substr('abcd...
2008/09/03
[ "https://Stackoverflow.com/questions/41781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4403/" ]
41,792
<p>I am re-factoring some code and am wondering about the use of a <code>lock</code> in the instance constructor.</p> <pre><code>public class MyClass { private static Int32 counter = 0; private Int32 myCount; public MyClass() { lock(this) { counter++; myCount = counter; ...
[ { "answer_id": 41801, "author": "Nick Berardi", "author_id": 17, "author_profile": "https://Stackoverflow.com/users/17", "pm_score": 2, "selected": false, "text": "private static int counter = 0;\nprivate static object counterLock = new Object();\n\nlock(counterLock) {\n counter++;\n ...
2008/09/03
[ "https://Stackoverflow.com/questions/41792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3619/" ]
41,796
<p>I'm looking for a quality WinForms component that supports syntax highlighting, code folding and the like. The key criteria are:</p> <ol> <li>Stability </li> <li>Value (price)</li> <li>Ability to easily customize syntax to highlight</li> <li>Light weight</li> </ol>
[ { "answer_id": 16391867, "author": "Jeremy Thompson", "author_id": 495455, "author_profile": "https://Stackoverflow.com/users/495455", "pm_score": 2, "selected": false, "text": "public Form1()\n{\nInitializeComponent();\nICSharpCode.AvalonEdit.TextEditor te = new ICSharpCode.AvalonEdit.T...
2008/09/03
[ "https://Stackoverflow.com/questions/41796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4398/" ]
41,824
<p>I'm using Microsoft AjaxControlToolkit for modal popup window.</p> <p>And on a modal popup window, when a postback occurred, the window was closing. How do I prevent from the closing action of the modal popup?</p>
[ { "answer_id": 41910, "author": "Ricky Supit", "author_id": 4191, "author_profile": "https://Stackoverflow.com/users/4191", "pm_score": 3, "selected": false, "text": "Show() MyModalPopoupExtender.Show()\n" }, { "answer_id": 42188, "author": "Jon Erickson", "author_id": 19...
2008/09/03
[ "https://Stackoverflow.com/questions/41824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4215/" ]
41,836
<p>I have tried both of :</p> <pre><code>ini_set('include_path', '.:/usr/share/php5:/usr/share/php5/PEAR:lib:app/classes'); </code></pre> <p>and also :</p> <pre><code>php_value include_path ".:/usr/share/php5:/usr/share/php5/PEAR:lib:app/classes" </code></pre> <p>in the .htaccess file.</p> <p>Both methods actually...
[ { "answer_id": 42336, "author": "Ian", "author_id": 4396, "author_profile": "https://Stackoverflow.com/users/4396", "pm_score": 2, "selected": false, "text": "PATH_SEPARATOR set_include_path('.' . PATH_SEPARATOR . './app/lib' . PATH_SEPARATOR . get_include_path());\n" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/41836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319/" ]
41,842
<p>When should I include PDB files for a production release? Should I use the <code>Optimize code</code> flag and how would that affect the information I get from an exception?</p> <p>If there is a noticeable performance benefit I would want to use the optimizations but if not I'd rather have accurate debugging info. ...
[ { "answer_id": 96261, "author": "HTTP 410", "author_id": 13118, "author_profile": "https://Stackoverflow.com/users/13118", "pm_score": 4, "selected": false, "text": "[.NET Framework Debugging Control]\nGenerateTrackingInfo=0\nAllowOptimize=1\n [.NET Framework Debugging Control]\nGenerate...
2008/09/03
[ "https://Stackoverflow.com/questions/41842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3615/" ]
41,869
<p>If I run the following query in SQL Server 2000 Query Analyzer:</p> <pre><code>BULK INSERT OurTable FROM 'c:\OurTable.txt' WITH (CODEPAGE = 'RAW', DATAFILETYPE = 'char', FIELDTERMINATOR = '\t', ROWS_PER_BATCH = 10000, TABLOCK) </code></pre> <p>On a text file that conforms to OurTable's schema for 40 lines, but ...
[ { "answer_id": 152695, "author": "Josef", "author_id": 5581, "author_profile": "https://Stackoverflow.com/users/5581", "pm_score": 6, "selected": true, "text": "BULK INSERT INSERT BEGIN TRANSACTION\nBEGIN TRY\nBULK INSERT OurTable \nFROM 'c:\\OurTable.txt' \nWITH (CODEPAGE = 'RAW', DATA...
2008/09/03
[ "https://Stackoverflow.com/questions/41869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2831/" ]
41,881
<p>I am using the <code>ODBC</code> connector to access a MySQL db from Visual Studio 2008 and I'm facing performance problems when dealing with crystal reports and to solve this I need a native connector to visual studio. If someone has had a similar problem and knows a solution or tools (freeware preferable), I would...
[ { "answer_id": 2738330, "author": "Fabio", "author_id": 329018, "author_profile": "https://Stackoverflow.com/users/329018", "pm_score": 1, "selected": false, "text": "Mysql.Data.dll dll Bin" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/41881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
41,894
<p>Is there a way to find the name of the program that is running in Java? The class of the main method would be good enough.</p>
[ { "answer_id": 41904, "author": "jodonnell", "author_id": 4223, "author_profile": "https://Stackoverflow.com/users/4223", "pm_score": 7, "selected": true, "text": " StackTraceElement[] stack = Thread.currentThread ().getStackTrace ();\n StackTraceElement main = stack[stack.length -...
2008/09/03
[ "https://Stackoverflow.com/questions/41894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/823/" ]
41,925
<p>What is a good data structure for storing phone numbers in database fields? I'm looking for something that is flexible enough to handle international numbers, and also something that allows the various parts of the number to be queried efficiently.</p> <p><strong>Edit:</strong> Just to clarify the use case here: I...
[ { "answer_id": 41982, "author": "Adam Davis", "author_id": 2915, "author_profile": "https://Stackoverflow.com/users/2915", "pm_score": 7, "selected": true, "text": "vanity (800) Lucky-Guy" }, { "answer_id": 42028, "author": "jcoby", "author_id": 2884, "author_profile"...
2008/09/03
[ "https://Stackoverflow.com/questions/41925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1219/" ]
41,928
<p>I have just received and bypassed a problem with LightWindow and IE7 where, on page load, it throws a JavaScript error on line 444 of <code>lightwindow.js</code>, claiming that the <code>object does not support this property or method</code>. Despite finding various postings on various forums, no Google result I cou...
[ { "answer_id": 47224, "author": "John Boker", "author_id": 2847, "author_profile": "https://Stackoverflow.com/users/2847", "pm_score": 1, "selected": false, "text": "if( this && this._getGalleryInfo )\n{\n //use the function\n\n}\n if(this && this.element && this.element.rel) _getGall...
2008/09/03
[ "https://Stackoverflow.com/questions/41928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192/" ]
41,934
<p>When I do a file search on eclipse it includes the <code>.svn</code> directories by default. I tried excluding them from the build path but they still appear on file search results.</p>
[ { "answer_id": 41959, "author": "Mark Ingram", "author_id": 986, "author_profile": "https://Stackoverflow.com/users/986", "pm_score": 3, "selected": false, "text": ".svn" }, { "answer_id": 354675, "author": "Community", "author_id": -1, "author_profile": "https://Stac...
2008/09/03
[ "https://Stackoverflow.com/questions/41934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/823/" ]
41,937
<p>I need to convert latitude/longitude coordinates into Easting/Northing coordinates in the Alberta 10 TM Projection.</p> <p>The 10 TM projection is similar to UTM, but it is a custom projection for the province of Alberta, Canada. I think (with some effort) I could code it myself but would rather not reinvent the w...
[ { "answer_id": 1143731, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "MapWindow" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/41937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1958/" ]
41,948
<p>I'm creating an application which lets you define events with a time frame. I want to automatically fill in the end date when the user selects or changes the start date. I can't quite figure out, however, how to get the difference between the two times, and then how to create a new end Date using that difference.<...
[ { "answer_id": 41960, "author": "Vincent Robert", "author_id": 268, "author_profile": "https://Stackoverflow.com/users/268", "pm_score": 7, "selected": true, "text": "getTime() var oldBegin = ...\nvar oldEnd = ...\nvar newBegin = ...\n\nvar newEnd = new Date(newBegin + oldEnd - oldBegin)...
2008/09/03
[ "https://Stackoverflow.com/questions/41948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2688/" ]
41,969
<p>I want to open a folder window, in the appropriate file manager, from within a cross-platform (windows/mac/linux) Python application.</p> <p>On OSX, I can open a window in the finder with</p> <pre><code>os.system('open "%s"' % foldername) </code></pre> <p>and on Windows with</p> <pre><code>os.startfile(foldernam...
[ { "answer_id": 42046, "author": "pixelbeat", "author_id": 4421, "author_profile": "https://Stackoverflow.com/users/4421", "pm_score": 5, "selected": true, "text": "os.system('xdg-open \"%s\"' % foldername)\n xdg-open" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/41969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3002/" ]
42,017
<p>I am looking for simple straightforward solution for accessing EXIF information of jpeg images in .Net. Does anybody has experience with this?</p>
[ { "answer_id": 2707506, "author": "Rowland Shaw", "author_id": 50447, "author_profile": "https://Stackoverflow.com/users/50447", "pm_score": 3, "selected": false, "text": "BitmapSource Metadata" }, { "answer_id": 31329551, "author": "Drew Noakes", "author_id": 24874, ...
2008/09/03
[ "https://Stackoverflow.com/questions/42017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2361/" ]
42,034
<p>I am learning Python for a class now, and we just covered tuples as one of the data types. I read the Wikipedia page on it, but, I could not figure out where such a data type would be useful in practice. Can I have some examples, perhaps in Python, where an immutable set of numbers would be needed? How is this diffe...
[ { "answer_id": 42052, "author": "sphereinabox", "author_id": 2775, "author_profile": "https://Stackoverflow.com/users/2775", "pm_score": 4, "selected": false, "text": "a = {}\na[(1,2,\"bob\")] = \"hello!\"\na[(\"Hello\",\"en-US\")] = \"Hi There!\"\n" }, { "answer_id": 39638334, ...
2008/09/03
[ "https://Stackoverflow.com/questions/42034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/577/" ]
42,068
<p>I've generated some JSON and I'm trying to pull it into an object in JavaScript. I keep getting errors. Here's what I have:</p> <pre><code>var data = '{"count" : 1, "stack" : "sometext\n\n"}'; var dataObj = eval('('+data+')'); </code></pre> <p>This gives me an error: </p> <pre><code>unterminated string literal </...
[ { "answer_id": 42073, "author": "BlaM", "author_id": 999, "author_profile": "https://Stackoverflow.com/users/999", "pm_score": 10, "selected": true, "text": "var data = '{\"count\" : 1, \"stack\" : \"sometext\\\\n\\\\n\"}';\n \\ \\" }, { "answer_id": 1111538, "author": "Ron",...
2008/09/03
[ "https://Stackoverflow.com/questions/42068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3636/" ]
42,070
<p>What's going on here?</p> <p>printf.sh:</p> <pre><code>#! /bin/sh NAME="George W. Bush" printf "Hello, %s\n" $NAME </code></pre> <p>Command line session:</p> <pre><code>$ ./printf.sh Hello, George Hello, W. Hello, Bush </code></pre> <p>UPDATE: <code>printf "Hello, %s\n" "$NAME"</code> works. For why I'm not usi...
[ { "answer_id": 42089, "author": "Tanj", "author_id": 4275, "author_profile": "https://Stackoverflow.com/users/4275", "pm_score": 1, "selected": false, "text": "NAME=\"George W. Bush\"\necho \"Hello, \"$NAME\n Hello, George W. Bush\n printf \"Hello, %s\\n\" \"$NAME\"\n" }, { "answ...
2008/09/03
[ "https://Stackoverflow.com/questions/42070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412/" ]
42,076
<p><strong>What mechanisms do you know that prevent your site from being abused by anonymous spammers.</strong></p> <p>For example, let's say that I have a site where people can vote something. But I <em>don't</em> want someone to spam something all the way to the top. So I found (a) creating an account and only allow...
[ { "answer_id": 895737, "author": "DisgruntledGoat", "author_id": 37947, "author_profile": "https://Stackoverflow.com/users/37947", "pm_score": 2, "selected": false, "text": "style=\"display:none\"" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/42076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2644/" ]
42,102
<p>I have a Singleton/Factory object that I'd like to write a JUnit test for. The Factory method decides which implementing class to instantiate based upon a classname in a properties file on the classpath. If no properties file is found, or the properties file does not contain the classname key, then the class will in...
[ { "answer_id": 42130, "author": "Cem Catikkas", "author_id": 3087, "author_profile": "https://Stackoverflow.com/users/3087", "pm_score": 2, "selected": false, "text": "myClassImpl instantiateMyClass()" }, { "answer_id": 9192126, "author": "AutomatedMike", "author_id": 352...
2008/09/03
[ "https://Stackoverflow.com/questions/42102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4249/" ]
42,115
<p>I am running into an issue I had before; can't find my reference on how to solve it.</p> <p>Here is the issue. We encrypt the connection strings section in the app.config for our client application using code below:</p> <pre><code> config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.No...
[ { "answer_id": 373205, "author": "MikeScott8", "author_id": 1889, "author_profile": "https://Stackoverflow.com/users/1889", "pm_score": 2, "selected": true, "text": "aspnet_regiis -pa \"NetFrameworkConfigurationKey\" \"{domain}\\{user}\"\n" }, { "answer_id": 2702297, "author"...
2008/09/03
[ "https://Stackoverflow.com/questions/42115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1889/" ]
42,125
<p>I have a library I created,</p> <h3>File <em>mylib.c:</em></h3> <pre><code>#include &lt;mylib.h&gt; int testlib() { printf(&quot;Hello, World!\n&quot;); return (0); } </code></pre> <h3>File <em>mylib.h:</em></h3> <pre><code>#include &lt;stdio.h&gt; extern int testlib(); </code></pre> <p>In my program, I've ...
[ { "answer_id": 42133, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 5, "selected": false, "text": "extern int testlib(void);\n" }, { "answer_id": 47693, "author": "Pramod", "author_id": 1386292, "a...
2008/09/03
[ "https://Stackoverflow.com/questions/42125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3807/" ]
42,126
<p>I am getting C++ Compiler error C2371 when I include a header file that itself includes odbcss.h. My project is set to MBCS.</p> <blockquote> <p>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\odbcss.h(430) : error C2371: 'WCHAR' : redefinition; different basic types 1><br> C:\Program Files\Microsoft SD...
[ { "answer_id": 42207, "author": "John Boker", "author_id": 2847, "author_profile": "https://Stackoverflow.com/users/2847", "pm_score": 0, "selected": false, "text": "#define WIN16 #include \"wab.h\" #undef WIN16" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/42126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3114/" ]
42,146
<p>This is an adapted version of a question from someone in my office. She's trying to determine how to tell what ports MSDE is running on for an application we have in the field.</p> <p>Answers to that narrower question would be greatly appreciated. I'm also interested in a broader answer that could be applied to a...
[ { "answer_id": 42152, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "https://Stackoverflow.com/users/1288", "pm_score": 4, "selected": false, "text": "netstat -b\n" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/42146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3475/" ]
42,150
<p>.NET Framework: 2.0 Preferred Language: C#</p> <p>I am new to TDD (Test Driven Development).</p> <p>First of all, is it even possible to unit test Windows Service?</p> <p>Windows service class is derived from ServiceBase, which has overridable methods, </p> <ol> <li>OnStart </li> <li>OnStop</li> </ol> <p>How ca...
[ { "answer_id": 42155, "author": "David Basarab", "author_id": 2469, "author_profile": "https://Stackoverflow.com/users/2469", "pm_score": 3, "selected": false, "text": "public static void StartService(string serviceName, int timeoutMilliseconds)\n{\n ServiceController service = new Serv...
2008/09/03
[ "https://Stackoverflow.com/questions/42150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4035/" ]
42,153
<p>I searched for this subject on Google and got some website about an experts exchange...so I figured I should just ask here instead.</p> <p>How do you embed a <code>JApplet</code> in HTML on a webpage?</p>
[ { "answer_id": 42163, "author": "Mike Stone", "author_id": 122, "author_profile": "https://Stackoverflow.com/users/122", "pm_score": 4, "selected": true, "text": "<applet code=\"TumbleItem.class\" \n codebase=\"examples/\"\n archive=\"tumbleClasses.jar, tumbleImages.jar\"\n...
2008/09/03
[ "https://Stackoverflow.com/questions/42153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2598/" ]
42,169
<p>I converted my company's calendar to XSL and changed all the tables to divs. It worked pretty well, but I had a lot of 8 day week bugs to work out initially owing to precarious cross-browser spacing issues. But I was reading another post regarding when to use tables v. divs and the consensus seemed to be that you sh...
[ { "answer_id": 42183, "author": "automatic", "author_id": 3854, "author_profile": "https://Stackoverflow.com/users/3854", "pm_score": 1, "selected": false, "text": "<table>" } ]
2008/09/03
[ "https://Stackoverflow.com/questions/42169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1765/" ]
42,182
<p>I'm trying to write a blog post which includes a code segment inside a <code>&lt;pre&gt;</code> tag. The code segment includes a generic type and uses <code>&lt;&gt;</code> to define that type. This is what the segment looks like:</p> <pre><code>&lt;pre&gt; PrimeCalc calc = new PrimeCalc(); Func&lt;int, int...
[ { "answer_id": 42191, "author": "toolkit", "author_id": 3295, "author_profile": "https://Stackoverflow.com/users/3295", "pm_score": 3, "selected": false, "text": "&lt; and &gt;\n" }, { "answer_id": 42192, "author": "ckpwong", "author_id": 2551, "author_profile": "http...
2008/09/03
[ "https://Stackoverflow.com/questions/42182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373/" ]