qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
307,502
<p>When you run <code>top</code> and see all running processes, I've always wanted to know just what everything actually means. e.g. all the various single-letter state codes for a running process (R = Running, S = Sleeping, etc...)</p> <p>Where can I find this?</p>
[ { "answer_id": 307506, "author": "SMB", "author_id": 26029, "author_profile": "https://Stackoverflow.com/users/26029", "pm_score": 4, "selected": false, "text": "man top D = uninterruptible sleep\nI = idle\nR = running\nS = sleeping\nT = stopped by job control signal\nt = stopped by debu...
2008/11/21
[ "https://Stackoverflow.com/questions/307502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39529/" ]
307,503
<p>I've got a few Unix shell scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing:</p> <pre><code>if [ -z "$STATE" ]; then echo "Need to set STATE" exit 1 fi if [ -z "$DEST" ]; then echo "Need to set DEST" exit 1 fi </code></...
[ { "answer_id": 307527, "author": "Vincent Van Den Berghe", "author_id": 39259, "author_profile": "https://Stackoverflow.com/users/39259", "pm_score": 5, "selected": false, "text": "${MyVariable:=SomeDefault}\n MyVariable MyVariable SomeDefault ${MyVariable} MyVariable=${MyVariable:=SomeD...
2008/11/21
[ "https://Stackoverflow.com/questions/307503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2994/" ]
307,512
<pre><code>public static IQueryable&lt;TResult&gt; ApplySortFilter&lt;T, TResult&gt;(this IQueryable&lt;T&gt; query, string columnName) where T : EntityObject { var param = Expression.Parameter(typeof(T), "o"); var body = Expression.PropertyOrField(param,columnName); var sortExpression = Expression.Lambda(body...
[ { "answer_id": 307599, "author": "JTew", "author_id": 25372, "author_profile": "https://Stackoverflow.com/users/25372", "pm_score": 3, "selected": false, "text": "// ***** OrderBy(company => company) *****\n// Create an expression tree that represents the expression\n// 'whereCallExpress...
2008/11/21
[ "https://Stackoverflow.com/questions/307512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25372/" ]
307,514
<p>Can you program/configure Visual Studio to produce custom intellisense for your own server controls.</p> <p>eg can you get it to do this:</p> <p><a href="http://www.yart.com.au/test/vs.gif" rel="nofollow noreferrer">alt text http://www.yart.com.au/test/vs.gif</a></p> <p>for a tag of your own like:</p> <pre><code...
[ { "answer_id": 307585, "author": "HectorMac", "author_id": 1400, "author_profile": "https://Stackoverflow.com/users/1400", "pm_score": 3, "selected": true, "text": "[EditorBrowsableAttribute (EditorBrowsableState.Never)] \n [Description(\"My extra helpful description\")]\n" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/307514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24696/" ]
307,531
<p>With code like the following, sometimes the child controls correctly finish their animation and sometimes they stop at random places in the middle. Why don't they work correctly?</p> <pre><code>var t:Tween; t = new Tween(child1,"x",Elastic.easeOut,0,100,2,true); t = new Tween(child1,"y", Elastic.easeOut,0,100,2,tr...
[ { "answer_id": 307535, "author": "Eric", "author_id": 4540, "author_profile": "https://Stackoverflow.com/users/4540", "pm_score": 2, "selected": false, "text": "var t1:Tween = new Tween(child1,\"x\",Elastic.easeOut,0,100,2,true);\nvar t2:Tween = new Tween(child1,\"y\", Elastic.easeOut,0,...
2008/11/21
[ "https://Stackoverflow.com/questions/307531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4540/" ]
307,579
<p>I've got two branches that are fully merged together.</p> <p>However, after the merge is done, I realise that one file has been messed up by the merge (someone else did an auto-format, gah), and it would just be easier to change to the new version in the other branch, and then reinsert my one line change after bring...
[ { "answer_id": 307872, "author": "madlep", "author_id": 14160, "author_profile": "https://Stackoverflow.com/users/14160", "pm_score": 12, "selected": true, "text": "git checkout otherbranch myfile.txt\n git checkout <commit_hash> <relative_path_to_file_or_dir>\ngit checkout <remote_name>...
2008/11/21
[ "https://Stackoverflow.com/questions/307579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14160/" ]
307,581
<p>Relatively new to rails and trying to model a very simple family "tree" with a single Person model that has a name, gender, father_id and mother_id (2 parents). Below is basically what I want to do, but obviously I can't repeat the :children in a has_many (the first gets overwritten).</p> <pre><code>class Person &l...
[ { "answer_id": 307660, "author": "Gordon Wilson", "author_id": 23071, "author_profile": "https://Stackoverflow.com/users/23071", "pm_score": 3, "selected": false, "text": "class Person < ActiveRecord::Base\n has_one :father, :class_name => 'Person', :foreign_key => 'father_id'\n has_on...
2008/11/21
[ "https://Stackoverflow.com/questions/307581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13636/" ]
307,582
<p>I have code running in a loop and it's saving state based on the current time. Sometimes this can be just milliseconds apart, but for some reason it seems that DateTime.Now will always return values of at least 10 ms apart even if it's only 2 or 3 ms later. This presents a major problem since the state i'm saving de...
[ { "answer_id": 4962857, "author": "Roman Starkov", "author_id": 33080, "author_profile": "https://Stackoverflow.com/users/33080", "pm_score": 5, "selected": false, "text": "Thread.Sleep(1) DateTime.UtcNow Thread.Sleep(2) DateTime.UtcNow . UtcNow timeBeginPeriod DateTime.UtcNow Thread.Sle...
2008/11/21
[ "https://Stackoverflow.com/questions/307582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,596
<p>Does anyone know how to calculate time difference in C++ in milliseconds? I used <a href="http://linux.die.net/man/3/difftime" rel="noreferrer"><code>difftime</code></a> but it doesn't have enough precision for what I'm trying to measure.</p>
[ { "answer_id": 307604, "author": "SoapBox", "author_id": 36384, "author_profile": "https://Stackoverflow.com/users/36384", "pm_score": 2, "selected": false, "text": "gettimeofday" }, { "answer_id": 307607, "author": "Tyler McHenry", "author_id": 39375, "author_profile...
2008/11/21
[ "https://Stackoverflow.com/questions/307596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23084/" ]
307,610
<p>I keep seeing people say that exceptions are slow, but I never see any proof. So, instead of asking if they are, I will ask how do exceptions work behind the scenes, so I can make decisions of when to use them and whether they are slow.</p> <p>From what I know, exceptions are the same as doing a return bunch of tim...
[ { "answer_id": 307716, "author": "CesarB", "author_id": 28258, "author_profile": "https://Stackoverflow.com/users/28258", "pm_score": 8, "selected": true, "text": "class MyException\n{\npublic:\n MyException() { }\n ~MyException() { }\n};\n\nvoid my_throwing_function(bool throwit)\...
2008/11/21
[ "https://Stackoverflow.com/questions/307610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,619
<p>My code works (yeah!) which sends json to a server.. would appreciate any thoughts on refactoring</p> <p>1) My C# code sends this json to the server</p> <p>{\"firstName\":\"Bill\",\"lastName\":\"Gates\",\"email\":\"asdf@hotmail.com\",\"deviceUUID\":\"abcdefghijklmnopqrstuvwxyz\"}</p> <p>Which I have to get rid of...
[ { "answer_id": 307683, "author": "Dave Mateer", "author_id": 26086, "author_profile": "https://Stackoverflow.com/users/26086", "pm_score": 0, "selected": false, "text": "$inbound = $_POST['json'];\nvar_dump($inbound);\n" }, { "answer_id": 307878, "author": "Dave Mateer", ...
2008/11/21
[ "https://Stackoverflow.com/questions/307619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26086/" ]
307,623
<p>I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper:</p> <pre><code>$output = utf8_encode(htmle...
[ { "answer_id": 307630, "author": "SoapBox", "author_id": 36384, "author_profile": "https://Stackoverflow.com/users/36384", "pm_score": 1, "selected": false, "text": "$output = htmlentities(utf8_encode($source));" }, { "answer_id": 307641, "author": "Eran Galperin", "autho...
2008/11/21
[ "https://Stackoverflow.com/questions/307623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
307,636
<p>I am able to create and execute a DTS package that copies tables from a remote Oracle database to a local SQL server, but want to setup the connection to the Oracle database as a linked server.</p> <p>The DTS package currently uses the <em>Microsoft OLE DB Provider for Oracle</em> with the following properties:</p>...
[ { "answer_id": 319018, "author": "Oppositional", "author_id": 2029, "author_profile": "https://Stackoverflow.com/users/2029", "pm_score": 6, "selected": true, "text": "C:\\Oracle C:\\Oracle\\instantclient_10_2 tnsnames.ora OracleTnsName = \n(\n DESCRIPTION=\n (\n ADDRESS = (PROTOCOL...
2008/11/21
[ "https://Stackoverflow.com/questions/307636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2029/" ]
307,640
<p><strong>Edited:</strong> What is the easiest way to <s>scrape</s> extract SharePoint list data to a separate SQL Server table? One condition: you're in a work environment where you don't control the SQL Server behind the SharePoint Server, so you can't just pull from the <em>UserData</em> table. </p> <p>Is there ...
[ { "answer_id": 4301806, "author": "Ulf", "author_id": 523618, "author_profile": "https://Stackoverflow.com/users/523618", "pm_score": 2, "selected": false, "text": "My Custom SharePoint List Corp Images Image Name" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/307640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36590/" ]
307,650
<p>How can I remove duplicate values from an array in PHP?</p>
[ { "answer_id": 307655, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 9, "selected": true, "text": "$array = array(1, 2, 2, 3);\n$array = array_unique($array); // Array is now (1, 2, 3)\n" }, { "answer_id": 2397157,...
2008/11/21
[ "https://Stackoverflow.com/questions/307650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39539/" ]
307,656
<p>I have a C#.net winform program which runs with a SQL Server database. I am using LINQ-to-SQL. Is it possible to rollback the call to one or more stored procedures inside a transaction within my program using LINQ-to-SQL? </p> <p>Initially I thought it would make sense to manage the transaction inside the stored...
[ { "answer_id": 307682, "author": "Andre Gallo", "author_id": 14401, "author_profile": "https://Stackoverflow.com/users/14401", "pm_score": -1, "selected": false, "text": " public Response<SomeObject> SaveSomething(Object yourObject)\n {\n DbTransaction dbTransaction = null;\...
2008/11/21
[ "https://Stackoverflow.com/questions/307656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,658
<p>I find myself running scripts and copy-pasting the output of these runs into emails or into some other documents. Is there a way such that I can make the copy-to-clipboard step a part of the script itself? Most of my scripts are either Perl or bat files and I work on Windows. </p> <p>Thanks.</p>
[ { "answer_id": 307668, "author": "digitalsanctum", "author_id": 22436, "author_profile": "https://Stackoverflow.com/users/22436", "pm_score": 0, "selected": false, "text": "somescript.bat > output.txt\n" }, { "answer_id": 307690, "author": "Blair Conrad", "author_id": 119...
2008/11/21
[ "https://Stackoverflow.com/questions/307658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27928/" ]
307,664
<p>Say I have a user control like the one below, how would I bind something to the <code>ActualWidth</code> of the "G1" grid from outside of the control?</p> <pre><code>&lt;UserControl x:Class="Blah"&gt; &lt;WrapPanel&gt; &lt;Grid x:Name="G1"&gt; ... &lt;/Grid&gt; &lt;Grid&gt; ... &lt;/Gr...
[ { "answer_id": 307677, "author": "Jobi Joy", "author_id": 8091, "author_profile": "https://Stackoverflow.com/users/8091", "pm_score": 1, "selected": false, "text": "DependencyProperty DependencyProperty" }, { "answer_id": 308385, "author": "Arcturus", "author_id": 900, ...
2008/11/21
[ "https://Stackoverflow.com/questions/307664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36074/" ]
307,669
<p>I am trying to write an rspec test for a controller that accesses a model Group.</p> <pre> @request.env['HTTP_REFERER'] = group_url(@mock_group) ### Line 49 </pre> <p>I get this:</p> <pre> NoMethodError in 'ActsController responding to create should redirect to :back' You have a nil object when you didn't expect...
[ { "answer_id": 344892, "author": "Matt Burke", "author_id": 29691, "author_profile": "https://Stackoverflow.com/users/29691", "pm_score": 2, "selected": false, "text": "it \"should do whatever when referrer is group thing\" do\n @request.env[\"HTTP_REFERER\"] = url_for(@mock_group)\n g...
2008/11/21
[ "https://Stackoverflow.com/questions/307669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,674
<p>How can I remove duplicate values from a multi-dimensional array in PHP?</p> <p>Example array:</p> <pre><code>Array ( [0] =&gt; Array ( [0] =&gt; abc [1] =&gt; def ) [1] =&gt; Array ( [0] =&gt; ghi [1] =&gt; jkl ) [2] =&gt; Array ( [0] =&gt;...
[ { "answer_id": 307701, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 4, "selected": false, "text": "\nfunction multi_unique($array) {\n foreach ($array as $k=>$na)\n $new[$k] = serialize($na);\n $uniq = array_...
2008/11/21
[ "https://Stackoverflow.com/questions/307674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39539/" ]
307,679
<p>On PHP, they have a way to restrict file size AFTER uploading, but not BEFORE uploading. I use the <a href="http://malsup.com/jquery/form/" rel="noreferrer">Malsup jQuery Form Plugin</a> for my form posting, and it supports image file posting.</p> <p>I was wondering if perhaps there's a restriction where I can set ...
[ { "answer_id": 307861, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "Requested content-length of 4000107 is larger than the configured limit of 2097152\n <h1>Request Entity Too Large</h1>\n Redir...
2008/11/21
[ "https://Stackoverflow.com/questions/307679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,688
<p>What is a simple way of downloading a file from a URL path?</p>
[ { "answer_id": 307697, "author": "vbroto", "author_id": 20837, "author_profile": "https://Stackoverflow.com/users/20837", "pm_score": 7, "selected": false, "text": "System.Net.WebClient.DownloadFile string remoteUri = \"http://www.contoso.com/library/homepage/images/\";\nstring fileName ...
2008/11/21
[ "https://Stackoverflow.com/questions/307688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20837/" ]
307,692
<p>I would like to know the simplest and most effective way to open and write data to a socket in the C programming language for network programming.</p>
[ { "answer_id": 35681089, "author": "Ciro Santilli OurBigBook.com", "author_id": 895245, "author_profile": "https://Stackoverflow.com/users/895245", "pm_score": 3, "selected": false, "text": "./server.out\n ifconfig 192.168.0.10 ./client.out 192.168.0.10\n #define _XOPEN_SOURCE 700\n\n#in...
2008/11/21
[ "https://Stackoverflow.com/questions/307692", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2128/" ]
307,695
<p>Being new to Cocoa, and probably not knowing all of the potential classes available that already have this functionality neatly wrapped in an OO class, here's an algorithm inquiry. What's the best bet to count how many times a particular key occurs in an array of multiple <code>NSDictionary</code> instances?</p> <p...
[ { "answer_id": 307824, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 3, "selected": true, "text": "NSDictionary * dict1 = [[NSDictionary alloc] initWithObjectsAndKeys:\n [NSNumber numberWithInt:1], @...
2008/11/21
[ "https://Stackoverflow.com/questions/307695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,706
<p>Is there any easy way to add a using statement to every class I create in a project without having to write</p> <pre><code>using SomeNamespace; </code></pre> <p>in every file?</p> <p>[edit] I could add a template I realise but I'm talking about doing it for every file in an existing project.</p>
[ { "answer_id": 307710, "author": "EndangeredMassa", "author_id": 106, "author_profile": "https://Stackoverflow.com/users/106", "pm_score": 0, "selected": false, "text": "<system.web>\n <pages>\n <namespaces>\n <add namespace=\"System.IO\" />\n ...
2008/11/21
[ "https://Stackoverflow.com/questions/307706", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6084/" ]
307,709
<p>When working with Silverlight, I've noticed that Firefox will cache the XAP file, so if I do an update, a user may be stuck using an outdated version. Is there a way to force the browser to either re-download the XAP file every time, or maybe only force it to after an update has been published? Or is there a setti...
[ { "answer_id": 307781, "author": "Jarett Millard", "author_id": 15882, "author_profile": "https://Stackoverflow.com/users/15882", "pm_score": 2, "selected": false, "text": "Cache-control: no-cache\nPragma: no-cache\n" }, { "answer_id": 310523, "author": "Kevin Moore", "au...
2008/11/21
[ "https://Stackoverflow.com/questions/307709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12172/" ]
307,729
<pre><code>class Ball: a = [] def __init__(self): pass def add(self,thing): self.a.append(thing) def size(self): print len(self.a) for i in range(3): foo = Ball() foo.add(1) foo.add(2) foo.size() </code></pre> <p>I would expect a return of :</p> <pre><code>2 2 2 </code></pre> <p>But I ...
[ { "answer_id": 307775, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "class Ball:\n def __init__(self):\n self.a = []\n a = [] __init__ self.a" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/307729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35335/" ]
307,737
<p>I've got this problem with dynamically created TextBox.</p> <p>When the TextBox is created in PageLoad, it's TextChanged event was fired.<br> But when I dynamically delete and recreated the TextBox, the TextChanged was not fired.</p> <p>This is the code:</p> <p><strong>.aspx file</strong></p> <pre><code>&lt;body...
[ { "answer_id": 307817, "author": "Howard Pinsley", "author_id": 7961, "author_profile": "https://Stackoverflow.com/users/7961", "pm_score": 1, "selected": false, "text": " \"The process that matches controls to posted values occurs \n after page_load completes, so it has to o...
2008/11/21
[ "https://Stackoverflow.com/questions/307737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36036/" ]
307,740
<p>In asp.net mvc, when do we use:</p> <p>and</p> <p>Do we ever need to put a ; (colon) ?</p>
[ { "answer_id": 307754, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 4, "selected": true, "text": "<%= %> <% %> <%= %> <% %> <%= Html.Encode( Model. Property ) %> <% Html.RenderPartial( \"ViewName\" ); %>" }, { ...
2008/11/21
[ "https://Stackoverflow.com/questions/307740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
307,763
<p>In VB6, ActiveX DLL is listed as a project template but in VS 2005+ there is no such thing. Where is my good old ActiveX DLL template? Many thanks in advance.</p>
[ { "answer_id": 308741, "author": "RS Conley", "author_id": 7890, "author_profile": "https://Stackoverflow.com/users/7890", "pm_score": 2, "selected": false, "text": "<ComClass(ComClass1.ClassId, ComClass1.InterfaceId, ComClass1.EventsId)> _\nPublic Class ComClass1\n\n#Region \"COM GUIDs\...
2008/11/21
[ "https://Stackoverflow.com/questions/307763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8203/" ]
307,765
<p>I was thinking along the lines of using <code>typeid()</code> but I don't know how to ask if that type is a subclass of another class (which, by the way, is abstract)</p>
[ { "answer_id": 307779, "author": "Howard Pinsley", "author_id": 7961, "author_profile": "https://Stackoverflow.com/users/7961", "pm_score": -1, "selected": false, "text": "if (myObj is Car) {\n\n}\n" }, { "answer_id": 307793, "author": "Dima", "author_id": 13313, "aut...
2008/11/21
[ "https://Stackoverflow.com/questions/307765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39189/" ]
307,766
<p>I'm trying to convert a Web Site to the Web Application project model and I'm running into compile errors that do not seem to be covered by the guidance I found at <a href="http://msdn.microsoft.com/en-us/library/aa983476.aspx" rel="nofollow noreferrer">Converting a Web Site Project to a Web Application Project</a>....
[ { "answer_id": 307779, "author": "Howard Pinsley", "author_id": 7961, "author_profile": "https://Stackoverflow.com/users/7961", "pm_score": -1, "selected": false, "text": "if (myObj is Car) {\n\n}\n" }, { "answer_id": 307793, "author": "Dima", "author_id": 13313, "aut...
2008/11/21
[ "https://Stackoverflow.com/questions/307766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7961/" ]
307,774
<p>How can I list the contents of a zipped folder in C#? For example how to know how many items are contained within a zipped folder, and what is their name?</p>
[ { "answer_id": 307778, "author": "Chris Ballance", "author_id": 1551, "author_profile": "https://Stackoverflow.com/users/1551", "pm_score": 4, "selected": false, "text": "ZipInputStream inStream = new ZipInputStream(File.OpenRead(fileName));\n\nwhile (inStream.GetNextEntry())\n{\n\n ...
2008/11/21
[ "https://Stackoverflow.com/questions/307774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20837/" ]
307,777
<p>This is a really basic question but...</p> <p>I have some code like this</p> <pre><code>var arr = Array('blah.jpg','ha.jpg'); for (var i=0; i&lt;array.length; i++) { $('div#blah' + i).click(function() { $('img').attr('src', arr[i]); }); } </code></pre> <p>This should bind the div with <code>id="bla...
[ { "answer_id": 307786, "author": "shahkalpesh", "author_id": 23574, "author_profile": "https://Stackoverflow.com/users/23574", "pm_score": 0, "selected": false, "text": "\nvar j = 0;\nfor (var i=0; i<array.length; i++)\n{\n $('div#blah' + j).click(function() {\n $('img').att...
2008/11/21
[ "https://Stackoverflow.com/questions/307777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364/" ]
307,783
<p>When using topfunky's <a href="http://nubyonrails.com/articles/automation-with-rstakeout" rel="nofollow noreferrer">RStakeout</a>, the color in the result of the <code>spec</code> command is lost. This happens even when adding the <code>--color</code> flag.</p>
[ { "answer_id": 307788, "author": "Chris Lloyd", "author_id": 42413, "author_profile": "https://Stackoverflow.com/users/42413", "pm_score": 2, "selected": true, "text": "AUTOTEST export AUTOTEST=true\n set -x AUTOTEST true\n" }, { "answer_id": 4435801, "author": "sent-hil", ...
2008/11/21
[ "https://Stackoverflow.com/questions/307783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42413/" ]
307,796
<p>Hopefully a nice simple one.</p> <p>I've got a php3 website that I want to run on php 5.2</p> <p>To start with I'd just like to have every reference to the current "index.php3" _within_each_file_ (recursively) changed to "index.php" and then move on to worrying about globals etc.</p> <p>K. Go!</p> <p>:) </p> <p...
[ { "answer_id": 307815, "author": "Brian C. Lane", "author_id": 27461, "author_profile": "https://Stackoverflow.com/users/27461", "pm_score": 2, "selected": false, "text": "sed -i 's/php3/php/g' *" }, { "answer_id": 307816, "author": "Jonathan Leffler", "author_id": 15168,...
2008/11/21
[ "https://Stackoverflow.com/questions/307796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13007/" ]
307,798
<p>I'm working on a little web crawler that will run in the system tray and crawl a web site every hour on the hour.</p> <p>What is the best way to get .NET to raise an event every hour or some other interval to perform some task. For example I want to run an event every 20 minutes based on the time. The event would b...
[ { "answer_id": 307806, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 6, "selected": true, "text": "int minutes = DateTime.Now.Minute;\nint adjust = 10 - (minutes % 10);\ntimer.Interval = adjust * 60 * 1000; \n" }, ...
2008/11/21
[ "https://Stackoverflow.com/questions/307798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/392/" ]
307,821
<p>I am using my own custom authentication with IIS, and I want the server on <i>every</i> page load (no matter what type of file) to first check the Application variable to see if the user is authenticated and authorized to see the site. In global.asax this could be:</p> <pre><code>void Application_Start(Object Sende...
[ { "answer_id": 307822, "author": "Alexander Bird", "author_id": 10608, "author_profile": "https://Stackoverflow.com/users/10608", "pm_score": 4, "selected": true, "text": "response.redirect(\"login.aspx\")" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/307821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10608/" ]
307,828
<p>I accidentally committed an unwanted file (<code>filename.orig</code> while resolving a merge) to my repository several commits ago, without me noticing it until now. I want to completely delete the file from the repository history. </p> <p>Is it possible to rewrite the change history such that <code>filename.orig<...
[ { "answer_id": 308355, "author": "CesarB", "author_id": 28258, "author_profile": "https://Stackoverflow.com/users/28258", "pm_score": 0, "selected": false, "text": "git filter-branch" }, { "answer_id": 308684, "author": "CB Bailey", "author_id": 19563, "author_profile...
2008/11/21
[ "https://Stackoverflow.com/questions/307828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27314/" ]
307,832
<p>I would like to learn the best practices in reloading the application state, such that when my app is started, it should automatically load the "correct" view/subview when it is opened again.</p> <p>In my particular case, my app has a bunch of view controllers, each taking care of a UITableView. I would like for my...
[ { "answer_id": 307880, "author": "Ben Gottlieb", "author_id": 6694, "author_profile": "https://Stackoverflow.com/users/6694", "pm_score": 4, "selected": true, "text": "[navigationController pushViewController: viewController animated: NO]" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/307832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35478/" ]
307,845
<p>I am trying to add a <code>UIButton</code> at runtime however it is not visible. What am I doing wrong?</p> <pre><code>- (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { UIButton *btn = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain]; btn.frame = CGRectMake(...
[ { "answer_id": 3888919, "author": "NguyenHungA5", "author_id": 470028, "author_profile": "https://Stackoverflow.com/users/470028", "pm_score": 1, "selected": false, "text": "btn buttonClick UIButton *btn= [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];\nbtn.frame = CGRectMake...
2008/11/21
[ "https://Stackoverflow.com/questions/307845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30099/" ]
307,855
<p>So, I'm working on some network programming in C, and it would seem that I am missing a bunch of standard C/C++ header files. For example, <code>sys/socket.h</code> is not there. A few otheres are missing too like <code>netdb.h</code>, and <code>unistd.h</code>. Is there a pack I need to install to get these on wind...
[ { "answer_id": 307902, "author": "Alex B", "author_id": 23643, "author_profile": "https://Stackoverflow.com/users/23643", "pm_score": 3, "selected": true, "text": "#define strtok_r strtok_s" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/307855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2128/" ]
307,857
<p>I would like to completely reset the scroll position of a UITableView, so that every time I open it, it is displaying the top-most items. In other words, I would like to scroll the table view to the top every time it is opened.</p> <p>I tried using the following piece of code, but it looks like I misunderstood the ...
[ { "answer_id": 307922, "author": "August", "author_id": 30966, "author_profile": "https://Stackoverflow.com/users/30966", "pm_score": 3, "selected": false, "text": "scrollToRowAtIndexPath:atScrollPosition:animated:\n selectRowAtIndexPath:animated:scrollPosition:\n" }, { "answer_i...
2008/11/21
[ "https://Stackoverflow.com/questions/307857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35478/" ]
307,859
<p>I'd like to skip the tests and create a (default) Makefile.</p>
[ { "answer_id": 307889, "author": "Evan Teran", "author_id": 13430, "author_profile": "https://Stackoverflow.com/users/13430", "pm_score": 2, "selected": false, "text": "CC=g++\nCFLAGS=-c -Wall\nLDFLAGS=\nSOURCES=main.cpp hello.cpp\nOBJECTS=$(SOURCES:.cpp=.o)\nEXECUTABLE=hello\n\nall: $(S...
2008/11/21
[ "https://Stackoverflow.com/questions/307859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,882
<p>jQuery's <code>draggable</code> functionality doesn't seem to work on tables (in FF3 or Safari). It's kind of difficult to envision how this <em>would</em> work, so it's not really surprising that it doesn't.</p> <pre><code>&lt;html&gt; &lt;style type='text/css'&gt; div.table { display: table; } div.row {...
[ { "answer_id": 2231845, "author": "Ariel Popovsky", "author_id": 29804, "author_profile": "https://Stackoverflow.com/users/29804", "pm_score": 5, "selected": false, "text": "helper: function(event){\nreturn $('<div class=\"drag-cart-item\"><table></table></div>').find('table').append($(e...
2008/11/21
[ "https://Stackoverflow.com/questions/307882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3594/" ]
307,929
<p>If I have a query such as <code>SELECT * from authors where name = @name_param</code>, is there a regex to parse out the parameter names (specifically the "name_param")?</p> <p>Thanks</p>
[ { "answer_id": 307957, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 3, "selected": false, "text": "SELECT * FROM authors WHERE name = @name_param \n AND string = 'don\\'t use @name_param';\n @name_param _stripQuoted(...
2008/11/21
[ "https://Stackoverflow.com/questions/307929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,939
<p>In java, does <code>file.delete()</code> return <code>true</code> or <code>false</code> where <code>File file</code> refers to a non-existent file?</p> <p>I realize this is kind of a basic question, and easy to very through test, but I'm getting strange results and would appreciate confirmation.</p>
[ { "answer_id": 307952, "author": "Steve B.", "author_id": 19479, "author_profile": "https://Stackoverflow.com/users/19479", "pm_score": 2, "selected": false, "text": "Deletes the file or directory denoted by this abstract pathname. If this pathname denotes a directory, then the directory...
2008/11/21
[ "https://Stackoverflow.com/questions/307939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20498/" ]
307,941
<p>I've connected to a MySQL database using Perl DBI. I would like to find out which database I'm connected to.</p> <p>I don't think I can use:</p> <pre><code>$dbh-&gt;{Name} </code></pre> <p>because I call <a href="http://dev.mysql.com/doc/refman/5.0/en/use.html" rel="noreferrer"><code>USE new_database</code></a> ...
[ { "answer_id": 307972, "author": "ysth", "author_id": 17389, "author_profile": "https://Stackoverflow.com/users/17389", "pm_score": 1, "selected": false, "text": "($dbname) = (each %{$dbh->selectrow_hashref(\"show tables\")}) =~ /^Tables_in_(.*)/;\n" }, { "answer_id": 307975, ...
2008/11/21
[ "https://Stackoverflow.com/questions/307941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4704/" ]
307,942
<p>OK, so Sybase (12.5.4) will let me do the following to DROP a table if it already exists:</p> <pre><code>IF EXISTS ( SELECT 1 FROM sysobjects WHERE name = 'a_table' AND type = 'U' ) DROP TABLE a_table GO </code></pre> <p>But if I try to do the same with table creation, I always get warned that the ...
[ { "answer_id": 307958, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": -1, "selected": false, "text": "IF object_id('a_table') IS NULL\nBEGIN\n CREATE TABLE a_table (\n col1 int not null,\n col2 int null...
2008/11/21
[ "https://Stackoverflow.com/questions/307942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1030/" ]
307,951
<p>I run an OpenSuse server that uploads zipped source code backups to a Microsoft FTP server every night. I have written a Bash script that does this through a cron job.</p> <p>I want to delete backed up files that are older than a certain date. How could I do this?</p>
[ { "answer_id": 307958, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": -1, "selected": false, "text": "IF object_id('a_table') IS NULL\nBEGIN\n CREATE TABLE a_table (\n col1 int not null,\n col2 int null...
2008/11/21
[ "https://Stackoverflow.com/questions/307951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1264322/" ]
307,964
<p>I am developing an online examination using servlets/jsp.I need to add a count down (hh/mm/ss) timer to the questions page that would end the exam and redirects to results page.</p> <p>I am done with all the other functionalities except the timer one.</p> <p>Can someone provide some help on this.</p> <p>Thanks</p...
[ { "answer_id": 6072810, "author": "sachin", "author_id": 762833, "author_profile": "https://Stackoverflow.com/users/762833", "pm_score": 1, "selected": false, "text": "<html>\n<%@page session=\"false\" %>\n<%\nHttpSession s=request.getSession(false);\n\nif(s==null) { %>\n\n <jsp:forwa...
2008/11/21
[ "https://Stackoverflow.com/questions/307964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11193/" ]
307,968
<p>I lost my installation of Dave Gillespie's calc.el by reinstalling Cygwin. It is not included with the default Cygwin install of Emacs. Who is considered the master maintainer these days? Is version 2.02f still most current?</p>
[ { "answer_id": 308001, "author": "Jouni K. Seppänen", "author_id": 26575, "author_profile": "https://Stackoverflow.com/users/26575", "pm_score": 2, "selected": false, "text": "cvs -d:pserver:anonymous@cvs.sv.gnu.org:/sources/emacs co emacs/lisp/calc\n" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/307968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39526/" ]
307,984
<p>Is it possible to declare an instance of a generic without knowing the type at design-time?</p> <p>Example:</p> <pre><code>Int i = 1; List&lt;typeof(i)&gt; list = new List&lt;typeof(i)&gt;(); </code></pre> <p>where the type of i could be anything, instead of having to do:</p> <pre><code>List&lt;int&gt; list = ne...
[ { "answer_id": 308006, "author": "Nathan", "author_id": 24954, "author_profile": "https://Stackoverflow.com/users/24954", "pm_score": 1, "selected": false, "text": "static void Main(string[] args)\n{\n int i = 1;\n var thelist = CreateList(i);\n}\n\npublic static List<T> CreateList...
2008/11/21
[ "https://Stackoverflow.com/questions/307984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490/" ]
308,019
<p>I have this line of JavaScript and the behavior I am seeing is that the <code>selectedLi</code> instantly disappears without "sliding up". This is not the behavior that I expected.</p> <p>What should I be doing so that the <code>selectedLi</code> slides up before it is removed?</p> <pre><code>selectedLi.slideUp("...
[ { "answer_id": 308034, "author": "seanb", "author_id": 3354, "author_profile": "https://Stackoverflow.com/users/3354", "pm_score": 9, "selected": true, "text": "selectedLi.slideUp(\"normal\", function() { $(this).remove(); } );\n" }, { "answer_id": 310278, "author": "Communit...
2008/11/21
[ "https://Stackoverflow.com/questions/308019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3957/" ]
308,027
<p>I think my eclipse's ctrl+clicking links might benefit greatly...</p> <p><b>Edit:</b> I'm using eclipse PDT.</p> <p><b>Edit 2:</b> I'm very happy with the solution of putting docblocks before functions (and variables) with an @return or @var statement, I've just updated the documentation of my app and now eclipse ...
[ { "answer_id": 308137, "author": "Stefan Gehrig", "author_id": 11354, "author_profile": "https://Stackoverflow.com/users/11354", "pm_score": 5, "selected": true, "text": "// [...]\n/**\n * Return the Request object\n *\n * @return Zend_Controller_Request_Abstract\n */\npublic function ge...
2008/11/21
[ "https://Stackoverflow.com/questions/308027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14966/" ]
308,044
<p>The first thing I do when I incorporate any third party code into my application is reformat it to my personal coding preference:</p> <pre><code>// Single line comments only // I never put spaces inside my parenthesis -(void)myOCDMethod { // If an if or for statement has only one instruction, I don't use ...
[ { "answer_id": 308799, "author": "Ben Gottlieb", "author_id": 6694, "author_profile": "https://Stackoverflow.com/users/6694", "pm_score": 2, "selected": false, "text": " -(void)myOCDMethod -> - (void) myOCDMethod if (this) \n{\n //code\n}\n if (this) {\n //code\n}\n \nfloat ...
2008/11/21
[ "https://Stackoverflow.com/questions/308044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28106/" ]
308,046
<p>So I'm doing this in PHP but it is a logic issue so I'll try to write it as generically as possible.</p> <p>To start here's how this pagination script works:</p> <ol> <li>for (<em>draw first three pages links</em>)</li> <li>if (<em>draw ellipsis (...) if there are pages between #1's pages and #3's pages</em>)</li>...
[ { "answer_id": 308106, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 2, "selected": false, "text": "function cdotinator ( $current_page, $page_count ) \n{\n $stepsize = 3; \n $elipse = '...';\n # Simple Case. \n i...
2008/11/21
[ "https://Stackoverflow.com/questions/308046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428190/" ]
308,054
<p>It's kind of embarassing that I find it so difficult to learn JavaScript, but .. </p> <p>Let's say I have a really simple controller like this:</p> <pre><code>class front extends Controller { public function __construct() { parent::Controller(); } public function index() { ...
[ { "answer_id": 308127, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 4, "selected": false, "text": "public function test() {\n $somenumber = $this->input->post('someNumber');\n if ($somenumber == 12) {\n print \"Nu...
2008/11/21
[ "https://Stackoverflow.com/questions/308054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
308,059
<p>I am trying to set up apache instead of IIS because <a href="https://stackoverflow.com/questions/188896/why-does-iis-crash-when-i-print-to-stderr-in-perl">IIS needlessly crashes</a> all the time, and it would be nice to be able to have my own checkout of the source instead of all of us editing a common checkout.</p>...
[ { "answer_id": 308070, "author": "brian d foy", "author_id": 2766176, "author_profile": "https://Stackoverflow.com/users/2766176", "pm_score": 5, "selected": true, "text": "-nph Expires Last-Modified use CGI qw(-nph)\n\nCGI::nph(1)\n\nprint header( -nph => 1, ...)\n # This no longer seem...
2008/11/21
[ "https://Stackoverflow.com/questions/308059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12448/" ]
308,061
<p>I was of the opinion that virtualization doesnt work in the super class constructor as per the design of OOP. For example, consider the following C# code. </p> <pre><code>using System; namespace Problem { public class BaseClass { public BaseClass() { Console.WriteLine("Hello, W...
[ { "answer_id": 308092, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": false, "text": "random" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/308061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30341/" ]
308,076
<p>I want to spruce up some areas of my website with a few jQuery animations here and there, and I'm looking to replace my AJAX code entirely since my existing code is having some cross-browser compatibility issues. However, since jQuery is a JavaScript library, I'm worried about my pages not functioning correctly when...
[ { "answer_id": 308104, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 4, "selected": true, "text": "a.info:hover span{ display:none}\n function createCSSRule(rule,attributes)\n{\n //Create the CSS rule\n var newRule = \"\\...
2008/11/21
[ "https://Stackoverflow.com/questions/308076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19521/" ]
308,081
<p>For the iPhone, is it possible to configure a UITableView such that it will allow multiple-selection?</p> <p>I've tried overriding <code>-setSelected:animated:</code> for each UITableViewCell, but trying to fudge the required behavior is tricky as it's difficult to separate the real unselections from the ones where...
[ { "answer_id": 675215, "author": "Benjamin Ortuzar", "author_id": 71560, "author_profile": "https://Stackoverflow.com/users/71560", "pm_score": 5, "selected": false, "text": " - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {\n\n UITableV...
2008/11/21
[ "https://Stackoverflow.com/questions/308081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1221378/" ]
308,085
<p>I have a DataGridView that I want to query using Linq (C# WinForm). I want to "count" rows where a certain criteria is met. For example, </p> <pre><code>variable1 = "count rows where ColumnBoxAge &gt; 3 || &lt; 5" label1.Text = variable1 </code></pre> <p>How to do this in C# WinForm using Linq?</p>
[ { "answer_id": 308148, "author": "Ali Ersöz", "author_id": 4215, "author_profile": "https://Stackoverflow.com/users/4215", "pm_score": 3, "selected": true, "text": "dataSet.Tables[0].AsEnumerable().Where(c => c.Field<int>(\"ageColumn\") > 3 ||\n c.Field<int>(\"ageColumn\") < 5).Count...
2008/11/21
[ "https://Stackoverflow.com/questions/308085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10385/" ]
308,109
<p>I've noticed that in some lines of rails views, this is used:</p> <pre><code>&lt;% # Code... -%&gt; </code></pre> <p>instead of:</p> <pre><code>&lt;% # Code... %&gt; </code></pre> <p>What is the difference?</p>
[ { "answer_id": 308114, "author": "dylanfm", "author_id": 38795, "author_profile": "https://Stackoverflow.com/users/38795", "pm_score": 4, "selected": false, "text": " <ul>\n <% @posts.each do |post| -%> \n <li><%=post.title%></li>\n <% end -%>\n </ul>\n <ul> <li> </li> <...
2008/11/21
[ "https://Stackoverflow.com/questions/308109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36049/" ]
308,122
<p>What is the regular expression for a decimal with a precision of 2?</p> <p><em>Valid examples</em>:</p> <pre><code>123.12 2 56754 92929292929292.12 0.21 3.1 </code></pre> <p><em>Invalid examples:</em></p> <pre><code>12.1232 2.23332 e666.76 </code></pre> <p>The decimal point may be optional, and integers may als...
[ { "answer_id": 308124, "author": "DocMax", "author_id": 6234, "author_profile": "https://Stackoverflow.com/users/6234", "pm_score": 10, "selected": true, "text": "[0-9]+(\\.[0-9][0-9]?)?\n \\d+(\\.\\d{1,2})?\n ^\\d+(\\.\\d{1,2})?$\n .12 12. . ^(\\d+(\\.\\d{0,2})?|\\.?\\d{1,2})$\n ()? 12....
2008/11/21
[ "https://Stackoverflow.com/questions/308122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39221/" ]
308,125
<p>Is there anything like Firebug that you can use within Google Chrome?</p> <p>Essential features I would like:</p> <ul> <li>Inspect HTML source (select elements, delete them, etc.)</li> <li>check CSS values (the built-in solution is weird, somehow)</li> </ul>
[ { "answer_id": 1707770, "author": "Manuel", "author_id": 50770, "author_profile": "https://Stackoverflow.com/users/50770", "pm_score": 3, "selected": false, "text": "javascript:var firebug=document.createElement('script');firebug.setAttribute('src','http://getfirebug.com/releases/lite/1....
2008/11/21
[ "https://Stackoverflow.com/questions/308125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9535/" ]
308,133
<p>I'm using PHP 5.2. I'd like to find a way to output a unique id for every object, so it's easy when looking over logs to see which objects are the same.</p> <p>In Ruby, I'd just say object.object_id to get Ruby's internal identifier for the object. There doesn't seem to be an obvious way to do this in PHP.</p> <p>...
[ { "answer_id": 308145, "author": "azkotoki", "author_id": 28581, "author_profile": "https://Stackoverflow.com/users/28581", "pm_score": 7, "selected": true, "text": "spl_object_hash()" }, { "answer_id": 34599839, "author": "rolacja", "author_id": 4307374, "author_prof...
2008/11/21
[ "https://Stackoverflow.com/questions/308133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31092/" ]
308,156
<p>I have created one sample PHP script to upload excel sheets of very bigger sizes. Also the process happening with each records given in the excel sheets is bit complex. To allow bigger sizes, I have added necessary PHP ini values in the Apache configuration file to override the actual PHP ini values.</p> <p>The pro...
[ { "answer_id": 308225, "author": "Mojah", "author_id": 30330, "author_profile": "https://Stackoverflow.com/users/30330", "pm_score": 1, "selected": false, "text": "error_reporting(E_ALL);\n" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/308156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
308,158
<p>When reviewing our codebase, I found an inheritance structure that resembles the following pattern:</p> <pre><code>interface IBase { void Method1(); void Method2(); } interface IInterface2 : IBase { void Method3(); } class Class1 : IInterface2 { ... } class Class2 : IInterface2 { ... } class...
[ { "answer_id": 308183, "author": "Greg Beech", "author_id": 13552, "author_profile": "https://Stackoverflow.com/users/13552", "pm_score": 2, "selected": false, "text": "NotImplementedException Stream Read Write Seek NotSupportedException" }, { "answer_id": 308245, "author": "...
2008/11/21
[ "https://Stackoverflow.com/questions/308158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2822/" ]
308,174
<p>I have just moved job and gone from VB 6 to VB.Net and found the learning jump fairly steep, have more a problem with the object / conceptual side of things .. but getting there now ... but as I was a assembler / C++ 10/15 years ago and was considering learning C++/C# .Net (XNA games library calls my name) but not s...
[ { "answer_id": 963852, "author": "Binoj Antony", "author_id": 33015, "author_profile": "https://Stackoverflow.com/users/33015", "pm_score": 1, "selected": false, "text": "Sub Function" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/308174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32336/" ]
308,175
<p>I can't tell if this is a result of the jQuery I'm using, but this is what I'm trying to do:</p> <pre><code>&lt;div class=&quot;info&quot; style=&quot;display: inline;&quot; onMouseOut=&quot;$(this).children('div').hide('normal');&quot; onMouseOver=&quot;$(this).children('div').show('normal');&quot; &gt; &lt...
[ { "answer_id": 308209, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 4, "selected": true, "text": "$('.info').bind('mouseenter', function() {\n $('div', this).show('normal');\n});\n\n$('.info').bind('mouseleave', function() ...
2008/11/21
[ "https://Stackoverflow.com/questions/308175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19521/" ]
308,187
<p>how do I translate this code into jython?</p> <pre><code> ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(file + ".zip")); byte[] buf = new byte[1024]; int len; //Create a new Zip entry with the file's name. ZipEntry zipEntry = new ZipEntry(file.toString()); //Create a bu...
[ { "answer_id": 308210, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 3, "selected": true, "text": "bin in from jarray import zeros\nfrom java.io import BufferedInputStream, FileInputStream, FileOutputStream\nfrom java.util.z...
2008/11/21
[ "https://Stackoverflow.com/questions/308187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21537/" ]
308,188
<p>I'm trying to use <a href="http://www.jboss.org/community/docs/DOC-10032" rel="noreferrer">this method</a> for receiving mail in our EJB3 app. In short, that means creating an MDB with the following annotations:</p> <pre><code>@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "mailServer"...
[ { "answer_id": 337473, "author": "Brett Hannah", "author_id": 42491, "author_profile": "https://Stackoverflow.com/users/42491", "pm_score": 5, "selected": true, "text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<ejb-jar version=\"3.0\">\n <enterprise-beans>\n <message-driv...
2008/11/21
[ "https://Stackoverflow.com/questions/308188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6400/" ]
308,191
<p>I have a group of strings in Javascript and I need to write a function that detects if another specific string belongs to this group or not.</p> <p>What is the fastest way to achieve this? Is it alright to put the group of values into an array, and then write a function that searches through the array?</p> <p>I th...
[ { "answer_id": 308201, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 3, "selected": false, "text": "// prepare a mock-up object\nsetOfValues = {};\nfor (var i = 0; i < 100; i++)\n setOfValues[\"example value \" + i] = tru...
2008/11/21
[ "https://Stackoverflow.com/questions/308191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11384/" ]
308,203
<p>I'm trying to figure out how to execute a custom query with Castle ActiveRecord. </p> <p>I was able to run simple query that returns my entity, but what I really need is the query like that below (with custom field set):</p> <p><em>select count(1) as cnt, data from workstationevent where serverdatetime >= :minDate...
[ { "answer_id": 318100, "author": "Neil Hewitt", "author_id": 22178, "author_profile": "https://Stackoverflow.com/users/22178", "pm_score": 4, "selected": true, "text": "HqlBasedQuery ArrayList object[] HqlBasedQuery query = new HqlBasedQuery(typeof(WorkStationEvent),\n \"select count(...
2008/11/21
[ "https://Stackoverflow.com/questions/308203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22680/" ]
308,204
<p>I would like to hear from you guys on how do you decide when you should be using concrete parameterized type vs. bounded parameterized type when designing API, esp. (that I care most) of defining a class/interface.</p> <p>For instance,</p> <pre><code>public interface Event&lt;S&gt;{ void setSource(S s); } publi...
[ { "answer_id": 308229, "author": "Miserable Variable", "author_id": 18573, "author_profile": "https://Stackoverflow.com/users/18573", "pm_score": 0, "selected": false, "text": "B extends A BHandler extends AHandler AHandler.handle(A) BHandler.handle(B)" }, { "answer_id": 1277054,...
2008/11/21
[ "https://Stackoverflow.com/questions/308204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36397/" ]
308,219
<p>I'm trying to build a multi-level dropdrown CSS menu for a website I'm doing on the umbraco content management system.</p> <p>I need to build it to have the following structure:</p> <pre><code>&lt;ul id="nav"&gt; &lt;li&gt;&lt;a href=".."&gt;Page #1&lt;/a&gt;&lt;/li&gt; &lt;li&gt; &lt;a href=".."&gt;Page #...
[ { "answer_id": 308651, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 4, "selected": true, "text": "parent <!-- update this variable on how deep your menu should be -->\n<xsl:variable name=\"maxLevelForMenu\" select=\"4\"/>...
2008/11/21
[ "https://Stackoverflow.com/questions/308219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
308,227
<p>Two snippets of MySQL: </p> <pre><code>SELECT * FROM annoyingly_long_left_hand_table LEFT JOIN annoyingly_long_right_hand_table ON annoyingly_long_left_hand_table.id = annoyingly_long_right_hand_table.id; </code></pre> <p>vs</p> <pre><code>SELECT * FROM annoyingly_long_left_hand_table LEFT JOIN...
[ { "answer_id": 1493614, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 1, "selected": false, "text": "USING ON" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/308227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20074/" ]
308,254
<p>I am running an Ubuntu 8.10, using Python 2.5 out of the box. This is fine from the system point of view, but I need Python2.4 since I dev on Zope / Plone.</p> <p>Well, installing python2.4 is no challenge, but I can't find a (clean) way to make iPython use it : no option in the man nor in the config file.</p> <p>...
[ { "answer_id": 308260, "author": "e-satis", "author_id": 9951, "author_profile": "https://Stackoverflow.com/users/9951", "pm_score": 5, "selected": true, "text": "ls /usr/bin/ipython*\n/usr/bin/ipython /usr/bin/ipython2.4 /usr/bin/ipython2.5\n" }, { "answer_id": 5293422, "a...
2008/11/21
[ "https://Stackoverflow.com/questions/308254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9951/" ]
308,258
<p>How do I tell the Vim editor about my include files path so that it can auto complete the function names when I press <kbd>CTRL</kbd>+<kbd>N</kbd>?</p> <p>For example, I have a C program like below:</p> <pre><code>#include&lt;stdio.h&gt; int main() { sca // here I press control+N, it does not complete to scanf...
[ { "answer_id": 308274, "author": "Rob Wells", "author_id": 2974, "author_profile": "https://Stackoverflow.com/users/2974", "pm_score": 5, "selected": true, "text": ".vimrc .vimrc set path+=/usr/include/**\nset path+=/my_include_dir/include\nset path+=/my_include_dir/srclib/apr/**\nset pa...
2008/11/21
[ "https://Stackoverflow.com/questions/308258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39615/" ]
308,276
<p>As a <a href="http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29" rel="noreferrer">C#</a> developer I'm used to running through constructors:</p> <pre class="lang-cs prettyprint-override"><code>class Test { public Test() { DoSomething(); } public Test(int count) : this() { ...
[ { "answer_id": 308309, "author": "Cyrille Ka", "author_id": 39622, "author_profile": "https://Stackoverflow.com/users/39622", "pm_score": 7, "selected": false, "text": "class SomeType\n{\n int number;\n \npublic:\n SomeType(int newNumber) : number(newNumber) {}\n SomeType() : SomeType...
2008/11/21
[ "https://Stackoverflow.com/questions/308276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2090/" ]
308,277
<p>I am working on a C++ project and I noticed that we have a number of warnings about unused parameters.</p> <p>What effect could it have if these warnings are ignored?</p>
[ { "answer_id": 308286, "author": "Alex B", "author_id": 23643, "author_profile": "https://Stackoverflow.com/users/23643", "pm_score": 7, "selected": true, "text": "#ifdef void (void)param1;\n #define UNUSED(expr) do { (void)(expr); } while (0)\n...\n\nvoid foo(int param1, int param2)\n{\...
2008/11/21
[ "https://Stackoverflow.com/questions/308277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24459/" ]
308,279
<p>Been thinking, what's the difference between declaring a variable with [] or * ? The way I see it:</p> <pre><code>char *str = new char[100]; char str2[] = "Hi world!"; </code></pre> <p>.. should be the main difference, though Im unsure if you can do something like</p> <pre><code>char *str = "Hi all"; </code></pre...
[ { "answer_id": 308312, "author": "warren", "author_id": 4418, "author_profile": "https://Stackoverflow.com/users/4418", "pm_score": -1, "selected": false, "text": "upperCaseString()" }, { "answer_id": 308315, "author": "Timbo", "author_id": 1810, "author_profile": "ht...
2008/11/21
[ "https://Stackoverflow.com/questions/308279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25745/" ]
308,298
<p>Using <strong>sc</strong> command we can query, start , stop windows services.<br> For ex: </p> <pre><code>sc query "windows service name" </code></pre> <p>The <strong>sc config</strong> command changes the configuration of the service, but I don't know how to use it. </p> <p>Could someone tell me how we can se...
[ { "answer_id": 308319, "author": "Andrew Ferrier", "author_id": 27641, "author_profile": "https://Stackoverflow.com/users/27641", "pm_score": 8, "selected": true, "text": "sc.exe config \"[servicename]\" obj= \"[.\\username]\" password= \"[password]\"\n obj= \"foo\" obj=\"foo\"" }, {...
2008/11/21
[ "https://Stackoverflow.com/questions/308298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32670/" ]
308,301
<p>I've got code similar to the following...</p> <pre><code>&lt;p&gt;&lt;label&gt;Do you have buffet facilities?&lt;/label&gt; &lt;asp:RadioButtonList ID="blnBuffetMealFacilities:chk" runat="server"&gt; &lt;asp:ListItem Text="Yes" Value="1"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="No" Value="0"&gt;&lt...
[ { "answer_id": 308327, "author": "Andrew Bullock", "author_id": 28543, "author_profile": "https://Stackoverflow.com/users/28543", "pm_score": 6, "selected": true, "text": "$('#rblDiv input').click(function(){\n alert($('#rblDiv input').index(this));\n});\n $('.divCollection div:eq(' +...
2008/11/21
[ "https://Stackoverflow.com/questions/308301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5055/" ]
308,307
<p>Can anyone point me in the right direction how to configure Visual Studio 2005 with our C++ console project how we can include a 'File Version' in the details section of the file properties.</p> <p>I've tried resource files without any luck. This is with a C++ project just for clarification, and big thank you for t...
[ { "answer_id": 308380, "author": "user33675", "author_id": 33675, "author_profile": "https://Stackoverflow.com/users/33675", "pm_score": 3, "selected": false, "text": "VS_VERSION_INFO" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/308307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
308,324
<p>I want to generate a CSV file for user to use Excel to open it.</p> <p>If I want to escape the comma in values, I can write it as "640,480".</p> <p>If I want to keep the leading zeros, I can use ="001234".</p> <p>But if I want to keep both comma and leading zeros in the value, writing as ="001,002" will be splitt...
[ { "answer_id": 308340, "author": "Nick Fortescue", "author_id": 5346, "author_profile": "https://Stackoverflow.com/users/5346", "pm_score": 2, "selected": false, "text": "\"\"\"001,002\"\"\"\n" }, { "answer_id": 308352, "author": "Kent Fredric", "author_id": 15614, "a...
2008/11/21
[ "https://Stackoverflow.com/questions/308324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288936/" ]
308,342
<p>I have a table with the following columns:</p> <pre> A B C --------- 1 10 X 1 11 X 2 15 X 3 20 Y 4 15 Y 4 20 Y </pre> <p>I want to group the data based on the B and C columns and count the distinct values of the A column. But if there are two ore more rows where the value on the A column is...
[ { "answer_id": 308387, "author": "Dheer", "author_id": 17266, "author_profile": "https://Stackoverflow.com/users/17266", "pm_score": 0, "selected": false, "text": "select count(a), BB, CC from\n(\nselect a, max(B) BB, Max(C) CC\nfrom yourtable\ngroup by a\n)\ngroup by BB,CC\n" }, { ...
2008/11/21
[ "https://Stackoverflow.com/questions/308342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24065/" ]
308,349
<p>I've created a a folder and after I open a file inside of that folder a write on it. It happens that after that I try to open the file but I have no permissions thus I have to change it manually.</p> <pre><code>/* str1 has tha name of the folder */ /* str the bytes I want to write in the file inside the folder*/ .....
[ { "answer_id": 308374, "author": "CesarB", "author_id": 28258, "author_profile": "https://Stackoverflow.com/users/28258", "pm_score": 3, "selected": false, "text": "open() open() O_CREAT" }, { "answer_id": 308575, "author": "wimh", "author_id": 33499, "author_profile"...
2008/11/21
[ "https://Stackoverflow.com/questions/308349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
308,359
<p>Is either:</p> <pre><code>&lt;a href="#"&gt;&lt;h1&gt;text here&lt;/h1&gt;&lt;/a&gt; </code></pre> <p>or</p> <pre><code>&lt;h1&gt;&lt;a href="#"&gt;text here&lt;/a&gt;&lt;/h1&gt; </code></pre> <p>"correct". Is there any benefit of using the first one, it seems more logical to me. Perhaps from an SEO point?</p>
[ { "answer_id": 308375, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 5, "selected": true, "text": "<h1><a href=\"#\">text here</a></h1>\n <h1> <a>" }, { "answer_id": 308378, "author": "Tamas Czinege", "author_id...
2008/11/21
[ "https://Stackoverflow.com/questions/308359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26823/" ]
308,364
<p>I've just done a test with bitfields, and the results are surprising me. </p> <pre><code>class test1 { public: bool test_a:1; bool test_b:1; bool test_c:1; bool test_d:1; bool test_e:1; bool test_f:1; bool test_g:1; bool test_h:1; }; class test2 { public: int test_a:1; int t...
[ { "answer_id": 308393, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 3, "selected": false, "text": "#ifndef __cplusplus\n#include <stdbool.h>\n#endif\n#include <stdio.h>\n\nstruct test1 {\n bool test_a:1;\n bool test_b...
2008/11/21
[ "https://Stackoverflow.com/questions/308364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1737/" ]
308,390
<p>I know this may be simple but being C++ I doubt it will be. How do I convert a string in the form 01/01/2008 to a date so I can manipulate it? I am happy to break the string into the day month year constituents. Also happy if solution is Windows only.</p>
[ { "answer_id": 308399, "author": "kenny", "author_id": 3225, "author_profile": "https://Stackoverflow.com/users/3225", "pm_score": 4, "selected": false, "text": "#include <time.h>\nchar *strptime(const char *buf, const char *format, struct tm *tm);\n" }, { "answer_id": 308916, ...
2008/11/21
[ "https://Stackoverflow.com/questions/308390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39634/" ]
308,401
<p>When I maximize 1 MDI child form, all MDI child forms would be maximized too. Is it possible to have 1 form maximized and another one not?</p> <p>Thanks in advance.</p>
[ { "answer_id": 4186597, "author": "jp2code", "author_id": 153923, "author_profile": "https://Stackoverflow.com/users/153923", "pm_score": 0, "selected": false, "text": "Child1.Show() Form1.Show(this) Form1.ShowDialog(this)" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/308401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39635/" ]
308,406
<p>One of my custom developed <a href="http://en.wikipedia.org/wiki/ASP.NET" rel="nofollow noreferrer">ASP.NET</a> sites was hacked today: "Hacked By Swan (Please Stop Wars !.. )" It is using ASP.NET and SQL Server 2005 and IIS 6.0 and Windows 2003 server. I am not using Ajax and I think I am using stored procedures e...
[ { "answer_id": 308634, "author": "digiguru", "author_id": 5055, "author_profile": "https://Stackoverflow.com/users/5055", "pm_score": 3, "selected": false, "text": "Dim strSQL As String = \"Select * FROM USERS Where name = '\" & Response.Querystring(\"name\") \"'\"\n Dim strSQL As String...
2008/11/21
[ "https://Stackoverflow.com/questions/308406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26817/" ]
308,417
<p>I have some issue with a Perl script. It modifies the content of a file, then reopen it to write it, and in the process some characters are lost. All words starting with '%' are deleted from the file. That's pretty annoying because the % expressions are variable placeholders for dialog boxes.</p> <p>Do you have any ...
[ { "answer_id": 308434, "author": "brian d foy", "author_id": 2766176, "author_profile": "https://Stackoverflow.com/users/2766176", "pm_score": 6, "selected": true, "text": "printf printf print FILE $content;\n open my($in), \"<\", $file or die \"cannot open file $file\\n\";\nopen...
2008/11/21
[ "https://Stackoverflow.com/questions/308417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29568/" ]
308,427
<p>I need a collection that </p> <ul> <li>contains a set of objects linked to a double.</li> <li>The sequence of these pairs should be arbitrary set by me (based on an int I get from the database) and be static throughout the lifecycle.</li> <li>The number of entries will be small (0 ~ 20) but varying.</li> <li>The co...
[ { "answer_id": 308441, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": false, "text": "KeyValuePair public class MutablePair<TFirst, TSecond>\n{\n public TFirst First { get; set; }\n public TSecond Sec...
2008/11/21
[ "https://Stackoverflow.com/questions/308427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
308,428
<p>If I type the command:</p> <pre><code>mvn dependency:list </code></pre> <p>The <a href="http://maven.apache.org/plugins/maven-dependency-plugin/" rel="nofollow noreferrer">docs</a> suggest that I'll get a list of my project's dependencies. Instead though, I get this:</p> <pre><code>[INFO] Searching repository for...
[ { "answer_id": 308480, "author": "Ivan Dubrov", "author_id": 31118, "author_profile": "https://Stackoverflow.com/users/31118", "pm_score": 2, "selected": false, "text": "mvn -cpu dependency:list mvn --check-plugin-updates dependency:list list list ~/.m2/repository/org/apache/maven/plugin...
2008/11/21
[ "https://Stackoverflow.com/questions/308428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/974/" ]
308,436
<p>How to (programmatically, without xml config) configure multiple loggers with Log4Net? I need them to write to different files.</p>
[ { "answer_id": 308544, "author": "Blair Conrad", "author_id": 1199, "author_profile": "https://Stackoverflow.com/users/1199", "pm_score": 7, "selected": true, "text": "using log4net;\nusing log4net.Appender;\nusing log4net.Layout;\nusing log4net.Repository.Hierarchy;\n\n// Set the level ...
2008/11/21
[ "https://Stackoverflow.com/questions/308436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35425/" ]
308,438
<p>I am using tinyMCE and, rather annoyingly, it replaces all of my apostrophes with their HTML numeric equivalent. Now most of the time this isn't a problem but for some reason I am having a problem storing the apostrophe replacement. So i have to search through the string and replace them all. Any help would be much ...
[ { "answer_id": 308439, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 4, "selected": true, "text": "$string = str_replace(\"&#39;\", \"<replacement>\", $string);\n" }, { "answer_id": 308574, "author": "RJHunter", ...
2008/11/21
[ "https://Stackoverflow.com/questions/308438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31677/" ]
308,454
<p>What is the difference between web reference and service reference in WCF? Which is preferable in WCF?</p>
[ { "answer_id": 2973819, "author": "Christian Hayter", "author_id": 115413, "author_profile": "https://Stackoverflow.com/users/115413", "pm_score": 6, "selected": false, "text": "basicHttpBinding" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/308454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]