qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
93,091
<p>Why is it that they decided to make <code>String</code> immutable in Java and .NET (and some other languages)? Why didn't they make it mutable?</p>
[ { "answer_id": 93099, "author": "jsight", "author_id": 1432, "author_profile": "https://Stackoverflow.com/users/1432", "pm_score": -1, "selected": false, "text": "String" }, { "answer_id": 93170, "author": "Evan DiBiase", "author_id": 2399475, "author_profile": "https...
2008/09/18
[ "https://Stackoverflow.com/questions/93091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2936/" ]
93,100
<p>We all know that prepared statements are one of the best way of fending of SQL injection attacks. What is the best way of creating a prepared statement with an "IN" clause. Is there an easy way to do this with an unspecified number of values? Take the following query for example.</p> <pre><code>SELECT ID,Column1...
[ { "answer_id": 93247, "author": "digiguru", "author_id": 5055, "author_profile": "https://Stackoverflow.com/users/5055", "pm_score": 3, "selected": false, "text": "Create Function [dbo].[SeparateValues]\n(\n @data VARCHAR(MAX),\n @delimiter VARCHAR(10) \n) \n RETURNS @tbldata TA...
2008/09/18
[ "https://Stackoverflow.com/questions/93100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1862/" ]
93,105
<p>Need a function that takes a character as a parameter and returns true if it is a letter.</p>
[ { "answer_id": 93108, "author": "raven", "author_id": 4228, "author_profile": "https://Stackoverflow.com/users/4228", "pm_score": 3, "selected": false, "text": "Private Function IsLetter(ByVal character As String) As Boolean\n IsLetter = UCase$(character) <> LCase$(character)\nEnd Fun...
2008/09/18
[ "https://Stackoverflow.com/questions/93105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4228/" ]
93,128
<p>I'm importing a MySQL dump and getting the following error.</p> <pre><code>$ mysql foo &lt; foo.sql ERROR 1153 (08S01) at line 96: Got a packet bigger than 'max_allowed_packet' bytes </code></pre> <p>Apparently there are attachments in the database, which makes for very large inserts.</p> <hr> <p>This is on my ...
[ { "answer_id": 93165, "author": "GHad", "author_id": 11705, "author_profile": "https://Stackoverflow.com/users/11705", "pm_score": 6, "selected": false, "text": "my.ini [mysqld]\n\nmax_allowed_packet = 10M\n" }, { "answer_id": 93168, "author": "Tomasz Tybulewicz", "author...
2008/09/18
[ "https://Stackoverflow.com/questions/93128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13989/" ]
93,147
<p>I'm supposed to create a simple rule engine in C#. Any leads on how I can proceed?. It's a minimalistic rule engine, and would use SQL server as the back end. Do we have any general blueprint or design patterns that generally apply to rule engines? What kind of .Net technologies can I use to design one? Any directio...
[ { "answer_id": 28099808, "author": "Dib", "author_id": 254215, "author_profile": "https://Stackoverflow.com/users/254215", "pm_score": 0, "selected": false, "text": "[TestMethod]\npublic void GreaterThanRule_WhenGreater_ResultsTrue()\n{\n // ARRANGE\n int threshold = 5;\n int ac...
2008/09/18
[ "https://Stackoverflow.com/questions/93147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
93,150
<p>The Query Optimizer is estimating that the results of a join will have only one row, when the actual number of rows is 2000. This is causing later joins on the dataset to have an estimated result of one row, when some of them go as high as 30,000.</p> <p>With a count of 1, the QO is choosing a loop join/index seek ...
[ { "answer_id": 114811, "author": "Chris Smith", "author_id": 9073, "author_profile": "https://Stackoverflow.com/users/9073", "pm_score": 3, "selected": true, "text": "UPDATE STATISTICS <table> WITH FULLSCAN, ALL\n" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/93150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9073/" ]
93,153
<p>In a .net 2 winforms application, what's a good way to set the culture for the entire application?<br> Setting CurrentThread.CurrentCulture for every new thread is repetitive and error-prone.<br> Ideally I'd like to set it when the app starts and forget about it.</p>
[ { "answer_id": 93622, "author": "Vertigo", "author_id": 5468, "author_profile": "https://Stackoverflow.com/users/5468", "pm_score": 1, "selected": false, "text": "static void Main()\n{\n System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo(\"fi-FI\");\n ...
2008/09/18
[ "https://Stackoverflow.com/questions/93153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/626/" ]
93,159
<p>In our project we have a standard auto-generated designer.cs file, linked to a DBML file, that contains all our object classes that map onto our database tables.</p> <p>We want to pass these objects directly through a WCF Service and so they need decorating with the [DataContract] and [DataMember] attributes where ...
[ { "answer_id": 93640, "author": "Mike Comstock", "author_id": 16872, "author_profile": "https://Stackoverflow.com/users/16872", "pm_score": 0, "selected": false, "text": "public partial class MyDataContext : System.Data.Linq.DataContext\n{\n...\n}\n [DataContract]\npublic partial class M...
2008/09/18
[ "https://Stackoverflow.com/questions/93159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17765/" ]
93,162
<p>Apparently you can easily obtain a client IP address in WCF 3.5 but not in WCF 3.0. Anyone know how?</p>
[ { "answer_id": 93437, "author": "Paul Mrozowski", "author_id": 3656, "author_profile": "https://Stackoverflow.com/users/3656", "pm_score": 7, "selected": false, "text": "using System.ServiceModel;\nusing System.ServiceModel.Channels;\n\nOperationContext context = OperationContext.Current...
2008/09/18
[ "https://Stackoverflow.com/questions/93162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3856/" ]
93,171
<p>I have a bowling web application that allows pretty detailed frame-by-frame information entry. One thing it allows is tracking which pins were knocked down on each ball. To display this information, I make it look like a rack of pins:</p> <pre>o o o o o o o o o o</pre> <p>Images are used to represent the pin...
[ { "answer_id": 93237, "author": "Chris Serra", "author_id": 13435, "author_profile": "https://Stackoverflow.com/users/13435", "pm_score": 0, "selected": false, "text": "<div> <td>...</td>" }, { "answer_id": 93248, "author": "scunliffe", "author_id": 6144, "author_prof...
2008/09/18
[ "https://Stackoverflow.com/questions/93171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/96/" ]
93,177
<p>Does someone know if it is possible to modify the JVM settings at runtime (e.g. -dname=value)? I need this little trick to run my Java stored procedure (oracle 10g).</p>
[ { "answer_id": 3813686, "author": "Saber Chebka", "author_id": 460705, "author_profile": "https://Stackoverflow.com/users/460705", "pm_score": 1, "selected": false, "text": " int times = 2;\n OracleRuntime.setMaxRunspaceSize(times *OracleRuntime.getMaxRunspaceSize());\n OracleRuntime....
2008/09/18
[ "https://Stackoverflow.com/questions/93177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12703/" ]
93,208
<p>I'd like to automatically generate database scripts on a regular basis. Is this possible.</p>
[ { "answer_id": 93282, "author": "Orion Adrian", "author_id": 7756, "author_profile": "https://Stackoverflow.com/users/7756", "pm_score": 4, "selected": true, "text": "exec proc_genscript \n @ServerName = 'Server Name', \n @DBName = 'Database Name', \n @ObjectName = 'Object Name ...
2008/09/18
[ "https://Stackoverflow.com/questions/93208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
93,214
<p>Given the code from the <a href="http://railscasts.com/episodes/75" rel="nofollow noreferrer">Complex Form part III</a> how would you go about testing the virtual attribute?</p> <pre><code> def new_task_attributes=(task_attributes) task_attributes.each do |attributes| tasks.build(attributes) end end...
[ { "answer_id": 93393, "author": "Jason Wadsworth", "author_id": 11078, "author_profile": "https://Stackoverflow.com/users/11078", "pm_score": 3, "selected": true, "text": "def test_adding_task_to_project\n p = Project.new\n new_tasks_attributes = [{ \"name\" => \"paint fence\"}]\n p.n...
2008/09/18
[ "https://Stackoverflow.com/questions/93214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1681/" ]
93,222
<p>I recently received an email from my girlfriend that spamassassin marked as spam, mostly because spamassassin detected a tracker ID... except there wasn't one. I'd like to know what triggered it, so that I can report a sensible bug.</p>
[ { "answer_id": 93393, "author": "Jason Wadsworth", "author_id": 11078, "author_profile": "https://Stackoverflow.com/users/11078", "pm_score": 3, "selected": true, "text": "def test_adding_task_to_project\n p = Project.new\n new_tasks_attributes = [{ \"name\" => \"paint fence\"}]\n p.n...
2008/09/18
[ "https://Stackoverflow.com/questions/93222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15371/" ]
93,231
<p>I'm having a problem debugging an Eclipse Application from Eclipse. When I launch the Debug Configuration, the Eclipse Application starts up and then stops repeatedly. It shows the splash screen and then disappears. This is the farthest it gets before restarting:</p> <pre><code>MyDebugConfiguration [Eclipse Appl...
[ { "answer_id": 93393, "author": "Jason Wadsworth", "author_id": 11078, "author_profile": "https://Stackoverflow.com/users/11078", "pm_score": 3, "selected": true, "text": "def test_adding_task_to_project\n p = Project.new\n new_tasks_attributes = [{ \"name\" => \"paint fence\"}]\n p.n...
2008/09/18
[ "https://Stackoverflow.com/questions/93231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7648/" ]
93,260
<p>It looks quite easy to find such a tool for Java (<a href="http://checkstyle.sourceforge.net/" rel="noreferrer">Checkstyle</a>, <a href="http://jcsc.sourceforge.net/" rel="noreferrer">JCSC</a>), but I can't seem to find one for C/C++. I am not looking for a lint-like static code analyzer, I only would like to check ...
[ { "answer_id": 394860, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "universalindentgui" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/93260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12291/" ]
93,264
<p>I have created a foreign key (in SQL Server) by:</p> <pre><code>alter table company add CountryID varchar(3); alter table company add constraint Company_CountryID_FK foreign key(CountryID) references Country; </code></pre> <p>I then run this query:</p> <pre><code>alter table company drop column CountryID; </code...
[ { "answer_id": 93292, "author": "Mike", "author_id": 1115144, "author_profile": "https://Stackoverflow.com/users/1115144", "pm_score": 9, "selected": true, "text": "alter table company drop constraint Company_CountryID_FK\n\n\nalter table company drop column CountryID\n" }, { "an...
2008/09/18
[ "https://Stackoverflow.com/questions/93264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
93,274
<p>What is the <em>definitive</em> way to mimic the CSS property min-width in Internet Explorer 6? Is it better not to try?</p>
[ { "answer_id": 93296, "author": "kch", "author_id": 13989, "author_profile": "https://Stackoverflow.com/users/13989", "pm_score": 4, "selected": true, "text": "foo { min-width: 100px } // for everyone\n* html foo { width: 100px } // just for IE\n" }, { "answer_id": 93307, ...
2008/09/18
[ "https://Stackoverflow.com/questions/93274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4241/" ]
93,277
<p>I have a rails form with a datetime_select field. When I try to submit the form, I get the following exception:</p> <pre><code>ActiveRecord::MultiparameterAssignmentErrors in WidgetsController#update 1 error(s) on assignment of multiparameter attributes </code></pre> <p>If it's a validation error, why don't I see...
[ { "answer_id": 93327, "author": "Jason Wadsworth", "author_id": 11078, "author_profile": "https://Stackoverflow.com/users/11078", "pm_score": 5, "selected": true, "text": "date_select datetime_select" }, { "answer_id": 2224752, "author": "Zubin", "author_id": 258826, ...
2008/09/18
[ "https://Stackoverflow.com/questions/93277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11078/" ]
93,279
<p>For our online game, we have written tons of PHP classes and functions grouped by theme in files and then folders. In the end, we have now all our backend code (logic &amp; DB access layers) in a set of files that we call <strong>libs</strong> and we include our libs in our GUI (web pages, presentation layer) using ...
[ { "answer_id": 93397, "author": "Jonathan Arkell", "author_id": 11052, "author_profile": "https://Stackoverflow.com/users/11052", "pm_score": 2, "selected": false, "text": "include include_once" }, { "answer_id": 93458, "author": "Marc Gear", "author_id": 6563, "autho...
2008/09/18
[ "https://Stackoverflow.com/questions/93279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11670/" ]
93,294
<p>So I have a nasty stack overflow I have been trying to track down / solve for the past 8 hours or so, and I'm at the point where i think i need advice. </p> <p>The details: Interestingly enough this code runs fine when called in the context of our regular winforms application -- but I am tasked with writing a web-...
[ { "answer_id": 93367, "author": "Mike Dimmick", "author_id": 6970, "author_profile": "https://Stackoverflow.com/users/6970", "pm_score": 1, "selected": false, "text": "_NT_SYMBOL_PATH SRV*C:\\WebSymbols*http://msdl.microsoft.com/download/symbols\n struct class" }, { "answer_id": ...
2008/09/18
[ "https://Stackoverflow.com/questions/93294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17784/" ]
93,335
<p>Does anyone know of a good tool to generate the WSDL for a service contract written in C# (i.e. set of methods that are tagged as "[OperationContract]" using WCF)? All the tools I've found work the other way around: create code stubs from a WSDL. I don't want to have to hand-jam a WSDL file. I've found tools for ...
[ { "answer_id": 97199, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "<configuration><services> <service name=\"MyServiceName\" behaviorConfiguration=\"MyServiceBehavior\">\n <host>\n <bas...
2008/09/18
[ "https://Stackoverflow.com/questions/93335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59910/" ]
93,353
<p>I need to make a random list of permutations. The elements can be anything but assume that they are the integers 0 through x-1. I want to make y lists, each containing z elements. The rules are that no list may contain the same element twice and that over all the lists, the number of times each elements is used i...
[ { "answer_id": 95138, "author": "Terhorst", "author_id": 8062, "author_profile": "https://Stackoverflow.com/users/8062", "pm_score": 3, "selected": true, "text": "import math, random\n\n\ndef get_pool(items, y, z):\n slots = y*z\n\n use_each_times = slots/len(items)\n exceptions...
2008/09/18
[ "https://Stackoverflow.com/questions/93353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4454/" ]
93,357
<p><strong>I want to read the contents of a URL but don't want to "hang" if the URL is unresponsive. I've created a BufferedReader using the URL...</strong></p> <pre><code>URL theURL = new URL(url); URLConnection urlConn = theURL.openConnection(); urlConn.setDoOutput(true); BufferedReader urlReader = new BufferedRead...
[ { "answer_id": 93589, "author": "Javaxpert", "author_id": 15241, "author_profile": "https://Stackoverflow.com/users/15241", "pm_score": 2, "selected": false, "text": "URLConnection.setConnectTimeout(int timeout) isFinished TimerTask ft = new TimerTask(){\n public void run(){\n if (...
2008/09/18
[ "https://Stackoverflow.com/questions/93357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13930/" ]
93,361
<p>We're testing our ClickOnce deployed application internally on IIS (Internet Information Services), but we're wondering if we can deploy it to the wider internet using Apache on Linux so we can make use of our existing external website host.</p> <p>If so, is there anything else I need to consider other than as spec...
[ { "answer_id": 382083, "author": "Don Kirkby", "author_id": 4794, "author_profile": "https://Stackoverflow.com/users/4794", "pm_score": 3, "selected": false, "text": "AddType application/x-ms-application .application\nAddType application/manifest .manifest\nAddType application/octet-stre...
2008/09/18
[ "https://Stackoverflow.com/questions/93361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5662/" ]
93,408
<p>I saw some code like the following in a JSP</p> <pre><code>&lt;c:if test="&lt;%=request.isUserInRole(RoleEnum.USER.getCode())%&gt;"&gt; &lt;li&gt;user&lt;/li&gt; &lt;/c:if&gt; </code></pre> <p>My confusion is over the "=" that appears in the value of the <code>test</code> attribute. My understanding was that a...
[ { "answer_id": 93669, "author": "Mike Spross", "author_id": 17862, "author_profile": "https://Stackoverflow.com/users/17862", "pm_score": 2, "selected": false, "text": "<c:if test=\"true\">\n <li>user</li>\n</c:if>\n" }, { "answer_id": 93717, "author": "Michael", "auth...
2008/09/18
[ "https://Stackoverflow.com/questions/93408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2648/" ]
93,415
<p>I use <a href="http://files.emacsblog.org/ryan/elisp/maxframe.el" rel="noreferrer">maxframe.el</a> to maximize my Emacs frames.</p> <p>It works great on all three major platforms, except on my dual-head Mac setup (Macbook Pro 15-inch laptop with 23-inch monitor). </p> <p>When maximizing an Emacs frame, the frame e...
[ { "answer_id": 93428, "author": "EfForEffort", "author_id": 14113, "author_profile": "https://Stackoverflow.com/users/14113", "pm_score": 2, "selected": false, "text": "\"*The maximum display width to support. This helps better support the true\nnature of display-pixel-width. Since mul...
2008/09/18
[ "https://Stackoverflow.com/questions/93415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13747/" ]
93,417
<p>Suppose you have a collection of a few hundred in-memory objects and you need to query this List to return objects matching some SQL or Criteria like query. For example, you might have a List of Car objects and you want to return all cars made during the 1960s, with a license plate that starts with AZ, ordered by th...
[ { "answer_id": 93738, "author": "Yuval", "author_id": 2819, "author_profile": "https://Stackoverflow.com/users/2819", "pm_score": 0, "selected": false, "text": "Comparator if (Car car : cars) {\n if (1959 < car.getYear() && 1970 > car.getYear() &&\n car.getLicense().startsW...
2008/09/18
[ "https://Stackoverflow.com/questions/93417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17542/" ]
93,423
<p>I have the following code:</p> <pre><code> String inputFile = "somefile.txt"; FileInputStream in = new FileInputStream(inputFile); FileChannel ch = in.getChannel(); ByteBuffer buf = ByteBuffer.allocateDirect(BUFSIZE); // BUFSIZE = 256 /* read the file into a buffer, 256 byte...
[ { "answer_id": 93528, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "File inputFile = new File(\"somefile.txt\");\nBufferedReader reader = new BufferedReader(new FileReader(inputFile));\n readLine...
2008/09/18
[ "https://Stackoverflow.com/questions/93423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10675/" ]
93,439
<p>Is there any website/service which will enable me to add RSS subscription to any website?</p> <p>This is for my company I work. We have a website which displays company related news. These news are supplied by an external agency and they gets updated to our database automatically. Our website picks up random/new ne...
[ { "answer_id": 93477, "author": "ConroyP", "author_id": 2287, "author_profile": "https://Stackoverflow.com/users/2287", "pm_score": 4, "selected": true, "text": "<link rel=\"alternate\" title=\"RSS Feed\" \n href=\"http://www.example.com/rss-feed/latest/\" type=\"application/rss+xml\"...
2008/09/18
[ "https://Stackoverflow.com/questions/93439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12178/" ]
93,462
<p>when an SQL Server Express DB is 'in recovery', you are unable to connect using SQL Authentication. </p> <p>Is there a simple way of determining the stat of the DB prior to connecting to it? (Using .Net)</p>
[ { "answer_id": 93594, "author": "Andy Irving", "author_id": 8553, "author_profile": "https://Stackoverflow.com/users/8553", "pm_score": 2, "selected": false, "text": "SELECT DATABASEPROPERTYEX ('master', 'STATUS') AS 'Status';\n" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/93462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
93,472
<p>Is it possible to use DateTimePicker (Winforms) to pick both date and time (in the dropdown)? How do you change the custom display of the picked value? Also, is it possible to enable the user to type the date/time manually?</p>
[ { "answer_id": 93614, "author": "itsmatt", "author_id": 7862, "author_profile": "https://Stackoverflow.com/users/7862", "pm_score": 9, "selected": true, "text": "dateTimePicker1.Format = DateTimePickerFormat.Custom;\ndateTimePicker1.CustomFormat = \"MM/dd/yyyy hh:mm:ss\"; \n" }, { ...
2008/09/18
[ "https://Stackoverflow.com/questions/93472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5363/" ]
93,511
<p>How to get a counter inside xsl:for-each loop that would reflect the number of current element processed.<br> For example my source XML is</p> <pre><code>&lt;books&gt; &lt;book&gt; &lt;title&gt;The Unbearable Lightness of Being &lt;/title&gt; &lt;/book&gt; &lt;book&gt; &lt;title&gt;Narci...
[ { "answer_id": 93553, "author": "redsquare", "author_id": 6440, "author_profile": "https://Stackoverflow.com/users/6440", "pm_score": 8, "selected": true, "text": "position() <countNo><xsl:value-of select=\"position()\" /></countNo>\n" }, { "answer_id": 93562, "author": "Sant...
2008/09/18
[ "https://Stackoverflow.com/questions/93511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3241/" ]
93,526
<p>A Y-combinator is a computer science concept from the &ldquo;functional&rdquo; side of things. Most programmers don't know much at all about combinators, if they've even heard about them.</p> <ul> <li>What is a Y-combinator?</li> <li>How do combinators work?</li> <li>What are they good for?</li> <li>Are they useful...
[ { "answer_id": 93573, "author": "Zach", "author_id": 9128, "author_profile": "https://Stackoverflow.com/users/9128", "pm_score": 5, "selected": false, "text": "var Y = function(f) {\n return (function(g) {\n return g(g);\n })(function(h) {\n return function() {\n return f(h(...
2008/09/18
[ "https://Stackoverflow.com/questions/93526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2729/" ]
93,539
<p>What is the difference between Views and Materialized Views in Oracle?</p>
[ { "answer_id": 93579, "author": "Jeremiah Peschka", "author_id": 11780, "author_profile": "https://Stackoverflow.com/users/11780", "pm_score": 6, "selected": false, "text": "ON COMMIT REFRESH ON COMMIT REFRESH" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/93539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1782/" ]
93,541
<p>I have a custom user control with a textbox on it and I'd like to expose the baseline (of the text in the textbox) snapline outside of the custom control. I know that you create a designer (inherited from ControlDesigner) and override SnapLines to get access to the snaplines, but I'm wondering how to get the text b...
[ { "answer_id": 95013, "author": "BenR", "author_id": 18039, "author_profile": "https://Stackoverflow.com/users/18039", "pm_score": 2, "selected": false, "text": "Public Overrides ReadOnly Property SnapLines() As System.Collections.IList\n Get\n Dim snapLinesList As ArrayList = ...
2008/09/18
[ "https://Stackoverflow.com/questions/93541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2848/" ]
93,551
<p>Web applications that want to force a resource to be <em>downloaded</em> rather than directly <em>rendered</em> in a Web browser issue a <code>Content-Disposition</code> header in the HTTP response of the form:</p> <p><code>Content-Disposition: attachment; filename=<em>FILENAME</em></code></p> <p>The <code>filename<...
[ { "answer_id": 216777, "author": "Kornel", "author_id": 27009, "author_profile": "https://Stackoverflow.com/users/27009", "pm_score": 8, "selected": false, "text": "Content-Disposition Content-Disposition filename*=UTF-8''foo%c3%a4 /real_script.php/fake_filename.doc\n mod_rewrite /mot%C3...
2008/09/18
[ "https://Stackoverflow.com/questions/93551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6682/" ]
93,569
<p>For example, if I declare a long variable, can I assume it will always be aligned on a "sizeof(long)" boundary? Microsoft Visual C++ online help says so, but is it standard behavior?</p> <p>some more info:</p> <p>a. It is possible to explicitely create a misaligned integer (*bar):</p> <blockquote> <p>char foo[5...
[ { "answer_id": 93585, "author": "Michael Burr", "author_id": 12711, "author_profile": "https://Stackoverflow.com/users/12711", "pm_score": 0, "selected": false, "text": "#define ALIGNMENT_OF( t ) offsetof( struct { char x; t test; }, test )\n" }, { "answer_id": 93797, "author...
2008/09/18
[ "https://Stackoverflow.com/questions/93569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12291/" ]
93,578
<p>I cannot use the Resource File API from within a file system plugin due to a PlatSec issue:</p> <pre><code>*PlatSec* ERROR - Capability check failed - Can't load filesystemplugin.PXT because it links to bafl.dll which has the following capabilities missing: TCB </code></pre> <p>My understanding of the issue is th...
[ { "answer_id": 94169, "author": "MathewI", "author_id": 17938, "author_profile": "https://Stackoverflow.com/users/17938", "pm_score": 3, "selected": true, "text": "TCB ProtServ DiskAdmin AllFiles PowerMgmt CommDD\n bafl.dll" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/93578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8565/" ]
93,583
<p>In a asp.net web application, I want to write to a file. This function will first get data from the database, and then write out the flat file.</p> <p>What can I do to make sure only 1 write occurs, and once the write occurrs, the other threads that maybe want to write to the file don't since the write took place....
[ { "answer_id": 93597, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 2, "selected": false, "text": "lock(this)\n{\n // perform the write.\n}\n" }, { "answer_id": 93674, "author": "Oliver Mellet", "author_id": 1...
2008/09/18
[ "https://Stackoverflow.com/questions/93583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
93,590
<p>I have a question about using streams in .NET to load files from disk. I am trying to pinpoint a performance problem and want to be sure it's where I think it is.</p> <pre><code>Dim provider1 As New MD5CryptoServiceProvider Dim stream1 As FileStream stream1 = New FileStream(FileName, FileMode.Open, FileAccess.Rea...
[ { "answer_id": 93694, "author": "Chris Wenham", "author_id": 5548, "author_profile": "https://Stackoverflow.com/users/5548", "pm_score": 3, "selected": true, "text": "provider1.ComputeHash(stream1.ToArray());\n" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/93590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3059/" ]
93,625
<p>I have a list with two <code>&lt;div&gt;</code>s in every <code>&lt;li&gt;</code> and I want to float them one next to the other and I want the <code>&lt;li&gt;</code> to take the whole availabe space. How do I do it?</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;style...
[ { "answer_id": 93646, "author": "workmad3", "author_id": 16035, "author_profile": "https://Stackoverflow.com/users/16035", "pm_score": -1, "selected": false, "text": "li{width:100%;}\n.a{}\n.b{float: left;}\n" }, { "answer_id": 93647, "author": "Jeremiah Peschka", "author...
2008/09/18
[ "https://Stackoverflow.com/questions/93625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17781/" ]
93,632
<p>I have a CakePHP application that in some moment will show a view with product media (pictures or videos) I want to know if, there is someway to include another view that threats the video or threats the pictures, depending on a flag. I want to use those "small views" to several other purposes, so It should be "like...
[ { "answer_id": 94758, "author": "Paolo Bergantino", "author_id": 16417, "author_profile": "https://Stackoverflow.com/users/16417", "pm_score": 3, "selected": false, "text": "$this->renderElement('display', array('flag' => 'value')); /app/views/elements/ display.thtml $flag $this->element...
2008/09/18
[ "https://Stackoverflow.com/questions/93632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2274/" ]
93,638
<p>I have a WPF app with many list based controls in a window, which all are bound to different CollectionViews.</p> <p>At the window level is there a way to get the current selected item for the currently in focus list based control? I know I can do this with some fairly trivial code by looking for the in focus elem...
[ { "answer_id": 95031, "author": "Andy", "author_id": 3857, "author_profile": "https://Stackoverflow.com/users/3857", "pm_score": 1, "selected": false, "text": "EventManager.RegisterClassHandler(typeof(ListBox), ListBox.SelectionChanged,\n new SelectionChangedEventHandler(this.OnListBo...
2008/09/18
[ "https://Stackoverflow.com/questions/93638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
93,642
<p>We require all requests for downloads to have a valid login (non-http) and we generate transaction tickets for each download. If you were to go to one of the download links and attempt to "replay" the transaction, we use HTTP codes to forward you to get a new transaction ticket. This works fine for a majority of use...
[ { "answer_id": 71583233, "author": "Amin Pial", "author_id": 9258044, "author_profile": "https://Stackoverflow.com/users/9258044", "pm_score": 0, "selected": false, "text": "partial content download - status code 206 partial-content-download Nginx partial-content-download Accept-Ranges: ...
2008/09/18
[ "https://Stackoverflow.com/questions/93642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5581/" ]
93,650
<p>How do you apply stroke (outline around text) to a textblock in xaml in WPF?</p>
[ { "answer_id": 94801, "author": "SmartyP", "author_id": 18005, "author_profile": "https://Stackoverflow.com/users/18005", "pm_score": 3, "selected": false, "text": " <Border BorderBrush=\"Purple\" BorderThickness=\"2\">\n <TextBlock>My fancy TextBlock</TextBlock>\n </Border>...
2008/09/18
[ "https://Stackoverflow.com/questions/93650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3798/" ]
93,653
<p>I've got a stored procedure in my database, that looks like this</p> <pre><code>ALTER PROCEDURE [dbo].[GetCountingAnalysisResults] @RespondentFilters varchar AS BEGIN @RespondentFilters = '''8ec94bed-fed6-4627-8d45-21619331d82a, 114c61f2-8935-4755-b4e9-4a598a51cc7f''' DECLARE @SQL nvarchar(600) SET @SQL = ...
[ { "answer_id": 93701, "author": "Jeremiah Peschka", "author_id": 11780, "author_profile": "https://Stackoverflow.com/users/11780", "pm_score": 1, "selected": false, "text": "\n-- This would be the input parameter of the stored procedure, if you want to do it that way, or a UDF\ndeclare @...
2008/09/18
[ "https://Stackoverflow.com/questions/93653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16003/" ]
93,654
<p>I'd sort of like to use SQLite from within C#.Net, but I can't seem to find an appropriate library. Is there one? An official one? Are there other ways to use SQLite than with a wrapper?</p>
[ { "answer_id": 48971442, "author": "Simon Mourier", "author_id": 403671, "author_profile": "https://Stackoverflow.com/users/403671", "pm_score": 2, "selected": false, "text": "netstandard" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/93654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/93438/" ]
93,655
<p>I have an XML file that's the output from a database. I'm using the Java SAX parser to parse the XML and output it in a different format. The XML contains some invalid characters and the parser is throwing errors like 'Invalid Unicode character (0x5)'</p> <p>Is there a good way to strip all these characters out b...
[ { "answer_id": 7726882, "author": "ogrisel", "author_id": 163740, "author_profile": "https://Stackoverflow.com/users/163740", "pm_score": 3, "selected": false, "text": "Pattern INVALID_XML_CHARS = Pattern.compile(\"[^\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\uD80...
2008/09/18
[ "https://Stackoverflow.com/questions/93655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8973/" ]
93,672
<p>Is there a 7-Zip command-line switch that prevents the filenames from echoing to the screen as they are added to the archive?</p>
[ { "answer_id": 93702, "author": "freespace", "author_id": 8297, "author_profile": "https://Stackoverflow.com/users/8297", "pm_score": 1, "selected": false, "text": "> /dev/null cmd.exe" }, { "answer_id": 93714, "author": "workmad3", "author_id": 16035, "author_profile...
2008/09/18
[ "https://Stackoverflow.com/questions/93672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7519/" ]
93,692
<p>I want to embed Javascript in a hobby game engine of mine. Now that we have the 5th generation of Javascript engines out (all blazing fast) I'm curious what engine would you choose to embed in a C++ framework (that includes actual ease of embeding it)? </p> <p><sup><em>Note: Just to make it clear, I'm not intereste...
[ { "answer_id": 97195, "author": "Daniel James", "author_id": 2434, "author_profile": "https://Stackoverflow.com/users/2434", "pm_score": 3, "selected": false, "text": " * Multiple threads in V8 are allowed, but only one thread at a time\n * is allowed to use V8. The definition of 'using...
2008/09/18
[ "https://Stackoverflow.com/questions/93692", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15124/" ]
93,695
<p>My users would like to be able to hit <kbd>Ctrl</kbd>+<kbd>S</kbd> to save a form. Is there a good cross-browser way of capturing the <kbd>Ctrl</kbd>+<kbd>S</kbd> key combination and submit my form?</p> <p>App is built on Drupal, so jQuery is available.</p>
[ { "answer_id": 93836, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 8, "selected": true, "text": "$(window).keypress(function(event) {\n if (!(event.which == 115 && event.ctrlKey) && !(event.which == 19)) return true;\n al...
2008/09/18
[ "https://Stackoverflow.com/questions/93695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1902010/" ]
93,699
<p>I remember seeing a while ago that there is some method in maybe the Reflection namespace that would recursively run <code>ToString()</code> on all of an object's properties and format it nicely for display. </p> <p>Yes, I know everything I could want will be accessible through the debugger, but I'm wondering if a...
[ { "answer_id": 41033428, "author": "Tomasz Swider", "author_id": 1904485, "author_profile": "https://Stackoverflow.com/users/1904485", "pm_score": 2, "selected": false, "text": "using Newtonsoft.Json;\n\nstatic class Pretty\n{\n public static void Print<T> (T x)\n {\n string...
2008/09/18
[ "https://Stackoverflow.com/questions/93699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
93,705
<p>I have an application in which users interact with each-other. I want to visualize these interactions so that I can determine whether clusters of users exist (within which interactions are more frequent).</p> <p>I've assigned a 2D point to each user (where each coordinate is between 0 and 1). My idea is that two ...
[ { "answer_id": 93822, "author": "Thomas Kammeyer", "author_id": 4410, "author_profile": "https://Stackoverflow.com/users/4410", "pm_score": 1, "selected": false, "text": " neato draws undirected graphs using ``spring'' models (see Kamada and\n Kawai, Information Processing Letters 31...
2008/09/18
[ "https://Stackoverflow.com/questions/93705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16050/" ]
93,708
<p>I have an asp.net application that runs exclusively on IE7 (internal web site).</p> <p>When a user needs to enter data, I pop up a child window with a form. When the form closes, it calls javascript:window.opener.location.reload(true) so that the new data will display on the main page.</p> <p>The problem is that t...
[ { "answer_id": 93806, "author": "Jonathan Lonowski", "author_id": 15031, "author_profile": "https://Stackoverflow.com/users/15031", "pm_score": 0, "selected": false, "text": "window.opener.location = '#';\n" }, { "answer_id": 4342773, "author": "Anish Joseph", "author_id"...
2008/09/18
[ "https://Stackoverflow.com/questions/93708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17870/" ]
93,710
<p>Basically, something similar to System.Xml.XmlWriter - A streaming XML Writer that doesn't incur much of a memory overhead. So that rules out xml.dom and xml.dom.minidom. Suggestions?</p>
[ { "answer_id": 93871, "author": "AdamKG", "author_id": 16361, "author_profile": "https://Stackoverflow.com/users/16361", "pm_score": -1, "selected": false, "text": "lxml.etree .write() from lxml.etree import XML\n\ntree = XML('<root><a><b/></a></root>')\ntree.write(your_file_object)\n" ...
2008/09/18
[ "https://Stackoverflow.com/questions/93710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17865/" ]
93,716
<p>How can I hide the title bar from a Windows Form but still have a Resizing Frame?</p>
[ { "answer_id": 93721, "author": "Brian Gillespie", "author_id": 6151, "author_profile": "https://Stackoverflow.com/users/6151", "pm_score": 5, "selected": true, "text": "ControlBox = false\nText = \"\"\n" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/93716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6151/" ]
93,720
<p><strong>How do I represent an aggregation relation between two classes in UML, such that each class has a link to the other class's interface, not the implementing class?</strong></p> <p>E.g. I have a class Foo that implements iFoo, and Bar that implements iBar. Foo should have a member variable of type iBar, and B...
[ { "answer_id": 93721, "author": "Brian Gillespie", "author_id": 6151, "author_profile": "https://Stackoverflow.com/users/6151", "pm_score": 5, "selected": true, "text": "ControlBox = false\nText = \"\"\n" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/93720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16399/" ]
93,728
<p>I want to do the following imports in a class.</p> <pre><code>import org.eclipse.jdt.core.dom.*; import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.core.compiler.IProblem; import org.eclipse.jdt.internal.compiler.ClassFile; import org.eclipse.jdt.internal.compiler.CompilationResult; ...
[ { "answer_id": 454386, "author": "jamesh", "author_id": 4737, "author_profile": "https://Stackoverflow.com/users/4737", "pm_score": 2, "selected": false, "text": "internal Import-Package" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/93728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5915/" ]
93,744
<p>For the life of me, I can't remember how to set, delete, toggle or test a bit in a bitfield. Either I'm unsure or I mix them up because I rarely need these. So a "bit-cheat-sheet" would be nice to have.</p> <p>For example: </p> <pre><code>flags = flags | FlagsEnum.Bit4; // Set bit 4. </code></pre> <p>or</p> <pr...
[ { "answer_id": 93785, "author": "Stephen Deken", "author_id": 7154, "author_profile": "https://Stackoverflow.com/users/7154", "pm_score": 7, "selected": false, "text": "flags |= 0x04;\n flags &= ~0x04;\n flags |= 1 << offset;\nflags &= ~(1 << offset);\n" }, { "answer_id": 93872, ...
2008/09/18
[ "https://Stackoverflow.com/questions/93744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15328/" ]
93,767
<p>I am using the mootools based Rokbox plugin, on one of my sites, and I can't figure out how to close it with javascript.</p> <p>I triggered the click event on the close button, but that did not work.</p> <p>I found the code in the rokbox source that is used to add the click listener</p> <pre><code>this.closeButto...
[ { "answer_id": 94526, "author": "Aeon", "author_id": 13289, "author_profile": "https://Stackoverflow.com/users/13289", "pm_score": 1, "selected": false, "text": "this self.swtch=false;\nself.close(e);\n self var rokbox = new RokBox(...);\n rokbox.close(); \n swtch=false" }, { "an...
2008/09/18
[ "https://Stackoverflow.com/questions/93767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
93,770
<p>For deployment reasons, I am trying to use IJW to wrap a C# assembly in C++ instead of using a COM Callable Wrapper. </p> <p>I've done it on other projects, but on this one, I am getting an EEFileLoadException. Any help would be appreciated!</p> <p>Managed C++ wrapper code (this is in a DLL):</p> <pre><code>ext...
[ { "answer_id": 96651, "author": "Adam Tegen", "author_id": 4066, "author_profile": "https://Stackoverflow.com/users/4066", "pm_score": 6, "selected": true, "text": "/// <summary>\n/// Summary for AssemblyResolver\n/// </summary>\npublic ref class AssemblyResolver\n{\npublic:\n\nstatic As...
2008/09/18
[ "https://Stackoverflow.com/questions/93770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4066/" ]
93,832
<p>What is the preferred way to open a URL from a thick client application on Windows using C# and the .NET framework? I want it to use the default browser.</p>
[ { "answer_id": 93866, "author": "Martin", "author_id": 770, "author_profile": "https://Stackoverflow.com/users/770", "pm_score": 1, "selected": false, "text": "private void launchURL_Click(object sender, System.EventArgs e){\n string targetURL = \"http://stackoverflow.com\";\n System.Dia...
2008/09/18
[ "https://Stackoverflow.com/questions/93832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17891/" ]
93,834
<p>I was recently working on an application that sent and received messages over Ethernet and Serial. I was then tasked to <strong>add</strong> the monitoring of DIO discretes. I throught, </p> <blockquote> <p>"No reason to interrupt the main thread which is involved in message processing, I'll just create ...
[ { "answer_id": 94271, "author": "harningt", "author_id": 12713, "author_profile": "https://Stackoverflow.com/users/12713", "pm_score": 2, "selected": false, "text": "Per CPU [*] EVENTLOOP ------ Handles nonblocking I/O using OS/library utilities\n | ...
2008/09/18
[ "https://Stackoverflow.com/questions/93834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25/" ]
93,839
<p>If you have binary strings (literally String objects that contain only 1's and 0's), how would you output them as bits into a file?</p> <p>This is for a text compressor I was working on; it's still bugging me, and it'd be nice to finally get it working. Thanks!</p>
[ { "answer_id": 93889, "author": "Tomer Gabel", "author_id": 11558, "author_profile": "https://Stackoverflow.com/users/11558", "pm_score": 4, "selected": true, "text": "\nbyte[] buffer = new byte[ ( string.length + 7 ) / 8 ];\nfor ( int i = 0; i < buffer.length; ++i ) {\n byte current =...
2008/09/18
[ "https://Stackoverflow.com/questions/93839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6833/" ]
93,853
<p>I have seen this problem arise in many different circumstances and would like to get the best practices for fixing / debugging it on StackOverflow.</p> <p>To use a real world example this occurred to me this morning:</p> <pre><code>expected announcement.rb to define Announcement </code></pre> <p>The class worked ...
[ { "answer_id": 94243, "author": "Joe Van Dyk", "author_id": 17076, "author_profile": "https://Stackoverflow.com/users/17076", "pm_score": 5, "selected": true, "text": "Announcement" }, { "answer_id": 94797, "author": "Ian Terrell", "author_id": 9269, "author_profile":...
2008/09/18
[ "https://Stackoverflow.com/questions/93853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4748/" ]
93,879
<p>The located assembly's manifest definition does not match the assembly reference</p> <p>getting this when running nunit through ncover. Any idea?</p>
[ { "answer_id": 8375396, "author": "Björn van den Heuvel", "author_id": 1080049, "author_profile": "https://Stackoverflow.com/users/1080049", "pm_score": 2, "selected": false, "text": "CreateObject" }, { "answer_id": 14359707, "author": "Rick Troupin", "author_id": 1983830...
2008/09/18
[ "https://Stackoverflow.com/questions/93879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
93,888
<p>By default the session expiry seems to be 20 minutes. </p> <p>Update: I do not want the session to expire until the browser is closed.</p> <p>Update2: This is my scenario. User logs into site. Plays around the site. Leaves computer to go for a shower (>20 mins ;)). Comes back to computer and <em>should</em> be abl...
[ { "answer_id": 93968, "author": "Toby Mills", "author_id": 12377, "author_profile": "https://Stackoverflow.com/users/12377", "pm_score": 1, "selected": false, "text": "Session.Abandon();" }, { "answer_id": 94362, "author": "Simon Forrest", "author_id": 4733, "author_p...
2008/09/18
[ "https://Stackoverflow.com/questions/93888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17404/" ]
93,900
<p>I have this workspace downloaded off the web and I try running it on a tomcat server from a fresh installation of Eclipse Ganymede. This particular project came with its own workspace. </p> <p>When I select Tomcat v6.0 I get a message </p> <blockquote> <p>Cannot create a server using the selected type</p> </bloc...
[ { "answer_id": 376748, "author": "Jim Kiley", "author_id": 7178, "author_profile": "https://Stackoverflow.com/users/7178", "pm_score": 2, "selected": false, "text": "<Context> <C ontext>" }, { "answer_id": 409958, "author": "Mantas K.", "author_id": 51240, "author_pro...
2008/09/18
[ "https://Stackoverflow.com/questions/93900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10523/" ]
93,911
<p>Part of our java application needs to run javascript that is written by non-developers. These non-developers are using javascript for data formatting. (Simple logic and string concatenation mostly).</p> <p>My question is how can I setup the execution of these scripts to make sure scripting errors don't have a majo...
[ { "answer_id": 754792, "author": "Thilo", "author_id": 14955, "author_profile": "https://Stackoverflow.com/users/14955", "pm_score": 4, "selected": false, "text": " protected void observeInstructionCount(Context cx, int instructionCount)\n {\n MyContext mcx = (MyContext)cx;\n lon...
2008/09/18
[ "https://Stackoverflow.com/questions/93911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5569/" ]
93,932
<p>We are getting an error in a VB6 application that sends data back and forth over TCP sockets. We get a runtime error "out of string space". Has anyone seen this or have any thoughts on why this would happen? It seems like we are hitting some VB6 threshhold so any other thoughts would be helpful as well.</p>
[ { "answer_id": 94043, "author": "Robit", "author_id": 17026, "author_profile": "https://Stackoverflow.com/users/17026", "pm_score": 2, "selected": false, "text": "MyString = \"Hello\"\nFor Count = 1 To 100\nMyString = MyString & MyString\nNext Count\n Assign the string to a variable of...
2008/09/18
[ "https://Stackoverflow.com/questions/93932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4653/" ]
93,944
<p>You might have a set of properties that is used on the developer machine, which varies from developer to developer, another set for a staging environment, and yet another for the production environment. </p> <p>In a Spring application you may also have beans that you want to load in a local environment but not in a...
[ { "answer_id": 94631, "author": "enricopulatzo", "author_id": 9883, "author_profile": "https://Stackoverflow.com/users/9883", "pm_score": 2, "selected": false, "text": "-Pproduction" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/93944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17542/" ]
93,976
<p>How do you check if a one-character String is a letter - including any letters with accents?</p> <p>I had to work this out recently, so I'll answer it myself, after the recent VB6 question reminded me.</p>
[ { "answer_id": 93979, "author": "Peter Hilton", "author_id": 2670, "author_profile": "https://Stackoverflow.com/users/2670", "pm_score": 6, "selected": true, "text": "string.matches(\"\\\\p{L}\"); // Unicode letter\nstring.matches(\"\\\\p{Lu}\"); // Unicode upper-case letter\n Character....
2008/09/18
[ "https://Stackoverflow.com/questions/93976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2670/" ]
93,981
<p>Suppose I have a design like this:</p> <p>Object GUI has two objects: object aManager and object bManager, which don't ever talk to each other.</p> <p>Both aManager and bManager have object cManager as an attribute (or rather a pointer to cManager). So when aManager modifies its cManager, it's affecting bManager's...
[ { "answer_id": 94202, "author": "Tim Frey", "author_id": 1471, "author_profile": "https://Stackoverflow.com/users/1471", "pm_score": 1, "selected": false, "text": "public GUI(CManager cManager)\n{\n this.aManager = new AManager(cManager);\n this.bManager = new BManager(cManager);\n...
2008/09/18
[ "https://Stackoverflow.com/questions/93981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17861/" ]
93,983
<p>How can I take the string <code>foo[]=1&amp;foo[]=5&amp;foo[]=2</code> and return a collection with the values <code>1,5,2</code> in that order. I am looking for an answer using regex in C#. Thanks</p>
[ { "answer_id": 94009, "author": "jjnguy", "author_id": 2598, "author_profile": "https://Stackoverflow.com/users/2598", "pm_score": 1, "selected": false, "text": "String[] nums = String.split(yourString, \"&?foo[]\");\n String.split()" }, { "answer_id": 94038, "author": "Anya ...
2008/09/18
[ "https://Stackoverflow.com/questions/93983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17872/" ]
93,989
<p>In .NET, what's the best way to prevent multiple instances of an app from running at the same time? And if there's no "best" technique, what are some of the caveats to consider with each solution?</p>
[ { "answer_id": 94059, "author": "Thomas Wagner", "author_id": 13997, "author_profile": "https://Stackoverflow.com/users/13997", "pm_score": 5, "selected": false, "text": "if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1)\n{\n AppLog.Write(\"Application ...
2008/09/18
[ "https://Stackoverflow.com/questions/93989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5682/" ]
94,011
<p>Here is my problem: I've got a dialog with some parameters that the user can change (via a spinner for example). Each time one of these parameters is changed, I launch a thread to update a 3D view according to the new parameter value. If the user changes another value (or the same value again by clicking many times...
[ { "answer_id": 94031, "author": "Dave L.", "author_id": 3093, "author_profile": "https://Stackoverflow.com/users/3093", "pm_score": 3, "selected": false, "text": "volatile boolean run Thread.stop()" }, { "answer_id": 94068, "author": "Olvagor", "author_id": 17473, "au...
2008/09/18
[ "https://Stackoverflow.com/questions/94011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2612/" ]
94,023
<p>I came across a controller in an older set of code (Rails 1.2.3) that had the following in a controller:</p> <pre><code>class GenericController &gt; ApplicationController # filters and such model :some_model </code></pre> <p>Although the name of the model does not match the name of the model, is there any ...
[ { "answer_id": 94041, "author": "kch", "author_id": 13989, "author_profile": "https://Stackoverflow.com/users/13989", "pm_score": 3, "selected": true, "text": "require" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/94023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13710/" ]
94,037
<p>How can I convert a character to its ASCII code using JavaScript?</p> <p>For example:</p> <blockquote> <p>get 10 from &quot;\n&quot;.</p> </blockquote>
[ { "answer_id": 94049, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 12, "selected": true, "text": "\"\\n\".charCodeAt(0);\n" }, { "answer_id": 9539389, "author": "Mohsen", "author_id": 650722, "author_profile...
2008/09/18
[ "https://Stackoverflow.com/questions/94037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4465/" ]
94,042
<p><strong>Here is my current question:</strong></p> <p>I'm guessing that my problem (described below) is being caused by ASP.NET worker processes being recycled, per the answers below—I'm using InProc sessions storage and don't see much chance of moving away, due to the restriction for other types of storage that all...
[ { "answer_id": 112284, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "...\n...\n<system.web>\n...\n...\n <healthMonitoring>\n <rules>\n <add name=\"Application Events\"\n ...
2008/09/18
[ "https://Stackoverflow.com/questions/94042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5696/" ]
94,047
<p>I'd like to use regular expressions in selecting elements using the match function. I'd prefer not to use an external library (such as saxon) to do this. </p>
[ { "answer_id": 340867, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "CustomDate custDate = new CustomDate() ;\n <xsl:transform\n version=\"1.0\"\n xmlns:xsl=\"http://www.w3.org/1999...
2008/09/18
[ "https://Stackoverflow.com/questions/94047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
94,053
<p>For ASP.Net application deployment what type of information (if any) are you storing in the machine.config? </p> <p>If you're not using it, how are you managing environment specific configuration settings that may change for each environment?</p> <p>I'm looking for some "best practices" and the benefits/pitfalls o...
[ { "answer_id": 94152, "author": "Jesse C. Slicer", "author_id": 3312, "author_profile": "https://Stackoverflow.com/users/3312", "pm_score": 2, "selected": false, "text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration>\n <mscorlib>\n <cryptographySettings>\n ...
2008/09/18
[ "https://Stackoverflow.com/questions/94053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
94,074
<p>I'm using wget to connect to a secure site like this:</p> <p><code>wget -nc -i inputFile</code></p> <p>where inputeFile consists of URLs like this:</p> <p><code><a href="https://clientWebsite.com/TheirPageName.asp?orderValue=1.00&amp;merchantID=36&amp;programmeID=92&amp;ref=foo&amp;Ofaz=0" rel="nofollow noreferre...
[ { "answer_id": 94100, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 3, "selected": false, "text": "-U \"Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-GB; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1\" \n --no-check-certi...
2008/09/18
[ "https://Stackoverflow.com/questions/94074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
94,103
<p>Does anyone know how SQL Server determines the order triggers (of same type, i.e. before triggers) are executed. And is there any way of changing this so that I can specify the order I want. If not, why not.</p> <p>Thanks.</p>
[ { "answer_id": 94158, "author": "EvilEddie", "author_id": 12986, "author_profile": "https://Stackoverflow.com/users/12986", "pm_score": 2, "selected": false, "text": "sp_Settriggerorder sp_settriggerorder [ @triggername = ] ‘[ triggerschema. ] triggername’\n, [ @order = ] ‘value’\n, [ @s...
2008/09/18
[ "https://Stackoverflow.com/questions/94103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11989/" ]
94,112
<p>My code takes an interface as input but only excercises a couple of the interface's methods (often, just getters).</p> <p>When testing the code, I'd love to define an anonymous inner class that returns the test data. But what do I do about all the other methods that the interface requires?</p> <p>I could use my I...
[ { "answer_id": 94159, "author": "Burkhard", "author_id": 12860, "author_profile": "https://Stackoverflow.com/users/12860", "pm_score": 0, "selected": false, "text": "class MyAdapter extends MyClass {\n public void A() {\n }\n ...\n}\n" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/94112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11766/" ]
94,123
<p>I'm working on a webapp, and every so often we run into situations where pages will load without applying CSS. This problem has shown up in IE6, IE7, Safari 3, and FF3.</p> <p>A page refresh will always fix the problem.</p> <p>There are 3 CSS files loaded, all within the same style block using @import:</p> <pre><...
[ { "answer_id": 98158, "author": "da5id", "author_id": 14979, "author_profile": "https://Stackoverflow.com/users/14979", "pm_score": 3, "selected": true, "text": "<link rel=\"stylesheet\" href=\"[base css file]\" type=\"text/css\" media=\"screen\" />\n" }, { "answer_id": 8058417, ...
2008/09/18
[ "https://Stackoverflow.com/questions/94123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17887/" ]
94,141
<p>I have the following script, where the first and third <code>document.writeline</code> are static and <strong>the second is generated</strong>:</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; document.write("&lt;script language='javascript' type='text/javascript' src='before.js'&gt;&lt;\/...
[ { "answer_id": 94328, "author": "Prestaul", "author_id": 5628, "author_profile": "https://Stackoverflow.com/users/5628", "pm_score": 1, "selected": false, "text": "var se1 = document.createElement('script');\nse1.src = 'a.js';\n\nvar se2 = document.createElement('script');\nse2.src = 'b....
2008/09/18
[ "https://Stackoverflow.com/questions/94141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4979/" ]
94,148
<p>Working on a project that parses a log of events, and then updates a model based on properties of those events. I've been pretty lazy about "getting it done" and more concerned about upfront optimization, lean code, and proper design patterns. Mostly a self-teaching experiment. I am interested in what patterns more ...
[ { "answer_id": 220017, "author": "moffdub", "author_id": 10759, "author_profile": "https://Stackoverflow.com/users/10759", "pm_score": 1, "selected": false, "text": "class Event\n{\n // maps property name to property value\n private Map<String, String> properties;\n\n // maps pr...
2008/09/18
[ "https://Stackoverflow.com/questions/94148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2204759/" ]
94,153
<p>I am attempting to use the 'tempfile' module for manipulating and creating text files. Once the file is ready I want to save it to disk. I thought it would be as simple as using 'shutil.copy'. However, I get a 'permission denied' IOError:</p> <pre><code>&gt;&gt;&gt; import tempfile, shutil &gt;&gt;&gt; f = tempfile...
[ { "answer_id": 94206, "author": "Hans Sjunnesson", "author_id": 8683, "author_profile": "https://Stackoverflow.com/users/8683", "pm_score": 3, "selected": false, "text": "new_file = open('bar.txt', 'rw')\nshutil.copyfileobj(f, new_file)\n" }, { "answer_id": 94339, "author": "...
2008/09/18
[ "https://Stackoverflow.com/questions/94153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872/" ]
94,154
<p>I'm trying to configure the Quick Launch menu to only display the ancestors and descendant nodes of the currently select node. The menu also needs to display all the childern of the root node. More simply:</p> <p>Given a site map of:</p> <p><strong>RootSite</strong></p> <p>---<strong>SubSite1</strong> = navigatio...
[ { "answer_id": 129428, "author": "Sixto Saez", "author_id": 9711, "author_profile": "https://Stackoverflow.com/users/9711", "pm_score": 3, "selected": true, "text": "<%@ Register TagPrefix=\"myCustom\" Namespace=\"YourCompany.CustomWebParts\"\n Assembly=\"YourCompany.CustomWebParts, Ve...
2008/09/18
[ "https://Stackoverflow.com/questions/94154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9711/" ]
94,161
<p>I'm working on a project that will be distributed with GNU autoconf/automake, and I have a set of bash scripts which call awk scripts. I would like the bash scripts to end up in the $PATH, but not the awk scripts. How should I insert these into the project? Should they be put in with other binaries?</p> <p>Also,...
[ { "answer_id": 94259, "author": "terminus", "author_id": 9232, "author_profile": "https://Stackoverflow.com/users/9232", "pm_score": 3, "selected": true, "text": "scriptsdir = $(prefix)/bin\nscripts_DATA = awkscript1 awkscript2\n" } ]
2008/09/18
[ "https://Stackoverflow.com/questions/94161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17925/" ]
94,171
<p>In C#.Net WPF During UserControl.Load -></p> <p>What is the best way of showing a whirling circle / 'Loading' Indicator on the UserControl until it has finished gathering data and rendering it's contents?</p>
[ { "answer_id": 95143, "author": "dcstraw", "author_id": 10391, "author_profile": "https://Stackoverflow.com/users/10391", "pm_score": 5, "selected": true, "text": "<Grid>\n <Grid x:Name=\"MainContent\" IsEnabled=\"False\">\n ...\n </Grid>\n\n <Grid x:Name=\"LoadingIndicatorPa...
2008/09/18
[ "https://Stackoverflow.com/questions/94171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352728/" ]
94,177
<p>I have the following XAML: </p> <pre><code>&lt;TextBlock Text="{Binding ElementName=EditListBox, Path=SelectedItems.Count}" Margin="0,0,5,0"/&gt; &lt;TextBlock Text="items selected"&gt; &lt;TextBlock.Style&gt; &lt;Style TargetType="{x:Type TextBlock}"&gt; &lt;Style.Triggers&gt; ...
[ { "answer_id": 94690, "author": "Alan Le", "author_id": 1133, "author_profile": "https://Stackoverflow.com/users/1133", "pm_score": 5, "selected": true, "text": "public class CountToSelectedTextConverter : IValueConverter\n{\n #region IValueConverter Members\n\n public object Conve...
2008/09/18
[ "https://Stackoverflow.com/questions/94177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2284/" ]
94,204
<p>What is the best way to have synchronized a collection of objects between various threads in .Net?</p> <p>I need to have a List or Dictionary accessed from different threads in a thread safe mode. With Adds, Removes, Foreachs, etc.</p>
[ { "answer_id": 94276, "author": "Thomee", "author_id": 12825, "author_profile": "https://Stackoverflow.com/users/12825", "pm_score": 0, "selected": false, "text": "\n Collections::Queue ^unsafe_queue = gcnew Collections::Queue();\n Collections::Queue ^safe_queue = Collections::Queu...
2008/09/18
[ "https://Stackoverflow.com/questions/94204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16613/" ]
94,226
<p>I have 4 versions of file A.txt in my subversion repository, say: A.txt.r1, A.txt.r2, A.txt.r3 and A.txt.r4. My working copy of the file is r4 and I want to switch back to r2. I don't want to use "<em>svn update -r 2 A.txt</em>" because this will delete all the revisions after r2, namely r3 and r4. </p> <p>So is th...
[ { "answer_id": 94258, "author": "kch", "author_id": 13989, "author_profile": "https://Stackoverflow.com/users/13989", "pm_score": 2, "selected": false, "text": "svn up -r2 file svn up -r4 file" }, { "answer_id": 94351, "author": "Kent Fredric", "author_id": 15614, "au...
2008/09/18
[ "https://Stackoverflow.com/questions/94226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8203/" ]
94,227
<p>C++ is all about memory ownership - aka <strong>ownership semantics</strong>.</p> <p>It is the responsibility of the owner of a chunk of dynamically allocated memory to release that memory. So the question really becomes who owns the memory.</p> <p>In C++ ownership is documented by the type a <em>raw</em> pointer is...
[ { "answer_id": 94262, "author": "Matt Cruikshank", "author_id": 8643, "author_profile": "https://Stackoverflow.com/users/8643", "pm_score": 2, "selected": false, "text": "std::tr1::shared_ptr<Blah>" }, { "answer_id": 94512, "author": "Fabio Ceconello", "author_id": 8999, ...
2008/09/18
[ "https://Stackoverflow.com/questions/94227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14065/" ]
94,241
<p>in "CSS: The missing manual" the author says that font-size: medium (or other size keywords) sets the font relative to the <em>browser's</em> base font size.</p> <p>But what I'm seeing in FF2 and IE6 is that it sets the font size to what I specified in the .CSS HTML or BODY style (which is much preferred).</p> <p...
[ { "answer_id": 94330, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "body {\n font: normal 100% \"Arial\",\"Helvetica\",sans-serif;\n}\np, li, td {\n font-size: .85em;\n}\nli p, td p {\n fon...
2008/09/18
[ "https://Stackoverflow.com/questions/94241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4906/" ]
94,274
<p>This has been a problem that I haven't been able to figure out for sometime. Preventing the second instance is trivial and has many methods, however, bringing back the already running process isn't. I would like to:</p> <ul> <li>Minimized: Undo the minimize and bring the running instance to the front.</li> <li>Be...
[ { "answer_id": 64445715, "author": "user4565320", "author_id": 4565320, "author_profile": "https://Stackoverflow.com/users/4565320", "pm_score": 1, "selected": false, "text": " If App.PrevInstance = True Then\n MsgBox \"Already running....\"\n Unload Me\n Exit Sub\n End If\n"...
2008/09/18
[ "https://Stackoverflow.com/questions/94274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8505/" ]
94,305
<p>Lets say I have the option of identifying a code path to take on the basis of a string comparison or else iffing the type:</p> <p>Which is quicker and why?</p> <pre><code>switch(childNode.Name) { case "Bob": break; case "Jill": break; case "Marko": break; } if(childNode is Bob) { } e...
[ { "answer_id": 94408, "author": "Aeon", "author_id": 13289, "author_profile": "https://Stackoverflow.com/users/13289", "pm_score": -1, "selected": false, "text": "switch(childNode.Type)\n{\ncase Bob:\n break;\ncase Jill:\n break;\ncase Marko:\n break;\n}\n" }, { "answer_id": 9...
2008/09/18
[ "https://Stackoverflow.com/questions/94305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1143/" ]
94,316
<p>I want to change the Text of the browse button in the FileUpload Control (System.Web.UI.WebControls), instead of the [Browse...] text I want to use [...]</p>
[ { "answer_id": 10112832, "author": "BonDini", "author_id": 1200259, "author_profile": "https://Stackoverflow.com/users/1200259", "pm_score": 4, "selected": false, "text": "asp:FileUpload <a href=\"#\" id=\"lnkAttachSOW\">Attach File</a>\n <asp:FileUpload ID=\"fuSOW\" runat=\"server\" sty...
2008/09/18
[ "https://Stackoverflow.com/questions/94316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]