qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
339,910
<p>in context of SQL Server 2005, I have a table for which the primary key is a uniqueidentifier (GUID), with a default value generated by the newid() function. I want to write a stored procedure that inserts a new record into the table. How do I get the record's PK value? for an identity-declared field, this is easy -...
[ { "answer_id": 339918, "author": "Paul Nearney", "author_id": 24071, "author_profile": "https://Stackoverflow.com/users/24071", "pm_score": 3, "selected": true, "text": "DECLARE @newGuid uniqueidentifier\nSET @newGuid = newid()\n\nINSERT INTO myTable(id, stringval)\nVALUES (@newGuid, \"H...
2008/12/04
[ "https://Stackoverflow.com/questions/339910", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11464/" ]
339,912
<p>I have class with internal property:</p> <pre><code>internal virtual StateEnum EnrolmentState { get { ..getter logic } set { ..setter logic } } </code></pre> <p>However I want to be able to access to this property outside of the assembly so I created method that simply returns this property:</p> <pre><c...
[ { "answer_id": 339937, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": true, "text": "InternalsVisibleTo" }, { "answer_id": 340195, "author": "Aleksandar", "author_id": 29511, "author_pro...
2008/12/04
[ "https://Stackoverflow.com/questions/339912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29511/" ]
339,923
<p>In an HTML table, the <code>cellpadding</code> and <code>cellspacing</code> can be set like this:</p> <pre class="lang-html prettyprint-override"><code>&lt;table cellspacing="1" cellpadding="1"&gt; </code></pre> <p>How can the same be accomplished using CSS?</p>
[ { "answer_id": 339964, "author": "mat", "author_id": 42083, "author_profile": "https://Stackoverflow.com/users/42083", "pm_score": 6, "selected": false, "text": "cellspacing=\"0\"" }, { "answer_id": 339997, "author": "Will Prescott", "author_id": 13780, "author_profil...
2008/12/04
[ "https://Stackoverflow.com/questions/339923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1065/" ]
339,931
<p>Javascript client side application.</p> <p>Trying to eliminate memory leaks leads to ugly (to say the least) code.</p> <p>I am trying to clean up in window.unload instead on messing up all the code trying to avoid them.</p> <p>We use mostly <code>element.onevent=function(){..};</code> pattern, that results in clo...
[ { "answer_id": 1889571, "author": "Ruan Mendes", "author_id": 227299, "author_profile": "https://Stackoverflow.com/users/227299", "pm_score": 3, "selected": true, "text": "var EvtMgr = (function(){\n var listenerMap = {};\n\n // Public interface\n return {\n addListener: function (...
2008/12/04
[ "https://Stackoverflow.com/questions/339931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28207/" ]
339,935
<p>For example:</p> <p>script.js:</p> <pre><code>function functionFromScriptJS() { alert('inside functionFromScriptJS'); } </code></pre> <p>iframe.html:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script language="Javascript" src="script.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;iframe&gt; &lt;b...
[ { "answer_id": 339965, "author": "Ryan Cook", "author_id": 43029, "author_profile": "https://Stackoverflow.com/users/43029", "pm_score": 3, "selected": true, "text": "<iframe>" }, { "answer_id": 339990, "author": "adam", "author_id": 33604, "author_profile": "https://...
2008/12/04
[ "https://Stackoverflow.com/questions/339935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/578/" ]
339,939
<h2>My Situation</h2> <ul> <li>I have a N rectangles</li> <li>The rectangles all have the same shape (for example 2 inches wide x 1 inch tall) - Let's refer to this size as Sw and Sh for the width and height</li> <li>I want to position these rectangles in a grid such that the rects completely on top and next to each o...
[ { "answer_id": 339982, "author": "Will Dean", "author_id": 987, "author_profile": "https://Stackoverflow.com/users/987", "pm_score": 1, "selected": false, "text": "N/nCols*Sh + nCols*Sw\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/339939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13477/" ]
339,952
<p>We are in the process of upgrading our projects from C# 2.0 / VS2005 to C# 3.0 / VS2008. As part of the upgrade, we are adding some items to our coding standards document.</p> <p>How would (or did) you change your coding standards document when upgrading from C# 2.0 / VS2005 to C# 3.0 / VS2008?</p>
[ { "answer_id": 340028, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "var" }, { "answer_id": 341485, "author": "David Schmitt", "author_id": 4918, "author_profile": "https...
2008/12/04
[ "https://Stackoverflow.com/questions/339952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2822/" ]
339,956
<p>What is the best method for date of birth selector?</p> <ul> <li>3 text inputs (month / day / year) or one mask input. User MUST use keyboard</li> <li>3 select boxes. User can use keyboard or mouse. </li> <li>One nice <a href="http://jqueryui.com/demos/datepicker/" rel="noreferrer">datepicker</a>.</li> </ul> <p>I ...
[ { "answer_id": 3261876, "author": "Bennett McElwee", "author_id": 61754, "author_profile": "https://Stackoverflow.com/users/61754", "pm_score": 4, "selected": false, "text": " _______\n|_______| (example: 31/3/1970)\n" }, { "answer_id": 24788502, "author": "user3845825", ...
2008/12/04
[ "https://Stackoverflow.com/questions/339956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23810/" ]
339,961
<p>I need the perfect algorithm or C# function to calculate the difference (distance) between 2 decimal numbers.</p> <p>For example the difference between:<br /> <strong>100</strong> and <strong>25</strong> is <strong>75</strong><br /> <strong>100</strong> and <strong>-25</strong> is <strong>125</strong><br /> <strong...
[ { "answer_id": 339979, "author": "terjetyl", "author_id": 29519, "author_profile": "https://Stackoverflow.com/users/29519", "pm_score": 8, "selected": true, "text": "public decimal FindDifference(decimal nr1, decimal nr2)\n{\n return Math.Abs(nr1 - nr2);\n}\n" }, { "answer_id": ...
2008/12/04
[ "https://Stackoverflow.com/questions/339961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18631/" ]
339,962
<p>What I am trying to do when the user is in a textbox (in silverlight 2.0):</p> <ul> <li>When user presses the decimal point (.) <strong>on the numeric pad</strong>, I want to have it replaced by the correct decimal separator (which is comma (,) in a lot of countries)</li> </ul> <p>I can track that the user typed a...
[ { "answer_id": 340162, "author": "Tjipke", "author_id": 17709, "author_profile": "https://Stackoverflow.com/users/17709", "pm_score": 1, "selected": true, "text": " void CellText_KeyUp(object sender, KeyEventArgs e)\n {\n var DecSep = System.Threading.Thread.CurrentThread.Cu...
2008/12/04
[ "https://Stackoverflow.com/questions/339962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17709/" ]
339,963
<p>I'm trying to use System.Transaction.TransactionScope to create a transaction to call a few stored procedures but it doesn't seem to clean up after itself. Once the transaction is finished (commited or not and the transaction scope object is disposed) subsequent connections to the database open up with the read comm...
[ { "answer_id": 340045, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 0, "selected": false, "text": "sp_reset_connection" }, { "answer_id": 341841, "author": "gbn", "author_id": 27535, "author_profi...
2008/12/04
[ "https://Stackoverflow.com/questions/339963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6084/" ]
339,969
<p>I have two models one is Employee and other is Asset, with Many to one relation between Asset and Employee. And Asset is added as StackedInline field to Employee Admin interface, Is there anyway I can make Asset as read only field in the Employee Admin. </p> <p>My intention was to show all the assets the employee i...
[ { "answer_id": 1078084, "author": "ha22109", "author_id": 104824, "author_profile": "https://Stackoverflow.com/users/104824", "pm_score": 2, "selected": false, "text": "from django import forms\nfrom django.utils.safestring import mark_safe\nfrom datetime import datetime\n\nclass ReadOnl...
2008/12/04
[ "https://Stackoverflow.com/questions/339969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7965/" ]
339,971
<p>I have to include many header files, which are in different sub-directories. Is there a way in Visual Studio (I am using 2005 edition) to set one include path that Visual Studio will search also the sub-directories for header files?</p>
[ { "answer_id": 339988, "author": "Joris Timmermans", "author_id": 33987, "author_profile": "https://Stackoverflow.com/users/33987", "pm_score": 6, "selected": true, "text": "#include \"subdirectory/somefile.h\"" }, { "answer_id": 26518113, "author": "riderBill", "author_i...
2008/12/04
[ "https://Stackoverflow.com/questions/339971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9035/" ]
339,995
<p>Is there a better way to develop Java Swing applications?</p> <p>SWIXML? JavaFX? Anything else that developers out here have liked and recommend?</p>
[ { "answer_id": 340088, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 3, "selected": false, "text": "JPanel panel = new JPanel(new MigLayout());\n\npanel.add(firstNameLabel);\npanel.add(firstNameTextField);\npanel.add(lastNameLa...
2008/12/04
[ "https://Stackoverflow.com/questions/339995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29860/" ]
340,003
<p>What is the C++ equivalent to <code>GetObject</code> in <a href="http://en.wikipedia.org/wiki/JavaScript" rel="nofollow noreferrer">JavaScript</a> and <a href="http://en.wikipedia.org/wiki/VBScript" rel="nofollow noreferrer">VBScript</a>?</p> <p>The closest match I found to my question is:</p> <p><a href="http://c...
[ { "answer_id": 340032, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 1, "selected": false, "text": "CoGetObject" }, { "answer_id": 340117, "author": "Emmanuel Caradec", "author_id": 4508, "author...
2008/12/04
[ "https://Stackoverflow.com/questions/340003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4508/" ]
340,007
<p>I've recently have a reason to include into our build script the creation of an XML configuration file. The most straightforward way I can think of to do this is to hard-code the XML content as a string into the script and then to simply create a file and write that XML string to the file (named appropriately etc). ...
[ { "answer_id": 352035, "author": "jpoh", "author_id": 4368, "author_profile": "https://Stackoverflow.com/users/4368", "pm_score": 0, "selected": false, "text": "Function XMLToString(Nodes)\n dim retStr\n retStr = \"<?xml version=\"\"1.0\"\" encoding=\"\"utf-8\"\" ?>\"\n XMLToString = ...
2008/12/04
[ "https://Stackoverflow.com/questions/340007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4368/" ]
340,010
<p>I was reading up about NTVDM.exe as I build a quick test console app and it crashed on a friends machine complaining about this EXE.</p> <p>As I understand it all DOS cmd windows (C# console apps included) run as 16bit not 32bit.</p> <p>Is this true? Does this mean all my works console app back office apps are ru...
[ { "answer_id": 588720, "author": "RBerteig", "author_id": 68204, "author_profile": "https://Stackoverflow.com/users/68204", "pm_score": 0, "selected": false, "text": ".COM" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6486/" ]
340,020
<p>I'm using this query to get all employees of {clients with name starting with lowercase "a"}:</p> <pre><code>SELECT * FROM employees WHERE client_id IN (SELECT id FROM clients WHERE name LIKE 'a%') </code></pre> <p>Column <code>employees.client_id</code> is an int, with <code>INDEX client_id (index_id)</code>. ...
[ { "answer_id": 340029, "author": "cagcowboy", "author_id": 19629, "author_profile": "https://Stackoverflow.com/users/19629", "pm_score": 5, "selected": true, "text": "SELECT employees.*\nFROM employees, clients\nWHERE employees.client_id = clients.id\nAND clients.name LIKE 'a%';\n"...
2008/12/04
[ "https://Stackoverflow.com/questions/340020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19746/" ]
340,030
<p>Is there a Firefox plugin for manipulating and deleting saved form data? In the browser there is only the option to delete all data.</p>
[ { "answer_id": 340050, "author": "stesch", "author_id": 41860, "author_profile": "https://Stackoverflow.com/users/41860", "pm_score": 2, "selected": false, "text": "formhistory.sqlite" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43144/" ]
340,043
<p>I have a problem and i would like to learn the correct way to solve this. </p> <p>I have a Data Objeckt</p> <pre><code>class LinkHolder { public string Text; public string Link; } </code></pre> <p>I would like to present to the user a RadioButton list that uses the LinkHolder.Text value as descriptive tex...
[ { "answer_id": 340087, "author": "terjetyl", "author_id": 29519, "author_profile": "https://Stackoverflow.com/users/29519", "pm_score": 0, "selected": false, "text": "class LinkHolder {\n public string Text { get; set;}\n public string Link { get; set;}\n}\n" }, { "answer_i...
2008/12/04
[ "https://Stackoverflow.com/questions/340043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40274/" ]
340,046
<p>We have enableviewstate property for all the server controls in ASP.net. We know that its going to have the member datas and values in viewstate across postbacks</p> <p>What is the actual example for this?</p>
[ { "answer_id": 340370, "author": "HTTP 410", "author_id": 13118, "author_profile": "https://Stackoverflow.com/users/13118", "pm_score": 2, "selected": false, "text": "<asp:Label runat=\"server\" Font-Name=\"Verdana\" Text=\"Hello, World!\"></asp:Label>\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22162/" ]
340,049
<p>When I call GetForegroundWindow from c# I am getting the explorer parent process ID (I see this from process explorer) and not the process ID of the app that is in the foreground.</p> <p>Why is this and how do get the right process ID?</p> <p>Malcolm</p>
[ { "answer_id": 340207, "author": "Wolf5", "author_id": 37643, "author_profile": "https://Stackoverflow.com/users/37643", "pm_score": 3, "selected": false, "text": " [DllImport(\"user32\", SetLastError = true)]\n public static extern int GetForegroundWindow();\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40568/" ]
340,090
<p>I have a C# method that projects the value of a number from an interval to a target interval.<br> <strong>For example:</strong> we have an interval of -1000 and 9000 and a value of 5000; if we want to project this value to an interval of 0..100 we get 60.</p> <p>Here is the method: </p> <pre><code>/// &lt;summary&...
[ { "answer_id": 340141, "author": "Skizz", "author_id": 1898, "author_profile": "https://Stackoverflow.com/users/1898", "pm_score": 1, "selected": false, "text": "intervalTop + (intervalBottom - intervalTop) * (val - min) / (max - min);\n" }, { "answer_id": 340150, "author": "...
2008/12/04
[ "https://Stackoverflow.com/questions/340090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18631/" ]
340,093
<p>I'm trying to make a proxy object in IronPython, which should dynamically present underlying structure. The proxy itself shouldn't have any functions and properties, I'm trying to catch all the calls in the runtime. Catching the function calls is easy, I just need to define <strong>getattr</strong>() function for my...
[ { "answer_id": 340141, "author": "Skizz", "author_id": 1898, "author_profile": "https://Stackoverflow.com/users/1898", "pm_score": 1, "selected": false, "text": "intervalTop + (intervalBottom - intervalTop) * (val - min) / (max - min);\n" }, { "answer_id": 340150, "author": "...
2008/12/04
[ "https://Stackoverflow.com/questions/340093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43152/" ]
340,095
<p>I am looking for a .net templating engine - something simple, lightweight, stable with not too many dependencies. All I need it for at the moment is creating templated plain text and html emails. Can anyone give me a good recommendation?</p> <p>If it helps at all - something like Java's <a href="http://freemarker...
[ { "answer_id": 33546901, "author": "Nigrimmist", "author_id": 1151741, "author_profile": "https://Stackoverflow.com/users/1151741", "pm_score": 2, "selected": false, "text": "namespace ConsoleApplication4\n{\nclass Program\n{\n static void Main(string[] args)\n {\n\n Stopwat...
2008/12/04
[ "https://Stackoverflow.com/questions/340095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1853/" ]
340,104
<p>So I've got some scripts I've written which set up a Google map on my page. These scripts are in included in the <code>&lt;head&gt;</code> of my page, and use jQuery to build the map with markers generated from a list of addresses on the page.</p> <p>However, I have some exact co-ordinate data for each address whic...
[ { "answer_id": 340126, "author": "Rob Stevenson-Leggett", "author_id": 4950, "author_profile": "https://Stackoverflow.com/users/4950", "pm_score": 1, "selected": false, "text": " <input id=\"coordinates\" type=\"hidden\" value=\"123.2123.123:123,123,321;.....\" />\n" }, { "answer...
2008/12/04
[ "https://Stackoverflow.com/questions/340104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31582/" ]
340,111
<pre><code>&lt;document.write("&lt;SCR"+"IPT TYPE='text/javascript' SRC='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+gDomain+"/"+gDcsId+"/wtid.js"+"'&gt;&lt;\/SCR"+"IPT&gt;"); </code></pre> <p>I need to escape the string above in order to add the whole thing to a StringBuilder but so far I mu...
[ { "answer_id": 340130, "author": "Ian G", "author_id": 31765, "author_profile": "https://Stackoverflow.com/users/31765", "pm_score": 0, "selected": false, "text": "JavaScript" }, { "answer_id": 340159, "author": "Stephane", "author_id": 32891, "author_profile": "https...
2008/12/04
[ "https://Stackoverflow.com/questions/340111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42108/" ]
340,128
<p>We know that Python provides a lot of productivity over any compiled languages. We have programming in C# &amp; need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. </p> <p>Is it ideal choice to write unit test c...
[ { "answer_id": 2994724, "author": "Andy Dent", "author_id": 53870, "author_profile": "https://Stackoverflow.com/users/53870", "pm_score": 1, "selected": false, "text": "[TestCase(12, 3, 4)]\n[TestCase(12, 2, 6)]\n[TestCase(12, 4, 3)]\n[TestCase(12, 0, 0, ExpectedException = typeof(System...
2008/12/04
[ "https://Stackoverflow.com/questions/340128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43056/" ]
340,138
<p>I have the odd problem that I am not able to open the properties of my .NET projects in Visual Studio. If I try to open it by clicking on the Properties tree node in the Solution Explorer I get the following message:</p> <blockquote> <p>There is no editor available for '....csproj'. Make sure the application for ...
[ { "answer_id": 413430, "author": "Mil", "author_id": 9470, "author_profile": "https://Stackoverflow.com/users/9470", "pm_score": 6, "selected": true, "text": "devenv /ResetSkipPkgs\n" }, { "answer_id": 43673571, "author": "Anoop", "author_id": 2123370, "author_profile...
2008/12/04
[ "https://Stackoverflow.com/questions/340138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9470/" ]
340,139
<p>I have a set of conditions in my where clause like</p> <pre><code>WHERE d.attribute3 = 'abcd*' AND x.STATUS != 'P' AND x.STATUS != 'J' AND x.STATUS != 'X' AND x.STATUS != 'S' AND x.STATUS != 'D' AND CURRENT_TIMESTAMP - 1 &lt; x.CREATION_TIMESTAMP </code></pre> <p>Which of these conditions will be executed ...
[ { "answer_id": 340293, "author": "Tony Andrews", "author_id": 18747, "author_profile": "https://Stackoverflow.com/users/18747", "pm_score": 6, "selected": true, "text": "SQL> set autotrace on\nSQL> select * from emp\n 2 join dept on dept.deptno = emp.deptno\n 3 where emp.ename like '...
2008/12/04
[ "https://Stackoverflow.com/questions/340139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16488/" ]
340,145
<p>How can I add the reboot action to a vdproj?</p> <p>I need an <a href="http://en.wikipedia.org/wiki/Windows_Installer" rel="nofollow noreferrer">MSI</a> file which restart the PC at the end of the installation.</p>
[ { "answer_id": 342926, "author": "saschabeaumont", "author_id": 592, "author_profile": "https://Stackoverflow.com/users/592", "pm_score": 2, "selected": false, "text": "ForceReboot" }, { "answer_id": 6664104, "author": "angularsen", "author_id": 134761, "author_profil...
2008/12/04
[ "https://Stackoverflow.com/questions/340145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15485/" ]
340,183
<p>I've been spending some time looking at Phil Haack's article on <a href="http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx" rel="noreferrer">Grouping Controllers</a> very interesting stuff.</p> <p>At the moment I'm trying to figure out if it would be possible to use the same ideas to create a plug-in/mo...
[ { "answer_id": 340322, "author": "gius", "author_id": 19712, "author_profile": "https://Stackoverflow.com/users/19712", "pm_score": 2, "selected": false, "text": "public IView GetView(string viewName)\n{\n switch (viewName)\n {\n case \"Namespace.View1\":\n return...
2008/12/04
[ "https://Stackoverflow.com/questions/340183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35047/" ]
340,185
<p>I am working on an application that involves some gis stuff. There would be some .shp files to be read and plotted onto an opengl screen. The current opengl screen is using the orthographic projection as set from <code>glOrtho()</code> and is already displaying a map using coordinates from a simple text file..</p> ...
[ { "answer_id": 24601460, "author": "msmith81886", "author_id": 2142228, "author_profile": "https://Stackoverflow.com/users/2142228", "pm_score": 0, "selected": false, "text": "Guide Books" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340185", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30868/" ]
340,192
<p>I have a problem with a oneway web method that open a moss site (probably because in a oneway webmethod the context is null)</p> <p>Is possible to rewrite this code to remove the null reference exception? (without the oneway attribute i don't have the exception)</p> <pre><code>[SoapDocumentMethod(OneWay = true)] ...
[ { "answer_id": 355627, "author": "tartafe", "author_id": 43162, "author_profile": "https://Stackoverflow.com/users/43162", "pm_score": 2, "selected": true, "text": "//Call this before call new SPSite()\n private static void ChangeContext(string webUrl)\n {\n Trace.Trace...
2008/12/04
[ "https://Stackoverflow.com/questions/340192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43162/" ]
340,194
<p>how to validate letters and whitespaces using Zend Framework ?</p>
[ { "answer_id": 341114, "author": "dcousineau", "author_id": 20265, "author_profile": "https://Stackoverflow.com/users/20265", "pm_score": 2, "selected": false, "text": "true" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
340,204
<p>Can a macro be written in Scheme (with <code>define-syntax</code>, for example) which will take expressions like this:</p> <pre><code>(op a b c d e f g h i j) </code></pre> <p>And yield expressions like this as output?</p> <pre><code>(op (op (op (op (op (op (op (op (op a b) c) d) e) f) g) h) i) j) </code></pre> ...
[ { "answer_id": 340294, "author": "namin", "author_id": 34596, "author_profile": "https://Stackoverflow.com/users/34596", "pm_score": 4, "selected": true, "text": "(define bop list)\n\n(define-syntax op\n (syntax-rules ()\n ((op a b) (bop a b))\n ((op a b c ...) (op (bop a b) c ......
2008/12/04
[ "https://Stackoverflow.com/questions/340204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15055/" ]
340,209
<p>I'm writing a Java game and I want to implement a power meter for how hard you are going to shoot something. </p> <p>I need to write a function that takes a int between 0 - 100, and based on how high that number is, it will return a color between Green (0 on the power scale) and Red (100 on the power scale).</p> ...
[ { "answer_id": 340214, "author": "Paul Dixon", "author_id": 6521, "author_profile": "https://Stackoverflow.com/users/6521", "pm_score": 9, "selected": true, "text": "255" }, { "answer_id": 340234, "author": "efotinis", "author_id": 12320, "author_profile": "https://St...
2008/12/04
[ "https://Stackoverflow.com/questions/340209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2635/" ]
340,213
<p>I work on a program in Delphi that holds a lot of data, and I wonder which method is the best to save it to file. Now we use records and "file of" to save it but I think it should be better methods. I would prefer a system that makes it easy to migrate from the system we use now.</p> <p>EDIT: The application is a s...
[ { "answer_id": 340304, "author": "Miel", "author_id": 17336, "author_profile": "https://Stackoverflow.com/users/17336", "pm_score": 2, "selected": false, "text": "procedure TmyThing.PutData(AFile: String);\nvar\n writer: TWriter;\n stream: TFileStream;\nbegin\n stream := TFileStream.C...
2008/12/04
[ "https://Stackoverflow.com/questions/340213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36966/" ]
340,217
<p>I have two tables with the following columns:</p> <p>table1:</p> <pre><code>id, agent_name, ticket_id, category, date_logged </code></pre> <p>table2:</p> <pre><code>id, agent_name, department, admin_status </code></pre> <p>What I'm trying to achieve is to Select all rows from table1 where an agents department i...
[ { "answer_id": 340231, "author": "Arvo", "author_id": 35777, "author_profile": "https://Stackoverflow.com/users/35777", "pm_score": 0, "selected": false, "text": "select \n a.id, a.agent_name, a.ticket_id, \n a.category, a.date_logged, b.department\nfrom \n table1 a inner join t...
2008/12/04
[ "https://Stackoverflow.com/questions/340217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42428/" ]
340,223
<p>I have checked the whole site and googled on the net but was unable to find a simple solution to this problem.</p> <p>I have a datatable which has about 20 columns and 10K rows. I need to remove the duplicate rows in this datatable based on 4 key columns. Doesn't .Net have a function which does this? The function c...
[ { "answer_id": 340235, "author": "Samiksha", "author_id": 29515, "author_profile": "https://Stackoverflow.com/users/29515", "pm_score": 0, "selected": false, "text": "DELETE FROM table1 AS tb1 INNER JOIN \n(SELECT id, COUNT(id) AS cntr FROM table1 GROUP BY id) AS tb2\nON tb1.id = tb2.id ...
2008/12/04
[ "https://Stackoverflow.com/questions/340223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24105/" ]
340,232
<p>With my jquery I'm trying to make the transition from a message to a loading function easy on the eyes by animate the opasity of the message out, inserting the loading.gif and animating the opacity back in. It fails.</p> <pre><code>$('#powerSearchSubmitButton').click(function(ev) { startLoad(); return false...
[ { "answer_id": 341339, "author": "Nathan Long", "author_id": 4376, "author_profile": "https://Stackoverflow.com/users/4376", "pm_score": 2, "selected": false, "text": "$(this).fadeOut(500, function() {\n $(this).html(\"<img src='content/pics/loadingBig.gif' alt='loading'/>\");\n }...
2008/12/04
[ "https://Stackoverflow.com/questions/340232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
340,237
<p>I've cached a value using the ASP.NET Cache, with the following code:</p> <pre><code>Cache.Insert("TEST_VALUE", 150, null, Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(120)); </code></pre> <p>As I understand it, this should mean that if nothing accesses that object for 120 seconds, it will expire and return nu...
[ { "answer_id": 341331, "author": "Mark Bell", "author_id": 43140, "author_profile": "https://Stackoverflow.com/users/43140", "pm_score": 1, "selected": true, "text": "Cache[\"TEST_VALUE\"] = counter;\n" }, { "answer_id": 343273, "author": "Ben Aston", "author_id": 38522, ...
2008/12/04
[ "https://Stackoverflow.com/questions/340237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43140/" ]
340,250
<p>Hi I'm using <code>System.Net.Mail</code> to send some HTML formatted emails.</p> <p>What is the correct method for inserting css into the email message?</p> <p>I know I can apply formatting to each item, but I'ld rather use style sheets..</p> <p><strong>EDIT</strong> I should have mentioned that this is for an i...
[ { "answer_id": 343618, "author": "Alexander Prokofyev", "author_id": 11256, "author_profile": "https://Stackoverflow.com/users/11256", "pm_score": 2, "selected": false, "text": "string letter = File.ReadAllText(Request.PhysicalApplicationPath + \"letter.html\");\nstring style = File.Read...
2008/12/04
[ "https://Stackoverflow.com/questions/340250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31765/" ]
340,270
<p>I'm doing some really simple math and saving the result to a MS SQL2008 DB.</p> <p>I'm <em>averaging</em> out the some numbers, which are byte values between 1&lt;->5. I wish to record probably 2 decimal places only. I don't care about rounding for the 2nd decimal place (eg. a 1.155 == 1.5 or 1.6 .. i'm not too pha...
[ { "answer_id": 340301, "author": "Stein G. Strindhaug", "author_id": 26115, "author_profile": "https://Stackoverflow.com/users/26115", "pm_score": 0, "selected": false, "text": "integer = ( sum(all_values) / all_values.count().float ) * 100;\n" }, { "answer_id": 341100, "auth...
2008/12/04
[ "https://Stackoverflow.com/questions/340270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
340,271
<p>The bugzilla (perl-based) system has a feature to login automatically by using a http server environment variable. If you fill in the right ID or username, you are automatically logged in.</p> <p>My server runs Joomla (PHP-based) and has all the information about who is logged in. It runs bugzilla within a sub-fram...
[ { "answer_id": 340301, "author": "Stein G. Strindhaug", "author_id": 26115, "author_profile": "https://Stackoverflow.com/users/26115", "pm_score": 0, "selected": false, "text": "integer = ( sum(all_values) / all_values.count().float ) * 100;\n" }, { "answer_id": 341100, "auth...
2008/12/04
[ "https://Stackoverflow.com/questions/340271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26387/" ]
340,274
<p>I'm creating a zip file using the class FastZip from SharpZipLib and once I after I close the program, I cannot delete the file because:</p> <p>"Cannot delete zip.zip: It is being used by another person or program. Close any programs that might be using the file and try again."</p> <p>The code that is generating t...
[ { "answer_id": 340406, "author": "Thomas Hansen", "author_id": 29746, "author_profile": "https://Stackoverflow.com/users/29746", "pm_score": 0, "selected": false, "text": "using(Stream s = new SharpZipLibStream())\n{\n /*...do stuff, zip stuff.../\n}\n" }, { "answer_id": 342470...
2008/12/04
[ "https://Stackoverflow.com/questions/340274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36532/" ]
340,277
<p>I would like to use the JTable row sorter new in Java 6. But also I need it to be compatible in Mac OSX with Java 5. </p> <p>Is it possible to find out the JVM version during runtime and use different code for the JTable with and without row sorter?</p>
[ { "answer_id": 340401, "author": "Aaron Digulla", "author_id": 34088, "author_profile": "https://Stackoverflow.com/users/34088", "pm_score": 0, "selected": false, "text": "sorterClass" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9774/" ]
340,282
<p>Can someone explain to me why this code prints 14? I was just asked by another student and couldn't figure it out.</p> <pre><code>int i = 5; i = ++i + ++i; cout&lt;&lt;i; </code></pre>
[ { "answer_id": 340299, "author": "Gonzalo Quero", "author_id": 40996, "author_profile": "https://Stackoverflow.com/users/40996", "pm_score": -1, "selected": false, "text": "int i = 5;\ni = i+1; // First ++i, i is now 6\ni = i+1; // Second ++i, i is now 7\ni = i + i // i = 7 + 7\ncout << ...
2008/12/04
[ "https://Stackoverflow.com/questions/340282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2450/" ]
340,283
<p>Please consider the following <code>fork()</code>/<code>SIGCHLD</code> pseudo-code.</p> <pre><code> // main program excerpt for (;;) { if ( is_time_to_make_babies ) { pid = fork(); if (pid == -1) { /* fail */ } else if (pid == 0) { /* child stuff */ ...
[ { "answer_id": 340312, "author": "Darron", "author_id": 22704, "author_profile": "https://Stackoverflow.com/users/22704", "pm_score": -1, "selected": false, "text": " // main program excerpt\n for (;;) {\n if ( is_time_to_make_babies ) {\n\n pid = fork();\n if (pid...
2008/12/04
[ "https://Stackoverflow.com/questions/340283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
340,286
<p>I keep getting this NPE in my application and I can't seem to get rid of it because it is not showing up in any of my source code. As you can see from the stacktrace it is not happening in my code but in the Swing plaf. Has any of you had this problem and maybe figured out what is happening here?</p> <pre><code> ...
[ { "answer_id": 340340, "author": "bruno conde", "author_id": 31136, "author_profile": "https://Stackoverflow.com/users/31136", "pm_score": 2, "selected": false, "text": "private void setValueIsAdjusting(boolean flag) {\n table.getSelectionModel().setValueIsAdjusting(flag);\n table....
2008/12/04
[ "https://Stackoverflow.com/questions/340286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3379/" ]
340,341
<p>When I call the connect function of the Paramiko <code>SSHClient</code> class, it outputs some log data about establishing the connection, which I would like to suppress.</p> <p>Is there a way to do this either through Paramiko itself, or Python in general?</p>
[ { "answer_id": 340815, "author": "M. Utku ALTINKAYA", "author_id": 40948, "author_profile": "https://Stackoverflow.com/users/40948", "pm_score": 0, "selected": false, "text": "import sys\ndev_null = sys.stdout = sys.stderr = open('/dev/null', 'w')\ntry:\n.\n. connect()\n.\nfinally:\n de...
2008/12/04
[ "https://Stackoverflow.com/questions/340341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42820/" ]
340,344
<p>I Have created an SSRS Report for retrieving 55000 records using a Stored Procedure. When executing from the Stored Proc it is taking just 3 seconds but when executing from SSRS report it is taking more than one minute. How can I solve this problem?</p>
[ { "answer_id": 21031438, "author": "Zain", "author_id": 3179416, "author_profile": "https://Stackoverflow.com/users/3179416", "pm_score": 0, "selected": false, "text": "declare @reportParamLocal int\nset @reportParamLocal = @reportParam\n\nselect * from Table A where A.field = @reportPar...
2008/12/04
[ "https://Stackoverflow.com/questions/340344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
340,345
<p>I've got a C++ service which provides a named pipe to clients with a NULL SECURITY_ATTRIBUTES as follows:</p> <p><code> hPipe = CreateNamedPipe( lpszPipename, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITE...
[ { "answer_id": 21031438, "author": "Zain", "author_id": 3179416, "author_profile": "https://Stackoverflow.com/users/3179416", "pm_score": 0, "selected": false, "text": "declare @reportParamLocal int\nset @reportParamLocal = @reportParam\n\nselect * from Table A where A.field = @reportPar...
2008/12/04
[ "https://Stackoverflow.com/questions/340345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38892/" ]
340,353
<p>I have a post-compilation step that manipulates the Java bytecode of generated classes. I'd like to make life as painless as possible for library consumers, so I'm looking at ways I can make this process automatic and (if possible) compiler agnostic.</p> <p>The <a href="http://java.sun.com/javase/6/docs/api/javax/a...
[ { "answer_id": 340455, "author": "Aaron Digulla", "author_id": 34088, "author_profile": "https://Stackoverflow.com/users/34088", "pm_score": 3, "selected": true, "text": "Example" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304/" ]
340,354
<p>I had two domains for ex. domain1 and domain2, I am opening domain2/index.aspx page as popup from domain1/default.aspx page. While closing domain2 page i need to reload the domain1 page, i had given the javascript code as "Opener.Location.Reload();". I am getting <strong>Permission denied</strong> javascript error. ...
[ { "answer_id": 340417, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 2, "selected": false, "text": "// On the parent...\nfunction DoTheRefresh()\n{\n location.reload();\n}\n" }, { "answer_id": 1355689, ...
2008/12/04
[ "https://Stackoverflow.com/questions/340354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
340,356
<p>When I call CreateProcess in Windows, the new process doesn't seem to inherit the console of the calling process. I made a test program that runs "ruby xtest", xtest being a script that writes "hello" to standard output. I ran this test program from Emacs, and get no output. I also tried the following code callin...
[ { "answer_id": 552413, "author": "MSN", "author_id": 6210, "author_profile": "https://Stackoverflow.com/users/6210", "pm_score": 1, "selected": false, "text": "hStdInput" }, { "answer_id": 640473, "author": "Community", "author_id": -1, "author_profile": "https://Stac...
2008/12/04
[ "https://Stackoverflow.com/questions/340356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
340,359
<p>like whether it is pentium or AMD etc. </p>
[ { "answer_id": 340434, "author": "gimel", "author_id": 6491, "author_profile": "https://Stackoverflow.com/users/6491", "pm_score": 2, "selected": false, "text": "Processor family type" }, { "answer_id": 340611, "author": "WACM161", "author_id": 12255, "author_profile"...
2008/12/04
[ "https://Stackoverflow.com/questions/340359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38807/" ]
340,366
<p>I need to update a record in a database with the following fields </p> <pre><code>[ID] int (AutoIncr. PK) [ScorerID] int [Score] int [DateCreated] smalldatetime </code></pre> <p>If a record exists for todays date (only the date portion should be checked, not the time) and a given scorer, I'd like to update the sco...
[ { "answer_id": 340384, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 5, "selected": true, "text": "IF EXISTS (SELECT NULL FROM MyTable WHERE ScorerID = @Blah AND CONVERT(VARCHAR, DateCreated, 101) = CONVERT(VARCHAR,...
2008/12/04
[ "https://Stackoverflow.com/questions/340366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16440/" ]
340,368
<p>In Visual Studio 2005, is there an easy way to automatically increment the assembly/file build numbers after a successful build?</p> <p>Emphasis on <strong><em>easy</em></strong>. I would like to track my build version, without having to set up CruiseControl or some similar tool.</p>
[ { "answer_id": 340404, "author": "Dean", "author_id": 11802, "author_profile": "https://Stackoverflow.com/users/11802", "pm_score": 3, "selected": true, "text": "<?xml version=\"1.0\" encoding=\"utf-8\"?> <Project DefaultTargets=\"Build\" \n xmlns=\"http://schemas.microsoft.com/...
2008/12/04
[ "https://Stackoverflow.com/questions/340368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22114/" ]
340,376
<p>I was wondering if it's possible to calculate the average of some numbers if I have this:</p> <pre><code>int currentCount = 12; float currentScore = 6.1123 (this is a range of 1 &lt;-&gt; 10). </code></pre> <p>Now, if I receive another score (let's say 4.5), can I recalculate the average so it would be something...
[ { "answer_id": 340387, "author": "John with waffle", "author_id": 279, "author_profile": "https://Stackoverflow.com/users/279", "pm_score": 4, "selected": false, "text": "current_sum += input;\ncurrent_count++;\ncurrent_average = current_sum/current_count;\n" }, { "answer_id": 34...
2008/12/04
[ "https://Stackoverflow.com/questions/340376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
340,383
<pre><code>function a () { return "foo"; } a.b = function () { return "bar"; } function c () { }; c.prototype = a; var d = new c(); d.b(); // returns "bar" d(); // throws exception, d is not a function </code></pre> <p>Is there some way for <code>d</code> to be a function, and yet still inherit properties f...
[ { "answer_id": 340838, "author": "Eugene Lazutkin", "author_id": 26394, "author_profile": "https://Stackoverflow.com/users/26394", "pm_score": 3, "selected": false, "text": "var d = new c();\n" }, { "answer_id": 341050, "author": "Russell Leggett", "author_id": 2828, ...
2008/12/04
[ "https://Stackoverflow.com/questions/340383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31662/" ]
340,413
<p>How do type casting happen without loss of data inside the compiler?</p> <p>For example:</p> <pre><code> int i = 10; UINT k = (UINT) k; float fl = 10.123; UINT ufl = (UINT) fl; // data loss here? char *p = "Stackoverflow Rocks"; unsigned char *up = (unsigned char *) p; </code></pre> <p>How does the compil...
[ { "answer_id": 340439, "author": "MSalters", "author_id": 15416, "author_profile": "https://Stackoverflow.com/users/15416", "pm_score": 3, "selected": false, "text": "& __stack[4] = float_to_int_bits(& __stack[0])" }, { "answer_id": 340466, "author": "James Hopkin", "auth...
2008/12/04
[ "https://Stackoverflow.com/questions/340413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38038/" ]
340,415
<p>I have a <code>JSP</code> page which contains an <code>HTML</code> <code>&lt;select&gt;</code> populated with all countries loaded from a database. Say for example, on "create user" all the country values are loaded in the select menu and I select 5 countries. Those 5 values are loaded into database for that particu...
[ { "answer_id": 340502, "author": "kgiannakakis", "author_id": 24054, "author_profile": "https://Stackoverflow.com/users/24054", "pm_score": 2, "selected": false, "text": "<select multiple=\"multiple\">\n <option value =\"UK\">UK</option>\n <option value =\"France\" selected=\"selected\...
2008/12/04
[ "https://Stackoverflow.com/questions/340415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
340,428
<p>Is it possible to save a form in VBA as .exe file and then run it.</p>
[ { "answer_id": 340490, "author": "Patrick Cuff", "author_id": 7903, "author_profile": "https://Stackoverflow.com/users/7903", "pm_score": 4, "selected": true, "text": "/m" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31132/" ]
340,431
<p>I want to create a linked server in one sql server to another using the sp_addlinkedserver procedure. When i access the remote server I would like it to logon as me (i.e. using my windows account). How do I do this?</p>
[ { "answer_id": 340450, "author": "Ed Harper", "author_id": 27825, "author_profile": "https://Stackoverflow.com/users/27825", "pm_score": 2, "selected": false, "text": "EXEC master.dbo.sp_addlinkedsrvlogin \n @rmtsrvname=N'<your linked server name>',\n @useself=N'True',\n @...
2008/12/04
[ "https://Stackoverflow.com/questions/340431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36189/" ]
340,437
<p>Whilst trawling through some old code I came across something similar to the following:</p> <pre><code>class Base { public: virtual int Func(); ... }; class Derived : public Base { public: int Func(); // Missing 'virtual' qualifier ... }; </code></pre> <p>The code compiles fine (MS VS2008) with no...
[ { "answer_id": 340446, "author": "Blair Conrad", "author_id": 1199, "author_profile": "https://Stackoverflow.com/users/1199", "pm_score": 4, "selected": true, "text": "virtual" }, { "answer_id": 340472, "author": "James Hopkin", "author_id": 11828, "author_profile": "...
2008/12/04
[ "https://Stackoverflow.com/questions/340437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
340,461
<p>I am wondering how to tell NHibernate to resolve dependencies on my POCO domain objects.</p> <p>I figured out that methods like CalculateOrderTax should be in the Domain object because they encode domain specific business rules. But once I have two of those I am violating SRP. </p> <p>It would be no problem to ext...
[ { "answer_id": 341009, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 4, "selected": true, "text": "public class MyInterceptor : EmptyInterceptor\n{\n public override bool OnLoad(object entity, object id, object...
2008/12/04
[ "https://Stackoverflow.com/questions/340461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21699/" ]
340,471
<p>Our development process is highly automated via a raft of bash and php scripts (including subversion hook scripts.) These scripts do a number of things to integrate with our Bugzilla 3.0 installation.</p> <p>But the current integration approach is a bunch of SQL calls which update the bugzilla database directly - ...
[ { "answer_id": 363507, "author": "Larry Silverman", "author_id": 7752, "author_profile": "https://Stackoverflow.com/users/7752", "pm_score": 2, "selected": false, "text": "contrib/bz_webservice_demo.pl" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24106/" ]
340,507
<p>I have a Customer class.</p> <pre><code>public class Customer { private string _id; private string _name; // some more properties follow </code></pre> <p>I am inheriting the EqualityComparer form MyEqualityComparer(of Customer).<br> This I am intending to use in LINQ queries.<br> MyEqualityComparer is...
[ { "answer_id": 340523, "author": "liggett78", "author_id": 19762, "author_profile": "https://Stackoverflow.com/users/19762", "pm_score": 2, "selected": false, "text": "return obj.Id.GetHashCode() ^ obj.Name.GetHashCode();\n" }, { "answer_id": 340526, "author": "Jon Skeet", ...
2008/12/04
[ "https://Stackoverflow.com/questions/340507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41968/" ]
340,520
<p>A few months ago, I have programmed an ASP.NET GridView with a custom "Delete" LinkButton and Client-Side JavaScript Confirmation according to this msdn article:</p> <p><a href="http://msdn.microsoft.com/en-us/library/bb428868.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/bb428868.aspx</a>...
[ { "answer_id": 340747, "author": "Samiksha", "author_id": 29515, "author_profile": "https://Stackoverflow.com/users/29515", "pm_score": 1, "selected": false, "text": "<asp:LinkButton ID=\"DeleteButton\" runat=\"server\" CausesValidation=\"False\"\n CommandName=\"Delete\" Text=\"Delete...
2008/12/04
[ "https://Stackoverflow.com/questions/340520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
340,521
<p>I'm writing a service that will only get calls from the local host. Performance is important so I thought I'd try the <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.netnamedpipebinding.aspx" rel="noreferrer">NetNamedPipeBinding</a> instead of <a href="http://msdn.microsoft.com/en-us/library/sys...
[ { "answer_id": 340869, "author": "Chris Porter", "author_id": 13495, "author_profile": "https://Stackoverflow.com/users/13495", "pm_score": 4, "selected": false, "text": "<binding name=\"MyBindingName\" sendTimeout=\"00:00:30\" receiveTimeout=\"infinite\">\n <reliableSession enabled=\...
2008/12/04
[ "https://Stackoverflow.com/questions/340521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2114/" ]
340,525
<p>I'm trying to learn about Expression trees, and I've created a method that takes an</p> <pre><code>Expression&lt;Func&lt;bool&gt;&gt; </code></pre> <p>and executes it if it satisfies some conditions - see the code below.</p> <pre><code> private static void TryCommand(Expression&lt;Func&lt;bool&gt;&gt; exp...
[ { "answer_id": 340566, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": true, "text": "Func<int>" }, { "answer_id": 1422704, "author": "Ricardo Lacerda Castelo Branco", "author_id": 173246, ...
2008/12/04
[ "https://Stackoverflow.com/questions/340525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32413/" ]
340,528
<p>If both get and set are compulsory in C# automatic properties, why do I have to bother specifying "get; set;" at all?</p>
[ { "answer_id": 340531, "author": "Brian Genisio", "author_id": 36687, "author_profile": "https://Stackoverflow.com/users/36687", "pm_score": 6, "selected": false, "text": "public int Foo { get; private set; }\n" }, { "answer_id": 340535, "author": "Cristian Libardo", "aut...
2008/12/04
[ "https://Stackoverflow.com/questions/340528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38522/" ]
340,543
<p>I have a problem creating a regular expression for the following task:</p> <p>Suppose we have HTML-like text of the kind:</p> <pre><code>&lt;x&gt;...&lt;y&gt;a&lt;/y&gt;...&lt;y&gt;b&lt;/y&gt;...&lt;/x&gt; </code></pre> <p>I want to get a collection of values inside <code>&lt;y&gt;&lt;/y&gt;</code> tags located i...
[ { "answer_id": 340603, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 2, "selected": false, "text": "\"y\" tags cannot be enclosed in other \"y\" tags\n\ninput looks like: <x>...<y>a</y>...<y>b</y>...</x>\n" }, { "a...
2008/12/04
[ "https://Stackoverflow.com/questions/340543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
340,546
<p>It is advised to use override instead of new key word in C#. Why that rule?</p>
[ { "answer_id": 340554, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 5, "selected": true, "text": "Base b = new Derived();\nDerived d = new Derived();\nb.MyMethod(); // Calls Base.MyMethod\nd.MyMethod(); // Calls Derived...
2008/12/04
[ "https://Stackoverflow.com/questions/340546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38807/" ]
340,548
<p>I'm writing some tests in Perl which have a fair amount of set up. This setup all lives in a module that the test scripts <code>use</code>. I want to be able to print some diagnostics from the module, and intended to use the <code>diag</code> function from <code>Test::More</code>. Problem is, when you <code>use Test...
[ { "answer_id": 340554, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 5, "selected": true, "text": "Base b = new Derived();\nDerived d = new Derived();\nb.MyMethod(); // Calls Base.MyMethod\nd.MyMethod(); // Calls Derived...
2008/12/04
[ "https://Stackoverflow.com/questions/340548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6402/" ]
340,553
<p>What is the best way to send HTTP requests from Windows Powershell?</p>
[ { "answer_id": 340570, "author": "Thomas Bratt", "author_id": 15985, "author_profile": "https://Stackoverflow.com/users/15985", "pm_score": 6, "selected": true, "text": "$page = (New-Object System.Net.WebClient).DownloadString(\"http://localhost/\")\n" }, { "answer_id": 21857868,...
2008/12/04
[ "https://Stackoverflow.com/questions/340553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15985/" ]
340,562
<p>In Java (And in general) is there a way to make a class so public that it's methods etc... are accessible from little classes all around that don't even instantiate it? Ha, what I mean is... If I have a daddy class that has a method <code>draw()</code> and it instantiates a baby class called Hand and one called Deck...
[ { "answer_id": 340590, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "https://Stackoverflow.com/users/1288", "pm_score": 3, "selected": true, "text": "class Daddy {\n public foo(){...}\n public createBaby(){\n Baby baby = new Baby(this);\n // baby ...
2008/12/04
[ "https://Stackoverflow.com/questions/340562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29182/" ]
340,568
<p>I'm trying to find an zip compression and encryption component with <a href="http://www.networkworld.com/careers/2004/0315manonline.html" rel="noreferrer">encryption suitable for use by the US Federal Government</a>, so I can't use Zip 2.0 encryption, it has to be AES or the like. I've already found <a href="http:/...
[ { "answer_id": 410446, "author": "Cheeso", "author_id": 48082, "author_profile": "https://Stackoverflow.com/users/48082", "pm_score": 5, "selected": true, "text": " using (ZipFile zip = new ZipFile())\n {\n zip.AddFile(\"ReadMe.txt\"); // no password for this entry\n\n // use a p...
2008/12/04
[ "https://Stackoverflow.com/questions/340568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33264/" ]
340,608
<p>So I was thinking about creating a dynamic sql question, meaning that i want the amount of parameters to be dynamic.</p> <p>Having looked at this: <a href="https://stackoverflow.com/questions/337704/parameterizing-a-sql-in-clause#337725">Parameterize an SQL IN clause</a> i was thinking that using like '%x%' is SLOW...
[ { "answer_id": 340630, "author": "Sergiu Damian", "author_id": 41345, "author_profile": "https://Stackoverflow.com/users/41345", "pm_score": 1, "selected": false, "text": "SELECT UserId FROM NameTable WHERE CHARINDEX( '|' + Name + '|', '|Filip Ekberg|Filip|Ekberg Filip|') > 0\n" }, {...
2008/12/04
[ "https://Stackoverflow.com/questions/340608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39106/" ]
340,610
<p>It is not possible to fire an event in C# that has no handlers attached to it. So before each call it is necessary to check if the event is null.</p> <pre><code>if ( MyEvent != null ) { MyEvent( param1, param2 ); } </code></pre> <p>I would like to keep my code as clean as possible and get rid of those null check...
[ { "answer_id": 340618, "author": "Dinah", "author_id": 356, "author_profile": "https://Stackoverflow.com/users/356", "pm_score": 8, "selected": true, "text": "public delegate void MyClickHandler(object sender, string myValue);\npublic event MyClickHandler Click = delegate {}; // add empt...
2008/12/04
[ "https://Stackoverflow.com/questions/340610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35440/" ]
340,622
<p>Is there a shortcut key to bring up the call hierarchy of a method inline with the code, in the quick menu format, rather than bringing up the call hierarchy panel?</p>
[ { "answer_id": 49383362, "author": "mani_drinks_coffee", "author_id": 1315254, "author_profile": "https://Stackoverflow.com/users/1315254", "pm_score": 2, "selected": false, "text": "alt" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42491/" ]
340,623
<p>I understand that programming to interfaces helps with loose coupling. However, is there a guideline that explains when its most effective?</p> <p>For example, I have a simple web application that collects data on employees, their training plans, expenses and computes their expense for the year etc. This is a fairl...
[ { "answer_id": 340665, "author": "terjetyl", "author_id": 29519, "author_profile": "https://Stackoverflow.com/users/29519", "pm_score": 2, "selected": false, "text": "class SimpleClass\n{\n public int A { get; set; }\n public int B { get; set; }\n public int C { get; set; }\n}\n\nList...
2008/12/04
[ "https://Stackoverflow.com/questions/340623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40070/" ]
340,627
<p>I need to parse Visual Studio automatically generated XML documentation to create a report. I decided to use XSLT but I'm very new to it and need help. Common template is:</p> <pre><code>&lt;doc&gt; &lt;members&gt; &lt;member name="F:MyNamespace"&gt; &lt;summary&gt;Some text&lt;/summary&gt; &lt;/mem...
[ { "answer_id": 340865, "author": "Dimitre Novatchev", "author_id": 36305, "author_profile": "https://Stackoverflow.com/users/36305", "pm_score": 4, "selected": true, "text": "XslCompiledTransform" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41956/" ]
340,645
<p>Let's say I have a simple chunck of XML:-</p> <pre><code>&lt;root&gt; &lt;item forename="Fred" surname="Flintstone" /&gt; &lt;item forename="Barney" surname="Rubble" /&gt; &lt;/root&gt; </code></pre> <p>Having fetched this XML in Silverlight I would like to bind it with <a href="http://en.wikipedia.org/wiki/...
[ { "answer_id": 341358, "author": "Bryant", "author_id": 10893, "author_profile": "https://Stackoverflow.com/users/10893", "pm_score": 2, "selected": false, "text": "public class XAttributeConverter : IValueConverter\n{\n public object Convert(object value, Type targetType, object para...
2008/12/04
[ "https://Stackoverflow.com/questions/340645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17516/" ]
340,657
<p>Is there a way to just tell the compiler, that I want my objects to be serializable by default?</p>
[ { "answer_id": 342178, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": true, "text": "[Serializable]" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1220/" ]
340,696
<p>Does cygwin allow a statically compiled binary? This would prevent the need for cygwin1.dll being on the PATH of target machines.</p>
[ { "answer_id": 27370738, "author": "chenwj", "author_id": 577251, "author_profile": "https://Stackoverflow.com/users/577251", "pm_score": 4, "selected": false, "text": "-mno-cygwin" }, { "answer_id": 44076504, "author": "Peter Schultz", "author_id": 2480447, "author_p...
2008/12/04
[ "https://Stackoverflow.com/questions/340696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5823/" ]
340,708
<p>I want to use jQuery with a GridView which contains textboxes, but I'm stuck on how to get event listeners registered for every textbox on the selected row. I was thinking I could do something with a StingBuilder in the Unload event of the GridView but I can't get it working.</p>
[ { "answer_id": 340795, "author": "BigJump", "author_id": 8542, "author_profile": "https://Stackoverflow.com/users/8542", "pm_score": 2, "selected": true, "text": "<asp:GridView runat=\"server\">\n <Columns>\n <asp:BoundField ControlStyle-CssClass=\"someclass\" DataField=\"xxx\" />\n ...
2008/12/04
[ "https://Stackoverflow.com/questions/340708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30512/" ]
340,717
<p>Seeing this: <a href="http://www.suckless.org/wiki.html" rel="nofollow noreferrer">http://www.suckless.org/wiki.html</a>. A wiki based on Mercurial. Are there any other non-code related use to version control? Is there any other projects that uses version control tools inside instead of programming their own specifi...
[ { "answer_id": 340731, "author": "Joachim Sauer", "author_id": 40342, "author_profile": "https://Stackoverflow.com/users/40342", "pm_score": 3, "selected": false, "text": "/etc" }, { "answer_id": 7585122, "author": "Félix Saparelli", "author_id": 231788, "author_profi...
2008/12/04
[ "https://Stackoverflow.com/questions/340717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39057/" ]
340,748
<p>I was writing some code, and I notice a pattern in the exception handling that got me thinking:</p> <pre><code>try{ // do stuff... throws JMS, Create and NamingException } catch (NamingException e) { log1(e); rollback(); doSomething(e) } catch (CreateException e) { log1(e); ...
[ { "answer_id": 340785, "author": "defnull", "author_id": 407880, "author_profile": "https://Stackoverflow.com/users/407880", "pm_score": 0, "selected": false, "text": "try {\n ...\n} catch ( Exception e) {\n if typeof(e) not in ('MyException', 'SpecialException') {\n throw e\n }\n ...
2008/12/04
[ "https://Stackoverflow.com/questions/340748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35323/" ]
340,787
<p>I have a XML with a structure similar to this:</p> <pre><code>&lt;category&gt; &lt;subCategoryList&gt; &lt;category&gt; &lt;/category&gt; &lt;category&gt; &lt;!--and so on --&gt; &lt;/category&gt; &lt;/subCategoryList&gt; &lt;/category&gt; </code></pre> <p>I have a Category ...
[ { "answer_id": 340831, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 2, "selected": false, "text": "//category/subCategoryList/category" }, { "answer_id": 340832, "author": "kgiannakakis", "author_id": 24054,...
2008/12/04
[ "https://Stackoverflow.com/questions/340787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314728/" ]
340,790
<p>I have the following problem: Multithreaded WPF application, Model View Presenter Implementation. Presenters and Views that belong together are created on a separate thread and get a separate Dispatcher. Now someone calls from another thread a method on the Presenter. I am intercepting the call, and now begins the p...
[ { "answer_id": 340968, "author": "jyoung", "author_id": 14841, "author_profile": "https://Stackoverflow.com/users/14841", "pm_score": 2, "selected": false, "text": "if( presenterDispatcherObject.CheckAccess() )\n Doit();\nelse\n presenterDispatcherObject.BeginInvoke( DispatcherPriorit...
2008/12/04
[ "https://Stackoverflow.com/questions/340790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
340,816
<p>How can I send keyboard input messages to either the currently selected window or the previously selected window? </p> <p>I have a program which I use to type some characters which are not present on my keyboard and I would like it if I could just send the input directly rather than me having to copy and paste all ...
[ { "answer_id": 340883, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 0, "selected": false, "text": "myField.Text += \"®\"; //This is a char that I do not have on my keyboard\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26566/" ]
340,827
<p>I am attempting to mock a call to an indexed property. I.e. I would like to moq the following:</p> <pre><code>object result = myDictionaryCollection["SomeKeyValue"]; </code></pre> <p>and also the setter value</p> <pre><code>myDictionaryCollection["SomeKeyValue"] = myNewValue; </code></pre> <p>I am doing this bec...
[ { "answer_id": 359123, "author": "Mike Scott", "author_id": 43649, "author_profile": "https://Stackoverflow.com/users/43649", "pm_score": 7, "selected": false, "text": "MyContainer[(string s)]" }, { "answer_id": 861282, "author": "wasker", "author_id": 21952, "author_...
2008/12/04
[ "https://Stackoverflow.com/questions/340827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31128/" ]
340,842
<p>This works:</p> <pre><code>constructor TMyObj.Create; begin inherited; end; </code></pre> <p>Why this is not working also?</p> <pre><code>function TMyObjEx.Import(CONST FileName: string; CONST x, y, z: Integer): string; begin result:= inherited; // Import(FileName, x, y, z); &lt;--- Compiler says: "incompatibl...
[ { "answer_id": 340893, "author": "Rob Kennedy", "author_id": 33732, "author_profile": "https://Stackoverflow.com/users/33732", "pm_score": 1, "selected": false, "text": "inherited" }, { "answer_id": 342063, "author": "Nick Hodges", "author_id": 2044, "author_profile":...
2008/12/04
[ "https://Stackoverflow.com/questions/340842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
340,850
<blockquote> <p><code>dict</code> methods <code>dict.keys()</code>, <code>dict.items()</code> and <code>dict.values()</code> return “views” instead of lists.</p> </blockquote> <p><a href="https://docs.python.org/3/whatsnew/3.0.html#views-and-iterators-instead-of-lists" rel="nofollow noreferrer">Source</a></p> <p>First ...
[ { "answer_id": 9023627, "author": "max", "author_id": 336527, "author_profile": "https://Stackoverflow.com/users/336527", "pm_score": 3, "selected": false, "text": "list" }, { "answer_id": 26553373, "author": "Antony Hatchkins", "author_id": 237105, "author_profile": ...
2008/12/04
[ "https://Stackoverflow.com/questions/340850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13009/" ]
340,878
<p>I'm having trouble setting up a scheduled task (now called Task Scheduler) under the actions tab to run on windows 2007 server. It also has exchange server 2007. </p> <p>I've tried setting </p> <p>Program/script : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Add arguments (optional): -psconsolefile ex...
[ { "answer_id": 33798161, "author": "uz-it", "author_id": 3382897, "author_profile": "https://Stackoverflow.com/users/3382897", "pm_score": 0, "selected": false, "text": "Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin\nAdd-PSSnapin Microsoft.Exchange.Management.PowerShell.Sup...
2008/12/04
[ "https://Stackoverflow.com/questions/340878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18853/" ]
340,888
<p>I've just done my first little webapp in django and I love it. I'm about to start on converting an old production PHP site into django and as part its template, there is a navigation bar.</p> <p>In PHP, I check each nav option's URL against the current URL, in the template code and apply a CSS class if they line up...
[ { "answer_id": 341713, "author": "Michael Warkentin", "author_id": 422277, "author_profile": "https://Stackoverflow.com/users/422277", "pm_score": 3, "selected": false, "text": "<body class=\"{{ nav_class }}\">\n" }, { "answer_id": 341748, "author": "jpwatts", "author_id"...
2008/12/04
[ "https://Stackoverflow.com/questions/340888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12870/" ]
340,911
<p>Are there any VS.NET plugins that will format a selection of code for printing or emailing and is also free?</p>
[ { "answer_id": 341079, "author": "Stein G. Strindhaug", "author_id": 26115, "author_profile": "https://Stackoverflow.com/users/26115", "pm_score": 0, "selected": false, "text": "monospaced" }, { "answer_id": 341576, "author": "configurator", "author_id": 9536, "author...
2008/12/04
[ "https://Stackoverflow.com/questions/340911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40106/" ]
340,915
<p>I have form that displays several keywords (standard set of choice lists that changes rarely). There are about 4 such fields and each have about 20 choices or so.</p> <p>I'm thinking if caching the keywords will be helpful for performance / best practice? Is there a strategy for determining when to cache?</p>
[ { "answer_id": 341125, "author": "user35559", "author_id": 35559, "author_profile": "https://Stackoverflow.com/users/35559", "pm_score": 0, "selected": false, "text": "\"IDictionary<string, IList<string>\"\n" }, { "answer_id": 341151, "author": "Shawn", "author_id": 26, ...
2008/12/04
[ "https://Stackoverflow.com/questions/340915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40070/" ]