qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
255,008
<p>What are the ways by which we can reduce the size of the HTML Response sent by an asp.net application?</p> <p>I am using Controls which are not owned by me and it produces output with white spaces. I am interested in Minifying the entire HTML output of the page just like how google does (View source www.google.com)...
[ { "answer_id": 28692638, "author": "Veverke", "author_id": 1219280, "author_profile": "https://Stackoverflow.com/users/1219280", "pm_score": 2, "selected": false, "text": "@{\n ... \n ...\n // anything\n ...\n}\n htmlContents = Regex.Replace(htmlContents, @\"//(.*?)\\r?\\n\", \"\"/*,...
2008/10/31
[ "https://Stackoverflow.com/questions/255008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30594/" ]
255,019
<p>Is there any way to do the equivalent of the following in a JSP without using scriptlet?</p> <pre><code>&lt;% response.setContentType("text/plain"); %&gt; </code></pre> <p>I can't simply use</p> <p>because I need to set the content-type in 2 places (each in a different branch of a ) and the JSP compiler will o...
[ { "answer_id": 255023, "author": "AlexJReid", "author_id": 32320, "author_profile": "https://Stackoverflow.com/users/32320", "pm_score": 2, "selected": false, "text": "<%@ page language=\"java\" contentType=\"text/plain\" %>\n <% \nif( branch condition ) { \n response.setContentType(\"t...
2008/10/31
[ "https://Stackoverflow.com/questions/255019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2648/" ]
255,035
<p>How do I convert a datetime or date object into a POSIX timestamp in python? There are methods to create a datetime object out of a timestamp, but I don't seem to find any obvious ways to do the operation the opposite way.</p>
[ { "answer_id": 255053, "author": "kender", "author_id": 4172, "author_profile": "https://Stackoverflow.com/users/4172", "pm_score": 7, "selected": true, "text": "import time, datetime\n\nd = datetime.datetime.now()\nprint time.mktime(d.timetuple())\n" }, { "answer_id": 5872022, ...
2008/10/31
[ "https://Stackoverflow.com/questions/255035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
255,041
<p>Is there some way I can define <code>String[int]</code> to avoid using <code>String.CharAt(int)</code>?</p>
[ { "answer_id": 255046, "author": "keparo", "author_id": 19468, "author_profile": "https://Stackoverflow.com/users/19468", "pm_score": 5, "selected": true, "text": "operator* MyType MyType String Array Array Array" }, { "answer_id": 255051, "author": "Lee Kowalkowski", "au...
2008/10/31
[ "https://Stackoverflow.com/questions/255041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4435/" ]
255,056
<p>I have a standard .NET windows service written in C#.</p> <p>Can it install itself without using InstallUtil? Should I use the service installer class? How should I use it?</p> <p>I want to be able to call the following:</p> <pre><code>MyService.exe -install </code></pre> <p>And it will have the same effect as c...
[ { "answer_id": 255062, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 8, "selected": true, "text": "[RunInstaller(true)]\npublic sealed class MyServiceInstallerProcess : ServiceProcessInstaller\n{\n public MyService...
2008/10/31
[ "https://Stackoverflow.com/questions/255056", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20257/" ]
255,063
<p>Would there a more elegant way of writing the following syntax? </p> <pre><code> Thread t0 = new Thread(new ParameterizedThreadStart(doWork)); t0.Start('someVal'); t0.Join(); Thread t1 = new Thread(new ParameterizedThreadStart(doWork)); t1.Start('someDiffVal'); t1.Joi...
[ { "answer_id": 255072, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "List<Thread> threads = new List<Thread>();\n\nforeach (string item in items)\n{\n string copy = item; // Important due...
2008/10/31
[ "https://Stackoverflow.com/questions/255063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30649/" ]
255,071
<p>I've been tasked with implementing a Date/Time selector for several areas of our web project, and instructed to use a control that another developer created as part of it. The control I'm working on is supposed to allow the user to choose a date from a calendar, choose a format for the display of that date (from se...
[ { "answer_id": 255072, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "List<Thread> threads = new List<Thread>();\n\nforeach (string item in items)\n{\n string copy = item; // Important due...
2008/10/31
[ "https://Stackoverflow.com/questions/255071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23902/" ]
255,077
<p>I have just installed VMWare Server 2.0 on a fresh Fedora Core 8 install. The ports for the web access console of VMWare are 8222 and 8333 (like the defaults).</p> <p>When I try a remote http access to myserver:8222 it fails. But when I run</p> <pre><code>/sbin/service iptables stop </code></pre> <p>access become...
[ { "answer_id": 255331, "author": "Adam Liss", "author_id": 29157, "author_profile": "https://Stackoverflow.com/users/29157", "pm_score": 3, "selected": true, "text": "-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT\n# Custom authorization for VMWare adminis...
2008/10/31
[ "https://Stackoverflow.com/questions/255077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18858/" ]
255,078
<p>What's the difference between a string and a symbol in Ruby and when should I use one over the other?</p>
[ { "answer_id": 255099, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 8, "selected": true, "text": "irb(main):007:0> :test.object_id\n=> 83618\nirb(main):008:0> :test.object_id\n=> 83618\nirb(main):009:0> :test.object...
2008/10/31
[ "https://Stackoverflow.com/questions/255078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
255,081
<p>I have a situation where another developer is including source files from a project that I maintain in a project that he maintains. The nature of the files is such that each source file registers a "command" in an interpretive environment so all you have to do is link in a new source file to register a new "command...
[ { "answer_id": 255090, "author": "Thomas", "author_id": 14637, "author_profile": "https://Stackoverflow.com/users/14637", "pm_score": 0, "selected": false, "text": "#include" }, { "answer_id": 255159, "author": "Rob Walker", "author_id": 3631, "author_profile": "https...
2008/10/31
[ "https://Stackoverflow.com/questions/255081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19674/" ]
255,098
<p>I am experimenting with calling delegate functions from a delegate array. I've been able to create the array of delegates, but how do I call the delegate?</p> <pre><code>public delegate void pd(); public static class MyClass { static void p1() { //... } static void p2 () { //...
[ { "answer_id": 255107, "author": "Romain Verdier", "author_id": 4687, "author_profile": "https://Stackoverflow.com/users/4687", "pm_score": 3, "selected": false, "text": "public class MainClass\n{\n static void Main()\n {\n pd[0]();\n pd[1]();\n }\n}\n" }, { ...
2008/10/31
[ "https://Stackoverflow.com/questions/255098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7899/" ]
255,104
<p>I'm working on a WinForms app and I have a user control in it. The buttons in the user control raise events up to the form to be handled by other code. One of the buttons starts some processses that will cause problems if they run simultaneously. I have logic in the code to manage the state so typically a user ca...
[ { "answer_id": 255138, "author": "HanClinto", "author_id": 26933, "author_profile": "https://Stackoverflow.com/users/26933", "pm_score": 4, "selected": true, "text": "private bool runningExclusiveProcess = false;\n\npublic void onClickHandler(object sender, EventArgs e)\n{\n if (!runn...
2008/10/31
[ "https://Stackoverflow.com/questions/255104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10221/" ]
255,114
<p>Let's make this very easy. What I want:</p> <pre><code>@array = qw/one two one/; my @duplicates = duplicate(@array); print "@duplicates"; # This should now print 'one'. </code></pre> <p>How to print duplicate values of a array/hash?</p>
[ { "answer_id": 255177, "author": "Leon Timmermans", "author_id": 4727, "author_profile": "https://Stackoverflow.com/users/4727", "pm_score": 4, "selected": true, "text": "sub duplicate {\n my @args = @_;\n my %items;\n for my $element(@args) {\n $items{$element}++;\n }...
2008/10/31
[ "https://Stackoverflow.com/questions/255114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33232/" ]
255,133
<p>I'm a long-time ActionScript 2 user, now getting started with ActionScript 3. The one thing I'm missing is an easy way to duplicate the functionality of AS2's MovieClip.onReleaseOutside. It is almost always necessary to implement this event, otherwise you get funny bugs like flash thinks your mouse is down when real...
[ { "answer_id": 256007, "author": "Ronnie Liew", "author_id": 1987, "author_profile": "https://Stackoverflow.com/users/1987", "pm_score": 2, "selected": false, "text": "flash.events.Event.MOUSE_LEAVE\n" }, { "answer_id": 257441, "author": "Antti", "author_id": 6037, "a...
2008/10/31
[ "https://Stackoverflow.com/questions/255133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14569/" ]
255,147
<p>In python, if I say</p> <pre><code>print 'h' </code></pre> <p>I get the letter h and a newline. If I say </p> <pre><code>print 'h', </code></pre> <p>I get the letter h and no newline. If I say</p> <pre><code>print 'h', print 'm', </code></pre> <p>I get the letter h, a space, and the letter m. How can I prev...
[ { "answer_id": 255154, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 9, "selected": true, "text": "import sys\n\nsys.stdout.write('h')\nsys.stdout.flush()\n\nsys.stdout.write('m')\nsys.stdout.flush()\n sys.stdout.flush()"...
2008/10/31
[ "https://Stackoverflow.com/questions/255147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4343/" ]
255,153
<p>how do i determine what a mysql db's charset is set to? in the cli?</p>
[ { "answer_id": 255163, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 4, "selected": true, "text": "SHOW CREATE DATABASE db-name\n SHOW CREATE TABLE db-name.table-name\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/255153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18285/" ]
255,170
<p>I am making a site that publishes articles in issues each month. It is straightforward, and I think using a Markdown editor (like the <a href="http://code.google.com/p/wmd/" rel="noreferrer">WMD</a> one here in Stack&nbsp;Overflow) would be perfect.</p> <p>However, <strong>they do need the ability to have images ri...
[ { "answer_id": 255182, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 9, "selected": true, "text": "<img style=\"float: right;\" src=\"whatever.jpg\">\n\nContinue markdown text...\n" }, { "answer_id": 1228126, ...
2008/10/31
[ "https://Stackoverflow.com/questions/255170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9913/" ]
255,189
<p>If I have a type defined as a <strong>set of</strong> an enumerated type, it's easy to create an empty set with [], but how do I create a <em>full</em> set?</p> <p>EDIT: Yeah, the obvious solution is to use a for loop. That's also a really bad solution if there's another way. Does anyone know of a way that'll wor...
[ { "answer_id": 255321, "author": "Jim McKeeth", "author_id": 255, "author_profile": "https://Stackoverflow.com/users/255", "pm_score": 3, "selected": false, "text": "FillChar(VarSet, SizeOf(VarSet), $FF);\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/255189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32914/" ]
255,194
<p>I'm working on a Grails project using Hibernate (GORM). I have the following Domain Models:</p> <pre><code>ClientContact { static hasMany = [owners: Person] static belongsTo = [Person] } Person { static hasMany = [clientContacts: ClientContact] } </code></pre> <p>When I try to retrieve all the <code>Clie...
[ { "answer_id": 255295, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 0, "selected": false, "text": "eqId()" }, { "answer_id": 311865, "author": "billjamesdev", "author_id": 13824, "author_profile": "ht...
2008/10/31
[ "https://Stackoverflow.com/questions/255194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21832/" ]
255,202
<p>When I type <code>git diff</code>, I want to view the output with my visual diff tool of choice (SourceGear "diffmerge" on Windows). How do I configure git to do this?</p>
[ { "answer_id": 255212, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 10, "selected": true, "text": "path old-file old-hex old-mode new-file new-hex new-mode\n -->8-(snip)--\n#!/bin/sh\n\n# diff is called by git with 7 parameter...
2008/10/31
[ "https://Stackoverflow.com/questions/255202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3891/" ]
255,214
<p>I keep seeing references to the visitor pattern in blogs but I've got to admit, I just don't get it. I read the <a href="http://en.wikipedia.org/wiki/Visitor_pattern" rel="noreferrer">wikipedia article for the pattern</a> and I understand its mechanics but I'm still confused as to when I'd use it.</p> <p>As someon...
[ { "answer_id": 255300, "author": "Federico A. Ramponi", "author_id": 18770, "author_profile": "https://Stackoverflow.com/users/18770", "pm_score": 8, "selected": false, "text": "class Animal { };\nclass Dog: public Animal { };\nclass Cat: public Animal { };\n class Animal\n{ public: v...
2008/10/31
[ "https://Stackoverflow.com/questions/255214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
255,216
<p>So far, I've only been passing javascript strings to my web methods, which get parsed, usually as Guids. but now i have a method that accepts an IList... on the client, i build this array of objects and then attempt to pass it like: </p> <pre><code>$.ajax({ type: 'POST', url: 'personalization.aspx/SetPersonaliz...
[ { "answer_id": 255261, "author": "Duncan", "author_id": 25035, "author_profile": "https://Stackoverflow.com/users/25035", "pm_score": 2, "selected": false, "text": "data:{backerEntries: backerEntries }\n" }, { "answer_id": 255269, "author": "Shog9", "author_id": 811, ...
2008/10/31
[ "https://Stackoverflow.com/questions/255216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6350/" ]
255,278
<p>What would be the best way to determine if an object equals number zero (0) or string.empty in C#?</p> <p><b>EDIT:</b> The object can equal any built-in System.Value type or reference type.</p> <p>Source Code:</p> <pre><code>public void MyMethod(object input1, object input2) { bool result = false; object ...
[ { "answer_id": 255292, "author": "Eoin Campbell", "author_id": 30155, "author_profile": "https://Stackoverflow.com/users/30155", "pm_score": 1, "selected": false, "text": "string x = \"Some String\"\nif( string.IsNullOrEmpty(string input) ) { ... }\n int x = 0;\nif(x == 0) { ... }\n int?...
2008/10/31
[ "https://Stackoverflow.com/questions/255278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26327/" ]
255,302
<p>Hoping some of you TinyXML++ people can help me out. Really, since you recomended to me before I think you owe me ;)</p> <p>I have the following code:</p> <pre><code> //ticpp::Iterator&lt; ticpp::Element &gt; child( "SetPiece" ); ticpp::Iterator&lt; ticpp::Node &gt; child("SetPiece"); GLuint lc_SPieces =...
[ { "answer_id": 285834, "author": "paavo256", "author_id": 34911, "author_profile": "https://Stackoverflow.com/users/34911", "pm_score": 1, "selected": false, "text": "__non_rtti_object" } ]
2008/11/01
[ "https://Stackoverflow.com/questions/255302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23829/" ]
255,312
<p>Say i have this PHP code:</p> <pre><code>$FooBar = "a string"; </code></pre> <p>i then need a function like this:</p> <pre><code>print_var_name($FooBar); </code></pre> <p>which prints:</p> <pre><code>FooBar </code></pre> <p>Any Ideas how to achieve this? Is this even possible in PHP?</p>
[ { "answer_id": 255335, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 7, "selected": true, "text": "function print_var_name($var) {\n foreach($GLOBALS as $var_name => $value) {\n if ($value === $var) {\n ...
2008/11/01
[ "https://Stackoverflow.com/questions/255312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13227/" ]
255,317
<p>I have an asp.net page with a button. This button generates and inserts a user control into the page, so many controls could exist on one page. I need to validate that a certain dynamically generated control inside the generated control exists. </p> <p>So..Page has 0 to N Control1’s. Each Control 1 can have 0 to...
[ { "answer_id": 256251, "author": "SecretDeveloper", "author_id": 2720, "author_profile": "https://Stackoverflow.com/users/2720", "pm_score": 4, "selected": true, "text": "public interface IValidatableControl\n{\n bool IsValidControl(); \n}\n public class Control1 : IValidatableCont...
2008/11/01
[ "https://Stackoverflow.com/questions/255317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33253/" ]
255,337
<p>I want to read and write from serial using events/interrupts. Currently, I have it in a while loop and it continuously reads and writes through the serial. I want it to only read when something comes from the serial port. How do I implement this in C++?</p> <p>This is my current code:</p> <pre> while(true) ...
[ { "answer_id": 256251, "author": "SecretDeveloper", "author_id": 2720, "author_profile": "https://Stackoverflow.com/users/2720", "pm_score": 4, "selected": true, "text": "public interface IValidatableControl\n{\n bool IsValidControl(); \n}\n public class Control1 : IValidatableCont...
2008/11/01
[ "https://Stackoverflow.com/questions/255337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28462/" ]
255,341
<p>It's easy to get the value of a key from a .NET generic Dictionary:</p> <pre><code>Dictionary&lt;int, string&gt; greek = new Dictionary&lt;int, string&gt;(); greek.Add(1, "Alpha"); greek.Add(2, "Beta"); string secondGreek = greek[2]; // Beta </code></pre> <p>But trying to get the keys given a value is not as stra...
[ { "answer_id": 255348, "author": "dove", "author_id": 30913, "author_profile": "https://Stackoverflow.com/users/30913", "pm_score": 2, "selected": false, "text": "var key = (from k in yourDictionary where string.Compare(k.Value, \"yourValue\", true) == 0 select k.Key).FirstOrDefault();\...
2008/11/01
[ "https://Stackoverflow.com/questions/255341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22437/" ]
255,370
<p>I am developing Eclipse plugins, and I need to be able to automate the building and execution of the test suite for each plugin. (Using Junit)</p> <p>Test are working within Eclipse, and I can break the plugins into the actual plugin and a fragment plugin for unit testing as described <a href="http://dev.eclipse.o...
[ { "answer_id": 288064, "author": "jamesh", "author_id": 4737, "author_profile": "https://Stackoverflow.com/users/4737", "pm_score": 4, "selected": false, "text": "uitestapplication testApplication coretestapplication Java Result 13 PDETestListener" }, { "answer_id": 963808, "...
2008/11/01
[ "https://Stackoverflow.com/questions/255370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3446/" ]
255,393
<p>I'm trying to make a page in php that takes rows from a database, displays them, and then give the viewer a chance to upvote or downvote a specific entry. Here is a snippet:</p> <pre><code>echo("&lt;form action=\"vote.php\" method=\"post\"&gt; \n"); echo("&lt;INPUT type=\"hidden\" name=\"idnum\" value=\"".$row[0]."...
[ { "answer_id": 255396, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "</form> <form/>" }, { "answer_id": 255397, "author": "Kibbee", "author_id": 1862, "author_profile": "...
2008/11/01
[ "https://Stackoverflow.com/questions/255393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25680/" ]
255,400
<p>This is a very complicated question concerning how to serialize data via a web service call, when the data is not-strongly typed. I'll try to lay it out as best possible.</p> <p><strong>Sample Storage Object:</strong></p> <pre><code>[Serializable] public class StorageObject { public string Name { get; set; } ...
[ { "answer_id": 255411, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": -1, "selected": false, "text": "Dictionary<string,List<string>> OtherInfo List<NameValuePairs> List<string> hobbies = storageObject.OtherInfo[\"Hobbie...
2008/11/01
[ "https://Stackoverflow.com/questions/255400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27472/" ]
255,414
<p>I'm trying to write a small script to change the current directory to my project directory:</p> <pre><code>#!/bin/bash cd /home/tree/projects/java </code></pre> <p>I saved this file as proj, added execute permission with <code>chmod</code>, and copied it to <code>/usr/bin</code>. When I call it by: <code>proj</cod...
[ { "answer_id": 255415, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 10, "selected": true, "text": "cd alias proj=\"cd /home/tree/projects/java\"\n" }, { "answer_id": 255416, "author": "Adam Liss", "author...
2008/11/01
[ "https://Stackoverflow.com/questions/255414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33203/" ]
255,419
<p>Trying to write a PowerShell cmdlet that will mute the sound at start, unless already muted, and un-mute it at the end (only if it wasn't muted to begin with). Couldn't find any PoweShell or WMI object I could use. I was toying with using Win32 functions like <a href="http://msdn.microsoft.com/en-us/library/ms706237...
[ { "answer_id": 1670848, "author": "user202195", "author_id": 202195, "author_profile": "https://Stackoverflow.com/users/202195", "pm_score": 2, "selected": false, "text": "C:\\utils\\nircmd.exe mutesysvolume 0 # 1 to to unmute, 2 to toggle\n" }, { "answer_id": 12397737, "aut...
2008/11/01
[ "https://Stackoverflow.com/questions/255419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19856/" ]
255,422
<p>I would like to create an HTML table with row colors changing based on position and content. But instead of alternating every row, I'd like to be able to group rows together, so that I can have some XML like this:</p> <pre><code>&lt;itemlist&gt; &lt;item group="0"&gt;Conent...blah blah&lt;/item&gt; &lt;item ...
[ { "answer_id": 255467, "author": "jmcdowell", "author_id": 2421, "author_profile": "https://Stackoverflow.com/users/2421", "pm_score": 3, "selected": true, "text": "<xsl:template match=\"/\">\n <ul>\n <xsl:apply-templates select=\"itemlist/item\"/>\n </ul>\n</xsl:template>\n...
2008/11/01
[ "https://Stackoverflow.com/questions/255422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33263/" ]
255,423
<p>I seem to remember being able to print out (or locate) the specific switches that each -O&lt;num> option turns on. Can you remind?</p> <p>Thanks!</p>
[ { "answer_id": 255434, "author": "Federico A. Ramponi", "author_id": 18770, "author_profile": "https://Stackoverflow.com/users/18770", "pm_score": 2, "selected": false, "text": "$ man gcc\n" }, { "answer_id": 255440, "author": "CesarB", "author_id": 28258, "author_pro...
2008/11/01
[ "https://Stackoverflow.com/questions/255423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30636/" ]
255,429
<p>I would like to know if it is possible to determine if a function parameter with a default value was passed in Python. For example, how does dict.pop work?</p> <pre><code>&gt;&gt;&gt; {}.pop('test') Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; KeyError: 'pop(): dictionary is ...
[ { "answer_id": 255433, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "def isdefarg(*args):\n if len(args) > 0:\n print len(args), \"arguments\"\n else:\n print \"no argume...
2008/11/01
[ "https://Stackoverflow.com/questions/255429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24730/" ]
255,436
<p>Does anyone have any suggestions (or a regular expression) for parsing the HTTP Accept header?</p> <p>I am trying to do some content-type negotiation in ASP.NET MVC. There doesn't seem to be a built in way (which is fine, because there are a lot of schools of thought here), but the parsing is not entirely trivial a...
[ { "answer_id": 255541, "author": "Markus Jarderot", "author_id": 22364, "author_profile": "https://Stackoverflow.com/users/22364", "pm_score": 0, "selected": false, "text": "/([^()<>@,;:\\\\\"\\/[\\]?={} \\t]+)\\/([^()<>@,;:\\\\\"\\/[\\]?={} \\t]+)/\n *" }, { "answer_id": 4901130...
2008/11/01
[ "https://Stackoverflow.com/questions/255436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11173/" ]
255,445
<p>Does anyone have a library or JavaScript snippet to validate the check digit of credit cards before the user hits Submit?</p>
[ { "answer_id": 23222562, "author": "alexey", "author_id": 92238, "author_profile": "https://Stackoverflow.com/users/92238", "pm_score": 3, "selected": false, "text": "function validateCardNumber(number) {\n var regex = new RegExp(\"^[0-9]{16}$\");\n if (!regex.test(number))\n ...
2008/11/01
[ "https://Stackoverflow.com/questions/255445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27193/" ]
255,470
<p>As the title describes, what are the different doctypes available and what do they mean? I notice that the layout looks a little different in IE7 when I switch from </p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" &gt; </code></pre> <p>to</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-/...
[ { "answer_id": 255474, "author": "keparo", "author_id": 19468, "author_profile": "https://Stackoverflow.com/users/19468", "pm_score": 7, "selected": true, "text": "html head body <!DOCTYPE html>\n <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\"http://www.w3.org/TR/xhtml1/D...
2008/11/01
[ "https://Stackoverflow.com/questions/255470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2849/" ]
255,476
<p>I'm sure this has been asked before, but I can't find it. </p> <p>What are the benefits/limitations of using a browser-based interface for a stand-alone application vs. using a normal GUI framework?</p> <p>I'm working on a Python program currently implement with wxPython for the GUI. The application is simply user...
[ { "answer_id": 255514, "author": "dbr", "author_id": 745, "author_profile": "https://Stackoverflow.com/users/745", "pm_score": 2, "selected": false, "text": "<?php if($_POST[\"email\"] ==\"\"){echo(\"Are you sure you want to continue?); ?>" } ]
2008/11/01
[ "https://Stackoverflow.com/questions/255476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18676/" ]
255,509
<p>I've heard that projects developed using TDD are easier to refactor because the practice yields a comprehensive set of unit tests, which will (hopefully) fail if any change has broken the code. All of the examples I've seen of this, however, deal with refactoring implementation - changing an algorithm with a more ef...
[ { "answer_id": 255546, "author": "Pistos", "author_id": 28558, "author_profile": "https://Stackoverflow.com/users/28558", "pm_score": 1, "selected": false, "text": "if definition of correctness changes\n change tests/specs\nend\n\nif definition of correctness does not change\n # no nee...
2008/11/01
[ "https://Stackoverflow.com/questions/255509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32998/" ]
255,511
<p>What's the difference between \n and \r (I know it has something to do with OS), and what's the best way to echo a line break that will work cross platform?</p> <p><strong>EDIT:</strong> In response to Jarod, I'll be using ths to echo a line break in a .txt log file, though I'm sure I'll be using it in the future f...
[ { "answer_id": 255512, "author": "Jarod Elliott", "author_id": 1061, "author_profile": "https://Stackoverflow.com/users/1061", "pm_score": 7, "selected": true, "text": "\\n \\r \\n \\r\\n \\n" }, { "answer_id": 255531, "author": "Andrew Moore", "author_id": 26210, "au...
2008/11/01
[ "https://Stackoverflow.com/questions/255511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27025/" ]
255,516
<p>I used the method</p> <pre><code>$("#dvTheatres a").hover(function (){ $(this).css("text-decoration", "underline"); },function(){ $(this).css("text-decoration", "none"); } ); </code></pre> <p>Is there a more elegant method?(single line)</p>
[ { "answer_id": 255519, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 4, "selected": false, "text": "#dvTheatres a {\n text-decoration: none;\n}\n\n#dvTheatres a:hover {\n text-decoration: underline;\n}\n" }, { ...
2008/11/01
[ "https://Stackoverflow.com/questions/255516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17447/" ]
255,517
<p>I would like to construct a query that displays all the results in a table, but is offset by 5 from the start of the table. As far as I can tell, MySQL's <code>LIMIT</code> requires a limit as well as an offset. Is there any way to do this?</p>
[ { "answer_id": 271648, "author": "Czimi", "author_id": 3906, "author_profile": "https://Stackoverflow.com/users/3906", "pm_score": 5, "selected": false, "text": "SELECT * FROM somewhere LIMIT 18446744073709551610 OFFSET 5\n" }, { "answer_id": 271650, "author": "Greg", "au...
2008/11/01
[ "https://Stackoverflow.com/questions/255517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23335/" ]
255,527
<p>Is there a practical algorithm that gives "multiplication chains"</p> <p>To clarify, the goal is to produce a multiplication change of an <b>arbitrary and exact </b> length<br> Multiplication chains of length 1 are trivial.</p> <p>A "multiplication chain" would be defined as 2 numbers, {start} and {multiplier}, us...
[ { "answer_id": 255537, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 1, "selected": false, "text": "start = constant;\nmultiplier = 1;\n" }, { "answer_id": 255558, "author": "Federico A. Ramponi", "author_...
2008/11/01
[ "https://Stackoverflow.com/questions/255527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24404/" ]
255,534
<p>I got an HTML with the <code>&lt;body onload="window.print()"&gt;</code>. </p> <p>The question I'm trying to ask is:</p> <ul> <li>Is there any way to remove the strings that the web browsers add to the printed page?</li> <li>Such as: <ul> <li>Web site from where the page was printed</li> <li>Page count</li> <li>T...
[ { "answer_id": 52952161, "author": "SCaffrey", "author_id": 4597306, "author_profile": "https://Stackoverflow.com/users/4597306", "pm_score": 2, "selected": false, "text": "@page {\n margin: 0;\n}\n@media print {\n footer {\n display: none;\n position: fixed;\n bottom: 0;\n }...
2008/11/01
[ "https://Stackoverflow.com/questions/255534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26004/" ]
255,551
<p>I'm using autotools to build a shared object. </p> <p>Using <code>pkglib_LTLIBRARIES</code> in my Makefile.am causes a <code>libtest.la</code> AND <code>libtest.so</code> to be built.</p> <p>I <em>only</em> want it to build/install <code>libtest.so</code>.</p> <p>Is this possible?</p>
[ { "answer_id": 1385147, "author": "William Pursell", "author_id": 140750, "author_profile": "https://Stackoverflow.com/users/140750", "pm_score": 2, "selected": false, "text": "--disable-static configure" }, { "answer_id": 47289012, "author": "Vadim Kotov", "author_id": 1...
2008/11/01
[ "https://Stackoverflow.com/questions/255551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
255,553
<p>I've heard that it's possible with extension methods, but I can't quite figure it out myself. I'd like to see a specific example if possible.</p> <p>Thanks!</p>
[ { "answer_id": 255621, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 7, "selected": false, "text": "public class Mixin : ISomeInterface\n{\n private SomeImplementation impl implements ISomeInterface;\n\n public voi...
2008/11/01
[ "https://Stackoverflow.com/questions/255553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6408/" ]
255,569
<p>Which sql data type should we use for number bases primary key:</p> <ol> <li>int</li> <li>bigint</li> <li>numeric</li> <li>float</li> </ol>
[ { "answer_id": 255572, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 7, "selected": true, "text": "int bigint uniqueidentifier" }, { "answer_id": 489589, "author": "Joe Phillips", "author_id": 20471, "...
2008/11/01
[ "https://Stackoverflow.com/questions/255569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191/" ]
255,571
<p>I am having some trouble manipulating images using CodeIgniter 1.7. With the following code, the image is uploaded correctly. Alas, instead of a new image being made, and then modified; the existing image is modified. Any help?</p> <pre><code>//Upload image first $config['upload_path'] = './uploads/'; $config['all...
[ { "answer_id": 255628, "author": "dbr", "author_id": 745, "author_profile": "https://Stackoverflow.com/users/745", "pm_score": 2, "selected": false, "text": "$imagemanip['new_img'] = './uploads/'.$thumbnail;\n $imagemanip['new_image'] = './uploads/'.$thumbnail;\n" }, { "answer_id...
2008/11/01
[ "https://Stackoverflow.com/questions/255571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
255,612
<p>I have a class that contains a dynamically allocated array, say</p> <pre><code>class A { int* myArray; A() { myArray = 0; } A(int size) { myArray = new int[size]; } ~A() { // Note that as per MikeB's helpful style critique, no need to check against 0. ...
[ { "answer_id": 255649, "author": "IMil", "author_id": 11185, "author_profile": "https://Stackoverflow.com/users/11185", "pm_score": 4, "selected": false, "text": "typedef std::vector<int> A;\ntypedef std::vector<A> AS;\n" }, { "answer_id": 255681, "author": "Jim Buck", "a...
2008/11/01
[ "https://Stackoverflow.com/questions/255612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3191/" ]
255,624
<p>While using Vim (at home and at work), I often find myself doing similar things repeatedly. For example, I may turn a bunch of CSV text into a series of SQL inserts. I've been using Vim for years, but only recently have I tried to seriously think about how I could improve my productivity while using it.</p> <p>My q...
[ { "answer_id": 255650, "author": "ngn", "author_id": 23109, "author_profile": "https://Stackoverflow.com/users/23109", "pm_score": 2, "selected": false, "text": ".vimrc :map echo >>~/.vimrc \":map ,c :%s/,/','/g<CR>:%s/^/('/g<CR>:%s/$/'),/g<CR>\"\n ,c vim file.txt -c ':normal ,c | :x'\n"...
2008/11/01
[ "https://Stackoverflow.com/questions/255624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18866/" ]
255,642
<p>I have a database table named call with columns call_time, location, emergency_type and there are three types of emergency: paramedics, police and firefighters. In the windows form I created CheckBoxes 'paramedics', 'police', 'firefighters' and I want to retrieve all table columns which meet user's selection.</p> <...
[ { "answer_id": 255657, "author": "Ady", "author_id": 31395, "author_profile": "https://Stackoverflow.com/users/31395", "pm_score": 0, "selected": false, "text": "string select = \"SELECT call_time, location, emergency_type where call_time between @from AND @to AND (1=0\";\n\nif(paramedic...
2008/11/01
[ "https://Stackoverflow.com/questions/255642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22996/" ]
255,644
<p>Today somebody told me that interface implementation in C# is just "Can-Do" relationship, not "Is-A" relationship. This conflicts with my long-time believing in LSP(Liskov Substitution Principle). I always think that all inheritance should means "Is-A" relationship. </p> <p>So, If interface implementation is just a...
[ { "answer_id": 422110, "author": "Jon Davis", "author_id": 11398, "author_profile": "https://Stackoverflow.com/users/11398", "pm_score": 2, "selected": false, "text": "Foo myFoo = new Foo(); \nreturn myFoo is IBar;\n IBar bar = myArrayList[3] as IBar;\nFoo foo = bar as Foo;\n void DoSome...
2008/11/01
[ "https://Stackoverflow.com/questions/255644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26349/" ]
255,669
<p>How do I enable assembly bind failure logging (Fusion) in .NET?</p>
[ { "answer_id": 255670, "author": "user32736", "author_id": 32736, "author_profile": "https://Stackoverflow.com/users/32736", "pm_score": 7, "selected": false, "text": "Windows Registry Editor Version 5.00\n\n[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Fusion]\n\"EnableLog\"=dword:00000001\...
2008/11/01
[ "https://Stackoverflow.com/questions/255669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32736/" ]
255,700
<p>In my website, users have the possibility to store links.</p> <p>During typing the internet address into the designated field I would like to display a suggest/autocomplete box similar to Google Suggest or the Chrome Omnibar.</p> <p>Example:</p> <p>User is typing as URL:</p> <pre><code>http://www.sta </code></pr...
[ { "answer_id": 256099, "author": "lacker", "author_id": 2652, "author_profile": "https://Stackoverflow.com/users/2652", "pm_score": 2, "selected": false, "text": "www.yoursite.com/suggest?typed=www.sta\n" }, { "answer_id": 656223, "author": "Justin R.", "author_id": 4593,...
2008/11/01
[ "https://Stackoverflow.com/questions/255700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26763/" ]
255,714
<p>So I've got a Ruby method like this:</p> <pre><code>def something(variable, &amp;block) .... end </code></pre> <p>And I want to call it like this:</p> <pre><code>something 'hello' { do_it } </code></pre> <p>Except that isn't working for me, I'm getting a syntax error. If I do this instead, it works:</p> <pre>...
[ { "answer_id": 255732, "author": "seanbehan", "author_id": 155970, "author_profile": "https://Stackoverflow.com/users/155970", "pm_score": 2, "selected": false, "text": "#to uppercase string\ndef something(my_input)\n yield my_input.upcase\nend\n\n# => \"HELLO WORLD\"\nsomething(\"hello ...
2008/11/01
[ "https://Stackoverflow.com/questions/255714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14873/" ]
255,741
<p>I'm a complete Ada newbie, though I've used Pascal for 2-3 years during HS.</p> <p>IIRC, it is possible to call Pascal compiled functions from C/C++. Is it possible to call procedures &amp; functions written in Ada from C++?</p>
[ { "answer_id": 41819129, "author": "Glen", "author_id": 7386272, "author_profile": "https://Stackoverflow.com/users/7386272", "pm_score": 3, "selected": false, "text": " package Ada_Pkg is\n procedure DoSomething (Number : in Integer);\n pragma Export (C, DoSomething, \"...
2008/11/01
[ "https://Stackoverflow.com/questions/255741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14069/" ]
255,771
<p>I need a modal dialog to gather some user input. I then need the same data to be consumed by the application MainFrame.</p> <p>Usually my Modal Dialog would have a pointer to some DataType able to store what I need, and I'd be passing this object by reference from the MainFrame in order to be able to recover data ...
[ { "answer_id": 255790, "author": "Samuel", "author_id": 32465, "author_profile": "https://Stackoverflow.com/users/32465", "pm_score": 3, "selected": true, "text": "public string UserName\n{\n get { return userNameTextBox.Text; }\n}\n Dialog dialog = new Dialog();\nif (dialog.ShowDialo...
2008/11/01
[ "https://Stackoverflow.com/questions/255771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311500/" ]
255,785
<p>Does a tool exist for dynamically altering running javascript in a browser? For example, to change the values of javascript variables during runtime.</p>
[ { "answer_id": 255793, "author": "Ady", "author_id": 31395, "author_profile": "https://Stackoverflow.com/users/31395", "pm_score": -1, "selected": false, "text": "<script type=\"text/javascript\" language=\"javascript\">\n example = function() {alert('first');}\n example();\n eval(\"e...
2008/11/01
[ "https://Stackoverflow.com/questions/255785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13227/" ]
255,797
<p>In what areas of programming would I use state machines ? Why ? How could I implement one ?</p> <p><strong>EDIT:</strong> please provide a practical example , if it's not too much to ask .</p>
[ { "answer_id": 255826, "author": "Charles Duffy", "author_id": 14122, "author_profile": "https://Stackoverflow.com/users/14122", "pm_score": 2, "selected": false, "text": "http://web.dyfis.net/bzr/isg_state_machine_framework/" }, { "answer_id": 255886, "author": "EvilTeach", ...
2008/11/01
[ "https://Stackoverflow.com/questions/255797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31610/" ]
255,800
<p>I'm making a program which the user build directories (not in windows, in my app) and in these folders there are subfolders and so on; every folder must contain either folders or documents. What is the best data structure to use? Notice that the user may select a subfolder and search for documents in it and in its s...
[ { "answer_id": 255841, "author": "Jason", "author_id": 16794, "author_profile": "https://Stackoverflow.com/users/16794", "pm_score": 5, "selected": true, "text": "Root\n Folder1\n Folder2\n Folder3\n Folder4\n Folder5\n Folder6\n ID ParentID Name\n\n0000 ...
2008/11/01
[ "https://Stackoverflow.com/questions/255800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29276/" ]
255,815
<p>I have the following line:</p> <pre><code>"14:48 say;0ed673079715c343281355c2a1fde843;2;laka;hello ;)" </code></pre> <p>I parse this by using a simple regexp:</p> <pre><code>if($line =~ /(\d+:\d+)\ssay;(.*);(.*);(.*);(.*)/) { my($ts, $hash, $pid, $handle, $quote) = ($1, $2, $3, $4, $5); } </code></pre> <p>Bu...
[ { "answer_id": 255827, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": false, "text": "(.*) (.*?)" }, { "answer_id": 255832, "author": "VonC", "author_id": 6309, "author_profile": "https://Sta...
2008/11/01
[ "https://Stackoverflow.com/questions/255815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33232/" ]
255,830
<p>I'm looking for someone to explain how to drag and drop in javascript, I want a horizontal line with some customizable images in it.</p> <p>I've had a look at the online tutorials for these but find them very hard to use.</p>
[ { "answer_id": 255884, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "print(\"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional...
2008/11/01
[ "https://Stackoverflow.com/questions/255830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
255,846
<p>I'm having a lot of issues with NSDate objects being prematurely deallocated. I suspect that the issues may be related to the way that I deal with the objects returned from NSDate convenience methods. I <em>think</em> that my showDate property declaration in the JKShow class should be "retain", but changing it to as...
[ { "answer_id": 255931, "author": "Peter Hosey", "author_id": 30461, "author_profile": "https://Stackoverflow.com/users/30461", "pm_score": 0, "selected": false, "text": "list" }, { "answer_id": 255983, "author": "kubi", "author_id": 28422, "author_profile": "https://S...
2008/11/01
[ "https://Stackoverflow.com/questions/255846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28422/" ]
255,852
<p>I've been writing a lot recently about Parallel computing and programming and I do notice that there are a lot of patterns that come up when it comes to parallel computing. Noting that Microsoft already has released a library along with the Microsoft Visual C++ 2010 Community Technical Preview (named Parallel Patter...
[ { "answer_id": 46700626, "author": "Beached", "author_id": 202861, "author_profile": "https://Stackoverflow.com/users/202861", "pm_score": 1, "selected": false, "text": "auto fut = async([]( ){..some work...} ).then( [](result_of_prev ){...more work} ).then... ;\nfut.wait( );\n auto sema...
2008/11/01
[ "https://Stackoverflow.com/questions/255852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11274/" ]
255,857
<p>I am trying to insert an image (jpg) in to a word document and the Selection.InlineShapes.AddPicture does not seem to be supported by win32old or I am doing something wrong. Has anyone had any luck inserting images. </p>
[ { "answer_id": 258389, "author": "Mike Woodhouse", "author_id": 1060, "author_profile": "https://Stackoverflow.com/users/1060", "pm_score": 1, "selected": false, "text": "require 'win32ole'\n\nbegin\n word = WIN32OLE::new('Word.Application') # create winole Object\n doc = word.Docume...
2008/11/01
[ "https://Stackoverflow.com/questions/255857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
255,862
<p>Netbeans is great but there's no way to wrap text in it (or hopefully I haven't found it yet). Is there any way to do this, and if not, is there any similarly good IDE for Java with this functionality (hopefully free as well).</p>
[ { "answer_id": 4059100, "author": "Sidarta", "author_id": 269056, "author_profile": "https://Stackoverflow.com/users/269056", "pm_score": 6, "selected": false, "text": "-J-Dorg.netbeans.editor.linewrap=true\n netbeans_default_options=\"-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-X...
2008/11/01
[ "https://Stackoverflow.com/questions/255862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
255,876
<p>I want to make an MVC route for a list of news, which can be served in several formats.</p> <ul> <li>news -> (X)HTML</li> <li>news.rss -> RSS</li> <li>news.atom -> ATOM</li> </ul> <p>Is it possible to do this (the more general "optional extension" situation crops up in several places in my planned design) with one...
[ { "answer_id": 255880, "author": "Doug McClean", "author_id": 11173, "author_profile": "https://Stackoverflow.com/users/11173", "pm_score": 5, "selected": true, "text": "public static void MapRouteWithOptionalFormat(this RouteCollection routes,\n ...
2008/11/01
[ "https://Stackoverflow.com/questions/255876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11173/" ]
255,879
<p>I need some help with WPF binding syntax:</p> <pre><code>public class ApplicationPresenter { public ObservableCollection&lt;Quotes&gt; PriceList {get;} } public class WebSitePricesView { private IApplicationPresenter presenter { get { return (ApplicationPresenter)DataContext; } } // p...
[ { "answer_id": 256249, "author": "Ian Oakes", "author_id": 21606, "author_profile": "https://Stackoverflow.com/users/21606", "pm_score": 1, "selected": false, "text": "public class Quotes\n{\n public string Description { get; set; }\n public decimal Value { get; set; }\n}\n\npublic...
2008/11/01
[ "https://Stackoverflow.com/questions/255879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30046/" ]
255,898
<p>I have a complex command that I'd like to make a shell/bash script of. I can write it in terms of <code>$1</code> easily:</p> <pre><code>foo $1 args -o $1.ext </code></pre> <p>I want to be able to pass multiple input names to the script. What's the right way to do it? </p> <p>And, of course, I want to handle fi...
[ { "answer_id": 255913, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 12, "selected": true, "text": "\"$@\" for var in \"$@\"\ndo\n echo \"$var\"\ndone\n sh test.sh 1 2 '3 4'\n1\n2\n3 4\n" }, { "answer_id":...
2008/11/01
[ "https://Stackoverflow.com/questions/255898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12874/" ]
255,907
<p>In Visual Studio 2008 in a C# WinForms project, there is a button on a form. In the properties view, the property "Font" is set to "Arial Unicode MS".</p> <p>What do I need to put into the property "Text", so I get the unicode character \u0D15 displayed on the button?</p> <p>When I put \u0D15 into the "Text" prope...
[ { "answer_id": 255918, "author": "Tamas Czinege", "author_id": 8954, "author_profile": "https://Stackoverflow.com/users/8954", "pm_score": 4, "selected": true, "text": "button1.Text = \"日本\";\n" }, { "answer_id": 67694137, "author": "Ragheed Al-Tayeb", "author_id": 125198...
2008/11/01
[ "https://Stackoverflow.com/questions/255907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33311/" ]
255,916
<p>I use BIRT since early days and still have riddles regarding PDF emitter. </p> <p><strong>Short story</strong>: Can I configure fontsConfig.xml to load fonts from relative path or from jars?</p> <p><strong>Long story:</strong> We are using both FOP and BIRT for generating PDF in our web application. It would be ni...
[ { "answer_id": 21705054, "author": "hvb", "author_id": 2814025, "author_profile": "https://Stackoverflow.com/users/2814025", "pm_score": 3, "selected": true, "text": "EngineConfig engineConfig = new EngineConfig();\nURL fontsConfigurationURL = new URL(\"file:///path/to/my/fontsConfig.xml...
2008/11/01
[ "https://Stackoverflow.com/questions/255916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19347/" ]
255,927
<p>I'm writing an iOS app with a table view inside a tab view. In my <code>UITableViewController</code>, I implemented <code>-tableView:didSelectRowAtIndexPath:</code>, but when I select a row at runtime, the method isn't being called. The table view is being populated though, so I know that other tableView methods in...
[ { "answer_id": 255961, "author": "Hunter", "author_id": 555, "author_profile": "https://Stackoverflow.com/users/555", "pm_score": 8, "selected": true, "text": "UITableViewDelegate UITableViewController" }, { "answer_id": 4023700, "author": "JackPearse", "author_id": 48761...
2008/11/01
[ "https://Stackoverflow.com/questions/255927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5815/" ]
255,928
<p>The MSI stores the installation directory for the future uninstall tasks.</p> <p>Using the <code>INSTALLPROPERTY_INSTALLLOCATION</code> property (that is <code>"InstallLocation"</code>) works only the installer has set the <code>ARPINSTALLLOCATION</code> property during the installation. But this property is option...
[ { "answer_id": 48016963, "author": "eduardomozart", "author_id": 1031340, "author_profile": "https://Stackoverflow.com/users/1031340", "pm_score": 0, "selected": false, "text": "%ProgramFiles(x86)%\\Natural Docs HKLM\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall H...
2008/11/01
[ "https://Stackoverflow.com/questions/255928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23372/" ]
255,941
<p>Is there anything out there freeware or commercial that can facilitate analysis of memory usage by a PHP application? I know xdebug can produce trace files that shows memory usage by function call but without a graphical tool the data is hard to interpret. </p> <p>Ideally I would like to be able to view not only t...
[ { "answer_id": 329809, "author": "EvilPuppetMaster", "author_id": 20851, "author_profile": "https://Stackoverflow.com/users/20851", "pm_score": 3, "selected": false, "text": "sort -bgrk 3 -o sorted.txt mytracefile.xt \n function analyzeMem($obj, $deep=false)\n{\n if (!is_scalar($obj))...
2008/11/01
[ "https://Stackoverflow.com/questions/255941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043539/" ]
255,942
<p>I'm using Castle ActiveRecord for persistence, and I'm trying to write a base class for my persistence tests which will do the following:</p> <ul> <li>Open a transaction for each test case and roll it back at the end of the test case, so that I get a clean DB for each test case without me having to rebuild the sche...
[ { "answer_id": 258313, "author": "kͩeͣmͮpͥ ͩ", "author_id": 26479, "author_profile": "https://Stackoverflow.com/users/26479", "pm_score": 1, "selected": false, "text": "IDbTransaction TransactionScope ITransaction IDbTransaction SessionScope TransactionScope FlushMode SessionScope FindAl...
2008/11/01
[ "https://Stackoverflow.com/questions/255942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12006/" ]
255,955
<p>Returning to WinForms in VS2008 after a long time.. Tinkering with a OOD problem in VS2008 Express Edition.</p> <p>I need some controls to be "display only" widgets. The user should not be able to change the value of these controls... the widgets are updated by a periodic update tick event. I vaguely remember there...
[ { "answer_id": 255965, "author": "Gulzar Nazim", "author_id": 4337, "author_profile": "https://Stackoverflow.com/users/4337", "pm_score": 5, "selected": true, "text": " Color clr = textBox1.BackColor;\n textBox1.ReadOnly = true;\n textBox1.BackColor = clr;\n" }, { "answe...
2008/11/01
[ "https://Stackoverflow.com/questions/255955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695/" ]
255,969
<p>I'm struggling with Test::Unit. When I think of unit tests, I think of one simple test per file. But in Ruby's framework, I must instead write: </p> <pre><code>class MyTest &lt; Test::Unit::TestCase def setup end def test_1 end def test_1 end end </code></pre> <p>But setup and teardown r...
[ { "answer_id": 256063, "author": "Rômulo Ceccon", "author_id": 23193, "author_profile": "https://Stackoverflow.com/users/23193", "pm_score": 3, "selected": false, "text": "setup tear_down require 'test/unit'\nrequire 'test/unit/ui/console/testrunner'\n\nclass TestDecorator < Test::Unit::...
2008/11/01
[ "https://Stackoverflow.com/questions/255969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8913/" ]
256,021
<p>I have written a script that goes through a bunch of files and snips out a portion of the files for further processing. The script creates a new directory and creates new files for each snip that is taken out. I have to now evaluate each of the files that were created to see if it is what I needed. The script also...
[ { "answer_id": 303086, "author": "PyNEwbie", "author_id": 30105, "author_profile": "https://Stackoverflow.com/users/30105", "pm_score": 1, "selected": true, "text": "def OnDelete(self, event):\n assert self.current, \"invalid delete operation\"\n try:\n os.remove(os.path.joi...
2008/11/01
[ "https://Stackoverflow.com/questions/256021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30105/" ]
256,027
<p>I am developing an application which will be connected to Access database at the beginning and the plan is to switch to MS SQL or SQL Express in the near future. The datatables structures are same for both types of databases and I am trying to avoid duplicating the code and trying to find the way to minimize the cod...
[ { "answer_id": 303086, "author": "PyNEwbie", "author_id": 30105, "author_profile": "https://Stackoverflow.com/users/30105", "pm_score": 1, "selected": true, "text": "def OnDelete(self, event):\n assert self.current, \"invalid delete operation\"\n try:\n os.remove(os.path.joi...
2008/11/01
[ "https://Stackoverflow.com/questions/256027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22996/" ]
256,033
<p>Is std::string size() a O(1) operation?</p> <p>The implementation of STL I'm using is the one built into VC++</p>
[ { "answer_id": 256045, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": -1, "selected": false, "text": "size_type __CLR_OR_THIS_CALL size() const\n\n{ // return length of sequence\n\n return (_Mysize);\n\n}\n" }, { "...
2008/11/01
[ "https://Stackoverflow.com/questions/256033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
256,038
<p>I'm using a <code>std::map</code> (VC++ implementation) and it's a little slow for lookups via the map's find method. </p> <p>The key type is <code>std::string</code>.</p> <p>Can I increase the performance of this <code>std::map</code> lookup via a custom key compare override for the map? For example, maybe <code>...
[ { "answer_id": 256089, "author": "Motti", "author_id": 3848, "author_profile": "https://Stackoverflow.com/users/3848", "pm_score": 4, "selected": false, "text": "set < == set set string.length struct comp {\n bool operator()(const std::string& lhs, const std::string& rhs)\n {\n ...
2008/11/01
[ "https://Stackoverflow.com/questions/256038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
256,065
<p><strong>NOTE</strong>: I mention the next couple of paragraphs as background. If you just want a TL;DR, feel free to skip down to the numbered questions as they are only indirectly related to this info.</p> <p>I'm currently writing a python script that does some stuff with POSIX dates (among other things). Unit ...
[ { "answer_id": 796933, "author": "mouviciel", "author_id": 45249, "author_profile": "https://Stackoverflow.com/users/45249", "pm_score": 0, "selected": false, "text": "if (a > 0)\n // Do Foo\nelse (if b < 0)\n // Do Bar\nelse\n // Do Foobar\n a b int Foo Bar Foobar Foo Bar Fooba...
2008/11/01
[ "https://Stackoverflow.com/questions/256065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
256,073
<p>I'm not sure why I'm getting this error, but shouldn't this code compile, since I'm already checking to see if queue is getting initialized? </p> <pre><code>public static void Main(String[] args) { Byte maxSize; Queue queue; if(args.Length != 0) { if(Byte.TryParse(args[0], out maxSize)) ...
[ { "answer_id": 256078, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 7, "selected": true, "text": "queue Queue queue = null;\n" }, { "answer_id": 256375, "author": "Mark Brackett", "author_id": 2199, ...
2008/11/01
[ "https://Stackoverflow.com/questions/256073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33324/" ]
256,077
<p>What is the right way to perform some static finallization? </p> <p>There is no static destructor. The <code>AppDomain.DomainUnload</code> event is not raised in the default domain. The <code>AppDomain.ProcessExit</code> event shares the total time of the three seconds (default settings) between all event handlers,...
[ { "answer_id": 256085, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 6, "selected": true, "text": "AppDomain.ProcessExit" }, { "answer_id": 256278, "author": "Michael Damatov", "author_id": 23372, "au...
2008/11/01
[ "https://Stackoverflow.com/questions/256077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23372/" ]
256,093
<p>I'm trying to use class names to change the color of a link after it has been selected, so that It will remain the new color, but only until another link is selected, and then it will change back.</p> <p>I'm using this code that was posted by Martin Kool in <a href="https://stackoverflow.com/questions/206689/changi...
[ { "answer_id": 256113, "author": "bobince", "author_id": 18936, "author_profile": "https://Stackoverflow.com/users/18936", "pm_score": 0, "selected": false, "text": "var siblings = el.parentNode.childNodes;\n" }, { "answer_id": 256143, "author": "Greg", "author_id": 24181...
2008/11/01
[ "https://Stackoverflow.com/questions/256093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
256,142
<p>When I try to commit the first revision to my git repository (git commit) from Cygwin, I'm getting an error in gvim which says "Unable to open swap file for "foo\.git\COMMIT_EDITMSG" [New Directory]. I think it might be some sort of permission problem, but I've tried removing the read-only flag from the folder, as w...
[ { "answer_id": 256168, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 2, "selected": false, "text": "git commit \\ gvim git SVN_EDITOR cygpath #!/bin/bash\ngvim \"$(cygpath --unix \"${1}\")\"\n" }, { "answer_id": 4...
2008/11/01
[ "https://Stackoverflow.com/questions/256142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32539/" ]
256,146
<p>Delphi 2009, among some cool stuff, has also just got Anonymous methods. I've seen the examples, and the blog posts regarding anonymous methods, but I don't get them yet. Can someone explain why I should be excited?</p>
[ { "answer_id": 256167, "author": "Toon Krijthe", "author_id": 18061, "author_profile": "https://Stackoverflow.com/users/18061", "pm_score": 4, "selected": false, "text": "type\n TAnonFunc = reference to procedure;\n TForm2 = class(TForm)\n Memo1: TMemo;\n Button1: TButton;\n B...
2008/11/01
[ "https://Stackoverflow.com/questions/256146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22712/" ]
256,148
<p>This is going to sound like a silly question, but I'm still learning C, so please bear with me. :)</p> <p>I'm working on chapter 6 of K&amp;R (structs), and thus far through the book have seen great success. I decided to work with structs pretty heavily, and therefore did a lot of work early in the chapter with the...
[ { "answer_id": 256153, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "https://Stackoverflow.com/users/3153", "pm_score": 5, "selected": true, "text": "void canonRect(struct rect *r) {\n struct rect temp;\n temp.lowerLeft.x = min(r->lowerLeft.x, r->upperRight.x);\...
2008/11/01
[ "https://Stackoverflow.com/questions/256148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14048/" ]
256,169
<p>What is the best OS for Java development? People from Sun are pushing the Solaris, yes Solaris have some extra features included in itself such as (dTrace, possibility for Performance tuning the JVM, etc.. ). Some friends of mine, had port their application on solaris, and they said to me that the performances was b...
[ { "answer_id": 256670, "author": "bendin", "author_id": 33396, "author_profile": "https://Stackoverflow.com/users/33396", "pm_score": 6, "selected": true, "text": "linux32" } ]
2008/11/01
[ "https://Stackoverflow.com/questions/256169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16039/" ]
256,172
<p>The company I work for has recently been hit with many header injection and file upload exploits on the sites we host and while we have fixed the problem with respect to header injection attacks, we have yet to get the upload exploits under control.</p> <p>I'm trying to set up a plug-and-play-type series of upload ...
[ { "answer_id": 18530956, "author": "inf3rno", "author_id": 607033, "author_profile": "https://Stackoverflow.com/users/607033", "pm_score": 6, "selected": false, "text": "MAX_FILE_SIZE size count ini_set('post_max_size', '40M'); //or bigger by multiple files\nini_set('upload_max_filesize'...
2008/11/01
[ "https://Stackoverflow.com/questions/256172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25375/" ]
256,195
<p>I'm using jQuery to wire up some mouseover effects on elements that are inside an UpdatePanel. The events are bound in <code>$(document).ready</code> . For example:</p> <pre><code>$(function() { $('div._Foo').bind("mouseover", function(e) { // Do something exciting }); }); </code></pre> <p>...
[ { "answer_id": 256253, "author": "Dan Herbert", "author_id": 392, "author_profile": "https://Stackoverflow.com/users/392", "pm_score": 10, "selected": true, "text": "$(document).ready() PageRequestManager $(document).ready(function() {\n // bind your jQuery events here initially\n});\...
2008/11/01
[ "https://Stackoverflow.com/questions/256195", "https://Stackoverflow.com", "https://Stackoverflow.com/users/239663/" ]
256,204
<p>I use the <code>:e</code> and <code>:w</code> commands to edit and to write a file. I am not sure if there is "close" command to close the current file without leaving Vim?</p> <p>I know that the <code>:q</code> command can be used to close a file, but if it is the last file, Vim is closed as well; Actually on Mac ...
[ { "answer_id": 256206, "author": "Rytmis", "author_id": 266, "author_profile": "https://Stackoverflow.com/users/266", "pm_score": 3, "selected": false, "text": ":enew :enew! :ls" }, { "answer_id": 256208, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile...
2008/11/01
[ "https://Stackoverflow.com/questions/256204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/62776/" ]
256,218
<p>Let's say I have a <code>char* str = "0123456789"</code> and I want to cut the first and the last three letters and print just the middle, what is the simplest, and safest, way of doing it?</p> <p>Now the trick: The portion to cut and the portion to print are of variable size, so I could have a very long char*, or ...
[ { "answer_id": 256223, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 7, "selected": true, "text": "printf() char *str = \"0123456789\";\nprintf(\"%.6s\\n\", str + 1);\n %s int length = 6;\nchar *str = \"0123456789\";...
2008/11/01
[ "https://Stackoverflow.com/questions/256218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21648/" ]
256,222
<p>I was wondering about the best practices for indicating invalid argument combinations in Python. I've come across a few situations where you have a function like so:</p> <pre><code>def import_to_orm(name, save=False, recurse=False): """ :param name: Name of some external entity to import. :param save: S...
[ { "answer_id": 256235, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 4, "selected": false, "text": "ValueError" }, { "answer_id": 256236, "author": "Markus Jarderot", "author_id": 22364, "author_p...
2008/11/01
[ "https://Stackoverflow.com/questions/256222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3594/" ]
256,228
<p>I'm trying to read data from a photocell resistor and my Arduino Decimila and then graph it in real-time with Processing.</p> <p>Should be painfully simple; but its growing into a little bit of a nightmare for me.</p> <p>code I'm running on my Arduino:</p> <pre class="lang-java prettyprint-override"><code>int p...
[ { "answer_id": 19803246, "author": "Mateo Sanchez", "author_id": 2741380, "author_profile": "https://Stackoverflow.com/users/2741380", "pm_score": 3, "selected": true, "text": "<iframe id=\"igraph\" src=\"https://plot.ly/~abhishek.mitra.963/1/400/250/\" width=\"400\" height=\"250\" seaml...
2008/11/01
[ "https://Stackoverflow.com/questions/256228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13293/" ]
256,229
<p>I'm building an ASP.NET web application, and all of my strings are stored in a resource file. I'd like to add a second language to my application, and ideally, I'd like to auto-detect the user's browser language (or windows language) and default to that, instead of making them choose something besides English. Curre...
[ { "answer_id": 256244, "author": "Jeff Fritz", "author_id": 29156, "author_profile": "https://Stackoverflow.com/users/29156", "pm_score": 2, "selected": false, "text": "CultureInfo.CurrentCulture Page_OnInit() Thread.CurrentThread.CurrentCulture = new CultureInfo(HttpContext.Current.Requ...
2008/11/01
[ "https://Stackoverflow.com/questions/256229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8114/" ]
256,234
<p>(If anything here needs clarification/ more detail please let me know.)</p> <p>I have an application (C#, 2.* framework) that interfaces with a third-party webservice using SOAP. I used thinktecture's WSCF add-in against a supplied WSDL to create the client-side implementation. For reasons beyond my control the SO...
[ { "answer_id": 256273, "author": "Ray Lu", "author_id": 11413, "author_profile": "https://Stackoverflow.com/users/11413", "pm_score": 4, "selected": true, "text": "public class MyClientSOAPExtension : SoapExtension\n{\n\n Stream oldStream;\n Stream newStream;\n\n // Save the ...
2008/11/01
[ "https://Stackoverflow.com/questions/256234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30901/" ]
256,254
<p>I have been researching and playing with functional programming lately, solely to broaden my thinking about programming, because I find thinking "functionally" difficult.</p> <p>I have downloaded Glasgow Haskell and experimented with that.</p> <p>What I am wondering is, what is the best platform for Windows to exp...
[ { "answer_id": 256332, "author": "Loopo", "author_id": 32763, "author_profile": "https://Stackoverflow.com/users/32763", "pm_score": 0, "selected": false, "text": "?- bend(your_mind).\nYes\n\n\n?- bend(X).\nX = your_mind\n" } ]
2008/11/01
[ "https://Stackoverflow.com/questions/256254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8946/" ]