qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
296,025
<p>I am preparing a project proposal for a client who wants to publish video in his website. I need to define which video formats will be allowed, which video sizes, as well as the necessary tools for conversion and preparation. </p> <p>I have no experience with embedding video in websites so which markup do I need to...
[ { "answer_id": 296098, "author": "rich", "author_id": 25502, "author_profile": "https://Stackoverflow.com/users/25502", "pm_score": 0, "selected": false, "text": "<embed src=\"http://aaa/bbb/ccc/myVideo.wmv\" type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/...
2008/11/17
[ "https://Stackoverflow.com/questions/296025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2138/" ]
296,036
<p>If a large module is loaded by some submodule of your code, is there any benefit to referencing the module from that namespace instead of importing it again?</p> <p>For example: I have a module MyLib, which makes extensive use of ReallyBigLib. If I have code that imports MyLib, should I dig the module out like so</...
[ { "answer_id": 296062, "author": "Toni Ruža", "author_id": 6267, "author_profile": "https://Stackoverflow.com/users/6267", "pm_score": 7, "selected": true, "text": "import MyLib\nimport ReallyBigLib\n" }, { "answer_id": 298106, "author": "Charles Merriam", "author_id": 13...
2008/11/17
[ "https://Stackoverflow.com/questions/296036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32880/" ]
296,055
<p>Let's say I want to create the alias %xed for %edit -x. How would I do it?</p>
[ { "answer_id": 296334, "author": "Igal Serban", "author_id": 25737, "author_profile": "https://Stackoverflow.com/users/25737", "pm_score": 3, "selected": true, "text": "def ed_xed(self,arg):\n ip = self.api\n return ip.magic.im_class.magic_edit(ip.IP,\" -x %s \"%arg)\n\nip.expose_m...
2008/11/17
[ "https://Stackoverflow.com/questions/296055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1512/" ]
296,090
<p>I am using C# and DSL Tools for VS2005. </p> <p>I need to create Transactions to change some data but i want them to be hidden from the user, that means, to not show in the UNDO list in VS2005.</p> <p>I tried by disabling the UndoManager</p> <pre><code>store.UndoManager.UndoState = UndoState.Disabled; </code></pr...
[ { "answer_id": 412905, "author": "Apóstolo", "author_id": 24099, "author_profile": "https://Stackoverflow.com/users/24099", "pm_score": 2, "selected": true, "text": "store.UndoManager.UndoState = UndoState.Disabled store.UndoManager.UndoState = UndoState.DisabledNoFlush;" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20335/" ]
296,096
<p>I'm writing code in Java, using the NetBeans IDE. I keep getting a couple of "Incompatible Type" errors. I declare a variable as String and then assign to it the value from a method that returns a String too. The error says that there was expected a type of "String" but instead found "..." where "..." the name of th...
[ { "answer_id": 296106, "author": "toolkit", "author_id": 3295, "author_profile": "https://Stackoverflow.com/users/3295", "pm_score": 0, "selected": false, "text": "string java.lang.String" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
296,097
<p>we're dealing with a very slow update statement in an Oracle project.</p> <p>Here's a little script to replciate the issue:</p> <pre><code>drop table j_test; CREATE TABLE J_TEST ( ID NUMBER(10) PRIMARY KEY, C1 VARCHAR2(50 BYTE), C2 VARCHAR2(250 BYTE), C3 NUMBER(5), C4 NUMBER(10) ); -- just ins...
[ { "answer_id": 296123, "author": "Gordon Bell", "author_id": 16473, "author_profile": "https://Stackoverflow.com/users/16473", "pm_score": 2, "selected": false, "text": "insert into j_test (id, C3, C4)\nselect rownum, 1, 'NEU'\nfrom <dummy_table>\nwhere rownum < 100000;\n" }, { "...
2008/11/17
[ "https://Stackoverflow.com/questions/296097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25320/" ]
296,116
<p>I am implementing web services for a PHP application and am trying to understand what both standard web services and RESTful web services have to offer. My intent is to write wrapper code to abstract away the web service details so that developers can just "instantiate remote objects" and use them. Here are my thou...
[ { "answer_id": 296170, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 4, "selected": true, "text": "var someResult = proxy.SubmitOrder(...);\n var qry = from user in ctx.Users\n where user.State == 'CO'\n ...
2008/11/17
[ "https://Stackoverflow.com/questions/296116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4639/" ]
296,133
<p>I'm astonished that the <a href="http://commons.apache.org/collections/" rel="nofollow noreferrer">Apache Commons Collections</a> project still hasn't got around to making their library generics-aware. I really like the features provided by this library, but the lack of support for generics is a big turn-off. There ...
[ { "answer_id": 4647248, "author": "linuxbuild", "author_id": 241776, "author_profile": "https://Stackoverflow.com/users/241776", "pm_score": 1, "selected": false, "text": "org.apache.commons.collections org.apache.commons.collections15 commons-collections-3.2.1.jar collections-generic-4....
2008/11/17
[ "https://Stackoverflow.com/questions/296133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2648/" ]
296,146
<p>I am sure making a silly mistake but I can't figure what:</p> <p>In SQL Server 2005 I am trying select all customers except those who have made a reservation before 2 AM.</p> <p>When I run this query:</p> <pre><code>SELECT idCustomer FROM reservations WHERE idCustomer NOT IN (SELECT distinct idCustomer FROM r...
[ { "answer_id": 296158, "author": "Amy B", "author_id": 8155, "author_profile": "https://Stackoverflow.com/users/8155", "pm_score": 7, "selected": true, "text": "SELECT distinct idCustomer FROM reservations\nWHERE DATEPART ( hour, insertDate) < 2\n and idCustomer is not null\n WHERE fiel...
2008/11/17
[ "https://Stackoverflow.com/questions/296146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4264/" ]
296,147
<p>I have a web service class that the rest of the framework depends on to grab its data, but the web service class needs to have different method attributes depending on what environment it's in. For instance...</p> <pre><code>[SoapDocumentMethodAttribute("https://example",...)] public string Test() { //doSomethi...
[ { "answer_id": 296185, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 3, "selected": true, "text": "#if TESTING\n [SoapDocumentMethodAttribute(something)]\n#else\n [SoapDocumentMethodAttribute(someoth...
2008/11/17
[ "https://Stackoverflow.com/questions/296147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212/" ]
296,148
<p>I have the following div layout:</p> <img src="https://i.stack.imgur.com/bZSnA.jpg"> <p>Everything is fine when I put normal txt elements in both the blue and the orange div. However, when I place an image in the orange div (which is 31px), the elements in the blue div get pushed down by about half the height of...
[ { "answer_id": 296166, "author": "Pim Jager", "author_id": 35197, "author_profile": "https://Stackoverflow.com/users/35197", "pm_score": 0, "selected": false, "text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" }, { ...
2008/11/17
[ "https://Stackoverflow.com/questions/296148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28871/" ]
296,150
<p>Many times I saw logging of errors like these:</p> <pre><code>System.out.println("Method aMethod with parameters a:"+a+" b: "+b); print("Error in line 88"); </code></pre> <p>so.. What are the best practices to log an error?</p> <p><strong>EDIT:</strong></p> <p>This is java but could be C/C++, basic, etc.</p>
[ { "answer_id": 296194, "author": "adam", "author_id": 33604, "author_profile": "https://Stackoverflow.com/users/33604", "pm_score": 2, "selected": false, "text": "log.warning(\"..\");\nlog.fine(\"..\");\nlog.finer(\"..\");\nlog.finest(\"..\");\n log.log(Level.WARNING, \"blah blah blah\",...
2008/11/17
[ "https://Stackoverflow.com/questions/296150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24639/" ]
296,173
<p>I'd like to copy the files that have a specific file extension to a new folder. I have an idea how to use <code>os.walk</code> but specifically how would I go about using that? I'm searching for the files with a specific file extension in only one folder (this folder has 2 subdirectories but the files I'm looking fo...
[ { "answer_id": 296184, "author": "Federico A. Ramponi", "author_id": 18770, "author_profile": "https://Stackoverflow.com/users/18770", "pm_score": 6, "selected": true, "text": "import glob, os, shutil\n\nfiles = glob.iglob(os.path.join(source_dir, \"*.ext\"))\nfor file in files:\n if ...
2008/11/17
[ "https://Stackoverflow.com/questions/296173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37804/" ]
296,182
<p>In the standard PrintDialog there are four values associated with a selected printer: Status, Type, Where, and Comment.</p> <p>If I know a printer's name, how can I get these values in C# 2.0?</p>
[ { "answer_id": 296298, "author": "Powerlord", "author_id": 15880, "author_profile": "https://Stackoverflow.com/users/15880", "pm_score": 5, "selected": false, "text": "using System.Drawing.Printing;\n PrinterSettings ps = new PrinterSettings();\nps.PrinterName = \"The printer name\"; // ...
2008/11/17
[ "https://Stackoverflow.com/questions/296182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38258/" ]
296,199
<p>I looked at the different options for plotting functions (or other types of graphs) in an interactive window. I mostly use wxWidgets but I'd be open to any other "interfaces". </p> <h2><strong>Looking at what is available, here is what I've found</strong>:</h2> <p><strong>wxPlot</strong>: Not updated since 2006. B...
[ { "answer_id": 391215, "author": "Gant", "author_id": 12460, "author_profile": "https://Stackoverflow.com/users/12460", "pm_score": 3, "selected": false, "text": "system()" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38290/" ]
296,230
<p>In javascript, I've got a block of HTML like this:</p> <pre><code>&lt;h2&gt;{title}&lt;/h2&gt; &lt;p&gt;&lt;a href="{url}"&gt;{content}&lt;/a&gt;&lt;/p&gt; </code></pre> <p>And I'm trying use regex "match" to spit out an array of all the {item}'s. So my output should look like:</p> <pre><code>['title', 'url', 'co...
[ { "answer_id": 296235, "author": "grieve", "author_id": 34329, "author_profile": "https://Stackoverflow.com/users/34329", "pm_score": 2, "selected": false, "text": "var pattern = new RegExp(\"\\{[a-zA-Z]+\\}+\", \"g\");\n" }, { "answer_id": 296266, "author": "Jan Goyvaerts", ...
2008/11/17
[ "https://Stackoverflow.com/questions/296230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38241/" ]
296,251
<p>I have a set of classes, each one is a different <a href="http://en.wikipedia.org/wiki/Strategy_pattern" rel="noreferrer">strategy</a> to do the same work. </p> <pre><code>namespace BigCorp.SuperApp { public class BaseClass { } public class ClassA : BaseClass { } public class ClassB : BaseClass { } } </...
[ { "answer_id": 296260, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 4, "selected": false, "text": "Assembly.GetType(name) Assembly assembly = typeof(SomeKnownType).Assembly; // in the same assembly!\nType type = asse...
2008/11/17
[ "https://Stackoverflow.com/questions/296251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3619/" ]
296,256
<p>I am looking for a Windows based library which can be used for parsing a bunch of C files to list global and local variables. The global and local variables may be declared using typedef. The output (i.e. list of global and local variables) can then be used for post processing (e.g. replacing the variable names with...
[ { "answer_id": 296965, "author": "qrdl", "author_id": 28494, "author_profile": "https://Stackoverflow.com/users/28494", "pm_score": 0, "selected": false, "text": "lex yacc" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30289/" ]
296,261
<p>When I try using a <code>Name="id"</code> and\or <code>x:name="id"</code> I get a compiler error:</p> <pre><code>The Type 'MyName' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. </code></pre> <p>When I don't have this specified my control ru...
[ { "answer_id": 296296, "author": "Kent Boogaart", "author_id": 5380, "author_profile": "https://Stackoverflow.com/users/5380", "pm_score": 0, "selected": false, "text": "ContentControl" }, { "answer_id": 343452, "author": "Miral", "author_id": 43534, "author_profile":...
2008/11/17
[ "https://Stackoverflow.com/questions/296261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/805/" ]
296,263
<p>What is the <code>@</code> symbol mean in <a href="/questions/tagged/oracle" class="post-tag" title="show questions tagged &#39;oracle&#39;" rel="tag">oracle</a>? </p> <p>For example:</p> <pre><code>select * from question_answer@abcd where id = '45' </code></pre>
[ { "answer_id": 296331, "author": "a2800276", "author_id": 27408, "author_profile": "https://Stackoverflow.com/users/27408", "pm_score": 6, "selected": true, "text": "select * from question_answer@abcd where id = '45'\n question_answer abcd dblink" }, { "answer_id": 296332, "a...
2008/11/17
[ "https://Stackoverflow.com/questions/296263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
296,264
<p>In EL expressions, used in a jsp page, strings are taken literally. For example, in the following code snippet</p> <pre><code>&lt;c:when test="${myvar == 'prefix.*'}"&gt; </code></pre> <p>test does not evaluate to true if the value of myvar is 'prefixxxxx.' Does anyone know if there is a way to have the string ...
[ { "answer_id": 296324, "author": "lucas", "author_id": 31172, "author_profile": "https://Stackoverflow.com/users/31172", "pm_score": 3, "selected": false, "text": "<c:when test=\"${fn:startsWith(myVar, 'prefix')}\">\n" }, { "answer_id": 296712, "author": "erickson", "auth...
2008/11/17
[ "https://Stackoverflow.com/questions/296264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1094969/" ]
296,268
<p>I'm thinking about starting work on a fairly large scale .NET or ASP.NET project (I haven't decided yet, but it is likely that, eventually, it will be accessible from both a desktop application written in .NET as well as an ASP.NET web application). However, I'm not sure if there's a conventional way to structure th...
[ { "answer_id": 309827, "author": "Keith G", "author_id": 5208, "author_profile": "https://Stackoverflow.com/users/5208", "pm_score": 1, "selected": false, "text": "projectname/\n /source/\n /source/projectname.sln\n /source/DataAccess/\n /source/Da...
2008/11/17
[ "https://Stackoverflow.com/questions/296268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
296,270
<p>I apologize in advance if this question seems remedial.</p> <p>Which would be considered more efficient in Python:</p> <p><strong>Standard import</strong></p> <pre><code>import logging try: ...some code... exception Exception, e: logging.error(e) </code></pre> <p>...or...</p> <p><strong>Contextual import</...
[ { "answer_id": 296292, "author": "mipadi", "author_id": 28804, "author_profile": "https://Stackoverflow.com/users/28804", "pm_score": 2, "selected": false, "text": "import" }, { "answer_id": 296380, "author": "S.Lott", "author_id": 10661, "author_profile": "https://St...
2008/11/17
[ "https://Stackoverflow.com/questions/296270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10040/" ]
296,283
<p>The "ATL simple object" wizard doesn't provide a way to specify that a new class is derived from an existing coclass and its interface. In Visual Studio 2008, how do I make a new ATL COM class derived from an existing one (i.e. <code>Base</code> implements <code>IBase</code>, and I want to make a new <code>Derived</...
[ { "answer_id": 375067, "author": "computinglife", "author_id": 17224, "author_profile": "https://Stackoverflow.com/users/17224", "pm_score": 1, "selected": false, "text": "CBaseLogic : IBase\n\nclass ATL_NO_VTABLE CBase :\n public CComObjectRootEx<CComSingleThreadModel>,\n public C...
2008/11/17
[ "https://Stackoverflow.com/questions/296283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22820/" ]
296,284
<p>I would like to create dynamic urls that route to controller actions with an Id value. I've created the following route using a catch-all parameter</p> <pre><code>routes.MapRoute( "RouteName", "{id}/{*Url}", new { controller = "Con...
[ { "answer_id": 300635, "author": "Doug Wilson", "author_id": 32588, "author_profile": "https://Stackoverflow.com/users/32588", "pm_score": 1, "selected": false, "text": "routes.MapRoute(\"Default\", \"{*token}\", \n new { controller = \"Home\", action = \"Index\", token = 0 });\n [Han...
2008/11/17
[ "https://Stackoverflow.com/questions/296284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
296,294
<p>How do I install a specific package, like derbytools, with Maven without specifying it as a dependency of project?</p>
[ { "answer_id": 296315, "author": "rich", "author_id": 25502, "author_profile": "https://Stackoverflow.com/users/25502", "pm_score": 2, "selected": false, "text": "mvn install mvn install:install-file -DgroupId=%DERBYTOOLS_GROUP_ID% \\ \n -DartifactId=%DERBYTOOLS_ARTIFACT_ID% \\\n -...
2008/11/17
[ "https://Stackoverflow.com/questions/296294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6068/" ]
296,309
<p>The following code is just a simplified example to demonstrate my problem:</p> <pre><code>using System; using System.IO; using System.Diagnostics; using System.Threading; namespace ConsoleApplication5 { class Program { static string LogFile = @"C:\test.log"; static void Main(string[] args)...
[ { "answer_id": 10818164, "author": "William", "author_id": 1426251, "author_profile": "https://Stackoverflow.com/users/1426251", "pm_score": 1, "selected": false, "text": "SyncLock queue" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296309", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043/" ]
296,312
<p>I'm using Spring's dependency injection but I'm running into difficulty loading a resource in my Spring config file. </p> <p>The resource is an XML file and is in a JAR file on my classpath. I try to access it as follows:</p> <pre><code>&lt;import resource="classpath:com/config/resources.xml" /&gt; </code></pre> ...
[ { "answer_id": 296357, "author": "toolkit", "author_id": 3295, "author_profile": "https://Stackoverflow.com/users/3295", "pm_score": 4, "selected": true, "text": "<listener>\n <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>\n</listener>\n\n<conte...
2008/11/17
[ "https://Stackoverflow.com/questions/296312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24481/" ]
296,325
<p>I'm teaching Java EE at the university, and this was a question a student asked. I said "no", but I wasn't really sure, so I thought I might ask you mighty developers. :)</p> <p>Basically, what I'd like to do is to use entities if they were in my context: cat getters, setters, etc, so like normal POJOs. if I use an...
[ { "answer_id": 301673, "author": "jamesh", "author_id": 4737, "author_profile": "https://Stackoverflow.com/users/4737", "pm_score": -1, "selected": false, "text": "map.get()" }, { "answer_id": 303388, "author": "Varun Mehta", "author_id": 31537, "author_profile": "htt...
2008/11/17
[ "https://Stackoverflow.com/questions/296325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
296,333
<p>I have an importer process which is running as a windows service (debug mode as an application) and it processes various xml documents and csv's and imports into an SQL database. All has been well until I have have had to process a large amount of data (120k rows) from another table (as I do the xml documents).</p> ...
[ { "answer_id": 297367, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 1, "selected": false, "text": "COMMIT INSERT SELECT" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/258/" ]
296,366
<p>I have a directory full of files and I need to pull the headers and footers off of them. They are all variable length so using head or tail isn't going to work. Each file does have a line I can search for, but I don't want to include the line in the results.</p> <p>It's usually </p> <pre><code>*** Start (more text...
[ { "answer_id": 296385, "author": "Jonathan Lonowski", "author_id": 15031, "author_profile": "https://Stackoverflow.com/users/15031", "pm_score": 0, "selected": false, "text": "$ sed -i '/^\\*\\*\\* Start/,/^\\*\\*\\* Finish/d!' *\n $ sed -i -e '/./,/^\\*\\*\\* Start/d' -e '/^\\*\\*\\* Fi...
2008/11/17
[ "https://Stackoverflow.com/questions/296366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13704/" ]
296,398
<p>I have a List of beans, each of which has a property which itself is a List of email addresses.</p> <pre><code>&lt;c:forEach items="${upcomingSchedule}" var="conf"&gt; &lt;div class='scheduled' title="${conf.subject}" id="scheduled&lt;c:out value="${conf.id}"/&gt;"&gt; ... &lt;/div&gt; &lt;/c:forEach&gt...
[ { "answer_id": 296430, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 4, "selected": true, "text": "<c:forEach items=\"${upcomingSchedule}\" var=\"conf\">\n <c:set var=\"title\" value=\"${conf.subject}: \"/>\n <c:forEach...
2008/11/17
[ "https://Stackoverflow.com/questions/296398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4249/" ]
296,405
<p>I am writing an algorithm to find the dominating set of a tournament graph. Is the minimum spanning tree of a directed graph equivalent to the dominating set of the graph? In other words, if I find the smallest MST for the tournament graph (by iterating through all of the vertices), can I then say this is equivalent...
[ { "answer_id": 296445, "author": "DanJ", "author_id": 4697, "author_profile": "https://Stackoverflow.com/users/4697", "pm_score": 1, "selected": false, "text": "_ _" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27884/" ]
296,414
<p>I'm trying to unit test a page in my ASP.NET MVC application that, when posted to, will delete a user's item. I want to restrict this page so that it can only be posted to by the owner of said item. Originally, I wanted to just stick a quick check in the controller that checked if the HttpContext.Current.User.Iden...
[ { "answer_id": 296484, "author": "Zachary Yates", "author_id": 8360, "author_profile": "https://Stackoverflow.com/users/8360", "pm_score": 3, "selected": true, "text": "HttpContext.Current.User IPrincipal HttpContext.Current.User.Identity IIdentity" }, { "answer_id": 6752922, ...
2008/11/17
[ "https://Stackoverflow.com/questions/296414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
296,418
<p>I have a datagridview where the users can select which subset of columns to view. The problem I am having is that when I change the columns being displayed, the column widths are only being determined by the width of the Header Cells, not the data in it. I do have each column set to AutoSizeMode = AllCells.</p> <p...
[ { "answer_id": 296425, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": true, "text": "dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;\ndgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumns...
2008/11/17
[ "https://Stackoverflow.com/questions/296418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4779/" ]
296,455
<p>Is there a quick-and-dirty way to tell programmatically, in shell script or in Perl, whether a path is located on a remote filesystem (nfs or the like) or a local one? Or is the only way to do this to parse /etc/fstab and check the filesystem type?</p>
[ { "answer_id": 296507, "author": "Steve Baker", "author_id": 13566, "author_profile": "https://Stackoverflow.com/users/13566", "pm_score": 2, "selected": false, "text": "df -T $dir | tail -1 | awk '{print $2;}'\n" }, { "answer_id": 296542, "author": "Chris Dodd", "author_...
2008/11/17
[ "https://Stackoverflow.com/questions/296455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12204/" ]
296,458
<p>In the .xsd file for a typed DataSet in .NET, there's a <code>&lt;Connections&gt;</code> section that contains a list of any data connections I've used to set up the DataTables and TableAdapters.</p> <p>There are times when I'd prefer not to have those there. For instance, sometimes I prefer to pass in a connectio...
[ { "answer_id": 859682, "author": "Ole Lynge", "author_id": 41094, "author_profile": "https://Stackoverflow.com/users/41094", "pm_score": 2, "selected": false, "text": "public internal public sealed partial class Settings\n{\n [...]\n [global::System.Configuration.DefaultSettingValu...
2008/11/17
[ "https://Stackoverflow.com/questions/296458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5486/" ]
296,490
<p>I would like to remove two files from a folder at the conclusion of my script. Do I need to create a function responsible for removing these two specific files? I would like to know in some detail how to use os.remove (if that is what I should use) properly. These two files will always be discarded at the conclusion...
[ { "answer_id": 296495, "author": "mipadi", "author_id": 28804, "author_profile": "https://Stackoverflow.com/users/28804", "pm_score": -1, "selected": true, "text": "os.remove(\"path/to/file\") .emacs os.remove(\".emacs\")\n str" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37804/" ]
296,499
<p>Once I have all the files I require in a particular folder, I would like my python script to zip the folder contents. </p> <p>Is this possible? </p> <p>And how could I go about doing it?</p>
[ { "answer_id": 296565, "author": "Kozyarchuk", "author_id": 52490, "author_profile": "https://Stackoverflow.com/users/52490", "pm_score": 3, "selected": false, "text": "def zipfolder(path, relname, archive):\n paths = os.listdir(path)\n for p in paths:\n p1 = os.path.join(pa...
2008/11/17
[ "https://Stackoverflow.com/questions/296499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37804/" ]
296,501
<p>I am overriding a Grid, adding some customer features. One of the features is a drop-down to adjust page size. I am extending the grid using a customer server control, which works great for what I've done so far. Now, however I am having a bit of trouble getting the dynamically added control to do a postback. Th...
[ { "answer_id": 296509, "author": "John", "author_id": 30006, "author_profile": "https://Stackoverflow.com/users/30006", "pm_score": 3, "selected": true, "text": "pageSizeDropdown.AutoPostBack = true\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2017/" ]
296,503
<p>I have a user control where the XAML of the control can bind to the appropriate properties from the parent's data context like normal (the data context propagates in xaml). </p> <p>For example, I have a window whose DataContext I am setting to ObjectA for example. My user control within the window is then try to ac...
[ { "answer_id": 296614, "author": "Jobi Joy", "author_id": 8091, "author_profile": "https://Stackoverflow.com/users/8091", "pm_score": 4, "selected": false, "text": "public partial class UserControl1\n{\n public UserControl1()\n {\n this.InitializeComponent();\n\n //Da...
2008/11/17
[ "https://Stackoverflow.com/questions/296503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9401/" ]
296,517
<p>I need to pass an array from JavaScript to a page method in C#. I have tried using a parameter in the C# method of IList and also a string[] array. Both ways throw an exception "cannot convert an object of type system.string to xxx", where xxx is the parameter type in the C# method. I am passing the object from jQue...
[ { "answer_id": 296564, "author": "Powerlord", "author_id": 15880, "author_profile": "https://Stackoverflow.com/users/15880", "pm_score": 4, "selected": true, "text": "{\"testNumbers\": [5555555555,3333333333,4444444444]}\n" }, { "answer_id": 296574, "author": "PhilHoy", "...
2008/11/17
[ "https://Stackoverflow.com/questions/296517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1284/" ]
296,519
<p>I have shell script which starts with:</p> <pre><code>sdir=`dirname $0` sdir=`(cd "$sdir/"; pwd)` </code></pre> <p>And this usually gets expanded (with 'sh -h') into </p> <pre><code>++ dirname /opt/foo/bin/bar + sdir=/opt/foo/bin ++ cd /opt/foo/bin/ ++ pwd + sdir=/opt/foo/bin </code></pre> <p>but for single user...
[ { "answer_id": 296585, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 3, "selected": false, "text": "sdir=`dirname $0`\nsdir=`(cd \"$sdir/\" >/dev/null; pwd)`\n" }, { "answer_id": 906069, "author": "Aaron ...
2008/11/17
[ "https://Stackoverflow.com/questions/296519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
296,520
<p>I have a Win32 console application which is doing some computations, compiled in Compaq Visual Fortran (which probably doesn't matter). </p> <p>I need to run a lot of them simultaneously.</p> <p>In XP, they take around 90-100% CPU together, work very fast. In Vista, no matter how many of them I run, they take no m...
[ { "answer_id": 296691, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 2, "selected": false, "text": "c:\\temp> dir > output.log\n nul c:\\temp> dir > nul\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38325/" ]
296,525
<h1>Example</h1> <p>There is an application that measures temperature in each town of the world. Each measurement is taken every 5 minutes and written in to the Measurement table.</p> <pre><code>CREATE TABLE [dbo].[Measurement]( [MeasurementID] [int] IDENTITY(1,1) NOT NULL, [Town] [varchar](50) NOT NULL, [D...
[ { "answer_id": 296531, "author": "Andrew Rimmer", "author_id": 1982, "author_profile": "https://Stackoverflow.com/users/1982", "pm_score": 0, "selected": false, "text": "select s.*\nfrom Measurement s\nwhere exists ( \n select 1\n from Measurement s1\n where s.Town = s1.Town\n gr...
2008/11/17
[ "https://Stackoverflow.com/questions/296525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1982/" ]
296,533
<p>I have a Windows Forms app, that has a single ElementHost containing a WPF UserControl... in my WPF, I have a VERY simple ListView:</p> <pre><code>&lt;ListView Margin="4" ItemsSource="{Binding Notifications}"&gt; &lt;ListView.View&gt; &lt;GridView&gt; &lt;GridViewColumn Header="FirstName" Di...
[ { "answer_id": 296606, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 6, "selected": true, "text": "<ListView ItemsSource=\"{BindingNames}\"Name=\"lv\">\n <ListView.ItemsPanel>\n <ItemsPanelTemplate>\n...
2008/11/17
[ "https://Stackoverflow.com/questions/296533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11917/" ]
296,536
<p>I am trying to write a bash script for testing that takes a parameter and sends it through curl to web site. I need to url encode the value to make sure that special characters are processed properly. What is the best way to do this? </p> <p>Here is my basic script so far:</p> <pre><code>#!/bin/bash host=${1:?'...
[ { "answer_id": 296630, "author": "Jay", "author_id": 20840, "author_profile": "https://Stackoverflow.com/users/20840", "pm_score": 3, "selected": false, "text": "urlencode.sed s/%/%25/g\ns/ /%20/g\ns/ /%09/g\ns/!/%21/g\ns/\"/%22/g\ns/#/%23/g\ns/\\$/%24/g\ns/\\&/%26/g\ns/'\\''/%27/g\ns/(/...
2008/11/17
[ "https://Stackoverflow.com/questions/296536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19130/" ]
296,538
<p>I'm working for the first time with Forms Authentication, I'm using an example from the web to learn, I included in my web.config</p> <pre><code> &lt;authentication mode="Forms"&gt; &lt;forms name="MYWEBAPP.ASPXAUTH" loginUrl="Login.aspx" protection="All" path="/"/&gt; &lt;/authentication&gt; &lt...
[ { "answer_id": 296546, "author": "Jonas Kongslund", "author_id": 37548, "author_profile": "https://Stackoverflow.com/users/37548", "pm_score": 3, "selected": true, "text": "\"accountants, seekers, copiers, typers\"\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130097/" ]
296,550
<p>I understand how Lucene.net can work for text indexing. Will I be able to efficiently search for documents based on a given date range? Or will Lucene.net just use text matching to match the dates?</p>
[ { "answer_id": 304964, "author": "Stefan Schultze", "author_id": 6358, "author_profile": "https://Stackoverflow.com/users/6358", "pm_score": 4, "selected": true, "text": " public static string Serialize(DateTime dateTime)\n {\n return dateTime.ToString(\"yyyyMMddHHmmss\", Cu...
2008/11/17
[ "https://Stackoverflow.com/questions/296550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1363/" ]
296,560
<p>I am looking for a way to mount\unmount a USB flash drive using VBScript. This is the closest I was able to get.</p> <pre><code>Sub EjectDrive(strDrive) On Error Resume Next CONST SSF_DRIVES = 17 Set objShell = CreateObject("Shell.Application") Set objDrive = objShell.Namespace(SSF_DRIVES).ParseName(strDrive) objD...
[ { "answer_id": 297352, "author": "aphoria", "author_id": 2441, "author_profile": "https://Stackoverflow.com/users/2441", "pm_score": 2, "selected": false, "text": "strComputer = \".\"\nSet objWMIService = GetObject(\"winmgmts:\" _\n & \"{impersonationLevel=impersonate}!\\\\\" & strCom...
2008/11/17
[ "https://Stackoverflow.com/questions/296560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
296,584
<p><strong>In C#, is there a way to instantiate an instance of a class without invoking its constructor?</strong></p> <p>Assume the class is public and is defined in a 3rd party library and the constructor is internal. The reasons I want to do this are complicated but it would be helpful to know if it's possible usin...
[ { "answer_id": 296611, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 0, "selected": false, "text": "using System.Reflection;\n\n// If the constructor takes arguments, otherwise pass these as null\nType[] pTypes = new Type[1]...
2008/11/17
[ "https://Stackoverflow.com/questions/296584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2069/" ]
296,587
<p>I have a single user java program that I would like to have store data in a light weight database such as Derby or Sqlite. I would like to use a data abstraction layer in my program. Hibernate appears to require a lot of configuration and is overkill for what I need. What are light weight alternatives to Hibernate?<...
[ { "answer_id": 4655996, "author": "Somatik", "author_id": 42198, "author_profile": "https://Stackoverflow.com/users/42198", "pm_score": 3, "selected": false, "text": "// Define the query\nDBCommand cmd = db.createCommand();\nDBColumnExpr EMPLOYEE_FULLNAME= db.EMPLOYEES.LASTNAME.append(\"...
2008/11/17
[ "https://Stackoverflow.com/questions/296587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14744/" ]
296,603
<p>I'm working on an anti-spam project (<a href="http://centmail.net" rel="nofollow noreferrer">centmail</a>) that involves having the sender use a client plugin that adds a custom header (as well as a signature, but that part's <a href="https://stackoverflow.com/questions/142319">easier</a>). The general problem is t...
[ { "answer_id": 482698, "author": "Keltia", "author_id": 16143, "author_profile": "https://Stackoverflow.com/users/16143", "pm_score": 0, "selected": false, "text": "edit_headers my_hdr" }, { "answer_id": 482980, "author": "Sébastien RoccaSerra", "author_id": 2797, "au...
2008/11/17
[ "https://Stackoverflow.com/questions/296603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4234/" ]
296,609
<p>I'm trying to avoid a composite control or using and ASCX by extending an existing control. However, I'm having trouble with getting the controls added to the inherited control and keep their view-state/post-back integrity. Whenever I add the controls during pre-render, the controls show up, but the post-back throws...
[ { "answer_id": 296623, "author": "Zachary Yates", "author_id": 8360, "author_profile": "https://Stackoverflow.com/users/8360", "pm_score": 3, "selected": true, "text": "protected override void CreateChildControls(){\n Controls.Add(someControl);\n base.CreateChildControls();\n}\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2017/" ]
296,615
<p>Greetings!</p> <p>I'm scratching my head, wondering why when I do the following:</p> <pre><code>Response.Redirect(@"http://www.example.com/file.exe?id=12345"); </code></pre> <p>Both IE6 and IE7 will download the file as "file" (with no extension), but Firefox, Opera, Google Chrome and Safari have no problems at a...
[ { "answer_id": 296631, "author": "Falco Foxburr", "author_id": 37266, "author_profile": "https://Stackoverflow.com/users/37266", "pm_score": 2, "selected": false, "text": "Content-Type: application/octet-stream\nContent-Disposition: attachment; filename=\"file.exe\"\n" }, { "answ...
2008/11/17
[ "https://Stackoverflow.com/questions/296615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27870/" ]
296,619
<p>FreeMarker templates support an if-statement with the following syntax</p> <pre><code>&lt;#if hot&gt; It's hot. &lt;/#if&gt; </code></pre> <p>I've looked in the documentation and can't find any support for an if-else statement. Of course, I could achieve the same result with:</p> <pre><code>&lt;#if hot&gt; ...
[ { "answer_id": 296627, "author": "Ulf Lindback", "author_id": 30354, "author_profile": "https://Stackoverflow.com/users/30354", "pm_score": 6, "selected": true, "text": "<#if hot>\nit's hot\n<#else>\nit's not\n</#if>\n" }, { "answer_id": 299243, "author": "iberck", "autho...
2008/11/17
[ "https://Stackoverflow.com/questions/296619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2648/" ]
296,632
<p>I'm trying to configure Apache to allow read only access and ask for user to write to a SVN repository when you are coming from the local network (10.*) but not allow any access unless logged in when coming from external network.</p> <p>I sort of understand how the Order, Deny, Allow, and Limit directives work but ...
[ { "answer_id": 296627, "author": "Ulf Lindback", "author_id": 30354, "author_profile": "https://Stackoverflow.com/users/30354", "pm_score": 6, "selected": true, "text": "<#if hot>\nit's hot\n<#else>\nit's not\n</#if>\n" }, { "answer_id": 299243, "author": "iberck", "autho...
2008/11/17
[ "https://Stackoverflow.com/questions/296632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32465/" ]
296,657
<p>Recently, when porting some STL code to VS2008 I wanted to disable warnings generated by <code>std::copy</code> by defining the new <code>_SCL_SECURE_NO_WARNINGS</code> flag. You can do this in two ways:</p> <ul> <li>Using the <strong>/D</strong> compiler switch, which can be specified in the project properties. Y...
[ { "answer_id": 297147, "author": "JesperE", "author_id": 13051, "author_profile": "https://Stackoverflow.com/users/13051", "pm_score": 1, "selected": false, "text": "#ifdef _MSC_VER\n#define _SCL_SECURE_NO_WARNINGS\n#endif\n" }, { "answer_id": 1640134, "author": "blak3r", ...
2008/11/17
[ "https://Stackoverflow.com/questions/296657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
296,658
<p>I am creating a joomla plugin and want to load an array of images after the page has loaded. To do that, I'm currently using mootools.js to call myserver URL, obtain the JSON response and parse the response into javascript variables that represent each image url. It works great, but mootools.js is appropriately na...
[ { "answer_id": 296939, "author": "jishi", "author_id": 33663, "author_profile": "https://Stackoverflow.com/users/33663", "pm_score": 1, "selected": false, "text": "eval var json = eval('(' + xhr.responseText + ')');\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38339/" ]
296,667
<p>I have a function, <code>a()</code>, that I want to override, but also have the original <code>a()</code> be performed in an order depending on the context. For example, sometimes when I'm generating a page I'll want to override like this:</p> <pre><code>function a() { new_code(); original_a(); } </code></p...
[ { "answer_id": 296706, "author": "Matthew Crumley", "author_id": 2214, "author_profile": "https://Stackoverflow.com/users/2214", "pm_score": 9, "selected": true, "text": "var a = (function() {\n var original_a = a;\n\n if (condition) {\n return function() {\n new_...
2008/11/17
[ "https://Stackoverflow.com/questions/296667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16777/" ]
296,674
<p>One thing that bugs me about IE is that when it goes to load a page with an iframe it will wait until the iframe has finished loading before it will render the page. Firefox by contrast will render all the other page elements while the iframe is loading which is really nice if the iframe takes a long time to load b...
[ { "answer_id": 296731, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 3, "selected": true, "text": "<!-- jQuery example: -->\n\n<div id='content'>Loading...</div>\n\n<script type='text/javascript'>\n$(\"#content\").load(u...
2008/11/17
[ "https://Stackoverflow.com/questions/296674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5234/" ]
296,685
<p>I am trying to autoreload my page after every 20 seconds. I am using JavaScript for this instead of the &lt;meta>.</p> <p>I have &lt;body onload="SetTimer()"> and here is my JavaScript function</p> <pre><code> function SetTimer(){ setTimeout('window.location.replace(window.location.pathname)', 20000) ...
[ { "answer_id": 296727, "author": "ng.mangine", "author_id": 37784, "author_profile": "https://Stackoverflow.com/users/37784", "pm_score": 1, "selected": false, "text": "function SetTimer(){ \n setTimeout('window.location.replace(window.location)', 20000)\n}\n" }, { "answer_id"...
2008/11/17
[ "https://Stackoverflow.com/questions/296685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34219/" ]
296,696
<p>In Excel VBA (2003), I've noticed that any <strong>Public</strong> or <strong>Friend</strong> <strong>Sub</strong> method in either a module or <em>ThisWorkbook</em> that doesn't have any arguments will show up as a Macro that can be run by the user. I.e. when the user goes to Tools --> Macro --> Macros... (or Alt+...
[ { "answer_id": 296765, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 3, "selected": false, "text": "Optional Public Sub myPublicSub(Optional dummy_var As Integer)\n ...\nEnd Sub" }, { "answer_id": 296839, "a...
2008/11/17
[ "https://Stackoverflow.com/questions/296696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1354/" ]
296,717
<p>I need to unzip a compressed file on the fly in my program. It works when I try it on my own linux computer, but for some reason the school computers fail whenever I tell them to do it. To unzip I'm using the following command:</p> <pre><code> zcat /file/address/file.tar.gz </code></pre> <p>and get the error:</p> ...
[ { "answer_id": 296725, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 7, "selected": true, "text": "gzcat zcat" }, { "answer_id": 311821, "author": "Dustin", "author_id": 39975, "author_profile": "https://...
2008/11/17
[ "https://Stackoverflow.com/questions/296717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21539/" ]
296,719
<p>What's a good rule of thumb for naming methods that return properties/attributes/members of an object? If an object has some immutable quality "blarg", should a method that returns that quality be called "blarg()" or "getBlarg()"? The Java API, for example, is inconsistent: most properties are accessed through "ge...
[ { "answer_id": 296734, "author": "Khb", "author_id": 37817, "author_profile": "https://Stackoverflow.com/users/37817", "pm_score": 2, "selected": false, "text": "GetBlarg() or getBlarg()\n GetHashCode() hashcode" }, { "answer_id": 296743, "author": "Bill the Lizard", "aut...
2008/11/17
[ "https://Stackoverflow.com/questions/296719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38343/" ]
296,721
<p>When is it appropriate to use &lt;cflock scope="application"&gt; or it's ilk as opposed to &lt;cflock name="foo"&gt;? </p> <p>Specifically, I'm interested in using CFLock to protect shared objects in the application, session, or server scopes, but I'm also interested in finding out about different uses of locking ...
[ { "answer_id": 296758, "author": "Anne Porosoff", "author_id": 28701, "author_profile": "https://Stackoverflow.com/users/28701", "pm_score": 0, "selected": false, "text": "<cflock scope=\"application\">" }, { "answer_id": 296833, "author": "Nathan Strutz", "author_id": 59...
2008/11/17
[ "https://Stackoverflow.com/questions/296721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21973/" ]
296,728
<p>I'd like to setup a build server for unmanaged C++ code developed in Visual Studio 2005. The build server should be able to do the following:</p> <ul> <li>Monitor a Subversion repository for code changes and schedule a build</li> <li>Checkout code from Subversion and run unit tests</li> <li>Provide some sort of rep...
[ { "answer_id": 9909912, "author": "Jan Hudec", "author_id": 201725, "author_profile": "https://Stackoverflow.com/users/201725", "pm_score": 0, "selected": false, "text": "devenv.com whatever.sln /build 'Release|Win32' /project whatever\n whatever Release|Win32" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
296,730
<p>I am creating a new table inside mysql and I am trying to add a foreign key constraint to one of the fields.</p> <pre> CREATE TABLE `onlineorder` ( `receiptid` varchar(10) NOT NULL default '', `delivereddate` date default NULL, `cid` int(10) NOT NULL, `card#` int(10) default NULL, `expire` date default NU...
[ { "answer_id": 297305, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 3, "selected": false, "text": "FOREIGN KEY CHECK SHOW WARNINGS" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28462/" ]
296,732
<p>I've been wondering if it's possible to have Fluent-NHibernate communicate with stored procedures that already exist and assign mapping from the result set to my own domain objects.</p> <p>Also is Fluent-NHibernate able to directly execute procedures with no result set returned?</p> <p>Basically I've been consider...
[ { "answer_id": 2178506, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "SqlInsert(\"StoredProcName\");\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37055/" ]
296,738
<p>I'd love to know if there is a module to parse "human formatted" dates in Perl. I mean things like "tomorrow", "Tuesday", "next week", "1 hour ago".</p> <p>My research with CPAN suggest that there is no such module, so how would you go about creating one? NLP is way over the top for this.</p>
[ { "answer_id": 296739, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 6, "selected": true, "text": "#!/usr/bin/perl\n\nuse strict;\nuse Date::Manip;\n\nwhile (<DATA>)\n{\n chomp;\n print UnixDate($_, \"%Y-%m-%d %H:%...
2008/11/17
[ "https://Stackoverflow.com/questions/296738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38346/" ]
296,740
<p>I need to populate a context menu from a database at run time. I do not know the number of items that will be in the list, so I would like to handle the click event in a single place. How do I declare the handler so I can tell which menu item actually triggered the click.</p> <pre><code>Public Function GetBookmar...
[ { "answer_id": 296757, "author": "Jon B", "author_id": 27414, "author_profile": "https://Stackoverflow.com/users/27414", "pm_score": 1, "selected": true, "text": "Public Sub ForwardToList_Click(sender As Object, e As EventArgs)\n'...\nEnd Sub\n" }, { "answer_id": 4529548, "au...
2008/11/17
[ "https://Stackoverflow.com/questions/296740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38349/" ]
296,747
<p>When I generate a default scaffold, the display tags on show.html.erb have</p> <pre><code>&lt;%=h @broker.name %&gt; </code></pre> <p>I know the difference between <code>&lt;%</code> and <code>&lt;%=</code>. What's the "h" do?</p>
[ { "answer_id": 297246, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": false, "text": "<%=h <%= h <%=h person.first_name %>\n<%= h(person.first_name) %>\n h" }, { "answer_id": 303108, "author": "Tim Ha...
2008/11/17
[ "https://Stackoverflow.com/questions/296747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32154/" ]
296,750
<p>I have a class that has some properties. And I want something that calculates a Score out of these properties. Since this is a trivial task (some additions and divisions, but nothing spectacular).</p> <p>So naturally, the question is: "When to use a Property with some code in the getter, and when to use a function?...
[ { "answer_id": 296777, "author": "Micah", "author_id": 17744, "author_profile": "https://Stackoverflow.com/users/17744", "pm_score": 2, "selected": true, "text": "get set get_MyPropertyName() set_MyPropertyName()" }, { "answer_id": 296802, "author": "PhilHoy", "author_id"...
2008/11/17
[ "https://Stackoverflow.com/questions/296750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91/" ]
296,755
<p>The following code fails to compile stating "A local variable named 'st' cannot be declared in this scope because it would give a different meaning to 'st', which is already used in a 'child' scope to denote something else": </p> <pre><code> var l = new List&lt;string&gt;(); l.Find(st =&gt; st.EndsW...
[ { "answer_id": 296780, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 5, "selected": true, "text": "postParent postParent postParent" }, { "answer_id": 296790, "author": "Jared", "author_id": 14744, "a...
2008/11/17
[ "https://Stackoverflow.com/questions/296755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26160/" ]
296,781
<p>I'm running an SQL query against a mainframe DB2 database using the OdbcDataReader class and ExecuteReader() method. This code is in production and has been running fine for months.</p> <p>The query normally takes 1-2 minutes to execute. This past Friday, the query encountered a ThreadAbortException. Below is the ...
[ { "answer_id": 422183, "author": "Dean Hill", "author_id": 3106, "author_profile": "https://Stackoverflow.com/users/3106", "pm_score": 3, "selected": true, "text": "<configuration>\n <microsoft.web.services3>\n <messaging>\n <executionTimeoutInSeconds value=\"360\" />\n </mes...
2008/11/17
[ "https://Stackoverflow.com/questions/296781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3106/" ]
296,783
<p>Why does Resharper want you to change most variables to var type instead of the actual type in the code?</p>
[ { "answer_id": 296808, "author": "David Thibault", "author_id": 5903, "author_profile": "https://Stackoverflow.com/users/5903", "pm_score": 3, "selected": false, "text": "Person p = new Person();\n^^^^^^\n Person p = repository.GetPerson(1);\n¯¯¯\n" }, { "answer_id": 13526143, ...
2008/11/17
[ "https://Stackoverflow.com/questions/296783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11907/" ]
296,789
<p>In SQL Server Mgt Studio 2005, when I open the Object Explorer to script an object to a new Query Editor window, the tab for that new script window is titled something like 'MyServerName.MyDatabaseName - sqlquery37.sql' </p> <p>Not very descriptive. So when I get a bunch of windows open at the same time, I have no ...
[ { "answer_id": 296980, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 1, "selected": false, "text": "MyServerName.MyDatabaseName - MyFileName.sql\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6624/" ]
296,792
<p>When I open a file for reading in Haskell, I've found that I can't use the contents of the file after closing it. For example, this program will print the contents of a file:</p> <pre><code>main = do inFile &lt;- openFile "foo" ReadMode contents &lt;- hGetContents inFile putStr contents ...
[ { "answer_id": 297404, "author": "Chris Conway", "author_id": 1412, "author_profile": "https://Stackoverflow.com/users/1412", "pm_score": 1, "selected": false, "text": "hGetContents readFile main = do contents <- readFile \"foo\"\n putStr contents\n > main\nblahblahblah\n foo bl...
2008/11/17
[ "https://Stackoverflow.com/questions/296792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1891/" ]
296,795
<p>I've got a Subversion repository, and there are a number of users checking things in and out. However, I also need to frequently check in work for other people. I need to track the original author of the work.</p> <p>I was considering creating a property in SVN, like "originalauthor", which could track this. In ...
[ { "answer_id": 296829, "author": "Bert Huijben", "author_id": 2094, "author_profile": "https://Stackoverflow.com/users/2094", "pm_score": 4, "selected": true, "text": "Patch by: Jan Jansen <jan@example.com>\n svn commit --with-revprop \"original-author=Jan Jansen <jan@example.com>\" \n s...
2008/11/17
[ "https://Stackoverflow.com/questions/296795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9161/" ]
296,797
<p>Since you guys are having lots of questions or not enough info to work with, below is proprietary information and as such be careful as you can. The question – (please refer to if [$7 -eq "AAA"]...then statement - in bold ) has a problem with an output, where I can only output/print count of 'AAA' regardless the v...
[ { "answer_id": 296905, "author": "ADEpt", "author_id": 10105, "author_profile": "https://Stackoverflow.com/users/10105", "pm_score": 2, "selected": false, "text": "if [ \"$7\" -eq \"AAA\" ] ; then\n attr=\"attr2\"\nelsif [ \"$7\" -eq \"BBB\" ] ; then\n attr=\"attr1\"\nelse\n echo \"Bo...
2008/11/17
[ "https://Stackoverflow.com/questions/296797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
296,799
<p>How can I get the name of a file in in PHP? What I want to do is have a function take a string of a filename and then do some stuff if it's actually on the page.</p> <pre><code>function onThisPageFunction(fileNameFromFunction) { if(onThisPage == fileNameFromFunction) { do stuff } } </code></...
[ { "answer_id": 296813, "author": "activout.se", "author_id": 20444, "author_profile": "https://Stackoverflow.com/users/20444", "pm_score": 2, "selected": false, "text": "__FILE__" }, { "answer_id": 296862, "author": "Eric Goodwin", "author_id": 1430, "author_profile":...
2008/11/17
[ "https://Stackoverflow.com/questions/296799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28672/" ]
296,830
<p>I have a 5GB database and a 20GB transaction log (SQL Server 2005). Not sure why it is so large or what happened to make it that large, it used to be around 1/2 the size of the DB. DB grows about 1GB/month. </p> <p>Are there any guidelines to how how big your transaction log should be relative to your database file...
[ { "answer_id": 296860, "author": "Otus", "author_id": 36613, "author_profile": "https://Stackoverflow.com/users/36613", "pm_score": 1, "selected": false, "text": "Backup Log DatabaseName With Truncate_Only\nGO\n\nDeclare @LogFileLogicalName sysname\nselect @LogFileLogicalName=RTRIM(Name)...
2008/11/17
[ "https://Stackoverflow.com/questions/296830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34133/" ]
296,834
<p>Suppose I have three classes. It is valid to instantiate A, but there are also special cases B and D which subclass A, adding additional information.</p> <p>How would I do the mapping files for this in (fluent) NHibernate?</p> <pre><code>public class A { public int ID { get; set;} public string CommonProp...
[ { "answer_id": 298329, "author": "Erik Öjebo", "author_id": 276, "author_profile": "https://Stackoverflow.com/users/276", "pm_score": 4, "selected": true, "text": "// Domain classes\npublic class Animal\n{\n public virtual int Id { get; set; }\n public virtual string Name { get; se...
2008/11/17
[ "https://Stackoverflow.com/questions/296834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24954/" ]
296,842
<p>Given an amount of days, say 25, convert it into a duration text such as "3 Weeks, 4 Days"</p> <p>C# and F# solutions would both be great if the F# variation offers any improvement over C#.</p> <p>Edit: The solution should expand past weeks to include months and years. Bonus points for including centuries and so o...
[ { "answer_id": 296852, "author": "Gavin Miller", "author_id": 33226, "author_profile": "https://Stackoverflow.com/users/33226", "pm_score": 3, "selected": false, "text": "String.Format(\"{0} Weeks, {1} days\", days / 7, days % 7);\n" }, { "answer_id": 297067, "author": "Bob",...
2008/11/17
[ "https://Stackoverflow.com/questions/296842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45/" ]
296,849
<p>What is the way of separating Line-Breaks and Space in MultiLine Textbox or HTML Text area while inserting database (Asp.Net). For example what should I do if I want to insert </p> <p>Hello </p> <p>World </p> <p>to database with line breaks? And also While displaying what should I do? I don't want to use Edito...
[ { "answer_id": 296895, "author": "deadbug", "author_id": 4646, "author_profile": "https://Stackoverflow.com/users/4646", "pm_score": 5, "selected": true, "text": " < b r / > " }, { "answer_id": 297462, "author": "Grayside", "author_id": 38408, "author_profile": "https...
2008/11/17
[ "https://Stackoverflow.com/questions/296849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
296,861
<p>In ActionScript, how can you test if an object is defined, that is, not null?</p>
[ { "answer_id": 296870, "author": "Herms", "author_id": 1409, "author_profile": "https://Stackoverflow.com/users/1409", "pm_score": 2, "selected": false, "text": "var someObj:Object = getSomeObjectOrMaybeNull();\nif(someObj == null) {\n trace(\"someObj is null!\");\n} else {\n trace(\"s...
2008/11/17
[ "https://Stackoverflow.com/questions/296861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3858/" ]
296,873
<p>Lets say I am currently at: <code>http://example.com/folder/page.html</code></p> <p>Is it possible to create a relative link on this page that points to <code>http://example.com/folder/</code> without specifying <code>folder</code> anywhere? (And using only HTML.)</p> <p><strong>UPDATE:</strong> <strong>As it turn...
[ { "answer_id": 296881, "author": "Bullines", "author_id": 27870, "author_profile": "https://Stackoverflow.com/users/27870", "pm_score": 4, "selected": false, "text": "<html>\n <head>\n <title>Page</title>\n </head>\n <body>\n <a href=\"./\">Folder directory</a> \n ...
2008/11/17
[ "https://Stackoverflow.com/questions/296873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20128/" ]
296,879
<p>I am powering a web search using Sphinx, and am getting the following error message while building the indexes:</p> <blockquote> <p>WARNING: sort_hits: merge_block_size=76 kb too low, increasing mem_limit may improve performance</p> </blockquote> <p>The problem is I can't find any documentation on where this set...
[ { "answer_id": 403722, "author": "Glen Solsberry", "author_id": 16645, "author_profile": "https://Stackoverflow.com/users/16645", "pm_score": 3, "selected": false, "text": "mem_limit merge_block_size mem_limit" }, { "answer_id": 5515318, "author": "juidanho", "author_id":...
2008/11/17
[ "https://Stackoverflow.com/questions/296879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38358/" ]
296,904
<p>My data is such that I want to display values for the Employee and the Supervisor for a particular record. Instead of describing it, I'll show you a rough example:</p> <pre><code>&lt;table&gt;&lt;tr&gt; &lt;th colspan="3"&gt;Employee&lt;/th&gt; &lt;th colspan="3"&gt;Supervisor&lt;/th&gt; &lt;/tr&gt;&lt;tr&gt; &lt;t...
[ { "answer_id": 403722, "author": "Glen Solsberry", "author_id": 16645, "author_profile": "https://Stackoverflow.com/users/16645", "pm_score": 3, "selected": false, "text": "mem_limit merge_block_size mem_limit" }, { "answer_id": 5515318, "author": "juidanho", "author_id":...
2008/11/17
[ "https://Stackoverflow.com/questions/296904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337/" ]
296,906
<p>Is there a way to use Profiler to determine whether a table is being accessed by queries?</p> <p>I saw an event named <code>Object:Opened</code> (Indicates when an object has been accessed, such as for SELECT, INSERT, or DELETE statements) and <code>Object:Closed</code>, but these do not seem to work.</p> <p>In pa...
[ { "answer_id": 297316, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 0, "selected": false, "text": "SQL:StmtStarting SP:StmtStarting TextData %TABLE_NAME% SP:StmtStarting LIKE" }, { "answer_id": 312564, "auth...
2008/11/17
[ "https://Stackoverflow.com/questions/296906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3750/" ]
296,909
<p>I wouldn't dare do anything complex in a database without transactions. There is nearly always a simple to use in-built command. But when you start working with other persistent data you just don't get this simple to use transaction support. Some example are</p> <ul> <li>file systems</li> <li>web services (none tha...
[ { "answer_id": 297087, "author": "ddaa", "author_id": 11549, "author_profile": "https://Stackoverflow.com/users/11549", "pm_score": 3, "selected": false, "text": "/a/ /b/ mv /a /b/a mv /b /a/b" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18107/" ]
296,910
<p>I want to have an executable file that will call some other programs. The way I would do this in Linux is with a simple bash script that looks like this:</p> <pre><code>#!/bin/bash echo "running some-program" /home/murat/some-program arg1 arg2 </code></pre> <p>What's the best way to do this kind of thing under Win...
[ { "answer_id": 16494912, "author": "Ben P. Dorsi-Todaro", "author_id": 1940946, "author_profile": "https://Stackoverflow.com/users/1940946", "pm_score": 0, "selected": false, "text": "echo off\necho Backing up Images\n%homedrive%\\Backup\\7z.exe a -tzip photos.zip %userprofile%\\Photos\\...
2008/11/17
[ "https://Stackoverflow.com/questions/296910", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25910/" ]
296,913
<p>I am looking to write a function like </p> <pre><code>ref String TestIt( int index ) { return this.TestArray[index]; }; </code></pre> <p>so that I could write code like:</p> <pre><code>MyClass.TestIt(0) = "Hello World"; </code></pre> <p>My goal is to mimic this c++ declaration</p> <pre><code>CString&amp; MyClas...
[ { "answer_id": 296946, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 3, "selected": true, "text": "class YourClass {\n public class Nested {\n public Nested(YourClass outer) { m_RefToOuterWorld = outer; }\n ...
2008/11/17
[ "https://Stackoverflow.com/questions/296913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5618/" ]
296,918
<p>This problem occurred during daylight saving time change. After the change occurred, we've noticed that our server application started writing into the log incorrect time - one hour ahead which means that .NET caches time zone offset. We had to restart our application to resolve this problem. I wrote a simple applic...
[ { "answer_id": 1047837, "author": "Paul Farry", "author_id": 97516, "author_profile": "https://Stackoverflow.com/users/97516", "pm_score": 0, "selected": false, "text": " Private mTZChangeFilter As WindowsMessageFilter\n\n\n mTZChangeFilter = New WindowsMessageFilter()\n AddHand...
2008/11/17
[ "https://Stackoverflow.com/questions/296918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8653/" ]
296,920
<p>How do you get the current time (not date AND time)?</p> <p>Example: 5:42:12 PM</p>
[ { "answer_id": 296933, "author": "Mark Brackett", "author_id": 2199, "author_profile": "https://Stackoverflow.com/users/2199", "pm_score": 9, "selected": false, "text": "DateTime.Now.TimeOfDay TimeSpan DateTime.Now.ToString(\"h:mm:ss tt\")" }, { "answer_id": 296937, "author":...
2008/11/17
[ "https://Stackoverflow.com/questions/296920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
296,952
<p>How can I prevent the image tag that calls the associated image from displaying if no image is associated with the record?</p> <pre><code>&lt;%= image_tag @agent.avatar.url %&gt; </code></pre> <p>...gives me the text "Missing" if there is no image associated with that agent. I want to test to see there is an imag...
[ { "answer_id": 296990, "author": "neezer", "author_id": 32154, "author_profile": "https://Stackoverflow.com/users/32154", "pm_score": 5, "selected": false, "text": "has_attached_file :avatar, :default_url => '/images/brokers/agents/anonymous_icon.jpg'\n" }, { "answer_id": 297329,...
2008/11/17
[ "https://Stackoverflow.com/questions/296952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32154/" ]
296,964
<p>What could the following line possibly mean?</p> <pre><code>my $x = shift; </code></pre>
[ { "answer_id": 296969, "author": "David Nehme", "author_id": 14167, "author_profile": "https://Stackoverflow.com/users/14167", "pm_score": 2, "selected": false, "text": "my ($x) = @_;\n" }, { "answer_id": 296991, "author": "Alnitak", "author_id": 6782, "author_profile...
2008/11/17
[ "https://Stackoverflow.com/questions/296964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
296,967
<p>I'm wondering where the callbacks are (or if there are anything) for animations in a CALayer. Specifically, for implied animations like altering the frame, position, etc. In a UIView, you could do something like this:</p> <pre><code>[UIView beginAnimations:@"SlideOut" context:nil]; [UIView setAnimationDuration:.3];...
[ { "answer_id": 297045, "author": "Jeffrey Forbes", "author_id": 28019, "author_profile": "https://Stackoverflow.com/users/28019", "pm_score": 7, "selected": true, "text": "CABasicAnimation CABasicAnimation* anim = [CABasicAnimation animationWithKeyPath:@\"frame\"];\nanim.fromValue = [NSV...
2008/11/17
[ "https://Stackoverflow.com/questions/296967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28019/" ]
296,971
<p>The section <strong>Last links in the chain: Stashing and the reflog</strong> in <a href="http://ftp.newartisans.com/pub/git.from.bottom.up.pdf" rel="noreferrer">http://ftp.newartisans.com/pub/git.from.bottom.up.pdf</a> recommends stashing often to take snapshots of your work in progress. The author goes as far as...
[ { "answer_id": 417540, "author": "d0k", "author_id": 52109, "author_profile": "https://Stackoverflow.com/users/52109", "pm_score": 3, "selected": false, "text": "#!/bin/sh\nGIT_DIR=$(git rev-parse --git-dir) || exit\nref_stash=refs/stash\n\nw_commit=$(git stash create) # creates a commit...
2008/11/17
[ "https://Stackoverflow.com/questions/296971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
296,975
<p>I'm using <code>git-svn</code> to work against my company's central Subversion repository. We've recently created a new feature branch in the central repo. </p> <p>How do I tell Git about it? When I run <code>git branch -r</code> I can only see the branches that existed when I ran <code>fetch</code> against the Sub...
[ { "answer_id": 297000, "author": "Hank Gay", "author_id": 4203, "author_profile": "https://Stackoverflow.com/users/4203", "pm_score": 6, "selected": false, "text": "git svn fetch" }, { "answer_id": 1430782, "author": "vjangus", "author_id": 76516, "author_profile": "h...
2008/11/17
[ "https://Stackoverflow.com/questions/296975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4203/" ]