qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
288,424
<p>I was wondering if there is a good IRC channel around somewhere that allows iPhone developers to get together and talk about code and etc.</p> <p>Any channel already around that people are using?</p>
[ { "answer_id": 289178, "author": "wisequark", "author_id": 33159, "author_profile": "https://Stackoverflow.com/users/33159", "pm_score": 1, "selected": false, "text": "#iphonedev irc.freenode.net" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/288424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35478/" ]
288,441
<p>I long thought that in C, all variables had to be declared at the beginning of the function. I know that in C99, the rules are the same as in C++, but what are the variable declaration placement rules for C89/ANSI C?</p> <p>The following code compiles successfully with <code>gcc -std=c89</code> and <code>gcc -ansi<...
[ { "answer_id": 288455, "author": "mipadi", "author_id": 28804, "author_profile": "https://Stackoverflow.com/users/28804", "pm_score": 8, "selected": true, "text": "s -pedantic c { }" }, { "answer_id": 288479, "author": "Kiley Hykawy", "author_id": 22727, "author_profi...
2008/11/13
[ "https://Stackoverflow.com/questions/288441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30323/" ]
288,445
<p>I have a swf file that's embedded in a html page, and I have a close button in the swf page, I want the swf to disappear when I click on the button, what is the best way to do that? Thanks.</p>
[ { "answer_id": 1176547, "author": "Yens", "author_id": 71772, "author_profile": "https://Stackoverflow.com/users/71772", "pm_score": 3, "selected": true, "text": "function removeFlashFromHTML() \n{\n swfobject.removeSWF(\"id_of_your_html_object\");\n}\n function buttonClicked(evt:MouseEv...
2008/11/13
[ "https://Stackoverflow.com/questions/288445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34797/" ]
288,465
<p>I'm building an XML DOM document in C++. My problem is this: I execute an XPATH query from an Element in my Document, which I know will return another Element. The elementPtr->selectSingleNode call returns an IXMLDOMNode. How can I gain access to the attributes of this node?</p> <p>Part of me wants to downcast the...
[ { "answer_id": 288518, "author": "DavidK", "author_id": 31394, "author_profile": "https://Stackoverflow.com/users/31394", "pm_score": 1, "selected": false, "text": "MSXML2::IXMLDOMElementPtr pParentElement(pParentNode);\n" }, { "answer_id": 289207, "author": "Greg Domjan", ...
2008/11/13
[ "https://Stackoverflow.com/questions/288465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37481/" ]
288,500
<p>I am having an issue with SSH hanging on my Mac Book Pro. This only happens to me once I get home from work after I have used SSH while at work. The three factors I have narrowed the issue down to are SSH, our work AFS network drive and the method of network connectivity.</p> <p>At work we use an AFS drive with Ker...
[ { "answer_id": 339741, "author": "Paul Ivanov", "author_id": 36303, "author_profile": "https://Stackoverflow.com/users/36303", "pm_score": 2, "selected": false, "text": "Supported escape sequences:\n~. - terminate connection\n~B - send a BREAK to the remote system\n~C - open a command...
2008/11/13
[ "https://Stackoverflow.com/questions/288500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29690/" ]
288,508
<p>Does Xcode support anything akin to Visual Studio style <code>#region</code> directives for arbitrary code folding?</p>
[ { "answer_id": 288530, "author": "Jason Coco", "author_id": 34218, "author_profile": "https://Stackoverflow.com/users/34218", "pm_score": 7, "selected": true, "text": "#pragma mark\n // MARK:\n// TODO:\n// FIXME:\n// !!!:\n// ???:\n" }, { "answer_id": 716751, "author": "willc...
2008/11/13
[ "https://Stackoverflow.com/questions/288508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13932/" ]
288,512
<p>Anyone knows a good way to resize any window to for example 640x480?</p> <p>Reason is, of course, screencasting.</p> <p>Under windows I've used ZoneSize from donationcoder. (Btw: For Firefox it's easy, just use the web developer toolbar.)</p>
[ { "answer_id": 288537, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 7, "selected": true, "text": "$ wmctrl -l\n0x00c00003 -1 rgamble-desktop Bottom Expanded Edge Panel\n0x00c00031 -1 rgamble-desktop Top Expanded Edg...
2008/11/13
[ "https://Stackoverflow.com/questions/288512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9987/" ]
288,513
<p>Here is what I am trying to do: Given a date, a day of the week, and an integer <code>n</code>, determine whether the date is the <code>n</code>th day of the month.</p> <p>For example:</p> <ul> <li><p>input of <code>1/1/2009,Monday,2</code> would be false because <code>1/1/2009</code> is not the second Monday</p><...
[ { "answer_id": 288529, "author": "Robert Wagner", "author_id": 10784, "author_profile": "https://Stackoverflow.com/users/10784", "pm_score": 5, "selected": true, "text": "private bool NthDayOfMonth(DateTime date, DayOfWeek dow, int n){\n int d = date.Day;\n return date.DayOfWeek == dow...
2008/11/13
[ "https://Stackoverflow.com/questions/288513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19038/" ]
288,540
<p>C#: How do you tell which item index is selected in ListView?</p>
[ { "answer_id": 288551, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 2, "selected": false, "text": "myListView.SelectedIndices\n" }, { "answer_id": 288555, "author": "Nathan W", "author_id": 6335, ...
2008/11/13
[ "https://Stackoverflow.com/questions/288540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
288,546
<p>I need to connect to an Exchange mailbox in a Python script, without using any profile setup on the local machine (including using Outlook). If I use win32com to create a MAPI.Session I could logon (with the Logon() method) with an existing profile, but I want to just provide a username &amp; password.</p> <p>Is t...
[ { "answer_id": 3072491, "author": "Erik Cederstrand", "author_id": 219640, "author_profile": "https://Stackoverflow.com/users/219640", "pm_score": 7, "selected": false, "text": "from exchangelib import DELEGATE, Account, Credentials\n\ncredentials = Credentials(\n username='MYWINDOMAI...
2008/11/13
[ "https://Stackoverflow.com/questions/288546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4966/" ]
288,550
<p>How can I create a Sidebar form in delphi.</p> <p>I try the <code>ScreenSnap</code> and <code>Align</code> properties but I need that the form stay visible even if the user maximize other forms, without been on top. Just like the windows sidebar do.</p> <p><strong>Update</strong>: From the comments: if a window is m...
[ { "answer_id": 288588, "author": "Kluge", "author_id": 8752, "author_profile": "https://Stackoverflow.com/users/8752", "pm_score": 0, "selected": false, "text": "SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);\n" }, { "answer_id": 288980, "author": "R...
2008/11/13
[ "https://Stackoverflow.com/questions/288550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24293/" ]
288,559
<p>Even though error_reporting is set to 0, database errors are still being printed to screen. Is there a setting somewhere I can change to disable database error reporting? This is for CodeIgniter v1.6.x</p> <p><strong>EDIT</strong>: Re: Fixing errors - Um, yes. I want to fix the errors. I get error notices from my e...
[ { "answer_id": 288748, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 6, "selected": false, "text": "config/database.php: // ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.\n $db['default']['db_debug'] = ...
2008/11/13
[ "https://Stackoverflow.com/questions/288559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
288,560
<p>I have the following structure:</p> <pre><code> &lt;StructLayout(LayoutKind.Sequential)&gt; _ Public Structure _WTS_CLIENT_ADDRESS Public AddressFamily As Integer &lt;MarshalAs(UnmanagedType.ByValArray, SizeConst:=20)&gt; _ Public Address() As Byte End Structure </code></pre> <p>...
[ { "answer_id": 311934, "author": "Jérôme Laban", "author_id": 26346, "author_profile": "https://Stackoverflow.com/users/26346", "pm_score": 3, "selected": true, "text": "IPAddress address = new IPAddress(_ClientIPAddress.Address.Skip(2).Take(4).ToArray());\n" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/288560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13338/" ]
288,564
<p>I have a web application project (wap) that is successfully being deployed to a development server by our tfsbuild server.</p> <p>I'd like the build server to run our collection of webtests after deployment.</p> <p>What is a best practice (or ANY practice) for doing this?</p>
[ { "answer_id": 311934, "author": "Jérôme Laban", "author_id": 26346, "author_profile": "https://Stackoverflow.com/users/26346", "pm_score": 3, "selected": true, "text": "IPAddress address = new IPAddress(_ClientIPAddress.Address.Skip(2).Take(4).ToArray());\n" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/288564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2424/" ]
288,573
<p>When using regular expressions in Ruby, what is the difference between $1 and \1?</p>
[ { "answer_id": 288595, "author": "Avdi", "author_id": 20487, "author_profile": "https://Stackoverflow.com/users/20487", "pm_score": 7, "selected": true, "text": "sub gsub \"foobar\".sub(/foo(.*)/, '\\1\\1') # => \"barbar\"\n if \"foobar\" =~ /foo(.*)/ then \n puts \"The matching word wa...
2008/11/13
[ "https://Stackoverflow.com/questions/288573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
288,575
<p>I inherited a project that uses SQL Server 200x, wherein a column that stores a value that is always considered as a percentage in the problem domain is stored as its greater than 1 decimal equivalent. For example, <em>70%</em> (0.7, literally) is stored as <em>70</em>, <em>100%</em> as <em>100</em>, etc. Aside from...
[ { "answer_id": 288643, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 2, "selected": false, "text": "(0.3==3*.1)\n abs( 0.3 - 3*.1 )\n (column-SomeValue) BETWEEN -0.0001 AND 0.0001 ABS(column-SomeValue) < 0.0001 column = Som...
2008/11/13
[ "https://Stackoverflow.com/questions/288575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4296/" ]
288,582
<p>Here's the scenario - a client uploads a Sybase dump file to (gzipped) to our local FTP server. We have an automated process which picks these up and then moves them to different server within the network where the database server resides. Unfortunately, this transfer is over a WAN, which for large files takes a lon...
[ { "answer_id": 555574, "author": "brianegge", "author_id": 14139, "author_profile": "https://Stackoverflow.com/users/14139", "pm_score": 3, "selected": true, "text": "$ md5sum *.dmp\n2bddf3cd8b04010183dd3295ce7594ff pubs_1.dmp\n7510e0250c8d68bae3e0e794c211e60b pubs_2.dmp\n091fe54fa5fd8...
2008/11/13
[ "https://Stackoverflow.com/questions/288582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1030/" ]
288,584
<p>I want to use <a href="http://code.google.com/apis/visualization/documentation/gallery/annotatedtimeline.html" rel="nofollow noreferrer">Google's Annotated Time Line Visualization</a>. It is very easy to make this work by manually adding the lines for column &amp; row data. This is all done through attributes of goo...
[ { "answer_id": 369245, "author": "jjclarkson", "author_id": 46425, "author_profile": "https://Stackoverflow.com/users/46425", "pm_score": 1, "selected": false, "text": "$connectionstring = odbc_connect($db, $user, $pass) or die(\"Connection Failed\");\n$query = \"...\";\n$result = odbc_d...
2008/11/13
[ "https://Stackoverflow.com/questions/288584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16771/" ]
288,603
<p>I am getting </p> <pre><code>Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *filename* on line 81 </code></pre> <p>While running a query to build a chart. The query gets data from the mysql db and uses it to build the chart.</p> <p>Usually, I get this error and go to the...
[ { "answer_id": 288610, "author": "mercutio", "author_id": 1951, "author_profile": "https://Stackoverflow.com/users/1951", "pm_score": 3, "selected": true, "text": "$rosh=mysql_query(\"select distinct term from search_terms\")\n or die(\"Error with query: \" . mysql_error());\n $bash=mys...
2008/11/13
[ "https://Stackoverflow.com/questions/288603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1149/" ]
288,612
<p>I have a form that excepts a file upload in ASP.NET. I need to increase the max upload size to above the 4 MB default.</p> <p>I have found in certain places referencing the below code at <a href="http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength.aspx" rel="noreferr...
[ { "answer_id": 288667, "author": "ben", "author_id": 7561, "author_profile": "https://Stackoverflow.com/users/7561", "pm_score": 4, "selected": false, "text": "Web.config <system.web>\n\n <httpRuntime maxRequestLength=\"600000\"/>\n</system.web>\n" }, { "answer_id": 288675...
2008/11/13
[ "https://Stackoverflow.com/questions/288612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/576/" ]
288,614
<p>How would I go about creating a real world form creation class that I can use to display a new form with fields of different types, as how many fields I want, I can use drop downs and I can do all of this by using OOP?</p>
[ { "answer_id": 288706, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 4, "selected": true, "text": "method action enctype class Form {\n var $attributes, // array, with keys ['method' => 'post', 'action' => 'mypage.php'.....
2008/11/13
[ "https://Stackoverflow.com/questions/288614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37418/" ]
288,619
<p>Say I have a sql query </p> <pre><code>SELECT fname, lname, dob, ssn, address1, address2, zip, phone,state from users </code></pre> <p>Now say the records are now either in dictionary base or a strongly typed collection.</p> <p>I have a grid view control and i want to bind it to my collection but I only want to d...
[ { "answer_id": 288627, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 2, "selected": false, "text": "from user in UserCollection\nselect new { FirstName=user.fname, LastName=user.lname, Dob=user.dob, SSN=user.ssn }...
2008/11/13
[ "https://Stackoverflow.com/questions/288619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
288,637
<p>I need to construct some rather simple SQL, I suppose, but as it's a rare event that I work with DBs these days I can't figure out the details.</p> <p>I have a table 'posts' with the following columns:</p> <blockquote> <p>id, caption, text</p> </blockquote> <p>and a table 'comments' with the following columns:<...
[ { "answer_id": 288655, "author": "hark", "author_id": 34826, "author_profile": "https://Stackoverflow.com/users/34826", "pm_score": -1, "selected": false, "text": "SELECT p.caption FROM posts p WHERE (SELECT COUNT(*) FROM comments c WHERE c.post_id=p.id) > 1; SELECT COUNT(*) comment_coun...
2008/11/13
[ "https://Stackoverflow.com/questions/288637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4055/" ]
288,687
<p>I've written a cheap &amp; cheerful sound board in for my Mac, and I play the various sounds with NSSound like this:</p> <pre><code>-(void)play:(NSSound *)soundEffect:(BOOL)stopIfPlaying { BOOL wasPlaying = FALSE; if([nowPlaying isPlaying]) { [nowPlaying stop]; wasPlaying = TRUE; } ...
[ { "answer_id": 289386, "author": "Chris Blackwell", "author_id": 1329401, "author_profile": "https://Stackoverflow.com/users/1329401", "pm_score": 0, "selected": false, "text": "if([nowPlaying isPlaying]) {\n for(int i = 1; i < 100; ++i)\n {\n [nowPlaying setVolume: (1.0 / ...
2008/11/13
[ "https://Stackoverflow.com/questions/288687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11470/" ]
288,695
<p>I want to parse an Apache <strong>access.log</strong> file with a python program in a certain way, and though I am completely new to object-oriented programming, I want to start doing it now.</p> <p>I am going to create a class <strong>ApacheAccessLog</strong>, and the only thing I can imagine now, it will be doing...
[ { "answer_id": 288807, "author": "Adam Byrtek", "author_id": 36656, "author_profile": "https://Stackoverflow.com/users/36656", "pm_score": 5, "selected": true, "text": "readline readline" }, { "answer_id": 307776, "author": "Francis Stephens", "author_id": 39476, "aut...
2008/11/13
[ "https://Stackoverflow.com/questions/288695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37511/" ]
288,699
<p>Can someone show me how to get the <code>top</code> &amp; <code>left</code> position of a <code>div</code> or <code>span</code> element when one is not specified?</p> <p>ie:</p> <pre><code>&lt;span id='11a' style='top:55px;' onmouseover=&quot;GetPos(this);&quot;&gt;stuff&lt;/span&gt; &lt;span id='12a' onmouseover=&q...
[ { "answer_id": 288708, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 8, "selected": true, "text": "function getPos(el) {\n // yay readability\n for (var lx=0, ly=0;\n el != null;\n lx += el.offsetLeft, ly...
2008/11/13
[ "https://Stackoverflow.com/questions/288699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26685/" ]
288,707
<p>I'm working with large numbers that I can't have rounded off. Using Lua's standard math library, there seem to be no convenient way to preserve precision past some internal limit. I also see there are several libraries that can be loaded to work with big numbers:</p> <ol> <li><a href="http://oss.digirati.com.br/l...
[ { "answer_id": 620789, "author": "Jon Ericson", "author_id": 1438, "author_profile": "https://Stackoverflow.com/users/1438", "pm_score": 3, "selected": false, "text": "PLAT src/Makefile linux none libmapm.a /usr/local/lib/ m_apm.h m_apm_lc.h /usr/local/include/ LUA LUAINC LUALIB LUABIN M...
2008/11/13
[ "https://Stackoverflow.com/questions/288707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1438/" ]
288,715
<p>How can I check whether a variable is defined in Ruby? Is there an <code>isset</code>-type method available?</p>
[ { "answer_id": 288724, "author": "digitalsanctum", "author_id": 22436, "author_profile": "https://Stackoverflow.com/users/22436", "pm_score": 4, "selected": false, "text": "defined?(your_var) your_var.nil?" }, { "answer_id": 288726, "author": "Ricardo Acras", "author_id":...
2008/11/13
[ "https://Stackoverflow.com/questions/288715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
288,732
<p>I'm working on a program that searches entire drives for a given file. At the moment, I calculate an MD5 hash for the known file and then scan all files recursively, looking for a match.</p> <p>The only problem is that MD5 is painfully slow on large files. Is there a faster alternative that I can use while retainin...
[ { "answer_id": 17743934, "author": "Sergey Grischenko", "author_id": 2599083, "author_profile": "https://Stackoverflow.com/users/2599083", "pm_score": 0, "selected": false, "text": " using (FileStream stream = File.OpenRead(filePath))\n {\n using (var bufferedStr...
2008/11/13
[ "https://Stackoverflow.com/questions/288732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14333/" ]
288,739
<p>I need to generate random numbers within a specified interval, [max;min].</p> <p>Also, the random numbers should be uniformly distributed over the interval, not located to a particular point.</p> <p>Currenly I am generating as:</p> <pre><code>for(int i=0; i&lt;6; i++) { DWORD random = rand()%(max-min+1) + min...
[ { "answer_id": 288753, "author": "Jason Coco", "author_id": 34218, "author_profile": "https://Stackoverflow.com/users/34218", "pm_score": 2, "selected": false, "text": "rand() random()" }, { "answer_id": 288760, "author": "Rob Walker", "author_id": 3631, "author_profi...
2008/11/13
[ "https://Stackoverflow.com/questions/288739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33411/" ]
288,752
<p>I have this strange issue with my web app. You see, I'm using jQuery with the Forms API and doing $('#MyForm').ajaxSubmit(api parms and callback function goes here).</p> <p>Randomly when I do this, however, and only on Firefox, the page load icon starts spinning, the page load progress bar runs in the status bar, a...
[ { "answer_id": 288753, "author": "Jason Coco", "author_id": 34218, "author_profile": "https://Stackoverflow.com/users/34218", "pm_score": 2, "selected": false, "text": "rand() random()" }, { "answer_id": 288760, "author": "Rob Walker", "author_id": 3631, "author_profi...
2008/11/13
[ "https://Stackoverflow.com/questions/288752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
288,775
<p>Say I have a method that needs to pull 8 values from a map with 100 elements in it. Which do you think would be preferable:</p> <p>Walk in a for loop from begin to end once, pulling the elements out by switching on the key?</p> <p>Or using find 8 times to get those values?</p>
[ { "answer_id": 288872, "author": "Artelius", "author_id": 31945, "author_profile": "https://Stackoverflow.com/users/31945", "pm_score": 3, "selected": false, "text": "find" } ]
2008/11/13
[ "https://Stackoverflow.com/questions/288775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
288,779
<p>In asp.net mvc, I want to create a action for login.</p> <p>So this is how I am doing it:</p> <ol> <li><p>create a action/view named login that simply displays the view.</p></li> <li><p>create another action, named login2 that will be the page that handles the form post and checks the database if the username/pass...
[ { "answer_id": 836940, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": " /// <summary>\n /// Displays the Login screen the first time\n /// to anyone who wishes to view it.\n /// </summa...
2008/11/13
[ "https://Stackoverflow.com/questions/288779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
288,794
<p>For instance, does the compiler know to translate</p> <pre><code>string s = "test " + "this " + "function"; </code></pre> <p>to</p> <pre><code>string s = "test this function"; </code></pre> <p>and thus avoid the performance hit with the string concatenation?</p>
[ { "answer_id": 288913, "author": "Michael Burr", "author_id": 12711, "author_profile": "https://Stackoverflow.com/users/12711", "pm_score": 5, "selected": false, "text": "+ string result = x + y + z;\n string result = String.Concat( x, y, z);\n string result = String.Concat( String.Conca...
2008/11/13
[ "https://Stackoverflow.com/questions/288794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337/" ]
288,800
<p>I have this naive regex "&lt;([\s]|[^&lt;])+?>" (excluding the quotation marks). It seems so straightforward but it is indeed evil when it works against the below HTML text. It sends the Java regular expression engine to an infinite loop. </p> <p>I have another regex ("&lt;.+?>"), which does somewhat the same thing...
[ { "answer_id": 288843, "author": "localshred", "author_id": 29690, "author_profile": "https://Stackoverflow.com/users/29690", "pm_score": 2, "selected": false, "text": "([\\s]|[^<]) < < `\"<([^<])+?>\"`\n" }, { "answer_id": 289676, "author": "Jan Goyvaerts", "author_id": ...
2008/11/13
[ "https://Stackoverflow.com/questions/288800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8203/" ]
288,810
<p>Getting the subdomain from a URL sounds easy at first.</p> <pre><code>http://www.domain.example </code></pre> <p>Scan for the first period then return whatever came after the "http://" ...</p> <p>Then you remember</p> <pre><code>http://super.duper.domain.example </code></pre> <p>Oh. So then you think, okay, fin...
[ { "answer_id": 288885, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 5, "selected": false, "text": ".uk .co.uk example.co.uk .co.uk .co.uk .uk.com .com" }, { "answer_id": 9790261, "author": "Isak", "author_id...
2008/11/13
[ "https://Stackoverflow.com/questions/288810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37522/" ]
288,813
<p>In Delphi 2006, I am showing a modal form. User input in that form can change data that might be displayed currently on the parent form which is the mainform. To reflect those changes I need to force a repaint of some ownerdrawn components on the mainform. I tried to do that like this from the modal form:</p> <pre>...
[ { "answer_id": 288819, "author": "Kluge", "author_id": 8752, "author_profile": "https://Stackoverflow.com/users/8752", "pm_score": 0, "selected": false, "text": "Application.ProcessMessages;\n" }, { "answer_id": 288964, "author": "Jim McKeeth", "author_id": 255, "auth...
2008/11/13
[ "https://Stackoverflow.com/questions/288813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35657/" ]
288,814
<p>I have this code in my aspx page;</p> <pre><code>&lt;a href="javascript:void(0);" onclick=&lt;% Print(); %&gt; title="Print listings"&gt;Print&lt;/a&gt; </code></pre> <p>which presents a link to print a listings to a pdf when the user clicks on it; as you can note the script calls a function from the behind code.<...
[ { "answer_id": 288848, "author": "Robert Wagner", "author_id": 10784, "author_profile": "https://Stackoverflow.com/users/10784", "pm_score": 1, "selected": false, "text": "<a href=\"PrintMyPdf.ashx?PageID=<%= CurrentPageId %>\">Print</a>\n protected int CurrentPageId { get { return 4; } ...
2008/11/13
[ "https://Stackoverflow.com/questions/288814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130097/" ]
288,828
<p>I need to test a JDBC connection to a database. The java code to do that should be as simple as:</p> <pre><code>DriverManager.getConnection("jdbc connection URL", "username", "password"); </code></pre> <p>The driver manager will lookup the appropriate the driver for the given connection URL. However I need to be a...
[ { "answer_id": 288941, "author": "SaM", "author_id": 883, "author_profile": "https://Stackoverflow.com/users/883", "pm_score": 5, "selected": true, "text": "public class DelegatingDriver implements Driver\n{\n private final Driver driver;\n\n public DelegatingDriver(Driver driver)\...
2008/11/14
[ "https://Stackoverflow.com/questions/288828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/883/" ]
288,850
<p>I am using .Net framework 2.0 / jQuery to make an Ajax call to a 2.0 web service. No matter what I set the contentType to in the ajax call, the service always returns XML. I want it to return Json!</p> <p>Here is the call:</p> <pre><code> $(document).ready(function() { $.ajax({ type: "POS...
[ { "answer_id": 288938, "author": "Darko", "author_id": 32943, "author_profile": "https://Stackoverflow.com/users/32943", "pm_score": 3, "selected": false, "text": "[ScriptMethod(ResponseFormat = ResponseFormat.Json)]\n" }, { "answer_id": 289078, "author": "redsquare", "au...
2008/11/14
[ "https://Stackoverflow.com/questions/288850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7232/" ]
288,861
<p>Is there anyway to get Eclipse to automatically look for static imports? For example, now that I've finally upgraded to Junit 4, I'd like to be able to write:</p> <pre><code>assertEquals(expectedValue, actualValue); </code></pre> <p>hit <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>O</kbd> and have Eclipse add:</p> <...
[ { "answer_id": 289289, "author": "Dave L.", "author_id": 3093, "author_profile": "https://Stackoverflow.com/users/3093", "pm_score": 8, "selected": false, "text": "Assert.assertEquals(val1, val2)" }, { "answer_id": 289599, "author": "Bill Michell", "author_id": 7938, ...
2008/11/14
[ "https://Stackoverflow.com/questions/288861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18995/" ]
288,867
<p>I need to replace our <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29" rel="noreferrer">Ajax</a> Modal Popup controls with a JavaScript equivalent. We use this as a simple context sensitive help type popup. I did a quick browse but didn't see quite what I was looking for. I just need some text and a sim...
[ { "answer_id": 289028, "author": "José Leal", "author_id": 37190, "author_profile": "https://Stackoverflow.com/users/37190", "pm_score": 6, "selected": true, "text": "function myPop() { \n this.square = null;\n this.overdiv = null;\n\n this.popOut = function(msgtxt) {\n /...
2008/11/14
[ "https://Stackoverflow.com/questions/288867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8816/" ]
288,875
<p>C#: How would you cycle through items in a listview using next and previous buttons?</p> <p>Background:</p> <p>Let's say you have 10 items in a listview.</p> <p>Next to the listview there are two buttons titled previos and next.</p> <p>Problem:</p> <p>How would you cycle through those listview items after click...
[ { "answer_id": 288896, "author": "Mike Blandford", "author_id": 28643, "author_profile": "https://Stackoverflow.com/users/28643", "pm_score": -1, "selected": false, "text": " for(int i=0;i<listView.Items.Count;i++)\n listView.Items[i]\n" }, { "answer_id": 288905, "author...
2008/11/14
[ "https://Stackoverflow.com/questions/288875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
288,877
<p>Is there a way I can set up callbacks on (or automataically log) method parameters, entries, and exits without making explicit calls within each method? I basically want to log this information to my logger class (which is static) without having to do it manually for each method.</p> <p>Right now I have to call Log...
[ { "answer_id": 288888, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": -1, "selected": false, "text": "__call class TestClass {\n public function __call($function, $args) {\n Logger::logEntry();\n Logger::info('...
2008/11/14
[ "https://Stackoverflow.com/questions/288877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5291/" ]
288,893
<p>I'm using a PropertyGrid in a tool app to show a window to monitor an object in a remote app. Every second or so I get an update from the app with the state of any members that have changed, and I update the grid. I call Refresh() to make the changes take. This all works pretty well except one thing.</p> <p>Say the...
[ { "answer_id": 12004833, "author": "aalutsyk", "author_id": 1606750, "author_profile": "https://Stackoverflow.com/users/1606750", "pm_score": 2, "selected": false, "text": "var panProp = categ.GridItems[3];\nvar tiltProp = categ.GridItems[4];\npanProp.Select();\ntiltProp.Select();\n" }...
2008/11/14
[ "https://Stackoverflow.com/questions/288893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14582/" ]
288,894
<p>I have a master / detail table and want to update some summary values in the master table against the detail table. I know I can update them like this:</p> <pre><code>update MasterTbl set TotalX = (select sum(X) from DetailTbl where DetailTbl.MasterID = MasterTbl.ID) update MasterTbl set TotalY = (select sum(Y) fr...
[ { "answer_id": 288910, "author": "Chris", "author_id": 34942, "author_profile": "https://Stackoverflow.com/users/34942", "pm_score": 3, "selected": false, "text": "update \n MasterTbl\nset\n TotalX = Sum(DetailTbl.X),\n TotalY = Sum(DetailTbl.Y),\n TotalZ = Sum(DetailTbl.Z)\n...
2008/11/14
[ "https://Stackoverflow.com/questions/288894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8752/" ]
288,900
<p>I have a string which holds a decimal value in it and I need to convert that string into a floating point variable. So an example of the string I have is "5.45" and I want a floating point equivalent so I can add .1 to it. I have searched around the internet, but I only see how to convert a string to an integer.</p>...
[ { "answer_id": 288907, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 8, "selected": true, "text": "% perl -e 'print \"5.45\" + 0.1;'\n5.55\n" }, { "answer_id": 288967, "author": "Rini", "author_id": 14374, ...
2008/11/14
[ "https://Stackoverflow.com/questions/288900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340/" ]
288,942
<p>How to convert last 3 digits of number into 0</p> <p>example 3444678 to 3444000</p> <p>I can do like </p> <p>(int)(3444678/1000) * 1000= 3444000</p> <p>But division and multiplication could be costly...</p> <p>Any other solution????</p>
[ { "answer_id": 288946, "author": "Jesse Beder", "author_id": 112, "author_profile": "https://Stackoverflow.com/users/112", "pm_score": 5, "selected": true, "text": "n - (n % 1000)\n" }, { "answer_id": 288959, "author": "Peter C.", "author_id": 31389, "author_profile":...
2008/11/14
[ "https://Stackoverflow.com/questions/288942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33411/" ]
288,954
<p>I'm fairly new to WPF and I've come across a problem that seems a bit tricky to solve. Basically I want a 4x4 grid thats scalable but keeps a square (or any other arbitrary) aspect ratio. This actually seems quite tricky to do, which surprises me because I would imagine its a reasonably common requirement.</p> <p...
[ { "answer_id": 289425, "author": "Donnelle", "author_id": 28074, "author_profile": "https://Stackoverflow.com/users/28074", "pm_score": -1, "selected": false, "text": "SizeToContent=\"WidthAndHeight\"" } ]
2008/11/14
[ "https://Stackoverflow.com/questions/288954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18393/" ]
288,955
<p>To send a serial string character to the serial port. I would need to call WriteFile(handle, "A", strlen("A"), ...)</p> <p>However, what if I want to specify and send a hex or binary number? For example, I want to send WriteFile(handle, 0x41, sizeOf(0x41), ...) ?</p> <p>Is there a function that allow me to do th...
[ { "answer_id": 288960, "author": "Pyrolistical", "author_id": 21838, "author_profile": "https://Stackoverflow.com/users/21838", "pm_score": 1, "selected": false, "text": "int buffer[1024];\nbuffer[0] = 42;\n\nWriteFile(handle, buffer, 1);\n" } ]
2008/11/14
[ "https://Stackoverflow.com/questions/288955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28462/" ]
288,966
<p>How would you describe the running time of this sort, given a function <code>sorted</code> which returns True if the list is sorted that runs in O(n):</p> <pre><code>def sort(l): while not sorted(l): random.shuffle(l) </code></pre> <p>Assume shuffling is perfectly random. </p> <p>Would this be written in big-...
[ { "answer_id": 289017, "author": "Jörg W Mittag", "author_id": 2988, "author_profile": "https://Stackoverflow.com/users/2988", "pm_score": 4, "selected": true, "text": "O(n·n!)" } ]
2008/11/14
[ "https://Stackoverflow.com/questions/288966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15055/" ]
288,968
<p>Is it possible to perform a named-group match in Perl's regex syntax as with Python's? I always bind the <code>$n</code> values to proper names after matching, so I'd find it more convenient to do it in the regex itself if it's possible.</p> <p>Python does it like so:</p> <pre><code>&gt;&gt;&gt; import re &gt;&gt;...
[ { "answer_id": 288983, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 3, "selected": false, "text": "(?'NAME'pattern)\n(?<NAME>pattern)\n" }, { "answer_id": 288989, "author": "Leon Timmermans", "a...
2008/11/14
[ "https://Stackoverflow.com/questions/288968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3594/" ]
288,984
<p>I'm looking to calculate the number of months between 2 date time fields.</p> <p>Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL?</p>
[ { "answer_id": 289032, "author": "Vincent Ramdhanie", "author_id": 27439, "author_profile": "https://Stackoverflow.com/users/27439", "pm_score": 3, "selected": false, "text": "Select period_diff(concat(year(d1),if(month(d1)<10,'0',''),month(d1)), concat(year(d2),if(month(d2)<10,'0',''),m...
2008/11/14
[ "https://Stackoverflow.com/questions/288984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
288,988
<p>I was trying to follow some instructions today, and it starts with the comment </p> <pre><code> REM In SQLPlus I manually copy in each line and execute it. </code></pre> <p>That's nice, I don't have SQLPlus, I have SQLDeveloper. The lines that were pasted in were of the type:</p> <pre><code> @\\server\dir\dir\d...
[ { "answer_id": 289086, "author": "David Aldridge", "author_id": 6742, "author_profile": "https://Stackoverflow.com/users/6742", "pm_score": -1, "selected": false, "text": "begin\n procedure_name ('parameter1', 'parameter2');\nend;\n/\n" }, { "answer_id": 3663193, "author":...
2008/11/14
[ "https://Stackoverflow.com/questions/288988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22523/" ]
288,998
<p>I was wondering if anyone can help me get started with creating a room in Sandy 3D. I know I can generate the planes, but I am unsure as to how to implement simple physics (i.e. the player cannot walk through a wall). Is there a simple way to do this, or should I look into something like WOW (3D physics engine for F...
[ { "answer_id": 289086, "author": "David Aldridge", "author_id": 6742, "author_profile": "https://Stackoverflow.com/users/6742", "pm_score": -1, "selected": false, "text": "begin\n procedure_name ('parameter1', 'parameter2');\nend;\n/\n" }, { "answer_id": 3663193, "author":...
2008/11/14
[ "https://Stackoverflow.com/questions/288998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21475/" ]
289,001
<p>I have a MySQL table where an indexed <code>INT</code> column is going to be 0 for 90% of the rows. If I change those rows to use <code>NULL</code> instead of 0, will they be left out of the index, making the index about 90% smaller?</p>
[ { "answer_id": 289012, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "https://Stackoverflow.com/users/1288", "pm_score": 3, "selected": false, "text": "NULL" }, { "answer_id": 16637462, "author": "Khanh Van", "author_id": 780763, "author_profile": ...
2008/11/14
[ "https://Stackoverflow.com/questions/289001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28835/" ]
289,002
<p>I have a static class that I would like to raise an event as part of a try catch block within a static method of that class.</p> <p>For example in this method I would like to raise a custom event in the catch. </p> <pre><code>public static void saveMyMessage(String message) { try { //Do Database s...
[ { "answer_id": 289043, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "public static event EventHandler Work;\n" }, { "answer_id": 289044, "author": "Todd", "author_id": 31940, ...
2008/11/14
[ "https://Stackoverflow.com/questions/289002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34831/" ]
289,003
<p>I have an Asp.Net 1.1 application that uses the following code to write out an image file to a pop up web page.</p> <pre><code> Response.ContentType="image/tiff" 'Only for Tif files Dim objStream As Object objStream = Server.CreateObject("ADODB.Stream") objStream.open() objStream.type = 1 o...
[ { "answer_id": 289015, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 0, "selected": false, "text": "Response.AppendHeader(\"Content-Disposition\", \"inline\");\n" } ]
2008/11/14
[ "https://Stackoverflow.com/questions/289003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1688440/" ]
289,006
<p>I am trying to write a console app that simply lists the number of lists at the sharepoint root.</p> <p>I tried doing it by using the following code, but the object SPContext.Current is null. Any ideas of how to get the web object?</p> <pre><code> SPWeb web = SPContext.Current.Site.OpenWeb("http://localhost") ; <...
[ { "answer_id": 289026, "author": "Nat", "author_id": 13813, "author_profile": "https://Stackoverflow.com/users/13813", "pm_score": 3, "selected": true, "text": "SPSite spSite = new SPSite(\"http://myurl\");\nSPWeb spMySite = spSite.Allwebs[\"mysite\"];\nSPWeb spRootsite = spsite.RootWeb;...
2008/11/14
[ "https://Stackoverflow.com/questions/289006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12497/" ]
289,010
<p>Similar to <a href="https://stackoverflow.com/questions/188141/c-list-orderby-alphabetical-order">List&lt;&gt; OrderBy Alphabetical Order</a>, we want to sort by one element, then another. we want to achieve the functional equivalent of </p> <pre><code>SELECT * from Table ORDER BY x, y </code></pre> <p>We have ...
[ { "answer_id": 289021, "author": "Toby", "author_id": 291137, "author_profile": "https://Stackoverflow.com/users/291137", "pm_score": 7, "selected": false, "text": "OrderBy ThenBy ThenByDescending using System.Linq;\n....\nList<SomeClass>() a;\nList<SomeClass> b = a.OrderBy(x => x.x).The...
2008/11/14
[ "https://Stackoverflow.com/questions/289010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1811110/" ]
289,029
<p>It seems like the classical way to handle transactions with JDBC is to set auto-commit to false. This creates a new transaction, and each call to commit marks the beginning the next transactions. On multithreading app, I understand that it is common practice to open a new connection for each thread.</p> <p>I am wri...
[ { "answer_id": 7625713, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "1. Thread 1 opens statement \n3. Thread 2 opens statement\n4. Thread 1 does something Thread 2 does something\n5. ....
2008/11/14
[ "https://Stackoverflow.com/questions/289029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/446497/" ]
289,030
<p>I am having a Html hyperlink. I need to link this hyperlink to another page.When I place the mouse over the link. It should show the image. how to do this</p>
[ { "answer_id": 289042, "author": "José Leal", "author_id": 37190, "author_profile": "https://Stackoverflow.com/users/37190", "pm_score": 0, "selected": false, "text": " \n\nvar WindowVisible = null;\nfunction WindowShow() { \n this.bind = function(obj,url,height,width) {\n obj....
2008/11/14
[ "https://Stackoverflow.com/questions/289030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22162/" ]
289,076
<p>Example C API signature:</p> <p><code>void Func(unsigned char* bytes);</code></p> <p>In C, when I want to pass a pointer to an array, I can do:</p> <pre><code>unsigned char* bytes = new unsigned char[1000]; Func(bytes); // call </code></pre> <p>How do I translate the above API to P/Invoke such that I can pass a ...
[ { "answer_id": 289088, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 3, "selected": false, "text": "unsafe \n{\n fixed(byte* pByte = byteArray)\n IntPtr intPtr = new IntPtr((void *) pByte);\n Func(intPtr);\n}\n I...
2008/11/14
[ "https://Stackoverflow.com/questions/289076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11238/" ]
289,077
<p>When do you call <code>Microsoft.Security.Application.AntiXss.HtmlEncode</code>? Do you do it when the user submits the information or do you do when you're displaying the information? </p> <p>How about for basic stuff like First Name, Last Name, City, State, Zip?</p>
[ { "answer_id": 289094, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 2, "selected": false, "text": "&amp;amp; usFirstName = getUserInput('firstName')\n\nssFirstName = cleanString(usFirstName);\n" } ]
2008/11/14
[ "https://Stackoverflow.com/questions/289077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10352/" ]
289,082
<p>Given the following class, what is your opinion on the best way to handle create/edit where Attributes.Count can be any number.</p> <pre><code>public class Product { public int Id {get;set;} public string Name {get;set;} public IList&lt;Attribute&gt; Attributes {get;set;} } public class Attribute { public...
[ { "answer_id": 289109, "author": "Kyle West", "author_id": 34133, "author_profile": "https://Stackoverflow.com/users/34133", "pm_score": 0, "selected": false, "text": "public ActionResult Whatever(stirng attr1Name, string attr2Name, string attr3Name ...\n public ActionResult Whatever(ILI...
2008/11/14
[ "https://Stackoverflow.com/questions/289082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34133/" ]
289,092
<p>How do I execute a command every time after ssh'ing from one machine to another?</p> <p>e.g</p> <pre><code>ssh mymachine stty erase ^H </code></pre> <p>I'd rather just have "stty erase ^H" execute every time after my ssh connection completes.</p> <p>This command can't simply go into my .zshrc file. i.e. for loc...
[ { "answer_id": 289099, "author": "Adam Liss", "author_id": 29157, "author_profile": "https://Stackoverflow.com/users/29157", "pm_score": 0, "selected": false, "text": ".profile" }, { "answer_id": 289100, "author": "Ken Gentle", "author_id": 8709, "author_profile": "ht...
2008/11/14
[ "https://Stackoverflow.com/questions/289092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34594/" ]
289,098
<p>Given the following domain classes:</p> <pre><code>class Post { SortedSet tags static hasMany = [tags: Tag] } class Tag { static belongsTo = Post static hasMany = [posts: Post] } </code></pre> <p>From my understanding so far, using a <code>hasMany</code> will result in hibernate <code>Set</code> mappi...
[ { "answer_id": 290124, "author": "Miguel Ping", "author_id": 22992, "author_profile": "https://Stackoverflow.com/users/22992", "pm_score": 0, "selected": false, "text": "Set SortedSet List SortedSet Comparable Tag Tags Tags SortedSet HashSet" }, { "answer_id": 304141, "author...
2008/11/14
[ "https://Stackoverflow.com/questions/289098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27163/" ]
289,106
<p><a href="https://stackoverflow.com/questions/286584/can-i-specify-interfaces-when-i-declare-a-member#287669">Can I specify interfaces when I declare a member?</a></p> <p>After thinking about this question for a while, it occurred to me that a static-duck-typed language might actually work. Why can't predefined clas...
[ { "answer_id": 289168, "author": "mipadi", "author_id": 28804, "author_profile": "https://Stackoverflow.com/users/28804", "pm_score": 4, "selected": true, "text": "MyClass MyMethod()" }, { "answer_id": 312934, "author": "Joh", "author_id": 221933, "author_profile": "h...
2008/11/14
[ "https://Stackoverflow.com/questions/289106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32998/" ]
289,108
<p>I prefer to use jQuery with my ASP.NET MVC apps than the Microsoft Ajax library. I have been adding a parameter called "mode" to my actions, which I set in my ajax calls. If it is provided, I return a JsonViewResult. If it isn't supplied, I assume it was a standard Http post and I return a ViewResult.</p> <p>I'd li...
[ { "answer_id": 289128, "author": "Eric Schoonover", "author_id": 3957, "author_profile": "https://Stackoverflow.com/users/3957", "pm_score": 2, "selected": false, "text": "IsMvcAjaxRequest Request[\"__MVCASYNCPOST\"] == \"true\" __MVCASYNCPOST IsMvcAjaxRequest IsMvcAjaxRequest IsjQueryAj...
2008/11/14
[ "https://Stackoverflow.com/questions/289108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8087/" ]
289,122
<p>I have a chart with a series that denotes a large set (1000's) of discrete measurements. Some of these are bad measurements and I want to colour the line for the series based on another set of data that describes how accurate the measurements are. Bad measurements should be red and good measurements green and the in...
[ { "answer_id": 289989, "author": "Fionnuala", "author_id": 2548, "author_profile": "https://Stackoverflow.com/users/2548", "pm_score": 3, "selected": true, "text": "Dim cht As Chart\nDim sc As Series\nDim blnBad As Boolean\nDim j\n\nj = 85 'RGB orange '\nblnBad = False\n\n'This is a cha...
2008/11/14
[ "https://Stackoverflow.com/questions/289122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31045/" ]
289,138
<p>I was really looking at the differences between pass by value and how Java allocates objects and what java does to put objects on the stack.</p> <p>Is there anyway to access objects allocated on the heap? What mechanisms does java enforce to guarantee that the right method can access the right data off the heap?</...
[ { "answer_id": 289209, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 3, "selected": false, "text": "new" } ]
2008/11/14
[ "https://Stackoverflow.com/questions/289138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10522/" ]
289,159
<p>I have a form with a <code>&lt;textarea&gt;</code> and I want to capture any line breaks in that textarea on the server-side, and replace them with a <code>&lt;br/&gt;</code>.</p> <p>Is that possible?</p> <p>I tried setting <code>white-space:pre</code> on the <code>textarea</code>'s CSS, but it's still not enough....
[ { "answer_id": 289165, "author": "Marc", "author_id": 37210, "author_profile": "https://Stackoverflow.com/users/37210", "pm_score": 6, "selected": true, "text": "nl2br()" }, { "answer_id": 290564, "author": "Law", "author_id": 6272, "author_profile": "https://Stackove...
2008/11/14
[ "https://Stackoverflow.com/questions/289159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24744/" ]
289,171
<p>What is the point of an action returning ActionResult?</p>
[ { "answer_id": 289192, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 4, "selected": false, "text": "return Redirect(newUrl);\n" } ]
2008/11/14
[ "https://Stackoverflow.com/questions/289171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
289,176
<p>I keep seeing the phrase "duck typing" bandied about, and even ran across a code example or two. I am way too <strike>lazy</strike> busy to do my own research, can someone tell me, briefly:</p> <ul> <li>the difference between a 'duck type' and an old-skool 'variant type', and </li> <li>provide an example of where I...
[ { "answer_id": 289191, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 1, "selected": false, "text": "sub dance { \n my $creature = shift;\n if( $creature->can(\"walk\") ){ \n $creature->walk(\"left\",1)...
2008/11/14
[ "https://Stackoverflow.com/questions/289176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9345/" ]
289,187
<p>I have an Excel macro that deletes a sheet, copies another sheet and renames it to the same name of the deleted sheet. This works fine when run from Excel, but when I run it by calling the macro from Python I get the following error message:</p> <blockquote> <p>Run-time error '1004' - Cannot rename a sheet to the...
[ { "answer_id": 289313, "author": "shahkalpesh", "author_id": 23574, "author_profile": "https://Stackoverflow.com/users/23574", "pm_score": 2, "selected": false, "text": "\nSheets(\"CC\").Delete\n Application.DisplayAlerts = False Sheets(\"CC\").Delete Application.DisplayAlerts = Tru...
2008/11/14
[ "https://Stackoverflow.com/questions/289187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
289,194
<p>We have an home-brewed XMPP server and I was asked what is our server's MSL (Maximum Segment Lifetime).<br> What does it mean and how can I obtain it? Is it something in the Linux <code>/proc</code> TCP settings?</p>
[ { "answer_id": 35000966, "author": "John Hascall", "author_id": 2040863, "author_profile": "https://Stackoverflow.com/users/2040863", "pm_score": 4, "selected": false, "text": "/proc/sys/net/ipv4/tcp_fin_timeout cat /proc/sys/net/ipv4/tcp_fin_timeout\n echo 5 > /proc/sys/net/ipv4/tcp_fin...
2008/11/14
[ "https://Stackoverflow.com/questions/289194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
289,208
<p>Since upgrading to 2008 I and many people here have noticed that randomly VS will no longer step in to code or jump over breakpoints. Its got to the stage where debugging is becoming a real chore. We are running SP1 but noticed problem on 2008 basic too.</p> <p>In ref to Robert's question: We host WCF and Remoting ...
[ { "answer_id": 289222, "author": "Robert Wagner", "author_id": 10784, "author_profile": "https://Stackoverflow.com/users/10784", "pm_score": 2, "selected": false, "text": "public static void Main(string[] args)\n{\n if (Environment.UserInteractive)\n {\n Console.WriteLine(\"...
2008/11/14
[ "https://Stackoverflow.com/questions/289208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30225/" ]
289,220
<p>Below is my (simplified) schema (in MySQL ver. 5.0.51b) and my strategy for updating it. There has got to be a better way. Inserting a new item requires 4 trips to the database and editing/updating an item takes up to <strong>7</strong>!</p> <p><strong>items</strong>: itemId, itemName <br /><strong>categories</stro...
[ { "answer_id": 289233, "author": "too much php", "author_id": 28835, "author_profile": "https://Stackoverflow.com/users/28835", "pm_score": 2, "selected": true, "text": "DELETE categories.*\nFROM categories\nLEFT JOIN map USING (catId)\nWHERE map.catID IS NULL;\n INSERT IGNORE INTO map (...
2008/11/14
[ "https://Stackoverflow.com/questions/289220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/356/" ]
289,225
<p>Is there any HTML5 support in IE8? Is it on the IE8 roadmap?</p>
[ { "answer_id": 289469, "author": "hsivonen", "author_id": 18721, "author_profile": "https://Stackoverflow.com/users/18721", "pm_score": 7, "selected": true, "text": "<canvas> <video>" }, { "answer_id": 1759706, "author": "John", "author_id": 52207, "author_profile": "...
2008/11/14
[ "https://Stackoverflow.com/questions/289225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36590/" ]
289,241
<p>Forgive me for a potentially silly question here, but in other programming languages (scripting ones like PHP or Perl) it is often easy to dump everything contained within a variable.</p> <p>For instance, in PHP there are the <code>var_dump()</code> or <code>print_r()</code> functions. Perl has the <code>Data::Dump...
[ { "answer_id": 289250, "author": "Jason Coco", "author_id": 34218, "author_profile": "https://Stackoverflow.com/users/34218", "pm_score": 3, "selected": false, "text": "NSData* myData = //... assume this exists\nNSLog(@\"Contents of myData: %@\", myData);\n gdb) po myData\n" }, { ...
2008/11/14
[ "https://Stackoverflow.com/questions/289241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35478/" ]
289,255
<p>Title says it mostly. I want to add a simple extension method to the base Dictionary class in C#. At first I was going to name it Pop(TKey key), kind of like the Stack method, but it accepts a key to use for lookup.</p> <p>Then I was going to do Take(TKey key), but it coincides with the LINQ method of the same name...
[ { "answer_id": 289260, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 1, "selected": false, "text": "object valueRemoved = someDictionary.RemoveElement(key)\n if (!dict.ContainsKey(key))\n{\n return null;\n}\nobject...
2008/11/14
[ "https://Stackoverflow.com/questions/289255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16387/" ]
289,271
<p>How can I decode a base64 encoded message in PHP? I know how to use PHP_base64_decode function, but I wanna know how to write little endian part, like the code below, it is base64 code with little endian: (how to write little endian part in php)</p> <p><strong>Original Base64 Content ( as posted by original poster ...
[ { "answer_id": 12025216, "author": "John Dvorak", "author_id": 499214, "author_profile": "https://Stackoverflow.com/users/499214", "pm_score": 2, "selected": false, "text": "mb_convert_encoding($input, 'UTF-8', 'UTF-16LE')" } ]
2008/11/14
[ "https://Stackoverflow.com/questions/289271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
289,274
<p>I have included <code>&lt;zlib.h&gt;</code> in my iphone application and the source code I was mocking up the sample code of Molecules provided by Brad Larson, however, when I build the project, it returns the error as below. Can anyone point out for me whether this is a library linking problem or am I missing some...
[ { "answer_id": 289294, "author": "Ben Gottlieb", "author_id": 6694, "author_profile": "https://Stackoverflow.com/users/6694", "pm_score": 7, "selected": true, "text": "Build Settings Other Linker Flags -lz Clean Product" } ]
2008/11/14
[ "https://Stackoverflow.com/questions/289274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35405/" ]
289,276
<p>Here's my code (note that this was given by a friend):</p> <pre><code>Private Sub Browse_Click() Dim textfile As String textfile = Space(255) GetFileNameFromBrowseW Me.hWnd, StrPtr(sSave), 255, StrPtr("c:\"), StrPtr("txt"), StrPtr("Apps (*.txt)" + Chr$(0) + "*.txt" + Chr$(0) + "All files (*.*)...
[ { "answer_id": 289514, "author": "onedaywhen", "author_id": 15354, "author_profile": "https://Stackoverflow.com/users/15354", "pm_score": 0, "selected": false, "text": "sSave textfile Text1 Text1.Text .Text" }, { "answer_id": 289630, "author": "Ant", "author_id": 11529, ...
2008/11/14
[ "https://Stackoverflow.com/questions/289276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
289,278
<p>If I have a string "12 23 34 56"</p> <p>What's the easiest way to change it to "\x12 \x23 \x34 \x56"?</p>
[ { "answer_id": 289291, "author": "Jesse Beder", "author_id": 112, "author_profile": "https://Stackoverflow.com/users/112", "pm_score": 2, "selected": false, "text": "string s = \"12 23 34 45\";\nstringstream str(s), out;\nint val;\nwhile(str >> val)\n out << \"\\\\x\" << val << \" \";...
2008/11/14
[ "https://Stackoverflow.com/questions/289278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
289,307
<p>Say I have two lists:</p> <pre><code>var list1 = new int[] {1, 2, 3}; var list2 = new string[] {"a", "b", "c"}; </code></pre> <p>Is it possible to write a LINQ statement that will generate the following list:</p> <pre><code>var result = new []{ new {i = 1, s = "a"}, new {i = 1, s = "b"}, new {i = 1, ...
[ { "answer_id": 289310, "author": "Preet Sangha", "author_id": 30225, "author_profile": "https://Stackoverflow.com/users/30225", "pm_score": 5, "selected": false, "text": "var result = from l1 in list1\n from l2 in list2 \n select new { i = l1, s = l2};\n" ...
2008/11/14
[ "https://Stackoverflow.com/questions/289307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3820/" ]
289,311
<p>I want to output a timestamp with a PST offset (e.g., 2008-11-13T13:23:30-08:00). <code>java.util.SimpleDateFormat</code> does not seem to output timezone offsets in the <em>hour:minute</em> format, it excludes the colon. Is there a simple way to get that timestamp in Java?</p> <pre><code>// I want 2008-11-13T12:23...
[ { "answer_id": 289322, "author": "FoxyBOA", "author_id": 19347, "author_profile": "https://Stackoverflow.com/users/19347", "pm_score": 2, "selected": false, "text": "SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd'T'h:m:ss.SZ\");\n" }, { "answer_id": 289927, "auth...
2008/11/14
[ "https://Stackoverflow.com/questions/289311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/680/" ]
289,315
<p>In IE6 the paragraph following the empty paragraph is displayed with the background color of the empty paragraph, which I'm guessing is wrong! It works correctly in Firefox, but I haven't checked IE7.</p> <p>Is there a CSS solution to this problem, or do I have to remove the empty element?</p> <p>(I would rather ...
[ { "answer_id": 289336, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 1, "selected": false, "text": "<p style='background-color:green'>Green content</p>\n<p style='background-color:red; margin-left:50px'></p>\n<p>Unstyled backg...
2008/11/14
[ "https://Stackoverflow.com/questions/289315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37572/" ]
289,321
<p>I'm currently using <a href="http://eigenclass.org/hiki.rb?rcov" rel="noreferrer">Rcov</a> to get C0 code coverage analysis for a rails project that I'm working on.</p> <p>However, those results are practically meaningless- I have 100% coverage according to rcov (as it only covers C0 analysis) and I've barely writt...
[ { "answer_id": 53195912, "author": "Marc-André Lafortune", "author_id": 8279, "author_profile": "https://Stackoverflow.com/users/8279", "pm_score": 2, "selected": false, "text": "DeepCover" } ]
2008/11/14
[ "https://Stackoverflow.com/questions/289321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35345/" ]
289,324
<p>I was remote debugging a stack overflow from a recursive function. The Visual Studio IDE only showed the first 1,000 frames (all the same function), but I needed to go up further too see what the cause was.</p> <p>Does anybody know how to get VS to 'move up' in a stack listing?</p> <p>Thanks. </p>
[ { "answer_id": 289474, "author": "David Sykes", "author_id": 259, "author_profile": "https://Stackoverflow.com/users/259", "pm_score": 0, "selected": false, "text": "void f(int rcount /* = 0 */ )\n{\n Assert(rcount < 1000);\n f(count+1);\n}\n" }, { "answer_id": 292231, "autho...
2008/11/14
[ "https://Stackoverflow.com/questions/289324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37574/" ]
289,329
<p>I was trying to create a pseudo super struct to print array of structs. My basic structures are as follows.</p> <pre><code>/* Type 10 Count */ typedef struct _T10CNT { int _cnt[20]; } T10CNT; ... /* Type 20 Count */ typedef struct _T20CNT { long _cnt[20]; } T20CNT; ... </code></pre> <p>I created the bel...
[ { "answer_id": 289334, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 0, "selected": false, "text": "CMNCNT *cmncnt = (CMNCNT *)&cmncnt[ii*cmncnt_elmsize];\n" }, { "answer_id": 289338, "author": "Adam Pierce", ...
2008/11/14
[ "https://Stackoverflow.com/questions/289329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18657/" ]
289,335
<p>Can anyone tell me what is the difference between XSDObjectGen.exe &amp; XSD.exe?</p> <p>Is there any way to make XSDObjectGen.exe work in dot net 2.0?</p>
[ { "answer_id": 3004852, "author": "Daniel Fortunov", "author_id": 5975, "author_profile": "https://Stackoverflow.com/users/5975", "pm_score": 3, "selected": false, "text": "xsd.exe XSDObjectGen.exe XSDObjectGen.exe C:\\Program Files\\XSDObjectGenerator" }, { "answer_id": 5044576,...
2008/11/14
[ "https://Stackoverflow.com/questions/289335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/747/" ]
289,342
<p>What is the keyboard short cut in Eclipse to jump to the closing brace of a scope?</p>
[ { "answer_id": 378476, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": false, "text": "}" }, { "answer_id": 1637242, "author": "Romain Linsolas", "author_id": 26457, "author_profile": "https://...
2008/11/14
[ "https://Stackoverflow.com/questions/289342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3020/" ]
289,347
<p>I have a string that I would like to tokenize. But the C <code>strtok()</code> function requires my string to be a <code>char*</code>. How can I do this simply?</p> <p>I tried:</p> <pre><code>token = strtok(str.c_str(), " "); </code></pre> <p>which fails because it turns it into a <code>const char*</code>, not a...
[ { "answer_id": 289354, "author": "DocMax", "author_id": 6234, "author_profile": "https://Stackoverflow.com/users/6234", "pm_score": 4, "selected": false, "text": "char *dup = strdup(str.c_str());\ntoken = strtok(dup, \" \");\nfree(dup);\n" }, { "answer_id": 289365, "author": ...
2008/11/14
[ "https://Stackoverflow.com/questions/289347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
289,360
<p>I have a large UIScrollView into which I'm placing 3-4 rather large (320x1500 pixels or so) UIImageView image tiles. I'm adding these UIImageViews to the scroll view inside of my NIB files. I have one outlet on my controller, and that is to the UIScrollView. I'm using a property (nonatomic, retain) for this, and ...
[ { "answer_id": 289374, "author": "seanalltogether", "author_id": 26986, "author_profile": "https://Stackoverflow.com/users/26986", "pm_score": 0, "selected": false, "text": "- (void)dealloc {\n NSLog(@\"DAY Controller Dealloc'd\");\n [self.scrollView release];\n [super dealloc];...
2008/11/14
[ "https://Stackoverflow.com/questions/289360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35516/" ]
289,362
<p>I'm using the MySQL Query Browser (part of the <a href="http://dev.mysql.com/downloads/gui-tools/" rel="noreferrer">MySQL GUI Tools</a>) and need to change a field to NULL, but I can't figure out how to do it - if I delete the value it tries to update it to <code>''</code>. Typing "NULL" makes it try to update to <c...
[ { "answer_id": 37532738, "author": "Izzy Rodriguez", "author_id": 228160, "author_profile": "https://Stackoverflow.com/users/228160", "pm_score": 3, "selected": false, "text": "Shift + Delete" }, { "answer_id": 62324390, "author": "Andrea Fini", "author_id": 4541788, ...
2008/11/14
[ "https://Stackoverflow.com/questions/289362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
289,405
<p>When I'm writing some tight loop that needs to work fast I am often bothered by thoughts about how the processor branch prediction is going to behave. For instance I try my best to avoid having an if statement in the most inner loop, especially one with a result which is not somewhat uniform (say evaluates to true o...
[ { "answer_id": 296684, "author": "AShelly", "author_id": 10396, "author_profile": "https://Stackoverflow.com/users/10396", "pm_score": 0, "selected": false, "text": "if (var >= limit) { otherVar = 0;}\n otherVar *= (var<limit)&1;\n" } ]
2008/11/14
[ "https://Stackoverflow.com/questions/289405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9611/" ]
289,409
<p>I have a layout that is working, but it has one very annoying problem.. when the content is taller than the screen, the background stops.</p> <p>This is the desired layout in bad-ASCII-art format:</p> <pre><code>_____________________ _ | | long |logo| | | | content | | | | | | | | ...
[ { "answer_id": 289487, "author": "Mikael Söderström", "author_id": 36944, "author_profile": "https://Stackoverflow.com/users/36944", "pm_score": 0, "selected": false, "text": "<div id=\"right\">...</div> <div style=\"clear: both; font-size: 1px; line-height:1px\">&nbsp;</div>\n" }, {...
2008/11/14
[ "https://Stackoverflow.com/questions/289409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745/" ]
289,432
<p>Basically, I'm trying to write the following (pseudocode) in an ASP.NET HttpModule:</p> <pre><code>*pre-code* try { handler.ProcessRequest(...) } catch (Exception) { *error-code* } finally { *post-code* } </code></pre> <p>I've found that I can hook into HttpModule.PreExecuteHandler for "pre-code" and .Error for "e...
[ { "answer_id": 292814, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": -1, "selected": false, "text": "protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)\n{\n //\n}\n\nprotected void Ap...
2008/11/14
[ "https://Stackoverflow.com/questions/289432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7104/" ]
289,433
<p>How can I prevent the user from being able to resize an image in designMode? (disable the handles when image is clicked)</p>
[ { "answer_id": 289453, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 4, "selected": true, "text": "document.body.contentEditable = true;\n var imgs = document.getElementsByTagName(\"IMG\");\nfor (var i = 0; i < imgs.length; ++...
2008/11/14
[ "https://Stackoverflow.com/questions/289433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26181/" ]