qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
128,241
<p>Here's a question that's been haunting me for a year now. The root question is how do I set the size of an element relative to its parent so that it is inset by N pixels from every edge? Setting the width would be nice, but you don't know the width of the parent, and you want the elements to resize with the window. ...
[ { "answer_id": 128253, "author": "Dan", "author_id": 17121, "author_profile": "https://Stackoverflow.com/users/17121", "pm_score": 0, "selected": false, "text": "display:block" }, { "answer_id": 128293, "author": "cllpse", "author_id": 20946, "author_profile": "https:...
2008/09/24
[ "https://Stackoverflow.com/questions/128241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5114/" ]
128,259
<p>I have a list of data in the following form:</p> <p><code>[(id\__1_, description, id\_type), (id\__2_, description, id\_type), ... , (id\__n_, description, id\_type))</code></p> <p>The data are loaded from files that belong to the same group. In each group there could be multiples of the same id, each coming from ...
[ { "answer_id": 128361, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 2, "selected": false, "text": "{ 'id1': [ ('description1a', 'type1'), ('description1b','type1') ], \n 'id2': [ ('description2', 'type2') ],\n...\n}\n { '...
2008/09/24
[ "https://Stackoverflow.com/questions/128259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14107/" ]
128,267
<p>I'm trying to define a task that emits (using echo) a message when a target completes execution, regardless of whether that target was successful or not. Specifically, the target executes a task to run some unit tests, and I want to emit a message indicating where the results are available:</p> <pre><code>&lt;tar...
[ { "answer_id": 128325, "author": "bernie", "author_id": 21141, "author_profile": "https://Stackoverflow.com/users/21141", "pm_score": 3, "selected": false, "text": "<target name=\"myTarget\">\n <trycatch property=\"foo\" reference=\"bar\">\n <try>\n <testing outputdi...
2008/09/24
[ "https://Stackoverflow.com/questions/128267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16977/" ]
128,277
<p><strong>UPDATE</strong></p> <p>I'm basically binding the query to a WinForms <code>DataGridView</code>. I want the column headers to be appropriate and have spaces when needed. For example, I would want a column header to be <code>First Name</code> instead of <code>FirstName</code>.</p> <hr> <p>How do you create ...
[ { "answer_id": 128391, "author": "Scott Nichols", "author_id": 4299, "author_profile": "https://Stackoverflow.com/users/4299", "pm_score": 5, "selected": false, "text": "var query = from u in db.Users\n select new\n {\n FirstName = u.FirstName,\n ...
2008/09/24
[ "https://Stackoverflow.com/questions/128277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/299/" ]
128,279
<p>I have a <a href="http://en.wikipedia.org/wiki/WiX" rel="nofollow noreferrer">WiX</a> installer and a single custom action (plus undo and rollback) for it which uses a property from the installer. The custom action has to happen after all the files are on the hard disk. It seems that you need 16 entries in the WXS f...
[ { "answer_id": 152961, "author": "Mike Dimmick", "author_id": 6970, "author_profile": "https://Stackoverflow.com/users/6970", "pm_score": 2, "selected": false, "text": "CustomAction Custom MsiDoAction MsiDoAction MsiSetProperty IISExtension" }, { "answer_id": 6371772, "author...
2008/09/24
[ "https://Stackoverflow.com/questions/128279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20686/" ]
128,287
<p>What is currently the best tool for JavaME unit testing? I´ve never really used unit testing before (shame on me!), so learning curve is important. I would appreciate some pros and cons with your answer. :)</p>
[ { "answer_id": 128318, "author": "Powerlord", "author_id": 15880, "author_profile": "https://Stackoverflow.com/users/15880", "pm_score": 0, "selected": false, "text": "@Before @After @BeforeClass @AfterClass" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/128287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12423/" ]
128,305
<p>How to tag images in the image itself in a web page? </p> <p>I know <a href="http://www.taggify.net/" rel="nofollow noreferrer">Taggify</a>, but... is there other options?</p> <p><a href="http://en.blog.orkut.com/2008/06/tag-thats-me.html" rel="nofollow noreferrer">Orkut</a> also does it to tag people faces... How...
[ { "answer_id": 128518, "author": "Luke Foust", "author_id": 646, "author_profile": "https://Stackoverflow.com/users/646", "pm_score": 2, "selected": false, "text": "public static BitmapMetadata GetMetaData(string path)\n{\n using (Stream s = new System.IO.FileStream(path, FileMode.Ope...
2008/09/24
[ "https://Stackoverflow.com/questions/128305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1100/" ]
128,342
<p>For a project of mine I would love to provide auto completion for a specific textarea. Similar to how intellisense/omnicomplete works. For that however I have to find out the absolute cursor position so that I know where the DIV should appear.</p> <p>Turns out: that's (nearly I hope) impossible to achieve. Does ...
[ { "answer_id": 163395, "author": "enobrev", "author_id": 14651, "author_profile": "https://Stackoverflow.com/users/14651", "pm_score": 5, "selected": false, "text": "selection.end y x context.measureText selection.end <!DOCTYPE html>\n<html lang=\"en-US\">\n <head>\n <meta char...
2008/09/24
[ "https://Stackoverflow.com/questions/128342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19990/" ]
128,343
<p>I am currently initializing a Hashtable in the following way:</p> <pre><code>Hashtable filter = new Hashtable(); filter.Add("building", "A-51"); filter.Add("apartment", "210"); </code></pre> <p>I am looking for a nicer way to do this.</p> <p>I tried something like </p> <pre><code>Hashtable filter2 = new Hashtabl...
[ { "answer_id": 128367, "author": "mattlant", "author_id": 14642, "author_profile": "https://Stackoverflow.com/users/14642", "pm_score": 3, "selected": false, "text": "Hashtable table = new Hashtable {{1, 1}, {2, 2}};\n" }, { "answer_id": 128409, "author": "Paul Batum", "a...
2008/09/24
[ "https://Stackoverflow.com/questions/128343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14755/" ]
128,348
<p>If I have a series of points as longitude and latitude, how would I calculate the center of all of those points?</p>
[ { "answer_id": 128384, "author": "Skizz", "author_id": 1898, "author_profile": "https://Stackoverflow.com/users/1898", "pm_score": 2, "selected": false, "text": "A. .B\n A. C. .B\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/128348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19235/" ]
128,349
<p>Date coming out of a database, need to format as "mm/dd/yy"</p> <pre><code>For Each dr as DataRow in ds.Tables(0).Rows Response.Write(dr("CreateDate")) Next </code></pre>
[ { "answer_id": 128356, "author": "Geoff", "author_id": 1097, "author_profile": "https://Stackoverflow.com/users/1097", "pm_score": 0, "selected": false, "text": "Response.Write(DateTime.Parse(dr(\"CreateDate\").ToString()).ToString(\"MM/dd/yyyy\"))\n" }, { "answer_id": 128364, ...
2008/09/24
[ "https://Stackoverflow.com/questions/128349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70/" ]
128,350
<p>I'm writing an <code>RSS</code> to <code>JSON parser</code> and as a part of that, I need to use <code>htmlentities()</code> on any tag found inside the description tag. Currently, I'm trying to use <code>preg_replace()</code>, but I'm struggling a little with it. My current (non-working) code looks like:</p> <pre>...
[ { "answer_id": 128373, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 4, "selected": true, "text": "preg_replace_callback function _handle_match($match)\n{\n return '<description>' . htmlentities($match[1]) . '</d...
2008/09/24
[ "https://Stackoverflow.com/questions/128350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13281/" ]
128,365
<p>I have a server access log, with timestamps of each http request, I'd like to obtain a count of the number of requests at each second. Using <code>sed</code>, and <code>cut -c</code>, so far I've managed to cut the file down to just the timestamps, such as:</p> <blockquote> <p>22-Sep-2008 20:00:21 +0000<br> 22-...
[ { "answer_id": 128394, "author": "The Archetypal Paul", "author_id": 21755, "author_profile": "https://Stackoverflow.com/users/21755", "pm_score": 6, "selected": true, "text": "uniq --count\n" }, { "answer_id": 128446, "author": "Remo.D", "author_id": 16827, "author_p...
2008/09/24
[ "https://Stackoverflow.com/questions/128365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4249/" ]
128,377
<p>I have an application - more like a utility - that sits in a corner and updates two different databases periodically. </p> <p>It is a little standalone app that has been built with a Spring Application Context. The context has two Hibernate Session Factories configured in it, in turn using Commons DBCP data sources...
[ { "answer_id": 128473, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "try { \n TransactionTemplate tt = new TransactionTemplate(txManager);\n\n tt.execute(new TransactionCallbackWithoutResul...
2008/09/24
[ "https://Stackoverflow.com/questions/128377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15452/" ]
128,389
<p>This is something that I always find a bit hard to explain to others: Why do XML namespaces exist? When should we use them and when should we not? What are the common pitfalls when working with namespaces in XML? </p> <p>Also, how do they relate to XML schemas? Should XSD schemas always be associated with a names...
[ { "answer_id": 128444, "author": "TcKs", "author_id": 20382, "author_profile": "https://Stackoverflow.com/users/20382", "pm_score": 1, "selected": false, "text": "<sampleDoc>\n <header title=\"Hello world!\">\n <items>\n <item name=\"Volvo\" color=\"Blue\"/>\n </items...
2008/09/24
[ "https://Stackoverflow.com/questions/128389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3389/" ]
128,412
<p>We are using SQL Server 2005, but this question can be for any <a href="http://en.wikipedia.org/wiki/Relational_database_management_system" rel="noreferrer">RDBMS</a>.</p> <p>Which of the following is more efficient, when selecting all columns from a view?</p> <pre><code>Select * from view </code></pre> <p>or </...
[ { "answer_id": 4202807, "author": "Simon", "author_id": 510552, "author_profile": "https://Stackoverflow.com/users/510552", "pm_score": 1, "selected": false, "text": "create view v_fruit as select F.id, S.strain from F key join S; \ncreate view v_apples as select v_fruit.*, C.colour from...
2008/09/24
[ "https://Stackoverflow.com/questions/128412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2539/" ]
128,443
<p>Does anyone know how I can get a format string to use <a href="http://en.wikipedia.org/wiki/Rounding#Round-to-even_method" rel="nofollow noreferrer">bankers rounding</a>? I have been using "{0:c}" but that doesn't round the same way that bankers rounding does. The <a href="http://msdn.microsoft.com/en-us/library/sys...
[ { "answer_id": 128539, "author": "Zach Lute", "author_id": 21374, "author_profile": "https://Stackoverflow.com/users/21374", "pm_score": 3, "selected": true, "text": "string s = string.Format(\"{0:c}\", 12345.6789);\n string s = string.Format(\"{0:c}\", Math.Round(12345.6789));\n" }, ...
2008/09/24
[ "https://Stackoverflow.com/questions/128443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21767/" ]
128,450
<p>I have some controller methods I'd like to share. What is the best practice for doing this in ruby on rails? Should I create an abstract class that my controllers extend, or should I create module and add it in to each controller? Below are the controller methods I want to share:</p> <pre><code>def driving_directio...
[ { "answer_id": 130821, "author": "Ian Terrell", "author_id": 9269, "author_profile": "https://Stackoverflow.com/users/9269", "pm_score": 8, "selected": true, "text": "Maps Maps::driving_directions class MapController < ApplicationController params" }, { "answer_id": 136426, "...
2008/09/24
[ "https://Stackoverflow.com/questions/128450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1486/" ]
128,463
<p>I am looking for a method to place some text onto the clipboard with <a href="http://en.wikipedia.org/wiki/VBScript" rel="noreferrer">VBScript</a>. The VBScript in question will be deployed as part of our login script. I would like to avoid using anything that isn't available on a clean Windows XP system.</p> <p>...
[ { "answer_id": 128482, "author": "Zoredache", "author_id": 20267, "author_profile": "https://Stackoverflow.com/users/20267", "pm_score": 4, "selected": false, "text": "Set objIE = CreateObject(\"InternetExplorer.Application\")\nobjIE.Navigate(\"about:blank\")\nobjIE.document.parentwindow...
2008/09/24
[ "https://Stackoverflow.com/questions/128463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20267/" ]
128,466
<p>Should I try to actually upgrade my existing app, or just rewrite it mostly from scratch, saving what pieces (templates, etc) I can?</p>
[ { "answer_id": 128483, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 2, "selected": false, "text": "__str__() __unicode__() admin.py" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/128466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8002/" ]
128,478
<p><a href="http://www.python.org/dev/peps/pep-0008/" rel="noreferrer">PEP 8</a> states:</p> <blockquote> <p>Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants.</p> </blockquote> <p>However if the class/method/function that I am importin...
[ { "answer_id": 128525, "author": "Jason Baker", "author_id": 2147, "author_profile": "https://Stackoverflow.com/users/2147", "pm_score": 3, "selected": false, "text": "do_something_with_x(x)\n from pprint import pprint\npprint(x)\ndo_something_with_x(x)\n" }, { "answer_id": 12853...
2008/09/24
[ "https://Stackoverflow.com/questions/128478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15676/" ]
128,502
<p>I've just updated my ruby installation on my gentoo server to ruby 1.8.6 patchlevel 287 and have started getting an error on one of my eRuby apps. The error given in the apache error_log file is:</p> <pre><code>[error] mod_ruby: /usr/lib/ruby/1.8/cgi.rb:774: superclass mismatch for class Cookie (TypeError) </code><...
[ { "answer_id": 211049, "author": "Pistos", "author_id": 28558, "author_profile": "https://Stackoverflow.com/users/28558", "pm_score": 3, "selected": false, "text": "class Cookie\nend\n % irb\nirb(main):001:0> class C < String; end\n=> nil\nirb(main):002:0> class C; end\n=> nil\nirb(main)...
2008/09/24
[ "https://Stackoverflow.com/questions/128502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1912/" ]
128,512
<p>If I have a subclass that has yet to implement a function provided by the base class, I can override that function and have it throw a <code>NotSupportedException</code>. Is there a way to generate a compile-time error for this to avoid only hitting this at runtime?</p> <p>Update: I can't make the base class abstr...
[ { "answer_id": 128528, "author": "Khoth", "author_id": 20686, "author_profile": "https://Stackoverflow.com/users/20686", "pm_score": 2, "selected": false, "text": "abstract class Foo\n{\n public abstract void Bar();\n}\n Bar()" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/128512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/815/" ]
128,527
<p>We have our JBoss and Oracle on separate servers. The connections seem to be dropped and is causing issues with JBoss. How can I have the JBoss reconnect to Oracle if the connection is bad while we figure out why the connections are being dropped in the first place?</p>
[ { "answer_id": 129333, "author": "Steve K", "author_id": 739, "author_profile": "https://Stackoverflow.com/users/739", "pm_score": 6, "selected": true, "text": "<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>\n" }, { "answer_id": 145889, "author": ...
2008/09/24
[ "https://Stackoverflow.com/questions/128527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6013/" ]
128,537
<p>How do I make an asynchronous call to a web service using the <code>PHP SOAP Extension</code>?</p>
[ { "answer_id": 19150921, "author": "quickshiftin", "author_id": 680920, "author_profile": "https://Stackoverflow.com/users/680920", "pm_score": 1, "selected": false, "text": "class NonBlockingSoapServer extends SoapServer\n{\n public function handle()\n {\n // this script ca...
2008/09/24
[ "https://Stackoverflow.com/questions/128537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
128,560
<p>When is it a good idea to use <a href="http://us3.php.net/manual/en/reserved.constants.php" rel="noreferrer"><code>PHP_EOL</code></a>?</p> <p>I sometimes see this in code samples of PHP. Does this handle DOS/Mac/Unix endline issues?</p>
[ { "answer_id": 128564, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 10, "selected": true, "text": "PHP_EOL" }, { "answer_id": 129370, "author": "Zoredache", "author_id": 20267, "author_profile": ...
2008/09/24
[ "https://Stackoverflow.com/questions/128560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3757/" ]
128,561
<p>I have a new application written in WPF that needs to support an old API that allows it to receive a message that has been posted to a hidden window. Typically another application uses FindWindow to identify the hidden window using the name of its custom window class.</p> <p><strong>1) I assume to implement a cust...
[ { "answer_id": 128622, "author": "chakrit", "author_id": 3055, "author_profile": "https://Stackoverflow.com/users/3055", "pm_score": 0, "selected": false, "text": "protected override void WndProc(ref System.Windows.Forms.Message m)\n{\n // *always* let the base class process the messag...
2008/09/24
[ "https://Stackoverflow.com/questions/128561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5427/" ]
128,573
<p>I have a class with two class methods (using the <code>classmethod()</code> function) for getting and setting what is essentially a static variable. I tried to use the <code>property()</code> function with these, but it results in an error. I was able to reproduce the error with the following in the interpreter:</...
[ { "answer_id": 128812, "author": "Florian Bösch", "author_id": 19435, "author_profile": "https://Stackoverflow.com/users/19435", "pm_score": 2, "selected": false, "text": "class ClassProperty(object):\n def __init__(self, fget, fset):\n self.fget = fget\n self.fset = fse...
2008/09/24
[ "https://Stackoverflow.com/questions/128573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9940/" ]
128,580
<p>I'm trying to get the contents of a XML document element, but the element has a colon in it's name.</p> <p>This line works for every element but the ones with a colon in the name:</p> <pre><code>$(this).find("geo:lat").text(); </code></pre> <p>I assume that the colon needs escaping. How do I fix this?</p>
[ { "answer_id": 128598, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 6, "selected": true, "text": "$(this).find(\"geo\\\\:lat\").text();\n" }, { "answer_id": 128640, "author": "Jim", "author_id": 8427...
2008/09/24
[ "https://Stackoverflow.com/questions/128580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/399/" ]
128,584
<p>The following simple "calculator expression" grammar (BNF) can be easily parsed with the a trivial recursive-descent parser, which is predictive LL(1):</p> <pre><code>&lt;expr&gt; := &lt;term&gt; + &lt;term&gt; | &lt;term&gt; - &lt;term&gt; | &lt;term&gt; &lt;term&gt; := &lt;...
[ { "answer_id": 128661, "author": "mmattax", "author_id": 1638, "author_profile": "https://Stackoverflow.com/users/1638", "pm_score": 2, "selected": false, "text": "\n<command> := <expr>\n | <id> = <expr>\n" }, { "answer_id": 128724, "author": "Remo.D", "au...
2008/09/24
[ "https://Stackoverflow.com/questions/128584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
128,588
<p>Seems so basic, I can't believe I don't know this! I just need a scratch folder to dump some temporary files to. I don't care if it gets wiped out between usages or not, and I don't think I should have to go through the hassle of creating one and maintaining it myself from within my application. Is that too much to ...
[ { "answer_id": 128596, "author": "Adam Wright", "author_id": 1200, "author_profile": "https://Stackoverflow.com/users/1200", "pm_score": 5, "selected": true, "text": "System.IO.Path.GetTempPath()" }, { "answer_id": 128605, "author": "Eduardo Campañó", "author_id": 12091, ...
2008/09/24
[ "https://Stackoverflow.com/questions/128588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5469/" ]
128,618
<p>Is there any easy way to create a class that uses <strong>IFormatProvider</strong> that writes out a user-friendly file-size?</p> <pre><code>public static string GetFileSizeString(string filePath) { FileInfo info = new FileInfo(@"c:\windows\notepad.exe"); long size = info.Length; string sizeString = siz...
[ { "answer_id": 128683, "author": "Eduardo Campañó", "author_id": 12091, "author_profile": "https://Stackoverflow.com/users/12091", "pm_score": 8, "selected": true, "text": "public class FileSizeFormatProvider : IFormatProvider, ICustomFormatter\n{\n public object GetFormat(Type format...
2008/09/24
[ "https://Stackoverflow.com/questions/128618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2429/" ]
128,623
<p>How can I disable all table constrains in Oracle with a single command? This can be either for a single table, a list of tables, or for all tables.</p>
[ { "answer_id": 128786, "author": "Mike McAllister", "author_id": 16247, "author_profile": "https://Stackoverflow.com/users/16247", "pm_score": 3, "selected": false, "text": "set heading off\n\nspool drop_constraints.out\n\nselect\n 'alter table ' || \n owner || '.' || \n table_n...
2008/09/24
[ "https://Stackoverflow.com/questions/128623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9435/" ]
128,636
<p>.NET has a lot of complex data structures. Unfortunately, some of them are quite similar and I'm not always sure when to use one and when to use another. Most of my C# and VB books talk about them to a certain extent, but they never really go into any real detail.</p> <p>What's the difference between Array, ArrayLis...
[ { "answer_id": 128754, "author": "Sam Schutte", "author_id": 146, "author_profile": "https://Stackoverflow.com/users/146", "pm_score": 8, "selected": true, "text": "Array type[] ArrayList List List<string> ArrayList Hashtable Dictionary Dictionary<string, string> SortedList List Dictiona...
2008/09/24
[ "https://Stackoverflow.com/questions/128636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21244/" ]
128,659
<p>I keep getting this error when trying to re-order items in my ReorderList control.</p> <p>"Reorder failed, see details below.</p> <p>Can't access data source. It does not a DataSource and does not implement IList."</p> <p>I'm setting the datasource to a DataTable right now, and am currently trying to use an Arra...
[ { "answer_id": 128831, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": " <cc1:ReorderList id=\"ReorderList1\" runat=\"server\" CssClass=\"Sortables\" Width=\"400\" >\n ...
2008/09/24
[ "https://Stackoverflow.com/questions/128659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
128,674
<p>Pretty simple scenario. I have a web service that receives a byte array that is to be saved as a particular file type on disk. What is the most efficient way to do this in C#?</p>
[ { "answer_id": 128692, "author": "Maurice", "author_id": 19676, "author_profile": "https://Stackoverflow.com/users/19676", "pm_score": 8, "selected": true, "text": "File.WriteAllBytes()" }, { "answer_id": 128694, "author": "Khoth", "author_id": 20686, "author_profile"...
2008/09/24
[ "https://Stackoverflow.com/questions/128674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5469/" ]
128,699
<p>I'm looking for a way to visualize a piece of GML I'm receiving. What is the best freely available java library to use for this task?</p>
[ { "answer_id": 5602710, "author": "Jody Garnett", "author_id": 287743, "author_profile": "https://Stackoverflow.com/users/287743", "pm_score": 0, "selected": false, "text": " URL url = TestData.getResource(this, \"states.gml\");\n InputStream in = url.openStream();\n\n ...
2008/09/24
[ "https://Stackoverflow.com/questions/128699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18702/" ]
128,783
<p>Is it possible to use AIX's mksysb and savevg to create a bootable tape with the rootvg and then append all the other VGs?</p>
[ { "answer_id": 129951, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "savevg -f /tmp/vgname\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/128783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
128,796
<p>I really enjoy having "pretty" URLs (e.g. <code>/Products/Edit/1</code> instead of <code>/products.aspx?productID=1</code>) but I'm at a loss on how to do this for pages that let you search by a large number of variables.</p> <p>For instance, let's say you have a page that lets a user search for all products of a p...
[ { "answer_id": 128881, "author": "chrisntr", "author_id": 4455, "author_profile": "https://Stackoverflow.com/users/4455", "pm_score": 1, "selected": false, "text": "http://example.com/search/?productType={producttype}&name={name}&address={address}" }, { "answer_id": 128882, "...
2008/09/24
[ "https://Stackoverflow.com/questions/128796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
128,815
<p>I'd like to set a cookie via Django with that has several different values to it, similar to .NET's <a href="http://msdn.microsoft.com/en-us/library/system.web.httpcookie_members(VS.80).aspx" rel="nofollow noreferrer">HttpCookie.Values</a> property. Looking at the <a href="http://docs.djangoproject.com/en/dev/ref/re...
[ { "answer_id": 2383482, "author": "Jordan Reiter", "author_id": 255918, "author_profile": "https://Stackoverflow.com/users/255918", "pm_score": 1, "selected": false, "text": "import pickle\nclass MultiCookie():\n def __init__(self,cookie=None,values=None):\n if cookie != None:\...
2008/09/24
[ "https://Stackoverflow.com/questions/128815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/736/" ]
128,818
<p>I have seen people say that it is bad form to use catch with no arguments, especially if that catch doesn't do anything:</p> <pre><code>StreamReader reader=new StreamReader("myfile.txt"); try { int i = 5 / 0; } catch // No args, so it will catch any exception {} reader.Close(); </code></pre> <p>However, this ...
[ { "answer_id": 128829, "author": "Khoth", "author_id": 20686, "author_profile": "https://Stackoverflow.com/users/20686", "pm_score": 10, "selected": true, "text": "try...catch try..finally" }, { "answer_id": 128845, "author": "chakrit", "author_id": 3055, "author_prof...
2008/09/24
[ "https://Stackoverflow.com/questions/128818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21727/" ]
128,853
<p>I'm sure there's some trivial one-liner with perl, ruby, bash whatever that would let me run a command in a loop until I observe some string in stdout, then stop. Ideally, I'd like to capture stdout as well, but if it's going to console, that might be enough. </p> <p>The particular environment in question at the ...
[ { "answer_id": 128872, "author": "Jay", "author_id": 20840, "author_profile": "https://Stackoverflow.com/users/20840", "pm_score": 4, "selected": false, "text": "OUTPUT=\"\"; \nwhile [ `echo $OUTPUT | grep -c somestring` = 0 ]; do \n OUTPUT=`$cmd`; \ndone\n function run_until () {\n OU...
2008/09/24
[ "https://Stackoverflow.com/questions/128853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7671/" ]
128,857
<p>I have a user reporting that when they use the back button to return to a web page that they come back as a different person. It seems like they may be accessing a different users profile.</p> <p>Here are the important parts of the code:</p> <pre><code>//here's the code on the web page public static WebProfile p ...
[ { "answer_id": 128872, "author": "Jay", "author_id": 20840, "author_profile": "https://Stackoverflow.com/users/20840", "pm_score": 4, "selected": false, "text": "OUTPUT=\"\"; \nwhile [ `echo $OUTPUT | grep -c somestring` = 0 ]; do \n OUTPUT=`$cmd`; \ndone\n function run_until () {\n OU...
2008/09/24
[ "https://Stackoverflow.com/questions/128857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4888/" ]
128,888
<p>In Java, I have a subclass <code>Vertex</code> of the Java3D class <code>Point3f</code>. Now <code>Point3f</code> computes <code>equals()</code> based on the values of its coordinates, but for my <code>Vertex</code> class I want to be stricter: two vertices are only equal if they are the same object. So far, so good...
[ { "answer_id": 128940, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "https://Stackoverflow.com/users/1288", "pm_score": 1, "selected": false, "text": "System.identityHashCode() hashCode() hashCode()" }, { "answer_id": 128982, "author": "Jay R.", "auth...
2008/09/24
[ "https://Stackoverflow.com/questions/128888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14637/" ]
128,914
<p>Several months ago my work deployed an in-house function that wraps the standard, php, mysql_query() function with additional options and abilities. A sample feature would be some handy debugging tools we can turn on/off. </p> <p>I was wondering how popular query handlers are and what features people like to build ...
[ { "answer_id": 128962, "author": "Till", "author_id": 2859, "author_profile": "https://Stackoverflow.com/users/2859", "pm_score": 1, "selected": false, "text": "<?php\n$query = \"SELECT * FROM table\";\n$result = mysql_query($query);\nif (!$result) {\n echo mysql_error();\n} else {\n ...
2008/09/24
[ "https://Stackoverflow.com/questions/128914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14959/" ]
128,923
<p>Many times I've seen links like these in HTML pages:</p> <pre><code>&lt;a href='#' onclick='someFunc(3.1415926); return false;'&gt;Click here !&lt;/a&gt; </code></pre> <p>What's the effect of the <code>return false</code> in there?</p> <p>Also, I don't usually see that in buttons.</p> <p>Is this specified anywhe...
[ { "answer_id": 128939, "author": "stephenbayer", "author_id": 18893, "author_profile": "https://Stackoverflow.com/users/18893", "pm_score": 3, "selected": false, "text": "<a href>" }, { "answer_id": 128966, "author": "Jim", "author_id": 8427, "author_profile": "https:...
2008/09/24
[ "https://Stackoverflow.com/questions/128923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15649/" ]
128,933
<p>I am putting together a Samba-based server as a Primary Domain Controller, and ran into a cute little problem that should have been solved many times over. But a number of searches did not yield a result. I need to be able to remove an existing user from an existing group with a command line script. It appears th...
[ { "answer_id": 129468, "author": "innaM", "author_id": 7498, "author_profile": "https://Stackoverflow.com/users/7498", "pm_score": 1, "selected": false, "text": "my $user = 'user';\nmy $groupNoMore = 'somegroup';\nmy $groups = join ',', grep { $_ ne $groupNoMore } split /\\s/, `groups $u...
2008/09/24
[ "https://Stackoverflow.com/questions/128933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2346/" ]
128,938
<p>I want to install a gem on all my application servers, but gem install requires sudo access - how can I enable sudo only for running this capistrano command? </p> <p>In other words, I don't wish to use sudo for all my deployment recipes, just when I invoke this command on the command line.</p>
[ { "answer_id": 12591986, "author": "New Alexandria", "author_id": 263858, "author_profile": "https://Stackoverflow.com/users/263858", "pm_score": 0, "selected": false, "text": "run \"sudo do_something\"" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/128938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21788/" ]
128,949
<p>Templates are a pretty healthy business in established programming languages, but are there any good ones that can be processed in JavaScript?</p> <p>By "template" I mean a document that accepts a data object as input, inserts the data into some kind of serialized markup language, and outputs the markup. Well-known...
[ { "answer_id": 11573000, "author": "Kernel James", "author_id": 1203580, "author_profile": "https://Stackoverflow.com/users/1203580", "pm_score": 0, "selected": false, "text": "<p>Name: <span data-qtext=\"data.name\"></span></p>\n<p>Email: <span data-qtext=\"data.email\"></span></p>\n" ...
2008/09/24
[ "https://Stackoverflow.com/questions/128949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8735/" ]
128,954
<p>I have code to create another "row" (div with inputs) on a button click. I am creating new input elements and everything works fine, however, I can't find a way to access these new elements.</p> <p>Example: I have input element (name_1 below). Then I create another input element (name_2 below), by using the javas...
[ { "answer_id": 129186, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 0, "selected": false, "text": "$(\"#lp_1\")" }, { "answer_id": 129199, "author": "Athena", "author_id": 17846, "author_profile": "https://S...
2008/09/24
[ "https://Stackoverflow.com/questions/128954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16437/" ]
128,965
<p>When I started writing database queries I didn't know the JOIN keyword yet and naturally I just extended what I already knew and wrote queries like this:</p> <pre><code>SELECT a.someRow, b.someRow FROM tableA AS a, tableB AS b WHERE a.ID=b.ID AND b.ID= $someVar </code></pre> <p>Now that I know that this is the sam...
[ { "answer_id": 129005, "author": "Powerlord", "author_id": 15880, "author_profile": "https://Stackoverflow.com/users/15880", "pm_score": 3, "selected": false, "text": "SELECT a.someRow, b.someRow\nFROM tableA AS a\nINNER JOIN tableB AS b\n ON a.ID = b.ID\nWHERE b.ID = ?\n" }, { ...
2008/09/24
[ "https://Stackoverflow.com/questions/128965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11995/" ]
128,981
<p>I'm writing a program and am having trouble using the scanf and fopen working together.</p> <p>From what I can tell my erroneous lines seems to be:</p> <pre><code>FiLE * DataFile DataFile = fopen("StcWx.txt","r"); scanf(DataFile, "%i %i %i %.2f %i %i", &amp;Year, &amp;Month, &amp;Day, &amp;Precip, &amp;High, &amp;...
[ { "answer_id": 128993, "author": "Derek Park", "author_id": 872, "author_profile": "https://Stackoverflow.com/users/872", "pm_score": 1, "selected": false, "text": "fscanf" }, { "answer_id": 54590680, "author": "Vừng Nhỏ ", "author_id": 5137968, "author_profile": "h...
2008/09/24
[ "https://Stackoverflow.com/questions/128981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
128,990
<p>I have a base URL :</p> <pre><code>http://my.server.com/folder/directory/sample </code></pre> <p>And a relative one :</p> <pre><code>../../other/path </code></pre> <p>How to get the absolute URL from this ? It's pretty straighforward using string manipulation, but I would like to do this in a secure way, using t...
[ { "answer_id": 129003, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 7, "selected": true, "text": "var baseUri = new Uri(\"http://my.server.com/folder/directory/sample\");\nvar absoluteUri = new Uri(baseUri,\"../../other...
2008/09/24
[ "https://Stackoverflow.com/questions/128990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4687/" ]
128,998
<p>I usually format my project directory like J-P Boodhoo. a main dir containing solution file, then a lib folder for all third-party lib, a src dir, a tools lib for third-party that wont be deployed.... <a href="http://blog.jpboodhoo.com/DirectoryStructureForProjects.aspx" rel="noreferrer">For more info look here</a><...
[ { "answer_id": 129102, "author": "jwfearn", "author_id": 10559, "author_profile": "https://Stackoverflow.com/users/10559", "pm_score": 3, "selected": true, "text": ".vcproj .sln .vsprops" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/128998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7419/" ]
129,013
<p>This is only happening on the live server. On multiply development servers the image is being created as expected.</p> <p>LIVE: Red Hat</p> <pre><code>$ php --version PHP 5.2.6 (cli) (built: May 16 2008 21:56:34) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies <...
[ { "answer_id": 851769, "author": "Darkerstar", "author_id": 73565, "author_profile": "https://Stackoverflow.com/users/73565", "pm_score": 0, "selected": false, "text": "imagettftext($image, $fontSize, 0, 0, 50, $black, $font, $text);\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/129013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1797/" ]
129,019
<p>I would like something that I can use as follows</p> <pre><code>var msg = new NonStaticMessageBox(); if(msg.Show("MyMessage", "MyCaption", MessageBoxButtons.OkCancel) == DialogResult.Ok) {....} </code></pre> <p>But specifically non-static (I need to pass a reference to it around) does anyone know if/where such an...
[ { "answer_id": 132654, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "public class MessageBox\n{\n private Form _messageForm = null;\n\n public void Show(string title,...) {...}\n}\n" }, ...
2008/09/24
[ "https://Stackoverflow.com/questions/129019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
129,023
<p>I have a questionable coding practice. </p> <p>When I need to iterate through a small list of items whose count limit is under <code>32000</code>, I use <code>Int16</code> for my <em>i</em> variable type instead of <code>Integer</code>. I do this because I assume using the <code>Int16</code> is more efficient than ...
[ { "answer_id": 129817, "author": "Alex Lyman", "author_id": 5897, "author_profile": "https://Stackoverflow.com/users/5897", "pm_score": 7, "selected": false, "text": "Int32 Int64 UInt32 UInt64 Int32 Int16 Int32 Int32 Int64 Byte SByte UInt16 Int16 UInt32 UInt64 for (short i = 0; i < 32000...
2008/09/24
[ "https://Stackoverflow.com/questions/129023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17235/" ]
129,036
<p>I am writing a component that, given a ZIP file, needs to:</p> <ol> <li>Unzip the file.</li> <li>Find a specific dll among the unzipped files.</li> <li>Load that dll through reflection and invoke a method on it.</li> </ol> <p>I'd like to unit test this component.</p> <p>I'm tempted to write code that deals dire...
[ { "answer_id": 129204, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 7, "selected": true, "text": "chdir() chdir()" }, { "answer_id": 23124879, "author": "Christopher Perry", "author_id": 413414, ...
2008/09/24
[ "https://Stackoverflow.com/questions/129036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536/" ]
129,043
<p>I have a bash script that creates a Subversion patch file for the current directory. I want to modify it to zip the produced file, if <code>-z</code> is given as an argument to the script.</p> <p>Here's the relevant part:</p> <pre><code>zipped='' zipcommand='&gt;' if [ "$1" = "-z" ] then zipped='zipped ' fi...
[ { "answer_id": 129132, "author": "Keeth", "author_id": 20588, "author_profile": "https://Stackoverflow.com/users/20588", "pm_score": 4, "selected": true, "text": "zipped=''\nzipcommand='>'\n\nif [ \"$1\" = \"-z\" ]\nthen\n zipped='zipped '\n filename=\"${filename}.zip\"\n zipcomman...
2008/09/24
[ "https://Stackoverflow.com/questions/129043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4790/" ]
129,046
<p>How would I disable and later enable all indexes in a given schema/database in Oracle?</p> <p>Note: This is to make sqlldr run faster.</p>
[ { "answer_id": 129163, "author": "Dmitry Khalatov", "author_id": 18174, "author_profile": "https://Stackoverflow.com/users/18174", "pm_score": 2, "selected": false, "text": "alter session set skip_unusable_indexes = true; alter index your_index unusable; alter index your_index rebuild [o...
2008/09/24
[ "https://Stackoverflow.com/questions/129046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9435/" ]
129,053
<p>How does Google's API make cross-domain requests back to Google, when it's on your website?</p>
[ { "answer_id": 131317, "author": "Burke", "author_id": 21980, "author_profile": "https://Stackoverflow.com/users/21980", "pm_score": 0, "selected": false, "text": "window.name" }, { "answer_id": 15170008, "author": "jpillora", "author_id": 977939, "author_profile": "h...
2008/09/24
[ "https://Stackoverflow.com/questions/129053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16628/" ]
129,077
<p>This issue came up when I got different records counts for what I thought were identical queries one using a <code>not in</code> <code>where</code> constraint and the other a <code>left join</code>. The table in the <code>not in</code> constraint had one null value (bad data) which caused that query to return a coun...
[ { "answer_id": 129151, "author": "YonahW", "author_id": 3821, "author_profile": "https://Stackoverflow.com/users/3821", "pm_score": 6, "selected": false, "text": "NOT IN NULL NOT IN NULL NULL 0 NULL" }, { "answer_id": 129152, "author": "Brannon", "author_id": 5745, "a...
2008/09/24
[ "https://Stackoverflow.com/questions/129077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12752/" ]
129,088
<p>I am writing a script for MS PowerShell. This script uses the <code>Copy-Item</code> command. One of the optional arguments to this command is "<code>-container</code>". The documentation for the argument states that specifying this argument "Preserves container objects during the copy operation."</p> <p>This is ...
[ { "answer_id": 129385, "author": "Steven Murawski", "author_id": 1233, "author_profile": "https://Stackoverflow.com/users/1233", "pm_score": 6, "selected": true, "text": "-container: $false" }, { "answer_id": 21798660, "author": "bouvierr", "author_id": 542417, "autho...
2008/09/24
[ "https://Stackoverflow.com/questions/129088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9117/" ]
129,120
<p>I've been a professional software engineer for about a year now, having graduated with a CS degree. I've known about assertions for a while in C++ and C, but had no idea they existed in C# and .NET at all until recently.</p> <p>Our production code contains no asserts whatsoever and my question is this...</p> <p>Sh...
[ { "answer_id": 129136, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 7, "selected": false, "text": "Debug.Assert() DEBUG Debug.Assert() Debug.Assert()" }, { "answer_id": 129179, "author": "Mark Ingram", "...
2008/09/24
[ "https://Stackoverflow.com/questions/129120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8945/" ]
129,133
<p>How do I view the SQL that is generated by nHibernate? version 1.2</p>
[ { "answer_id": 129818, "author": "mathieu", "author_id": 971, "author_profile": "https://Stackoverflow.com/users/971", "pm_score": 6, "selected": true, "text": "<section name=\"log4net\" type=\"log4net.Config.Log4NetConfigurationSectionHandler,log4net\"/>\n <log4net>\n <appender name=\"...
2008/09/24
[ "https://Stackoverflow.com/questions/129133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1642688/" ]
129,144
<p>Sometimes I find myself in the situation where I want to execute several sequential commands like such:</p> <pre><code>try: foo(a, b) except Exception, e: baz(e) try: bar(c, d) except Exception, e: baz(e) ... </code></pre> <p>This same pattern occurs when exceptions simply need to be ignored.</p> ...
[ { "answer_id": 129172, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 2, "selected": false, "text": "lambda for cmd in [\n (lambda: foo (a, b)),\n (lambda: bar (c, d)),\n]:\n try:\n cmd ()\n except St...
2008/09/24
[ "https://Stackoverflow.com/questions/129144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9241/" ]
129,160
<p>The resource definition in tomcat's <code>server.xml</code> looks something like this...</p> <pre class="lang-xml prettyprint-override"><code>&lt;Resource name="jdbc/tox" scope="Shareable" type="javax.sql.DataSource" url="jdbc:oracle:thin:@yourDBserver.yourCompany.com:1521:yourDBsid" driverClass...
[ { "answer_id": 129268, "author": "Brad8118", "author_id": 7617, "author_profile": "https://Stackoverflow.com/users/7617", "pm_score": -1, "selected": false, "text": "print(SHA1CryptoServiceProvider sHA1Hasher = new SHA1CryptoServiceProvider();\n ASCIIEncoding enc = new ASCIIEncodi...
2008/09/24
[ "https://Stackoverflow.com/questions/129160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13930/" ]
129,171
<p>What's the most efficient way to read a stream into another stream? In this case, I'm trying to read data in a Filestream into a generic stream. I know I could do the following:<br> 1. read line by line and write the data to the stream<br> 2. read chunks of bytes and write to the stream<br> 3. etc</p> <p>I'm just...
[ { "answer_id": 129185, "author": "Kent Boogaart", "author_id": 5380, "author_profile": "https://Stackoverflow.com/users/5380", "pm_score": 1, "selected": false, "text": "ReadLine()" }, { "answer_id": 129925, "author": "Jesse C. Slicer", "author_id": 3312, "author_prof...
2008/09/24
[ "https://Stackoverflow.com/questions/129171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21829/" ]
129,178
<p>I have recently been thinking about the difference between the two ways of defining an array:</p> <ol> <li><code>int[] array</code></li> <li><code>int array[]</code></li> </ol> <p>Is there a difference?</p>
[ { "answer_id": 129188, "author": "skaffman", "author_id": 21234, "author_profile": "https://Stackoverflow.com/users/21234", "pm_score": 9, "selected": true, "text": "int array[] int[] array" }, { "answer_id": 129198, "author": "Derek Park", "author_id": 872, "author_p...
2008/09/24
[ "https://Stackoverflow.com/questions/129178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21199/" ]
129,181
<p>Is there a way to format a UTC time into any arbitrary string format I want in java? Basically I was thinking of having some class take the timestamp and I pass it is string telling it how I want it formated, and it returns the formatted string for me. Is there a way to do this?</p>
[ { "answer_id": 129229, "author": "Jay", "author_id": 20840, "author_profile": "https://Stackoverflow.com/users/20840", "pm_score": 5, "selected": false, "text": "String date = new java.text.SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\").format(new java.util.Date (epoch*1000));\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/129181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2328/" ]
129,207
<p>Is there a way to statically/globally request a copy of the ApplicationContext in a Spring application?</p> <p>Assuming the main class starts up and initializes the application context, does it need to pass that down through the call stack to any classes that need it, or is there a way for a class to ask for the pr...
[ { "answer_id": 144545, "author": "stian", "author_id": 17542, "author_profile": "https://Stackoverflow.com/users/17542", "pm_score": 4, "selected": false, "text": "<bean id=\"mainContext\" class=\"org.springframework.context.support.ClassPathXmlApplicationContext\">\n <constructor-ar...
2008/09/24
[ "https://Stackoverflow.com/questions/129207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14057/" ]
129,208
<p>On the advice of a more experienced developer, I have always coded my web pages that require user input (form processing, database administration, etc.) as self-referential pages. For PHP pages, I set the action of the form to the <code>'PHP_SELF'</code> element of the <code>$_SERVER</code> predefined variable, and ...
[ { "answer_id": 129256, "author": "ceejayoz", "author_id": 1902010, "author_profile": "https://Stackoverflow.com/users/1902010", "pm_score": 0, "selected": false, "text": "RewriteEngine on\nRewriteRule ^form$ form.php [QSA]\nRewriteRule ^form/submit$ form.php [QSA]\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/129208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8161/" ]
129,248
<p>I have a many to many index table, and I want to do an include/exclude type query on it.</p> <p>fid is really a integer index, but here as letters for easier understanding. Here's a sample table :</p> <p>table t</p> <pre><code>eid | fid ----+---- 1 | A 1 | B 1 | C 2 | B 2 | C 3 | A 3 | C 4 | A 4 ...
[ { "answer_id": 129260, "author": "Tom Ritter", "author_id": 8435, "author_profile": "https://Stackoverflow.com/users/8435", "pm_score": 3, "selected": false, "text": "Select eid from t where fid = 'B' \nEXCEPT\nselect eid from t where fid = 'A'\n" }, { "answer_id": 129302, "a...
2008/09/24
[ "https://Stackoverflow.com/questions/129248", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21838/" ]
129,257
<p>How Do I Get Eclipse Style Function Completions in Emacs for C, C++ and JAVA? I love the power of the Emacs text editor but the lack of an "intellisense" feature leaves me using Eclipse.</p>
[ { "answer_id": 129390, "author": "dmckee --- ex-moderator kitten", "author_id": 2509, "author_profile": "https://Stackoverflow.com/users/2509", "pm_score": 2, "selected": false, "text": "complete-tab M-Tab" }, { "answer_id": 130111, "author": "David Webb", "author_id": 31...
2008/09/24
[ "https://Stackoverflow.com/questions/129257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
129,265
<p>I have a Postgresql database on which I want to do a few cascading deletes. However, the tables aren't set up with the ON DELETE CASCADE rule. Is there any way I can perform a delete and tell Postgresql to cascade it just this once? Something equivalent to</p> <pre><code>DELETE FROM some_table CASCADE; </code></...
[ { "answer_id": 129300, "author": "palehorse", "author_id": 312, "author_profile": "https://Stackoverflow.com/users/312", "pm_score": 9, "selected": true, "text": "DELETE FROM some_child_table WHERE some_fk_field IN (SELECT some_id FROM some_Table);\nDELETE FROM some_table;\n" }, { ...
2008/09/24
[ "https://Stackoverflow.com/questions/129265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1694/" ]
129,267
<p>There have been a few questions asked here about why you can't define static methods within interfaces, but none of them address a basic inconsistency: why can you define static fields and static inner types within an interface, but not static methods?</p> <p>Static inner types perhaps aren't a fair comparison, sin...
[ { "answer_id": 129934, "author": "DJClayworth", "author_id": 19276, "author_profile": "https://Stackoverflow.com/users/19276", "pm_score": 4, "selected": false, "text": "MyInterface var = new MyImplementingClass();\nvar.staticMethod();\n" }, { "answer_id": 130023, "author": "...
2008/09/24
[ "https://Stackoverflow.com/questions/129267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21234/" ]
129,277
<p>This is likely going to be an easy answer and I'm just missing something, but here goes...If I have a Type, (that is, an actual System.Type...not an instance) how do I tell if it inherits from another specific base type?</p>
[ { "answer_id": 129294, "author": "Chris Marasti-Georg", "author_id": 96, "author_profile": "https://Stackoverflow.com/users/96", "pm_score": 5, "selected": false, "text": "// Returns true if \"type\" inherits from \"baseType\"\npublic static bool Inherits(Type type, Type baseType) {\n ...
2008/09/24
[ "https://Stackoverflow.com/questions/129277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5469/" ]
129,283
<p>Forgive the vague title, I wasn't sure how to describe it.</p> <p>If you have a generic model "Archive", how do you show different views/forms based on a user selected 'type'?</p> <p>For example, the user creates a new "Archive", then gets the choice of video, book, audio etc. From there they get different forms b...
[ { "answer_id": 129293, "author": "Iain Holder", "author_id": 1122, "author_profile": "https://Stackoverflow.com/users/1122", "pm_score": 2, "selected": false, "text": "public class Video : Archive\n{ \n public int Id {get;set}\n public string Name {get;set;} \n ...\n}\n pub...
2008/09/24
[ "https://Stackoverflow.com/questions/129283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4196/" ]
129,285
<p>Is it possible to add attributes at runtime or to change the value of an attribute at runtime?</p>
[ { "answer_id": 129340, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 7, "selected": true, "text": "System.Type" }, { "answer_id": 46117780, "author": "Eric Ouellet", "author_id": 452845, "author_profi...
2008/09/24
[ "https://Stackoverflow.com/questions/129285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16979/" ]
129,297
<p>I have a laptop running Ubuntu to which I connect an external monitor when I'm at the office. Usually this requires me to run <code>xrandr --auto</code> in order for the laptop to re-size the display to match the external monitor. It would be nice if this could be done automatically, either triggered when the monito...
[ { "answer_id": 154960, "author": "matli", "author_id": 23896, "author_profile": "https://Stackoverflow.com/users/23896", "pm_score": 3, "selected": true, "text": "xauth merge /home/your_username/.Xauthority\nexport DISPLAY=:0.0\nxrandr --auto\n" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/129297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13051/" ]
129,305
<p>I often run into the problem that I have one stream full of data and want to write everything of it into another stream.</p> <p>All code-examples out there use a buffer in form of a byte-array.</p> <p>Is there a more elegant way to this?</p> <p>If not, what's the ideal size of the buffer. Which factors make up th...
[ { "answer_id": 129344, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "https://Stackoverflow.com/users/1288", "pm_score": 3, "selected": false, "text": "static void CopyStream(Stream input, Stream output){\n byte[] buffer = new byte[0x1000];\n int read;\n whil...
2008/09/24
[ "https://Stackoverflow.com/questions/129305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9632/" ]
129,310
<p>I use the <a href="https://addons.mozilla.org/en-US/firefox/addon/6543" rel="nofollow noreferrer">Nightly Tester Tools</a> for Firefox and <a href="http://fiddlertool.com/fiddler/" rel="nofollow noreferrer">Fiddler</a> for IE. What do you use?</p>
[ { "answer_id": 602455, "author": "random", "author_id": 9314, "author_profile": "https://Stackoverflow.com/users/9314", "pm_score": 0, "selected": false, "text": "CTRL+SHIFT+ALT+U" } ]
2008/09/24
[ "https://Stackoverflow.com/questions/129310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14770/" ]
129,329
<p>I understand the differences between optimistic and pessimistic locking. Now, could someone explain to me when I would use either one in general?</p> <p>And does the answer to this question change depending on whether or not I'm using a stored procedure to perform the query?</p> <p>But just to check, optimistic mea...
[ { "answer_id": 58952004, "author": "Vlad Mihalcea", "author_id": 1025118, "author_profile": "https://Stackoverflow.com/users/1025118", "pm_score": 8, "selected": false, "text": "account account account 1 account UPDATE version version version OptimisticLockException" }, { "answer...
2008/09/24
[ "https://Stackoverflow.com/questions/129329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
129,335
<p>When you call <code>RedirectToAction</code> within a controller, it automatically redirects using an HTTP GET. How do I explicitly tell it to use an HTTP POST?</p> <p>I have an action that accepts both GET and POST requests, and I want to be able to <code>RedirectToAction</code> using POST and send it some values...
[ { "answer_id": 1343182, "author": "Jason Bunting", "author_id": 1790, "author_profile": "https://Stackoverflow.com/users/1790", "pm_score": 7, "selected": false, "text": "[AcceptVerbs(HttpVerbs.Get)]\npublic ActionResult Index() {\n // obviously these values might come from somewhere n...
2008/09/24
[ "https://Stackoverflow.com/questions/129335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7831/" ]
129,345
<p>How can I pass arguments to a constructor in an IOC-framework? I want to do something like: (Trying to be IOC-framework agnostic ;) )</p> <pre><code>object objectToLogFor = xxx; container.Resolve&lt;ILogging&gt;(objectToLogFor); public class MyLogging : ILogging { public MyLogging(object objectToLogFor){} } <...
[ { "answer_id": 573438, "author": "Edward Wilde", "author_id": 5182, "author_profile": "https://Stackoverflow.com/users/5182", "pm_score": 4, "selected": true, "text": "string objectToLogFor = \"PolicyName\";\nObjectFactory.With<string>(objectToLogFor).GetInstance<ILogging>();\n" }, {...
2008/09/24
[ "https://Stackoverflow.com/questions/129345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21733/" ]
129,360
<p>I'm working with jQuery for the first time and need some help. I have html that looks like the following:</p> <pre><code>&lt;div id='comment-8' class='comment'&gt; &lt;p&gt;Blah blah&lt;/p&gt; &lt;div class='tools'&gt;&lt;/div&gt; &lt;/div&gt; &lt;div id='comment-9' class='comment'&gt; &lt;p&gt;Blah bl...
[ { "answer_id": 129420, "author": "andy", "author_id": 6152, "author_profile": "https://Stackoverflow.com/users/6152", "pm_score": 1, "selected": false, "text": "<tt>parent()</tt> <tt>$(this).parent().attr('id')</tt>; <tt>$(this).parents('div:eq(0)').attr('id')</tt> <tt>\"comment\"</tt>" ...
2008/09/24
[ "https://Stackoverflow.com/questions/129360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2656/" ]
129,362
<p>I'm writing a WinForms application and one of the tabs in my TabControl has a SplitContainer. I'm saving the SplitterDistance in the user's application settings, but the restore is inconsistent. If the tab page with the splitter is visible, then the restore works and the splitter distance is as I left it. If some ot...
[ { "answer_id": 983325, "author": "Robert Jeppesen", "author_id": 9436, "author_profile": "https://Stackoverflow.com/users/9436", "pm_score": 2, "selected": false, "text": " var fullDistance = \n new Func<SplitContainer, int>(\n c => c.Orientation == \n ...
2008/09/24
[ "https://Stackoverflow.com/questions/129362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4794/" ]
129,388
<p>I am writing a webpage in C# .NET. In javascript there is a function called GetElementsByTagName... this is nice for javascript invoked from the .aspx page. My question is, is there any way I can have this kind of functionality from my C# code-behind?</p> <p>--</p> <p>The scenario for those curious: I used an a...
[ { "answer_id": 129400, "author": "StingyJack", "author_id": 16391, "author_profile": "https://Stackoverflow.com/users/16391", "pm_score": 2, "selected": false, "text": "For each ctl as Control in Me.Controls\n If ctl.Name = whatYouWant Then\n do stuff\nNext 'ctl\n Dim ctl as New Cont...
2008/09/24
[ "https://Stackoverflow.com/questions/129388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13732/" ]
129,389
<p>I want a true deep copy. In Java, this was easy, but how do you do it in C#?</p>
[ { "answer_id": 129395, "author": "Kilhoffer", "author_id": 5469, "author_profile": "https://Stackoverflow.com/users/5469", "pm_score": 10, "selected": true, "text": "public static T DeepClone<T>(this T obj)\n{\n using (var ms = new MemoryStream())\n {\n var formatter = new BinaryFormat...
2008/09/24
[ "https://Stackoverflow.com/questions/129389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18931/" ]
129,405
<p>How do I Configuring DoxyGen to document ActionScript files?</p> <p>I've included the *.as and *.asi files in doxygen's search pattern, but the classes, functions and variables don't show there.</p>
[ { "answer_id": 139745, "author": "Eliram", "author_id": 18790, "author_profile": "https://Stackoverflow.com/users/18790", "pm_score": 2, "selected": false, "text": "OPTIMIZE_OUTPUT_JAVA = YES\nEXTRACT_ALL = YES\nHIDE_UNDOC_MEMBERS = NO\nHIDE_UNDOC_CLASSES = NO\n pack...
2008/09/24
[ "https://Stackoverflow.com/questions/129405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18790/" ]
129,406
<p>When my browser renders the following test case, there's a gap below the image. From my understanding of CSS, the bottom of the blue box should touch the bottom of the red box. But that's not the case. Why?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div cla...
[ { "answer_id": 129412, "author": "John Sheehan", "author_id": 1786, "author_profile": "https://Stackoverflow.com/users/1786", "pm_score": 3, "selected": false, "text": "vertical-align: bottom;\n" }, { "answer_id": 129426, "author": "tim_yates", "author_id": 6509, "aut...
2008/09/24
[ "https://Stackoverflow.com/questions/129406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7598/" ]
129,417
<p>Coming from a desktop background I'm not sure exactly how to pass the exceptions I have caught to an Error page in order to avoid the standard exception screen being seen by my users. </p> <p>My general question is how do I pass the exception from page X to my Error page in ASP.net?</p>
[ { "answer_id": 129434, "author": "Forgotten Semicolon", "author_id": 1960, "author_profile": "https://Stackoverflow.com/users/1960", "pm_score": 4, "selected": true, "text": " <customErrors mode=\"RemoteOnly\" defaultRedirect=\"/error.html\">\n <error statusCode=\"403\" redirect=\...
2008/09/24
[ "https://Stackoverflow.com/questions/129417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20748/" ]
129,437
<p>I have a SQL script that I want to output progress messages as it runs. Having it output messages between SQL statements is easy, however I have some very long running INSERT INTO SELECTs. Is there a way to have a select statement output messages as it goes, for example after every 1000 rows, or every 5 seconds?</p>...
[ { "answer_id": 161961, "author": "AJ.", "author_id": 7211, "author_profile": "https://Stackoverflow.com/users/7211", "pm_score": 2, "selected": false, "text": "DECLARE @total_rows int\n\nSELECT @total_rows = count(*) \nFROM Source_Table\n\nWHILE @total_rows > (SELECT count(*) FROM ...
2008/09/24
[ "https://Stackoverflow.com/questions/129437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3524/" ]
129,445
<p>I'm new to postgreSQL and I have a simple question:</p> <p>I'm trying to create a simple script that creates a DB so I can later call it like this:</p> <pre><code>psql -f createDB.sql </code></pre> <p>I want the script to call other scripts (separate ones for creating tables, adding constraints, functions etc), l...
[ { "answer_id": 129496, "author": "Steve K", "author_id": 739, "author_profile": "https://Stackoverflow.com/users/739", "pm_score": 8, "selected": true, "text": "\\i somedir/script2.sql \n \\i c:/somedir/script2.sql\n \\i somedir\\\\script2.sql\n" }, { "answer_id": 15415502, "...
2008/09/24
[ "https://Stackoverflow.com/questions/129445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21853/" ]
129,451
<p>If you are using Java or JavaScript, is there a good way to do something like a String subtraction so that given two strings:</p> <pre><code>org.company.project.component org.company.project.component.sub_component </code></pre> <p>you just get:</p> <pre><code>sub_component </code></pre> <p>I know that I could j...
[ { "answer_id": 129461, "author": "Chris Marasti-Georg", "author_id": 96, "author_profile": "https://Stackoverflow.com/users/96", "pm_score": 3, "selected": false, "text": "String result = \"org.company.project.component.sub_component\".replace(\"org.company.project.component\",\"\")\n" ...
2008/09/24
[ "https://Stackoverflow.com/questions/129451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5412/" ]
129,453
<p>Every time I start in deep in a C# project, I end up with lots of events that really just need to pass a single item. I stick with the <code>EventHandler</code>/<code>EventArgs</code> practice, but what I like to do is have something like:</p> <pre><code>public delegate void EventHandler&lt;T&gt;(object src, Event...
[ { "answer_id": 129511, "author": "mattlant", "author_id": 14642, "author_profile": "https://Stackoverflow.com/users/14642", "pm_score": 2, "selected": false, "text": "EventHandler<T>" }, { "answer_id": 129613, "author": "Ilya Ryzhenkov", "author_id": 18575, "author_pr...
2008/09/24
[ "https://Stackoverflow.com/questions/129453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/96/" ]
129,498
<p>I am using the ADONetAppender to (try) to log data via a stored procedure (so that I may inject logic into the logging routine).</p> <p>My configuration settings are listed below. Can anybody tell what I'm doing wrong?</p> <pre class="lang-xml prettyprint-override"><code>&lt;appender name="ADONetAppender_SqlServer...
[ { "answer_id": 1037572, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": -1, "selected": false, "text": "</configSections>\n<log4net>\n\n <appender name=\"AdoNetAppender\" type=\"log4net.Appender.AdoNetAppender\">\n\n <...
2008/09/24
[ "https://Stackoverflow.com/questions/129498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
129,502
<p>This is on iPhone 0S 2.0. Answers for 2.1 are fine too, though I am unaware of any differences regarding tables.</p> <p>It feels like it should be possible to get text to wrap without creating a custom cell, since a <code>UITableViewCell</code> contains a <code>UILabel</code> by default. I know I can make it work i...
[ { "answer_id": 129743, "author": "drewh", "author_id": 1967, "author_profile": "https://Stackoverflow.com/users/1967", "pm_score": -1, "selected": false, "text": "UITableViewCell's UILabel UILabel numberOfLines sizeToFit UILabel* label = [[UILabel alloc] initWithFrame:cell.frame];\nlabel...
2008/09/24
[ "https://Stackoverflow.com/questions/129502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18017/" ]
129,507
<p>How does one write a unittest that fails only if a function doesn't throw an expected exception?</p>
[ { "answer_id": 129522, "author": "Moe", "author_id": 3051, "author_profile": "https://Stackoverflow.com/users/3051", "pm_score": 11, "selected": true, "text": "TestCase.assertRaises TestCase.failUnlessRaises import mymod\n\nclass MyTestCase(unittest.TestCase):\n def test1(self):\n ...
2008/09/24
[ "https://Stackoverflow.com/questions/129507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4766/" ]
129,510
<p>I have an application I'm writing where I'm allowing the administrators to add aliases for pages, categories, etc, and I would like to use a different controller/action depending on the alias (without redirecting, and I've found that render doesn't actually call the method. I just renders the template). I have tried...
[ { "answer_id": 130750, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 0, "selected": false, "text": "method_missing class MyController\n def method_missing(sym, *args)\n aliased = Alias.find_by_action_name(sym)\n #...
2008/09/24
[ "https://Stackoverflow.com/questions/129510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6705/" ]