qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
383,565 | <p>I'm using Python to <strong>infinitely</strong> iterate over a list, repeating each element in the list a number of times. For example given the list:</p>
<pre><code>l = [1, 2, 3, 4]
</code></pre>
<p>I would like to output each element two times and then repeat the cycle:</p>
<pre><code>1, 1, 2, 2, 3, 3, 4, 4, 1,... | [
{
"answer_id": 383573,
"author": "rob",
"author_id": 43927,
"author_profile": "https://Stackoverflow.com/users/43927",
"pm_score": 1,
"selected": false,
"text": "iterable = [1, 2, 3, 4]\nn = 2\n\nwhile (True):\n for elem in iterable:\n for dummy in range(n):\n print elem # or ca... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37522/"
] |
383,570 | <p>What is the easiest way in Java to map strings (Java <code>String</code>) to (positive) integers (Java <code>int</code>), so that</p>
<ul>
<li>equal strings map to equal integers, and</li>
<li>different strings map to different integers?</li>
</ul>
<p>So, similar to <code>hashCode()</code> but different strings ar... | [
{
"answer_id": 383582,
"author": "Avi",
"author_id": 1605,
"author_profile": "https://Stackoverflow.com/users/1605",
"pm_score": 2,
"selected": false,
"text": "String s = \"my string\";\nBigInteger bi = new BigInteger(s.getBytes());\n"
},
{
"answer_id": 384084,
"author": "Nor... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12547/"
] |
383,587 | <p>The built-in <code>Math.Pow()</code> function in .NET raises a <code>double</code> base to a <code>double</code> exponent and returns a <code>double</code> result.</p>
<p>What's the best way to do the same with integers?</p>
<p>Added: It seems that one can just cast <code>Math.Pow()</code> result to (int), but wil... | [
{
"answer_id": 383596,
"author": "Vilx-",
"author_id": 41360,
"author_profile": "https://Stackoverflow.com/users/41360",
"pm_score": 7,
"selected": true,
"text": "int IntPow(int x, uint pow)\n{\n int ret = 1;\n while ( pow != 0 )\n {\n if ( (pow & 1) == 1 )\n r... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33080/"
] |
383,595 | <p>I had a typo in my fstab and it boots to a commandline but is readonly, I know what the error is but i can't change it because it's mounted as readonly. I want to mount the filesystem and make the changes. I know I can boot a live distro and edit it that way, but i was wondering if there was an easier way to do it.<... | [
{
"answer_id": 383842,
"author": "MarkR",
"author_id": 13724,
"author_profile": "https://Stackoverflow.com/users/13724",
"pm_score": 5,
"selected": false,
"text": "mount / -o remount,rw\n"
},
{
"answer_id": 383885,
"author": "Johannes Schaub - litb",
"author_id": 34509,
... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
383,600 | <p>I have a Java web app that reads a MySql db and returns DateTime fields. What is the best way to convert the DateTime fields returned in the resultset into something more readable?</p>
<p>Currently the DateTime fields print as:</p>
<p>2008-12-14 16:30:00</p>
<p>but I would like something more user friendly like:... | [
{
"answer_id": 383612,
"author": "Zoredache",
"author_id": 20267,
"author_profile": "https://Stackoverflow.com/users/20267",
"pm_score": 2,
"selected": false,
"text": "mysql> select date_format(now(),'%d %b %Y at %H:%i') as formated_date;\n+----------------------+\n| formated_date ... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16684/"
] |
383,623 | <p>How do you apply 'or' to all values of a list in Python? I'm thinking something like:</p>
<pre><code>or([True, True, False])
</code></pre>
<p>or if it was possible:</p>
<pre><code>reduce(or, [True, True, False])
</code></pre>
| [
{
"answer_id": 383637,
"author": "Dustin",
"author_id": 39975,
"author_profile": "https://Stackoverflow.com/users/39975",
"pm_score": 2,
"selected": false,
"text": "reduce(lambda a,b: a or b, [True, True, False])\n"
},
{
"answer_id": 383638,
"author": "PEZ",
"author_id": ... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383623",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6068/"
] |
383,631 | <p>How do I use the <code>json_encode()</code> function with MySQL query results? Do I need to iterate through the rows or can I just apply it to the entire results object?</p>
| [
{
"answer_id": 383662,
"author": "Hugh Bothwell",
"author_id": 33258,
"author_profile": "https://Stackoverflow.com/users/33258",
"pm_score": 5,
"selected": false,
"text": "mysql_query()"
},
{
"answer_id": 383664,
"author": "Paolo Bergantino",
"author_id": 16417,
"auth... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12073/"
] |
383,633 | <p>I am working on a UNIX box, and trying to run an application, which gives some debug logs to the standard output. I have redirected this output to a log file, but now wish to get the lines where the error is being shown.</p>
<p>My problem here is that a simple</p>
<pre><code>cat output.log | grep FAIL
</code></pre... | [
{
"answer_id": 383640,
"author": "PEZ",
"author_id": 44639,
"author_profile": "https://Stackoverflow.com/users/44639",
"pm_score": 3,
"selected": false,
"text": "grep -C 3 FAIL output.log\n"
},
{
"answer_id": 383641,
"author": "jfs",
"author_id": 4279,
"author_profile... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383633",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35416/"
] |
383,634 | <p>Well I run a small video website and on the actual video page there is a strip of "related videos" similar to most video sides (e.g. YouTube) and currently all I'm doing is taking one of its tags randomly and finding other videos with the same tag. Not surprisingly this isn't a great method as some tags are very va... | [
{
"answer_id": 384185,
"author": "Bill Karwin",
"author_id": 20860,
"author_profile": "https://Stackoverflow.com/users/20860",
"pm_score": 3,
"selected": true,
"text": "SELECT v2.video_id\nFROM VideoTags AS v1\n JOIN VideoTags AS v2\n USING (tag_id)\nWHERE v1.video_id = ?\n AND v1.vid... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428190/"
] |
383,658 | <p>I am programming winforms using c# and vb.net.</p>
<p>I love the arrows used in coderush.</p>
<p>for those who have not seen coderush arrows ,please see this image.</p>
<p><a href="https://i.stack.imgur.com/6IVX6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6IVX6.jpg" alt="http://www.aspnetp... | [
{
"answer_id": 384185,
"author": "Bill Karwin",
"author_id": 20860,
"author_profile": "https://Stackoverflow.com/users/20860",
"pm_score": 3,
"selected": true,
"text": "SELECT v2.video_id\nFROM VideoTags AS v1\n JOIN VideoTags AS v2\n USING (tag_id)\nWHERE v1.video_id = ?\n AND v1.vid... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48027/"
] |
383,680 | <p>I've developed a web service in asp.net and am able to test it from an in-project aspx page and can readily display the information that was returned in JSON format.</p>
<p>I now need to consume the web service from a stand-alone html page.</p>
<p>Does someone have experience with this? I'm puzzled by the part th... | [
{
"answer_id": 383693,
"author": "BobbyShaftoe",
"author_id": 38426,
"author_profile": "https://Stackoverflow.com/users/38426",
"pm_score": 4,
"selected": true,
"text": " $.ajax({\n type: \"POST\",\n url: \"~/MyService.asmx/MyMethod\",\n data: \"{parameterName:'\" aStringArgume... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36902/"
] |
383,686 | <p>I've got a "diagnostics" page in my ASP.NET application which does things like verify the database connection(s), display the current appSettings and ConnectionStrings, etc. A section of this page displays the Assembly versions of important types used throughout, but I could not figure out how to effectively show t... | [
{
"answer_id": 383690,
"author": "Kent Boogaart",
"author_id": 5380,
"author_profile": "https://Stackoverflow.com/users/5380",
"pm_score": 8,
"selected": false,
"text": "AppDomain"
},
{
"answer_id": 26300241,
"author": "Contango",
"author_id": 107409,
"author_profile"... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13960/"
] |
383,689 | <p>I made a custom TObjectList descendant designed to hold subclasses of a base object class. It looks something like this:</p>
<pre><code>interface
TMyDataList<T: TBaseDatafile> = class(TObjectList<TBaseDatafile>)
public
constructor Create;
procedure upload(db: TDataSet);
end;
imple... | [
{
"answer_id": 383698,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 5,
"selected": true,
"text": "T"
},
{
"answer_id": 7301803,
"author": "Atle S",
"author_id": 843632,
"author_profile": "https://... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32914/"
] |
383,692 | <p>I've looked on Wikipedia and Googled it and read the official documentation, but I still haven't got to the point where I really understand what JSON is, and why I'd use it.</p>
<p>I have been building applications using PHP, MySQL and JavaScript / HTML for a while, and if JSON can do something to make my life easie... | [
{
"answer_id": 383699,
"author": "Andreas Grech",
"author_id": 44084,
"author_profile": "https://Stackoverflow.com/users/44084",
"pm_score": 10,
"selected": true,
"text": "{\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"address\": {\n \"streetAddress\": \"... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383692",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11522/"
] |
383,728 | <p>Well, I have this bit of code that is slowing down the program hugely because it is linear complexity but called a lot of times making the program quadratic complexity. If possible I would like to reduce its computational complexity but otherwise I'll just optimize it where I can. So far I have reduced down to:</p>
... | [
{
"answer_id": 383732,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 3,
"selected": false,
"text": "while"
},
{
"answer_id": 383736,
"author": "Adam Rosenfield",
"author_id": 9530,
"author_profile"... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
383,734 | <p>What do you recommend for displaying URLs and handling views in Rails for cities, regions, countries?</p>
<p>i.e:</p>
<p>/us/ca/San-Fransisco</p>
<p>/countries/us/regions/ca/cities/San-Fransisco</p>
<p>Should be able to:
List all countries, list all regions within country and list all cities within a region and ... | [
{
"answer_id": 383840,
"author": "Milan Novota",
"author_id": 26123,
"author_profile": "https://Stackoverflow.com/users/26123",
"pm_score": 3,
"selected": true,
"text": "GET /us/regions\n"
}
] | 2008/12/20 | [
"https://Stackoverflow.com/questions/383734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50718/"
] |
383,735 | <p>Are methods calls really so slow or is there something wrong in my computer?</p>
<pre><code>static void Main(string[] args) {
Stopwatch sw = new Stopwatch(); sw.Start();
for (int i = 0; i < 10000000; i++) {
double z = Math.Pow(i,2);
}
Console.WriteLine(sw.ElapsedMilliseconds);
sw = S... | [
{
"answer_id": 383741,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 3,
"selected": false,
"text": "c:\\Users\\Jon\\Test>csc /o+ /debug- Test.cs\nMicrosoft (R) Visual C# 2008 Compiler version 3.5.30729.1\nfor Microsoft (... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38561/"
] |
383,738 | <p>We're developing a Python web service and a client web site in parallel. When we make an HTTP request from the client to the service, one call consistently raises a socket.error in socket.py, in read:</p>
<pre>(104, 'Connection reset by peer')</pre>
<p>When I listen in with wireshark, the "good" and "bad" respons... | [
{
"answer_id": 383816,
"author": "S.Lott",
"author_id": 10661,
"author_profile": "https://Stackoverflow.com/users/10661",
"pm_score": 6,
"selected": true,
"text": "time.sleep(0.01)"
}
] | 2008/12/20 | [
"https://Stackoverflow.com/questions/383738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10612/"
] |
383,739 | <p>I am using the toggle() with jQuery and I have a sidebar on my page and each header is </p>
<pre><code><h2 class="sidebar-header">
</code></pre>
<p>One section of my code will look like:</p>
<pre><code> <div class="sidebar-section">
<h2 class="sidebar-header">SUBSCRIBE</h2>
... | [
{
"answer_id": 383750,
"author": "Andreas Grech",
"author_id": 44084,
"author_profile": "https://Stackoverflow.com/users/44084",
"pm_score": 1,
"selected": false,
"text": "<div class=\"topdiv\">\n <h2 class=\"header\">Header 1</h2>\n <div class=\"somecontent\">\n This is the... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
383,757 | <p>I'm looking for a compiler or interpreter for a language with basic math support and File IO which can be executed directly from a memorystick in either Linux or Windows. Built in functionality for basic datastructures and sorting/searching would be a plus.</p>
<p>(I've read about movable python, but it only suppor... | [
{
"answer_id": 383769,
"author": "Arnout",
"author_id": 3496,
"author_profile": "https://Stackoverflow.com/users/3496",
"pm_score": 1,
"selected": false,
"text": "perl.exe"
},
{
"answer_id": 384238,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile": "https:... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383757",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12677/"
] |
383,760 | <p>I am trying to make a search view in Django. It is a search form with freetext input + some options to select, so that you can filter on years and so on. This is some of the code I have in the view so far, the part that does the filtering. And I would like some input on how expensive this would be on the database se... | [
{
"answer_id": 383797,
"author": "Aaron",
"author_id": 7503,
"author_profile": "https://Stackoverflow.com/users/7503",
"pm_score": 2,
"selected": false,
"text": "soknad_list.query.as_sql()[0]\n"
}
] | 2008/12/20 | [
"https://Stackoverflow.com/questions/383760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42546/"
] |
383,765 | <p>How can I get a DataSet with all the data from a SQL Express server using C#?</p>
<p>Thanks</p>
<p>edit: To clarify, I do want all the data from every table. The reason for this, is that it is a relatively small database. Previously I'd been storing all three tables in an XML file using DataSet's abilities. Howeve... | [
{
"answer_id": 383794,
"author": "Eduardo Campañó",
"author_id": 12091,
"author_profile": "https://Stackoverflow.com/users/12091",
"pm_score": 3,
"selected": true,
"text": "DbProviderFactory factory = DbProviderFactories.GetFactory(\"System.Data.SqlClient\");\n\nDataTable tables = null;\... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12243/"
] |
383,777 | <p>I'm looking for a good, simple PHP function to get my latest Facebook status updates. Anyone know of one?</p>
<p>Thanks!</p>
<p><strong>EDIT:</strong> I've added a half-solution below.</p>
<p>Or if anyone knows a good way to read in the RSS feed and spit out the recent status update?</p>
| [
{
"answer_id": 383805,
"author": "jasonrm",
"author_id": 31341,
"author_profile": "https://Stackoverflow.com/users/31341",
"pm_score": 1,
"selected": false,
"text": "http://www.new.facebook.com/feeds/status.php?id=[idnumber]&viewer=[viewer]&key=[key]&format=rss20"
},
{
"answer_id... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/396/"
] |
383,780 | <p>I have a simple text field for "Phone Number" in a contact form on a client's website. The formmail script returns whatever the user types into the field. For example, they'll receive "000-000-0000", "0000000000", (000) 000-000, etc. The client would like to receive all phone numbers in this form: 000-000-0000. Can ... | [
{
"answer_id": 383796,
"author": "clawr",
"author_id": 46201,
"author_profile": "https://Stackoverflow.com/users/46201",
"pm_score": 0,
"selected": false,
"text": "function formatPhone($number)\n{\n $number = str_replace(array('(', ')', '-', ' '), '', $number);\n if (strlen($number) ==... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48047/"
] |
383,781 | <p>Is there any other place besides the metabase.xml file where the file upload size can be modified?</p>
<p>I am currently running a staging server with IIS6 and it is setup to allow uploading of files up to 20mb. This works perfectly fine. I have a new production server where I am trying to setup this same availab... | [
{
"answer_id": 383835,
"author": "netadictos",
"author_id": 31791,
"author_profile": "https://Stackoverflow.com/users/31791",
"pm_score": 5,
"selected": false,
"text": "<system.web>\n <httpRuntime executionTimeout=\"240\" maxRequestLength=\"20480\" />\n</system.web>\n"
},
{
"ans... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21664/"
] |
383,783 | <p>I'm currently wrestling with an Oracle SQL DATE conversion problem using iBATIS from Java.</p>
<p>Am using the Oracle JDBC thin driver ojdbc14 version 10.2.0.4.0. iBATIS version 2.3.2. Java 1.6.0_10-rc2-b32.</p>
<p>The problem revolves around a column of DATE type that is being returned by this snippet of SQL:</p>... | [
{
"answer_id": 383897,
"author": "ninesided",
"author_id": 1030,
"author_profile": "https://Stackoverflow.com/users/1030",
"pm_score": 0,
"selected": false,
"text": "java.sql.Date"
},
{
"answer_id": 384056,
"author": "RogerV",
"author_id": 48048,
"author_profile": "ht... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383783",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48048/"
] |
383,801 | <p>I believe i have set up Pg properly, but my script doesn't seem to be connecting to the database. I am testing with:</p>
<pre>
$database="networkem";
$user="postgres";
$password="";
$host="localhost";
$dbh = DBI->connect("DBI:Pg:dbname=$dbname;host=$host", $user, $password);
</pre>
<p>My pg_hba reads:</p>
<pre>
... | [
{
"answer_id": 383877,
"author": "Schwern",
"author_id": 14660,
"author_profile": "https://Stackoverflow.com/users/14660",
"pm_score": 4,
"selected": false,
"text": "DBI->errstr"
},
{
"answer_id": 430658,
"author": "Dave Pirotte",
"author_id": 53600,
"author_profile":... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
383,813 | <p>In a Forms application I'm displaying log output from a long running command-line application that generated a lot of output. I start the program in the background, and capture its output and currently display it in a TextBox using AppendText. I prefer to only display for example the last 1000 lines. Removing lines ... | [
{
"answer_id": 384399,
"author": "Serge van den Oever",
"author_id": 48050,
"author_profile": "https://Stackoverflow.com/users/48050",
"pm_score": 4,
"selected": false,
"text": " delegate void UpdateCCNetWindowDelegate(String msg);\n\n private void Message2CCNetOutput(String messa... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383813",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48050/"
] |
383,831 | <p>I've got a mySql stored procedure that looks like this--</p>
<pre><code>delimiter |
create procedure GetEmployeeById(in ID varchar(45))
begin
select id,
firstName,
lastName,
phone,
address1,
address2,
city,
state,
zip,
username,
password,
emptypeid... | [
{
"answer_id": 383868,
"author": "Rob Kennedy",
"author_id": 33732,
"author_profile": "https://Stackoverflow.com/users/33732",
"pm_score": 2,
"selected": false,
"text": "id"
}
] | 2008/12/20 | [
"https://Stackoverflow.com/questions/383831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94958/"
] |
383,833 | <p>Suppose I'm implementing a queue in java and I have a reference to the initial node, called ini and another to the last one, called last. Now, I start inserting objects into the queue. At one point, I decide I want an operation to clear the queue. Then I do this:</p>
<pre><code>ini = null;
last = null;
</code></pre... | [
{
"answer_id": 383836,
"author": "sk.",
"author_id": 16399,
"author_profile": "https://Stackoverflow.com/users/16399",
"pm_score": 4,
"selected": false,
"text": "public class Stack {\n private final Object[] stack = new Object[10];\n private int top = 0;\n public void push(Object obj)... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
383,848 | <p>I'm looking for some open source F# projects to learn from.
Something not snippets but full projects that are good representatives of F# features (i.e. pattern matching, discriminated unions, etc).</p>
<p>My objective are mainly to see how all the features fit together, how the project is organized and how the pro... | [
{
"answer_id": 6272738,
"author": "Stephen Swensen",
"author_id": 236255,
"author_profile": "https://Stackoverflow.com/users/236255",
"pm_score": 2,
"selected": false,
"text": "async"
}
] | 2008/12/20 | [
"https://Stackoverflow.com/questions/383848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21239/"
] |
383,850 | <p>Is there a convention for naming the private method that I have called "<code>_Add</code>" here? I am not a fan of the leading underscore but it is what one of my teammates suggests.</p>
<pre><code>public Vector Add(Vector vector) {
// check vector for null, and compare Length to vector.Length
return _Add(v... | [
{
"answer_id": 383851,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 5,
"selected": false,
"text": "*Impl"
},
{
"answer_id": 383854,
"author": "Greg Dean",
"author_id": 1200558,
"author_profile": "... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45914/"
] |
383,857 | <p>I'm having trouble trying to set the value of a property after i cast it. I'm not sure if this is called <em>boxing</em>.</p>
<p>Anyways, the new variable is getting set, but the original is not. I thought the new variable is just a <em>reference</em> to the original. But when i check the intellisence/debug watcher... | [
{
"answer_id": 383863,
"author": "Rob Kennedy",
"author_id": 33732,
"author_profile": "https://Stackoverflow.com/users/33732",
"pm_score": 0,
"selected": false,
"text": "TagList"
},
{
"answer_id": 383864,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile":... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30674/"
] |
383,888 | <p>Suppose I have this:</p>
<pre><code>class test<T>
{
private T[] elements;
private int size;
public test(int size)
{
this.size = size;
elements = new T[this.size];
}
}
</code></pre>
<p>It seems this isn't possible because the compiler doesn't know what constructor to call o... | [
{
"answer_id": 383892,
"author": "mat",
"author_id": 42083,
"author_profile": "https://Stackoverflow.com/users/42083",
"pm_score": 0,
"selected": false,
"text": "private T[] elements;\n"
},
{
"answer_id": 383895,
"author": "Johannes Schaub - litb",
"author_id": 34509,
... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
383,898 | <p>This is something I've pondered over for a while, as I've seen both used in practise.</p>
<h2>Method 1</h2>
<pre><code><ol>
<li>List item 1</li>
<li>List item 2
<ol>
<li>List item 3</li>
</ol>
</li>
<li>List item ... | [
{
"answer_id": 383915,
"author": "Rob Kennedy",
"author_id": 33732,
"author_profile": "https://Stackoverflow.com/users/33732",
"pm_score": 5,
"selected": true,
"text": "OL"
},
{
"answer_id": 383922,
"author": "Mark Brackett",
"author_id": 2199,
"author_profile": "http... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383898",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2025/"
] |
383,899 | <p>this question is an extension to a <a href="https://stackoverflow.com/questions/383857/why-is-this-property-not-getting-set" title="My previous question about reference and property setting">previous question i asked</a> (and was answered). I'm refactoring my code an playing around with / experimenting with various ... | [
{
"answer_id": 383905,
"author": "Tim Merrifield",
"author_id": 36706,
"author_profile": "https://Stackoverflow.com/users/36706",
"pm_score": 5,
"selected": true,
"text": "ITagElement someData = data as ITagElement\nif (someData != null)\n{\n if (someData.TagList.IsNullOrEmpty())\n ... | 2008/12/20 | [
"https://Stackoverflow.com/questions/383899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30674/"
] |
383,912 | <p>I'd like to know if there's an easier way to batch insert a set of records if they don't already exist in a table. For example I have a Tags table in the database having ID, Name columns - given a list of tag names I want to add only those that are not already present. Here's what I came up with:</p>
<pre><code>pri... | [
{
"answer_id": 383905,
"author": "Tim Merrifield",
"author_id": 36706,
"author_profile": "https://Stackoverflow.com/users/36706",
"pm_score": 5,
"selected": true,
"text": "ITagElement someData = data as ITagElement\nif (someData != null)\n{\n if (someData.TagList.IsNullOrEmpty())\n ... | 2008/12/21 | [
"https://Stackoverflow.com/questions/383912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48065/"
] |
383,918 | <p><strong>Question:</strong> For typed in commands invoked via M-x I am having difficulty understanding how Emacs allows recalling and rerunning the commands. The command-history works quite differently from Vim. It puts the commands in a buffer rather than the "minibuffer".</p>
<p>Is there a way to get something sim... | [
{
"answer_id": 383924,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"author_profile": "https://Stackoverflow.com/users/34509",
"pm_score": 1,
"selected": false,
"text": "customize-group minibuffer\n"
},
{
"answer_id": 383935,
"author": "Charlie Martin",
"author... | 2008/12/21 | [
"https://Stackoverflow.com/questions/383918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42223/"
] |
383,921 | <p>I have the types <code>Rock</code>, <code>Paper</code>, and <code>Scissors</code>. These are components, or "hands" of the Rock, Paper, Scissors game. Given two players' hands the game must decide who wins. How do I solve the problem of storing this chain chart</p>
<p><img src="https://upload.wikimedia.org/wikip... | [
{
"answer_id": 383926,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 3,
"selected": true,
"text": "public enum RPSEnum { Rock, Paper, Scissors }\n\nprivate RPSEnum FirtRPS = RPSEnum.Rock;\nprivate RPSEnum LastRPS = RPSE... | 2008/12/21 | [
"https://Stackoverflow.com/questions/383921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/456/"
] |
383,927 | <p>Apache is spitting out a HTTP response of code: 400 "Bad Request" with no details whenever I access a page driven that is handled by a FastCGI script.</p>
<ul>
<li>I've installed the mod_fcgid module and it's loaded and configured in the Apache config files</li>
<li>I've tested several FastCGI scripts, all of them ... | [
{
"answer_id": 383926,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 3,
"selected": true,
"text": "public enum RPSEnum { Rock, Paper, Scissors }\n\nprivate RPSEnum FirtRPS = RPSEnum.Rock;\nprivate RPSEnum LastRPS = RPSE... | 2008/12/21 | [
"https://Stackoverflow.com/questions/383927",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13216/"
] |
383,944 | <p>When debugging in PHP, I frequently find it useful to simply stick a <a href="http://php.net/var-dump" rel="noreferrer">var_dump()</a> in my code to show me what a variable is, what its value is, and the same for anything that it contains.</p>
<p>What is a good Python equivalent for this?</p>
| [
{
"answer_id": 383951,
"author": "Oli",
"author_id": 12870,
"author_profile": "https://Stackoverflow.com/users/12870",
"pm_score": 2,
"selected": false,
"text": "print"
},
{
"answer_id": 383953,
"author": "Martin v. Löwis",
"author_id": 33006,
"author_profile": "https... | 2008/12/21 | [
"https://Stackoverflow.com/questions/383944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20267/"
] |
383,947 | <p>I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this? </p>
<p>I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly. </p>
<p>Is it just so if you were to do:</p>
<pre><code>IInterface classRef = ... | [
{
"answer_id": 383952,
"author": "Lasse V. Karlsen",
"author_id": 267,
"author_profile": "https://Stackoverflow.com/users/267",
"pm_score": 5,
"selected": false,
"text": "IInterface classRef = new ObjectWhatever();\n"
},
{
"answer_id": 383954,
"author": "kdgregory",
"auth... | 2008/12/21 | [
"https://Stackoverflow.com/questions/383947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35454/"
] |
383,966 | <p>More specifically, I'm trying to check if given string (a sentence) is in Turkish. </p>
<p>I can check if the string has Turkish characters such as Ç, Ş, Ü, Ö, Ğ etc. However that's not very reliable as those might be converted to C, S, U, O, G before I receive the string.</p>
<p>Another method is to have the 100 ... | [
{
"answer_id": 383988,
"author": "Daniel Naab",
"author_id": 32638,
"author_profile": "https://Stackoverflow.com/users/32638",
"pm_score": 5,
"selected": true,
"text": "from reverend.thomas import Bayes\nguesser = Bayes()\nguesser.train('french', 'le la les du un une je il elle de en')\n... | 2008/12/21 | [
"https://Stackoverflow.com/questions/383966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
383,973 | <p>This is a fundamental question, but an important one none the less...</p>
<p><strong>When starting a C++ program whose main method has the following common signature:</strong></p>
<pre><code>int main(int argc, char* args[]) {
//Magic!
return 0;
}
</code></pre>
<p><strong>is args[0] always guaranteed to be... | [
{
"answer_id": 383976,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"author_profile": "https://Stackoverflow.com/users/34509",
"pm_score": 6,
"selected": true,
"text": "exec"
},
{
"answer_id": 383986,
"author": "Michael Burr",
"author_id": 12711,
"author_pr... | 2008/12/21 | [
"https://Stackoverflow.com/questions/383973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3552/"
] |
383,977 | <p>I've queued up over 10,000 files to be uploaded to a UNIX based FTP server using a freeware (Windows based) FTP client which as far as i can see has finished without error.</p>
<p>Now, when i view the remote directory (using the Windows software) the output is truncated to 10,000 filenames. This ever occurs when i ... | [
{
"answer_id": 384055,
"author": "Norman Ramsey",
"author_id": 41661,
"author_profile": "https://Stackoverflow.com/users/41661",
"pm_score": 2,
"selected": false,
"text": "ftp://hostname/pub/..."
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/383977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13227/"
] |
383,978 | <p>Here's a small test program I wrote:</p>
<pre><code>#import <Foundation/Foundation.h>
int main(int argc, char **argv) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *arr = [NSArray array];
printf("Arr isMemberOfClass NSArray: %d\n", [arr isMemberOfClass:[NSArray class]])... | [
{
"answer_id": 384013,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 2,
"selected": false,
"text": "isMemberOfClass: [NSArray class]"
},
{
"answer_id": 384044,
"author": "Peter Hosey",
"author_id": 30461,
"... | 2008/12/21 | [
"https://Stackoverflow.com/questions/383978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40882/"
] |
384,004 | <p>I am using LINQ to EF and have the following LINQ query:</p>
<pre><code>var results = (from x in ctx.Items
group x by x.Year into decades
orderby decades.Count() descending
select new { Decade = decades.Key, DecadeCount = decades.Count() });
</code></pre>
<p>So this kin... | [
{
"answer_id": 384012,
"author": "Lucas",
"author_id": 24231,
"author_profile": "https://Stackoverflow.com/users/24231",
"pm_score": 3,
"selected": false,
"text": "var results = (from x in ctx.Items\n group x by (x.Year / 10 * 10) into decades\n orderby decade... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25719/"
] |
384,016 | <p>I've never worked on a professional project with a team, as I'm still in high school. As a consequence, I've never been exposed to this whole "versioning" and "source control" thing. Are they the same? How exactly does a program that manages code manage code? I've heard you have to check out code (copy the existing ... | [
{
"answer_id": 384165,
"author": "dbr",
"author_id": 745,
"author_profile": "https://Stackoverflow.com/users/745",
"pm_score": 3,
"selected": false,
"text": "svn commit somefile"
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/384016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27677/"
] |
384,036 | <p>I want to set up a continuous integration and test framework for my open source C++ project. The desired features are:</p>
<pre><code>1. check out the source code
2. run all the unit and other tests
3. run performance tests (these measure the software quality - for example how long does it take the system to comple... | [
{
"answer_id": 384065,
"author": "wilhelmtell",
"author_id": 456,
"author_profile": "https://Stackoverflow.com/users/456",
"pm_score": 2,
"selected": false,
"text": "time"
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/384036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19501/"
] |
384,042 | <p>Is there a built in way to limit the depth of a System.Collection.Generics.Stack? So that if you are at max capacity, pushing a new element would remove the bottom of the stack?</p>
<p>I know I can do it by converting to an array and rebuilding the stack, but I figured there's probably a method on it already.</p>
... | [
{
"answer_id": 384047,
"author": "Ryan Lundy",
"author_id": 5486,
"author_profile": "https://Stackoverflow.com/users/5486",
"pm_score": 2,
"selected": false,
"text": "Stack<T>"
},
{
"answer_id": 384097,
"author": "Greg Dean",
"author_id": 1200558,
"author_profile": "h... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1965/"
] |
384,053 | <p>Should be super simple for you guys...div one gets clicked, div two appears. What I don't know how to do is make div 2 go away when div one is clicked again.</p>
<pre><code><img src="/..." width="" height"" onClick="MM_showHideLayers('logo','','show','logoEasterEgg','',show')">
</code></pre>
<p>What should I... | [
{
"answer_id": 384057,
"author": "Andrew Hare",
"author_id": 34211,
"author_profile": "https://Stackoverflow.com/users/34211",
"pm_score": 0,
"selected": false,
"text": "MM_showHideLayers"
},
{
"answer_id": 384120,
"author": "Jeremy Bade",
"author_id": 13284,
"author_... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39781/"
] |
384,076 | <p>Some time ago, I saw a Mono application with colored output, presumably because of its log system (because all the messages were standardized). </p>
<p>Now, Python has the <code>logging</code> module, which lets you specify a lot of options to customize output. So, I'm imagining something similar would be possible ... | [
{
"answer_id": 384125,
"author": "airmind",
"author_id": 48087,
"author_profile": "https://Stackoverflow.com/users/48087",
"pm_score": 8,
"selected": false,
"text": "BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)\n\n#The background is set with 40 plus the number of the ... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384076",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48087/"
] |
384,078 | <p>When I have tables in my database that have PK/FK relationships (int) and when they are modeled by the Entity Framework designer everything seems as it should be. I can write the code below and everything seems like it's going to work fine as well but then when I run the code I get an error on the project.Status.St... | [
{
"answer_id": 384100,
"author": "bendewey",
"author_id": 37881,
"author_profile": "https://Stackoverflow.com/users/37881",
"pm_score": 4,
"selected": true,
"text": "Dim db As New MyDbModel.MyDbEntities() \nDim project As MyDbModel.Project = (From p In db.Project.Include(\"Status\") W... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/47167/"
] |
384,089 | <p>I am try to use stringWithFormat to set a numerical value on the text property of a label but the following code is not working. I cannot cast the int to NSString. I was expecting that the method would know how to automatically convert an int to NSString.</p>
<p>What do I need to do here?</p>
<pre><code>- (IBActio... | [
{
"answer_id": 384090,
"author": "BobbyShaftoe",
"author_id": 38426,
"author_profile": "https://Stackoverflow.com/users/38426",
"pm_score": 8,
"selected": true,
"text": "label.text = [NSString stringWithFormat:@\"%d\", count];\n"
},
{
"answer_id": 384094,
"author": "Zach Lang... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10366/"
] |
384,101 | <p>Is there a way to use the formatter that comes with eclipse, outside of eclipse? I would like to format some java files using my formatter.xml file that I have configured using eclipse. Does anyone have any code examples that would allow me to do this? I would also like to use this standalone, so the specific jar... | [
{
"answer_id": 51595344,
"author": "Brad Parks",
"author_id": 26510,
"author_profile": "https://Stackoverflow.com/users/26510",
"pm_score": 2,
"selected": false,
"text": "eclipse -vm <path to virtual machine> -application org.eclipse.jdt.core.JavaCodeFormatter [ OPTIONS ] <files>\n"
}
... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384101",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17712/"
] |
384,108 | <p>I read through a bunch of questions asking about simple source code control tools and Git seemed like a reasonable choice. I have it up and running, and it works well so far. One aspect that I like about CVS is the automatic incrementation of a version number.</p>
<p>I understand that this makes less sense in a dis... | [
{
"answer_id": 384177,
"author": "Otto",
"author_id": 9594,
"author_profile": "https://Stackoverflow.com/users/9594",
"pm_score": 2,
"selected": false,
"text": "master"
},
{
"answer_id": 384194,
"author": "skiphoppy",
"author_id": 18103,
"author_profile": "https://Sta... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45978/"
] |
384,110 | <p>I cannot get std::tr1::shared_ptr for my WinMobile project since the STL for WinCE is maintained by a different team at Microsoft :( aarrgh...</p>
<p>Anyone worked with another thread-safe, reference counting smart pointers? I'm actually using yasper which seems to be good. </p>
<p>Thank you very much.</p>
| [
{
"answer_id": 384118,
"author": "Hernán",
"author_id": 48026,
"author_profile": "https://Stackoverflow.com/users/48026",
"pm_score": 0,
"selected": false,
"text": " //preferred \nptr<SomeClass> p1(new SomeClass);\n\n //less safe \nptr<SomeClass> p2 = new SomeClass; \n"
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/384110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48026/"
] |
384,119 | <p>If I've queued up some email to be sent via the System.Net.Mail.SMTPClent, where can I find this mail? With the Windows SMTP Client, it's in the C:\inetpub\mailroot folder - is there a similar folder for the .NET client?</p>
<p>EDIT: Here's an example. If I turn off the outgoing SMTP server on my XP computer and th... | [
{
"answer_id": 494496,
"author": "labilbe",
"author_id": 1195872,
"author_profile": "https://Stackoverflow.com/users/1195872",
"pm_score": 1,
"selected": false,
"text": " <mailSettings>\n <!--\n <smtp\n deliveryMethod = \"Network\" [Network | Speci... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8114/"
] |
384,121 | <p>How would one go about loading compiled C code at run time, and then calling functions within it? Not like simply calling exec().</p>
<p>EDIT: The the program loading the module is in C.</p>
| [
{
"answer_id": 384132,
"author": "Robert Gamble",
"author_id": 25222,
"author_profile": "https://Stackoverflow.com/users/25222",
"pm_score": 6,
"selected": true,
"text": "dlopen"
},
{
"answer_id": 384337,
"author": "bortzmeyer",
"author_id": 15625,
"author_profile": "... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46431/"
] |
384,145 | <p>I have a page structure similar to this:</p>
<pre><code><body>
<div id="parent">
<div id="childRightCol">
/*Content*/
</div>
<div id="childLeftCol">
/*Content*/
</div>
</div>
</body>
</code></pre>
<p>I would like for the parent <code>d... | [
{
"answer_id": 384149,
"author": "bendewey",
"author_id": 37881,
"author_profile": "https://Stackoverflow.com/users/37881",
"pm_score": 5,
"selected": false,
"text": "clear:both"
},
{
"answer_id": 384195,
"author": "Tim Knight",
"author_id": 43043,
"author_profile": "... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10589/"
] |
384,157 | <p>I am working on a script to send data to a mysql table and I have it all working properly but the success part of the call, it is not loading my results in to my results column on my page. My code is below.</p>
<p>Any suggestions on what I can do to fix that? I am guessing the problem is within my "success:" option... | [
{
"answer_id": 384167,
"author": "bendewey",
"author_id": 37881,
"author_profile": "https://Stackoverflow.com/users/37881",
"pm_score": 0,
"selected": false,
"text": "$.ajax({\n type: \"POST\",\n url: \"ajax.php\",\n da... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
384,184 | <p>I'm trying to setup the MVC development enviroment on my laptop. I'm running WinXP Pro with IIS 5.1</p>
<p>I got the environment setup with the sample MVC application that come with beta. I can only get to the home page. when i try to open About us page. i run into the page can not be found error. Is it the routing... | [
{
"answer_id": 384188,
"author": "FlySwat",
"author_id": 1965,
"author_profile": "https://Stackoverflow.com/users/1965",
"pm_score": 1,
"selected": false,
"text": " routes.Add(new Route(\"{controller}.mvc.aspx/{action}\", \n new MvcRouteHandler()) \n { Defaults = new RouteVal... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28647/"
] |
384,189 | <p>I'd like to swap out an sql:query for some Java code that builds a complex query with several parameters. The current sql is a simple select.</p>
<pre>
<sql:query
var="result"
dataSource="${dSource}"
sql="select * from TABLE ">
</sql:query>
</pre>
<p>How do I take my Java ResultSet (ie. rs = stmt.e... | [
{
"answer_id": 384719,
"author": "krosenvold",
"author_id": 23691,
"author_profile": "https://Stackoverflow.com/users/23691",
"pm_score": 0,
"selected": false,
"text": "ResultSet getResult()\n"
},
{
"answer_id": 2428468,
"author": "BalusC",
"author_id": 157882,
"autho... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
384,200 | <p>Forgive me, for I am fairly new to C++, but I am having some trouble regarding operator ambiguity. I think it is compiler-specific, for the code compiled on my desktop. However, it fails to compile on my laptop. I think I know what's going wrong, but I don't see an elegant way around it. Please let me know if I am m... | [
{
"answer_id": 384211,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"author_profile": "https://Stackoverflow.com/users/34509",
"pm_score": 4,
"selected": true,
"text": "begin"
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/384200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48096/"
] |
384,220 | <p>I have a crazy navigation menu that I have to code. It's kind of tough. Please see the screenshot of the design here:</p>
<p><a href="https://i.stack.imgur.com/l3U7W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l3U7W.png" alt="nav menu"></a>
</p>
<p><a href="http://i41.tinypic.com/307xfo9.png... | [
{
"answer_id": 384241,
"author": "Jonathan Lonowski",
"author_id": 15031,
"author_profile": "https://Stackoverflow.com/users/15031",
"pm_score": 2,
"selected": false,
"text": "background: transparent;\nbackground: inherit;\n"
},
{
"answer_id": 386592,
"author": "Nathan Long",... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
384,228 | <p>I'm having some trouble updating a row in a MySQL database. Here is the code I'm trying to run:</p>
<pre><code>import MySQLdb
conn=MySQLdb.connect(host="localhost", user="root", passwd="pass", db="dbname")
cursor=conn.cursor()
cursor.execute("UPDATE compinfo SET Co_num=4 WHERE ID=100")
cursor.execute("SELECT Co_n... | [
{
"answer_id": 384240,
"author": "Zoredache",
"author_id": 20267,
"author_profile": "https://Stackoverflow.com/users/20267",
"pm_score": 7,
"selected": true,
"text": "conn.commit()"
},
{
"answer_id": 384452,
"author": "ʞɔıu",
"author_id": 41613,
"author_profile": "htt... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38/"
] |
384,247 | <p>Whenever we make changes to the CSS, it generally takes 24 hours to reflect those changes on my site. I have tried clearing the server cache and browser cache but it doesn't help too. Is there any other way to make the CSS changes reflect immediately after updation?</p>
<p>it happens in all the browsers... when i c... | [
{
"answer_id": 384275,
"author": "Ian G",
"author_id": 31765,
"author_profile": "https://Stackoverflow.com/users/31765",
"pm_score": -1,
"selected": false,
"text": "<style type=\"text/css\">\n/* your css */\n</style>\n"
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/384247",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29515/"
] |
384,262 | <pre><code>var insInvoice = new NpgsqlCommand(
@"INSERT INTO invoice_detail(
invoice_id,
invoice_detail_id,
product_id,
qty,
price,
amount)
VALUES (
:_invoice_id,
:_invoice_detail_id,
:_product_id,
:_qty,
:_price,
:_qty * :_price)", c);
with(var p = insInvoice.P... | [
{
"answer_id": 384274,
"author": "yfeldblum",
"author_id": 12349,
"author_profile": "https://Stackoverflow.com/users/12349",
"pm_score": 0,
"selected": false,
"text": "var insInvoice = new NpgsqlCommand(...);\ninsInvoice.Parameters.With(p => {\n p.Add(\"_invoice_id\", NpgsqlDbType.Uui... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384262",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11432/"
] |
384,264 | <p>I want to implement something exactly like "<a href="http://msdn.microsoft.com/en-us/library/aa905322.aspx" rel="nofollow noreferrer">Changing the Default Text in the Search Box</a>" for a WPF search TextBox. The box should show some greyed out "Search.." text when it's empty, and then it should function normally wh... | [
{
"answer_id": 384330,
"author": "Kent Boogaart",
"author_id": 5380,
"author_profile": "https://Stackoverflow.com/users/5380",
"pm_score": 1,
"selected": false,
"text": "TextBox"
},
{
"answer_id": 5707666,
"author": "Carl L",
"author_id": 714008,
"author_profile": "ht... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384264",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/47605/"
] |
384,284 | <p>Is there a way to rename an open file in Emacs? While I'm viewing it? Something like save-as, but the original one should go away.</p>
| [
{
"answer_id": 384612,
"author": "Chris Conway",
"author_id": 1412,
"author_profile": "https://Stackoverflow.com/users/1412",
"pm_score": 9,
"selected": false,
"text": "dired"
},
{
"answer_id": 1834038,
"author": "Shawn Hoover",
"author_id": 223029,
"author_profile": ... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6068/"
] |
384,286 | <p>I'm trying to get:</p>
<pre><code>document.createElement('div') //=> true
{tagName: 'foobar something'} //=> false
</code></pre>
<p>In my own scripts, I used to just use this since I never needed <code>tagName</code> as a property:</p>
<pre><code>if (!object.tagName) throw ...;
</code></pre>
<p>So for th... | [
{
"answer_id": 384301,
"author": "finpingvin",
"author_id": 46054,
"author_profile": "https://Stackoverflow.com/users/46054",
"pm_score": 3,
"selected": false,
"text": "if (obj.nodeName){\n switch (obj.nodeType){\n case 1: return 'element';\n case 3: return (/\\S/).test(obj.node... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384286",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15031/"
] |
384,294 | <p>While disassembling the .Net Source Code using Reflector, I came upon the Equals implementation in the Object Class and it refers to </p>
<pre><code>bool InternalEquals(object objA, object objB);
</code></pre>
<p>Which again refers to </p>
<pre><code>internal static extern bool InternalEquals(object objA, object ... | [
{
"answer_id": 384296,
"author": "mmx",
"author_id": 33708,
"author_profile": "https://Stackoverflow.com/users/33708",
"pm_score": 4,
"selected": false,
"text": "[MethodImpl(MethodImplOptions.InternalCall)]"
},
{
"answer_id": 5227504,
"author": "Viacheslav Ivanov",
"autho... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45972/"
] |
384,304 | <p>How can I create a local user account using .NET 2.0 and c# and also be able to set the "Password never expires" to never. </p>
<p>I have tried using "Net.exe" using Process.Start and passing its parameters but it seems that the "net user" is unable to set the "Password never expires" to never.</p>
| [
{
"answer_id": 384307,
"author": "splattne",
"author_id": 6461,
"author_profile": "https://Stackoverflow.com/users/6461",
"pm_score": 6,
"selected": true,
"text": "DirectoryEntry localMachine = new DirectoryEntry(\"WinNT://\" + \n Environment.MachineName);\nDirectoryEntry newUser = lo... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34623/"
] |
384,306 | <p>I am upgrading an unmanaged C++ application to use the XP/Vista style common controls by adding a manifest. According to MSDN's page on <a href="http://msdn.microsoft.com/en-us/library/aa374191.aspx" rel="nofollow noreferrer">application manifests</a>, you are required to specify the name and version in the manifes... | [
{
"answer_id": 384307,
"author": "splattne",
"author_id": 6461,
"author_profile": "https://Stackoverflow.com/users/6461",
"pm_score": 6,
"selected": true,
"text": "DirectoryEntry localMachine = new DirectoryEntry(\"WinNT://\" + \n Environment.MachineName);\nDirectoryEntry newUser = lo... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25637/"
] |
384,310 | <p>On a site with a high number of users, should paging be handled in code, or with a stored procedure. If you have employed caching, please include your success factors.</p>
| [
{
"answer_id": 384347,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 1,
"selected": false,
"text": "Skip()"
},
{
"answer_id": 384388,
"author": "netadictos",
"author_id": 31791,
"author_profile": "... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19799/"
] |
384,318 | <p>In any class, how do I explicitly refer to a certain method of my class?</p>
<p>For example, this code works:</p>
<pre><code>class Test : IEnumerable<T> {
public IEnumerator<T> GetEnumerator() { return null; }
IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }
}
</code></pre>
... | [
{
"answer_id": 384334,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 1,
"selected": false,
"text": " IEnumerator<T> IEnumerable<T>.GetEnumerator() { return null; } // TODO\n IEnumerator IEnumerable.GetEnumerator... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41283/"
] |
384,332 | <p>I manage Unix systems where, sometimes, programs like CGI scripts run forever, sometimes eating a lot of CPU time and wasting resources. </p>
<p>I want a program (typically invoked from cron) which can kill these runaways, based on the following criteria (combined with AND and OR):</p>
<ul>
<li>Name (given by a re... | [
{
"answer_id": 384369,
"author": "Alex B",
"author_id": 23643,
"author_profile": "https://Stackoverflow.com/users/23643",
"pm_score": 2,
"selected": false,
"text": "/etc/security/limits.conf"
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/384332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15625/"
] |
384,336 | <p>I'm trying to pass information to a python page via the url. I have the following link text:</p>
<pre><code>"<a href='complete?id=%s'>" % (str(r[0]))
</code></pre>
<p>on the complete page, I have this:</p>
<pre><code>import cgi
def complete():
form = cgi.FieldStorage()
db = MySQLdb.connect(user="", ... | [
{
"answer_id": 384355,
"author": "gimel",
"author_id": 6491,
"author_profile": "https://Stackoverflow.com/users/6491",
"pm_score": 1,
"selected": false,
"text": "form[\"id\"]"
},
{
"answer_id": 384359,
"author": "Steen",
"author_id": 1448983,
"author_profile": "https:... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384336",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2128/"
] |
384,350 | <p>It doesn't remove everything inside the 2nd form tag but just hides the and tags from the page</p>
<p>Any ideas and workaround?</p>
| [
{
"answer_id": 384361,
"author": "Andreas Grech",
"author_id": 44084,
"author_profile": "https://Stackoverflow.com/users/44084",
"pm_score": 0,
"selected": false,
"text": "myTextbox.Text = 'Hello';"
},
{
"answer_id": 67840958,
"author": "Colin",
"author_id": 3304104,
... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48118/"
] |
384,373 | <p>IS there any way i can do that?</p>
| [
{
"answer_id": 384381,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "do shell script"
},
{
"answer_id": 389585,
"author": "Jörg W Mittag",
"author_id": 2988,
"author_profile":... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
384,391 | <p>I have a worker thread that is listening to a TCP socket for incoming traffic, and buffering the received data for the main thread to access (let's call this socket <em>A</em>). However, the worker thread also has to do some regular operations (say, once per second), even if there is no data coming in. Therefore, I ... | [
{
"answer_id": 384397,
"author": "Alex B",
"author_id": 23643,
"author_profile": "https://Stackoverflow.com/users/23643",
"pm_score": 6,
"selected": true,
"text": "select()"
},
{
"answer_id": 70470737,
"author": "Bruce Lu",
"author_id": 17753998,
"author_profile": "ht... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19254/"
] |
384,392 | <p>still trying to find where i would use the "yield" keyword in a real situation.</p>
<p>I see this thread on the subject </p>
<p><a href="https://stackoverflow.com/questions/39476/what-is-the-yield-keyword-used-for-in-c">What is the yield keyword used for in C#?</a></p>
<p>but in the accepted answer, they have thi... | [
{
"answer_id": 384403,
"author": "Trap",
"author_id": 7839,
"author_profile": "https://Stackoverflow.com/users/7839",
"pm_score": 0,
"selected": false,
"text": "public IEnumerable<ICustomer> Customers()\n{\n foreach( ICustomer customer in m_maleCustomers )\n {\n ... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4653/"
] |
384,401 | <p>I'm currently trying to implement a class to handle secure communications between instances of my app using RSACrytoServiceProveider class.
First question : is it a good idea implement a single class to handle sender/reciever roles or should i split the roles into individual classes ?. This is what i have done so f... | [
{
"answer_id": 384472,
"author": "Andrea Celin",
"author_id": 47458,
"author_profile": "https://Stackoverflow.com/users/47458",
"pm_score": 1,
"selected": false,
"text": "Namespace Crypto\n\n Public Class RSACry\n\n Shared Sub New()\n End Sub\n\n Public Enum Algor... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384401",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48127/"
] |
384,419 | <p>I have a list that looks like (A (B (C D)) (E (F))) which represents this tree:</p>
<pre><code> A
/ \
B E
/ \ /
C D F
</code></pre>
<p>How do I print it as (A B E C D F) ?</p>
<p>This is as far as I managed:</p>
<pre><code>((lambda(tree) (loop for ele in tree do (print ele))) my-list)
</c... | [
{
"answer_id": 384582,
"author": "namin",
"author_id": 34596,
"author_profile": "https://Stackoverflow.com/users/34596",
"pm_score": 2,
"selected": false,
"text": "(A ((B (C D)) (E (F))))"
},
{
"answer_id": 384716,
"author": "Jonathan Leffler",
"author_id": 15168,
"au... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15345/"
] |
384,431 | <pre><code>game.h needs:
- packet.h
- socket.h
server.h needs:
- socket.h
socket.h needs:
- game.h
</code></pre>
<p>The problem comes when I try to include socket.h into game.h, because socket.h has game.h included already. How do I solve these kind of problems?</p>
| [
{
"answer_id": 384434,
"author": "Lasse V. Karlsen",
"author_id": 267,
"author_profile": "https://Stackoverflow.com/users/267",
"pm_score": 5,
"selected": true,
"text": "#ifndef GAME_H\n#define GAME_H\n\n.. rest of your header file here\n\n#endif\n"
},
{
"answer_id": 384439,
... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
384,442 | <p>I have byte array as input. I would like to convert that array to string that contains hexadecimal representation of array values. This is F# code:</p>
<pre><code>let ByteToHex bytes =
bytes
|> Array.map (fun (x : byte) -> String.Format("{0:X2}", x))
let ConcatArray stringArray = String.Join(null, ... | [
{
"answer_id": 384447,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": -1,
"selected": false,
"text": "raw"
},
{
"answer_id": 384530,
"author": "JaredPar",
"author_id": 23283,
"author_profile": "http... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25732/"
] |
384,451 | <p>There's a lot of security advice out there to tell programmers what <em>not</em> to do. What in your opinion are the best practices that <em>should</em> be followed when coding for good security?</p>
<p>Please add your suggested security control / design pattern below. Suggested format is a bold headline summarisin... | [
{
"answer_id": 384459,
"author": "Charlie Martin",
"author_id": 35092,
"author_profile": "https://Stackoverflow.com/users/35092",
"pm_score": 2,
"selected": false,
"text": "sudo make install"
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/384451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42404/"
] |
384,462 | <p>if i have a protected method, can i pass in a parameter where the data type is declared internal?</p>
| [
{
"answer_id": 384464,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 4,
"selected": true,
"text": "public interface IFoo {}\ninternal class Foo : IFoo {}\npublic class Bar {\n protected void Test(IFoo foo) {}\n}\n"... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4653/"
] |
384,471 | <p>So, looking for a mysql-db-lib that is compatible with py3k/py3.0/py3000, any ideas? Google turned up nothing.</p>
| [
{
"answer_id": 39008521,
"author": "Collin Anderson",
"author_id": 131881,
"author_profile": "https://Stackoverflow.com/users/131881",
"pm_score": 2,
"selected": false,
"text": "MySQLdb"
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/384471",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/452521/"
] |
384,500 | <p>Here is the scenario:<br>
ThickBox is opened from parent window (when button is pressed) with Ajax content (div based form) that contains the set of inputs with autocomplete support. Once ThickBox(form) is closed the input values should be passed to parent window.</p>
<p>Question:<br>
The content of ThickBox is loa... | [
{
"answer_id": 384560,
"author": "redsquare",
"author_id": 6440,
"author_profile": "https://Stackoverflow.com/users/6440",
"pm_score": 3,
"selected": true,
"text": "$.ajaxSuccess( function(evt, request, settings){\n //ajax method has completed\n}); \n"
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/384500",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42512/"
] |
384,502 | <p>Not to long ago, someone told me that <code>long</code> are not 64 bits on 64 bit machines and I should always use <code>int</code>. This did not make sense to me. I have seen docs (such as the one on Apple's official site) say that <code>long</code> are indeed 64 bits when compiling for a 64-bit CPU. I looked up wh... | [
{
"answer_id": 384544,
"author": "Paul de Vrieze",
"author_id": 4100,
"author_profile": "https://Stackoverflow.com/users/4100",
"pm_score": 2,
"selected": false,
"text": "#include <iostream>\n\nint main() {\n std::cout << sizeof(long)*8 << std::endl;\n}\n"
},
{
"answer_id": 3846... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
384,511 | <p>I noticed that <code>List<T></code> defines its enumerator as a <code>struct</code>, while <code>ArrayList</code> defines its enumerator as a <code>class</code>. What's the difference? If I am to write an enumerator for my class, which one would be preferable?</p>
<p><strong>EDIT:</strong> My requirements can... | [
{
"answer_id": 384514,
"author": "Daniel Earwicker",
"author_id": 27423,
"author_profile": "https://Stackoverflow.com/users/27423",
"pm_score": 3,
"selected": false,
"text": "yield return"
},
{
"answer_id": 384522,
"author": "JaredPar",
"author_id": 23283,
"author_pro... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41283/"
] |
384,573 | <p>What are the reasons when I am connecting to the MySQL server in my laptop(development machine) using MySQL Administrator it is too slow, but when I am connecting to the MySQL server in the prouction machine it is faster. Does setting on the logs have a noticeable performance drop? I have no problems before with slo... | [
{
"answer_id": 721910,
"author": "robnardo",
"author_id": 56774,
"author_profile": "https://Stackoverflow.com/users/56774",
"pm_score": 0,
"selected": false,
"text": "network.dns.disableIPv6"
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/384573",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46893/"
] |
384,574 | <p>I am trying to figure out a clean way to intercept uncaught exceptions that occur in my application. </p>
<p>I have log4j configured for logging the normal application flow and caught exceptions, so that is taken care of. Right now, I have a class that takes all error-level messages and adds them to a queue to be e... | [
{
"answer_id": 384585,
"author": "kdgregory",
"author_id": 42126,
"author_profile": "https://Stackoverflow.com/users/42126",
"pm_score": 4,
"selected": true,
"text": "<error-page>\n <exception-type>java.lang.Exception</exception-type>\n <location>/dumpRequest.jsp</location>\n</erro... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13812/"
] |
384,592 | <p>I want to use this pattern:</p>
<pre><code>SqlCommand com = new SqlCommand(sql, con);
com.CommandType = CommandType.StoredProcedure;//um
com.CommandTimeout = 120;
//com.Connection = con; //EDIT: per suggestions below
SqlParameter par;
par = new SqlParameter("@id", SqlDbType.Int);
par.Direction = ParameterDirectio... | [
{
"answer_id": 387087,
"author": "FlySwat",
"author_id": 1965,
"author_profile": "https://Stackoverflow.com/users/1965",
"pm_score": 0,
"selected": false,
"text": "result = getResultFromCache(CacheKey)\nif (result == null)\n{\n result = getResultFromDB();\n InsertIntoCache(result... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33264/"
] |
384,593 | <p>Im trying to save a bitmap jpg format with a specified encoding quality. However im getting an exception ("Parameter is not valid.") when calling the save method.</p>
<p>If i leave out the two last parameters in the bmp.save it works fine.</p>
<pre><code> EncoderParameters eps = new EncoderParameters(1);
... | [
{
"answer_id": 1318070,
"author": "Mahdi",
"author_id": 161505,
"author_profile": "https://Stackoverflow.com/users/161505",
"pm_score": 2,
"selected": false,
"text": "eps.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, (long)16);\n"
}
] | 2008/12/21 | [
"https://Stackoverflow.com/questions/384593",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36476/"
] |
384,596 | <p>i've got a ComboBox that i generate dynamically and fill with some items. i would like to set this control's width to the width of the longest item. how do i count the display width of some text?</p>
<p>edit: i'm using windows forms, but i would like to do it in asp.net as well</p>
| [
{
"answer_id": 55558353,
"author": "Adam",
"author_id": 1126985,
"author_profile": "https://Stackoverflow.com/users/1126985",
"pm_score": 0,
"selected": false,
"text": "private void comboBox_DropDown(object sender, EventArgs e)\n {\n Graphics g = (sender as ComboBox).Cr... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40872/"
] |
384,610 | <p>As an exercise, I'm translating parts of our large and battle-hardened Delphi-framework to C#. </p>
<p>Included in this framework is a generic singleton parent class. Of course, implementing a singleton in C# is fairly easy (there is even a Jon Skeet article, so what more could I wish for), but our Delphi singleton... | [
{
"answer_id": 384626,
"author": "devios1",
"author_id": 238948,
"author_profile": "https://Stackoverflow.com/users/238948",
"pm_score": 3,
"selected": true,
"text": "Equals()"
},
{
"answer_id": 384627,
"author": "George Mauer",
"author_id": 5056,
"author_profile": "h... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384610",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16725/"
] |
384,632 | <p>The documentation for <a href="http://msdn.microsoft.com/en-us/library/k3e17y47(VS.80).aspx" rel="nofollow noreferrer">Sort</a> says that Sort will throw an ArgumentException if "The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itsel... | [
{
"answer_id": 384647,
"author": "Greg Dean",
"author_id": 1200558,
"author_profile": "https://Stackoverflow.com/users/1200558",
"pm_score": 3,
"selected": true,
"text": "public void Sort(T[] keys, int index, int length, IComparer<T> comparer)\n{\n try\n {\n ...\n Arr... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38206/"
] |
384,633 | <p>i am new to .net 3.5.
I have a collection of items:</p>
<pre><code>IList<Model> models;
</code></pre>
<p>where</p>
<pre><code>class Model
{
public string Name
{
get;
private set;
}
}
</code></pre>
<p>I would like to get the element, which has the longest name's length.
I tried </p... | [
{
"answer_id": 384649,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 3,
"selected": false,
"text": "TValue"
},
{
"answer_id": 384656,
"author": "BFree",
"author_id": 15861,
"author_profile": "https://... | 2008/12/21 | [
"https://Stackoverflow.com/questions/384633",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40872/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.