qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
389,779
<p>Let's consider a C++ class. At the beginning of the execution I want to read a set of values from an XML file and assign them to 7 of the data members of this class. Those values do not change during the whole execution and they have to be shared by all the objects / instances of the class in question. Are static da...
[ { "answer_id": 390355, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 1, "selected": false, "text": "class xml_stuff {\npublic:\n xml_stuff() {\n // 1. touch all members once\n // => 2. they ...
2008/12/23
[ "https://Stackoverflow.com/questions/389779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48716/" ]
389,788
<p>so i've got this, roughly:</p> <pre><code>&lt;div id="A"&gt; &lt;ul&gt; &lt;li id="B"&gt;foo&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="C"&gt; ... &lt;/div&gt; </code></pre> <p>These are positioned so that B and C overlap.</p> <p>A has a <code>z-index</code> of <code>90</code>, B has a <c...
[ { "answer_id": 389815, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 5, "selected": true, "text": "z-index" } ]
2008/12/23
[ "https://Stackoverflow.com/questions/389788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56817/" ]
389,797
<p>Visual Studio compiles this code fine, but gcc only lets it compile without the Template operator. With the Template operator it gives the following errors:</p> <p>Line 29: error: expected `;' before "itrValue"</p> <pre><code>class Test { public: Test&amp; operator&lt;&lt;(const char* s) {return *this;} // no...
[ { "answer_id": 389811, "author": "Pieter", "author_id": 5822, "author_profile": "https://Stackoverflow.com/users/5822", "pm_score": 4, "selected": false, "text": "typename std::list<T>::const_iterator\n" }, { "answer_id": 390054, "author": "David Rodríguez - dribeas", "au...
2008/12/23
[ "https://Stackoverflow.com/questions/389797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
389,803
<p>Is there a setting in SQL Server to have null = null evaluate to true?</p>
[ { "answer_id": 389810, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 2, "selected": false, "text": "SET ANSI_NULLS OFF\n" } ]
2008/12/23
[ "https://Stackoverflow.com/questions/389803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5232/" ]
389,813
<p>I need to sort some objects according to their contents (in fact according to one of their properties, which is NOT the key and may be duplicated between different objects).</p> <p>.NET provides two classes (<a href="https://msdn.microsoft.com/en-us/library/f7fta44c(v=vs.110).aspx" rel="noreferrer">SortedDictionary...
[ { "answer_id": 389872, "author": "Frank Krueger", "author_id": 338, "author_profile": "https://Stackoverflow.com/users/338", "pm_score": 0, "selected": false, "text": "Key" }, { "answer_id": 389891, "author": "Brann", "author_id": 47341, "author_profile": "https://Sta...
2008/12/23
[ "https://Stackoverflow.com/questions/389813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47341/" ]
389,821
<p>I'm still having a hard time not wanting to use Tables to do my Details View Layout in HTML. I want to run some samples by people and get some opinions.</p> <p>What you would prefer to see in the html for a Details View? Which one has the least hurddles cross browser? Which is the most compliant? Which one look...
[ { "answer_id": 389947, "author": "Gareth", "author_id": 31582, "author_profile": "https://Stackoverflow.com/users/31582", "pm_score": 3, "selected": true, "text": "<fieldset>\n <label for=\"name\">XXX <input type=\"text\" id=\"name\"/></label>\n <label for=\"email\">XXX <input type=\"t...
2008/12/23
[ "https://Stackoverflow.com/questions/389821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37881/" ]
389,825
<p>I am trying to recreate something similar to the popup keyboard used in safari.</p> <p><img src="https://dl.getdropbox.com/u/22784/keyboardToolbar.png" alt="alt text"></p> <p>I am able to visually reproduce it by placeing a toolbar over my view and the appropriate buttons, however i cant figure out any way to dism...
[ { "answer_id": 389830, "author": "Frank Krueger", "author_id": 338, "author_profile": "https://Stackoverflow.com/users/338", "pm_score": 6, "selected": true, "text": "[viewReceivingKeys resignFirstResponder];\n" }, { "answer_id": 389834, "author": "frankodwyer", "author_i...
2008/12/23
[ "https://Stackoverflow.com/questions/389825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8918/" ]
389,827
<p>Is there a way to (ab)use the <strong>C</strong> preprocessor to emulate namespaces in <strong>C</strong>?</p> <p>I'm thinking something along these lines:</p> <pre><code>#define NAMESPACE name_of_ns some_function() { some_other_function(); } </code></pre> <p>This would get translated to:</p> <pre><code>name...
[ { "answer_id": 389838, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 4, "selected": false, "text": "#define FUN_NAME(namespace,name) namespace ## name\n" }, { "answer_id": 389961, "author": "rampion", "author_i...
2008/12/23
[ "https://Stackoverflow.com/questions/389827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46450/" ]
389,832
<p>I would like to know if we can reuse the same Statement object for executing more than one query. Or, should we create a new statement for different queries.</p> <p>For example,</p> <pre><code>Connection con = getDBConnection(); Statement st1 = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_...
[ { "answer_id": 389839, "author": "Tom Hawtin - tackline", "author_id": 4725, "author_profile": "https://Stackoverflow.com/users/4725", "pm_score": 4, "selected": false, "text": "PreparedStatement" }, { "answer_id": 389875, "author": "Powerlord", "author_id": 15880, "a...
2008/12/23
[ "https://Stackoverflow.com/questions/389832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48725/" ]
389,844
<p>Is there any way to have a Windows batch file directly input SQL statements without calling a script? I want the batch file to login to SQL and then enter in the statements directly.</p> <p><strong>EDIT:</strong> I'm using Oracle v10g</p>
[ { "answer_id": 389857, "author": "Dave Costa", "author_id": 6568, "author_profile": "https://Stackoverflow.com/users/6568", "pm_score": 3, "selected": true, "text": "echo select * from dual; | sqlplus user/pw@db\n" }, { "answer_id": 389864, "author": "Bevan", "author_id":...
2008/12/23
[ "https://Stackoverflow.com/questions/389844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1459442/" ]
389,846
<p>When using <code>.contains()</code> on an <code>ArrayCollection</code> in Flex, it will always look at the memory reference. It does not appear to look at an <code>.equals()</code> method or <code>.toString()</code> method or anything overridable. Instead, I need to loop through the <code>ArrayCollection</code> ev...
[ { "answer_id": 21670127, "author": "Zjoia", "author_id": 474109, "author_profile": "https://Stackoverflow.com/users/474109", "pm_score": 0, "selected": false, "text": "in_array($haystack, $arrayCollection->toArray());\n" } ]
2008/12/23
[ "https://Stackoverflow.com/questions/389846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/738/" ]
389,904
<p>I have an ASP.NET web form which I am adding a variable number User Controls to. I have two problems:</p> <ol> <li><p>The User Controls are added to a PlaceHolder on the form in the first PageLoad event (I only add them when "(!this.IsPostback)", but then when the form is posted back, the controls are gone. Is th...
[ { "answer_id": 1137526, "author": "Middletone", "author_id": 35331, "author_profile": "https://Stackoverflow.com/users/35331", "pm_score": 0, "selected": false, "text": "Protected Overrides Sub LoadViewState(ByVal savedState As Object)\n MyBase.LoadViewState(savedState)\n If IsPost...
2008/12/23
[ "https://Stackoverflow.com/questions/389904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14101/" ]
389,905
<p>I've created a user control using WPF and I want to add it to window. I've done that, but I can't make my control have a height higher than the height it has in its own xaml file. My MaxWidth and MaxHeight are both infinity, but I can't make the control any taller than what it is in its xaml file.</p> <p>To get aro...
[ { "answer_id": 393860, "author": "Jab", "author_id": 29676, "author_profile": "https://Stackoverflow.com/users/29676", "pm_score": 2, "selected": false, "text": "xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \nxmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibi...
2008/12/23
[ "https://Stackoverflow.com/questions/389905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18927/" ]
389,922
<p>Why do we need both <code>using namespace</code> and <code>include</code> directives in C++ programs?</p> <p>For example, </p> <pre><code>#include &lt;iostream&gt; using namespace std; int main() { cout &lt;&lt; "Hello world"; } </code></pre> <p>Why is it not enough to just have <code>#include &lt;iostream&gt;...
[ { "answer_id": 389944, "author": "Tim", "author_id": 10755, "author_profile": "https://Stackoverflow.com/users/10755", "pm_score": 6, "selected": true, "text": "C++" }, { "answer_id": 389949, "author": "Motti", "author_id": 3848, "author_profile": "https://Stackoverfl...
2008/12/23
[ "https://Stackoverflow.com/questions/389922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/363902/" ]
389,927
<p>I found a bunch of scripts in the project I have been newly assigned to that are the "shutdown" scripts. They just do some basic searches and run the Unix <code>kill</code> command. Is there any reason they shouldn't shutdown the process this way? Does this ensure that dynamically allocated memory will return pro...
[ { "answer_id": 389937, "author": "Frank Krueger", "author_id": 338, "author_profile": "https://Stackoverflow.com/users/338", "pm_score": 2, "selected": false, "text": "kill -9\n" }, { "answer_id": 389946, "author": "Zan Lynx", "author_id": 13422, "author_profile": "ht...
2008/12/23
[ "https://Stackoverflow.com/questions/389927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45581/" ]
389,945
<p>I've often seen people use Perl data structures in lieu of configuration files; i.e. a lone file containing only:</p> <pre><code>%config = ( 'color' =&gt; 'red', 'numbers' =&gt; [5, 8], qr/^spam/ =&gt; 'eggs' ); </code></pre> <p>What's the best way to convert the contents of these files into Python-equ...
[ { "answer_id": 390062, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 4, "selected": true, "text": "%config = (\n 'color' => 'red',\n 'numbers' => [5, 8],\n qr/^spam/ => 'eggs'\n);\n" }, { "answer_id": 39058...
2008/12/23
[ "https://Stackoverflow.com/questions/389945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3594/" ]
389,957
<p>I'm trying to create proper header files which don't include too many other files to keep them clean and to speed up compile time.</p> <p>I encountered two problems while doing this:</p> <ol> <li><p>Forward declaration on base classes doesn't work.</p> <pre><code>class B; class A : public B { // ... } </cod...
[ { "answer_id": 389963, "author": "Daniel Earwicker", "author_id": 27423, "author_profile": "https://Stackoverflow.com/users/27423", "pm_score": 6, "selected": true, "text": "std::string" }, { "answer_id": 390124, "author": "David Rodríguez - dribeas", "author_id": 36565, ...
2008/12/23
[ "https://Stackoverflow.com/questions/389957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47064/" ]
389,993
<p>Is there any straightforward way to get the mantissa and exponent from a double in c# (or .NET in general)?</p> <p>I found <a href="https://jonskeet.uk/csharp/DoubleConverter.cs" rel="nofollow noreferrer">this example</a> using Google, but I'm not sure how robust it would be. Could the binary representation for a d...
[ { "answer_id": 390072, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 6, "selected": true, "text": "public static string ToExactString (double d)\n{\n …\n\n // Translate the double into sign, exponent and mantissa.\...
2008/12/23
[ "https://Stackoverflow.com/questions/389993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6219/" ]
390,000
<p>Whats the best way to separate the string, "Parisi, Kenneth" into "Kenneth" and "Parisi"? <br>I am still learning how to parse strings with these regular expressions, but not too familiar with how to set vars equal to the matched string &amp; output of the matched (or mismatched) string.</p>
[ { "answer_id": 390009, "author": "codelogic", "author_id": 43427, "author_profile": "https://Stackoverflow.com/users/43427", "pm_score": 2, "selected": false, "text": "my ($lname,$fname) = ($1,$2) if $var =~ /([a-z]+),\\s+([a-z]+)/i;\n" }, { "answer_id": 390015, "author": "cl...
2008/12/23
[ "https://Stackoverflow.com/questions/390000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42229/" ]
390,006
<p>Is there a .NET API for OpenOffice? <br /></p> <p>EDIT: Is there a OpenOffice SDK for .NET?</p>
[ { "answer_id": 1408063, "author": "Chris", "author_id": 64257, "author_profile": "https://Stackoverflow.com/users/64257", "pm_score": 3, "selected": false, "text": "XComponentLoader xComponentLoader =\n (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, desktop);\n" ...
2008/12/23
[ "https://Stackoverflow.com/questions/390006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443363/" ]
390,017
<p>I have a ListView inside another ListView, and I'd like to hide a table column in the inner ListView whenever a particular parameter is passed. Given the setup below, how would I hide the ID column (both the header and the data) if the URL contains "...?id=no"?</p> <pre><code>&lt;asp:ListView ID="ProcedureListView"...
[ { "answer_id": 390065, "author": "Victor", "author_id": 42518, "author_profile": "https://Stackoverflow.com/users/42518", "pm_score": 0, "selected": false, "text": "<% if (Request.QueryString[\"id\"] != \"no\") { %>\n <td>\n <%#Eval(\"benefit_id\")%>\n </td>\n<% } %>\n <td>\n ...
2008/12/23
[ "https://Stackoverflow.com/questions/390017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23935/" ]
390,033
<p>Hey everyone, I'm working on a PHP application that needs to parse a .tpl file with HTML in it and I'm making it so that the HTML can have variables and basic if statements in it. An if statement look something like this: `</p> <pre><code>&lt;!--if({VERSION} == 2)--&gt; Hello World &lt;!--endif --&gt; </code></pre>...
[ { "answer_id": 390055, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": false, "text": "endif" }, { "answer_id": 390058, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://...
2008/12/23
[ "https://Stackoverflow.com/questions/390033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29291/" ]
390,051
<p>I want to write an Exception to an MS Message Queue. When I attempt it I get an exception. So I tried simplifying it by using the XmlSerializer which still raises an exception, but it gave me a bit more info:</p> <blockquote> <p>{"There was an error reflecting type 'System.Exception'."}</p> </blockquote> <p>wi...
[ { "answer_id": 390081, "author": "Jason Jackson", "author_id": 13103, "author_profile": "https://Stackoverflow.com/users/13103", "pm_score": 3, "selected": false, "text": "public class WireObject<T, E>\n{\n public T Payload{get;set;}\n public E Exception{get;set;}\n}\n" }, { "a...
2008/12/23
[ "https://Stackoverflow.com/questions/390051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16260/" ]
390,052
<p>I am displaying many rows of data in a list view that is bound to a list of a custom class. The custom class has a property called type. The number of allowable Types is limited and I would like to limit the user to making changes by selecting from a combobox. I tried adding a combobox to the base class but that ...
[ { "answer_id": 390081, "author": "Jason Jackson", "author_id": 13103, "author_profile": "https://Stackoverflow.com/users/13103", "pm_score": 3, "selected": false, "text": "public class WireObject<T, E>\n{\n public T Payload{get;set;}\n public E Exception{get;set;}\n}\n" }, { "a...
2008/12/23
[ "https://Stackoverflow.com/questions/390052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38349/" ]
390,083
<p>Have just started playing with ASP.NET MVC and have stumbled over the following situation. It feels a lot like a bug but if its not, an explanation would be appreciated :)</p> <p>The View contains pretty basic stuff</p> <pre><code>&lt;%=Html.DropDownList("MyList", ViewData["MyListItems"] as SelectList)%&gt; &lt;%...
[ { "answer_id": 390339, "author": "Todd Smith", "author_id": 31624, "author_profile": "https://Stackoverflow.com/users/31624", "pm_score": 4, "selected": true, "text": "if (ViewData.ModelState.TryGetValue(key, out modelState))\n" }, { "answer_id": 1630360, "author": "Aracnid",...
2008/12/23
[ "https://Stackoverflow.com/questions/390083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8262/" ]
390,087
<p>We are developing a WinForm application that we want to deploy to certain users machine. We would like to uniquely identify each application installed with some sort of "code" that we can define before installing on their system.</p> <p>Right now we plan to put the unique code (that we type ourselves) in an xml or...
[ { "answer_id": 390292, "author": "Brody", "author_id": 17131, "author_profile": "https://Stackoverflow.com/users/17131", "pm_score": 1, "selected": false, "text": "' Windows Installer utility to execute SQL statements against an installer database\n' For use with Windows Scripting Host, ...
2008/12/23
[ "https://Stackoverflow.com/questions/390087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
390,095
<p>Background: We are using VS 2008 and are in the process of upgrading from TFS 2005 to 2008.</p> <p>We have a solution that contains several projects and overall have hundreds of code files. We want to add the same text as a comment to all of these files (a copyright message). Does anyone know of a quick/easy/effi...
[ { "answer_id": 390120, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 1, "selected": false, "text": "# Process all .cpp and .h files under the directory tree at $PROJECTROOT\n# To add other file types, add more \"-o -...
2008/12/23
[ "https://Stackoverflow.com/questions/390095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48747/" ]
390,099
<p>I am looking at uClinux system that builds the kernel with arm-linux-xxx, but builds the user apps with arm-elf-xxx.</p> <p>If the apps are intended to run on linux, wouldn't it be better to build everything with arm-linux-xxx ?</p> <p>Where does one set that option in the overall uClinux build config?</p>
[ { "answer_id": 9922177, "author": "gfour", "author_id": 671119, "author_profile": "https://Stackoverflow.com/users/671119", "pm_score": 2, "selected": false, "text": "arm-linux-gcc -v" } ]
2008/12/23
[ "https://Stackoverflow.com/questions/390099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2033811/" ]
390,103
<p>This is related to my <a href="https://stackoverflow.com/questions/390017/hide-a-table-column-in-a-nested-listview">earlier question</a>, but I thought I'd simplify it and make a challenge out of it. Given the code below, can you change the value of "ChangeThisLabel" from the code behind?</p> <pre><code>&lt;asp:Lis...
[ { "answer_id": 390117, "author": "Kon", "author_id": 22303, "author_profile": "https://Stackoverflow.com/users/22303", "pm_score": 1, "selected": false, "text": "FindControl(\"ChangeThisLabel\")" }, { "answer_id": 390160, "author": "Victor", "author_id": 42518, "autho...
2008/12/23
[ "https://Stackoverflow.com/questions/390103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23935/" ]
390,105
<p>I've have finally got the datepicker to work on my MVC demo site. One thing though it doesn't work when browsing with IE7, I havn't testet with IE6 yet. Does anyone know how to fix this problem or can't I use jQuery if I want IE users to be able to pick dates?</p> <p>It works like a charm on Safari and Firefox, exc...
[ { "answer_id": 390134, "author": "SquidScareMe", "author_id": 30921, "author_profile": "https://Stackoverflow.com/users/30921", "pm_score": 0, "selected": false, "text": "<script type=\"text/javascript\"> \n $(document).ready(function() { \n $(\"#Date\").datepi...
2008/12/23
[ "https://Stackoverflow.com/questions/390105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/459417/" ]
390,106
<p>It seems to be a common requirement nowadays to have a search feature that can search almost anything you want. Can anyone give me samples or tips as to how to go about building a one stop search for an application?</p> <p>For example: you have 3 tables customers, products, employees. The application has a master p...
[ { "answer_id": 390277, "author": "Philippe Grondier", "author_id": 11436, "author_profile": "https://Stackoverflow.com/users/11436", "pm_score": 2, "selected": false, "text": "'*823*'" } ]
2008/12/23
[ "https://Stackoverflow.com/questions/390106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37494/" ]
390,108
<p>What are general guidelines on when user-defined implicit conversion could, should, or should not be defined?</p> <p>I mean things like, for example, "an implicit conversion should never lose information", "an implicit conversion should never throw exceptions", or "an implicit conversion should never instantiate ne...
[ { "answer_id": 390125, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": false, "text": "Nullable<T>" }, { "answer_id": 390158, "author": "Jon Skeet", "author_id": 22656, "author_profile...
2008/12/23
[ "https://Stackoverflow.com/questions/390108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9204/" ]
390,115
<p>What have others done to get around the fact that the Commons Logging project (for both .NET and Java) do not support Mapped or Nested Diagnostic Contexts as far as I know?</p>
[ { "answer_id": 1680095, "author": "tgeros", "author_id": 4458, "author_profile": "https://Stackoverflow.com/users/4458", "pm_score": 1, "selected": true, "text": "public interface IDiagnosticContextHandler\n{\n void Set(string name, string value);\n}\n" }, { "answer_id": 37523...
2008/12/23
[ "https://Stackoverflow.com/questions/390115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4458/" ]
390,118
<p>I have the following 3 classes </p> <pre><code>Book Product SpecialOptions </code></pre> <p>There are many Books, and there are many Products per Book. Likewise in a Product there are many SpecialOptions. There are other properties of each of these three classes so each class has the following interface</p> <pre>...
[ { "answer_id": 1680095, "author": "tgeros", "author_id": 4458, "author_profile": "https://Stackoverflow.com/users/4458", "pm_score": 1, "selected": true, "text": "public interface IDiagnosticContextHandler\n{\n void Set(string name, string value);\n}\n" }, { "answer_id": 37523...
2008/12/23
[ "https://Stackoverflow.com/questions/390118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22777/" ]
390,135
<p>How do you search for a specific text inside a text run (in Docx using the OpenXML SDK 2.0) and once you find it how do you insert a comment surrounding the 'search text'. The 'search text' can be a sub string of an existing run. All example in the samples insert comments around the first paragraph or something simp...
[ { "answer_id": 549807, "author": "herskinduk", "author_id": 63411, "author_profile": "https://Stackoverflow.com/users/63411", "pm_score": 2, "selected": false, "text": "<paragraph>\n <run>...</run>\n <commentRangeStart />\n <run>search text</run>\n <commentRangeEnd />\n <run>...</ru...
2008/12/23
[ "https://Stackoverflow.com/questions/390135", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48753/" ]
390,148
<p>I have a web application that is generating hundreds of PDFs in batch, using ColdFusion 8 on a Windows/IIS server.</p> <p>The process runs fine on my development and staging servers, but of course the client is cheap and is only paying for shared hosting, which isn't as fast as my dev/staging boxes. As a result, PD...
[ { "answer_id": 428397, "author": "Adam Tuttle", "author_id": 751, "author_profile": "https://Stackoverflow.com/users/751", "pm_score": 2, "selected": true, "text": "localUrl" }, { "answer_id": 579847, "author": "pplrppl", "author_id": 67612, "author_profile": "https:/...
2008/12/23
[ "https://Stackoverflow.com/questions/390148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/751/" ]
390,150
<p>I have a simple task of authenticating against Active Directory using Java. Just verifying credentials and nothing else. Let's say my domain is "fun.xyz.tld", OU path is unknown, and username/password is testu/testp. </p> <p>I know there's a few Java libraries out there that simplify this task, but I wasn't success...
[ { "answer_id": 390169, "author": "Anthony", "author_id": 48463, "author_profile": "https://Stackoverflow.com/users/48463", "pm_score": 2, "selected": false, "text": "kerberos" }, { "answer_id": 394193, "author": "DV.", "author_id": 18406, "author_profile": "https://St...
2008/12/23
[ "https://Stackoverflow.com/questions/390150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18406/" ]
390,164
<p>Say I need to call a javascript file in the <code>&lt;head&gt;</code> of an ERb template. My instinct is to do the usual:</p> <pre><code>&lt;head&gt; &lt;%= javascript_include_tag :defaults %&gt; &lt;!-- For example --&gt; &lt;/head&gt; </code></pre> <p>in my application's layout. The problem of course becoming th...
[ { "answer_id": 390182, "author": "Gareth", "author_id": 31582, "author_profile": "https://Stackoverflow.com/users/31582", "pm_score": 1, "selected": false, "text": "<head>\n <%= javascript_include_tag :defaults %> <!-- For example -->\n <%= @extra_head_content %>\n</head>\n" }, { ...
2008/12/23
[ "https://Stackoverflow.com/questions/390164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2293/" ]
390,174
<p>I have a file with a bunch of lines. I have recorded a macro that performs an operation on a single line. I want to repeat that macro on all of the remaining lines in the file. Is there a quick way to do this?</p> <p>I tried Ctrl+Q, highlighted a set of lines, and pressed @@, but that didn't seem to do the trick...
[ { "answer_id": 390194, "author": "Judge Maygarden", "author_id": 1491, "author_profile": "https://Stackoverflow.com/users/1491", "pm_score": 10, "selected": true, "text": ":5,10norm! @a\n" }, { "answer_id": 5292858, "author": "SergioAraujo", "author_id": 2571881, "aut...
2008/12/23
[ "https://Stackoverflow.com/questions/390174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20133/" ]
390,176
<p>I know that the f# list is not the same at the c# List. What do I need to do to be able to pass a list of ints from a c# application to an f# library? I'd like to be able to use pattern matching on the data once it's in the f# code.</p>
[ { "answer_id": 390227, "author": "Alexey Romanov", "author_id": 9204, "author_profile": "https://Stackoverflow.com/users/9204", "pm_score": 3, "selected": false, "text": "Seq.toList : IEnumerable<'a> -> list<'a>\n" }, { "answer_id": 390248, "author": "Daniel Earwicker", "...
2008/12/23
[ "https://Stackoverflow.com/questions/390176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26339/" ]
390,181
<p>I'm working on a project, written in Java, which requires that I build a very large 2-D sparse array. Very sparse, if that makes a difference. Anyway: the most crucial aspect for this application is efficency in terms of time (assume loads of memory, though not nearly so unlimited as to allow me to use a standard ...
[ { "answer_id": 391235, "author": "eljenso", "author_id": 30316, "author_profile": "https://Stackoverflow.com/users/30316", "pm_score": 2, "selected": false, "text": " SortedMap<Index, Object> entries = new TreeMap<Index, Object>();\n entries.put(new Index(1, 4), \"1-4\");\n entr...
2008/12/23
[ "https://Stackoverflow.com/questions/390181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47450/" ]
390,187
<p>When attempting to copy a framework into the Frameworks folder of my project in Xcode, I get the error</p> <blockquote> <p>Could not copy /Developer/Platforms/.../Frameworks/OpenAL.framework to /Users/.../OpenAL.framework</p> </blockquote> <p>I had accidentally copied the wrong framework with the same name into ...
[ { "answer_id": 391235, "author": "eljenso", "author_id": 30316, "author_profile": "https://Stackoverflow.com/users/30316", "pm_score": 2, "selected": false, "text": " SortedMap<Index, Object> entries = new TreeMap<Index, Object>();\n entries.put(new Index(1, 4), \"1-4\");\n entr...
2008/12/23
[ "https://Stackoverflow.com/questions/390187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21293/" ]
390,188
<p>Is there a good, free telnet library available for C# (not ASP .NET)? I have found a few on google, but they all have one issue or another (don't support login/password, don't support a scripted mode).</p> <p>I am assuming that MS still has not included a telnet library as part of .NET v3.5 as I couldn't find it if...
[ { "answer_id": 8827835, "author": "Prakash", "author_id": 1144302, "author_profile": "https://Stackoverflow.com/users/1144302", "pm_score": 3, "selected": false, "text": "using System;\nusing System.IO;\nusing System.Net;\nusing System.Net.Sockets;\nusing System.Text.RegularExpressions;\...
2008/12/23
[ "https://Stackoverflow.com/questions/390188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/757/" ]
390,192
<p>When I define an object of a class using new like this</p> <pre><code>$blah = new Whatever(); </code></pre> <p>I get autocomplete for $blah. <strong>But how do I do it when I have $blah as a function parameter?</strong> Without autocomplete I am incomplete.</p> <p><strong>Edit</strong>: <strong>How do I do it if ...
[ { "answer_id": 390211, "author": "maxnk", "author_id": 45862, "author_profile": "https://Stackoverflow.com/users/45862", "pm_score": 3, "selected": false, "text": "function myFunction(Whatever $blah) {\n}\n" }, { "answer_id": 396041, "author": "Alan Gabriel Bem", "author_...
2008/12/23
[ "https://Stackoverflow.com/questions/390192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8047/" ]
390,195
<p>We have an old Classic ASP application that we have been using Visual Studio 6 to maintain. This has worked fine, but we're ready to step out of the stone age and I'd like to see if I can use Visual Studio 2008 (SP1) to maintain the application.</p> <p>In the past, multiple developers could work on the application...
[ { "answer_id": 390211, "author": "maxnk", "author_id": 45862, "author_profile": "https://Stackoverflow.com/users/45862", "pm_score": 3, "selected": false, "text": "function myFunction(Whatever $blah) {\n}\n" }, { "answer_id": 396041, "author": "Alan Gabriel Bem", "author_...
2008/12/23
[ "https://Stackoverflow.com/questions/390195", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48760/" ]
390,205
<p>I'm trying to convert all instances of the > character to its HTML entity equivalent, &gt;, within a string of HTML that contains HTML tags. The furthest I've been able to get with a solution for this is using a regex.</p> <p>Here's what I have so far:</p> <pre><code> public static readonly Regex HtmlAngleB...
[ { "answer_id": 390233, "author": "JB King", "author_id": 8745, "author_profile": "https://Stackoverflow.com/users/8745", "pm_score": 0, "selected": false, "text": ">" }, { "answer_id": 390256, "author": "LarryF", "author_id": 18518, "author_profile": "https://Stackove...
2008/12/23
[ "https://Stackoverflow.com/questions/390205", "https://Stackoverflow.com", "https://Stackoverflow.com/users/769/" ]
390,219
<p>Okay, this is really kinda starting to bug me. I have a simple Web project setup located at: "C:\Projects\MyTestProject\". In IIS on my machine, I have mapped a virtual directory to this location so I can run my sites locally (I understand I can run it from Visual Studio, I like this method better). I have named ...
[ { "answer_id": 23918787, "author": "Jason Eades", "author_id": 1368050, "author_profile": "https://Stackoverflow.com/users/1368050", "pm_score": 4, "selected": false, "text": "<!-- Development -->\n<httpCookies httpOnlyCookies=\"true\" requireSSL=\"false\" />\n<!-- Production -->\n<!--<h...
2008/12/23
[ "https://Stackoverflow.com/questions/390219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39337/" ]
390,238
<p>I'm looking for ways to display a single row of data as a single column (with multiple rows). For example,</p> <pre> FieldA FieldB ------- --------- 1 Some Text [row] Header Value [col] ------ ------ FieldA 1 [row1] FieldB SomeText [row2] </pre> <p>Is there a way to do this with SQL Server 20...
[ { "answer_id": 390327, "author": "fatbuddha", "author_id": 28034, "author_profile": "https://Stackoverflow.com/users/28034", "pm_score": 2, "selected": false, "text": "Declare @tbl Table\n(\n c1 int,\n c2 int,\n c3 int\n)\n\nInsert into @tbl Values(1,2,3)\n\nSelect\n cname,\n cval\n...
2008/12/23
[ "https://Stackoverflow.com/questions/390238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28413/" ]
390,242
<p>I have a program that continually polls the database for change in value of some field. It runs in the background and currently uses a while(true) and a sleep() method to set the interval. I am wondering if this is a good practice? And, what could be a more efficient way to implement this? The program is meant to ru...
[ { "answer_id": 390421, "author": "Bombe", "author_id": 43582, "author_profile": "https://Stackoverflow.com/users/43582", "pm_score": 0, "selected": false, "text": "public class Service implements Runnable {\n\n private boolean shouldStop = false;\n\n public synchronized stop() {\n ...
2008/12/23
[ "https://Stackoverflow.com/questions/390242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48725/" ]
390,250
<p>When writing custom classes it is often important to allow equivalence by means of the <code>==</code> and <code>!=</code> operators. In Python, this is made possible by implementing the <code>__eq__</code> and <code>__ne__</code> special methods, respectively. The easiest way I've found to do this is the following ...
[ { "answer_id": 390280, "author": "Vasil", "author_id": 7883, "author_profile": "https://Stackoverflow.com/users/7883", "pm_score": 3, "selected": false, "text": "__eq__" }, { "answer_id": 390335, "author": "too much php", "author_id": 28835, "author_profile": "https:/...
2008/12/23
[ "https://Stackoverflow.com/questions/390250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38140/" ]
390,260
<p>I'm using the code that netadictos posted to the question <a href="https://stackoverflow.com/questions/333665/">here</a>. All I want to do is to display a warning when a user is navigating away from or closing a window/tab.</p> <p>The code that netadictos posted seems to work fine in IE7, FF 3.0.5, Safari 3.2.1, a...
[ { "answer_id": 390315, "author": "Blorgbeard", "author_id": 369, "author_profile": "https://Stackoverflow.com/users/369", "pm_score": 1, "selected": false, "text": "history.navigationMode = 'compatible';\n" }, { "answer_id": 17452749, "author": "wojo", "author_id": 9022, ...
2008/12/23
[ "https://Stackoverflow.com/questions/390260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47121/" ]
390,263
<p>I am using python to read a currency value from excel. The returned from the range.Value method is a tuple that I don't know how to parse.</p> <p>For example, the cell appears as $548,982, but in python the value is returned as (1, 1194857614).</p> <p>How can I get the numerical amount from excel or how can I conv...
[ { "answer_id": 391076, "author": "tzot", "author_id": 6899, "author_profile": "https://Stackoverflow.com/users/6899", "pm_score": 3, "selected": true, "text": "import struct\ntry: import decimal\nexcept ImportError:\n divisor= 10000.0\nelse:\n divisor= decimal.Decimal(10000)\n\ndef...
2008/12/23
[ "https://Stackoverflow.com/questions/390263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
390,265
<p>I always seem to see if a string (querystring value usually) has a value but first I have to check that it is not nothing first so I end up with 2 if then statements - am I missing somethign here - there has to be a better way to do this:</p> <pre><code>If Not String.IsNullOrEmpty(myString) Then If CBool(myStrin...
[ { "answer_id": 390296, "author": "devio", "author_id": 21336, "author_profile": "https://Stackoverflow.com/users/21336", "pm_score": 3, "selected": true, "text": "If Not String.IsNullOrEmpty(myString) AndAlso CBool(myString) Then \n ....\nEnd If\n" }, { "answer_id": 390440, ...
2008/12/23
[ "https://Stackoverflow.com/questions/390265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34548/" ]
390,276
<p>Here's a problem that I've been running into lately - a misconfigured apache on a webhost. This means that all scripts that rely on <code>$_SERVER['DOCUMENT_ROOT']</code> break. The easiest workaround that I've found is just set the variable in some global include files that is shared, but it's a pain not to forget ...
[ { "answer_id": 390295, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "$_SERVER['SCRIPT_FILENAME']" }, { "answer_id": 390356, "author": "Eineki", "author_id": 29125, "author_pro...
2008/12/23
[ "https://Stackoverflow.com/questions/390276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27610/" ]
390,278
<p>I'm setting up a new PC and I installed my project to work with. It is a .NET Remoting 2.0 application that uses the ASP.NET development server to host the server side while developing. I'm getting the following error when I make requests to the server:</p> <p>"The remote server returned an error: (403) Forbidden. ...
[ { "answer_id": 390318, "author": "NotMe", "author_id": 2424, "author_profile": "https://Stackoverflow.com/users/2424", "pm_score": 2, "selected": false, "text": "403 - Forbidden. IIS defines several different 403 errors that indicate a more specific cause of the error:\n• 403.1 - Execu...
2008/12/23
[ "https://Stackoverflow.com/questions/390278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31017/" ]
390,284
<p>Using Flex 3 with the ColdFusion plugin, can I not write a standalone ColdFusion class which I can invoke from my flex website (mxml)?</p> <p>Thanks</p>
[ { "answer_id": 400548, "author": "Brett", "author_id": 47581, "author_profile": "https://Stackoverflow.com/users/47581", "pm_score": 2, "selected": false, "text": "<mx:Script>\n <![CDATA[\n private function callMethod():void\n {\n ro.MethodName;\n } \n\n private funct...
2008/12/23
[ "https://Stackoverflow.com/questions/390284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32484/" ]
390,286
<p>I am trying to write a generic Parse method that converts and returns a strongly typed value from a NamedValueCollection. I tried two methods but both of these methods are going through boxing and unboxing to get the value. Does anyone know a way to avoid the boxing? If you saw this in production would you not li...
[ { "answer_id": 390312, "author": "Robert C. Barth", "author_id": 9209, "author_profile": "https://Stackoverflow.com/users/9209", "pm_score": 5, "selected": false, "text": "public static T Parse<T>(this NameValueCollection col, string key)\n{\n return (T)Convert.ChangeType(col[key], type...
2008/12/23
[ "https://Stackoverflow.com/questions/390286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37881/" ]
390,289
<p>I just refactored some code that was in a different section of the class I was working on because it was a series of nested conditional operators (?:) that was made a ton clearer by a fairly simple switch statement (C#). </p> <p>When will you touch code that isn't directly what you are working on to make it more c...
[ { "answer_id": 390302, "author": "Piskvor left the building", "author_id": 19746, "author_profile": "https://Stackoverflow.com/users/19746", "pm_score": 1, "selected": false, "text": "if($something) {\n load_data($something);\n} else {\n load_data($something);\n echo \"Loaded\";\n do...
2008/12/23
[ "https://Stackoverflow.com/questions/390289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13100/" ]
390,307
<p>What are the cons and pros of windows services vs scheduled tasks for running a program repeatedly (e.g. every two minutes)?</p>
[ { "answer_id": 1744714, "author": "Rebecca", "author_id": 119624, "author_profile": "https://Stackoverflow.com/users/119624", "pm_score": 7, "selected": true, "text": "protected override void OnStart (string args) {\n\n // Create worker thread; this will invoke the WorkerFunction\n /...
2008/12/23
[ "https://Stackoverflow.com/questions/390307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2133/" ]
390,326
<p>I have a base class with a virtual method, and multiple subclasses that override that method.</p> <p>When I encounter one of those subclasses, I would like to call the overridden method, but without knowledge of the subclass. I can think of ugly ways to do this (check a value and cast it), but it seems like there s...
[ { "answer_id": 390349, "author": "Daniel Earwicker", "author_id": 27423, "author_profile": "https://Stackoverflow.com/users/27423", "pm_score": 4, "selected": true, "text": "class Foo \n{\n public virtual void virtualPrintMe()\n {\n nonVirtualPrintMe();\n }\n\n public ...
2008/12/23
[ "https://Stackoverflow.com/questions/390326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6054/" ]
390,354
<p>I am using .NET 2.0 and SQL Server 2005. For historical reasons, the app code is using SQLTransaction but some of the stored procedures are also using T-SQL begin/commit/rollback tran statements. The idea is that the DBTransaction can span many stored procedures, which each individual sproc controls what's happening...
[ { "answer_id": 390349, "author": "Daniel Earwicker", "author_id": 27423, "author_profile": "https://Stackoverflow.com/users/27423", "pm_score": 4, "selected": true, "text": "class Foo \n{\n public virtual void virtualPrintMe()\n {\n nonVirtualPrintMe();\n }\n\n public ...
2008/12/23
[ "https://Stackoverflow.com/questions/390354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48776/" ]
390,362
<p>I've got a sproc (MSSQL 2k5) that will take a variable for a LIKE claus like so:</p> <pre><code>DECLARE @SearchLetter2 char(1) SET @SearchLetter = 't' SET @SearchLetter2 = @SearchLetter + '%' SELECT * FROM BrandNames WHERE [Name] LIKE @SearchLetter2 and IsVisible = 1 --WHERE [Name] LIKE 't%' and IsVis...
[ { "answer_id": 390404, "author": "JB King", "author_id": 8745, "author_profile": "https://Stackoverflow.com/users/8745", "pm_score": 3, "selected": false, "text": "declare @SearchLetter2 char(2)\ndeclare @SearchLetter char(1)\nSet @SearchLetter = 'A'\nSet @SearchLetter2 = @SearchLetter+'...
2008/12/23
[ "https://Stackoverflow.com/questions/390362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42568/" ]
390,368
<p>Is there a way to stop Google from indexing a site? <br /></p>
[ { "answer_id": 390379, "author": "UnkwnTech", "author_id": 115, "author_profile": "https://Stackoverflow.com/users/115", "pm_score": 8, "selected": true, "text": "User-agent: *\nDisallow: /\n" }, { "answer_id": 13203384, "author": "user1586214", "author_id": 1586214, ...
2008/12/23
[ "https://Stackoverflow.com/questions/390368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443363/" ]
390,375
<p>In PHP, if you define a class, and then instantiate an object of that class, it's possible to later arbitrarily add new members to that class. For example:</p> <pre><code>class foo { public $bar = 5; } $A = new foo; $A-&gt;temp = 10; </code></pre> <p>However, I'd like the ability to make it impossible to add...
[ { "answer_id": 390434, "author": "Kornel", "author_id": 27009, "author_profile": "https://Stackoverflow.com/users/27009", "pm_score": 3, "selected": true, "text": "__set" } ]
2008/12/23
[ "https://Stackoverflow.com/questions/390375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20903/" ]
390,381
<p>I am writing a small applescript which retrieves all "unread" messages in the viewer and loops them.</p> <p>I have two goals to complete:</p> <ol> <li><p>I need to get the subject of each message and perform a regular expression to see if it's suitable for step 2 (ex: get emails with subject {.*})</p></li> <li><p>...
[ { "answer_id": 390549, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 2, "selected": false, "text": "do shell script" } ]
2008/12/23
[ "https://Stackoverflow.com/questions/390381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48780/" ]
390,385
<p>If I create a file:</p> <p>test.cpp:</p> <pre><code>void f(double **a) { } int main() { double var[4][2]; f(var); } </code></pre> <p>And then run: g++ test.cpp -o test</p> <p>I get</p> <pre><code>test.cpp: In function `int main()': test.cpp:8: error: cannot convert `double (*)[2]' to `double**' for ar...
[ { "answer_id": 390417, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 4, "selected": false, "text": "// same as void f(double (*a)[2]) {\nvoid f(double a[][2]) { \n\n}\n\nint main() {\n // note. this is no...
2008/12/23
[ "https://Stackoverflow.com/questions/390385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48782/" ]
390,389
<p>I only have 1 line of code, and this is:</p> <pre><code>pcrecpp::RE re("abc"); </code></pre> <p>inside a function <code>OnBnClickedButtonGo()</code>. And this function fails in Release mode, but it works OK in debug mode.</p> <p>(I am using Visual Studio 8 on Windows XP.)</p> <p>The error message is:</p> <pre><...
[ { "answer_id": 2146963, "author": "matheszabi", "author_id": 260074, "author_profile": "https://Stackoverflow.com/users/260074", "pm_score": 2, "selected": false, "text": "native.dll" } ]
2008/12/23
[ "https://Stackoverflow.com/questions/390389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48778/" ]
390,391
<p>I am doing some significant refactoring and feature-adding on a project, and have just broken backwards compatibility with my data. I did it by creating a bunch of subclasses from the class that I used to house my data in, and loading in old serialized objects no longer works..</p> <p>What kind of pre-engineering o...
[ { "answer_id": 390423, "author": "dacracot", "author_id": 13930, "author_profile": "https://Stackoverflow.com/users/13930", "pm_score": 2, "selected": true, "text": "<root>\n <something one=\"1\" two=\"2\"/>\n</root>\n" } ]
2008/12/23
[ "https://Stackoverflow.com/questions/390391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6054/" ]
390,409
<p>So far I've found it impossible to produce usable tracebacks when Mako templates aren't coded correctly.</p> <p>Is there any way to debug templates besides iterating for every line of code?</p>
[ { "answer_id": 536087, "author": "Kenan Banks", "author_id": 43089, "author_profile": "https://Stackoverflow.com/users/43089", "pm_score": 7, "selected": true, "text": "from mako import exceptions\n\ntry:\n template = lookup.get_template(uri)\n print template.render()\nexcept:\n ...
2008/12/23
[ "https://Stackoverflow.com/questions/390409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/853/" ]
390,420
<p>Hi I need to create a query in MSAccess 2003 through code (a.k.a. VB) -- how can I accomplish this?</p>
[ { "answer_id": 390439, "author": "Fionnuala", "author_id": 2548, "author_profile": "https://Stackoverflow.com/users/2548", "pm_score": 6, "selected": true, "text": "strSQL=\"SELECT * FROM tblT WHERE ID =\" & Forms!Form1!txtID \n\nSet qdf=CurrentDB.CreateQueryDef(\"NewQuery\",strSQL)\nDoC...
2008/12/23
[ "https://Stackoverflow.com/questions/390420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428190/" ]
390,448
<p>I have a single windows shell command I'd like to run (via EXEC master..xp_cmdshell) once for each row in a table. I'm using information from various fields to build the command output.</p> <p>I'm relativity new to writing T-SQL programs (as opposed to individual queries) and can't quite get my head around the syn...
[ { "answer_id": 390489, "author": "jrcs3", "author_id": 3819, "author_profile": "https://Stackoverflow.com/users/3819", "pm_score": 4, "selected": true, "text": "USE Northwind\n\nDECLARE @name VARCHAR(32)\nDECLARE @command VARCHAR(100)\n\nDECLARE shell_cursor CURSOR FOR \nSELECT LastName ...
2008/12/24
[ "https://Stackoverflow.com/questions/390448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4668/" ]
390,475
<p>I have a problem that just started happening after I reinstalled my website's server.</p> <p>In the past I could do do this:</p> <p>Code:</p> <pre><code>&lt;% set msgSet = conn.execute("select * from base_scroller where scroller_num = 1" %&gt; </code></pre> <p>check if it's not empty or anything else</p> <p>C...
[ { "answer_id": 390529, "author": "AnonJr", "author_id": 25163, "author_profile": "https://Stackoverflow.com/users/25163", "pm_score": 0, "selected": false, "text": " <%= cStr(msgSet(\"scroller_name\")) %>\n" }, { "answer_id": 395249, "author": "Amadiere", "author_id": 7...
2008/12/24
[ "https://Stackoverflow.com/questions/390475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
390,481
<p>I often use this code pattern:</p> <pre><code>while(true) { //do something if(&lt;some condition&gt;) { break; } } </code></pre> <p>Another programmer told me that this was bad practice and that I should replace it with the more standard:</p> <pre><code>while(!&lt;some condition&gt;) { ...
[ { "answer_id": 390498, "author": "Andrew G. Johnson", "author_id": 428190, "author_profile": "https://Stackoverflow.com/users/428190", "pm_score": 7, "selected": true, "text": "while (true)" }, { "answer_id": 390523, "author": "Bill the Lizard", "author_id": 1288, "au...
2008/12/24
[ "https://Stackoverflow.com/questions/390481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4639/" ]
390,491
<p>I want to add a "Select One" option to a drop down list bound to a <code>List&lt;T&gt;</code>. </p> <p>Once I query for the <code>List&lt;T&gt;</code>, how do I add my initial <code>Item</code>, not part of the data source, as the FIRST element in that <code>List&lt;T&gt;</code> ? I have:</p> <pre><code>// popula...
[ { "answer_id": 390501, "author": "x0n", "author_id": 6920, "author_profile": "https://Stackoverflow.com/users/6920", "pm_score": 5, "selected": false, "text": "<asp:DropDownList ID=\"ddl\" runat=\"server\" AppendDataBoundItems=\"true\">\n <asp:ListItem Value=\"0\" Text=\"Please choose...
2008/12/24
[ "https://Stackoverflow.com/questions/390491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35615/" ]
390,512
<p>I want to add a new time-field to a an existing MySQL-table that is formated like this "MM:SS". The field is supposed to hold duration-data. What is the correct MySQL syntax to do this? Couldn't find anything that covers this on the MySQL-site.</p>
[ { "answer_id": 390501, "author": "x0n", "author_id": 6920, "author_profile": "https://Stackoverflow.com/users/6920", "pm_score": 5, "selected": false, "text": "<asp:DropDownList ID=\"ddl\" runat=\"server\" AppendDataBoundItems=\"true\">\n <asp:ListItem Value=\"0\" Text=\"Please choose...
2008/12/24
[ "https://Stackoverflow.com/questions/390512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24218/" ]
390,534
<p>Simply put, I have a table with, among other things, a column for timestamps. I want to get the row with the most recent (i.e. greatest value) timestamp. Currently I'm doing this:</p> <pre><code>SELECT * FROM table ORDER BY timestamp DESC LIMIT 1 </code></pre> <p>But I'd much rather do something like this:</p> <p...
[ { "answer_id": 390542, "author": "SquareCog", "author_id": 15962, "author_profile": "https://Stackoverflow.com/users/15962", "pm_score": 5, "selected": true, "text": "SELECT * from foo where timestamp = (select max(timestamp) from foo)\n" }, { "answer_id": 390543, "author": "...
2008/12/24
[ "https://Stackoverflow.com/questions/390534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658/" ]
390,554
<p>I'm trying to install SQL Server 2005 Express SP3 on two of my machines. When I try to do this I get this error message: "None of the selected features can be installed or upgraded. Setup cannot proceed since no effective change is being made to the machine. To continue, click Back and then select features to instal...
[ { "answer_id": 390542, "author": "SquareCog", "author_id": 15962, "author_profile": "https://Stackoverflow.com/users/15962", "pm_score": 5, "selected": true, "text": "SELECT * from foo where timestamp = (select max(timestamp) from foo)\n" }, { "answer_id": 390543, "author": "...
2008/12/24
[ "https://Stackoverflow.com/questions/390554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29821/" ]
390,565
<p>I have been testing out the <code>yield return</code> statement with some of the code I have been writing. I have two methods:</p> <pre><code>public static IEnumerable&lt;String&gt; MyYieldCollection { get { wrapper.RunCommand("Fetch First From Water_Mains"); for (int row =...
[ { "answer_id": 390635, "author": "Nick", "author_id": 44741, "author_profile": "https://Stackoverflow.com/users/44741", "pm_score": 1, "selected": false, "text": "public IEnumerable<int> YieldInts()\n{\n for (int i = 0; i < 1000; i++)\n {\n Thread.Sleep(1000) // or do some o...
2008/12/24
[ "https://Stackoverflow.com/questions/390565", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6335/" ]
390,575
<p>I am fairly new to PHP. What is the best way to control access to a class throughout a PHP application and where is the best place to store these classes that will need to be accessed throughout the entire application? Example; I have a user class that is created on during the login process, but each time the pa...
[ { "answer_id": 390593, "author": "UnkwnTech", "author_id": 115, "author_profile": "https://Stackoverflow.com/users/115", "pm_score": 2, "selected": false, "text": "$username //username from db\n$name //name from db\n$_SESSION['username'] = $username;\n$_SESSION['name'] = $name;\n" }, ...
2008/12/24
[ "https://Stackoverflow.com/questions/390575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
390,578
<p>Take the following class as an example:</p> <pre><code>class Sometype { int someValue; public Sometype(int someValue) { this.someValue = someValue; } } </code></pre> <p>I then want to create an instance of this type using reflection:</p> <pre><code>Type t = typeof(Sometype); object o = Ac...
[ { "answer_id": 390596, "author": "Jason Jackson", "author_id": 13103, "author_profile": "https://Stackoverflow.com/users/13103", "pm_score": 8, "selected": true, "text": "FormatterServices.GetUninitializedObject()" }, { "answer_id": 390597, "author": "Nick", "author_id": ...
2008/12/24
[ "https://Stackoverflow.com/questions/390578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37472/" ]
390,584
<p>I have a question regarding a data binding(of multiple properties) for custom DataGridViewColumn. Here is a schema of what controls that I have, and I need to make it bindable with DataGridView datasource. Any ideas or a link to an article discussing the matter? </p> <p><strong>Controls</strong></p> <ul> <li>Grap...
[ { "answer_id": 485606, "author": "Vera", "author_id": 48802, "author_profile": "https://Stackoverflow.com/users/48802", "pm_score": 2, "selected": false, "text": "public partial class MyCell : DataGridViewCell \n {\n protected override void Paint(...)\n {...} // draws control\n...
2008/12/24
[ "https://Stackoverflow.com/questions/390584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48802/" ]
390,595
<p>I have an web application where I have a requirement to encrypt and store the connection string in the web.config. </p> <p>What is the best way to retrieve this and use this connection string with IBATIS.NET instead of storing the connection string in the SqlMap.config?</p>
[ { "answer_id": 410215, "author": "Nicholas Piasecki", "author_id": 32187, "author_profile": "https://Stackoverflow.com/users/32187", "pm_score": 3, "selected": true, "text": "\n <database>\n <provider name=\"sqlServer2005\" />\n <dataSource name=\"TheDB\" connectionString=\"$...
2008/12/24
[ "https://Stackoverflow.com/questions/390595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10830/" ]
390,602
<p><strong>Question:</strong> How could I find out the M-x equivalent commands for doing GUI-based operations in Emacs, in those cases where my Emacs-variant uses OS-specific desktop functionality?</p> <p><strong>Background:</strong> Conventional understanding states that everything in Emacs is a command, and that com...
[ { "answer_id": 390617, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 2, "selected": false, "text": "C-h k" }, { "answer_id": 391589, "author": "Joe Casadonte", "author_id": 45978, "author_profile...
2008/12/24
[ "https://Stackoverflow.com/questions/390602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42223/" ]
390,604
<p>This is one of those little detail (and possibly religious) questions. Let's assume we're constructing a REST architecture, and for definiteness lets assume the service needs three parameters, <em>x</em>, <em>y</em>, and <em>z</em>. Reading the various works about REST, it would seem that this should be expressed ...
[ { "answer_id": 390616, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 4, "selected": true, "text": "http://myservice.example.com/resource/x/y/z/" }, { "answer_id": 390694, "author": "Jason S", "author_id": 44...
2008/12/24
[ "https://Stackoverflow.com/questions/390604", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35092/" ]
390,615
<p>Is this a good way to implement a Finally-like behavior in standard C++? (Without special pointers)</p> <pre><code>class Exception : public Exception { public: virtual bool isException() { return true; } }; class NoException : public Exception { public: bool isException() { return false; } }; Object *myO...
[ { "answer_id": 390623, "author": "David Norman", "author_id": 34502, "author_profile": "https://Stackoverflow.com/users/34502", "pm_score": 6, "selected": true, "text": "try {\n // Some work\n}\nfinally {\n // Cleanup code\n}\n" }, { "answer_id": 390624, "author": "Jason ...
2008/12/24
[ "https://Stackoverflow.com/questions/390615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47064/" ]
390,632
<p>Suppose I have the following class:</p> <pre><code>public class TestBase { public bool runMethod1 { get; set; } public void BaseMethod() { if (runMethod1) ChildMethod1(); else ChildMethod2(); } protected abstract void ChildMethod1(); protected abstract void ChildMethod2(); } </co...
[ { "answer_id": 392023, "author": "Lance Fisher", "author_id": 571, "author_profile": "https://Stackoverflow.com/users/571", "pm_score": 2, "selected": false, "text": "[Test]\npublic BaseMethod_should_call_correct_child_method()\n{\n //strict mocks will make sure all expectations are met...
2008/12/24
[ "https://Stackoverflow.com/questions/390632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571/" ]
390,641
<p>In erlang, there are bitwise operations to operate on integers, for example:</p> <pre><code>1&gt 127 bsl 1. 254 </code></pre> <p>there is also the ability to pack integers into a sequence of bytes</p> <pre><code>&lt&lt 16#7F, 16#FF &gt&gt</code></pre> <p>is it possible, or are there any operators or BIFs that c...
[ { "answer_id": 390714, "author": "Mike Hamer", "author_id": 42050, "author_profile": "https://Stackoverflow.com/users/42050", "pm_score": 0, "selected": false, "text": "1> Bits = <<16#0FFFFFFF:(4*8)>>.\n<<15,255,255,255>>\n\n2> size(Bits).\n4\n\n3> Size=size(Bits)*8.\n32\n\n4> <<Num:Size...
2008/12/24
[ "https://Stackoverflow.com/questions/390641", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42050/" ]
390,648
<p>What is the difference between using ToString and ToString() in VB.NET?</p>
[ { "answer_id": 30263308, "author": "Grantly", "author_id": 1491278, "author_profile": "https://Stackoverflow.com/users/1491278", "pm_score": 1, "selected": false, "text": "Dim sbrBuilder as New StringBuilder\n\n...\n\nsbrBuilder.ToString()\nreturn sbrBuilder.ToString\n" } ]
2008/12/24
[ "https://Stackoverflow.com/questions/390648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48581/" ]
390,693
<p>I've been fiddling with ASP.NET MVC since the CTP, and I like a lot of things they did, but there are things I just don't get.</p> <p>For example, I downloaded beta1, and I'm putting together a little personal site/resume/blog with it. Here is a snippet from the ViewSinglePost view:</p> <pre><code> &lt;% /...
[ { "answer_id": 390747, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 4, "selected": false, "text": "<%= %>" }, { "answer_id": 390936, "author": "Todd Smith", "author_id": 31624, "author_profile": "ht...
2008/12/24
[ "https://Stackoverflow.com/questions/390693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
390,702
<p>I have to following code:</p> <p><a href="http://www.nomorepasting.com/getpaste.php?pasteid=22987" rel="nofollow noreferrer">http://www.nomorepasting.com/getpaste.php?pasteid=22987</a></p> <p>If <code>PHPSESSID</code> is not already in the table the <code>REPLACE INTO</code> query works just fine, however if <code...
[ { "answer_id": 391085, "author": "Zoredache", "author_id": 20267, "author_profile": "https://Stackoverflow.com/users/20267", "pm_score": 1, "selected": false, "text": "REPLACE INTO session (phpsessid, data) VALUES(?, ?)\n" }, { "answer_id": 404240, "author": "Kevin Loney", ...
2008/12/24
[ "https://Stackoverflow.com/questions/390702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13834/" ]
390,703
<p>While looking at online code samples, I have sometimes come across an assignment of a String constant to a String object via the use of the new operator.</p> <p>For example:</p> <pre><code>String s; ... s = new String("Hello World"); </code></pre> <p>This, of course, compared to</p> <pre><code>s = "Hello World";...
[ { "answer_id": 390722, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": -1, "selected": false, "text": "int q;\nfor(q=0;q<MAX;q++){\n String s;\n int ix;\n // other stuff\n s = new String(\"Hello, there!\")...
2008/12/24
[ "https://Stackoverflow.com/questions/390703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23072/" ]
390,723
<p>I am trying to install an app inside of another web app. I have my .aspx pages and some code that I was putting into the main app's app_code folder. I've added my own web.config file for my connection string and such but I think there's a conflict. So my question is a two parter. First, what is the best way to insta...
[ { "answer_id": 390722, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": -1, "selected": false, "text": "int q;\nfor(q=0;q<MAX;q++){\n String s;\n int ix;\n // other stuff\n s = new String(\"Hello, there!\")...
2008/12/24
[ "https://Stackoverflow.com/questions/390723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45429/" ]
390,727
<p>I'm just finishing a web page for our sales guy to quickly go through a list of contacts. </p> <p>Is it possible to initiate a call from our Vonage line via a Hyperlink?</p> <p>They offer an application called "Click-2-Call" but I hope it's possible to initiate it using only a Hyperlink.</p>
[ { "answer_id": 390791, "author": "EndangeredMassa", "author_id": 106, "author_profile": "https://Stackoverflow.com/users/106", "pm_score": 2, "selected": true, "text": "Call <a href=\"phone: 123-456-7890\">123-456-7890</a>\n" } ]
2008/12/24
[ "https://Stackoverflow.com/questions/390727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3747/" ]
390,730
<p>I'm quite new to database design and have some questions about best practices and would really like to learn. I am designing a database schema, I have a good idea of the requirements and now its a matter of getting it into black and white.</p> <p>In this pseudo-database-layout, I have a table of customers, table of...
[ { "answer_id": 390745, "author": "dtc", "author_id": 32892, "author_profile": "https://Stackoverflow.com/users/32892", "pm_score": 3, "selected": false, "text": "TBL_ORDER:\nID\nTBL_CUSTOMER.ID\n\nTBL_ORDER_ITEM:\nID\nTBL_ORDER.ID\nTBL_PRODUCTS.ID\nQuantity\nUniqueDetails\n" } ]
2008/12/24
[ "https://Stackoverflow.com/questions/390730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29820/" ]
390,736
<p>How do you open a file from a java application when you do not know which application the file is associated with. Also, because I'm using Java, I'd prefer a platform independent solution.</p>
[ { "answer_id": 390779, "author": "RealHowTo", "author_id": 25122, "author_profile": "https://Stackoverflow.com/users/25122", "pm_score": 6, "selected": true, "text": "java.awt.Desktop" }, { "answer_id": 390785, "author": "OscarRyz", "author_id": 20654, "author_profile...
2008/12/24
[ "https://Stackoverflow.com/questions/390736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36858/" ]
390,748
<p>let's say that I have an XML file containing this :</p> <pre><code>&lt;description&gt;&lt;![CDATA[ &lt;h2&gt;lorem ipsum&lt;/h2&gt; &lt;p&gt;some text&lt;/p&gt; ]]&gt;&lt;/description&gt; </code></pre> <p>that I want to get and parse in ActionScript 2 as HTML text, and setting some CSS before displaying it...
[ { "answer_id": 392307, "author": "gltovar", "author_id": 2855, "author_profile": "https://Stackoverflow.com/users/2855", "pm_score": 1, "selected": false, "text": "someXML = new XML();\nsomeXML.ignoreWhite = true;\n" }, { "answer_id": 393391, "author": "fenomas", "author_...
2008/12/24
[ "https://Stackoverflow.com/questions/390748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26721/" ]
390,789
<p>I am working on a c++ win32 program that involves a keyboard hook. The application is a win32 project with no user interface whatsoever. I need to keep the application from closing without using causing the hook to not work or use up a bunch of system resources. I used to use a message box but I need the application...
[ { "answer_id": 390917, "author": "Lodle", "author_id": 23339, "author_profile": "https://Stackoverflow.com/users/23339", "pm_score": -1, "selected": false, "text": "bool shouldExit = false;\n\ndo\n{\n //some code to handle events\n shouldExit = handleEvents();\n\n //sleep for a sma...
2008/12/24
[ "https://Stackoverflow.com/questions/390789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37875/" ]
390,797
<p>After some stupid musings about Klingon languages, that came from this <a href="https://stackoverflow.com/questions/304564/is-there-a-good-k-kode-editor-for-klingon">post</a> I began a silly hobby project creating a Klingon programming language that compiles to Lua byte-code. During the initial language design phase...
[ { "answer_id": 390980, "author": "Daniel Daranas", "author_id": 96780, "author_profile": "https://Stackoverflow.com/users/96780", "pm_score": 3, "selected": false, "text": "HelperFunctionDoesNothing(\"This is a comment! Blah Blah Blah...\");\n" }, { "answer_id": 391019, "auth...
2008/12/24
[ "https://Stackoverflow.com/questions/390797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15124/" ]
390,798
<p>I have a business case whereby I need to be able to specify my own calling convention when using P/Invoke. Specifically, I have a legacy dll which uses a non-standard ABI, and I need to able to specify the calling convention for each function. </p> <p>For example, one function in this dll accepts its first two argu...
[ { "answer_id": 393761, "author": "erikkallen", "author_id": 47161, "author_profile": "https://Stackoverflow.com/users/47161", "pm_score": 3, "selected": true, "text": "int RealFunction(int param1, const char * param2, char param 3);\n\nint MyFunction(int param1, int param2, int param3) {...
2008/12/24
[ "https://Stackoverflow.com/questions/390798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48821/" ]
390,800
<p>Create a class (call it FormElement). That class should have some properties like the metadata they have with data elements (name, sequence number, value—which is just a string, etc).</p> <p>This class has as attributes of type Validation Application Block Validation classes.</p> <p>I want to serialize it to xml ...
[ { "answer_id": 393929, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 2, "selected": false, "text": "// This code serializes a class instance to an XML file:\nXmlSerializer xs = new XmlSerializer(typeof(objectToSerialize));\n...
2008/12/24
[ "https://Stackoverflow.com/questions/390800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48824/" ]