qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
372,807
<p>I have a problem with a bash script. I have to use the operator * to multiplicate. Instead the script bugs me with expansion and using as operator the name of the script itself. I tried with single quotes but it doesn't work :( Here's the code</p> <pre><code>#!/bin/bash -x # Bash script that calculates an arithmet...
[ { "answer_id": 372871, "author": "Jason Day", "author_id": 737, "author_profile": "https://Stackoverflow.com/users/737", "pm_score": 2, "selected": false, "text": "*" }, { "answer_id": 386992, "author": "MatthieuP", "author_id": 41469, "author_profile": "https://Stack...
2008/12/16
[ "https://Stackoverflow.com/questions/372807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41977/" ]
372,808
<p>I have uploaded some files to a directory under public and I try to access them using Dir.glob. But I get no results back. </p> <p>The Dir.glob works fine on dev server (mongrel) and also works fine when using script/console on the site installed on site5</p> <p>is there a way to get this working or a different wa...
[ { "answer_id": 372851, "author": "Keltia", "author_id": 16143, "author_profile": "https://Stackoverflow.com/users/16143", "pm_score": 2, "selected": true, "text": "Dir.entries(\"public\").each do |f|\n puts(f)\nend\n" }, { "answer_id": 373068, "author": "AndreasKnudsen", ...
2008/12/16
[ "https://Stackoverflow.com/questions/372808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36465/" ]
372,812
<p>I am running C# framework 2.0 and I would like to get some of the data from a list? The list is a List&lt;>. How can I do that without looping and doing comparaison manually on each element of the List&lt;>?</p>
[ { "answer_id": 372822, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 3, "selected": true, "text": " static void Main()\n {\n List<SimpleObject> list = new List<SimpleObject>();\n list.Add(new ...
2008/12/16
[ "https://Stackoverflow.com/questions/372812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46829/" ]
372,815
<pre><code> for m := 0 to 300 do if Pos(certain_String, string(arrayitem(m)) &lt;&gt; 0 then begin randomize; x := random(100); begin case x of 0..69 : function(m); // 70 percent 70..79 : function(m+1); // 10 percent 80..84 : ...
[ { "answer_id": 372840, "author": "pyon", "author_id": 46571, "author_profile": "https://Stackoverflow.com/users/46571", "pm_score": 0, "selected": false, "text": "break" }, { "answer_id": 372855, "author": "Toon Krijthe", "author_id": 18061, "author_profile": "https:/...
2008/12/16
[ "https://Stackoverflow.com/questions/372815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
372,820
<p>I'm looking at this control, and it seems to be lacking the standard .net "datasource" and "datamember" properties for databinding. Is this control not bindable? I can write some custom function that populates the treeview from a given data source, I suppose, and embed data objects as necessary, but is that the 'b...
[ { "answer_id": 373514, "author": "TheCodeMonk", "author_id": 28956, "author_profile": "https://Stackoverflow.com/users/28956", "pm_score": 3, "selected": false, "text": "class Node\n{\n System.Collections.Generic.List<Node> _Children;\n String Description;\n\n void Node()\n {...
2008/12/16
[ "https://Stackoverflow.com/questions/372820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18071/" ]
372,828
<p>I wrote below code to remove checked item from radio group in my form by double click.</p> <pre><code>$("input[type='radio']").each(function(){ $(this).dblclick(function(){ $(this).removeAttr("checked"); }); }); </code></pre> <p>but this code doesn't work in FireFox ...
[ { "answer_id": 1298571, "author": "Andy Gaskell", "author_id": 30697, "author_profile": "https://Stackoverflow.com/users/30697", "pm_score": 2, "selected": false, "text": "$(\"input[type='radio']\").dblclick(function(){\n $(this).removeAttr(\"checked\");\n});\n" } ]
2008/12/16
[ "https://Stackoverflow.com/questions/372828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46110/" ]
372,834
<p>I am trying to create a SQL server login and database user from within my application, along with a custom application user row. I want these users to be able to create other users - i.e. the application will control who can/can't create users but I need all users to have permissions for creating SQL server logins a...
[ { "answer_id": 10096634, "author": "Hemanshu", "author_id": 1325127, "author_profile": "https://Stackoverflow.com/users/1325127", "pm_score": 0, "selected": false, "text": "/* \nTOPIC: create a login ,who can add other logins to databases (securityadmin server role)\n*/\n\nUSE MASTER \n...
2008/12/16
[ "https://Stackoverflow.com/questions/372834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
372,837
<p>I spend some time customizing the colors for syntax highlighting in Eclipse (Java, JSP, HTML, CSS, etc.) but whenever I try to export these settings via File|Export|General|Preferences and reimport them, the settings never completely get imported back. Some colors are restored and others are left unchanged, leaving ...
[ { "answer_id": 598146, "author": "foxdonut", "author_id": 26353, "author_profile": "https://Stackoverflow.com/users/26353", "pm_score": 8, "selected": true, "text": ".epf" }, { "answer_id": 3772160, "author": "st.never", "author_id": 455368, "author_profile": "https:/...
2008/12/16
[ "https://Stackoverflow.com/questions/372837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26353/" ]
372,862
<p>I'm an old (but not too old) Java programmer, that decided to learn C++. But I have seen that much of C++ programming style, is... well, just damn ugly!</p> <p>All that stuff of putting the class definition in a header file, and the methods in a different source file- Calling functions out of nowhere, instead of us...
[ { "answer_id": 372948, "author": "Adam", "author_id": 1366, "author_profile": "https://Stackoverflow.com/users/1366", "pm_score": 6, "selected": true, "text": "// Vehicle.h\nclass Wheel {\n private:\n Car& m_parent;\n public:\n Wheel( Car& p ) : m_parent( p ) {\n ...
2008/12/16
[ "https://Stackoverflow.com/questions/372862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2605/" ]
372,865
<p><a href="https://msdn.microsoft.com/en-us/library/system.io.path.combine%28v=vs.110%29.aspx" rel="noreferrer">Path.Combine</a> is handy, but is there a similar function in the .NET framework for <a href="http://en.wikipedia.org/wiki/Uniform_resource_locator" rel="noreferrer">URLs</a>?</p> <p>I'm looking for syntax ...
[ { "answer_id": 372888, "author": "Ryan Cook", "author_id": 43029, "author_profile": "https://Stackoverflow.com/users/43029", "pm_score": 7, "selected": false, "text": "Uri.TryCreate( ... )" }, { "answer_id": 1207244, "author": "mtazva", "author_id": 67538, "author_pro...
2008/12/16
[ "https://Stackoverflow.com/questions/372865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16082/" ]
372,869
<p>I get the name of a variable from the script user as the first argument and I echo the value of said variable back to the console:</p> <pre><code>#!/bin/bash variablename=$1 echo "The value of $variablename is: " ${!variablename} </code></pre> <p>This works great!</p> <p>What I can't get to work is if I want to c...
[ { "answer_id": 372876, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "#!/bin/bash\nvariablename=$1\necho \"The value of $variablename is: \" ${!variablename}\necho \"I will now try to change the va...
2008/12/16
[ "https://Stackoverflow.com/questions/372869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
372,872
<p>When converting from PNG to JPG using the MagickWand API, how do I set the background to white for transparent pixels?</p>
[ { "answer_id": 4318947, "author": "Oldes", "author_id": 494472, "author_profile": "https://Stackoverflow.com/users/494472", "pm_score": 2, "selected": false, "text": "if(current_wand && IsMagickWand(current_wand)){\n status=MagickReadImage(current_wand, \"test.png\");\n if (status ...
2008/12/16
[ "https://Stackoverflow.com/questions/372872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
372,877
<p>I have Default.aspx page, which inherits from BasePage.cs, which inherits from System.Web.UI.Page. BasePage is where I do some common things every page must do upon loading.</p> <p>In BasePage, lets say I'm checking for X. If X=1, then I will redirect to my "Discontinued.aspx" page immediately and stop execution ...
[ { "answer_id": 372930, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 5, "selected": true, "text": "...redirect(stopit,true);\nreturn;\n" }, { "answer_id": 372940, "author": "recursive", "author_id": 44...
2008/12/16
[ "https://Stackoverflow.com/questions/372877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44698/" ]
372,885
<p>How do I connect to a MySQL database using a python program?</p>
[ { "answer_id": 372896, "author": "George Stocker", "author_id": 16587, "author_profile": "https://Stackoverflow.com/users/16587", "pm_score": 8, "selected": false, "text": "#!/usr/bin/python\nimport MySQLdb\n\n# Connect\ndb = MySQLdb.connect(host=\"localhost\",\n user...
2008/12/16
[ "https://Stackoverflow.com/questions/372885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
372,893
<p>I want to create a file that only resides in memory... In looking through some documentation I saw a recommendation to use a shell extension as a virtual file. Im not sure that is a workable solution but I would like to know</p> <ol> <li>Is it a good approach (or should I be using a ramdisk instead)</li> <li>Wher...
[ { "answer_id": 372896, "author": "George Stocker", "author_id": 16587, "author_profile": "https://Stackoverflow.com/users/16587", "pm_score": 8, "selected": false, "text": "#!/usr/bin/python\nimport MySQLdb\n\n# Connect\ndb = MySQLdb.connect(host=\"localhost\",\n user...
2008/12/16
[ "https://Stackoverflow.com/questions/372893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38734/" ]
372,907
<p>How do I maintain the scroll position of the parent page when I open new window using window.open()? The parent page returns to the top of the page.</p> <p>Here is my current code:</p> <pre><code>&lt;a href="#" onclick="javascript: window.open('myPage.aspx');"&gt; Open New Window &lt;/a&gt; </code></pre>
[ { "answer_id": 372924, "author": "Grant Wagner", "author_id": 9254, "author_profile": "https://Stackoverflow.com/users/9254", "pm_score": 4, "selected": true, "text": "<a href=\"#\" onclick=\"window.open('myPage.aspx');return false;\">Open New Window</a>\n" }, { "answer_id": 3729...
2008/12/16
[ "https://Stackoverflow.com/questions/372907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26327/" ]
372,914
<p>I have the following code to zip all the files and then save it to the harddisk. I want zip all the files (this is done) and then attach the zip file to the Response stream so that the user have the option to save it! </p> <pre><code>protected void DownloadSelectedFiles_Click(object sender, EventArgs e) { ...
[ { "answer_id": 373238, "author": "Stefan", "author_id": 19307, "author_profile": "https://Stackoverflow.com/users/19307", "pm_score": 1, "selected": false, "text": " Response.Buffer = true;\n Response.Clear();\n Response.ClearContent();\n Response.ClearHeaders();\n" } ]
2008/12/16
[ "https://Stackoverflow.com/questions/372914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3797/" ]
372,915
<p>I'm dealing with game dialogue files (conversation between player and non-playable-characters) where dialogue choices and their outcome depend on certain conditions and result in certain actions. Now, I could write a simple parser to handle some sort of language for specifying the pre and post-conditions, but a frie...
[ { "answer_id": 373141, "author": "Guge", "author_id": 37771, "author_profile": "https://Stackoverflow.com/users/37771", "pm_score": 1, "selected": false, "text": "<category>\n<pattern>WHAT ARE YOU</pattern>\n<template>\n <think><set name=\"topic\">Me</set></think> \n I am the lates...
2008/12/16
[ "https://Stackoverflow.com/questions/372915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23153/" ]
372,916
<p>OK,</p> <p>This question has probably been answered before, but I'm not sure of how to word the Title.</p> <p>I have a class that has methods which return many composite LINQ queries. Most of these queries form Anonymous Types in order to get the data I need. I found out that I'm not able to return an Anonymous ...
[ { "answer_id": 373750, "author": "Chaowlert Chaisrichalermpol", "author_id": 2398110, "author_profile": "https://Stackoverflow.com/users/2398110", "pm_score": 0, "selected": false, "text": "// Useful? probably not.\nprivate void foo()\n{\n var user = AnonCast(GetUserTuple(), new { Nam...
2008/12/16
[ "https://Stackoverflow.com/questions/372916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36269/" ]
372,925
<p>My reuirement:</p> <p>Input File:</p> <p>1,abc,xyx</p> <p>2,def,mno</p> <p>3,ghi,suv</p> <p>DB Table Structure:</p> <p>Col1 char</p> <p>col2 char</p> <p>col3 char</p> <p>col4 char</p> <p>col5 char</p> <p>Data in Table after BCP:</p> <p>col1 col2 col3 col4 col5</p> <p>1 abc xyz ab xy</p> <p>2 ...
[ { "answer_id": 373536, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 2, "selected": false, "text": "BULK INSERT" }, { "answer_id": 924943, "author": "edosoft", "author_id": 6399, "author_profile": "ht...
2008/12/16
[ "https://Stackoverflow.com/questions/372925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
372,933
<p>I am taking in a string from user input, and splitting it on whitespace (using \w) into an array of strings. I then loop through the array, and append a part of the where clause like this:</p> <pre><code> query += " AND ( " + "field1 LIKE '%" + searchStrings[i] +"%' " ...
[ { "answer_id": 372962, "author": "BenAlabaster", "author_id": 40650, "author_profile": "https://Stackoverflow.com/users/40650", "pm_score": 5, "selected": true, "text": "+ field1 like @PropertyVal Or field2 like @PropertyVal Or field3 like @PropertyVal etc...\n" }, { "answer_id":...
2008/12/16
[ "https://Stackoverflow.com/questions/372933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4257/" ]
372,934
<p>By "fixed vector" I mean a static list of values, like 1 through 24.</p> <p>The current query looks like this (simplified)</p> <pre><code>SELECT Period, Profit FROM Projections </code></pre> <p>But the data is "sparse" &#8212; so there's not a row for every period.</p> <p>What query will give me a row for peiods...
[ { "answer_id": 372962, "author": "BenAlabaster", "author_id": 40650, "author_profile": "https://Stackoverflow.com/users/40650", "pm_score": 5, "selected": true, "text": "+ field1 like @PropertyVal Or field2 like @PropertyVal Or field3 like @PropertyVal etc...\n" }, { "answer_id":...
2008/12/16
[ "https://Stackoverflow.com/questions/372934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4525/" ]
372,955
<p>If I'm rendering a regular view in asp.net mvc the only domain object properties that show up in my page the ones I specifically write out. For example:</p> <pre><code>&lt;div&gt;&lt;%= Customer.FirstName %&gt;&lt;/div&gt; </code></pre> <p>However, if I serialize a domain object for json it will include every prop...
[ { "answer_id": 372977, "author": "Craig Stuntz", "author_id": 7714, "author_profile": "https://Stackoverflow.com/users/7714", "pm_score": 5, "selected": true, "text": "var customer = from c in serviceLayer.GetCustomers()\n where c.Id == id.Value\n select new {...
2008/12/16
[ "https://Stackoverflow.com/questions/372955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31624/" ]
372,961
<p>I have a SQL statement similar to this:</p> <pre><code>SELECT COUNT(*) AS foo, SUM(foo) AS foo_sum FROM bar </code></pre> <p>But MySQL doesn't allow this because foo is an alias. Does anyone have an idea of how this could be accomplished in SQL?</p>
[ { "answer_id": 372987, "author": "Harper Shelby", "author_id": 21196, "author_profile": "https://Stackoverflow.com/users/21196", "pm_score": 1, "selected": false, "text": "SELECT SUM(foo) as foo_sum\nFROM \n(\n SELECT COUNT(*) AS foo\n FROM bar\n GROUP BY baz\n)\n" }, { ...
2008/12/16
[ "https://Stackoverflow.com/questions/372961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46540/" ]
372,974
<p>I want to programmatically invoke an event handler for a control. For example:</p> <pre><code>DateTimePicker dtpLastConsummated; </code></pre> <p>I want to trigger the TextChanged event handler for the <code>dtpLastConsummated</code>, how can i do it?</p> <p>In other languages I would call something akin to:</p> ...
[ { "answer_id": 373567, "author": "Jon B", "author_id": 27414, "author_profile": "https://Stackoverflow.com/users/27414", "pm_score": 2, "selected": false, "text": "class MyButton : Button\n{\n public void CauseClick()\n {\n this.OnClick();\n }\n}\n" }, { "answer_i...
2008/12/16
[ "https://Stackoverflow.com/questions/372974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
372,980
<p>The ISO C committee (<a href="http://www.open-std.org/JTC1/SC22/WG14/" rel="noreferrer">ISO/IEC JTC1/SC21/WG14</a>) has published <a href="http://www.open-std.org/JTC1/SC22/WG14/www/projects#24731-1" rel="noreferrer">TR 24731-1</a> and is working on <a href="http://www.open-std.org/JTC1/SC22/WG14/www/projects#24731-...
[ { "answer_id": 373911, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 5, "selected": false, "text": "%n" }, { "answer_id": 17353714, "author": "cmaster - reinstate monica", "author_id": 2445184, ...
2008/12/16
[ "https://Stackoverflow.com/questions/372980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15168/" ]
372,982
<p>I have from the backend a time on the format 00:12:54 and I display it to the screen. But, I would like to have this time to continue to go down. I have though to create a variable in javascript that will old the time and with <code>setTimeout</code> to loop to display with document.getElementById the new value. I t...
[ { "answer_id": 372986, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 2, "selected": false, "text": " $('#until2d4h').countdown({until: '+12M +54S'});\n" }, { "answer_id": 373010, "author": "Ates Gora...
2008/12/16
[ "https://Stackoverflow.com/questions/372982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46829/" ]
372,988
<p>I'm new to database indexing, if I have 2 columns in a table that are good choices for indexing like for example,</p> <pre><code>[Posts]( [PostID] [int] IDENTITY(1,1) NOT NULL, [UserName] [nvarchar](64) NOT NULL, [ApplicationType] [smallint] NOT NULL, ... ) </code></pre> <p>in this case PostID woul...
[ { "answer_id": 373024, "author": "BCS", "author_id": 1343, "author_profile": "https://Stackoverflow.com/users/1343", "pm_score": 1, "selected": false, "text": "a" } ]
2008/12/16
[ "https://Stackoverflow.com/questions/372988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32240/" ]
373,002
<p>I'm trying to find a markdown interpreter class/module that I can use in a rakefile.</p> <p>So far I've found <a href="http://maruku.rubyforge.org/" rel="noreferrer">maruku</a>, but I'm a bit wary of beta releases.</p> <p>Has anyone had any issues with maruku? Or, do you know of a better alternative?</p>
[ { "answer_id": 373446, "author": "outcassed", "author_id": 18424, "author_profile": "https://Stackoverflow.com/users/18424", "pm_score": 9, "selected": true, "text": "BlueCloth: 13.029987s total time, 00.130300s average\n Maruku: 08.424132s total time, 00.084241s average\nRDiscount: 00...
2008/12/16
[ "https://Stackoverflow.com/questions/373002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15031/" ]
373,012
<p>I am trying to create a simple dialog in MFC using Visual C++. My problem is that when I get the dialog on the screen and try to type in an Edit Box field, if I type the letter 'a' once, it appears in the edit box as 'aaaaaaaaaaa' (that's 12 a's). Furthermore, if I try to navigate around in the box using the arrow...
[ { "answer_id": 422786, "author": "rec", "author_id": 14022, "author_profile": "https://Stackoverflow.com/users/14022", "pm_score": 1, "selected": false, "text": "BOOL DialogName::PreTranslateMessage(MSG* pMsg)\n{\n\n if(pMsg->message==WM_KEYDOWN)\n {\n // TODO: see what is g...
2008/12/16
[ "https://Stackoverflow.com/questions/373012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34731/" ]
373,017
<p>Which techniqes would you use to implement a search for contents in a column on a very big table in MySql? Say for instance that you have 10.000.000 emails stored in a table in the database and would like to implement a subject search, that would enable me to search for one or more words that was present in the ema...
[ { "answer_id": 373041, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 2, "selected": false, "text": "FULLTEXT" }, { "answer_id": 373044, "author": "Eli", "author_id": 5958, "author_profile": "https:/...
2008/12/16
[ "https://Stackoverflow.com/questions/373017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37119/" ]
373,020
<p>Is there a way to find the application name of the current active window at a given time on Mac OS X using Python?</p>
[ { "answer_id": 373210, "author": "Peter Hosey", "author_id": 30461, "author_profile": "https://Stackoverflow.com/users/30461", "pm_score": 3, "selected": false, "text": "window = NSApp.mainWindow()\n" }, { "answer_id": 373310, "author": "Dirk Stoop", "author_id": 24051, ...
2008/12/16
[ "https://Stackoverflow.com/questions/373020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40195/" ]
373,022
<p>I'm trying to retrive a dataset to a Gridview, but I just don't get any row in my Gridview. What am I doing wrong?</p> <p>the page code</p> <pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load CType(Master, AreaTrabalho).AlteraTitulo = "Projectos" Using o...
[ { "answer_id": 373210, "author": "Peter Hosey", "author_id": 30461, "author_profile": "https://Stackoverflow.com/users/30461", "pm_score": 3, "selected": false, "text": "window = NSApp.mainWindow()\n" }, { "answer_id": 373310, "author": "Dirk Stoop", "author_id": 24051, ...
2008/12/16
[ "https://Stackoverflow.com/questions/373022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2019426/" ]
373,027
<p>I'm getting this error in a PHP (Drupal) application:</p> <pre><code>(104)Connection reset by peer: FastCGI: comm with server "/opt/php-5.2.5/bin/php-cgi" aborted: read failed </code></pre> <p>It is often followed by this error:</p> <pre><code>FastCGI: incomplete headers (0 bytes) received from server "/opt/php-...
[ { "answer_id": 4496035, "author": "sacabuche", "author_id": 259337, "author_profile": "https://Stackoverflow.com/users/259337", "pm_score": -1, "selected": false, "text": "#.htaccess file\nAddHandler fastcgi-script .py\n" }, { "answer_id": 9804240, "author": "Yuriy", "aut...
2008/12/16
[ "https://Stackoverflow.com/questions/373027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32137/" ]
373,057
<p>I'm performing a bulk insert with an ADO.NET 2.0 SqlBulkCopy object from a C# method into a MS SQL 2005 database, using a database user with limited permissions. When I try to run the operation, I get the error message:</p> <blockquote> <p>Bulk copy failed. User does not have ALTER TABLE permission on table ...
[ { "answer_id": 373963, "author": "gbn", "author_id": 27535, "author_profile": "https://Stackoverflow.com/users/27535", "pm_score": 2, "selected": false, "text": "ALTER TABLE dbo.SomeTable ENABLE TRIGGER ALL" }, { "answer_id": 374691, "author": "James Orr", "author_id": 41...
2008/12/16
[ "https://Stackoverflow.com/questions/373057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41457/" ]
373,064
<p>My goal is to make sure that in most scenarios objects are used via a "read-only interface" that is a subset of the full interface.</p> <ul> <li>As an example, if I were using C++, I would just return a <code>const</code> object.</li> <li>In C#, if I could achieve this with interfaces, I would just implement a read...
[ { "answer_id": 373353, "author": "Paul Kapustin", "author_id": 38325, "author_profile": "https://Stackoverflow.com/users/38325", "pm_score": 1, "selected": false, "text": "protected double accuracy;\npublic double Accuracy { get { return accuracy; } }\n" } ]
2008/12/16
[ "https://Stackoverflow.com/questions/373064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38325/" ]
373,067
<p>I'm creating a simple API that creates typed classes based on JSON data that has a mandatory 'type' field defined in it. It uses this string to define a new type, add the fields in the JSON object, instantiate it, and then populate the fields on the instance.</p> <p>What I want to be able to do is allow for these ...
[ { "answer_id": 373076, "author": "Can Berk Güder", "author_id": 2119, "author_profile": "https://Stackoverflow.com/users/2119", "pm_score": 0, "selected": false, "text": "dir()" }, { "answer_id": 373092, "author": "Martin v. Löwis", "author_id": 33006, "author_profile...
2008/12/16
[ "https://Stackoverflow.com/questions/373067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,084
<p>Address records are probably used in most database, but I've seen a number of slightly different sets of fields used to store them. The number of fields seems to vary from 3-7, and sometimes all fields are simple labelled address1..addressN, other times given specific meaning (town, city, etc).</p> <p>This is UK sp...
[ { "answer_id": 373133, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 0, "selected": false, "text": "Lloyds TSB\nIsle of Man Offshore Centre\nPeveril Buildings\nPeveril Square\nDouglas\nIsle of Man\nIM99 0XX\nUnite...
2008/12/16
[ "https://Stackoverflow.com/questions/373084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26334/" ]
373,087
<p>I use jQuery to make an AJAX POST request to my server, which can return HTTP response with status 302. Then JavaScript just sends GET request to this URL, while I'd like to redirect user to URL in this response. Is this possible?</p>
[ { "answer_id": 373130, "author": "Strelok", "author_id": 2788, "author_profile": "https://Stackoverflow.com/users/2788", "pm_score": -1, "selected": false, "text": "function doAjaxCall() {\n $.ajaxSetup({complete: onRequestCompleted});\n $.get(yourUrl,yourData,yourCallback);\n}\n\nfu...
2008/12/16
[ "https://Stackoverflow.com/questions/373087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46854/" ]
373,089
<p>What is the purpose of this Rails config setting...</p> <pre><code>config.action_controller.consider_all_requests_local = true </code></pre> <p>It's set to true by default in <code>config/environments/development.rb</code>.</p> <p>Thanks,</p> <p>Ethan</p>
[ { "answer_id": 373135, "author": "Gordon Wilson", "author_id": 23071, "author_profile": "https://Stackoverflow.com/users/23071", "pm_score": 8, "selected": true, "text": "consider_all_requests_local" } ]
2008/12/16
[ "https://Stackoverflow.com/questions/373089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
373,126
<p>I am trying to so something like <a href="https://stackoverflow.com/questions/48475/database-design-for-tagging">Database Design for Tagging</a>, except each of my tags are grouped into categories.</p> <p>For example, let's say I have a database about vehicles. Let's say we actually don't know very much about vehi...
[ { "answer_id": 373208, "author": "Dan Vinton", "author_id": 21849, "author_profile": "https://Stackoverflow.com/users/21849", "pm_score": 0, "selected": false, "text": "vehicles\n int vid\n string vin\n\ntags\n int tid\n int cid\n string key\n\ncategories\n int cid\n string catego...
2008/12/16
[ "https://Stackoverflow.com/questions/373126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21838/" ]
373,134
<p>I have just installed darcs 2.1.2.2. When I type darcs help, sth less-like shows up. When I dismiss it with q it goes away but I don't get prompt and can't execute any commands. C-c doesn't work either. I am using bash on gentoo.</p>
[ { "answer_id": 411496, "author": "Steve Baker", "author_id": 13566, "author_profile": "https://Stackoverflow.com/users/13566", "pm_score": 3, "selected": true, "text": "cmd | less\n" } ]
2008/12/16
[ "https://Stackoverflow.com/questions/373134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5978/" ]
373,142
<p>What techniques can be used to speed up C++ compilation times?</p> <p>This question came up in some comments to Stack Overflow question <em><a href="https://stackoverflow.com/questions/372862">C++ programming style</a></em>, and I'm interested to hear what ideas there are.</p> <p>I've seen a related question, <em>...
[ { "answer_id": 373158, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 4, "selected": false, "text": "-j<N>" }, { "answer_id": 373165, "author": "Milan Babuškov", "author_id": 14690, "autho...
2008/12/16
[ "https://Stackoverflow.com/questions/373142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11898/" ]
373,149
<p>I am trying to encode/decode MIME headers in Ruby.</p>
[ { "answer_id": 374045, "author": "Keltia", "author_id": 16143, "author_profile": "https://Stackoverflow.com/users/16143", "pm_score": 3, "selected": true, "text": "require \"base64\"\n" } ]
2008/12/16
[ "https://Stackoverflow.com/questions/373149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39529/" ]
373,153
<p>When you're using a factory pattern, how do you inject dependencies into constructors at runtime?</p> <p>I'm building Foos with different formats - boolean, array, freetext, matrix, etc. That format list will grow as we find different uses for Foo. Here's my basic core domain:</p> <pre><code>public interface IFo...
[ { "answer_id": 373797, "author": "Andrew Kennan", "author_id": 22506, "author_profile": "https://Stackoverflow.com/users/22506", "pm_score": 3, "selected": true, "text": "public interface IFooFormat\n{\n}\n\npublic class FooFormat<TValue> : IFooFormat\n{\n private TValue _value;\n\n ...
2008/12/16
[ "https://Stackoverflow.com/questions/373153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33157/" ]
373,156
<p>I'm scared that one day, I'm going to put a space or miss out something in the command I currently use:</p> <pre><code>rm -rf ./* </code></pre> <p>Is there a safer way of emptying the current directory's contents?</p>
[ { "answer_id": 373164, "author": "Chris Kloberdanz", "author_id": 28714, "author_profile": "https://Stackoverflow.com/users/28714", "pm_score": 0, "selected": false, "text": "-i" }, { "answer_id": 373175, "author": "Pyrolistical", "author_id": 21838, "author_profile":...
2008/12/16
[ "https://Stackoverflow.com/questions/373156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3410/" ]
373,157
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/321113/how-can-i-pre-set-arguments-in-javascript-function-call-partial-function-appli">How can I pre-set arguments in JavaScript function call? (Partial Function Application)</a> </p> </blockquote> <p>I need to...
[ { "answer_id": 373216, "author": "Jason Bunting", "author_id": 1790, "author_profile": "https://Stackoverflow.com/users/1790", "pm_score": 7, "selected": true, "text": "var fr = partial(f, 1, 2, 3);\n\n// now, when you invoke fr() it will invoke f(1,2,3)\nfr();\n" }, { "answer_id...
2008/12/16
[ "https://Stackoverflow.com/questions/373157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44084/" ]
373,182
<p>I bet I've got elementary question, but I couldn't solve it for two nights. I've got 1 "ul" element and I just want it to move any amount of pixels every e.g. 2 sec to the left. I want him to move like this step by step and then come back to the original position and start moving again. I've been stucked, my script...
[ { "answer_id": 373201, "author": "hhafez", "author_id": 42303, "author_profile": "https://Stackoverflow.com/users/42303", "pm_score": 0, "selected": false, "text": " for(i=eLi.length; i>0 ;i--){\n eUl.style.marginLeft = i*x+'px'; \n }\n" }, { "answer_id": 373222, ...
2008/12/16
[ "https://Stackoverflow.com/questions/373182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46866/" ]
373,186
<p>I see that I can declare a function with (say)</p> <pre><code>public double Function(double parameter) </code></pre> <p>but what if I do want to take the derivative of that function?</p>
[ { "answer_id": 373265, "author": "pyon", "author_id": 46571, "author_profile": "https://Stackoverflow.com/users/46571", "pm_score": 5, "selected": false, "text": " [f(x+h) - f(x-h)] / 2h " }, { "answer_id": 31605113, "author": "Natalie Perret", "author_id": 4636721, "...
2008/12/16
[ "https://Stackoverflow.com/questions/373186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46827/" ]
373,194
<p>I've come up with:</p> <pre><code>re.findall("([a-fA-F\d]*)", data) </code></pre> <p>but it's not very fool proof, is there a better way to grab all MD5-hash codes?</p>
[ { "answer_id": 373207, "author": "Marc Novakowski", "author_id": 27020, "author_profile": "https://Stackoverflow.com/users/27020", "pm_score": 7, "selected": true, "text": "re.findall(r\"([a-fA-F\\d]{32})\", data)\n" }, { "answer_id": 373286, "author": "Greg Hewgill", "au...
2008/12/16
[ "https://Stackoverflow.com/questions/373194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32933/" ]
373,212
<p>I've created a <em>very</em> simple app, which presents an easygui entrybox() and continues to loop this indefinitely as it receives user input.</p> <p>I can quit the program using the Cancel button as this returns None, but I would also like to be able to use the standard 'close' button to quit the program. (ie. t...
[ { "answer_id": 373267, "author": "Angel", "author_id": 23285, "author_profile": "https://Stackoverflow.com/users/23285", "pm_score": 0, "selected": false, "text": "root.protocol('WM_DELETE_WINDOW', self.quit)\n" }, { "answer_id": 34888002, "author": "pietronardelli", "au...
2008/12/16
[ "https://Stackoverflow.com/questions/373212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44817/" ]
373,214
<p>I was asking about specifics with this approach earlier today <a href="https://stackoverflow.com/questions/372572/how-to-block-the-ui-thread-from-another-thread-or-force-a-form-to-run-within-th">here</a> but the confused responses has me wondering if I'm going about this all wrong.</p> <p>So here's the problem. I ...
[ { "answer_id": 373225, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 0, "selected": false, "text": ".Join()" }, { "answer_id": 384010, "author": "George Mauer", "author_id": 5056, "author_pro...
2008/12/16
[ "https://Stackoverflow.com/questions/373214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
373,219
<p>I have a silverlight control which has a reference to a silverlight enabled wcf service.</p> <p>When I add a reference to the service in my silverlight control, it adds the following to my clientconfig file:</p> <pre><code>&lt;configuration&gt; &lt;system.serviceModel&gt; &lt;bindings&gt; &...
[ { "answer_id": 375394, "author": "Jeremy", "author_id": 9266, "author_profile": "https://Stackoverflow.com/users/9266", "pm_score": 4, "selected": false, "text": "svcMyService.DataAccessClient svcProxy_m;\n\nSystem.ServiceModel.BasicHttpBinding binding = new System.ServiceModel.BasicHttp...
2008/12/16
[ "https://Stackoverflow.com/questions/373219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9266/" ]
373,230
<p>How do I check to see if a column exists in a <code>SqlDataReader</code> object? In my data access layer, I have create a method that builds the same object for multiple stored procedures calls. One of the stored procedures has an additional column that is not used by the other stored procedures. I want to modifi...
[ { "answer_id": 373250, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 5, "selected": false, "text": "public static bool HasColumn(this IDataRecord r, string columnName)\n{\n try\n {\n return r.GetOrdinal(colu...
2008/12/17
[ "https://Stackoverflow.com/questions/373230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26327/" ]
373,233
<p>Why does adding an "||" OR between 2 "!=" not work for me? </p> <p>When 'name' is "test" or "test2" my if statement doesn't work if I've used 2 "!=" but if I use just one it does, please tell me why.</p> <pre><code>if (col.Name != "test" || col.Name != "test2") { MessageBox.Show("No" + col.Name.ToString()); //T...
[ { "answer_id": 373240, "author": "Dan Vinton", "author_id": 21849, "author_profile": "https://Stackoverflow.com/users/21849", "pm_score": 4, "selected": false, "text": "col.Name != \"test\" && col.Name != \"test2\"\n" }, { "answer_id": 373246, "author": "Matthew Crumley", ...
2008/12/17
[ "https://Stackoverflow.com/questions/373233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,234
<p>How can I grab my local changelist and send it to someone else in Perforce? More specifically, I would like to send unsubmitted changes from a local pending changelist to another user's pending changelist.</p>
[ { "answer_id": 373434, "author": "Ana Betts", "author_id": 5728, "author_profile": "https://Stackoverflow.com/users/5728", "pm_score": 5, "selected": true, "text": "set P4DIFF=C:\\cygwin\\bin\\diff.exe\np4 diff -du -c 12345 > patch-to-head.diff\n\n# On Other machine\npatch -p1 < patch-to...
2008/12/17
[ "https://Stackoverflow.com/questions/373234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46869/" ]
373,243
<p>I use ls to obtain my filename which has white space so it looks something like: </p> <p><code>my file with whitespace.tar.bz2</code></p> <p>I want to pipe this to tar similar to:</p> <pre><code>ls | grep mysearchstring | tar xvjf </code></pre> <p>How can I insert double quotes before piping it to tar?</p>
[ { "answer_id": 373296, "author": "Zan Lynx", "author_id": 13422, "author_profile": "https://Stackoverflow.com/users/13422", "pm_score": 3, "selected": false, "text": "find . -name '*.tar.bz2' -print0 | xargs -0 -n1 tar xjf\n" }, { "answer_id": 373979, "author": "Mr.Ree", ...
2008/12/17
[ "https://Stackoverflow.com/questions/373243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23120/" ]
373,252
<p>Recently saw someone commending another user on their use of sizeof var instead of sizeof(type). I always thought that was just a style choice. Is there any significant difference? As an example, the lines with f and ff were considered better than the lines with g and gg:</p> <pre><code> typedef struct _foo {} foo;...
[ { "answer_id": 373272, "author": "Martin v. Löwis", "author_id": 33006, "author_profile": "https://Stackoverflow.com/users/33006", "pm_score": 2, "selected": false, "text": "sizeof f" }, { "answer_id": 373343, "author": "Johannes Schaub - litb", "author_id": 34509, "a...
2008/12/17
[ "https://Stackoverflow.com/questions/373252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44065/" ]
373,253
<p>Given an array like {"one two", "three four five"}, how'd you calculate the total number of words contained in it using LINQ?</p>
[ { "answer_id": 373260, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 3, "selected": false, "text": "var stringArray = new[] {\"one two\", \"three four five\"};\nvar numWords = stringArray.SelectMany(segment => s...
2008/12/17
[ "https://Stackoverflow.com/questions/373253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1670/" ]
373,257
<p>I have many sites that use the same root category of the Main Site. Each product that is added is added to the site it was added to (wow.) and also the Main Site. However, I would like categories on a per site basis to only appear if there are products on that site.</p> <p>If I have:</p> <pre><code>Category1 Categ...
[ { "answer_id": 11385618, "author": "Amir Shakya", "author_id": 1102707, "author_profile": "https://Stackoverflow.com/users/1102707", "pm_score": 0, "selected": false, "text": "<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>\n<?php if($_menu): ?>\n<div>\n <ul id=\"nav\...
2008/12/17
[ "https://Stackoverflow.com/questions/373257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,258
<p>Let's in fact generalize to a <code>c</code>-confidence interval. Let the common rate parameter be <code>a</code>. (Note that the mean of an exponential distribution with rate parameter <code>a</code> is <code>1/a</code>.)</p> <p>First find the cdf of the sum of <code>n</code> such i.i.d. random variables. Use t...
[ { "answer_id": 373751, "author": "dreeves", "author_id": 4234, "author_profile": "https://Stackoverflow.com/users/4234", "pm_score": 3, "selected": true, "text": "F[x_] := 1 - GammaRegularized[n, a*x];\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/373258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4234/" ]
373,261
<p>I am developing an OpenGL application and I am seeing some strange things happen. The machine I am testing with is equipped with an NVidia Quadro FX 4600 and it is running RHEL WS 4.3 x86_64 (kernel 2.6.9-34.ELsmp).</p> <p>I've stepped through the application with a debugger and I've noticed that it is hanging on O...
[ { "answer_id": 381477, "author": "Andrew Garrison", "author_id": 16460, "author_profile": "https://Stackoverflow.com/users/16460", "pm_score": 2, "selected": true, "text": "__GL_YIELD" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/373261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16460/" ]
373,262
<p>How can the XOR operation (on two 32 bit ints) be implemented using only basic arithmetic operations? Do you have to do it bitwise after dividing by each power of 2 in turn, or is there a shortcut? I don't care about execution speed so much as about the simplest, shortest code.</p> <p><strong>Edit:</strong> This is...
[ { "answer_id": 373290, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 4, "selected": true, "text": "uint32_t mod_op(uint32_t a, uint32_t b) {\n uint32_t int_div = a / b;\n return a - (b * int_div);\n}\n...
2008/12/17
[ "https://Stackoverflow.com/questions/373262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16883/" ]
373,266
<p>I am trying to create an XML schema representing an 'order' for a shopping cart</p> <p>I want this to completely abstract away my shopping cart's implementation -- and eventually support partners sending us orders using this schema. (yes i'm planning on integrating this schema into our existing cart)</p> <p>It wil...
[ { "answer_id": 373592, "author": "George Stocker", "author_id": 16587, "author_profile": "https://Stackoverflow.com/users/16587", "pm_score": 2, "selected": false, "text": "<?xml version=\"1.0\"?>\n <Order>\n <Date>2003/07/04</Date>\n <CustomerId>123</CustomerId>\n <CustomerName>Acme ...
2008/12/17
[ "https://Stackoverflow.com/questions/373266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16940/" ]
373,287
<p>Is it possible to send messages from a PHP script to the console in Eclipse? Has anyone attempted this already? I'm not very familiar with how the console works, so I'm not sure if there is a standardized method for communicating with it.</p>
[ { "answer_id": 374991, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<?php\n\necho \"Hello World\\n\";\n\n?>\n" }, { "answer_id": 399042, "author": "Uresu", "author_id": 11552, ...
2008/12/17
[ "https://Stackoverflow.com/questions/373287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5291/" ]
373,295
<p>Has anyone came across where they have to deal with .truststore file? and knowing how to import .cer into .truststore file? </p> <p>I am not sure if I have to use Java Keytool or Linux command (such as openssl command).</p> <p>Thanks</p>
[ { "answer_id": 373307, "author": "Strelok", "author_id": 2788, "author_profile": "https://Stackoverflow.com/users/2788", "pm_score": 9, "selected": true, "text": "# Copy the certificate into the directory Java_home\\Jre\\Lib\\Security\n# Change your directory to Java_home\\Jre\\Lib\\Secu...
2008/12/17
[ "https://Stackoverflow.com/questions/373295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44534/" ]
373,297
<p>I have Windows Server 2008 installed on a Sony laptop and the brightness control doesn't work. I'd like to write a program to allow me to change it.</p> <p>Currently what I have to do is open the Power control panel, click advanced settings, and fight through so many UAC boxes that anybody watching me must think I'...
[ { "answer_id": 799207, "author": "Lucas", "author_id": 24231, "author_profile": "https://Stackoverflow.com/users/24231", "pm_score": 4, "selected": true, "text": "ManagementClass mclass = new ManagementClass(\"WmiMonitorBrightnessMethods\");\nmclass.Scope = new ManagementScope(@\"\\\\.\\...
2008/12/17
[ "https://Stackoverflow.com/questions/373297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16940/" ]
373,305
<p>I am trying to develop a slideshow with a pause between slides. So I'm trying to use the setTimeout statement as shown below. This is written to swap 2.jpg for 1.jpg with a pause of 10 seconds on clicking the button. But it does now work. Can anyone help me. Thanks.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;scri...
[ { "answer_id": 373340, "author": "Eran Galperin", "author_id": 10585, "author_profile": "https://Stackoverflow.com/users/10585", "pm_score": 3, "selected": false, "text": " setTimeout(function() { swap(); },10000);\n //Or\n setTimeout(swap,10000); //Passing the actual function as the cal...
2008/12/17
[ "https://Stackoverflow.com/questions/373305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39973/" ]
373,324
<p>I seem to recall that there is an HTML tag that escapes absolutely everything inside it except the matching closing tag. Kind of like <a href="http://www.htmlref.com/reference/AppA/tag_plaintext.htm" rel="noreferrer"><code>&lt;plaintext&gt;</code></a> but not fundamentally broken.</p>
[ { "answer_id": 373337, "author": "EndangeredMassa", "author_id": 106, "author_profile": "https://Stackoverflow.com/users/106", "pm_score": 5, "selected": true, "text": "<xmp>some stuff <tags></tags> too</xmp>\n" }, { "answer_id": 373389, "author": "Greg Hewgill", "author_...
2008/12/17
[ "https://Stackoverflow.com/questions/373324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
373,328
<p>During development (and for debugging) it is very useful to run a Java class' <em>public static void main(String[] argv)</em> method directly from inside Eclipse (using the Run As context menu).</p> <p>Is there a similarily quick way to specify command line parameters for the run? What I do now is go to the "Run D...
[ { "answer_id": 374220, "author": "Esko", "author_id": 44523, "author_profile": "https://Stackoverflow.com/users/44523", "pm_score": 4, "selected": false, "text": "Run -> Run configurations..." }, { "answer_id": 374260, "author": "Romain Linsolas", "author_id": 26457, ...
2008/12/17
[ "https://Stackoverflow.com/questions/373328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14955/" ]
373,335
<p>I'm looking for a library in Python which will provide <code>at</code> and <code>cron</code> like functionality.</p> <p>I'd quite like have a pure Python solution, rather than relying on tools installed on the box; this way I run on machines with no cron.</p> <p>For those unfamiliar with <code>cron</code>: you can...
[ { "answer_id": 374207, "author": "Brian", "author_id": 9493, "author_profile": "https://Stackoverflow.com/users/9493", "pm_score": 6, "selected": false, "text": "from datetime import datetime, timedelta\nimport time\n\n# Some utility classes / functions first\nclass AllMatch(set):\n \...
2008/12/17
[ "https://Stackoverflow.com/questions/373335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4737/" ]
373,342
<p>I have a line of Fortran code, which includes some text. I'm changing the text, which makes the code line too long for Fortran, so I split it over two lines using 'a'. </p> <p>Was:</p> <pre><code> IF (MYVAR .EQ. 1) THEN WRITE(iott,'(A) (A)') 'ABC=', SOMEVAR </code></pre> <p>Changed to:</p> <pre><code> IF (...
[ { "answer_id": 373424, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 0, "selected": false, "text": "a" }, { "answer_id": 373600, "author": "Scottie T", "author_id": 6688, "author_profile": "https://S...
2008/12/17
[ "https://Stackoverflow.com/questions/373342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,351
<p><strong>The situation:</strong></p> <p>I need to convert our current development environment from Windows&nbsp;XP 32-bit to Windows&nbsp;Vista 64-bit (*). Naturally, I've run into plenty of places in our build system where hardcoded paths were problematic (e.g. "<code>C:\Program Files</code>" becoming "<code>C:\Pro...
[ { "answer_id": 373583, "author": "Benoit Miller", "author_id": 46807, "author_profile": "https://Stackoverflow.com/users/46807", "pm_score": 1, "selected": false, "text": "cmd.exe" }, { "answer_id": 437548, "author": "Die in Sente", "author_id": 40756, "author_profile...
2008/12/17
[ "https://Stackoverflow.com/questions/373351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46807/" ]
373,357
<p>Is there any way to get the exposure settings (aperture, shutter speed, ISO) for a photo taken on an iPhone?</p> <p>An app running on the iPhone can use the UIImagePickerController interface for taking pictures, but that doesn't provide much info about the picture.</p> <p>The EXIF data for a photo taken on the iPh...
[ { "answer_id": 373583, "author": "Benoit Miller", "author_id": 46807, "author_profile": "https://Stackoverflow.com/users/46807", "pm_score": 1, "selected": false, "text": "cmd.exe" }, { "answer_id": 437548, "author": "Die in Sente", "author_id": 40756, "author_profile...
2008/12/17
[ "https://Stackoverflow.com/questions/373357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175/" ]
373,365
<p>I want to write out a text file.</p> <p>Instead of the default UTF-8, I want to write it encoded as ISO-8859-1 which is code page 28591. I have no idea how to do this...</p> <p>I'm writing out my file with the following very simple code:</p> <pre><code>using (StreamWriter sw = File.CreateText(myfilename)) { s...
[ { "answer_id": 373368, "author": "Steven Behnke", "author_id": 42588, "author_profile": "https://Stackoverflow.com/users/42588", "pm_score": -1, "selected": false, "text": "sw.Encoding = Encoding.GetEncoding(28591);\n" }, { "answer_id": 373372, "author": "Dave Markle", "a...
2008/12/17
[ "https://Stackoverflow.com/questions/373365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44004/" ]
373,366
<p>I'm having an issue setting up one of my projects in TeamCity (v4.0), specifically when it comes to using Object Initializers.</p> <p>The project builds fine normally, however it would seem that TeamCity transforms the build file into something it likes (some MSBuild mutation) and when it comes to compiling the cod...
[ { "answer_id": 373422, "author": "Mike Two", "author_id": 23659, "author_profile": "https://Stackoverflow.com/users/23659", "pm_score": 3, "selected": true, "text": "<msbuild project=\"SimpleEcho.v35.proj\">\n <!-- this property enables MSBuild 3.5 -->\n <property name=\"teamcity_dot...
2008/12/17
[ "https://Stackoverflow.com/questions/373366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18434/" ]
373,370
<p>The best I can come up with for now is this monstrosity:</p> <pre><code>&gt;&gt;&gt; datetime.utcnow() \ ... .replace(tzinfo=pytz.UTC) \ ... .astimezone(pytz.timezone("Australia/Melbourne")) \ ... .replace(hour=0,minute=0,second=0,microsecond=0) \ ... .astimezone(pytz.UTC) \ ... .replace(tzinfo=None) date...
[ { "answer_id": 373379, "author": "Ignacio Vazquez-Abrams", "author_id": 20862, "author_profile": "https://Stackoverflow.com/users/20862", "pm_score": 0, "selected": false, "text": ">>> time.gmtime()\n(2008, 12, 17, 1, 16, 46, 2, 352, 0)\n>>> time.localtime()\n(2008, 12, 16, 20, 16, 47, 1...
2008/12/17
[ "https://Stackoverflow.com/questions/373370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3715/" ]
373,383
<p>I'm using python and I need to map locations like "Bloomington, IN" to GPS coordinates so I can measure distances between them. What Geocoding libraries/APIs do you recommend? Solutions in other languages are also welcome.</p>
[ { "answer_id": 4514033, "author": "xster", "author_id": 167638, "author_profile": "https://Stackoverflow.com/users/167638", "pm_score": 3, "selected": false, "text": "print Geocoder.geocode(\"Montreal, Canada\")[0].coordinates\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/373383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/280/" ]
373,386
<p>I have a block of code that is repeated within a DB2 stored procedure. I would like to separate this out into a new procedure that I can call with parameters and have it return a value.</p> <p>How do I create a procedure to return a value and how do I call this procedure from inside my original procedure?</p>
[ { "answer_id": 376425, "author": "molasses", "author_id": 11293, "author_profile": "https://Stackoverflow.com/users/11293", "pm_score": 3, "selected": false, "text": "CREATE PROCEDURE myschema.add(IN a INT, IN b INT, OUT c INT)\nBEGIN\n SET c = a + b;\nEND\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/373386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11293/" ]
373,387
<p>For a project I am doing I need to manually create a .net project. I am currently using a <code>StreamWriter</code> to create the .sln, .csproj and base (empty for now) class. I am also generating the AssemblyInfo.cs class. I have copied exactly the files and folder structure VS.Net creates when you create an empty ...
[ { "answer_id": 376425, "author": "molasses", "author_id": 11293, "author_profile": "https://Stackoverflow.com/users/11293", "pm_score": 3, "selected": false, "text": "CREATE PROCEDURE myschema.add(IN a INT, IN b INT, OUT c INT)\nBEGIN\n SET c = a + b;\nEND\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/373387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4244/" ]
373,388
<p>I'll soon be working on a large c# project and would like to build in multi-language support from the start. I've had a play around and can get it working using a separate resource file for each language, then use a resource manager to load up the strings.</p> <p>Are there any other good approaches that I could loo...
[ { "answer_id": 4333182, "author": "JxXx", "author_id": 315333, "author_profile": "https://Stackoverflow.com/users/315333", "pm_score": 2, "selected": false, "text": "public partial class App : Application \n{ \n public App() \n { \n } \n \n protected overr...
2008/12/17
[ "https://Stackoverflow.com/questions/373388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74652/" ]
373,395
<p>I am a Java programmer and need to work on a Flex/ActionScript project right now. I got an example of using ITreeDataDesriptor from Flex 3 Cookbook, but there is one line of actionscript code that's hard for me to understand. I appreciate if someone could explain this a little further. </p> <pre><code>public functi...
[ { "answer_id": 373423, "author": "Luke", "author_id": 21406, "author_profile": "https://Stackoverflow.com/users/21406", "pm_score": 1, "selected": false, "text": "var myobject = {\n 'prop1': 100,\n 'prop2': {\n 'a': 1\n }\n}\n\ntrace( myobject.prop1 ); // 100\ntrace( myobjec...
2008/12/17
[ "https://Stackoverflow.com/questions/373395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/455772/" ]
373,419
<p>What is the difference between </p> <ol> <li>a parameter passed by reference</li> <li>a parameter passed by value?</li> </ol> <p>Could you give me some examples, please?</p>
[ { "answer_id": 373429, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 7, "selected": false, "text": "ref" }, { "answer_id": 373455, "author": "pyon", "author_id": 46571, "author_profile": ...
2008/12/17
[ "https://Stackoverflow.com/questions/373419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,421
<p>I have analyzed a hibernate generated oracle database and discovered that a delete of a row from a single table will spawn the firing of 1200+ triggers in order to delete the related rows in child tables. The triggers are all auto-generated the same - an automatic delete of a child row without checking for existence...
[ { "answer_id": 373466, "author": "Ricardo Villamil", "author_id": 19314, "author_profile": "https://Stackoverflow.com/users/19314", "pm_score": 0, "selected": false, "text": "DECLARE \nX NUMBER;\nBEGIN\n SELECT COUNT(*) INTO X FROM DBA_OBJECTS WHERE OBJECT_TYPE = 'TRIGGER' AND OB...
2008/12/17
[ "https://Stackoverflow.com/questions/373421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,449
<p>I have a Delphi 2009 program that handles a lot of data and needs to be as fast as possible and not use too much memory.</p> <p>What <strong>small simple</strong> changes have you made to your Delphi code that had the biggest impact on the performance of your program by noticeably reducing execution time or memory ...
[ { "answer_id": 373806, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 2, "selected": false, "text": "TQuery" }, { "answer_id": 1198694, "author": "Guy Gordon", "author_id": 652328, "author_profile": ...
2008/12/17
[ "https://Stackoverflow.com/questions/373449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30176/" ]
373,454
<p>The code</p> <pre><code>&lt;%=Html.CheckBox("SendEmail") %&gt; </code></pre> <p>evaluates to two HTML elements when it's rendered</p> <pre><code>&lt;input id="SendEmail" name="SendEmail" type="checkbox" value="true" /&gt; &lt;input name="SendEmail" type="hidden" value="false" /&gt; </code></pre> <p>Is this by ...
[ { "answer_id": 374632, "author": "Craig Stuntz", "author_id": 7714, "author_profile": "https://Stackoverflow.com/users/7714", "pm_score": 2, "selected": false, "text": " // Render an additional <input type=\"hidden\".../> for checkboxes. This\n // addresses scenario...
2008/12/17
[ "https://Stackoverflow.com/questions/373454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
373,459
<p>I'd like to split a string using one or more separator characters.</p> <p>E.g. "a b.c", split on " " and "." would give the list ["a", "b", "c"].</p> <p>At the moment, I can't see anything in the standard library to do this, and my own attempts are a bit clumsy. E.g.</p> <pre><code>def my_split(string, split_char...
[ { "answer_id": 373474, "author": "Ignacio Vazquez-Abrams", "author_id": 20862, "author_profile": "https://Stackoverflow.com/users/20862", "pm_score": 6, "selected": true, "text": ">>> import re\n>>> re.split('[ .]', 'a b.c')\n['a', 'b', 'c']\n" }, { "answer_id": 373576, "auth...
2008/12/17
[ "https://Stackoverflow.com/questions/373459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29903/" ]
373,462
<p>I'm trying to do a simple erase and keep getting errors.</p> <p>Here is the snippet of code for my erase:</p> <pre><code>std::list&lt;Mine*&gt;::iterator iterMines = mines.begin(); for(int i = oldSizeOfMines; i &gt;0 ; i--, iterMines++) { if(player-&gt;distanceFrom(*iterMines) &lt; radiusOfOnScreen) { ...
[ { "answer_id": 373505, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 2, "selected": false, "text": "std::list<Mine*>::iterator iterMines = mines.begin();\nfor(int i = oldSizeOfMines; i >0 ; i--, iterMines++)...
2008/12/17
[ "https://Stackoverflow.com/questions/373462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39189/" ]
373,490
<p>We are building a query to count the number of events per hour, per day. Most days there are hours that do not have any activity and therefore where the query is run the count of activities per hour show up but there are gaps and the query excludes these. We still want to show the hours that do not have activity and...
[ { "answer_id": 373509, "author": "Dave Markle", "author_id": 24995, "author_profile": "https://Stackoverflow.com/users/24995", "pm_score": 2, "selected": false, "text": "DECLARE @MinDate DATETIME;\nSET @MinDate = CONVERT(varchar, GETDATE(), 101);\n\nWITH times AS (\n SELECT @MinDate ...
2008/12/17
[ "https://Stackoverflow.com/questions/373490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,518
<p>Using the Java URL class, I can connect to an external <code>HTTPS</code> server (such as our production site), but using a local URL I get following exception. </p> <pre><code>"SunCertPathBuilderException: unable to find valid certification path to requested target". </code></pre> <p>How do I get a valid certifi...
[ { "answer_id": 373526, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 0, "selected": false, "text": "try {\n int port = 443;\n ServerSocketFactory ssocketFactory = SSLServerSocketFactory.getDefault();\n Serv...
2008/12/17
[ "https://Stackoverflow.com/questions/373518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/943/" ]
373,520
<p>I have a program in Perl I'm working on where I would need multiple keys, and a way of giving each key multiple values and follow that by being able to both read them in and write them out to an external file depending on if the key matches what the person enters into standard input. I've looked across several sites...
[ { "answer_id": 373553, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 5, "selected": true, "text": "#!/bin/perl -w\nuse strict;\nuse Data::Dumper;\n\nmy(%hash);\n\n$hash{key1} = [ 1, \"b\", \"c\" ];\n$hash{key2} = ...
2008/12/17
[ "https://Stackoverflow.com/questions/373520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,541
<p>I need to do a LINQ2DataSet query that does a join on more than one field (as</p> <pre><code>var result = from x in entity join y in entity2 on x.field1 = y.field1 and x.field2 = y.field2 </code></pre> <p>I have yet found a suitable solution (I can add the extra constraints to a where clause, b...
[ { "answer_id": 373550, "author": "KristoferA", "author_id": 11241, "author_profile": "https://Stackoverflow.com/users/11241", "pm_score": 7, "selected": false, "text": "var result = from x in entity\n join y in entity2 on new { x.field1, x.field2 } equals new { y.field1, y.field2 }\n" ...
2008/12/17
[ "https://Stackoverflow.com/questions/373541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5302/" ]
373,589
<p>I'm playing with the new geography column in SQL Server 2008 and the STGeomFromText function. Here is my code (works with AdventureWorks2008)</p> <pre><code>DECLARE @region geography; set @region = geography::STGeomFromText('POLYGON(( -80.0 50.0, -90.0 50.0, -90.0 25.0, -80.0 25.0, -80.0 50...
[ { "answer_id": 3566801, "author": "Andy Jones", "author_id": 5096, "author_profile": "https://Stackoverflow.com/users/5096", "pm_score": 1, "selected": false, "text": "select srs.unit_of_measure from sys.spatial_reference_systems as srs where srs.spatial_reference_id = 4326" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/373589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9443/" ]
373,599
<p>I am using a route like this one:</p> <pre><code>routes.MapRoute("Invoice-New-NewCustomer", "Invoice/New/Customer/New/{*name}", new { controller = "Customer", action = "NewInvoice" }, new { name = @"[^\.]*" }); </code></pre> <p>There is an action which handles this route:</p> <pre><code>public ActionR...
[ { "answer_id": 373640, "author": "EndangeredMassa", "author_id": 106, "author_profile": "https://Stackoverflow.com/users/106", "pm_score": 2, "selected": false, "text": "Server.URLencode(strURL)\n" }, { "answer_id": 375718, "author": "Haacked", "author_id": 598, "auth...
2008/12/17
[ "https://Stackoverflow.com/questions/373599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1195872/" ]
373,605
<p>How do I load a dropdown list in asp.net and c#?</p>
[ { "answer_id": 373608, "author": "keithwarren7", "author_id": 40714, "author_profile": "https://Stackoverflow.com/users/40714", "pm_score": 1, "selected": false, "text": "DropDownLists" }, { "answer_id": 373614, "author": "ChadT", "author_id": 23300, "author_profile":...
2008/12/17
[ "https://Stackoverflow.com/questions/373605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,615
<p><strong>The question, in brief:</strong></p> <p>In MVC, how do you distinguish between a checkbox click (or a selectbox or listbox change) from a human meaning "Controller, modify the model", and a checkbox click (or a selectbox or listbox change) from the Controller meaning "I'm updating the view because the model...
[ { "answer_id": 375619, "author": "Juliet", "author_id": 40516, "author_profile": "https://Stackoverflow.com/users/40516", "pm_score": 0, "selected": false, "text": "\npublic interface GraphView\n{\n event Action ToggleEdge;\n}\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/373615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4105/" ]
373,623
<p>This database will store a list of children. But the problem is, they will have their weight measured once a day. How can I store the changes so I can easily query their actual weight and the weight variation over one day, one week and one month?</p>
[ { "answer_id": 373633, "author": "warren", "author_id": 4418, "author_profile": "https://Stackoverflow.com/users/4418", "pm_score": 4, "selected": true, "text": "table kid\n int pkey(id)\n text name\n\ntable weight\n date when\n int kidid fkey(kid.id)\n int weight\n int...
2008/12/17
[ "https://Stackoverflow.com/questions/373623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46921/" ]
373,626
<p>In all my projects till now, I use to use singleton pattern to access Application configuration throughout the application. Lately I see lot of articles taking about not to use singleton pattern , because this pattern does not promote of testability also it hides the Component dependency. My question is what is th...
[ { "answer_id": 373645, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 6, "selected": true, "text": "Lazy<T>" }, { "answer_id": 599126, "author": "Protagonist", "author_id": 460006, "author_profile": "...
2008/12/17
[ "https://Stackoverflow.com/questions/373626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46922/" ]
373,639
<p>I'm trying to run an interactive command through paramiko. The cmd execution tries to prompt for a password but I do not know how to supply the password through paramiko's exec_command and the execution hangs. Is there a way to send values to the terminal if a cmd execution expects input interactively?</p> <pre><...
[ { "answer_id": 373742, "author": "monkut", "author_id": 24718, "author_profile": "https://Stackoverflow.com/users/24718", "pm_score": 2, "selected": false, "text": "ssh_stdin.write('input value')\nssh_stdin.flush()\n" }, { "answer_id": 373870, "author": "James Brady", "au...
2008/12/17
[ "https://Stackoverflow.com/questions/373639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46920/" ]
373,643
<p>I'm trying to center a page and then make it <code>100%</code> in height. I have a div called "content" as the parent element of all elements in the HTML page. What do I need to do next? I'd like to stay away from any CSS-hacks. This is currently working in IE7, but not in Firefox 3.</p> <p><strong>EDIT:</strong> I...
[ { "answer_id": 373703, "author": "fasih.rana", "author_id": 46024, "author_profile": "https://Stackoverflow.com/users/46024", "pm_score": 0, "selected": false, "text": "body\n{\n background-color: #000;\n text-align: center; \n margin-top: 0px;\n margin-left: auto;\n margi...
2008/12/17
[ "https://Stackoverflow.com/questions/373643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36590/" ]