qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
168,924
<p>Let's say I've got two strings in JavaScript:</p> <pre><code>var date1 = '2008-10-03T20:24Z' var date2 = '2008-10-04T12:24Z' </code></pre> <p>How would I come to a result like so:</p> <pre><code>'4 weeks ago' </code></pre> <p>or</p> <pre><code>'in about 15 minutes' </code></pre> <p>(should support past and fut...
[ { "answer_id": 169009, "author": "moonshadow", "author_id": 11834, "author_profile": "https://Stackoverflow.com/users/11834", "pm_score": 4, "selected": true, "text": " function humane_date(date_str){\n var time_formats = [\n [60, 'Just Now'],\n [90, '1 Minute'], ...
2008/10/03
[ "https://Stackoverflow.com/questions/168924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22468/" ]
168,926
<p>Ok, I'm using the term "Progressive Enhancement" kind of loosely here but basically I have a Flash-based website that supports deep linking and loads content dynamically - what I'd like to do is provide alternate content (text) for those either not having Flash and for search engine bots. So, for a user with flash t...
[ { "answer_id": 169009, "author": "moonshadow", "author_id": 11834, "author_profile": "https://Stackoverflow.com/users/11834", "pm_score": 4, "selected": true, "text": " function humane_date(date_str){\n var time_formats = [\n [60, 'Just Now'],\n [90, '1 Minute'], ...
2008/10/03
[ "https://Stackoverflow.com/questions/168926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3435/" ]
168,931
<p>When you guys are unit testing an application that relies on values from an app.config file? How do you test that those values are read in correctly and how your program reacts to incorrect values entered into a config file?</p> <p>It would be ridiculous to have to modify the config file for the NUnit app, but I c...
[ { "answer_id": 168936, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 4, "selected": false, "text": "app.config ConfigurationManager" }, { "answer_id": 255712, "author": "Community", "author_id": -1, ...
2008/10/03
[ "https://Stackoverflow.com/questions/168931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7856/" ]
168,946
<p>Here's my scenario. I created an application which uses Integrated Windows Authentication in order to work. In <code>Application_AuthenticateRequest()</code>, I use <code>HttpContext.Current.User.Identity</code> to get the current <code>WindowsPrincipal</code> of the user of my website.</p> <p>Now here's the funn...
[ { "answer_id": 7685602, "author": "Grhm", "author_id": 204690, "author_profile": "https://Stackoverflow.com/users/204690", "pm_score": 6, "selected": true, "text": "LookupAccountName()\n\nLookupAccountSid()\n\nLsaOpenPolicy()\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/168946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24995/" ]
168,951
<hr /> <p><strong> The <a href="http://docs.php.net/manual/en/class.httprequestpool.php" rel="noreferrer">HttpRequestPool</a> class provides a solution. Many thanks to those who pointed this out.</p> <p>A brief tutorial can be found at: <a href="http://www.phptutorial.info/?HttpRequestPool-construct" rel="noreferrer"...
[ { "answer_id": 195806, "author": "Willem", "author_id": 15447, "author_profile": "https://Stackoverflow.com/users/15447", "pm_score": 2, "selected": false, "text": "$request_list = array(\n # address => http request string\n #\n '127.0.0.1' => \"HTTP/1.1 GET /index.html\\nServer: we...
2008/10/03
[ "https://Stackoverflow.com/questions/168951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5343/" ]
168,956
<p>I need a (php) regex to match Yahoo's username rules:</p> <blockquote> <p>Use 4 to 32 characters and start with a letter. You may use letters, numbers, underscores, and one dot (.).</p> </blockquote>
[ { "answer_id": 168965, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 2, "selected": false, "text": "[A-Za-z][A-Za-z0-9_.]{3,31}\n" }, { "answer_id": 168971, "author": "Randy", "author_id": 9361, "au...
2008/10/03
[ "https://Stackoverflow.com/questions/168956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24999/" ]
168,961
<p>I'm trying to add the lucene sandbox contribution called <a href="http://lucene.apache.org/java/docs/lucene-sandbox/index.html#Term%20Highlighter" rel="nofollow noreferrer">term-highlighter</a> to my pom.xml. I'm not really that familiar with Maven, but the code has a <a href="http://svn.apache.org/repos/asf/lucene/...
[ { "answer_id": 168990, "author": "Sam Merrell", "author_id": 782, "author_profile": "https://Stackoverflow.com/users/782", "pm_score": 1, "selected": false, "text": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schema...
2008/10/03
[ "https://Stackoverflow.com/questions/168961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/459/" ]
168,963
<p>I have the following code making a GET request on a URL:</p> <pre><code>$('#searchButton').click(function() { $('#inquiry').load('/portal/?f=searchBilling&amp;pid=' + $('#query').val()); }); </code></pre> <p>But the returned result is not always reflected. For example, I made a change in the respon...
[ { "answer_id": 168972, "author": "Lou Franco", "author_id": 3937, "author_profile": "https://Stackoverflow.com/users/3937", "pm_score": 5, "selected": false, "text": "$('#inquiry').load('/portal/?f=searchBilling&pid=' + $('#query').val()+'&uid='+uniqueId());\n" }, { "answer_id": ...
2008/10/03
[ "https://Stackoverflow.com/questions/168963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/204/" ]
168,979
<p>In C++, static library A is linked into dynamic libraries B and C. If a class, Foo, is used in A which is defined in B, will C link if it doesn't use Foo?</p> <p>I thought the answer was yes, but I am now running into a problem with xlc_r7 where library C says Foo is an undefined symbol, which it is as far as C is ...
[ { "answer_id": 170163, "author": "xtofl", "author_id": 6610, "author_profile": "https://Stackoverflow.com/users/6610", "pm_score": 0, "selected": false, "text": "__declspec( dllexport )" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/168979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24638/" ]
168,991
<p>I'd like to be able to (effectively) sort a database view - I know that conceptually order in a db view is invalid, but I have the following scenario to deal with:</p> <ul> <li>a third-party legacy application, that reads data from database tables using a select(*) from tablename statement</li> <li>the legacy appli...
[ { "answer_id": 168995, "author": "albertein", "author_id": 23020, "author_profile": "https://Stackoverflow.com/users/23020", "pm_score": 1, "selected": false, "text": "CREATE VIEW OrderedTable\nAS SELECT TOP (Select Count(*) from UnorderedTable) *\nFROM UnorderedTable Order By field\n" ...
2008/10/03
[ "https://Stackoverflow.com/questions/168991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2362/" ]
168,992
<p>I'm trying to display a series of titles varying from 60 characters to 160 or so and the capitalization varies, some of it all caps, some half caps. When it's mostly lowercase the whole 160 characters of text fits in the width I want, but when it starts getting more caps (they must be wider), it starts over flowing...
[ { "answer_id": 168997, "author": "Zebra North", "author_id": 17440, "author_profile": "https://Stackoverflow.com/users/17440", "pm_score": 1, "selected": false, "text": "style=\"width: Xpx; overflow: hidden;\"" }, { "answer_id": 169000, "author": "David Heggie", "author_i...
2008/10/03
[ "https://Stackoverflow.com/questions/168992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13009/" ]
169,008
<p>I'm trying to write a regex that will parse out the <strong>directory and filename</strong> of a fully qualified path using matching groups.</p> <p>so...</p> <pre><code>/var/log/xyz/10032008.log </code></pre> <p>would recognize <code>group 1 to be "/var/log/xyz"</code> and <code>group 2 to be "10032008.log"</code...
[ { "answer_id": 169014, "author": "tzot", "author_id": 6899, "author_profile": "https://Stackoverflow.com/users/6899", "pm_score": 3, "selected": false, "text": "^(.*)/([^/]*)$\n ^\\(.*\\)/\\([^/]*\\)$\n" }, { "answer_id": 169021, "author": "Paige Ruten", "author_id": 813,...
2008/10/03
[ "https://Stackoverflow.com/questions/169008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1247/" ]
169,034
<p>Every time I call this method my NSMutableData is leaking and I cannot figure out how to plug it. theData's retain count is upped by one after the decoder is allocated and initialized and I have no idea why. I am stuck with a retain count of 2 at the end of the method and attempting to release it causes an app crash...
[ { "answer_id": 169247, "author": "Chris Hanson", "author_id": 714, "author_profile": "https://Stackoverflow.com/users/714", "pm_score": 2, "selected": false, "text": "venueIOList -autorelease -release" }, { "answer_id": 169709, "author": "mmalc", "author_id": 23233, "...
2008/10/03
[ "https://Stackoverflow.com/questions/169034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25004/" ]
169,044
<p>My development environment is running in JDK1.6, and I need to compile some classes so they are compatible with a client running JDK1.5. How would I do this with the 'javac' ant target?</p>
[ { "answer_id": 169055, "author": "Tom Feiner", "author_id": 13523, "author_profile": "https://Stackoverflow.com/users/13523", "pm_score": 2, "selected": false, "text": "< javac srcdir=\"${src} destdir=\"${build}\" target=\"1.5\" />" }, { "answer_id": 169065, "author": "Darron...
2008/10/03
[ "https://Stackoverflow.com/questions/169044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
169,058
<p>I've got a Win32 C++ app with a suite of unit tests. After the unit tests have finished running, I'd like a human-readable report on any unfreed memory to be automatically generated. Ideally, the report will have a stack with files &amp; line number info for each unfreed allocation. It would be nice to have them ...
[ { "answer_id": 169088, "author": "Michael Burr", "author_id": 12711, "author_profile": "https://Stackoverflow.com/users/12711", "pm_score": 1, "selected": false, "text": "_CrtSetReportMode\n_CrtSetReportFile\n_CrtMemState \n_CrtMemCheckpoint\n_CrtMemDumpStatistics\n_CrtSetReportFile\n...
2008/10/03
[ "https://Stackoverflow.com/questions/169058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23524/" ]
169,070
<p>How do I write a decorator that restores the current working directory to what it was before the decorated function was called? In other words, if I use the decorator on a function that does an <code>os.chdir()</code>, the cwd will not be changed after the function is called.</p>
[ { "answer_id": 169079, "author": "Daryl Spitzer", "author_id": 4766, "author_profile": "https://Stackoverflow.com/users/4766", "pm_score": 2, "selected": false, "text": "def preserve_cwd(function):\n def decorator(*args, **kwargs):\n cwd = os.getcwd()\n result = function(*arg...
2008/10/03
[ "https://Stackoverflow.com/questions/169070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4766/" ]
169,080
<p>I'd like to be able to toggle easily between two values for "maximum number of parallel project builds" in Visual Studio 2008 (in Tools->Options->Projects and Solutions->Build and Run). (When I'm planning on doing concurrent work I'd like to reduce it from 4 to 3.) I'm not too well versed in writing macros for the I...
[ { "answer_id": 169093, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 3, "selected": true, "text": "Dim p = DTE.Properties(\"ProjectsAndSolutions\",\"BuildAndRun\")\np.Item(\"MaxNumParallelBuilds\")\n" }, { "answe...
2008/10/03
[ "https://Stackoverflow.com/questions/169080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4790/" ]
169,107
<p>I'm in a situation where I would to generate a script for a database that I could run on another server and get a database identical to the original one, but without any of the data. In essence, I want to end up with a big create script that captures the database schema. </p> <p>I am working in an environment that...
[ { "answer_id": 169135, "author": "BoltBait", "author_id": 20848, "author_profile": "https://Stackoverflow.com/users/20848", "pm_score": 5, "selected": true, "text": "Script Database as > Create to > file > All Tasks > Generate Scripts" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/169107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19452/" ]
169,116
<p>I have a type (System.Type) of an enum and a string containing enumeration value to set.</p> <p>E.g. given: </p> <pre><code>enum MyEnum { A, B, C }; </code></pre> <p>I have typeof(MyEnum) and "B".</p> <p>How do I create MyEnum object set to MyEnum.B?</p>
[ { "answer_id": 169120, "author": "Yuval", "author_id": 23202, "author_profile": "https://Stackoverflow.com/users/23202", "pm_score": 4, "selected": false, "text": "MyEnum enumValue = (MyEnum)Enum.Parse(typeof(MyEnum), \"B\");\n" }, { "answer_id": 169181, "author": "Pavel Chuc...
2008/10/03
[ "https://Stackoverflow.com/questions/169116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
169,121
<p>When I try to bind port 80 to a socket in c, i always get the error, that I don't have permission to use this port. is there an easy way to get this permission?</p>
[ { "answer_id": 169147, "author": "Eli Bendersky", "author_id": 8206, "author_profile": "https://Stackoverflow.com/users/8206", "pm_score": 3, "selected": false, "text": "winsock" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/169121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25017/" ]
169,146
<p>I'm getting an unexpected T_CONCAT_EQUAL error on a line of the following form:</p> <pre><code>$arg1 .= "arg2".$arg3."arg4"; </code></pre> <p>I'm using PHP5. I could simply go an do the following:</p> <pre><code>$arg1 = $arg1."arg2".$arg3."arg4"; </code></pre> <p>but I'd like to know whats going wrong in the fi...
[ { "answer_id": 169187, "author": "Brian Sweeney", "author_id": 2170994, "author_profile": "https://Stackoverflow.com/users/2170994", "pm_score": 1, "selected": false, "text": "$arg1 .= \"arg2\".$arg3.\"arg4\";\n arg1 .= \"arg2\".$arg3.\"arg4\";\n" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/169146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2170994/" ]
169,150
<p>How can I configure an application, or even an entire machine, to use either the server or workstation flavor of the CLR's garbage collection? </p>
[ { "answer_id": 260139, "author": "Justin R.", "author_id": 4593, "author_profile": "https://Stackoverflow.com/users/4593", "pm_score": 0, "selected": false, "text": "GCSettings.LatencyMode" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/169150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4593/" ]
169,155
<p>I am using SetCursor to set the system cursor to my own image. The code looks something like this:</p> <pre><code>// member on some class HCURSOR _cursor; // at init time _cursor = LoadCursorFromFile("somefilename.cur"); // in some function SetCursor(_cursor); </code></pre> <p>When I do this the cursor does chan...
[ { "answer_id": 169280, "author": "Joe Ludwig", "author_id": 1031, "author_profile": "https://Stackoverflow.com/users/1031", "pm_score": 4, "selected": true, "text": "WM_SETCURSOR WM_SETCURSOR SetCursor WM_SETCURSOR // defined somewhere\nHWND windowHandle;\nHCURSOR cursor;\n\nSetCursor(cu...
2008/10/03
[ "https://Stackoverflow.com/questions/169155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1031/" ]
169,170
<p>I am looking for a way to do a keep alive check in .NET. The scenario is for both UDP and TCP.</p> <p>Currently in TCP what I do is that one side connects and when there is no data to send it sends a keep alive every X seconds.</p> <p>I want the other side to check for data, and if non was received in X seconds, t...
[ { "answer_id": 171344, "author": "Greg Dean", "author_id": 1200558, "author_profile": "https://Stackoverflow.com/users/1200558", "pm_score": 4, "selected": false, "text": " public static void SetTcpKeepAlive(Socket socket, uint keepaliveTime, uint keepaliveInterval)\n {\n /*...
2008/10/03
[ "https://Stackoverflow.com/questions/169170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
169,186
<p>I am having a very hard time finding a standard pattern / best practice that deals with rendering child controls inside a composite based on a property value.</p> <p>Here is a basic scenario. I have a Composite Control that has two child controls, a textbox and a dropdown. Lets say there is a property that toggles ...
[ { "answer_id": 169205, "author": "ckramer", "author_id": 20504, "author_profile": "https://Stackoverflow.com/users/20504", "pm_score": 0, "selected": false, "text": "public bool ShowDropDown\n{\n get{ return (bool)ViewState[\"ShowDropDown\"]; }\n set{ ViewState[\"ShowDropDown\"]; }...
2008/10/03
[ "https://Stackoverflow.com/questions/169186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25020/" ]
169,193
<p>There is a way to keep the scroll on bottom for a multi line textbox?</p> <p>Something like in the vb6 </p> <pre><code>txtfoo.selstart=len(txtfoo.text) </code></pre> <p>I'm trying with txtfoo.selectionstart=txtfoo.text.length without success.</p> <p>Regards.</p>
[ { "answer_id": 169210, "author": "MazarD", "author_id": 22672, "author_profile": "https://Stackoverflow.com/users/22672", "pm_score": 4, "selected": true, "text": "txtfoo.AppendText \n txtfoo.text+=\"something\"\n" }, { "answer_id": 169219, "author": "Matthew Scharley", ...
2008/10/03
[ "https://Stackoverflow.com/questions/169193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22672/" ]
169,201
<p>In ActionScript 3.0, is there an automatic way to calculate the number of days, hours, minutes and seconds between two specified dates?</p> <p>Basicly, what I need is the ActionScript equivalent of the .NET Timespan class.</p> <p>Any idea?</p>
[ { "answer_id": 169218, "author": "Russell Myers", "author_id": 18194, "author_profile": "https://Stackoverflow.com/users/18194", "pm_score": 4, "selected": false, "text": "var someDate:Date = new Date(...);\nvar anotherDate:Date = new Date(...);\nvar millisecondDifference:int = anotherDa...
2008/10/03
[ "https://Stackoverflow.com/questions/169201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
169,216
<p>As kind of a follow up to <a href="https://stackoverflow.com/questions/111605/what-kind-of-prefix-do-you-use-for-member-variables">this question about prefixes</a>, I agree with most people on the thread that prefixes are bad. But what about if you are using getters and setters? Then you need to differeniate the pub...
[ { "answer_id": 169238, "author": "Garry Shutler", "author_id": 6369, "author_profile": "https://Stackoverflow.com/users/6369", "pm_score": 1, "selected": false, "text": "private int myValue;\n\npublic int MyValue\n{\n get { return myValue; }\n}\n Private _myValue As Integer\n\nPublic ...
2008/10/03
[ "https://Stackoverflow.com/questions/169216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11911/" ]
169,217
<p>In SQL Server you can use the <code>IsNull()</code> function to check if a value is null, and if it is, return another value. Now I am wondering if there is anything similar in C#.</p> <p>For example, I want to do something like:</p> <pre><code>myNewValue = IsNull(myValue, new MyValue()); </code></pre> <p>instead...
[ { "answer_id": 169226, "author": "Kent Boogaart", "author_id": 5380, "author_profile": "https://Stackoverflow.com/users/5380", "pm_score": 9, "selected": true, "text": "?? myNewValue = myValue ?? new MyValue();\n" }, { "answer_id": 169415, "author": "Robert Rossney", "aut...
2008/10/03
[ "https://Stackoverflow.com/questions/169217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11989/" ]
169,220
<p>I'm used to writing classes like this:</p> <pre><code>public class foo { private string mBar = "bar"; public string Bar { get { return mBar; } set { mBar = value; } } //... other methods, no constructor ... } </code></pre> <p>Converting Bar to an auto-property seems convenient and concise, but how ...
[ { "answer_id": 169232, "author": "Matthew Scharley", "author_id": 15537, "author_profile": "https://Stackoverflow.com/users/15537", "pm_score": 2, "selected": false, "text": "public foo() {\n Bar = \"bar\";\n}\n" }, { "answer_id": 169237, "author": "Aaron Powell", "aut...
2008/10/03
[ "https://Stackoverflow.com/questions/169220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/459/" ]
169,233
<p><a href="http://thedailywtf.com/Articles/The-Hot-Room.aspx" rel="noreferrer">http://thedailywtf.com/Articles/The-Hot-Room.aspx</a></p> <p>You see how at the bottom there're links to the next and previous articles ("Unprepared For Divide_By_Zero" and "A Completely Different Game")? How do I do that, but selecting th...
[ { "answer_id": 169270, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 3, "selected": false, "text": "-- next\nSELECT * FROM articles WHERE id > ? AND private IS NULL ORDER BY id ASC LIMIT 1\n\n-- previous\nSELECT * FROM art...
2008/10/03
[ "https://Stackoverflow.com/questions/169233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23107/" ]
169,240
<p>I have two databases with the same structure. The tables have an integer as a primary key as used in Rails.</p> <p>If I have a patients table, I will have one patient using primary key 123 in one database and another patient using the same primary key in the other database.</p> <p>What would you suggest for mergin...
[ { "answer_id": 169606, "author": "user6325", "author_id": 6325, "author_profile": "https://Stackoverflow.com/users/6325", "pm_score": 3, "selected": false, "text": "def self.up\n ActiveRecord::Base.establish_connection :development\n patients = Patient.find(:all)\n ActiveRecord::Base....
2008/10/03
[ "https://Stackoverflow.com/questions/169240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14755/" ]
169,276
<p>After maintaining lots of code littered with #region (in both C# and VB.NET), it seems to me that this construct is just a bunch of "make work" for the programmer. It's work to PUT the dang things into the code, and then they make searching and reading code very annoying.</p> <p>What are the benefits? Why do coders...
[ { "answer_id": 169471, "author": "johnc", "author_id": 5302, "author_profile": "https://Stackoverflow.com/users/5302", "pm_score": 3, "selected": false, "text": "#region Properties\n\n#region Update Section\n\n#region Accessors\n #Sweep under carpet\n" }, { "answer_id": 287371, ...
2008/10/03
[ "https://Stackoverflow.com/questions/169276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/814/" ]
169,277
<p>Is there a Generics Friendly way of using Collection.EMPTY_LIST in my Java Program.</p> <p>I know I could just declare one myself, but I'm just curious to know if there's a way in the JDK to do this.</p> <p>Something like <code>users = Collections&lt;User&gt;.EMPTY_LIST;</code></p>
[ { "answer_id": 169286, "author": "Ryan Delucchi", "author_id": 9931, "author_profile": "https://Stackoverflow.com/users/9931", "pm_score": 6, "selected": true, "text": "List<User> users = Collections.emptyList();\n Collections.emptyList(); String List<User> users = Collections.<User>empt...
2008/10/03
[ "https://Stackoverflow.com/questions/169277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2443/" ]
169,278
<p>How do I get modrewrite to ENTIRELY ignore the /vip/ directory so that all requests pass directly to the folder?</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / RewriteRule ^vip/.$ - [PT] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L...
[ { "answer_id": 169347, "author": "ceejayoz", "author_id": 1902010, "author_profile": "https://Stackoverflow.com/users/1902010", "pm_score": 1, "selected": false, "text": "RewriteRule ^vip/.$ - [PT]\n RewriteRule ^vip/.*$ - [PT,L]\n" }, { "answer_id": 11918202, "author": "aron...
2008/10/03
[ "https://Stackoverflow.com/questions/169278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24557/" ]
169,287
<p>Does anyone have a good resource on dlls and how they are used / generated in Visual Studio? A few questions I'm rather hazy on specifically are:</p> <ul> <li>How refresh files work</li> <li>How dll version numbers are generated</li> <li>The difference between adding a reference by project vs browsing for the spec...
[ { "answer_id": 169314, "author": "Rob Walker", "author_id": 3631, "author_profile": "https://Stackoverflow.com/users/3631", "pm_score": 3, "selected": false, "text": "[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n" }, { "answer_id": 169668, "author": "Kev", "author_id": 4...
2008/10/03
[ "https://Stackoverflow.com/questions/169287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
169,293
<p>I'm looking for a make utility for building large java programs. I'm aware of ANT already, but want to see what else is available.</p> <p>Ideally, it should be able to handle the .java->.class package directory weirdness that fouls up GNU Make.</p> <p>Win32, but cross platform is a plus.</p> <p><strong>EDIT:</str...
[ { "answer_id": 170060, "author": "oxbow_lakes", "author_id": 16853, "author_profile": "https://Stackoverflow.com/users/16853", "pm_score": 1, "selected": false, "text": "war" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/169293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4777/" ]
169,303
<p>I want to be able to run unstrusted ruby code. I want to be able to pass variables to said untrusted code that it may use. I also want said code to return a result to me. Here is a conceptual example of what I am thinking</p> <pre><code>input = "sweet" output = nil Thread.start { $SAFE = 4 #... untrusted code...
[ { "answer_id": 26594052, "author": "fearless_fool", "author_id": 558639, "author_profile": "https://Stackoverflow.com/users/558639", "pm_score": 2, "selected": false, "text": "$SAFE" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/169303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21317/" ]
169,330
<p>Is there a way to get stored procedures from a SQL Server 2005 Express database using C#? I would like to export all of this data in the same manner that you can script it our using SQL Server Management Studio, without having to install the GUI.</p> <p>I've seen some references to do thing via the PowerShell but i...
[ { "answer_id": 169339, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 2, "selected": false, "text": "select * from sys.procedures\n" }, { "answer_id": 169340, "author": "Brian Kim", "author_id": 5704, ...
2008/10/03
[ "https://Stackoverflow.com/questions/169330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5678/" ]
169,332
<p>I want to use a timer in my simple <a href="http://en.wikipedia.org/wiki/.NET_Framework" rel="nofollow noreferrer">.NET</a> application written in C#. The only one I can find is the Windows.Forms.Timer class. I don't want to reference this namespace just for my console application. </p> <p>Is there a C# timer (or ...
[ { "answer_id": 169337, "author": "Eric Schoonover", "author_id": 3957, "author_profile": "https://Stackoverflow.com/users/3957", "pm_score": 4, "selected": false, "text": "Timer System.Timers Timer System.Threading using System;\nusing System.Timers;\n\npublic class Timer1\n{\n privat...
2008/10/03
[ "https://Stackoverflow.com/questions/169332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22471/" ]
169,342
<p>I have a solution that contains two projects. One project is an ASP.NET Web Application Project, and one is a class library. The web application has a project reference to the class library. Neither of these is strongly-named.</p> <p>In the class library, which I'll call &quot;Framework,&quot; I have an endpoint beh...
[ { "answer_id": 3332155, "author": "cdmdotnet", "author_id": 178840, "author_profile": "https://Stackoverflow.com/users/178840", "pm_score": 3, "selected": false, "text": "<system.serviceModel>\n <extensions>\n <behaviorExtensions>\n <add name=\"clientCredential\" typ...
2008/10/03
[ "https://Stackoverflow.com/questions/169342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8116/" ]
169,355
<p>Would anyone know why MSVC++ 2008 always returns error 5 on GetLastError() when I try to call OpenProcess with PROCESS_ALL_ACCESS as my desired access? PROCESS_VM_READ works just fine. I'm an administrator on this computer and it is working fine in Dev C++.</p> <p>Do I need to set an option somewhere?</p>
[ { "answer_id": 169394, "author": "Michael Burr", "author_id": 12711, "author_profile": "https://Stackoverflow.com/users/12711", "pm_score": 2, "selected": false, "text": "DELETE READ_CONTROL WRITE_DAC WRITE_OWNER" } ]
2008/10/03
[ "https://Stackoverflow.com/questions/169355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
169,362
<p>I would like to compress a folder and all its sub-folders/files, and email the zip file as an attachment. What would be the best way to achieve this with Python? </p>
[ { "answer_id": 169406, "author": "nosklo", "author_id": 17160, "author_profile": "https://Stackoverflow.com/users/17160", "pm_score": 5, "selected": true, "text": "homework import smtplib\nimport zipfile\nimport tempfile\nfrom email import encoders\nfrom email.message import Message\nfro...
2008/10/03
[ "https://Stackoverflow.com/questions/169362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
169,377
<p>As a hobby I'm interesting in programming an Ethernet-connected LED sign to scroll messages across a screen. But I'm having trouble making a UDP sender in <a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET" rel="nofollow noreferrer">VB.NET</a> (I am using 2008 currently).</p> <p>Now the sign is nice enough to ...
[ { "answer_id": 169422, "author": "Grant", "author_id": 30, "author_profile": "https://Stackoverflow.com/users/30", "pm_score": 0, "selected": false, "text": "Public Function HexFromIP(ByVal sIP As String)\n Dim aIP As String()\n Dim sHexCode As String = \"\"\n aIP = sIP.Split(\"...
2008/10/04
[ "https://Stackoverflow.com/questions/169377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25031/" ]
169,378
<p>ReSharper likes to point out multiple functions per ASP.NET page that could be made static. Does it help me if I do make them static? Should I make them static and move them to a utility class?</p>
[ { "answer_id": 169384, "author": "Eric Schoonover", "author_id": 3957, "author_profile": "https://Stackoverflow.com/users/3957", "pm_score": 3, "selected": false, "text": "this" }, { "answer_id": 169399, "author": "Jeff Yates", "author_id": 23234, "author_profile": "h...
2008/10/04
[ "https://Stackoverflow.com/questions/169378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/459/" ]
169,404
<p>In a <a href="https://stackoverflow.com/questions/168408/c-alternatives-to-void-pointers-that-isnt-templates">related question</a> I asked about creating a generic container. Using polymorphic templates seems like the right way to go.</p> <p>However, I can't for the life of me figure out how a destructor should be ...
[ { "answer_id": 169439, "author": "Scott Langham", "author_id": 11898, "author_profile": "https://Stackoverflow.com/users/11898", "pm_score": 3, "selected": true, "text": "MyContainer<shared_ptr<SomeComplexType> > MyContainer<float> shared_ptr shared_ptr shared_ptr" }, { "answer_i...
2008/10/04
[ "https://Stackoverflow.com/questions/169404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14621/" ]
169,419
<p>I like having my warning level set at W4 but all new projects start at W3. Is there some way to change the default value for warning levels for new projects?</p>
[ { "answer_id": 169434, "author": "albertein", "author_id": 23020, "author_profile": "https://Stackoverflow.com/users/23020", "pm_score": 2, "selected": false, "text": "%PROGRAM_FILES%\\Microsoft Visual Studio 9.0\\Common7\\IDE\\ProjectTemplates\\\n %PROGRAM_FILES%\\Microsoft Visual Studi...
2008/10/04
[ "https://Stackoverflow.com/questions/169419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3176/" ]
169,420
<p>I've been looking for a generic way to deal with bidirectional associations and a way to handle the inverse updates in manual written Java code.</p> <p>For those who don't know what I'm talking about, here is an example. Below it are my current results of (unsatisfying) solutions.</p> <pre><code>public class A { ...
[ { "answer_id": 169758, "author": "Kevin Day", "author_id": 10973, "author_profile": "https://Stackoverflow.com/users/10973", "pm_score": 0, "selected": false, "text": "AssociationBuilder.createAssociation(A a, Connector< A> ca, B b, Connector< B> cb, Synchronizer< A,B> sync)\n sync(Chan...
2008/10/04
[ "https://Stackoverflow.com/questions/169420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19935/" ]
169,428
<p>this code always returns 0 in PHP 5.2.5 for microseconds:</p> <pre><code>&lt;?php $dt = new DateTime(); echo $dt-&gt;format("Y-m-d\TH:i:s.u") . "\n"; ?&gt; </code></pre> <p>Output:</p> <pre><code>[root@www1 ~]$ php date_test.php 2008-10-03T20:31:26.000000 [root@www1 ~]$ php date_test.php 2008-10-03T20:31:27.00000...
[ { "answer_id": 169458, "author": "eydelber", "author_id": 25039, "author_profile": "https://Stackoverflow.com/users/25039", "pm_score": 6, "selected": true, "text": "function getTimestamp()\n{\n return date(\"Y-m-d\\TH:i:s\") . substr((string)microtime(), 1, 8);\n}\n" }, { ...
2008/10/04
[ "https://Stackoverflow.com/questions/169428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25039/" ]
169,435
<p>How can I view the intermediate translation done to JSP and JSPX pages by WTP? I'm getting weird syntax errors in my Problems tab of Eclipse in a project that has plenty of .jspx pages. They don't affect anything in the running application (Tomcat 6.0) and they appeared only over the last 2 weeks, after an update....
[ { "answer_id": 200594, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<stripes:errors/>" } ]
2008/10/04
[ "https://Stackoverflow.com/questions/169435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/269754/" ]
169,450
<p><em>Information-Expert</em>, <em>Tell-Don't-Ask</em>, and <em>SRP</em> are often mentioned together as best practices. But I think they are at odds. Here is what I'm talking about.</p> <p>Code that favors SRP but violates Tell-Don't-Ask &amp; Info-Expert:</p> <pre><code>Customer bob = ...; // TransferObjectFactory...
[ { "answer_id": 13421639, "author": "Michael Parker", "author_id": 1554346, "author_profile": "https://Stackoverflow.com/users/1554346", "pm_score": 1, "selected": false, "text": " List<Bill> bills = Customer.GetOutstandingBills();\n PaymentReminder.RemindCustomer(customer, bills);\n Cu...
2008/10/04
[ "https://Stackoverflow.com/questions/169450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10759/" ]
169,453
<p>We're running a web app on Tomcat 6 and Apache mod_proxy 2.2.3. Seeing a lot of 502 errors like this:</p> <blockquote> <p>Bad Gateway! The proxy server received an invalid response from an upstream server.</p> <p>The proxy server could not handle the request GET /the/page.do.</p> <p>Reason: Error rea...
[ { "answer_id": 1287662, "author": "Janning", "author_id": 351758, "author_profile": "https://Stackoverflow.com/users/351758", "pm_score": 4, "selected": false, "text": "SetEnv proxy-nokeepalive 1\nSetEnv proxy-initial-not-pooled 1\n keepAlive" }, { "answer_id": 1837936, "auth...
2008/10/04
[ "https://Stackoverflow.com/questions/169453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7671/" ]
169,470
<p>I have a function in which I get en external resource from the web using cocoa's Url object. And it works fine on the simulator, but occasionally fails on the device itself (it's a google query so the resource obviously does exist). Which leads me to believe that there is some internal timeout barrier on the hardwa...
[ { "answer_id": 173275, "author": "lajos", "author_id": 3740, "author_profile": "https://Stackoverflow.com/users/3740", "pm_score": 1, "selected": false, "text": "+ (id)requestWithURL:(NSURL *)theURL cachePolicy:(NSURLRequestCachePolicy)cachePolicy timeoutInterval:(NSTimeInterval)timeoutI...
2008/10/04
[ "https://Stackoverflow.com/questions/169470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15124/" ]
169,477
<p>I'm trying to implement a server control that frobs a couple of files inside the web directory of an ASP.NET site. I'm using VS Web Dev Express 2008 as my IDE. When I call <code>HttpContext.Current.Request.ApplicationPath</code> to get a path to the web root so I can find those files, it returns C:. What the heck?</...
[ { "answer_id": 169490, "author": "Kibbee", "author_id": 1862, "author_profile": "https://Stackoverflow.com/users/1862", "pm_score": 2, "selected": false, "text": "HTTPContext.Current.Request.ServerVariables(\"APPL_PHYSICAL_PATH\")\n" }, { "answer_id": 169510, "author": "Mark ...
2008/10/04
[ "https://Stackoverflow.com/questions/169477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16398/" ]
169,506
<p>I have a form with many input fields.</p> <p>When I catch the submit form event with jQuery, is it possible to get all the input fields of that form in an associative array?</p>
[ { "answer_id": 169553, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 3, "selected": false, "text": "var items = new Array();\n\n$('#form_id:input').each(function (el) {\n items[el.name] = el;\n});\n" }, { "answer_id...
2008/10/04
[ "https://Stackoverflow.com/questions/169506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7883/" ]
169,511
<p>How do I iterate over a range of numbers in Bash when the range is given by a variable?</p> <p>I know I can do this (called "sequence expression" in the Bash <a href="http://www.gnu.org/software/bash/manual/bashref.html#Brace-Expansion" rel="noreferrer">documentation</a>):</p> <pre><code> for i in {1..5}; do echo ...
[ { "answer_id": 169515, "author": "Peter Hoffmann", "author_id": 720, "author_profile": "https://Stackoverflow.com/users/720", "pm_score": 5, "selected": false, "text": "for i in $(seq $END); do echo $i; done\n" }, { "answer_id": 169517, "author": "Jiaaro", "author_id": 29...
2008/10/04
[ "https://Stackoverflow.com/questions/169511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24923/" ]
169,512
<p>I recently began using <a href="http://www.eclipse.org/birt/phoenix/deploy/" rel="noreferrer">BIRT</a> and have developed a report to use with my <a href="http://developer.mozilla.org/en/XULRunner" rel="noreferrer">xulrunner</a> application. What I haven't yet figured out is how I should deploy the viewer. It seem...
[ { "answer_id": 27257220, "author": "McCoy", "author_id": 2816092, "author_profile": "https://Stackoverflow.com/users/2816092", "pm_score": 2, "selected": false, "text": "genReport.bat -f PDF -o PATH/GENERATED_REPORTS/REPORT.pdf -F \"PATH/TO/REPORT.rptdesign\"" } ]
2008/10/04
[ "https://Stackoverflow.com/questions/169512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525/" ]
169,520
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/795746/warning-mysql-fetch-array-supplied-argument-is-not-a-valid-mysql-result">Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result</a> </p> </blockquote> <p>When I run my php page, I ge...
[ { "answer_id": 169527, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<?PHP\n\n $user_name = \"root\";\n $password = \"\";\n $database = \"addressbook\";\n $server = \"127.0.0.1\";\n\n...
2008/10/04
[ "https://Stackoverflow.com/questions/169520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
169,529
<p>So I have a ListView with an upper limit of about 1000 items. I need to be able to filter these items using a textbox's TextChanged event. I have some code that works well for a smaller number of items (~400), but when I need to re-display a full list of all 1000 items, it takes about 4 seconds.</p> <p>I am not c...
[ { "answer_id": 169611, "author": "sieben", "author_id": 1147, "author_profile": "https://Stackoverflow.com/users/1147", "pm_score": 2, "selected": false, "text": "MyListView.AddRange(items)\n" } ]
2008/10/04
[ "https://Stackoverflow.com/questions/169529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1053/" ]
169,555
<p>Greetings,</p> <p>I need to include a property in my class which is a collection of System.IO.FileInfo objects. I am not really sure how to do this and how I would add and removed objects from an instance of the the class (I would assume like any other collection). </p> <p>Please let me know if I need to add m...
[ { "answer_id": 169568, "author": "Frank Krueger", "author_id": 338, "author_profile": "https://Stackoverflow.com/users/338", "pm_score": 1, "selected": false, "text": "File FileInfo class Foo {\n public IEnumerable<FileInfo> LotsOfFile {\n get {\n for (int i=0; i < 1...
2008/10/04
[ "https://Stackoverflow.com/questions/169555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5836/" ]
169,562
<p>Ok, my actual problem was this: I was implementing an <code>IList&lt;T&gt;</code>. When I got to <code>CopyTo(Array array, int index)</code>, this was my solution:</p> <pre><code>void ICollection.CopyTo(Array array, int index) { // Bounds checking, etc here. if (!(array.GetValue(0) is T)) throw new ...
[ { "answer_id": 169579, "author": "justin.m.chase", "author_id": 12958, "author_profile": "https://Stackoverflow.com/users/12958", "pm_score": 2, "selected": false, "text": "if(!typeof(T).IsAssignableFrom(array.GetElementType()))\n" }, { "answer_id": 169595, "author": "Mark Ci...
2008/10/04
[ "https://Stackoverflow.com/questions/169562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15537/" ]
169,573
<p>I am searching for an open source Java library to generate thumbnails for a given URL. I need to bundle this capability, rather than call out to external services, such as <a href="http://aws.amazon.com/ast/" rel="nofollow noreferrer">Amazon</a> or <a href="http://www.websnapr.com/" rel="nofollow noreferrer">websna...
[ { "answer_id": 170392, "author": "McDowell", "author_id": 304, "author_profile": "https://Stackoverflow.com/users/304", "pm_score": 4, "selected": true, "text": "import java.awt.Component;\nimport java.awt.Graphics2D;\nimport java.awt.image.BufferedImage;\nimport java.io.File;\nimport ja...
2008/10/04
[ "https://Stackoverflow.com/questions/169573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14419/" ]
169,574
<p>Like most *nix people, I tend to play with my tools and get them configured just the way that I like them. This was all well and good until recently. As I do more and more work, I tend to log onto more and more machines, and have more and more stuff that's configured great on my home machine, but not necessarily on ...
[ { "answer_id": 169638, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 1, "selected": false, "text": "sh" }, { "answer_id": 169663, "author": "Pierre Spring", "author_id": 1532, "author_profile": "https:...
2008/10/04
[ "https://Stackoverflow.com/questions/169574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24817/" ]
169,590
<p>I need to fire an event when the mouse is above a PictureBox with the mouse button already clicked and held down.</p> <p>Problems: </p> <p>The MouseDown and MouseEnter event handlers do not work together very well.</p> <p>For instance once a mouse button is clicked and held down, C# will fire the MouseDown event ...
[ { "answer_id": 169604, "author": "Jeff Yates", "author_id": 23234, "author_profile": "https://Stackoverflow.com/users/23234", "pm_score": 4, "selected": false, "text": "System.Windows.Control.MousePosition PictureBox.ClientRectangle Control.MouseButtons if (pictureBox.ClientRectangle.Co...
2008/10/04
[ "https://Stackoverflow.com/questions/169590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609/" ]
169,596
<p><strong>EDIT:</strong> <em>I'm still waiting for more answers. Thanks!</em></p> <p>In SQL 2000 days, I used to use temp table method where you create a temp table with new identity column and primary key then select where identity column between A and B.</p> <p>When <strong>SQL 2005</strong> came along I found out...
[ { "answer_id": 169655, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 3, "selected": false, "text": "SELECT column_list\nFROM\n (SELECT column_list\n ROW_NUMBER() OVER(ORDER BY OrderByColumnName) as RowNum\n ...
2008/10/04
[ "https://Stackoverflow.com/questions/169596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5704/" ]
169,610
<p>I'm writing a function that gets the path environment variable of a system, splits up each path, then concats on some other extra characters onto the end of each path.</p> <p>Everything works fine until I use the <code>strcat()</code> function (see code below).</p> <pre><code>char* prependPath( char* exeName ) { ...
[ { "answer_id": 169615, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "strtok" }, { "answer_id": 169629, "author": "Martin York", "author_id": 14065, "author_profile": "https://...
2008/10/04
[ "https://Stackoverflow.com/questions/169610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
169,624
<p>I was looking into sorting tables by a column designated given some input, and from what I've found, there is no easy way to do this. The best I've found is a switch statement: </p> <pre><code>SELECT Column1, Column2, Column3, Column4 FROM Table ORDER BY CASE WHEN @OrderBY = 'Column1' THEN Column1 WH...
[ { "answer_id": 169632, "author": "Ron Savage", "author_id": 12476, "author_profile": "https://Stackoverflow.com/users/12476", "pm_score": 1, "selected": false, "text": "Select\n *\nFrom\n myTableFUnction()\nOrder by\n 1, 2, 3, 6 <-- defined by application code in the SQL for the ...
2008/10/04
[ "https://Stackoverflow.com/questions/169624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/392/" ]
169,625
<p>I would like users to submit a URL that is valid but also is an image, ending with .jpg, .png, or .gif.</p>
[ { "answer_id": 169631, "author": "Dan", "author_id": 17121, "author_profile": "https://Stackoverflow.com/users/17121", "pm_score": 6, "selected": false, "text": "#fragments ?querystrings localhost" }, { "answer_id": 169634, "author": "Mark Cidade", "author_id": 1659, ...
2008/10/04
[ "https://Stackoverflow.com/questions/169625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
169,637
<p>When I retrieve a record using LINQ that has a DateTime field only the ToString() is available. </p> <p>Where are all the other DateTime methods? </p> <p>I have to Convert.ToDateTime the DateTime? that the Field returns?</p> <p>What is the difference between (DateTime) and (DateTime?)</p>
[ { "answer_id": 169644, "author": "Ryan", "author_id": 17917, "author_profile": "https://Stackoverflow.com/users/17917", "pm_score": 0, "selected": false, "text": "new DateTime()" }, { "answer_id": 169651, "author": "Mark Cidade", "author_id": 1659, "author_profile": "...
2008/10/04
[ "https://Stackoverflow.com/questions/169637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6161/" ]
169,662
<p>Is it possible, in Java, to enforce that a class have a specific set of subclasses and no others? For example:</p> <pre><code>public abstract class A {} public final class B extends A {} public final class C extends A {} public final class D extends A {} </code></pre> <p>Can I somehow enforce that no other subclas...
[ { "answer_id": 169671, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 2, "selected": false, "text": "A" }, { "answer_id": 169675, "author": "asterite", "author_id": 20459, "author_profile": "https://St...
2008/10/04
[ "https://Stackoverflow.com/questions/169662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3434/" ]
169,695
<p>What is the best way to persist/save printer settings in .Net? There used to be a bug in .Net 1.1 in the serialization of the <code>PrinterSetting</code> object and there were some <a href="http://www.codeproject.com/KB/cs/printersettings.aspx" rel="nofollow noreferrer">workarounds</a> but I'm wondering if there isn...
[ { "answer_id": 170030, "author": "Dmitry Shechtman", "author_id": 3583, "author_profile": "https://Stackoverflow.com/users/3583", "pm_score": 1, "selected": false, "text": "PrinterSettings" }, { "answer_id": 33784768, "author": "Marco Guignard", "author_id": 2087090, ...
2008/10/04
[ "https://Stackoverflow.com/questions/169695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3811/" ]
169,713
<p>What made it hard to find? How did you track it down?</p> <p>Not close enough to close but see also<br> <a href="https://stackoverflow.com/questions/175854/what-is-the-funniest-bug-youve-ever-experienced">https://stackoverflow.com/questions/175854/what-is-the-funniest-bug-youve-ever-experienced</a></p>
[ { "answer_id": 169725, "author": "Brian", "author_id": 18192, "author_profile": "https://Stackoverflow.com/users/18192", "pm_score": 1, "selected": false, "text": "XMLEncoder XMLEncoder" }, { "answer_id": 171872, "author": "Tal", "author_id": 11287, "author_profile": ...
2008/10/04
[ "https://Stackoverflow.com/questions/169713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10960/" ]
169,721
<p>I keep hearing that Flex is open source and I figured that a great way to learn about the inner workings would be to look at it. I can easily find the Flex SDK (<a href="http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code" rel="noreferrer">http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code...
[ { "answer_id": 169724, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 1, "selected": false, "text": "http://opensource.adobe.com/wiki/display/flexsdk/Downloads\n" } ]
2008/10/04
[ "https://Stackoverflow.com/questions/169721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9619/" ]
169,731
<p>In Javascript, I have an object:</p> <pre><code>obj = { one: "foo", two: "bar" }; </code></pre> <p>Now, I want do do this</p> <pre><code>var a = 'two'; if(confirm('Do you want One')) { a = 'one'; } alert(obj.a); </code></pre> <p>But of course it doesn't work. What would be the correct way of referencing this...
[ { "answer_id": 169737, "author": "yfeldblum", "author_id": 12349, "author_profile": "https://Stackoverflow.com/users/12349", "pm_score": 3, "selected": false, "text": "obj[a]\n" }, { "answer_id": 169740, "author": "Javier", "author_id": 11649, "author_profile": "https...
2008/10/04
[ "https://Stackoverflow.com/questions/169731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/144/" ]
169,759
<p>What's the best .NET communication component or protocol for very low bandwidth and intermittently connected communication (i.e.: &lt; 10 kilobits/sec)?</p>
[ { "answer_id": 169763, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 1, "selected": false, "text": "System.Net.Sockets. Socket TcpClient UdpClient" } ]
2008/10/04
[ "https://Stackoverflow.com/questions/169759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25010/" ]
169,784
<p>I am totally new to <code>SQL</code>. I have a simple select query similar to this:</p> <pre><code>SELECT COUNT(col1) FROM table1 </code></pre> <p>There are some 120 records in the table and shown on the <code>GUI</code>. For some reason, this query always returns a number which is less than the actual count.</p> ...
[ { "answer_id": 169785, "author": "Blorgbeard", "author_id": 369, "author_profile": "https://Stackoverflow.com/users/369", "pm_score": 4, "selected": false, "text": "select count(*) from table1\n count(*) count(isnull(col1,0)) isnull" }, { "answer_id": 169786, "author": "Gulza...
2008/10/04
[ "https://Stackoverflow.com/questions/169784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25065/" ]
169,799
<p>I'm trying to get into java again (it's been a few years). I never really did any GUI coding in java. I've been using Netbeans to get started with this.</p> <p>When using winforms in C# at work I use a usercontrols to build parts of my UI and add them to forms dynamically. </p> <p>I've been trying to use <code>JPa...
[ { "answer_id": 169805, "author": "Daniel Spiewak", "author_id": 9815, "author_profile": "https://Stackoverflow.com/users/9815", "pm_score": -1, "selected": false, "text": "mainPanel.invalidate() mainPanel.validate()" }, { "answer_id": 169857, "author": "BFreeman", "author...
2008/10/04
[ "https://Stackoverflow.com/questions/169799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21811/" ]
169,815
<p>In the same spirit of other platforms, it seemed logical to follow up with this question: What are common non-obvious mistakes in Java? Things that seem like they ought to work, but don't.</p> <p>I won't give guidelines as to how to structure answers, or what's "too easy" to be considered a gotcha, since that's wha...
[ { "answer_id": 169824, "author": "Alan", "author_id": 17205, "author_profile": "https://Stackoverflow.com/users/17205", "pm_score": 1, "selected": false, "text": "Long long public void foo(Object obj) {\n if (grass.isGreen()) {\n Long id = grass.getId();\n foo(id);\n ...
2008/10/04
[ "https://Stackoverflow.com/questions/169815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17205/" ]
169,817
<p>I'm thinking the answer is no, but I'd love it it anybody had any insight into how to crawl a tree structure to any depth in SQL (MySQL), but with a single query</p> <p>More specifically, given a tree structured table (id, data, data, parent_id), and one row in the table, is it possible to get <em>all</em> descenda...
[ { "answer_id": 169834, "author": "Dan", "author_id": 17121, "author_profile": "https://Stackoverflow.com/users/17121", "pm_score": -1, "selected": false, "text": "getChildren(parent){\n children = query(SELECT * FROM table WHERE parent_id = parent.id)\n return children\n}\n\nprintT...
2008/10/04
[ "https://Stackoverflow.com/questions/169817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14873/" ]
169,818
<h2>What should happen when I call <code>$user-&gt;get_email_address()</code>?</h2> <h3>Option 1: Pull the email address from the database on demand</h3> <pre><code>public function get_email_address() { if (!$this-&gt;email_address) { $this-&gt;read_from_database('email_address'); } return $this-&...
[ { "answer_id": 169923, "author": "Dylan Beattie", "author_id": 5017, "author_profile": "https://Stackoverflow.com/users/5017", "pm_score": 4, "selected": true, "text": "public function get_email_address() {\n if (!$this->email_address) {\n $this->load_all_data_from_db($this->id...
2008/10/04
[ "https://Stackoverflow.com/questions/169818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25068/" ]
169,828
<p>Interested if anyone has used VSTS Database Edition extensively and, if so, which features did you find the most useful over the standard Visual Studio database projects?</p> <p>What are the most compelling features as opposed to alternative schema management options or tools like RedGate's SqlCompare etc?</p> <p>...
[ { "answer_id": 1847699, "author": "Andy", "author_id": 442820, "author_profile": "https://Stackoverflow.com/users/442820", "pm_score": 2, "selected": false, "text": "TaskName=\"DataGeneratorTask\"\nAssemblyName=\"Microsoft.Data.Schema.Tasks, Version=9.1.0.0, Culture=neutral, PublicKeyTok...
2008/10/04
[ "https://Stackoverflow.com/questions/169828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18471/" ]
169,829
<p>INotifyPropertyChanged is fairly self explanatory and I think I'm clear on when to raise that one (i.e. when I've finished updating the values).<br> If I implement INotifyPropertyChanging I'm tending to raise the event as soon as I enter the setter or other method that changes the objects state and then continue wit...
[ { "answer_id": 169849, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 5, "selected": true, "text": "PropertyChanging public T Foo\n { get\n { return m_Foo;\n }\n set\n { if (m_Foo == value) return; //no need fo...
2008/10/04
[ "https://Stackoverflow.com/questions/169829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15572/" ]
169,833
<p>I've opened a new window with window.open() and I want to use the reference from the window.open() call to then write content to the new window. I've tried copying HTML from the old window to the new window by using myWindow.document.body.innerHTML = oldWindowDiv.innerHTML; but that's doesn't work. Any ideas?</p>
[ { "answer_id": 169840, "author": "Giao", "author_id": 14099, "author_profile": "https://Stackoverflow.com/users/14099", "pm_score": -1, "selected": false, "text": "myWindow.document.writeln(documentString)\n" }, { "answer_id": 169843, "author": "Vijesh VP", "author_id": 2...
2008/10/04
[ "https://Stackoverflow.com/questions/169833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2484/" ]
169,866
<p>How to export pictures in Microsoft Word to TIFF file using Visual Studio Tools for Office? I can obtain a reference to the pictures as InlineShape object collection, the hard part now is how to save them as TIFF images.</p>
[ { "answer_id": 169893, "author": "Graviton", "author_id": 3834, "author_profile": "https://Stackoverflow.com/users/3834", "pm_score": 3, "selected": true, "text": " private void SaveToImage(Word.InlineShape picShape, string filePath)\n {\n picShape.Select();\n the...
2008/10/04
[ "https://Stackoverflow.com/questions/169866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
169,877
<p>Being new to test based development, this question has been bugging me. How much is too much? What should be tested, how should it be tested, and why should it be tested? The examples given are in C# with NUnit, but I assume the question itself is language agnostic.</p> <p>Here are two current examples of my own, t...
[ { "answer_id": 169886, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 1, "selected": false, "text": "_list" } ]
2008/10/04
[ "https://Stackoverflow.com/questions/169877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15537/" ]
169,889
<p>There's another post on SO relating to .NET -- not us. Pure PHP. Trying to find the best way/process to deploy stable version of our PHP app. I've seen an article on <a href="http://www.simplisticcomplexity.com/2006/8/16/automated-php-deployment-with-capistrano/" rel="nofollow noreferrer">Capistrano</a>, but am c...
[ { "answer_id": 169935, "author": "Michael Johnson", "author_id": 17688, "author_profile": "https://Stackoverflow.com/users/17688", "pm_score": 3, "selected": true, "text": "svn export scp ssh" } ]
2008/10/04
[ "https://Stackoverflow.com/questions/169889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24708/" ]
169,894
<p>The <a href="http://flot.googlecode.com/svn/trunk/API.txt" rel="nofollow noreferrer">Flot API documentation</a> describes the library's extensive hooks for customizing the axes of a graph. You can set the number of ticks, their color, etc. separately for each axis. However, I can not figure out how to prevent Flot f...
[ { "answer_id": 4569708, "author": "Laurimann", "author_id": 328958, "author_profile": "https://Stackoverflow.com/users/328958", "pm_score": 3, "selected": false, "text": "var options = {\n grid: {show: true,\n color: \"rgb(48, 48, 48)\",\n tickColor: ...
2008/10/04
[ "https://Stackoverflow.com/questions/169894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10419/" ]
169,897
<p>I tried to package a Twisted program with py2exe, but once I run the exe file I built, I got a "No module named resource" error. </p> <p>And I found the py2exe said:</p> <blockquote> <p>The following modules appear to be missing ['FCNTL', 'OpenSSL', 'email.Generator', 'email.Iterators', 'email.Utils', 'pkg_resou...
[ { "answer_id": 169913, "author": "teratorn", "author_id": 14739, "author_profile": "https://Stackoverflow.com/users/14739", "pm_score": 5, "selected": true, "text": "python setup.py py2exe -p win32com -i twisted.web.resource\n" }, { "answer_id": 31598939, "author": "K246", ...
2008/10/04
[ "https://Stackoverflow.com/questions/169897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25077/" ]
169,902
<p>Given two image buffers (assume it's an array of ints of size width * height, with each element a color value), how can I map an area defined by a quadrilateral from one image buffer into the other (always square) image buffer? I'm led to understand this is called "projective transformation".</p> <p>I'm also lookin...
[ { "answer_id": 170108, "author": "Sklivvz", "author_id": 7028, "author_profile": "https://Stackoverflow.com/users/7028", "pm_score": 0, "selected": false, "text": "t a a t b b b t" }, { "answer_id": 170124, "author": "b3.", "author_id": 14946, "author_profile": "https...
2008/10/04
[ "https://Stackoverflow.com/questions/169902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173449/" ]
169,904
<p>I'm using HttpListener to allow a user to set up a proxy on a user-defined port. When I start the HttpListener, I get an exception if the application isn't running under administrator privileges in Vista.</p> <p>From what I've read, <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feed...
[ { "answer_id": 195256, "author": "Roger Lipscombe", "author_id": 8446, "author_profile": "https://Stackoverflow.com/users/8446", "pm_score": 6, "selected": false, "text": "netsh http show urlacl\n netsh http add urlacl url=http://+:80/MyUri user=DOMAIN\\User listen=yes\n" }, { "a...
2008/10/04
[ "https://Stackoverflow.com/questions/169904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5/" ]
169,905
<p>I want to write a script which cleans the 'run' dialogue automatically every log off. Where is the history stored?</p>
[ { "answer_id": 169911, "author": "Vincent McNabb", "author_id": 16299, "author_profile": "https://Stackoverflow.com/users/16299", "pm_score": 2, "selected": false, "text": "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU\n" } ]
2008/10/04
[ "https://Stackoverflow.com/questions/169905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4960/" ]
169,907
<p>I need to encode a 100KB+ string as base64 in VBA. Are there any built-in functions or COM objects available which will do this as a pure VBA approach is either complex or doesn't scale well at these volumes (see links from <a href="http://www.vbforums.com/showthread.php?t=379072" rel="noreferrer">dbb</a> and <a hre...
[ { "answer_id": 169945, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 7, "selected": true, "text": "Function EncodeBase64(text As String) As String\n Dim arrData() As Byte\n arrData = StrConv(text, vbFromUnicode) \...
2008/10/04
[ "https://Stackoverflow.com/questions/169907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4023/" ]
169,925
<p>I want to convert a string into a double and after doing some math on it, convert it back to a string.</p> <p>How do I do this in Objective-C?</p> <p>Is there a way to round a double to the nearest integer too?</p>
[ { "answer_id": 169932, "author": "olliej", "author_id": 784, "author_profile": "https://Stackoverflow.com/users/784", "pm_score": 9, "selected": true, "text": "double myDouble = [myString doubleValue];\n int myInt = (int)(myDouble + (myDouble>0 ? 0.5 : -0.5))\n NSString* myNewString = [N...
2008/10/04
[ "https://Stackoverflow.com/questions/169925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23695/" ]
169,973
<p>When is it better to use a <a href="https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1" rel="noreferrer">List</a> vs a <a href="https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.linkedlist-1" rel="noreferrer">LinkedList</a>?</p>
[ { "answer_id": 169983, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 8, "selected": false, "text": "List<T> LinkedList<T> List<T> LinkedList<T> List<T> List<T> Find ToArray LinkedList<T>" }, { "answer_id": 777...
2008/10/04
[ "https://Stackoverflow.com/questions/169973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5274/" ]
170,004
<p>Let's say:</p> <pre><code>&lt;div&gt; pre text &lt;div class="remove-just-this"&gt; &lt;p&gt;child foo&lt;/p&gt; &lt;p&gt;child bar&lt;/p&gt; nested text &lt;/div&gt; post text &lt;/div&gt; </code></pre> <p>to this:</p> <pre><code>&lt;div&gt; pre text &lt;p&gt;child foo&lt;/p&gt; &lt;p&g...
[ { "answer_id": 170056, "author": "jk.", "author_id": 21284, "author_profile": "https://Stackoverflow.com/users/21284", "pm_score": 8, "selected": true, "text": "var cnt = $(\".remove-just-this\").contents();\n$(\".remove-just-this\").replaceWith(cnt);\n" }, { "answer_id": 170142,...
2008/10/04
[ "https://Stackoverflow.com/questions/170004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20838/" ]
170,019
<p>I have an API that is dependent on certain state information between requests. As an easy first version of the code, I am simply using PHP session's to store the state information instead of something more advanced (APC, memcache, DB). Throughout my initial testing in a web browser, everything worked perfectly. Howe...
[ { "answer_id": 170031, "author": "keparo", "author_id": 19468, "author_profile": "https://Stackoverflow.com/users/19468", "pm_score": 5, "selected": true, "text": "mysite.com?PHPSESSID=10alksdjfq9e\n" }, { "answer_id": 170764, "author": "Alan Storm", "author_id": 4668, ...
2008/10/04
[ "https://Stackoverflow.com/questions/170019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8880/" ]
170,021
<p>We are currently running a SQL Job that archives data daily at every 10PM. However, the end users complains that from 10PM to 12, the page shows a time out error.</p> <p>Here's the pseudocode of the job</p> <pre><code>while @jobArchive = 1 and @countProcecessedItem &lt; @maxItem exec ArchiveItems @countProcec...
[ { "answer_id": 170031, "author": "keparo", "author_id": 19468, "author_profile": "https://Stackoverflow.com/users/19468", "pm_score": 5, "selected": true, "text": "mysite.com?PHPSESSID=10alksdjfq9e\n" }, { "answer_id": 170764, "author": "Alan Storm", "author_id": 4668, ...
2008/10/04
[ "https://Stackoverflow.com/questions/170021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24755/" ]
170,028
<p>This seems very noisy to me. Five lines of overhead is just too much.</p> <pre><code>m_Lock.EnterReadLock() Try Return m_List.Count Finally m_Lock.ExitReadLock() End Try </code></pre> <p>So how would you simply this?</p>
[ { "answer_id": 170032, "author": "Jonathan Allen", "author_id": 5274, "author_profile": "https://Stackoverflow.com/users/5274", "pm_score": 0, "selected": false, "text": "Using m_Lock.ReadSection\n Return m_List.Count\nEnd Using\n <Extension()> Public Function ReadSection(ByVal lock A...
2008/10/04
[ "https://Stackoverflow.com/questions/170028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5274/" ]
170,036
<p>Does windows have any decent sampling (eg. non-instrumenting) profilers available? Preferably something akin to Shark on MacOS, although i am willing to accept that i am going to have to pay for such a profiler on windows.</p> <p>I've tried the profiler in VS Team Suite and was not overly impressed, and was wonder...
[ { "answer_id": 171709, "author": "bk1e", "author_id": 8090, "author_profile": "https://Stackoverflow.com/users/8090", "pm_score": 2, "selected": false, "text": "dbghelp.dll symsrv.dll kernrate.exe dbghelp.dll %SystemRoot%\\system32" } ]
2008/10/04
[ "https://Stackoverflow.com/questions/170036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/784/" ]
170,051
<p>I'm trying to make things simpler. Here is my code:</p> <pre><code> If Threading.Monitor.TryEnter(syncRoot) Then Try 'do something Finally Threading.Monitor.Exit(syncRoot) End Try Else 'do something else End If </code></pre> <p>This is even worse t...
[ { "answer_id": 170055, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": false, "text": "using(var token = GetLock(syncLock, timeout)) {\n if(token != null) { ... }\n}\n" }, { "answer_id": 170094, ...
2008/10/04
[ "https://Stackoverflow.com/questions/170051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5274/" ]