qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
162,534
<p>I just wanna ask what would be better approach to supply these objects in my unit tests.</p> <p>In my unit test I am testing CSLA object. CSLA object is internally using one property and one method of ApplicationUser object. ApplicationUser is inherited from IPrincipal. The properties are: 1) ApplicationContext.Use...
[ { "answer_id": 162667, "author": "Carlton Jenke", "author_id": 1215, "author_profile": "https://Stackoverflow.com/users/1215", "pm_score": 2, "selected": false, "text": " [SetUp]\n public void Setup()\n {\n var identity = MockRepository.GenerateStub<IIdentity>();\n ...
2008/10/02
[ "https://Stackoverflow.com/questions/162534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24507/" ]
162,537
<p>I just upgraded a VS 2005 project to VS 2008 and was examining the changes. I noticed one of the .Designer.cs files had changed significantly. The majority of the changes were simply replacements of <em>System</em> with <em>global::System</em>. For example,</p> <pre><code>protected override System.Data.DataTable ...
[ { "answer_id": 162554, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 5, "selected": true, "text": " global::System.Data.DataTable \n System.Data.DataTable\n class TestApp\n{\n // Define a new class called 'System' to cau...
2008/10/02
[ "https://Stackoverflow.com/questions/162537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4228/" ]
162,542
<p>How do you perform delete and put operations restfully in rails? I have read the documentation and thought I was doing everything properly, but I can't seem to get it to work.</p> <p>For example, if I wanted to delete an employee I would create a controller called "EmployeesController" and create a destroy method t...
[ { "answer_id": 162590, "author": "Matthias Winkelmann", "author_id": 4494, "author_profile": "https://Stackoverflow.com/users/4494", "pm_score": 4, "selected": true, "text": ":url => employee_url(@employee)\n" }, { "answer_id": 162612, "author": "flitzwald", "author_id": ...
2008/10/02
[ "https://Stackoverflow.com/questions/162542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5923/" ]
162,564
<p>I need a way to update the month value on a dateTime field in my db. I'm being past an int value for the month and need to use that for the update. Is it possible to do this in the sql statement or would I be best doing it in c# in the webservice?</p>
[ { "answer_id": 162584, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 3, "selected": true, "text": "UPDATE table\nSET datecol = DATEADD(m, @newmonth, DATEADD(m, -MONTH(datecol), datecol))\nWHERE id = @id\n UPDATE table\nS...
2008/10/02
[ "https://Stackoverflow.com/questions/162564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17510/" ]
162,571
<p>I've executed a JDBC query to obtain a resultset. Before iterating over it, I'd like to quickly find out how many rows were returned. How can I do this with high performance?</p> <p>I'm using Java 6, Oracle 11g, and the latest Oracle JDBC drivers.</p>
[ { "answer_id": 162597, "author": "Tom Hawtin - tackline", "author_id": 4725, "author_profile": "https://Stackoverflow.com/users/4725", "pm_score": 2, "selected": false, "text": "ResultSet.afterLast() ResultSet.getRow() ResultSet.beforeFirst()" }, { "answer_id": 162629, "autho...
2008/10/02
[ "https://Stackoverflow.com/questions/162571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2959/" ]
162,576
<p>I've been battling PHP's email reading functions for the better part of two days. I'm writing a script to read emails from a mailbox and save any attachments onto the server. If you've ever done something similar, you might understand my pain: <strong>PHP doesn't play well with email!</strong></p> <p>I've connected...
[ { "answer_id": 162611, "author": "kender", "author_id": 4172, "author_profile": "https://Stackoverflow.com/users/4172", "pm_score": 3, "selected": true, "text": "echo if (substr($ContentType,0,4) == \"text\") {\necho imap_qprint($fileContent);\n} else {\necho imap_base64($fileContent);\n...
2008/10/02
[ "https://Stackoverflow.com/questions/162576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12870/" ]
162,591
<p>I have a subversion repository with the standard layout, i.e. trunk/ and branches/ (and tags/). When working on a bigger change, a feature branch is used, regularly synced with trunk, and later reintegrated back into trunk (using 1.5 now). Pretty standard stuff.</p> <p>What I am wondering is whether such a feature ...
[ { "answer_id": 162623, "author": "Blair Conrad", "author_id": 1199, "author_profile": "https://Stackoverflow.com/users/1199", "pm_score": 4, "selected": false, "text": "-rrevision" }, { "answer_id": 162630, "author": "jvasak", "author_id": 5840, "author_profile": "htt...
2008/10/02
[ "https://Stackoverflow.com/questions/162591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15677/" ]
162,606
<p>I know of a couple of routines that work as follows: </p> <blockquote> <p>X<sub>n+1</sub> = Routine(X<sub>n</sub>, max) </p> </blockquote> <p>For example, something like a LCG generator: </p> <blockquote> <p>X<sub>n+1</sub> = (a*X<sub>n</sub> + c) mod m </p> </blockquote> <p>There isn't enough parameteri...
[ { "answer_id": 163312, "author": "Milhous", "author_id": 17712, "author_profile": "https://Stackoverflow.com/users/17712", "pm_score": 1, "selected": false, "text": "X(n+1) = Routine(Xn, max, permutation number)\nfor(i = n; i > 0; i--)\n {\n int temp = Map.lookup(i) \n otherfun(temp,...
2008/10/02
[ "https://Stackoverflow.com/questions/162606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24404/" ]
162,617
<p>When creating a new file with vim, I would like to automatically add some skeleton code.</p> <p>For example, when creating a new xml file, I would like to add the first line:</p> <pre><code> &lt;?xml version="1.0"?&gt; </code></pre> <p>Or when creating an html file, I would like to add:</p> <pre><code>&lt;!DOCT...
[ { "answer_id": 162654, "author": "Oli", "author_id": 22035, "author_profile": "https://Stackoverflow.com/users/22035", "pm_score": 1, "selected": false, "text": "augroup Xml\n au BufNewFile *.xml :python import vim\n au BufNewFile *.xml :python vim.current.buffer[0:0] = ['<?xml version...
2008/10/02
[ "https://Stackoverflow.com/questions/162617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24076/" ]
162,618
<p>Using C#</p> <p>How do you remove a specific node from an XMLDocument using XPATH?</p>
[ { "answer_id": 162647, "author": "David Basarab", "author_id": 2469, "author_profile": "https://Stackoverflow.com/users/2469", "pm_score": 2, "selected": false, "text": "XmlDocument doc = new XmlDocument();\n\n// Load you XML Document\n\nXmlNode childNode = doc.SelectSingleNode(childNode...
2008/10/02
[ "https://Stackoverflow.com/questions/162618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2744/" ]
162,644
<p>Firebug is the most convenient tool I've found for editing CSS - so why isn't there a simple "save" option for CSS?</p> <p>I am always finding myself making tweaks in Firebug, then going back to my original .css file and replicating the tweaks.</p> <p>Has anyone come up with a better solution?</p> <p><b>EDIT:</b>...
[ { "answer_id": 8175478, "author": "Lance", "author_id": 169992, "author_profile": "https://Stackoverflow.com/users/169992", "pm_score": 2, "selected": false, "text": "id id #element-127 {\n background: red;\n}\n .space box-shadow()" }, { "answer_id": 11593735, "author": "Len...
2008/10/02
[ "https://Stackoverflow.com/questions/162644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14966/" ]
162,651
<p>What is the difference between these two pieces of code</p> <pre><code>type IInterface1 = interface procedure Proc1; end; IInterface2 = interface procedure Proc2; end; TMyClass = class(TInterfacedObject, IInterface1, IInterface2) protected procedure Proc1; procedure Proc2; end; </cod...
[ { "answer_id": 162682, "author": "Joe Skora", "author_id": 14057, "author_profile": "https://Stackoverflow.com/users/14057", "pm_score": 1, "selected": false, "text": "...\nIInterface2 = interface(Interface1)\n...\n" }, { "answer_id": 162706, "author": "Dave Sherohman", "...
2008/10/02
[ "https://Stackoverflow.com/questions/162651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22712/" ]
162,674
<p>When using tooltips to show a detailed description of a TreeNode, the tooltip is drawn on top of the node, as if it was completing the node's text. Also, if the text is long, the tooltip is positioned in a way that the <strong>text exceeds the screen</strong>. </p> <p>But what I need is the tooltip to show right be...
[ { "answer_id": 162769, "author": "Vivek", "author_id": 7418, "author_profile": "https://Stackoverflow.com/users/7418", "pm_score": 2, "selected": false, "text": "ToolTip.Show public void Show(\n string text,\n IWin32Window window,\n int x,\n int y,\n int duration\n)\n" }...
2008/10/02
[ "https://Stackoverflow.com/questions/162674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10833/" ]
162,677
<p>How would I write a Perl CGI script that receives a file via a HTTP post and saves that to the file system?</p>
[ { "answer_id": 162724, "author": "kender", "author_id": 4172, "author_profile": "https://Stackoverflow.com/users/4172", "pm_score": 4, "selected": true, "text": " #!/usr/bin/perl -wT\n\nuse strict;\nuse CGI;\nuse CGI::Carp qw ( fatalsToBrowser );\nuse File::Basename;\n\n$CGI::POST_MAX = ...
2008/10/02
[ "https://Stackoverflow.com/questions/162677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6701/" ]
162,681
<p>Given the email address: "Jim" &lt;jim@example.com&gt;</p> <p>If I try to pass this to MailAddress I get the exception:</p> <blockquote> <p>The specified string is not in the form required for an e-mail address.</p> </blockquote> <p>How do I parse this address into a display name (Jim) and email address (jim@ex...
[ { "answer_id": 162700, "author": "Codewerks", "author_id": 17729, "author_profile": "https://Stackoverflow.com/users/17729", "pm_score": 2, "selected": false, "text": "\"Jimbo <jim@example.com>\"\n" }, { "answer_id": 162701, "author": "Wayne", "author_id": 8236, "auth...
2008/10/02
[ "https://Stackoverflow.com/questions/162681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4580/" ]
162,727
<p>I've got a text file full of records where each field in each record is a fixed width. My first approach would be to parse each record simply using string.Substring(). Is there a better way? </p> <p>For example, the format could be described as:</p> <pre><code>&lt;Field1(8)&gt;&lt;Field2(16)&gt;&lt;Field3(12)&gt...
[ { "answer_id": 162909, "author": "Leandro Oliveira", "author_id": 16610, "author_profile": "https://Stackoverflow.com/users/16610", "pm_score": 5, "selected": false, "text": "[FixedLengthRecord()] \npublic class MyData\n{ \n [FieldFixedLength(8)] \n public string someData; \n\n [Field...
2008/10/02
[ "https://Stackoverflow.com/questions/162727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2773/" ]
162,730
<p>I have a table column that needs to be limited to a certain width - say 100 pixels. At times the text in that column is wider than this and contains no spaces. For example:</p> <pre><code>a_really_long_string_of_text_like_this_with_no_line_breaks_makes_the_table_unhappy </code></pre> <p>I would like to calculate ...
[ { "answer_id": 162746, "author": "Dan", "author_id": 17121, "author_profile": "https://Stackoverflow.com/users/17121", "pm_score": 1, "selected": false, "text": "table-layout: fixed;\n" }, { "answer_id": 162785, "author": "roenving", "author_id": 23142, "author_profil...
2008/10/02
[ "https://Stackoverflow.com/questions/162730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13850/" ]
162,735
<p>What do you think the next evolution of languages will look like?</p>
[ { "answer_id": 5415702, "author": "schoetbi", "author_id": 108238, "author_profile": "https://Stackoverflow.com/users/108238", "pm_score": 0, "selected": false, "text": " C -> Device drivers\n C++ -> Highperformance Computing\n Java ...
2008/10/02
[ "https://Stackoverflow.com/questions/162735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
162,748
<p>On a project I'm working on, we use subversion, with tortoiseSVN as a client, under windows XP.</p> <p>As we enter in production and continue development in parallel, many branches are created.</p> <p>Often, we have to backport modifications made on the branch to the trunk, or to older branches. Backporting is a v...
[ { "answer_id": 5415702, "author": "schoetbi", "author_id": 108238, "author_profile": "https://Stackoverflow.com/users/108238", "pm_score": 0, "selected": false, "text": " C -> Device drivers\n C++ -> Highperformance Computing\n Java ...
2008/10/02
[ "https://Stackoverflow.com/questions/162748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2965/" ]
162,752
<p>I am looking for an algorithm to calculate the next set of operations in a sequence. Here is the simple definition of the sequence.</p> <ol> <li>Task 1A will be done every 500 hours</li> <li>Task 2A will be done every 1000 hours</li> <li>Task 3A will be done every 1500 hours</li> </ol> <p>So at t=500, do 1A. At t=...
[ { "answer_id": 195931, "author": "Simon Lehmann", "author_id": 27011, "author_profile": "https://Stackoverflow.com/users/27011", "pm_score": 2, "selected": true, "text": "history = [list of tuples like (timestamp, (A, B, ...)), ordered by timestamp]\nlastTaskTime = {}\ntaskIntervals = {}...
2008/10/02
[ "https://Stackoverflow.com/questions/162752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/341/" ]
162,753
<p>I am using a multi-dimensional dynamic array in delphi and am trying to figure this out:</p> <p>I have 2 seperate values for the first index and second index that are totally seperate of each other.</p> <p>As new values come I want to grow the array if that new value is outside of either bound.</p> <p>For new val...
[ { "answer_id": 162783, "author": "gabr", "author_id": 4997, "author_profile": "https://Stackoverflow.com/users/4997", "pm_score": 2, "selected": false, "text": "SetLength(List, Length(List), y + 1);\n" }, { "answer_id": 165847, "author": "PatrickvL", "author_id": 12170, ...
2008/10/02
[ "https://Stackoverflow.com/questions/162753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16059/" ]
162,762
<p>I recently deploy one web application in one of my development servers. I'm using oracle, asp.net and c#. When I run the application in the server everything works fine, but when I try to run the application outside of the server (using my pc, for example) i get this error:</p> <pre><code>ORA-12154: TNS:could not r...
[ { "answer_id": 20966307, "author": "Rohit Hans", "author_id": 3168126, "author_profile": "https://Stackoverflow.com/users/3168126", "pm_score": 0, "selected": false, "text": "Variable Name: TNS_ADMIN\n\nVariable Value: (YourDrive):\\app\\(UserName)\\product\\11.2.0\\dbhome_1\\NETWORK\\AD...
2008/10/02
[ "https://Stackoverflow.com/questions/162762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24521/" ]
162,764
<p>I have a database with user 'dbo' that has a login name "domain\xzy". How do I change it from "domain\xzy" to "domain\abc".</p>
[ { "answer_id": 32514655, "author": "Mike", "author_id": 914490, "author_profile": "https://Stackoverflow.com/users/914490", "pm_score": 1, "selected": false, "text": "USE [My_Database_Name]\nGO\nEXEC dbo.sp_changedbowner @loginame = N'domain\\abc', @map = false\nGO\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/162764", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24522/" ]
162,778
<p>I am creating an RSS reader as a hobby project, and at the point where the user is adding his own URL's.</p> <p>I was thinking of two things.</p> <ul> <li>A plaintext file where each url is a single line</li> <li>SQLite where i can have unique ID's and descriptions following the URL</li> </ul> <p>Is the SQLite id...
[ { "answer_id": 162802, "author": "kender", "author_id": 4172, "author_profile": "https://Stackoverflow.com/users/4172", "pm_score": 1, "selected": false, "text": "last_fetch_time" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/162778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22459/" ]
162,797
<p>Do you know any solution to put a picture over a Flash?</p> <p>It <strong>must</strong> work in IE6, IE7, Firefox for Windows, MacOSX, Linux and Safari.</p>
[ { "answer_id": 163324, "author": "PhiLho", "author_id": 15459, "author_profile": "https://Stackoverflow.com/users/15459", "pm_score": 2, "selected": false, "text": "<object width=\"550\" height=\"450\"\n codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve...
2008/10/02
[ "https://Stackoverflow.com/questions/162797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24509/" ]
162,798
<p>One of the really nice things about python is the simplicity with which you can name variables that have the same name as the accessor:</p> <pre><code>self.__value = 1 def value(): return self.__value </code></pre> <p>Is there a simple way of providing access to the private members of a class that I wish to s...
[ { "answer_id": 162854, "author": "Thomas Wouters", "author_id": 17624, "author_profile": "https://Stackoverflow.com/users/17624", "pm_score": 4, "selected": true, "text": "_ContainerThing__value __value value _value" }, { "answer_id": 164691, "author": "S.Lott", "author_i...
2008/10/02
[ "https://Stackoverflow.com/questions/162798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18909/" ]
162,804
<p>I have a char array in a C application that I have to split into parts of 250 so that I can send it along to another application that doesn't accept more at one time. </p> <p>How would I do that? Platform: win32. </p>
[ { "answer_id": 162837, "author": "jvasak", "author_id": 5840, "author_profile": "https://Stackoverflow.com/users/5840", "pm_score": 3, "selected": true, "text": "strncpy char *strncpy(\n char *strDest,\n const char *strSource,\n size_t count \n);\n void send250(char *inMsg, int msg...
2008/10/02
[ "https://Stackoverflow.com/questions/162804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10010/" ]
162,810
<p>I am using Log4Net with the AdoNetAppender to log messages from a simple systray application into a SQL Server 2005 database.</p> <p>I want to log the machine name along with the log message because this application will be running on multiple machines and I need to know on which one the message originated.</p> <p...
[ { "answer_id": 162979, "author": "Thad", "author_id": 24500, "author_profile": "https://Stackoverflow.com/users/24500", "pm_score": 4, "selected": false, "text": "<parameter>\n <parameterName value=\"@machine\" />\n <dbType value=\"String\" />\n <size value=\"255\" />\n <layout type=...
2008/10/02
[ "https://Stackoverflow.com/questions/162810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2834/" ]
162,852
<p>I deleted millions of rows of old data from a production SQL database recently, and it didn't seem to shrink the size of the .MDF file much. We have a finite amount of disk space.</p> <p>I am wondering if there is anything else I can do to "tighten" the file (like something analogous to Access' Compact and Repair f...
[ { "answer_id": 162910, "author": "JosephStyons", "author_id": 672, "author_profile": "https://Stackoverflow.com/users/672", "pm_score": 2, "selected": false, "text": "backup log MY_DATABASE WITH TRUNCATE_ONLY;\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/162852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1842/" ]
162,871
<p>I'm quite new to NHibernate and starting to find my way around.</p> <p>I have a domain model that is somewhat like a tree.</p> <p>Funds have Periods have Selections have Audits<br> Now I would like to get all Audits for a specific Fund</p> <p>Would look like this if I made it in SQL</p> <p>SELECT A.*<br> FROM Au...
[ { "answer_id": 162966, "author": "Jasper", "author_id": 18702, "author_profile": "https://Stackoverflow.com/users/18702", "pm_score": 1, "selected": false, "text": "select elements(s.Audits)\nfrom Fund as f inner join Period as p inner join Selection as s \nwhere f = myFundInstance \n"...
2008/10/02
[ "https://Stackoverflow.com/questions/162871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11434/" ]
162,873
<p>How do you include a file that is more than 2 directories back. I know you can use <code>../index.php</code> to include a file that is 2 directories back, but how do you do it for 3 directories back? Does this make sense? I tried <code>.../index.php</code> but it isn't working.</p> <p>I have a file in <code>/game/f...
[ { "answer_id": 162881, "author": "bdukes", "author_id": 2688, "author_profile": "https://Stackoverflow.com/users/2688", "pm_score": 4, "selected": false, "text": "../../index.php \n" }, { "answer_id": 162882, "author": "Ólafur Waage", "author_id": 22459, "author_profi...
2008/10/02
[ "https://Stackoverflow.com/questions/162873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
162,874
<p>I'm using <a href="http://enunciate.codehaus.org" rel="nofollow noreferrer">Enunciate</a> to build a prototype REST api and need to include a jar containing custom code as a library.</p> <p>My Ant Script looks like this:</p> <p></p> <pre><code>&lt;!--include all jars--&gt; &lt;path id="en.classpath"&gt; &lt;f...
[ { "answer_id": 221420, "author": "Miguel Ping", "author_id": 22992, "author_profile": "https://Stackoverflow.com/users/22992", "pm_score": 2, "selected": false, "text": "<jar jarfile=\"${dist}/${war.name}\" update=\"true\">\n <fileset dir=\"${lib}\">\n <include name=\"**/*.jar\"...
2008/10/02
[ "https://Stackoverflow.com/questions/162874", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9518/" ]
162,879
<p>Let's say you have a class with a Uri property. Is there any way to get that property to accept both a string value and a Uri? How would you build it?</p> <p>I'd like to be able to do something like one of the following, but neither are supported (using VB, since it lets you specify type in the Set declaration fo...
[ { "answer_id": 162890, "author": "bdukes", "author_id": 2688, "author_profile": "https://Stackoverflow.com/users/2688", "pm_score": 2, "selected": false, "text": "Public Sub SetLink(ByVal value as String)\n _link = new Uri(value)\nEnd Sub\n" }, { "answer_id": 162893, "auth...
2008/10/02
[ "https://Stackoverflow.com/questions/162879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043/" ]
162,886
<p>Does anyone know of an application or system out there for tracking changes (files added/removed, diffs on text files) to a <em>non-source controlled</em> directory over time? Something that would let you</p> <ol> <li><p>Take a snapshot of a certain directory tree at time A</p></li> <li><p>Come back at time period...
[ { "answer_id": 162980, "author": "Dickon Reed", "author_id": 22668, "author_profile": "https://Stackoverflow.com/users/22668", "pm_score": 3, "selected": true, "text": "hg commit -A -m \"automated snapshot\"" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/162886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4668/" ]
162,896
<p>I'm a Mac user and I've decided to learn Emacs. I've <a href="http://steve.yegge.googlepages.com/effective-emacs" rel="noreferrer">read</a> that to reduce hand strain and improve accuracy the <kbd>CTRL</kbd> and <kbd>CAPS LOCK</kbd> keys should be swapped. How do I do this in Leopard?</p> <p>Also, in Terminal I hav...
[ { "answer_id": 19614725, "author": "lawlist", "author_id": 2112489, "author_profile": "https://Stackoverflow.com/users/2112489", "pm_score": 2, "selected": false, "text": "ns-win.el --with-ns init.el (define-key global-map [?\\s-,] 'customize)\n(define-key global-map [?\\s-'] 'next-multi...
2008/10/02
[ "https://Stackoverflow.com/questions/162896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658/" ]
162,897
<p>Given the following C function in a DLL:</p> <pre><code>char * GetDir(char* path ); </code></pre> <p>How would you P/Invoke this function into C# and marshal the char * properly. .NET seems to know how to do LPCTSTR but when I can't figure out any marshaling that doesn't cause a NotSupportedException to fire when ...
[ { "answer_id": 162922, "author": "OregonGhost", "author_id": 20363, "author_profile": "https://Stackoverflow.com/users/20363", "pm_score": 4, "selected": false, "text": "[DllImport(\"your.dll\", CharSet = CharSet.Ansi)]\nstring GetDir(StringBuilder path);\n" }, { "answer_id": 163...
2008/10/02
[ "https://Stackoverflow.com/questions/162897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194/" ]
162,911
<p>If I can do this, how do I call Java code (methods for instance) from within JavaScript code, in Wicket. </p>
[ { "answer_id": 1146921, "author": "Antony Stubbs", "author_id": 105741, "author_profile": "https://Stackoverflow.com/users/105741", "pm_score": 5, "selected": true, "text": " component.add( new AbstractDefaultAjaxBehavior() {\n\n @Override\n protected void respond(Aj...
2008/10/02
[ "https://Stackoverflow.com/questions/162911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23486/" ]
162,931
<p>I'm trying to create a Crystal Reports formula field (to calculate the percentage change in a price) that will return "N/A" if a particular report field is null, but return a number to two decimal places using accounting format (negative numbers surrounded by parentheses) if it is not.</p> <p>The closest I have bee...
[ { "answer_id": 163019, "author": "Pyroglass", "author_id": 21760, "author_profile": "https://Stackoverflow.com/users/21760", "pm_score": 4, "selected": true, "text": "ToText(CCur(@Price}/{ValuationReport.YestPrice}*100-100)) CCur CCur(number) CCur(string) Replace (ToText(CCur({field})),\...
2008/10/02
[ "https://Stackoverflow.com/questions/162931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012/" ]
162,936
<p>I'm writing a GUI in C#, Visual Studio 2008, using the Designer and WinForms. I've got a ComboBox control, and I'd like it to only allow to select from the provided options and not to accept a user-entered string. It doesn't appear to have a ReadOnly property, and disabling it hinders the readability of the contro...
[ { "answer_id": 163012, "author": "David Max", "author_id": 22284, "author_profile": "https://Stackoverflow.com/users/22284", "pm_score": 2, "selected": false, "text": "comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;\ncomboBox1.Items.AddRange(new object[] {\n \"One\",\n \"Two\...
2008/10/02
[ "https://Stackoverflow.com/questions/162936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24529/" ]
162,941
<p>I know this is a really basic question, but I've just started with some basic C++ programming after coding a few projects with high-level languages. </p> <p>Basically I have three questions:</p> <ol> <li>Why use pointers over normal variables?</li> <li>When and where should I use pointers?</li> <li>How do you use ...
[ { "answer_id": 162988, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 6, "selected": false, "text": "char hello[] = \"hello\";\n\nchar *p = hello;\n\nwhile (*p)\n{\n *p += 1; // increase the character by one\n\n p += ...
2008/10/02
[ "https://Stackoverflow.com/questions/162941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
162,960
<p>So, I've been living with my cvs repositories for some time. Though there is a thing I miss - if i rename a file that is already in repository, I need to delete the one with old name from there and add the new one. Hence, I loose all my change-history. And sometimes there's a need to rename a file in alredy existing...
[ { "answer_id": 162970, "author": "Matthias Winkelmann", "author_id": 4494, "author_profile": "https://Stackoverflow.com/users/4494", "pm_score": 5, "selected": true, "text": "svn move <oldfile> <newfile>\n git mv <oldfile> <newfile> mv" }, { "answer_id": 162998, "author": "Co...
2008/10/02
[ "https://Stackoverflow.com/questions/162960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4172/" ]
162,962
<p>When I run my Visual Studio Windows Forms application by clicking F5 (debug mode), after I click on the close button (which calls <code>Application.Exit()</code>), after a few seconds I get an error that says:</p> <blockquote> <p>cannot acess a disposed object: Object name 'SampleForm'.</p> </blockquote> <p>A bi...
[ { "answer_id": 162972, "author": "GEOCHET", "author_id": 5640, "author_profile": "https://Stackoverflow.com/users/5640", "pm_score": 0, "selected": false, "text": "do {\n\n // Crazy threading stuff here\n\n}while(_running);\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/162962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
162,969
<p>I'm developing a an eclipse plugin that uses an SWT interface. I need to display text, and within that text there needs to be links. The only two widgets that I've found that will allow me to include clickable links in text are Link and Browser. Browser, however, is overkill for my needs, and I couldn't properly ...
[ { "answer_id": 162972, "author": "GEOCHET", "author_id": 5640, "author_profile": "https://Stackoverflow.com/users/5640", "pm_score": 0, "selected": false, "text": "do {\n\n // Crazy threading stuff here\n\n}while(_running);\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/162969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3415/" ]
162,986
<p>I have a class that looks like this</p> <pre><code>public class SomeClass { public SomeChildClass[] childArray; } </code></pre> <p>which will output XML from the XMLSerializer like this:</p> <pre><code>&lt;SomeClass&gt; &lt;SomeChildClass&gt; ... &lt;/SomeChildClass&gt; &lt;SomeChildClass&gt; ...
[ { "answer_id": 163134, "author": "Micah", "author_id": 17744, "author_profile": "https://Stackoverflow.com/users/17744", "pm_score": 3, "selected": true, "text": "[XmlAttribute(\"Index\")]\npublic int Order\n{ { get; set; } }\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/162986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3543/" ]
162,989
<p>How does one dynamically load a new report from an embedded resource? I have created a reporting project that contains a report as an embedded resource. I added a second report file and use the following code to switch reports:</p> <pre><code>this.reportViewer1.LocalReport.ReportEmbeddedResource = "ReportsApplicati...
[ { "answer_id": 167132, "author": "Craig Eddy", "author_id": 5557, "author_profile": "https://Stackoverflow.com/users/5557", "pm_score": 4, "selected": true, "text": "<ReportViewer>.Reset();\n <ReportViewer>.LocalReport.DataSources.Add( ... );\n" }, { "answer_id": 71563048, "a...
2008/10/02
[ "https://Stackoverflow.com/questions/162989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5557/" ]
162,993
<p>I am creating a decoupled WMI provider in a class library. Everything I have read points towards including something along these lines:</p> <pre><code>[System.ComponentModel.RunInstaller(true)] public class MyApplicationManagementInstaller : DefaultManagementInstaller { } </code></pre> <p>I gather the purpose of t...
[ { "answer_id": 373748, "author": "David Gardiner", "author_id": 25702, "author_profile": "https://Stackoverflow.com/users/25702", "pm_score": 1, "selected": false, "text": " public static void Run( Type type )\n {\n // Register WMI stuff\n var installArgs = new[]\n ...
2008/10/02
[ "https://Stackoverflow.com/questions/162993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82/" ]
163,004
<p>Say I have two tables I want to join. Categories:</p> <pre><code>id name ---------- 1 Cars 2 Games 3 Pencils </code></pre> <p>And items:</p> <pre><code>id categoryid itemname --------------------------- 1 1 Ford 2 1 BMW 3 1 VW 4 2 Tetris 5 ...
[ { "answer_id": 163051, "author": "GSerg", "author_id": 11683, "author_profile": "https://Stackoverflow.com/users/11683", "pm_score": 0, "selected": false, "text": " select category.id, category.name, itemid, itemname\n inner join \n (select item.categoryid, item.id as itemid, ...
2008/10/02
[ "https://Stackoverflow.com/questions/163004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15214/" ]
163,009
<p>If I open a file using urllib2, like so:</p> <pre><code>remotefile = urllib2.urlopen('http://example.com/somefile.zip') </code></pre> <p>Is there an easy way to get the file name other then parsing the original URL?</p> <p>EDIT: changed openfile to urlopen... not sure how that happened.</p> <p>EDIT2: I ended up ...
[ { "answer_id": 163093, "author": "Dan Lenski", "author_id": 20789, "author_profile": "https://Stackoverflow.com/users/20789", "pm_score": 2, "selected": false, "text": "urllib2.urlopen openfile urllib2 urllib2.urlparse >>> from urllib2 import urlparse\n>>> print urlparse.urlsplit('http:/...
2008/10/02
[ "https://Stackoverflow.com/questions/163009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6007/" ]
163,022
<p>I'd like to do some basic profiling of my code, but found that the DateTime.Now in C# only have a resolution of about 16 ms. There must be better time keeping constructs that I haven't yet found.</p>
[ { "answer_id": 163089, "author": "ChronoPositron", "author_id": 19127, "author_profile": "https://Stackoverflow.com/users/19127", "pm_score": 1, "selected": false, "text": "[DllImport(\"Kernel32.dll\")]\nprivate static extern bool QueryPerformanceCounter(out long lpPerformanceCount);\n B...
2008/10/02
[ "https://Stackoverflow.com/questions/163022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2973/" ]
163,058
<p>In a C++ function I need the compiler to choose a different block if it is compiling for a 64 bit architecture.</p> <p>I know a way to do it for MSVC++ and g++, so I'll post it as an answer. However I would like to know if there is a better way (more elegant that would work for all compilers/all 64 bits architectur...
[ { "answer_id": 163062, "author": "Mathieu Pagé", "author_id": 5861, "author_profile": "https://Stackoverflow.com/users/5861", "pm_score": 5, "selected": false, "text": "g++ #if defined(_M_X64) || defined(__amd64__)\n // code...\n#endif\n" }, { "answer_id": 164015, "author": ...
2008/10/02
[ "https://Stackoverflow.com/questions/163058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5861/" ]
163,071
<p>The <a href="http://en.wikipedia.org/wiki/Law_of_Demeter" rel="noreferrer">Law of Demeter</a> indicates that you should only speak to objects that you know about directly. That is, do not perform method chaining to talk to other objects. When you do so, you are establishing improper linkages with the intermediary ...
[ { "answer_id": 163139, "author": "Rasmus Faber", "author_id": 5542, "author_profile": "https://Stackoverflow.com/users/5542", "pm_score": 4, "selected": false, "text": "int price = customer.getOrder().getPrice();\n int price = customer.getOrderPrice();\n" }, { "answer_id": 163180...
2008/10/02
[ "https://Stackoverflow.com/questions/163071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10737/" ]
163,079
<p>Is there a tool to migrate an <a href="http://en.wikipedia.org/wiki/SQLite" rel="noreferrer">SQLite</a> database to <a href="http://en.wikipedia.org/wiki/Microsoft_SQL_Server" rel="noreferrer">SQL Server</a> (both the structure and data)?</p>
[ { "answer_id": 163136, "author": "Nathan Clark", "author_id": 1331, "author_profile": "https://Stackoverflow.com/users/1331", "pm_score": 3, "selected": false, "text": ".dump" }, { "answer_id": 28151420, "author": "AlbanMar31", "author_id": 4459356, "author_profile": ...
2008/10/02
[ "https://Stackoverflow.com/questions/163079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7793/" ]
163,092
<p>In Ruby you can easily set a default value for a variable </p> <pre><code>x ||= "default" </code></pre> <p>The above statement will set the value of x to "default" if x is nil or false</p> <p>Is there a similar shortcut in PHP or do I have to use the longer form:</p> <pre><code>$x = (isset($x))? $x : "default"; ...
[ { "answer_id": 163123, "author": "Michał Niedźwiedzki", "author_id": 2169, "author_profile": "https://Stackoverflow.com/users/2169", "pm_score": 3, "selected": false, "text": "isset($x) or $x = 'default';\n" }, { "answer_id": 163901, "author": "SeanDowney", "author_id": 5...
2008/10/02
[ "https://Stackoverflow.com/questions/163092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796/" ]
163,098
<p>I have several databases where the transaction log (.LDF) is many times larger than the database file (.MDF).</p> <p>What can I do to automatically shrink these or keep them from getting so large?</p>
[ { "answer_id": 163193, "author": "jdecuyper", "author_id": 296, "author_profile": "https://Stackoverflow.com/users/296", "pm_score": 0, "selected": false, "text": "USE yourdabatase\nSELECT * FROM sysfiles\n FileID … \n1 1 24264 -1 1280 10485...
2008/10/02
[ "https://Stackoverflow.com/questions/163098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2926/" ]
163,104
<p>Is there any way for the main form to be able to intercept events firing on a subcontrol on a user control?</p> <p>I've got a custom user-control embedded in the main Form of my application. The control contains various subcontrols that manipulate data, which itself is displayed by other controls on the main form....
[ { "answer_id": 163255, "author": "Eric Schoonover", "author_id": 3957, "author_profile": "https://Stackoverflow.com/users/3957", "pm_score": 5, "selected": true, "text": "UserControl UserControl1 UserControl TextBox1 UserControl ControlChanged UserControl TextBox1 TextChangeEvent Control...
2008/10/02
[ "https://Stackoverflow.com/questions/163104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24529/" ]
163,162
<p>I am trying to use the <code>Directory.GetFiles()</code> method to retrieve a list of files of multiple types, such as <code>mp3</code>'s and <code>jpg</code>'s. I have tried both of the following with no luck:</p> <pre><code>Directory.GetFiles("C:\\path", "*.mp3|*.jpg", SearchOption.AllDirectories); Directory.Get...
[ { "answer_id": 163203, "author": "NotMe", "author_id": 2424, "author_profile": "https://Stackoverflow.com/users/2424", "pm_score": 3, "selected": false, "text": "List<string> _searchPatternList = new List<string>();\n ...\n List<string> fileList = new List<string>();\n foreach (...
2008/10/02
[ "https://Stackoverflow.com/questions/163162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2470/" ]
163,183
<p>I'm encountering some peculiarities with LINQ to SQL.</p> <p>With a relatively simple query, I want to select some fields, but have the date fields formatted as strings, which I first achieved like this:</p> <pre><code> var list = dataContext.MyLists.Single(x =&gt; x.ID == myId); var items = from i...
[ { "answer_id": 163261, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 5, "selected": true, "text": "var items = list.MyItems.Select(item => new { item.ID, item.Sector, item.Description, \n ...
2008/10/02
[ "https://Stackoverflow.com/questions/163183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/366/" ]
163,184
<p>I need to convert inline css style attributes to their HTML tag equivelants. The solution I have works but runs VERY slowly using the Microsoft .Net Regex namespace and long documents (~40 pages of html). I've tried several variations but with no useful results. I've done a little wrapping around executing the ex...
[ { "answer_id": 163211, "author": "Santiago Palladino", "author_id": 12791, "author_profile": "https://Stackoverflow.com/users/12791", "pm_score": 3, "selected": false, "text": "span font .\\*? [^>]\\*? .\\*? [^<]\\*?" }, { "answer_id": 163316, "author": "Markus Jarderot", ...
2008/10/02
[ "https://Stackoverflow.com/questions/163184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
163,207
<p>I need to call a method that accepts a stream argument. The method loads text into the stream, which would normally be a file. I'd like to simply populate a string with the contents of the stream, instead of writing it to a file. How do I do this?</p>
[ { "answer_id": 163226, "author": "Wolfwyrd", "author_id": 15570, "author_profile": "https://Stackoverflow.com/users/15570", "pm_score": 3, "selected": false, "text": "StringBuilder sb = new StringBuilder();\nStringWriter sw = new StringWriter(sb);\nCallYourMethodWhichWritesToYourStream(s...
2008/10/02
[ "https://Stackoverflow.com/questions/163207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20625/" ]
163,246
<p>In Oracle, I can re-create a view with a single statement, as shown here:</p> <pre><code>CREATE OR REPLACE VIEW MY_VIEW AS SELECT SOME_FIELD FROM SOME_TABLE WHERE SOME_CONDITIONS </code></pre> <p>As the syntax implies, this will drop the old view and re-create it with whatever definition I've given.</p> <p>Is the...
[ { "answer_id": 163283, "author": "Michael Petrotta", "author_id": 23897, "author_profile": "https://Stackoverflow.com/users/23897", "pm_score": 3, "selected": false, "text": "if exists (select * from dbo.sysobjects\n where id = object_id(N'dbo.MyView') and\n OBJECTPROPERTY(id, N'IsView...
2008/10/02
[ "https://Stackoverflow.com/questions/163246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/672/" ]
163,302
<p>I'm trying to have the modrewrite rules skip the directory <code>vip</code>. I've tried a number of things as you can see below, but to no avail.</p> <pre><code># BEGIN WordPress &lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / #RewriteRule ^vip$ - [PT] RewriteRule ^vip/.$ - [PT] #RewriteCond %{REQUEST_...
[ { "answer_id": 163401, "author": "Peter Howe", "author_id": 24106, "author_profile": "https://Stackoverflow.com/users/24106", "pm_score": -1, "selected": false, "text": "RewriteRule ^/vip/(.*)$ /$1?%{QUERY_STRING} [L]\n" }, { "answer_id": 163530, "author": "Patrick McElhane...
2008/10/02
[ "https://Stackoverflow.com/questions/163302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24557/" ]
163,311
<p>I am using an asp:Calander and I have an object that has a beginning date and an ending date. I need to get all the dates between these two dates and place them in an array so i can then render corresponding dates on the calander with different CSS</p>
[ { "answer_id": 163325, "author": "albertein", "author_id": 23020, "author_profile": "https://Stackoverflow.com/users/23020", "pm_score": 2, "selected": false, "text": "DateTime startDate;\nDateTime endDate;\n\nDateTime currentDate = startDate;\nList<DateTime> dates = new List<DateTime> (...
2008/10/02
[ "https://Stackoverflow.com/questions/163311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16820/" ]
163,336
<p>Say for example you just queried a database and you recieved this 2D array.</p> <pre><code>$results = array( array('id' =&gt; 1, 'name' =&gt; 'red' , 'spin' =&gt; 1), array('id' =&gt; 2, 'name' =&gt; 'green', 'spin' =&gt; -1), array('id' =&gt; 3, 'name' =&gt; 'blue' , 'spin' =&gt; .5) ); </code></pre>...
[ { "answer_id": 163491, "author": "inxilpro", "author_id": 12549, "author_profile": "https://Stackoverflow.com/users/12549", "pm_score": 4, "selected": false, "text": "function array_column($array, $column)\n{\n $ret = array();\n foreach ($array as $row) $ret[] = $row[$column];\n ...
2008/10/02
[ "https://Stackoverflow.com/questions/163336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17919/" ]
163,355
<p>I'm on SQL Server 2005 and I am getting an error which I am pretty sure should not be getting.</p> <pre><code>Msg 512, Level 16, State 1, Procedure spGetSavedSearchesByAdminUser, Line 8 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , &gt;, &gt;= or when the ...
[ { "answer_id": 163371, "author": "Mark Brackett", "author_id": 2199, "author_profile": "https://Stackoverflow.com/users/2199", "pm_score": 2, "selected": false, "text": "WHERE strUserName = @strUserName AND (\n (@bitQuickSearch = 1 AND strSearchTypeCode = 'Quick')\n OR\n (strSearch...
2008/10/02
[ "https://Stackoverflow.com/questions/163355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/262613/" ]
163,360
<p>I use RegexBuddy while working with regular expressions. From its library I copied the regular expression to match URLs. I tested successfully within RegexBuddy. However, when I copied it as Java <code>String</code> flavor and pasted it into Java code, it does not work. The following class prints <code>false</code>:...
[ { "answer_id": 163398, "author": "TomC", "author_id": 13183, "author_profile": "https://Stackoverflow.com/users/13183", "pm_score": 8, "selected": true, "text": "String regex = \"^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]\";\n String regex = \"\\\\b(https?|f...
2008/10/02
[ "https://Stackoverflow.com/questions/163360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2138/" ]
163,363
<p>I have monthly sales figures stored in separate sheets. I would like to create a plot of sales for multiple products per month. Each product would be represented in a different colored line on the same chart with each month running along the x axis.</p> <p>What is the best way to create a single line chart that p...
[ { "answer_id": 4172905, "author": "Kev", "author_id": 16777, "author_profile": "https://Stackoverflow.com/users/16777", "pm_score": 0, "selected": false, "text": "Sub createAllGraphs()\n\nConst chartWidth As Integer = 260\nConst chartHeight As Integer = 200\n\n\n\n\nIf Sheets.Count = 1 T...
2008/10/02
[ "https://Stackoverflow.com/questions/163363", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8761/" ]
163,365
<p>Let's say that for some reason you need to write a macro: <code>MACRO(X,Y)</code>. <strong>(Let's assume there's a good reason you can't use an inline function.)</strong> You want this macro to emulate a call to a function with no return value.</p> <hr> <h3>Example 1: This should work as expected.</h3> <pre><co...
[ { "answer_id": 163366, "author": "Kip", "author_id": 18511, "author_profile": "https://Stackoverflow.com/users/18511", "pm_score": 6, "selected": false, "text": "#define MACRO(X,Y) \\\ndo { \\\n cout << \"1st arg is:\" << (X)...
2008/10/02
[ "https://Stackoverflow.com/questions/163365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18511/" ]
163,382
<p>I have the following code that won't compile and although there is a way to make it compile I want to understand why it isn't compiling. Can someone enlighten me as to specifically why I get the error message I will post at the end please?</p> <pre><code>public class Test { public static void main(String args[]...
[ { "answer_id": 163406, "author": "Ken", "author_id": 20621, "author_profile": "https://Stackoverflow.com/users/20621", "pm_score": 1, "selected": false, "text": "public class Test {\n public static void main(String args[]) {\n Test t = new Test();\n t.testT(null);\n }...
2008/10/02
[ "https://Stackoverflow.com/questions/163382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6414/" ]
163,389
<p>I have a web application where users enter arbitrary sql queries for later batch processing. We want to validate the syntax of the query without actually executing it. Some of the queries will take a long time, which is why we don't want to execute them. I'm using Oracle's dbms_sql.parse to do this.</p> <p>However,...
[ { "answer_id": 163483, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 4, "selected": true, "text": "import java.sql.*;\n. . .\nConnection conn;\n. . .\nPreparedStatement ps = conn.prepareStatement(\"SELECT * FROM foo\")...
2008/10/02
[ "https://Stackoverflow.com/questions/163389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6479/" ]
163,400
<p>I'm working on an upgrade for an existing database that was designed without any of the code to implement the design being considered. Now I've hit a brick wall in terms of implementing the database design in code. I'm certain whether its a problem with the design of the database or if I'm simply not seeing the corr...
[ { "answer_id": 163846, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 0, "selected": false, "text": "CREATE TABLE lessonstatus_rtab (\n user_id INT NOT NULL,\n seat_id INT NOT NULL,\n lesson_id INT NOT NULL RE...
2008/10/02
[ "https://Stackoverflow.com/questions/163400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20178/" ]
163,407
<p>Is there a way to use Enum values inside a JSP without using scriptlets.</p> <p>e.g. </p> <pre><code>package com.example; public enum Direction { ASC, DESC } </code></pre> <p>so in the JSP I want to do something like this</p> <pre><code>&lt;c:if test="${foo.direction ==&lt;% com.example.Direction.ASC %&...
[ { "answer_id": 163431, "author": "JeeBee", "author_id": 17832, "author_profile": "https://Stackoverflow.com/users/17832", "pm_score": 6, "selected": true, "text": "\n<%@ page import=\"com.example.Direction\" %>\n...\n<p>Direction is <%=foo.direction.getFriendlyName()%></p>\n<% if (foo.di...
2008/10/02
[ "https://Stackoverflow.com/questions/163407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3332/" ]
163,420
<p>I am trying to print an existing file to PDF programmatically in Visual Basic 2008.</p> <p>Our current relevant assets are: Visual Studio 2008 Professional Adobe Acrobat Professional 8.0</p> <p>I thought about getting a sdk like ITextSharp, but it seem like overkill for what I am trying to do especially since we h...
[ { "answer_id": 164314, "author": "Joe Phillips", "author_id": 20471, "author_profile": "https://Stackoverflow.com/users/20471", "pm_score": 2, "selected": false, "text": "'PDF_WILDCARD = \"*.pdf\"\n'PrnName = \"Adobe PDF\"\nSub PrintToPDF(ReportName As String, TempPath As String, _\n ...
2008/10/02
[ "https://Stackoverflow.com/questions/163420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5578/" ]
163,432
<p>I am using Borland Builder C++. I have a memory leak and I know it must be because of this class I created, but I am not sure how to fix it. Please look at my code-- any ideas would be greatly appreciated!</p> <p>Here's the .h file:</p> <pre><code>#ifndef HeaderH #define HeaderH #include &lt;vcl.h&gt; #include &lt...
[ { "answer_id": 163438, "author": "coppro", "author_id": 16855, "author_profile": "https://Stackoverflow.com/users/16855", "pm_score": 2, "selected": false, "text": "main new delete Header main Header header; new delete header;" }, { "answer_id": 163466, "author": "Rob Walker"...
2008/10/02
[ "https://Stackoverflow.com/questions/163432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23970/" ]
163,434
<p>There's a school of thought that null values should not be allowed in a relational database. That is, a table's attribute (column) should not allow null values. Coming from a software development background, I really don't understand this. It seems that if null is valid within the context of the attribute, then it s...
[ { "answer_id": 163456, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 5, "selected": false, "text": "NULL NUM_CHILDREN NULL NUM_CHILDREN NULL NUM_CHILDREN NULL" }, { "answer_id": 163510, "author": "finnw", ...
2008/10/02
[ "https://Stackoverflow.com/questions/163434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24396/" ]
163,484
<p>Any failed ASSERT statements on Windows cause the below debug message to appear and freeze the applications execution. I realise this is expected behaviour but it is running periodically on a headless machine so prevent the unit tests from failing, instead waiting on user input indefinitely.</p> <p>Is there s a reg...
[ { "answer_id": 163561, "author": "Andrew Stein", "author_id": 13029, "author_profile": "https://Stackoverflow.com/users/13029", "pm_score": 2, "selected": true, "text": "// For custom assert and trace handling with WebDbg\n#ifdef _DEBUG\nCDebugReportHook g_ReportHook;\n#endif\n" }, {...
2008/10/02
[ "https://Stackoverflow.com/questions/163484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5355/" ]
163,492
<p>Wondering if it would ever be useful to index every possible state of an application using some reference keys...</p> <p>Meaning, say we have a program that starts, has only so many possible outcomes, say 8.</p> <p>but if each outcome is attained through stepping through many more logic states, and in between each...
[ { "answer_id": 163812, "author": "andy", "author_id": 21482, "author_profile": "https://Stackoverflow.com/users/21482", "pm_score": 1, "selected": false, "text": "for (int i=0; i < 100; i++)\n some_function();\n" }, { "answer_id": 736899, "author": "Triynko", "author_i...
2008/10/02
[ "https://Stackoverflow.com/questions/163492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18309/" ]
163,497
<p>Is it possible to run a ruby application as a Windows Service? I see that there is a related question which discusses running a <a href="https://stackoverflow.com/questions/25530/best-method-to-run-a-java-application-as-a-nix-daemon-or-windows-service">Java Application as a Windows Service</a>, how can you do this ...
[ { "answer_id": 164365, "author": "Jonke", "author_id": 15638, "author_profile": "https://Stackoverflow.com/users/15638", "pm_score": 4, "selected": false, "text": "Service.create( :service_name => 'some_service',\n :host => nil,\n :service_type => Serv...
2008/10/02
[ "https://Stackoverflow.com/questions/163497", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19784/" ]
163,507
<p>Definition of variables in use:</p> <pre><code>Guid fldProId = (Guid)ffdPro.GetProperty("FieldId"); string fldProValue = (string)ffdPro.GetProperty("FieldValue"); FormFieldDef fmProFldDef = new FormFieldDef(); fmProFldDef.Key = fldProId; fmProFldDef.Retrieve(); string fldProName = (string)fmProFldDef.GetProperty("F...
[ { "answer_id": 163521, "author": "TheSoftwareJedi", "author_id": 18941, "author_profile": "https://Stackoverflow.com/users/18941", "pm_score": 0, "selected": false, "text": "Label hTxtBox = (Label)findControl(fldProName);\n string fldProName = (string)fmProFldDef.GetProperty(\"FieldName\...
2008/10/02
[ "https://Stackoverflow.com/questions/163507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24565/" ]
163,531
<p>I am creating an installer for an ASP.Net website using WiX. How do you set the ASP.Net version in IIS using WiX?</p>
[ { "answer_id": 163706, "author": "Vivek", "author_id": 7418, "author_profile": "https://Stackoverflow.com/users/7418", "pm_score": 0, "selected": false, "text": "aspnet_regiis.exe -s W3SVC/1/ROOT/SampleApp1" }, { "answer_id": 200438, "author": "thijs", "author_id": 26796,...
2008/10/02
[ "https://Stackoverflow.com/questions/163531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1865/" ]
163,535
<p>In implementing my first significant script using jquery I needed to find a specific web-control on the page. Since I work with DotNetNuke, there is no guaranteeing the controls ClientID since the container control may change from site to site. I ended up using an attribute selector that looks for an ID that ends ...
[ { "answer_id": 163566, "author": "toohool", "author_id": 14334, "author_profile": "https://Stackoverflow.com/users/14334", "pm_score": 3, "selected": false, "text": "$(\"#<%= cboPanes.ClientID %>\")\n" }, { "answer_id": 165572, "author": "Eric Schoonover", "author_id": 39...
2008/10/02
[ "https://Stackoverflow.com/questions/163535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4820/" ]
163,537
<p>I'm trying to debug an MSBuild task, and I know there is some way to write to the MSBuild log from within a custom task but I forget how.</p>
[ { "answer_id": 163558, "author": "Kent Boogaart", "author_id": 5380, "author_profile": "https://Stackoverflow.com/users/5380", "pm_score": 4, "selected": true, "text": "Log Log.LogMessage(\"My message\");\n" }, { "answer_id": 823680, "author": "si618", "author_id": 44540,...
2008/10/02
[ "https://Stackoverflow.com/questions/163537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327/" ]
163,538
<p>I am debugging with breakpoints and I realize the assert call? I thought it was only for unit tests. What does it do more than breakpoint? Since I can breakpoint, why should I use Assert?</p>
[ { "answer_id": 163543, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 9, "selected": true, "text": "Assert Debug.Assert" }, { "answer_id": 163555, "author": "Ryan", "author_id": 17917, "author...
2008/10/02
[ "https://Stackoverflow.com/questions/163538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21386/" ]
163,542
<p>If I do the following:</p> <pre><code>import subprocess from cStringIO import StringIO subprocess.Popen(['grep','f'],stdout=subprocess.PIPE,stdin=StringIO('one\ntwo\nthree\nfour\nfive\nsix\n')).communicate()[0] </code></pre> <p>I get:</p> <pre><code>Traceback (most recent call last): File "&lt;stdin&gt;", line ...
[ { "answer_id": 163556, "author": "Daryl Spitzer", "author_id": 4766, "author_profile": "https://Stackoverflow.com/users/4766", "pm_score": 6, "selected": false, "text": ">>> p = subprocess.Popen(['grep','f'],stdout=subprocess.PIPE,stdin=subprocess.PIPE)\n>>> p.stdin.write(b'one\\ntwo\\nt...
2008/10/02
[ "https://Stackoverflow.com/questions/163542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4766/" ]
163,550
<p>Is there a maximum number of characters that can be written to a file using a StreamWriter? Or is there a maximum number of characters that <code>WriteLine()</code> can output? I am trying to write some data to a file but all of the data does not seem to make it. This is the current state of my code:</p> <pre><code...
[ { "answer_id": 163594, "author": "user7116", "author_id": 7116, "author_profile": "https://Stackoverflow.com/users/7116", "pm_score": 3, "selected": false, "text": "using (StreamWriter writer = new StreamWriter(@\"somefile.txt\"))\n{\n // ...\n writer.WriteLine(largeAmountsOfData);...
2008/10/02
[ "https://Stackoverflow.com/questions/163550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2486/" ]
163,552
<p>I have seen <a href="https://stackoverflow.com/questions/87030/where-to-find-java-6-jssejce-source-code">Where to find Java 6 JSSE/JCE Source Code?</a> and asked the question myself <a href="https://stackoverflow.com/questions/150849/how-to-get-jrejdk-with-matching-source">How to get JRE/JDK with matching source?<...
[ { "answer_id": 5479171, "author": "Dolda2000", "author_id": 134252, "author_profile": "https://Stackoverflow.com/users/134252", "pm_score": 0, "selected": false, "text": "apt-get source openjdk-6 jdk/src/share/classes/javax/net/ssl" }, { "answer_id": 9645563, "author": "Peter...
2008/10/02
[ "https://Stackoverflow.com/questions/163552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1505846/" ]
163,562
<p>I'm looking for some kind of text-parser for ASP.NET that can make HTML from some style of text that uses a special format. Like in Wiki's there is some special syntax for headings and such. I have tried to look on google, but I did not found anything for .NET.</p> <p>Do someone know about a library for .NET that c...
[ { "answer_id": 197281, "author": "Cody Hatch", "author_id": 17086, "author_profile": "https://Stackoverflow.com/users/17086", "pm_score": 2, "selected": false, "text": "*italics* **bold** _italics_ *bold* 3. Test1\n2. Test2\n1. Test3 \n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/163562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11559/" ]
163,563
<p>I have an issue - </p> <p>The javascript <code>Date("mm-dd-yyyy")</code> constructor doesn't work for FF. It works fine for IE.</p> <ul> <li>IE : <code>new Date("04-02-2008")</code> => <code>"Wed Apr 2 00:00:00 EDT 2008"</code></li> <li>FF2 : <code>new Date("04-02-2008")</code> => <code>Invalid Date</code> </l...
[ { "answer_id": 163584, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 7, "selected": true, "text": "month new Date(\"04/02/2008\");\n new Date(2008, 3, 2);\n" }, { "answer_id": 164821, "author": "roenving", "au...
2008/10/02
[ "https://Stackoverflow.com/questions/163563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7617/" ]
163,569
<p>I have a Flex application that calls a function which searches a large document collection. Depending on the search term, the user may want to stop the request from flex. </p> <p>I’d like to not only stop the flex application from expecting the request, but also stop the CFC request. Is this possible? What’s the be...
[ { "answer_id": 163790, "author": "Peter Boughton", "author_id": 9360, "author_profile": "https://Stackoverflow.com/users/9360", "pm_score": 0, "selected": false, "text": "<cfabort/> <cfsetting requesttimeout=\"0\"/>" }, { "answer_id": 163821, "author": "Dan Cramer", "auth...
2008/10/02
[ "https://Stackoverflow.com/questions/163569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24563/" ]
163,591
<p>In the GNOME Terminal, Bash does smart auto-completion. For example</p> <pre><code>apt-get in&lt;TAB&gt; </code></pre> <p>becomes</p> <pre><code>apt-get install </code></pre> <p>In Emacs shell-mode, this auto-completion doesn't work, even after I explicitly source <code>/etc/bash_completion</code>. The above exa...
[ { "answer_id": 220960, "author": "Steve Lacey", "author_id": 11077, "author_profile": "https://Stackoverflow.com/users/11077", "pm_score": 4, "selected": false, "text": "(global-set-key \"\\M-\\r\" 'shell-resync-dirs)\n" }, { "answer_id": 28618762, "author": "gavenkoa", "...
2008/10/02
[ "https://Stackoverflow.com/questions/163591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412/" ]
163,603
<p>I have a web application written using CherryPy, which is run locally on <code>127.0.0.1:4321</code>. We use mod-rewrite and mod-proxy to have Apache act as a reverse proxy; Apache also handles our SSL encryption and may eventually be used to transfer all of our static content.</p> <p>This all works just fine for ...
[ { "answer_id": 164769, "author": "fumanchu", "author_id": 23692, "author_profile": "https://Stackoverflow.com/users/23692", "pm_score": 4, "selected": true, "text": "SetEnv proxy-nokeepalive 1" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/163603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1694/" ]
163,604
<p>I'm trying to select a random 10% sampling from a small table. I thought I'd just use the RAND() function and select those rows where the random number is less than 0.10:</p> <pre><code>SELECT * FROM SomeTable WHERE SomeColumn='SomeCondition' AND RAND() &lt; 0.10 </code></pre> <p>But I soon discovered that ...
[ { "answer_id": 163615, "author": "tzot", "author_id": 6899, "author_profile": "https://Stackoverflow.com/users/6899", "pm_score": 2, "selected": false, "text": "SELECT * FROM SomeTable WHERE SomeColumn='SomeCondition' AND 0*rowid+RAND() < 0.10\n RAND()" }, { "answer_id": 163843, ...
2008/10/02
[ "https://Stackoverflow.com/questions/163604", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5987/" ]
163,610
<p>I run a browser based game at www.darknovagames.com. Recently, I've been working on reformatting the site with CSS, trying to get all of its pages to verify according to the HTML standard.</p> <p>I've been toying with this idea of having the navigation menu on the left AJAX the pages in (rather than taking the user...
[ { "answer_id": 10234045, "author": "Nikita Koksharov", "author_id": 764206, "author_profile": "https://Stackoverflow.com/users/764206", "pm_score": 2, "selected": false, "text": "Path.map(\"#/page\").to(function(){\n alert('page!');\n});\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/163610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19521/" ]
163,628
<p>When placing email addresses on a webpage do you place them as text like this:</p> <pre><code>joe.somebody@company.com </code></pre> <p>or use a clever trick to try and fool the email address harvester bots? For example:</p> <p><strong>HTML Escape Characters:</strong></p> <pre><code>&amp;#106;&amp;#111;&amp;#101...
[ { "answer_id": 163784, "author": "cllpse", "author_id": 20946, "author_profile": "https://Stackoverflow.com/users/20946", "pm_score": 3, "selected": false, "text": "<a href=\"#\" class=\"--mailto--john--domain--com-- other classes goes here\" />\n // match all a-elements with \"--mailto-...
2008/10/02
[ "https://Stackoverflow.com/questions/163628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13227/" ]
163,646
<p>I guess I need to know what I need in the classpath (what jar) in order to execute WebSphere 6.1 ant tasks. If someone can provide an example that would be perfect.</p>
[ { "answer_id": 416798, "author": "Dinesh Manne", "author_id": 50853, "author_profile": "https://Stackoverflow.com/users/50853", "pm_score": 2, "selected": false, "text": "wsanttasks.jar /opt/IBM/WebSphere/AppServer/lib/wsanttasks.jar ws_ant ws_ant ws_ant" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/163646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15053/" ]
163,678
<p>I want to be able to specify the file name stem for the log file in a Specman test. I need to hard-code the main *.elog filename so that I don't get variance between tests and confuse the post-processing scripts. Is there a constraint or command line I can pass into Specman?</p>
[ { "answer_id": 897319, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "extend sys\n{\n run() is also {\n specman(\"set log specman.elog\");\n };\n};\n" } ]
2008/10/02
[ "https://Stackoverflow.com/questions/163678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20712/" ]
163,707
<p>Whoops, I need some info from a file I deleted, a while ago. In CVS I would just go to the ATTIC to find it, how do I find a file in SVN without having to go back to a revision where it existed (especially annoying since I have no idea really when I deleted -- one week ago, two weeks ago...)</p>
[ { "answer_id": 163737, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": ",v" }, { "answer_id": 163756, "author": "David Nehme", "author_id": 14167, "author_profile": "https:/...
2008/10/02
[ "https://Stackoverflow.com/questions/163707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3798/" ]
163,732
<p>What would you recommend for class that needs to keep a list of unique integers?</p> <p>I'm going to want to Add() integers to the collection and also check for existence e.g. Contains().</p> <p>Would be nice to also get them in a list as a string for display, ie. "1, 5, 10, 21".</p>
[ { "answer_id": 163738, "author": "Tom Ritter", "author_id": 8435, "author_profile": "https://Stackoverflow.com/users/8435", "pm_score": 6, "selected": true, "text": "HashSet<T> HashSet<T> HashSet<T> HashSet<T> Dictionary<TKey, TValue> Hashtable HashSet<T> Dictionary<TKey, TValue> HashSet...
2008/10/02
[ "https://Stackoverflow.com/questions/163732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16008/" ]
163,747
<p>I'm working on a configuration script for a JNI wrapper. One of the configuration parameters is the path to <code>jni.h</code>. What's a good quick-and-dirty Autoconf test for whether this parameter is set correctly for C++ compilation? You can assume you're running on Linux and <code>g++</code> is available.</p> <...
[ { "answer_id": 164030, "author": "Braden", "author_id": 18144, "author_profile": "https://Stackoverflow.com/users/18144", "pm_score": 4, "selected": true, "text": "AC_CHECK_HEADER CPPFLAGS libjvm dlopen JAVA_HOME JAVA_HOME AC_CHECK_HEADER([jni.h], [have_jni=yes])\nAC_ARG_VAR([JAVA_HOME],...
2008/10/02
[ "https://Stackoverflow.com/questions/163747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412/" ]
163,748
<p>I have a web project, a C# library project, and a web setup project in Visual Studio 2005. The web project needs the C# library needs to be registered in the GAC. This is simple, just add the GAC folder to the setup project and drop the primary output of the C# library in there. The C# library also needs to be regis...
[ { "answer_id": 164707, "author": "Seth Petry-Johnson", "author_id": 23632, "author_profile": "https://Stackoverflow.com/users/23632", "pm_score": 2, "selected": false, "text": "REM Unregister anything currently in component services\n\nRemoveCom+.vbs\n\nC:\\WINDOWS\\Microsoft.NET\\Framew...
2008/10/02
[ "https://Stackoverflow.com/questions/163748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
163,757
<p>I am using boost::signal in a native C++ class, and I now I am writing a .NET wrapper in C++/CLI, so that I can expose the native C++ callbacks as .NET events. When I try to use boost::bind to take the address of a member function of my managed class, I get compiler error 3374, saying I cannot take the address of a ...
[ { "answer_id": 165362, "author": "Brian Stewart", "author_id": 3114, "author_profile": "https://Stackoverflow.com/users/3114", "pm_score": 2, "selected": false, "text": "#include <msclr/marshal.h>\n\n#include <boost/bind.hpp>\n#include <boost/signal.hpp>\n#include <iostream>\n\n#using <m...
2008/10/02
[ "https://Stackoverflow.com/questions/163757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3114/" ]