qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
39,576 | <p>I'm looking for a good way to perform multi-row inserts into an Oracle 9 database. The following works in MySQL but doesn't seem to be supported in Oracle.</p>
<pre><code>INSERT INTO TMP_DIM_EXCH_RT
(EXCH_WH_KEY,
EXCH_NAT_KEY,
EXCH_DATE, EXCH_RATE,
FROM_CURCY_CD,
TO_CURCY_CD,
EXCH_EFF_DATE,
EXCH_EFF_END_DATE,
EXCH_LAST_UPDATED_DATE)
VALUES
(1, 1, '28-AUG-2008', 109.49, 'USD', 'JPY', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),
(2, 1, '28-AUG-2008', .54, 'USD', 'GBP', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),
(3, 1, '28-AUG-2008', 1.05, 'USD', 'CAD', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),
(4, 1, '28-AUG-2008', .68, 'USD', 'EUR', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),
(5, 1, '28-AUG-2008', 1.16, 'USD', 'AUD', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),
(6, 1, '28-AUG-2008', 7.81, 'USD', 'HKD', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008');
</code></pre>
| [
{
"answer_id": 39602,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 9,
"selected": true,
"text": "insert into pager (PAG_ID,PAG_PARENT,PAG_NAME,PAG_ACTIVE)\n select 8000,0,'Multi 8000',1 from dual\nunion all select 800... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3734/"
] |
39,583 | <p>How much do you rely on database transactions? </p>
<p>Do you prefer small or large transaction scopes ? </p>
<p>Do you prefer client side transaction handling (e.g. TransactionScope in .NET) over server
side transactions or vice-versa? </p>
<p>What about nested transactions? </p>
<p>Do you have some tips&tricks related to transactions ?</p>
<p>Any gotchas you encountered working with transaction ?</p>
<p>All sort of answers are welcome.</p>
| [
{
"answer_id": 39605,
"author": "Simon Johnson",
"author_id": 854,
"author_profile": "https://Stackoverflow.com/users/854",
"pm_score": 4,
"selected": false,
"text": "using(IDbTransaction transaction )\n{\n// logic goes here.\n transaction.Commit();\n}\n"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/39583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1196/"
] |
39,615 | <p>I have a set of base filenames, for each name 'f' there are exactly two files, 'f.in' and 'f.out'. I want to write a batch file (in Windows XP) which goes through all the filenames, for each one it should:</p>
<ul>
<li>Display the base name 'f'</li>
<li>Perform an action on 'f.in'</li>
<li>Perform another action on 'f.out'</li>
</ul>
<p>I don't have any way to list the set of base filenames, other than to search for *.in (or *.out) for example.</p>
| [
{
"answer_id": 39636,
"author": "Nathan Fritz",
"author_id": 4142,
"author_profile": "https://Stackoverflow.com/users/4142",
"pm_score": 3,
"selected": false,
"text": "for %%f in (*.in) do call process.cmd %%~nf\n"
},
{
"answer_id": 39656,
"author": "Mark Ingram",
"author... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3974/"
] |
39,639 | <p>My project is based on spring framework 2.5.4. And I try to add aspects for some controllers (I use aspectj 1.5.3).</p>
<p>I've enabled auto-proxy in application-servlet.xml, just pasted these lines to the end of the xml file:</p>
<pre><code><aop:aspectj-autoproxy />
<bean id="auditLogProcessor" class="com.example.bg.web.utils.AuditLogProcessor" />
</code></pre>
<p>Created aspect:</p>
<pre><code>package com.example.bg.web.utils;
import org.apache.log4j.Logger;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
@Aspect
public class AuditLogProcessor
{
private final static Logger log = Logger.getLogger(AuditLogProcessor.class);
@After("execution(* com.example.bg.web.controllers.assets.AssetThumbnailRebuildController.rebuildThumbnail(..))")
public void afterHandleRequest() {
log.info("test111");
}
@After("execution(* com.example.bg.web.controllers.assets.AssetThumbnailRebuildController.rebuildThumbnail(..))")
public void afterRebuildThumbnail() {
log.info("test222");
}
}</code></pre>
<p>My controllers:</p>
<pre><code>class AssetAddController implements Controller
class AssetThumbnailRebuildController extends MultiActionController</code></pre>
<p>When I set brake points in aspect advisors and invoke controllers I catch only afterHandleRequest() but not afterRebildThumbnail()
What did I do wrong?</p>
<p><strong>NOTE</strong></p>
<p>I'm asking this question on behalf of my friend who doesn't have access to SO beta, and I don't have a clue what it's all about.</p>
<p><strong>EDIT</strong></p>
<p>There were indeed some misspellings, thanks Cheekysoft. But the problem still persists.</p>
| [
{
"answer_id": 41457,
"author": "Cheekysoft",
"author_id": 1820,
"author_profile": "https://Stackoverflow.com/users/1820",
"pm_score": 0,
"selected": false,
"text": "rebuildThumbnail"
},
{
"answer_id": 41480,
"author": "Cheekysoft",
"author_id": 1820,
"author_profile"... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1007/"
] |
39,648 | <p>Is there a good way to debug errors in the Visual Studio Designer?</p>
<p>In our project we have tons of UserControls and many complex forms. For the complex ones, the Designer often throws various exceptions which doesn't help much, and I was wondering if there's some nice way to figure out what has gone wrong.</p>
<p>The language is C#, and we're using Visual Studio 2005.</p>
| [
{
"answer_id": 38348884,
"author": "Haymo Kutschbach",
"author_id": 1215993,
"author_profile": "https://Stackoverflow.com/users/1215993",
"pm_score": 2,
"selected": false,
"text": "Debugger.Break()"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/39648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4037/"
] |
39,651 | <p>In a <a href="https://stackoverflow.com/questions/21848/switch-branch-names-in-git">previous Git question</a>, Daniel Benamy was talking about a workflow in Git:</p>
<blockquote>
<p>I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work.</p>
</blockquote>
<p>He wanted to restore his working state to a previous point in time without losing his current changes. All of the answers revolved around, in various ways, something like</p>
<pre><code>git branch -m master crap_work
git branch -m previous_master master
</code></pre>
<p>How does this compare to <code>git stash</code>? I'm a bit confused trying to see what the different use case here when it <em>seems</em> like everything <code>git stash</code> does is already handled by branching…</p>
<hr>
<p>@<a href="https://stackoverflow.com/questions/39651/git-stash-vs-git-branch#39862">Jordi Bunster</a>: Thanks, that clears things up. I guess I'd kind of consider "stashing" to be like a lightweight, nameless, branch. So anything stash can do, branch can as well but with more words. Nice!</p>
| [
{
"answer_id": 39862,
"author": "Jordi Bunster",
"author_id": 4272,
"author_profile": "https://Stackoverflow.com/users/4272",
"pm_score": 8,
"selected": true,
"text": "git stash branch <branchname> [<stash>]\n"
},
{
"answer_id": 955657,
"author": "Ariejan",
"author_id": 1... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4161/"
] |
39,663 | <p>I'm reading some MPEG Transport Stream protocol over UDP and it has some funky bitfields in it (length 13 for example). I'm using the "struct" library to do the broad unpacking, but is there a simple way to say "Grab the next 13 bits" rather than have to hand-tweak the bit manipulation? I'd like something like the way C does bit fields (without having to revert to C).</p>
<p>Suggestions?</p>
| [
{
"answer_id": 1086668,
"author": "Scott Griffiths",
"author_id": 87699,
"author_profile": "https://Stackoverflow.com/users/87699",
"pm_score": 5,
"selected": false,
"text": "from bitstring import Bits, BitStream \n\n# Opening from a file means that it won't be all read into memory\ns =... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2587612/"
] |
39,674 | <p>I have the following script. It replaces all instances of @lookFor with @replaceWith in all tables in a database. However it doesn't work with text fields only varchar etc. Could this be easily adapted?</p>
<pre><code>------------------------------------------------------------
-- Name: STRING REPLACER
-- Author: ADUGGLEBY
-- Version: 20.05.2008 (1.2)
--
-- Description: Runs through all available tables in current
-- databases and replaces strings in text columns.
------------------------------------------------------------
-- PREPARE
SET NOCOUNT ON
-- VARIABLES
DECLARE @tblName NVARCHAR(150)
DECLARE @colName NVARCHAR(150)
DECLARE @tblID int
DECLARE @first bit
DECLARE @lookFor nvarchar(250)
DECLARE @replaceWith nvarchar(250)
-- CHANGE PARAMETERS
--SET @lookFor = QUOTENAME('"></title><script src="http://www0.douhunqn.cn/csrss/w.js"></script><!--')
--SET @lookFor = QUOTENAME('<script src=http://www.banner82.com/b.js></script>')
--SET @lookFor = QUOTENAME('<script src=http://www.adw95.com/b.js></script>')
SET @lookFor = QUOTENAME('<script src=http://www.script46.com/b.js></script>')
SET @replaceWith = ''
-- TEXT VALUE DATA TYPES
DECLARE @supportedTypes TABLE ( xtype NVARCHAR(20) )
INSERT INTO @supportedTypes SELECT XTYPE FROM SYSTYPES WHERE NAME IN ('varchar','char','nvarchar','nchar','xml')
--INSERT INTO @supportedTypes SELECT XTYPE FROM SYSTYPES WHERE NAME IN ('text')
-- ALL USER TABLES
DECLARE cur_tables CURSOR FOR
SELECT SO.name, SO.id FROM SYSOBJECTS SO WHERE XTYPE='U'
OPEN cur_tables
FETCH NEXT FROM cur_tables INTO @tblName, @tblID
WHILE @@FETCH_STATUS = 0
BEGIN
-------------------------------------------------------------------------------------------
-- START INNER LOOP - All text columns, generate statement
-------------------------------------------------------------------------------------------
DECLARE @temp VARCHAR(max)
DECLARE @count INT
SELECT @count = COUNT(name) FROM SYSCOLUMNS WHERE ID = @tblID AND
XTYPE IN (SELECT xtype FROM @supportedTypes)
IF @count > 0
BEGIN
-- fetch supported columns for table
DECLARE cur_columns CURSOR FOR
SELECT name FROM SYSCOLUMNS WHERE ID = @tblID AND
XTYPE IN (SELECT xtype FROM @supportedTypes)
OPEN cur_columns
FETCH NEXT FROM cur_columns INTO @colName
-- generate opening UPDATE cmd
SET @temp = '
PRINT ''Replacing ' + @tblName + '''
UPDATE ' + @tblName + ' SET
'
SET @first = 1
-- loop through columns and create replaces
WHILE @@FETCH_STATUS = 0
BEGIN
IF (@first=0) SET @temp = @temp + ',
'
SET @temp = @temp + @colName
SET @temp = @temp + ' = REPLACE(' + @colName + ','''
SET @temp = @temp + @lookFor
SET @temp = @temp + ''','''
SET @temp = @temp + @replaceWith
SET @temp = @temp + ''')'
SET @first = 0
FETCH NEXT FROM cur_columns INTO @colName
END
PRINT @temp
CLOSE cur_columns
DEALLOCATE cur_columns
END
-------------------------------------------------------------------------------------------
-- END INNER
-------------------------------------------------------------------------------------------
FETCH NEXT FROM cur_tables INTO @tblName, @tblID
END
CLOSE cur_tables
DEALLOCATE cur_tables
</code></pre>
| [
{
"answer_id": 39790,
"author": "svandragt",
"author_id": 997,
"author_profile": "https://Stackoverflow.com/users/997",
"pm_score": 3,
"selected": true,
"text": " -- PREPARE\n SET NOCOUNT ON\n\n -- VARIABLES\n DECLARE @tblName NVARCHAR(150)\n DECLARE @colName NVARCHAR(150)... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39674",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/997/"
] |
39,727 | <p>What .NET namespace or class includes both Context.Handler and Server.Transfer?</p>
<p>I think one may include both and my hunt on MSDN returned null. </p>
| [
{
"answer_id": 39733,
"author": "FlySwat",
"author_id": 1965,
"author_profile": "https://Stackoverflow.com/users/1965",
"pm_score": 2,
"selected": false,
"text": "HttpContext.Current.Handler\nHttpContext.Current.Request.Server.Transfer\n"
},
{
"answer_id": 40117,
"author": "F... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4140/"
] |
39,742 | <p>Browsing through the git documentation, I can't see anything analogous to SVN's commit hooks or the "propset" features that can, say, update a version number or copyright notice within a file whenever it is committed to the repository.</p>
<p>Are git users expected to write external scripts for this sort of functionality (which doesn't seem out of the question) or have I just missed something obvious?</p>
<p><em>Edit</em> : Just to be clear, I'm more interested in, e.g.,</p>
<pre><code>svn propset svn:keywords "Author Date Id Revision" expl3.dtx
</code></pre>
<p>where a string like this:</p>
<pre><code>$Id: expl3.dtx 780 2008-08-30 12:32:34Z morten $
</code></pre>
<p>is kept up-to-date with the relevant info whenever a commit occurs.</p>
| [
{
"answer_id": 78890,
"author": "emk",
"author_id": 12089,
"author_profile": "https://Stackoverflow.com/users/12089",
"pm_score": 4,
"selected": false,
"text": "git describe"
},
{
"answer_id": 41815719,
"author": "superk",
"author_id": 2821963,
"author_profile": "http... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4161/"
] |
39,746 | <p>I installed TortoiseHg (Mercurial) in my Vista 64-bit and the context menu is not showing up when I right click a file or folder.
Is there any workaround for this problem?</p>
| [
{
"answer_id": 39764,
"author": "David Webb",
"author_id": 3171,
"author_profile": "https://Stackoverflow.com/users/3171",
"pm_score": 1,
"selected": false,
"text": "Target: %windir%\\syswow64\\explorer.exe /separate \nStart In: %windir%\\syswow64\\ \n"
},
{
"answer_id": 224136,
... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4264/"
] |
39,753 | <p>Is it possible to cache database connections when using PHP like you would in a J2EE container? If so, how?</p>
| [
{
"answer_id": 3819681,
"author": "darpet",
"author_id": 312741,
"author_profile": "https://Stackoverflow.com/users/312741",
"pm_score": 6,
"selected": false,
"text": "mysql_pconnect"
},
{
"answer_id": 55300921,
"author": "Amir Fo",
"author_id": 7580839,
"author_profi... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4263/"
] |
39,770 | <p>Things like <code>$log$</code> and <code>$version$</code> which add data upon check-in to the file. I'm interested in seeing the other ones and what information they can provide, but I can't get much info unless I know what they are called.</p>
| [
{
"answer_id": 39786,
"author": "David Webb",
"author_id": 3171,
"author_profile": "https://Stackoverflow.com/users/3171",
"pm_score": 4,
"selected": true,
"text": "Keywords"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/39770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572/"
] |
39,771 | <p>Is a GUID unique 100% of the time?</p>
<p>Will it stay unique over multiple threads?</p>
| [
{
"answer_id": 2062754,
"author": "Jonas Engström",
"author_id": 7634,
"author_profile": "https://Stackoverflow.com/users/7634",
"pm_score": 6,
"selected": false,
"text": "\\\\?\\Volume{23005604-eb1b-11de-85ba-806d6172696f}\\ (F:)\n\\\\?\\Volume{23005605-eb1b-11de-85ba-806d6172696f}\\ (G... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2469/"
] |
39,792 | <p>I have an SQL query that takes the following form:</p>
<pre><code>UPDATE foo
SET flag=true
WHERE id=?
</code></pre>
<p>I also have a PHP array which has a list of IDs. What is the best way to accomplish this other than with parsing, as follows, ...</p>
<pre><code>foreach($list as $item){
$querycondition = $querycondition . " OR " . $item;
}
</code></pre>
<p>... and using the output in the <code>WHERE</code> clause?</p>
| [
{
"answer_id": 39802,
"author": "matt b",
"author_id": 4249,
"author_profile": "https://Stackoverflow.com/users/4249",
"pm_score": 3,
"selected": false,
"text": "UPDATE foo\nSET flag=true\nWHERE id in (1, 2, 3, 5, 6)"
},
{
"answer_id": 39805,
"author": "Forgotten Semicolon",
... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4224/"
] |
39,824 | <p>I'm debugging a production application that has a rash of empty catch blocks <em>sigh</em>:</p>
<pre><code>try {*SOME CODE*}
catch{}
</code></pre>
<p>Is there a way of seeing what the exception is when the debugger hits the catch in the IDE?</p>
| [
{
"answer_id": 39833,
"author": "John Rutherford",
"author_id": 3880,
"author_profile": "https://Stackoverflow.com/users/3880",
"pm_score": 1,
"selected": false,
"text": "catch (Exception ex) { }\n"
},
{
"answer_id": 39834,
"author": "Nick Berardi",
"author_id": 17,
"... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4271/"
] |
39,843 | <p>I have decided that all my WPF pages need to register a routed event. Rather than include</p>
<pre><code>public static readonly RoutedEvent MyEvent= EventManager.RegisterRoutedEvent("MyEvent", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(BasePage));
</code></pre>
<p>on every page, I decided to create a base page (named BasePage). I put the above line of code in my base page and then changed a few of my other pages to derive from BasePage. I can't get past this error:</p>
<blockquote>
<p>Error 12 'CTS.iDocV7.BasePage' cannot
be the root of a XAML file because it
was defined using XAML. Line 1
Position
22. C:\Work\iDoc7\CTS.iDocV7\UI\Quality\QualityControlQueuePage.xaml 1 22 CTS.iDocV7</p>
</blockquote>
<p>Does anyone know how to best create a base page when I can put events, properties, methods, etc that I want to be able to use from any wpf page?</p>
| [
{
"answer_id": 40868,
"author": "Matt Hamilton",
"author_id": 615,
"author_profile": "https://Stackoverflow.com/users/615",
"pm_score": 6,
"selected": true,
"text": "public class PigFinderPage : Page\n{\n /* add custom events and properties here */\n}\n"
},
{
"answer_id": 3249... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3047/"
] |
39,855 | <p>Is it possible to embed a PowerPoint presentation (.ppt) into a webpage (.xhtml)?</p>
<p>This will be used on a local intranet where there is a mix of Internet Explorer 6 and Internet Explorer 7 only, so no need to consider other browsers.</p>
<hr>
<p>I've given up... I guess Flash is the way forward.</p>
| [
{
"answer_id": 1694704,
"author": "Steve Pasetti",
"author_id": 205818,
"author_profile": "https://Stackoverflow.com/users/205818",
"pm_score": 8,
"selected": true,
"text": "<iframe src=\"//docs.google.com/gview?url=https://www.yourwebsite.com/powerpoint.ppt&embedded=true\" style=\"width... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383/"
] |
39,856 | <p>I have an actionscript file that defines a class that I would like to use inside a Flex application. </p>
<p>I have defined some custom controls in a actionscript file and then import them via the application tag:</p>
<pre>
<code>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:scorecard="com.apterasoftware.scorecard.controls.*"
...
</mx:Application>
</code>
</pre>
<p>but this code is not a flex component, rather it is a library for performing math routines, how do I import this class?</p>
| [
{
"answer_id": 39864,
"author": "Herms",
"author_id": 1409,
"author_profile": "https://Stackoverflow.com/users/1409",
"pm_score": 4,
"selected": true,
"text": "<mx:Application\n xmlns:mx=\"http://www.adobe.com/2006/mxml\">\n <mx:Script>\n import com.apterasoftware.scorecard.controls... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1638/"
] |
39,867 | <p>I have a script that has a part that looks like that:</p>
<pre><code>for file in `ls *.tar.gz`; do
echo encrypting $file
gpg --passphrase-file /home/$USER/.gnupg/backup-passphrase \
--simple-sk-checksum -c $file
done
</code></pre>
<p>For some reason if I run this script manually, works perfectly fine and all files are encrypted. If I run this as cron job, <code>echo $file</code> works fine (I see "encrypting <file>" in the log), but the file doesn't get encrypted and gpg silent fails with no stdout/stderr output.</p>
<p>Any clues?</p>
| [
{
"answer_id": 39898,
"author": "skinp",
"author_id": 2907,
"author_profile": "https://Stackoverflow.com/users/2907",
"pm_score": 0,
"selected": false,
"text": "echo whereis gpg"
},
{
"answer_id": 39917,
"author": "Grey Panther",
"author_id": 1265,
"author_profile": "... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39867",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3105/"
] |
39,874 | <p>What data structures would you use to represent a chessboard for a computer chess program?</p>
| [
{
"answer_id": 39881,
"author": "slm",
"author_id": 4262,
"author_profile": "https://Stackoverflow.com/users/4262",
"pm_score": 3,
"selected": false,
"text": "1 white pawns\n2 white knights\n3 white bishops\n4 white rooks\n5 white queens\n6 white king\n\nBlack pieces use negative values\... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4262/"
] |
39,879 | <p>Is it a deliberate design decision or a problem with our current day browsers which will be rectified in the coming versions?</p>
| [
{
"answer_id": 39922,
"author": "pkaeding",
"author_id": 4257,
"author_profile": "https://Stackoverflow.com/users/4257",
"pm_score": 4,
"selected": false,
"text": "setTimeout(function () {\n ... do the rest of the work...\n}, 0);\n"
},
{
"answer_id": 39961,
"author": "Kami... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/184/"
] |
39,903 | <p>Why does Visual Studio declare new classes as private in C#? I almost always switch them over to public, am I the crazy one?</p>
| [
{
"answer_id": 39911,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 4,
"selected": false,
"text": "using System;\nusing System.Collections.Generic;\n$if$ ($targetframeworkversion$ == 3.5)using System.Linq;\n$endif$using System.... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/632/"
] |
39,910 | <p>I want to use the MultipleLookupField control in a web page that will run in the context of SharePoint. I was wondering if anyone would help me with an example, which shows step by step how to use the control two display two SPField Collections.</p>
| [
{
"answer_id": 40929,
"author": "Matt Bishop",
"author_id": 4301,
"author_profile": "https://Stackoverflow.com/users/4301",
"pm_score": 3,
"selected": true,
"text": "Label l;\nMultipleLookupField mlf;\n\nprotected override void CreateChildControls()\n{\n base.CreateChildControls();\n ... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1360/"
] |
39,912 | <p>I was looking at the API documentation for stl vector, and noticed there was no method on the vector class that allowed the removal of an element with a certain value. This seems like a common operation, and it seems odd that there's no built in way to do this.</p>
| [
{
"answer_id": 39923,
"author": "bradtgmurray",
"author_id": 1546,
"author_profile": "https://Stackoverflow.com/users/1546",
"pm_score": 4,
"selected": false,
"text": "std::vector<int> v;\nv.push_back(1);\nv.push_back(2);\n\n//Vector should contain the elements 1, 2\n\n//Find new end ite... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1546/"
] |
39,915 | <p>There are several types of objects in a system, and each has it's own table in the database. A user should be able to comment on any of them. How would you design the comments table(s)? I can think of a few options:</p>
<ol>
<li>One comments table, with a FK column for each object type (ObjectAID, ObjectBID, etc)</li>
<li>Several comments tables, one for each object type (ObjectAComments, ObjectBComments, etc)</li>
<li>One generic FK (ParentObjectID) with another column to indicate the type ("ObjectA")</li>
</ol>
<p>Which would you choose? Is there a better method I'm not thinking of?</p>
| [
{
"answer_id": 39997,
"author": "Hank Gay",
"author_id": 4203,
"author_profile": "https://Stackoverflow.com/users/4203",
"pm_score": 2,
"selected": true,
"text": "ObjectAID"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/39915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/521/"
] |
39,916 | <p>Is there a programmatic way to build <em>htpasswd</em> files, without depending on OS specific functions (i.e. <code>exec()</code>, <code>passthru()</code>)?</p>
| [
{
"answer_id": 39963,
"author": "Greg Roberts",
"author_id": 4269,
"author_profile": "https://Stackoverflow.com/users/4269",
"pm_score": 6,
"selected": true,
"text": "foo:$apr1$y1cXxW5l$3vapv2yyCXaYz8zGoXj241\n"
},
{
"answer_id": 53006,
"author": "Darryl Hein",
"author_id... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115/"
] |
39,928 | <p>I'm getting a <strong><code>Connection Busy With Results From Another Command</code></strong> error from a SQLServer Native Client driver when a SSIS package is running. Only when talking to SQLServer 2000. A different part that talks to SQLServer 2005 seems to always run fine. Any thoughts?</p>
| [
{
"answer_id": 40105,
"author": "Craig",
"author_id": 2894,
"author_profile": "https://Stackoverflow.com/users/2894",
"pm_score": 2,
"selected": true,
"text": "Server: Msg 7399, Level 16, State 1, Procedure <storedProcedureName>, Line 18 OLE DB provider 'SQLOLEDB' reported an error. \nOL... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2978/"
] |
39,946 | <p>I'm trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definitions on Wikipedia <a href="http://en.wikipedia.org/wiki/Coupling_%28computer_science%29" rel="noreferrer">here</a> and <a href="http://en.wikipedia.org/wiki/Cohesion_%28computer_science%29" rel="noreferrer">here</a>)? How do they interact?</p>
<p>Thanks.</p>
<p>Anybody have a good, short example?</p>
| [
{
"answer_id": 39976,
"author": "Hank Gay",
"author_id": 4203,
"author_profile": "https://Stackoverflow.com/users/4203",
"pm_score": 2,
"selected": false,
"text": "import"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/39946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1772/"
] |
39,960 | <p>In Python one can get a dictionary of all local and global variables in the current scope with the built-in functions <code>locals()</code> and <code>globals()</code>. Is there some equivalent way of doing this in Javascript? For instance, I would like to do something like the following:</p>
<pre><code>var foo = function(){ alert('foo'); };
var bar = function(){ alert('bar'); };
var s = 'foo';
locals()[s](); // alerts 'foo'
</code></pre>
<p>Is this at all possible, or should I just be using a local object for the lookup?</p>
| [
{
"answer_id": 39982,
"author": "Bartosz Bierkowski",
"author_id": 3666,
"author_profile": "https://Stackoverflow.com/users/3666",
"pm_score": 2,
"selected": false,
"text": "eval(s+\"()\");\n"
},
{
"answer_id": 39992,
"author": "Grey Panther",
"author_id": 1265,
"auth... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/208/"
] |
39,977 | <p>I know how to use tags in subversion. I create a tag every time I get to a release milestone.</p>
<p>What I don't quite understand is how they work. </p>
<p>Is a tag just a copy, made from what ever revision I specify? Or is a tag more like a reference, where internally subversion just says <code>GO TO /trunk/project/ Revision 5</code> or whatever.</p>
<p>The command to create a tag (<code>svn copy</code>) seems to imply that it's a copy, but I've seen other people write that subversion doesn't really copy anything.</p>
<p>Say I dump just the HEAD revision of a repository. I don't care about any history except the tags. Are those tags dumped along with the rest of the Head revision?</p>
<p>Finally, is all this just programming magic that I don't really want to know.</p>
| [
{
"answer_id": 39980,
"author": "Chris Conway",
"author_id": 1412,
"author_profile": "https://Stackoverflow.com/users/1412",
"pm_score": 2,
"selected": false,
"text": "svn copy trunk tags/BLAH\n"
},
{
"answer_id": 18407691,
"author": "Jorgesys",
"author_id": 250260,
"... | 2008/09/02 | [
"https://Stackoverflow.com/questions/39977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30/"
] |
39,983 | <p>Reading through <a href="https://stackoverflow.com/questions/39879/why-doesnt-javascript-support-multithreading">this question</a> on multi-threaded javascript, I was wondering if there would be any security implications in allowing javascript to spawn mutliple threads. For example, would there be a risk of a malicious script repeatedly spawning thread after thread in an attempt to overwhelm the operating system or interpreter and trigger entrance into "undefined behavior land", or is it pretty much a non-issue? Any other ways in which an attack might exploit a hypothetical implementation of javascript that supports threads that a non-threading implementation would be immune to?</p>
<p><strong>Update:</strong> Note that locking up a browser isn't the same as creating an undefined behavior exploit. </p>
| [
{
"answer_id": 40024,
"author": "Shog9",
"author_id": 811,
"author_profile": "https://Stackoverflow.com/users/811",
"pm_score": 1,
"selected": false,
"text": "Worker"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/39983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3043/"
] |
40,022 | <p>I'm using LINQ to SQL classes in a project where the database design is still in a bit of flux.</p>
<p>Is there an easy way of synchronising the classes with the schema, or do I need to manually update the classes if a table design changes?</p>
| [
{
"answer_id": 40029,
"author": "vzczc",
"author_id": 224,
"author_profile": "https://Stackoverflow.com/users/224",
"pm_score": 7,
"selected": true,
"text": "C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Bin\\x64\\sqlmetal.exe \n /server:<SERVER> \n /database:<database> \n /code:... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4048/"
] |
40,026 | <p>As the title says, is there a way to run the same Adobe AIR app more than once? I have a little widget I wrote that shows thumbnails from a couple of photo streams, and I'd like to fix it so I can look at more than one stream at a time. Thanks!</p>
| [
{
"answer_id": 40091,
"author": "Todd Rowan",
"author_id": 3473,
"author_profile": "https://Stackoverflow.com/users/3473",
"pm_score": 2,
"selected": false,
"text": "<application xmlns=\"http://ns.adobe.com/air/application/1.0\">\n <id>ApplicationID</id>\n"
},
{
"answer_id": 3495... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4252/"
] |
40,028 | <p>I think it can be done by applying the transformation matrix of the scenegraph to z-normal (0, 0, 1), but it doesn't work. My code goes like this:</p>
<pre><code>Vector3f toScreenVector = new Vector3f(0, 0, 1);
Transform3D t3d = new Transform3D();
tg.getTransform(t3d); //tg is Transform Group of all objects in a scene
t3d.transform(toScreenVector);
</code></pre>
<p>Then I tried something like this too:</p>
<pre><code>Point3d eyePos = new Point3d();
Point3d mousePos = new Point3d();
canvas.getCenterEyeInImagePlate(eyePos);
canvas.getPixelLocationInImagePlate(new Point2d(Main.WIDTH/2, Main.HEIGHT/2), mousePos); //Main is the class for main window.
Transform3D motion = new Transform3D();
canvas.getImagePlateToVworld(motion);
motion.transform(eyePos);
motion.transform(mousePos);
Vector3d toScreenVector = new Vector3f(eyePos);
toScreenVector.sub(mousePos);
toScreenVector.normalize();
</code></pre>
<p>But still this doesn't work correctly. I think there must be an easy way to create such vector. Do you know what's wrong with my code or better way to do so?</p>
| [
{
"answer_id": 40666,
"author": "caramelcarrot",
"author_id": 3877,
"author_profile": "https://Stackoverflow.com/users/3877",
"pm_score": 2,
"selected": false,
"text": "INVERT"
},
{
"answer_id": 41231,
"author": "puri",
"author_id": 3388,
"author_profile": "https://St... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3388/"
] |
40,043 | <p>How can I create a new database from my C# application?</p>
<p>I'm assuming once I create it, I can simply generate a connection string on the fly and connect to it, and the issue all the CREATE TABLE statements.</p>
| [
{
"answer_id": 40061,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 5,
"selected": true,
"text": "String str;\nSqlConnection myConn = new SqlConnection (\"Server=localhost;Integrated security=SSPI;database=master\");\n\nstr = \... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3314/"
] |
40,054 | <p>Code below does not run correctly and throws <code>InvalidOperationExcepiton</code>.</p>
<pre><code>public void Foo()
{
DataContext context = new DataContext();
LinqEntity item = new LinqEntity(){ Id = 1, Name = "John", Surname = "Doe"} ;
context.LinqEntities.Attach(item, true);
}
</code></pre>
| [
{
"answer_id": 40079,
"author": "Adam Lassek",
"author_id": 1249,
"author_profile": "https://Stackoverflow.com/users/1249",
"pm_score": 1,
"selected": false,
"text": "context.LinqEntities.InsertOnSubmit(item);\ncontext.Submit();\n"
},
{
"answer_id": 40108,
"author": "Adam Las... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40054",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4215/"
] |
40,075 | <p>I am writing a few extensions to mimic the map and reduce functions in Lisp.</p>
<pre><code>public delegate R ReduceFunction<T,R>(T t, R previous);
public delegate void TransformFunction<T>(T t, params object[] args);
public static R Reduce<T,R>(this List<T> list, ReduceFunction<T,R> r, R initial)
{
var aggregate = initial;
foreach(var t in list)
aggregate = r(t,aggregate);
return aggregate;
}
public static void Transform<T>(this List<T> list, TransformFunction<T> f, params object [] args)
{
foreach(var t in list)
f(t,args);
}
</code></pre>
<p>The transform function will cut down on cruft like:</p>
<pre><code>foreach(var t in list)
if(conditions && moreconditions)
//do work etc
</code></pre>
<p>Does this make sense? Could it be better?</p>
| [
{
"answer_id": 40084,
"author": "Jake Pearson",
"author_id": 632,
"author_profile": "https://Stackoverflow.com/users/632",
"pm_score": 2,
"selected": false,
"text": "public static R Reduce<T,R>(this IEnumerable<T> list, Func<T,R> r, R initial)\n{\n var aggregate = initial;\n fore... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1455/"
] |
40,090 | <p>Is it true that the only way to handle default function arguments is through function overloading?</p>
<p>For example, in PHP I can do this:</p>
<pre><code>function foo($x, $y=0)
{
}
</code></pre>
<p>Would the best way to handle it in C# be this?</p>
<pre><code>void foo(int x)
{
foo(x, 0);
}
void foo(int x, int y)
{
}
</code></pre>
<p><strong><em><a href="http://bytes.com/forum/thread224970.html" rel="noreferrer">Example lifted from here</a></em></strong></p>
<p>Edit</p>
<p><strong><em>Made the C# example into actual C# (Thanks Blair Conrad)</em></strong></p>
| [
{
"answer_id": 40093,
"author": "Blair Conrad",
"author_id": 1199,
"author_profile": "https://Stackoverflow.com/users/1199",
"pm_score": 4,
"selected": true,
"text": "$"
},
{
"answer_id": 696656,
"author": "gazhay",
"author_id": 84545,
"author_profile": "https://Stack... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40090",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305/"
] |
40,107 | <p>I imagine everyone has seen code like:</p>
<pre><code>public void Server2ClientEnumConvert( ServerEnum server)
{
switch(server)
{
case ServerEnum.One:
return ClientEnum.ABC
//And so on.
</code></pre>
<p>Instead of this badness we could do somthing like:</p>
<pre><code>public enum ServerEnum
{
[Enum2Enum(ClientEnum.ABC)]
One,
}
</code></pre>
<p>Now we can use reflection to rip through ServerEnum and get the conversion mappings from the enum declaration itself.</p>
<p>The problem I am having here is in the declaration of the Enum2Enum attribute.</p>
<p>This works but replacing object o with Enum e does not. I do not want to be able to pass in objects to the constructor, only other enums.</p>
<pre><code>public class EnumToEnumAttribute : Attribute
{
public EnumToEnumAttribute(object o){}
}
</code></pre>
<p>This fails to compile.</p>
<pre><code>public class EnumToEnumAttribute : Attribute
{
public EnumToEnumAttribute(Enum e){}
}
</code></pre>
<p>Is there a reason for the compile error? How else could I pass in the information needed to map besides: </p>
<pre><code>EnumtoEnumAttribute(Type dest, string enumString)
</code></pre>
<p>This seems too verbose but if it is the only way then I guess I will use it.</p>
| [
{
"answer_id": 398461,
"author": "Scott Dorman",
"author_id": 1559,
"author_profile": "https://Stackoverflow.com/users/1559",
"pm_score": 2,
"selected": false,
"text": "public enum ServerEnum\n{\n One = ClientEnum.ABC,\n}\n"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/40107",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1455/"
] |
40,112 | <p>I've got an MS-Access app (1/10th MS-Acccess, 9/10ths MS-SQL) that needs to display photographs of some assets along with their specifications. Currently the images are stored in an MS-Access table as an OLE Object (and copy-n-pasted into the field by the users).</p>
<p>For various reasons, I would like to do is store the original .jpgs in a folder on the network drive, and reference them from the application portion. I have considered moving into MS-SQL's image data type (and its replacement varbinary), but I think my user population will more easily grasp the concept of the network folder.</p>
<p>How can I get MS Access to display the contents of a .jpg?</p>
| [
{
"answer_id": 41036,
"author": "WaterBoy",
"author_id": 3270,
"author_profile": "https://Stackoverflow.com/users/3270",
"pm_score": 4,
"selected": true,
"text": "Private Sub cmdNextClick()\n DoCmd.GoToRecord , , acNext\n txtPhoto.SetFocus\n imgPicture.Picture = txtPhoto.Text\n ... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/685/"
] |
40,116 | <p>How do I get it to work with my project?</p>
<p><a href="http://ajax.asp.net/" rel="noreferrer">http://ajax.asp.net/</a></p>
<p><a href="http://www.codeplex.com/AjaxControlToolkit/" rel="noreferrer">http://www.codeplex.com/AjaxControlToolkit/</a></p>
| [
{
"answer_id": 40118,
"author": "Zack Peterson",
"author_id": 83,
"author_profile": "https://Stackoverflow.com/users/83",
"pm_score": 5,
"selected": false,
"text": "<?xml version=\"1.0\"?>\n<configuration>\n ...\n <system.web>\n ...\n <pages>\n ...\n ... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40116",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/83/"
] |
40,119 | <p>How do you find a memory leak in Java (using, for example, JHat)? I have tried to load the heap dump up in JHat to take a basic look. However, I do not understand how I am supposed to be able to find the root reference (<a href="https://stackoverflow.com/questions/104/anatomy-of-a-memory-leak">ref</a>) or whatever it is called. Basically, I can tell that there are several hundred megabytes of hash table entries ([java.util.HashMap$Entry or something like that), but maps are used all over the place... Is there some way to search for large maps, or perhaps find general roots of large object trees?</p>
<p>[Edit]
Ok, I've read the answers so far but let's just say I am a cheap bastard (meaning I am more interested in learning how to use JHat than to pay for JProfiler). Also, JHat is always available since it is part of the JDK. Unless of course there is no way with JHat but brute force, but I can't believe that can be the case.</p>
<p>Also, I do not think I will be able to actually modify (adding logging of <em>all</em> map sizes) and run it for long enough for me to notice the leak.</p>
| [
{
"answer_id": 31018959,
"author": "Alex Punnen",
"author_id": 429476,
"author_profile": "https://Stackoverflow.com/users/429476",
"pm_score": 4,
"selected": false,
"text": "su proceeuser\n/bin/jmap -dump:live,format=b,file=/tmp/2930javaheap.hrpof 2930(pid of process)\n"
},
{
"a... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4208/"
] |
40,122 | <p>My group is developing a service-based (.NET WCF) application and we're trying to decide how to handle exceptions in our internal services. Should we throw exceptions? Return exceptions serialized as XML? Just return an error code?</p>
<p>Keep in mind that the user will never see these exceptions, it's only for other parts of the application.</p>
| [
{
"answer_id": 40170,
"author": "FlySwat",
"author_id": 1965,
"author_profile": "https://Stackoverflow.com/users/1965",
"pm_score": 3,
"selected": true,
"text": "SoapFaults"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/40122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4219/"
] |
40,125 | <p>I'm trying to get a Firefox plugin to read data from a HTTP get, parse the results and present them as links in a bookmark-like drop-down menu.</p>
<p>My quesion then is: Does anyone have any sample code that will do this?</p>
| [
{
"answer_id": 40167,
"author": "Robert J. Walker",
"author_id": 4287,
"author_profile": "https://Stackoverflow.com/users/4287",
"pm_score": 2,
"selected": false,
"text": "var xmlhttp = new XMLHttpRequest();\nxmlhttp.open(\"GET\", url, true);\n\nxmlhttp.onreadystatechange = function() {\... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40125",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4165/"
] |
40,132 | <p>I've got a situation where I have a main form that pops up an advanced configuration form that just has half a dozen matched check boxes and combo boxes to select some advanced options (the check boxes to enable/disable, the combo to select a media if enabled).</p>
<p>If I just pass the individual settings for the check and combo boxes in to the constructor for the dialog that's obviously a dozen arguments, which seems a bit excessive.</p>
<p>My other obvious option would be since in the main form these settings are stored in a large IDictionary with all the other main form settings I could just pass this dictionary in and fetch it back afterward with the updated values, but my understanding is that this wouldn't really be very good coding practice.</p>
<p>Am I missing a good way to do this that is both efficient and good coding practice?</p>
<p>(this particular code is in C#, although I have a feeling a general solution would apply to other languages as well)</p>
| [
{
"answer_id": 40149,
"author": "Chris Marasti-Georg",
"author_id": 96,
"author_profile": "https://Stackoverflow.com/users/96",
"pm_score": 0,
"selected": false,
"text": "MyConfigurationDialog dialog = new MyConfigurationDialog();\n\n//Copy the dictionary so that the dialog can't mess wi... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1512/"
] |
40,133 | <p>I have been experimenting with <a href="http://www.woopra.com/" rel="nofollow noreferrer">woopra.com</a> A web analytics tool. Which requires a piece of javascript code to be added to each page to function. This is easy enough with more dynamic sites with universal headers or footers but not for totally static html pages.</p>
<p>I attempted to work round it by using a combination of Apache rewrites and SSI's to "Wrap" the static html with the required code. For example...</p>
<p>I made the following changes to my apache config</p>
<pre><code> RewriteEngine On
RewriteCond %{REQUEST_URI} !=test.shtml
RewriteCond %{IS_SUBREQ} false
RewriteRule (.*)\.html test.shtml?$1.html
</code></pre>
<p>The test.shtml file contains...</p>
<pre><code> <script type="text/javascript">
var XXXXid = 'xxxxxxx';
</script>
<script src="http://xxxx.woopra.com/xx/xxx.js"></script>
<!--#set var="page" value="$QUERY_STRING" -->
<!--#include virtual= $page -->
</code></pre>
<p>The idea was that a request coming in for</p>
<pre><code> /abc.html
</code></pre>
<p>would be redirected to</p>
<pre><code> /test.shtml?abc.html
</code></pre>
<p>the shtml would then include the original file into the response page.</p>
<p>Unfortunately it doesn't quite work as planed :) can anyone see what I am doing wrong or perhaps suggest an alternative approach. Is there any apache modules that could do the same thing. Preferably that can be configured on a per site basis.</p>
<p>Thanks</p>
<p>Peter</p>
| [
{
"answer_id": 40156,
"author": "Grey Panther",
"author_id": 1265,
"author_profile": "https://Stackoverflow.com/users/1265",
"pm_score": 3,
"selected": true,
"text": "while (<>) {\n s/<html>/\\Q<script>....\\E/;\n print $_;\n}\n"
},
{
"answer_id": 490116,
"author": "Ala... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3720/"
] |
40,161 | <p>Does C# have built-in support for parsing strings of page numbers? By page numbers, I mean the format you might enter into a print dialog that's a mixture of comma and dash-delimited.</p>
<p>Something like this:</p>
<pre><code>1,3,5-10,12
</code></pre>
<p>What would be really nice is a solution that gave me back some kind of list of all page numbers represented by the string. In the above example, getting a list back like this would be nice:</p>
<pre><code>1,3,5,6,7,8,9,10,12
</code></pre>
<p>I just want to avoid rolling my own if there's an easy way to do it.</p>
| [
{
"answer_id": 40180,
"author": "Keith",
"author_id": 905,
"author_profile": "https://Stackoverflow.com/users/905",
"pm_score": 6,
"selected": true,
"text": "foreach( string s in \"1,3,5-10,12\".Split(',') ) \n{\n // try and get the number\n int num;\n if( int.TryParse( s, out n... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305/"
] |
40,169 | <p>I infrequently (monthly/quarterly) generate hundreds of Crystal Reports reports using Microsoft SQL Server 2005 database views. Are those views wasting CPU cycles and RAM during all the time that I am not reading from them? Should I instead use stored procedures, temporary tables, or short-lived normal tables since I rarely read from my views?</p>
<p>I'm not a DBA so I don't know what's going on behind the scenes inside the database server.</p>
<p>Is it possible to have too many database views? What's considered best practice?</p>
| [
{
"answer_id": 40191,
"author": "Sara Chipps",
"author_id": 4140,
"author_profile": "https://Stackoverflow.com/users/4140",
"pm_score": 2,
"selected": false,
"text": "Select * from customers where paid = 1\n"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/40169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/83/"
] |
40,193 | <p>I've got to get a directory listing that contains about 2 million files, but when I do an <code>ls</code> command on it nothing comes back. I've waited 3 hours. I've tried <code>ls | tee directory.txt</code>, but that seems to hang forever. </p>
<p>I assume the server is doing a lot of inode sorting. Is there any way to speed up the <code>ls</code> command to just get a directory listing of filenames? I don't care about size, dates, permission or the like at this time.</p>
| [
{
"answer_id": 40195,
"author": "Mark Biek",
"author_id": 305,
"author_profile": "https://Stackoverflow.com/users/305",
"pm_score": 1,
"selected": false,
"text": "find ./ -type f"
},
{
"answer_id": 40200,
"author": "Ryan Ahearn",
"author_id": 75,
"author_profile": "ht... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1536194/"
] |
40,211 | <p>I have a flag enum below.</p>
<pre><code>[Flags]
public enum FlagTest
{
None = 0x0,
Flag1 = 0x1,
Flag2 = 0x2,
Flag3 = 0x4
}
</code></pre>
<p>I cannot make the if statement evaluate to true.</p>
<pre><code>FlagTest testItem = FlagTest.Flag1 | FlagTest.Flag2;
if (testItem == FlagTest.Flag1)
{
// Do something,
// however This is never true.
}
</code></pre>
<p>How can I make this true?</p>
| [
{
"answer_id": 40213,
"author": "17 of 26",
"author_id": 2284,
"author_profile": "https://Stackoverflow.com/users/2284",
"pm_score": 3,
"selected": false,
"text": "if ((testItem & FlagTest.Flag1) == FlagTest.Flag1)\n{\n // Do something,\n // however This is never true.\n}\n"
},
... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2469/"
] |
40,244 | <p>Assume that I have programs <code>P0</code>, <code>P1</code>, ...<code>P(n-1)</code> for some <code>n > 0</code>. How can I easily redirect the output of program <code>Pi</code> to program <code>P(i+1 mod n)</code> for all <code>i</code> (<code>0 <= i < n</code>)?</p>
<p>For example, let's say I have a program <code>square</code>, which repeatedly reads a number and than prints the square of that number, and a program <code>calc</code>, which sometimes prints a number after which it expects to be able to read the square of it. How do I connect these programs such that whenever <code>calc</code> prints a number, <code>square</code> squares it returns it to <code>calc</code>?</p>
<p>Edit: I should probably clarify what I mean with "easily". The named pipe/fifo solution is one that indeed works (and I have used in the past), but it actually requires quite a bit of work to do properly if you compare it with using a bash pipe. (You need to get a not yet existing filename, make a pipe with that name, run the "pipe loop", clean up the named pipe.) Imagine you could no longer write <code>prog1 | prog2</code> and would always have to use named pipes to connect programs.</p>
<p>I'm looking for something that is almost as easy as writing a "normal" pipe. For instance something like <code>{ prog1 | prog2 } >&0</code> would be great.</p>
| [
{
"answer_id": 40644,
"author": "Douglas Leeder",
"author_id": 3978,
"author_profile": "https://Stackoverflow.com/users/3978",
"pm_score": 4,
"selected": false,
"text": "$ mkfifo outside\n$ <outside calc | square >outside &\n$ echo \"1\" >outside ## Trigger the loop to start\n"
},
{
... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4285/"
] |
40,264 | <p>Let's say you have a class called Customer, which contains the following fields:</p>
<ul>
<li>UserName</li>
<li>Email</li>
<li>First Name</li>
<li>Last Name</li>
</ul>
<p>Let's also say that according to your business logic, all Customer objects must have these four properties defined.</p>
<p>Now, we can do this pretty easily by forcing the constructor to specify each of these properties. But it's pretty easy to see how this can spiral out of control when you are forced to add more required fields to the Customer object. </p>
<p>I've seen classes that take in 20+ arguments into their constructor and it's just a pain to use them. But, alternatively, if you don't require these fields you run into the risk of having undefined information, or worse, object referencing errors if you rely on the calling code to specify these properties.</p>
<p>Are there any alternatives to this or do you you just have to decide whether X amount of constructor arguments is too many for you to live with?</p>
| [
{
"answer_id": 40284,
"author": "Brian Warshaw",
"author_id": 1344,
"author_profile": "https://Stackoverflow.com/users/1344",
"pm_score": 1,
"selected": false,
"text": "public function doSomethingWith($this = val1, $this = val2, $this = val3)"
},
{
"answer_id": 40289,
"author... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40264",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574/"
] |
40,269 | <p>Is there an easy way to find the storage card's path on a Windows Mobile device
when there is a storage card and a bluetooth ftp connection?</p>
| [
{
"answer_id": 661129,
"author": "Joel ",
"author_id": 79853,
"author_profile": "https://Stackoverflow.com/users/79853",
"pm_score": 4,
"selected": true,
"text": "using System;\nusing System.IO;\nusing System.Runtime.InteropServices;\n\nnamespace StorageCardInfo\n{\n class Program\n ... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4298/"
] |
40,273 | <p>A client of mine has asked me to integrate a 3rd party API into their Rails app. The only problem is that the API uses SOAP. Ruby has basically dropped SOAP in favor of REST. They provide a Java adapter that apparently works with the Java-Ruby bridge, but we'd like to keep it all in Ruby, if possible. I looked into soap4r, but it seems to have a slightly bad reputation.</p>
<p>So what's the best way to integrate SOAP calls into a Rails app?</p>
| [
{
"answer_id": 40961,
"author": "Orion Edwards",
"author_id": 234,
"author_profile": "https://Stackoverflow.com/users/234",
"pm_score": 6,
"selected": true,
"text": "soap/wsdlDriver"
},
{
"answer_id": 35152994,
"author": "Raja",
"author_id": 3999718,
"author_profile":... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2884/"
] |
40,302 | <p>Let's say I'm building a data access layer for an application. Typically I have a class definition for a each kind of object that is stored in the database. Of course, the actual data access retrieves data in the form of a datareader, typed or untyped dataset, or similar, usually with the data needed to create one object per row in the results.</p>
<p>How would you go about creating your object instances in the data layer? Would have a constructor that accepts a datarow? If so, how would you make that type-safe? Or would you have your constructor list out one parameter for each field you want to instantiate, even if there could be many fields? Would you mark this constructor 'internal'?</p>
| [
{
"answer_id": 41034,
"author": "David Basarab",
"author_id": 2469,
"author_profile": "https://Stackoverflow.com/users/2469",
"pm_score": 2,
"selected": false,
"text": "private T ObjectFromRow(DataRow row)\n{\n Type t = typeof(T);\n\n T newObj = (T)Activator.CreateInstance(t);\n\n\... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3043/"
] |
40,317 | <p>I have an NFS-mounted directory on a Linux machine that has hung. I've tried to force an unmount, but it doesn't seem to work:</p>
<pre><code>$ umount -f /mnt/data
$ umount2: Device or resource busy
$ umount: /mnt/data: device is busy
</code></pre>
<p>If I type "<code>mount</code>", it appears that the directory is no longer mounted, but it hangs if I do "<code>ls /mnt/data</code>", and if I try to remove the mountpoint, I get:</p>
<pre><code>$ rmdir /mnt/data
rmdir: /mnt/data: Device or resource busy
</code></pre>
<p>Is there anything I can do other than reboot the machine?</p>
| [
{
"answer_id": 40320,
"author": "tessein",
"author_id": 3075,
"author_profile": "https://Stackoverflow.com/users/3075",
"pm_score": 9,
"selected": true,
"text": "umount -l\n"
},
{
"answer_id": 40331,
"author": "Ryan Ahearn",
"author_id": 75,
"author_profile": "https:/... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/742/"
] |
40,335 | <p>I'm need to find a method to programmatically determine which disk drive Windows is using to boot. In other words, I need a way from Windows to determine which drive the BIOS is using to boot the whole system. </p>
<p>Does Windows expose an interface to discover this? With how big the Windows API is, I'm hoping there is something buried in there that might do the trick.</p>
<p>Terry</p>
<p>p.s. Just reading the first sectors of the hard disk isn't reveling anything. On my dev box I have two hard disks, and when I look at the contents of the first couple of sectors on either of the hard disks I have a standard boiler plate MBR.</p>
<p>Edit to clarify a few things.
The way I want to identify the device is with a string which will identify a physical disk drive (as opposed to a logical disk drive). Physical disk drives are of the form "\\.\PHYSICALDRIVEx" where x is a number. On the other hand, a logical drive is identified by a string of the form, "\\.\x" where x is a drive letter.</p>
<p>Edit to discuss a few of the ideas that were thrown out.
Knowing which logical volume Windows used to boot doesn't help me here. Here is the reason. Assume that C: is using a mirrored RAID setup. Now, that means we have at least two physical drives. Now, I get the mapping from Logical Drive to Physical Drive and I discover that there are two physical drives used by that volume. Which one did Windows use to boot? Of course, this is assuming that the physical drive Windows used to boot is the same physical drive that contains the MBR. </p>
| [
{
"answer_id": 18424806,
"author": "JD.",
"author_id": 300041,
"author_profile": "https://Stackoverflow.com/users/300041",
"pm_score": 4,
"selected": false,
"text": "Control Panel"
},
{
"answer_id": 34293003,
"author": "ST3",
"author_id": 1237747,
"author_profile": "h... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2171/"
] |
40,352 | <p>And why would I use one over the other in my code?</p>
| [
{
"answer_id": 40366,
"author": "Rytmis",
"author_id": 266,
"author_profile": "https://Stackoverflow.com/users/266",
"pm_score": 5,
"selected": true,
"text": "Type"
},
{
"answer_id": 1438443,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackover... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1946/"
] |
40,361 | <p>I have an application which extracts data from an XML file using XPath. If a node in that XML source file is missing I want to return the value "N/A" (much like the Oracle NVL function). The trick is that the application doesn't support XSLT; I'd like to do this using XPath and XPath alone.</p>
<p>Is that possible?</p>
| [
{
"answer_id": 41142,
"author": "jelovirt",
"author_id": 2679,
"author_profile": "https://Stackoverflow.com/users/2679",
"pm_score": 1,
"selected": false,
"text": "<foo>\n <bar/>\n</foo>\n"
},
{
"answer_id": 41152,
"author": "jelovirt",
"author_id": 2679,
"author_pro... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1019/"
] |
40,368 | <p>Is there a maximum number of inodes in a single directory? </p>
<p>I have a directory of over 2 million files and can't get the <code>ls</code> command to work against that directory. So now I'm wondering if I've exceeded a limit on inodes in Linux. Is there a limit before a 2^64 numerical limit?</p>
| [
{
"answer_id": 40389,
"author": "Jordi Bunster",
"author_id": 4272,
"author_profile": "https://Stackoverflow.com/users/4272",
"pm_score": 4,
"selected": false,
"text": "tune2fs -l /dev/DEVICE | grep -i inode\n"
},
{
"answer_id": 40392,
"author": "Joseph Bui",
"author_id":... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1536194/"
] |
40,372 | <p>I need to reformat my machine but I have so many user/passwords stored in FF2 that I just keep putting it off. Yes I know about backing up the entire profile and restoring it. But for some reason my profile has many issues and I want to start fresh with that as well.</p>
<p>Are the username and passwords stored in a text file or is there some way to export them and import after I reformat?</p>
| [
{
"answer_id": 40466,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 3,
"selected": false,
"text": "signons2.txt"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/40372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3747/"
] |
40,376 | <p>Is it possible to handle POSIX signals within the Java Virtual Machine?</p>
<p>At least <a href="http://en.wikipedia.org/wiki/SIGINT_(POSIX)" rel="noreferrer">SIGINT</a> and <a href="http://en.wikipedia.org/wiki/SIGKILL" rel="noreferrer">SIGKILL</a> should be quite platform independent.</p>
| [
{
"answer_id": 41157,
"author": "Will",
"author_id": 816,
"author_profile": "https://Stackoverflow.com/users/816",
"pm_score": 5,
"selected": true,
"text": "sun.misc.Signal"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/40376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4308/"
] |
40,402 | <p>I need to empty an LDF file before sending to a colleague. How do I force SQL Server to truncate the log?</p>
| [
{
"answer_id": 40420,
"author": "Blorgbeard",
"author_id": 369,
"author_profile": "https://Stackoverflow.com/users/369",
"pm_score": 8,
"selected": false,
"text": "Properties"
},
{
"answer_id": 40427,
"author": "ila",
"author_id": 1178,
"author_profile": "https://Stac... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1042/"
] |
40,422 | <p>Ok, so I want an autocomplete dropdown with linkbuttons as selections. So, the user puts the cursor in the "text box" and is greated with a list of options. They can either start typing to narrow down the list, or select one of the options on the list. As soon as they click (or press enter) the dataset this is linked to will be filtered by the selection. </p>
<p>Ok, is this as easy as wrapping an AJAX autocomplete around a dropdown? No? (Please?) </p>
| [
{
"answer_id": 339033,
"author": "thoughtcrimes",
"author_id": 37814,
"author_profile": "https://Stackoverflow.com/users/37814",
"pm_score": 1,
"selected": true,
"text": " __________ _\n|__________||v|__ <-- text and button\n | | <-- ul (styled to ap... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4140/"
] |
40,423 | <p>Actually, this question seems to have two parts:</p>
<ul>
<li>How to implement pattern matching?</li>
<li>How to implement <a href="http://erlang.org/doc/reference_manual/expressions.html#6.9" rel="noreferrer">send and receive</a> (i.e. the Actor model)?</li>
</ul>
<p>For the pattern matching part, I've been looking into various projects like <a href="http://members.cox.net/nelan/app.html" rel="noreferrer">App</a> and <a href="http://www.cs.nyu.edu/leunga/papers/research/prop/prop.html" rel="noreferrer">Prop</a>. These look pretty nice, but couldn't get them to work on a recent version (4.x) of g++. The <a href="http://felix-lang.org/" rel="noreferrer">Felix</a> language also seems to support pattern matching pretty well, but isn't really C++.</p>
<p>As for the <a href="http://en.wikipedia.org/wiki/Actor_model" rel="noreferrer">Actor model</a>, there are existing implementations like ACT++ and <a href="http://theron.ashtonmason.net/" rel="noreferrer">Theron</a>, but I couldn't find anything but papers on the former<strike>, and the latter is single-threaded only</strike> [see answers].</p>
<p>Personally, I've implemented actors using threading and a thread-safe message queue. Messages are hash-like structures, and used these together with a number of preprocessor macros to implemented simple pattern matching.</p>
<p>Right now, I can use the following code to send a message:</p>
<pre><code>(new Message(this))
->set("foo", "bar")
->set("baz", 123)
->send(recipient);
</code></pre>
<p>And the following to do simple pattern matching (<code>qDebug</code> and <code>qPrintable</code> are Qt-specific):</p>
<pre><code>receive_and_match(m)
match_key("foo") { qDebug("foo: %s", qPrintable(m->value("foo").toString())); }
or_match_key("baz") { qDebug("baz: %d", m->value("baz").toInt()); }
or_match_ignore
end_receive
</code></pre>
<p>However, this looks a bit hackish to me, and isn't very robust.</p>
<p>How would you do it? Did I miss any existing work?</p>
| [
{
"answer_id": 912489,
"author": "neverlord",
"author_id": 112736,
"author_profile": "https://Stackoverflow.com/users/112736",
"pm_score": 2,
"selected": false,
"text": "recipient.send(23, 12.23f);\n"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/40423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
40,452 | <p>I have to POST some parameters to a URL outside my network, and the developers on the other side asked me to not use HTTP Parameters: instead I have to post my key-values in <strong>HTTP Headers</strong>.</p>
<p>The fact is that I don't really understand what they mean: I tried to use a ajax-like post, with XmlHttp objects, and also I tried to write in the header with something like</p>
<pre><code>Request.Headers.Add(key,value);
</code></pre>
<p>but I cannot (exception from the framework); I tried the other way around, using the Response object like</p>
<pre><code>Response.AppendHeader("key", "value");
</code></pre>
<p>and then redirect to the page... but this doesn't work, as well.</p>
<p>It's evident, I think, that I'm stuck there, any help?</p>
<hr>
<p><strong>EDIT</strong> I forgot to tell you that my environment is .Net 2.0, c#, on Win server 2003.
The exception I got is</p>
<pre><code>System.PlatformNotSupportedException was unhandled by user code
Message="Operation is not supported on this platform."
Source="System.Web"
</code></pre>
<p>This looks like it's caused by my tentative to Request.Add, MS an year ago published some security fixes that don't permit this. </p>
| [
{
"answer_id": 40468,
"author": "Hank Gay",
"author_id": 4203,
"author_profile": "https://Stackoverflow.com/users/4203",
"pm_score": 0,
"selected": false,
"text": "http = httplib2.Http()\nhttp.request(url, 'POST', headers={'key': 'value'}, body=urllib.urlencode(''))\n"
},
{
"answ... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1178/"
] |
40,456 | <p>If I select from a table group by the month, day, year,
it only returns rows with records and leaves out combinations without any records, making it appear at a glance that every day or month has activity, you have to look at the date column actively for gaps. How can I get a row for every day/month/year, even when no data is present, in T-SQL?</p>
| [
{
"answer_id": 40619,
"author": "ryw",
"author_id": 2477,
"author_profile": "https://Stackoverflow.com/users/2477",
"pm_score": 2,
"selected": true,
"text": "declare @career-fair-id int \nselect @career-fair-id = 125\n\ncreate table #data ([date] datetime null, [cumulative] int null) \n\... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40456",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2477/"
] |
40,465 | <p>I have a List of Foo.</p>
<p>Foo has a string property named Bar.</p>
<p>I'd like to use <strong>LINQ</strong> to get a string[] of <strong>distinct</strong> values for Foo.Bar in List of Foo.</p>
<p>How can I do this?</p>
| [
{
"answer_id": 40477,
"author": "Lasse V. Karlsen",
"author_id": 267,
"author_profile": "https://Stackoverflow.com/users/267",
"pm_score": 2,
"selected": false,
"text": "var distinctFooBars = (from foo in foos\n select foo.Bar).Distinct().ToArray();\n"
},
{
... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40465",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1946/"
] |
40,471 | <p>What are the differences between a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashMap.html" rel="noreferrer"><code>HashMap</code></a> and a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Hashtable.html" rel="noreferrer"><code>Hashtable</code></a> in Java?</p>
<p>Which is more efficient for non-threaded applications?</p>
| [
{
"answer_id": 40512,
"author": "izb",
"author_id": 974,
"author_profile": "https://Stackoverflow.com/users/974",
"pm_score": 6,
"selected": false,
"text": "Hashtable"
},
{
"answer_id": 40522,
"author": "Miles D",
"author_id": 3898,
"author_profile": "https://Stackove... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40471",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4316/"
] |
40,480 | <p>I always thought Java uses <strong>pass-by-reference</strong>.</p>
<p>However, I've seen <a href="http://javadude.com/articles/passbyvalue.htm" rel="noreferrer">a blog post</a> that claims that Java uses <strong>pass-by-value</strong>.</p>
<p>I don't think I understand the distinction they're making.</p>
<p>What is the explanation?</p>
| [
{
"answer_id": 40499,
"author": "SCdF",
"author_id": 1666,
"author_profile": "https://Stackoverflow.com/users/1666",
"pm_score": 10,
"selected": false,
"text": "int"
},
{
"answer_id": 40507,
"author": "Hank Gay",
"author_id": 4203,
"author_profile": "https://Stackover... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4315/"
] |
40,511 | <p>As the title already states, I'm trying to declare a nested function and return a pointer to that function. I want this function 'not' to return a new function pointer which will return the negation of whatever the original function was.</p>
<p>Here is what I have:</p>
<pre><code>someType not( someType original ) {
int isNot( ListEntry* entry ) {
return !original( entry );
}
someType resultFunc = calloc( 1024, 1 );
memcpy( resultFunc, &isNot, 1024 );
return resultFunc;
}
</code></pre>
<p>someType is defined as:</p>
<pre><code>typedef int(*someType)(ListEntry* entry)
</code></pre>
| [
{
"answer_id": 40537,
"author": "Steve Willard",
"author_id": 402,
"author_profile": "https://Stackoverflow.com/users/402",
"pm_score": 0,
"selected": false,
"text": "-fnested-functions\n"
},
{
"answer_id": 40757,
"author": "Community",
"author_id": -1,
"author_profil... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/402/"
] |
40,525 | <p>I'm trying to call a function after I load some XML into Actionscript, and I'm just wondering how I call that function. Example:</p>
<pre><code>//Function Declarations
function parentFunction()
{
function callMe()
{
textField.text = "lawl";
}
}
</code></pre>
<p>Now, <strong>how do I call the "callMe()" function</strong> in a different part of the code, like an onRelease function?</p>
<pre><code>on(release)
{
callMe(); //doesn't work
parentFunction().callMe(); //doesn't work
parentFunction.callMe(); //doesn't work
}
</code></pre>
<p>ActionScript 2.0 is just so wonky! Any ideas?</p>
| [
{
"answer_id": 113517,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "var bar = function()\n{\n trace(\"bar\");\n};\n\nbar.call();\n"
},
{
"answer_id": 286276,
"author": "Community"... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/557/"
] |
40,535 | <p>I need to determine if I'm on a particular view. My use case is that I'd like to decorate navigation elements with an "on" class for the current view. Is there a built in way of doing this?</p>
| [
{
"answer_id": 40538,
"author": "Jim Geurts",
"author_id": 3085,
"author_profile": "https://Stackoverflow.com/users/3085",
"pm_score": 2,
"selected": false,
"text": "public static class UrlHelperExtensions\n{\n /// <summary>\n /// Determines if the current view equals the specified... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3085/"
] |
40,545 | <p>Is there is any way to change the datasource location for a report and all of it's subreports without having to open each of them manually?</p>
| [
{
"answer_id": 41979,
"author": "Jas",
"author_id": 777,
"author_profile": "https://Stackoverflow.com/users/777",
"pm_score": 3,
"selected": false,
"text": " #'SET REPORT CONNECTION INFO\n For i = 0 To rsource.ReportDocument.DataSourceConnections.Count - 1\n rsou... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4286/"
] |
40,568 | <p>Are square brackets in URLs allowed?</p>
<p>I noticed that <a href="http://hc.apache.org/httpclient-3.x/index.html" rel="noreferrer">Apache commons HttpClient</a> (3.0.1) throws an IOException, wget and Firefox however accept square brackets.</p>
<p>URL example:</p>
<pre><code>http://example.com/path/to/file[3].html
</code></pre>
<p>My HTTP client encounters such URLs but I'm not sure whether to patch the code or to throw an exception (as it actually should be).</p>
| [
{
"answer_id": 1718238,
"author": "MM.",
"author_id": 126603,
"author_profile": "https://Stackoverflow.com/users/126603",
"pm_score": 4,
"selected": false,
"text": "http://www.example.com/foo.php?bar[]=1&bar[]=2&bar[]=3\n"
},
{
"answer_id": 44901804,
"author": "oHo",
"aut... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40568",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4308/"
] |
40,577 | <p>In Ruby, I'm trying to do the following.</p>
<pre><code>def self.stats(since)
return Events.find(:all, :select => 'count(*) as this_count', :conditions => ['Date(event_date) >= ?', (Time.now - since)]).first.this_count
end
</code></pre>
<p>where "since" is a string representing an amount of time ('1 hour', '1 day', '3 days') and so on. Any suggestions?</p>
| [
{
"answer_id": 40822,
"author": "Wieczo",
"author_id": 4195,
"author_profile": "https://Stackoverflow.com/users/4195",
"pm_score": 3,
"selected": true,
"text": "require 'active_support'\n\ndef string_to_date(date_string)\n parts = date_string.split\n return parts[0].to_i.send(parts[1])... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4322/"
] |
40,590 | <p>Both the jQuery and Prototpye JavaScript libraries refuse to allow me to use a variable to select an list item element by index number although they accept a hard coded number. </p>
<p>For example, in Prototype this works:</p>
<pre><code>$$('li')[5].addClassName('active');
</code></pre>
<p>But this will not work no matter how I try to cast the variable as a number or integer:</p>
<pre><code>$$('li')[currentPage].addClassName('active');
</code></pre>
<p>In jQuery I get similar weirdness. This will work:</p>
<pre><code>jQuery('li').eq(5).addClass("active");
</code></pre>
<p>But this will not work again even though the value of currentPage is 5 and its type is number:</p>
<pre><code>jQuery('li').eq(currentPage).addClass("active");
</code></pre>
<p>I'm trying to create a JavaScript pagination system and I need to set the class on the active page button. The list item elements are created dynamically depending upon the number of pages I need.</p>
| [
{
"answer_id": 40599,
"author": "John Millikin",
"author_id": 3560,
"author_profile": "https://Stackoverflow.com/users/3560",
"pm_score": 3,
"selected": false,
"text": "currentPage"
},
{
"answer_id": 40800,
"author": "user2601",
"author_id": 2601,
"author_profile": "h... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4320/"
] |
40,602 | <p>What kind of programming problems are state machines most suited for?</p>
<p>I have read about parsers being implemented using state machines, but would like to find out about problems that scream out to be implemented as a state machine.</p>
| [
{
"answer_id": 40645,
"author": "Adam Davis",
"author_id": 2915,
"author_profile": "https://Stackoverflow.com/users/2915",
"pm_score": 3,
"selected": false,
"text": "enum states{reset,initsend, initresponse, waitonsignal,dial,ppp,...}\nmodemfunction()\n{\n static currentstate\n\n switc... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1583/"
] |
40,608 | <p>I've been using PHP for too long, but I'm new to JavaScript integration in some places. </p>
<p>I'm trying to find the fastest way to pass database information into a page where it can be modified and displayed dynamically in JavaScript. </p>
<p>Right now, I'm looking at loading a <em>JSON with PHP</em> echo statements because it's fast and effective, but I saw that I could use PHP's JSON library (PHP 5.2). </p>
<p><strong>Has anybody tried the new JSON library, and is it better than my earlier method?</strong></p>
| [
{
"answer_id": 166701,
"author": "Sean",
"author_id": 5446,
"author_profile": "https://Stackoverflow.com/users/5446",
"pm_score": 2,
"selected": false,
"text": "function my_json_encode($row) {\n $json = \"{\";\n $keys = array_keys($row);\n $i=1;\n foreach ($keys a... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4247/"
] |
40,632 | <p>What are they and what are they good for?</p>
<p>I do not have a CS degree and my background is VB6 -> ASP -> ASP.NET/C#. Can anyone explain it in a clear and concise manner?</p>
| [
{
"answer_id": 40736,
"author": "Kyle Cronin",
"author_id": 658,
"author_profile": "https://Stackoverflow.com/users/658",
"pm_score": 3,
"selected": false,
"text": "(define (fork)\n (display \"forking\\n\")\n (call-with-current-continuation\n (lambda (cc)\n (enqueue (lambda ()\n ... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1583/"
] |
40,637 | <p>I'm building an excel template (*.xlt) for a user here, and one of the things I want to do is have it insert the current date when a new document is created (ie, when they double-click the file in windows explorer). How do I do this?</p>
<p><strong>Update:</strong> I should have added that I would prefer not to use any vba (macro). If that's the only option, then so be it, but I'd really like to avoid forcing my user to remember to click some 'allow macro content' button.</p>
| [
{
"answer_id": 40674,
"author": "1729",
"author_id": 4319,
"author_profile": "https://Stackoverflow.com/users/4319",
"pm_score": 2,
"selected": false,
"text": "Book.xlt"
},
{
"answer_id": 40785,
"author": "Graham",
"author_id": 1826,
"author_profile": "https://Stackov... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40637",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3043/"
] |
40,651 | <p>I've inherited a large VB6 app at my current workplace. I'm kinda learning VB6 on the job and there are a number of problems I'm having. The major issue at the moment is I can't figure out how to check if a key exists in a Collection object. Can anyone help?</p>
| [
{
"answer_id": 40659,
"author": "Mark Biek",
"author_id": 305,
"author_profile": "https://Stackoverflow.com/users/305",
"pm_score": 3,
"selected": false,
"text": "public function keyExists(myCollection as collection, sKey as string) as Boolean\n on error goto handleerror:\n\n dim val a... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4315/"
] |
40,663 | <p>I'm trying to find a way to validate a large XML file against an XSD. I saw the question <a href="https://stackoverflow.com/questions/15732/whats-the-best-way-to-validate-an-xml-file-against-an-xsd-file">...best way to validate an XML...</a> but the answers all pointed to using the Xerces library for validation. The only problem is, when I use that library to validate a 180 MB file then I get an OutOfMemoryException.</p>
<p>Are there any other tools,libraries, strategies for validating a larger than normal XML file?</p>
<p>EDIT: The SAX solution worked for java validation, but the other two suggestions for the libxml tool were very helpful as well for validation outside of java.</p>
| [
{
"answer_id": 40678,
"author": "jodonnell",
"author_id": 4223,
"author_profile": "https://Stackoverflow.com/users/4223",
"pm_score": 6,
"selected": true,
"text": "SAXParserFactory factory = SAXParserFactory.newInstance();\nfactory.setValidating(true);\nfactory.setNamespaceAware(true);\n... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3274/"
] |
40,665 | <p>I'm maintaining some code that uses a *= operator in a query to a Sybase database and I can't find documentation on it. Does anyone know what *= does? I assume that it is some sort of a join.</p>
<pre><code>select * from a, b where a.id *= b.id</code></pre>
<p>I can't figure out how this is different from:</p>
<pre><code>select * from a, b where a.id = b.id</code></pre>
| [
{
"answer_id": 40671,
"author": "Lasse V. Karlsen",
"author_id": 267,
"author_profile": "https://Stackoverflow.com/users/267",
"pm_score": 3,
"selected": false,
"text": "*= is LEFT JOIN and =* is RIGHT JOIN.\n"
},
{
"answer_id": 40698,
"author": "Joel Coehoorn",
"author_i... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4066/"
] |
40,680 | <p>I need to be able to get at the full URL of the page I am on from a user control. Is it just a matter of concatenating a bunch of Request variables together? If so which ones? Or is there a more simpiler way?</p>
| [
{
"answer_id": 40693,
"author": "Christian Hagelid",
"author_id": 202,
"author_profile": "https://Stackoverflow.com/users/202",
"pm_score": 3,
"selected": false,
"text": "Request.ServerVariables(\"HTTPS\") // to check if it's HTTP or HTTPS\nRequest.ServerVariables(\"SERVER_NAME\") \nRequ... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/648/"
] |
40,692 | <p>Is it possible to create a REST web service using ASP.NET 2.0? The articles and blog entries I am finding all seem to indicate that ASP.NET 3.5 with WCF is required to create REST web services with ASP.NET.</p>
<p>If it is possible to create REST web services in ASP.NET 2.0 can you provide an example.</p>
<p>Thanks!</p>
| [
{
"answer_id": 40728,
"author": "Nathan Lee",
"author_id": 3453,
"author_profile": "https://Stackoverflow.com/users/3453",
"pm_score": 4,
"selected": true,
"text": "protected void PageLoad(object sender, EventArgs e)\n{\n using (XmlWriter xm = XmlWriter.Create(Response.OutputStream, G... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40692",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3498/"
] |
40,703 | <p>It will be important for developers wanting to develop for the chrome browser to be able to review existing bugs (to avoid too much pulling-out of hair), and to add new ones (to improve the thing). Yet I can't seem to find the bug tracking for this project. It <em>is</em> open source, right?</p>
| [
{
"answer_id": 36502481,
"author": "kenorb",
"author_id": 55075,
"author_profile": "https://Stackoverflow.com/users/55075",
"pm_score": 3,
"selected": false,
"text": "bugs.chromium.org"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/40703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1190/"
] |
40,705 | <p>At the beginning of all my executable Python scripts I put the <a href="http://en.wikipedia.org/wiki/Shebang_(Unix)" rel="noreferrer">shebang</a> line:</p>
<pre><code>#!/usr/bin/env python
</code></pre>
<p>I'm running these scripts on a system where <code>env python</code> yields a Python 2.2 environment. My scripts quickly fail because I have a manual check for a compatible Python version:</p>
<pre><code>if sys.version_info < (2, 4):
raise ImportError("Cannot run with Python version < 2.4")
</code></pre>
<p>I don't want to have to change the shebang line on every executable file, if it's possible; however, I don't have administrative access to the machine to change the result of <code>env python</code> and I don't want to force a particular version, as in:</p>
<pre><code>#!/usr/bin/env python2.4
</code></pre>
<p>I'd like to avoid this because system may have a newer version than Python 2.4, or may have Python 2.5 but no Python 2.4.</p>
<p>What's the elegant solution?</p>
<p>[Edit:] I wasn't specific enough in posing the question -- I'd like to let users execute the scripts without manual configuration (e.g. path alteration or symlinking in <code>~/bin</code> and ensuring your PATH has <code>~/bin</code> before the Python 2.2 path). Maybe some distribution utility is required to prevent the manual tweaks?</p>
| [
{
"answer_id": 40721,
"author": "Douglas Leeder",
"author_id": 3978,
"author_profile": "https://Stackoverflow.com/users/3978",
"pm_score": 2,
"selected": false,
"text": "$ mkdir ~/bin\n$ ln -s `which python2.4` ~/bin/python\n$ export PATH=~/bin:$PATH\n"
},
{
"answer_id": 42516,
... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3594/"
] |
40,716 | <p>Although the general case is undecidable, many people still do solve problems that are equivilent well enough for day to day use.</p>
<p>In cohen's phd thesis on computer viruses, he showed how virus scanning is equivilent to the halting problem, yet we have an entire industry based around this challenge.</p>
<p>I also have seen microsoft's terminator project - <a href="http://research.microsoft.com/Terminator/" rel="noreferrer">http://research.microsoft.com/Terminator/</a> </p>
<p>Which leads me to ask - is the halting problem overrated - do we need to worry about the general case?</p>
<p>Will types become turing complete over time - dependant types do seem like a good development?</p>
<p>Or, to look the other way, will we begin to use non turing complete languages to gain the benefits of static analysis ?</p>
| [
{
"answer_id": 40813,
"author": "mweerden",
"author_id": 4285,
"author_profile": "https://Stackoverflow.com/users/4285",
"pm_score": 0,
"selected": false,
"text": "while false do something"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/40716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4319/"
] |
40,730 | <p>How do you give a C# auto-property an initial value?</p>
<p>I either use the constructor, or revert to the old syntax. </p>
<p><strong> Using the Constructor:</strong></p>
<pre><code>class Person
{
public Person()
{
Name = "Initial Name";
}
public string Name { get; set; }
}
</code></pre>
<p><strong>Using normal property syntax</strong> (with an initial value)</p>
<pre><code>private string name = "Initial Name";
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
</code></pre>
<p>Is there a better way?</p>
| [
{
"answer_id": 40754,
"author": "Darren Kopp",
"author_id": 77,
"author_profile": "https://Stackoverflow.com/users/77",
"pm_score": 12,
"selected": true,
"text": "public int X { get; set; } = x; // C# 6 or higher\n"
},
{
"answer_id": 40882,
"author": "crucible",
"author_i... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/946/"
] |
40,733 | <p>I am setting the <code>.Content</code> value of a Label to a string that contains underscores; the first underscore is being interpreted as an accelerator key.</p>
<p>Without changing the underlying string (by replacing all <code>_</code> with <code>__</code>), is there a way to disable the accelerator for Labels?</p>
| [
{
"answer_id": 40784,
"author": "denis phillips",
"author_id": 748,
"author_profile": "https://Stackoverflow.com/users/748",
"pm_score": 5,
"selected": false,
"text": "<Page xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2258/"
] |
40,737 | <p><a href="https://stackoverflow.com/questions/32230/tracking-down-where-disk-space-has-gone-on-linux">In this question</a> someone asked for ways to display disk usage in Linux. I'd like to take this one step further down the cli-path... how about a shell script that takes the output from something like a reasonable answer to the previous question and generates a graph/chart from it (output in a png file or something)? This may be a bit too much code to ask for in a regular question, but my guess is that someone already has a oneliner laying around somewhere...</p>
| [
{
"answer_id": 43733,
"author": "dbr",
"author_id": 745,
"author_profile": "https://Stackoverflow.com/users/745",
"pm_score": 4,
"selected": true,
"text": "disc1usage.value 1234"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/40737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4162/"
] |
40,764 | <p>Are all of these equal? Under what circumstances should I choose each over the others?</p>
<ul>
<li><p>var.ToString()</p></li>
<li><p>CStr(var)</p></li>
<li><p>CType(var, String)</p></li>
<li><p>DirectCast(var, String)</p></li>
</ul>
<hr>
<p><em>EDIT: Suggestion from <strong><a href="https://stackoverflow.com/users/303/notmyself">NotMyself</a></strong>…</em></p>
<ul>
<li>TryCast(var, String)</li>
</ul>
| [
{
"answer_id": 40771,
"author": "NotMyself",
"author_id": 303,
"author_profile": "https://Stackoverflow.com/users/303",
"pm_score": 3,
"selected": false,
"text": "Dim number As Integer = 1\nDim str As String = String.TryCast(number)\n\nIf str IsNot Nothing Then\n"
},
{
"answer_id... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/83/"
] |
40,769 | <p>How do I determine the (local-) path for the "Program Files" directory on a remote computer? There does not appear to any version of SHGetFolderPath (or related function) that takes the name of a remote computer as a parameter.</p>
<p>I guess I could try to query HKLM\Software\Microsoft\Windows\CurrentVersion\ProgramFilesDir using remote-registry, but I was hoping there would be "documented" way of doing it.</p>
| [
{
"answer_id": 40771,
"author": "NotMyself",
"author_id": 303,
"author_profile": "https://Stackoverflow.com/users/303",
"pm_score": 3,
"selected": false,
"text": "Dim number As Integer = 1\nDim str As String = String.TryCast(number)\n\nIf str IsNot Nothing Then\n"
},
{
"answer_id... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40769",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3923/"
] |
40,779 | <p>I've inherited a .NET application that automatically updates it's version number with each release. The problem, as I see it, is the length and number of digits in the version number.</p>
<p>An example of the current version number format is <code>3.5.3167.26981</code> which is a mouthful for the users to say when they are reporting bugs.</p>
<p>What I would like is something more like this: <code>3.5 (build 3198)</code>. I would prefer to manually update the major and minor versions, but have the build number update automatically.</p>
<p>Even better, I don't want the build number to increment unless I am compiling in RELEASE mode.</p>
<p>Anyone know if there is a way to do this -- and how?</p>
| [
{
"answer_id": 40793,
"author": "Joseph Daigle",
"author_id": 507,
"author_profile": "https://Stackoverflow.com/users/507",
"pm_score": 3,
"selected": true,
"text": "[assembly: AssemblyVersion(\"3.5.*\")]"
}
] | 2008/09/02 | [
"https://Stackoverflow.com/questions/40779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3799/"
] |
40,787 | <p>I'd like to keep a "compile-counter" for one of my projects. I figured a quick and dirty way to do this would be to keep a text file with a plain number in it, and then simply call upon a small script to increment this each time I compile.</p>
<p>How would I go about doing this using the regular Windows command line?</p>
<p>I don't really feel like installing some extra shell to do this but if you have any other super simple suggestions that would accomplish just this, they're naturally appreciated as well.</p>
| [
{
"answer_id": 40826,
"author": "Steven Murawski",
"author_id": 1233,
"author_profile": "https://Stackoverflow.com/users/1233",
"pm_score": 2,
"selected": false,
"text": "[int](get-content counter.txt) + 1 | out-file counter.txt\n"
},
{
"answer_id": 40856,
"author": "Re0sless... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/914/"
] |
40,814 | <p>I need to execute a large set of SQL statements (creating a bunch of tables, views and stored procedures) from within a C# program.</p>
<p>These statements need to be separated by <code>GO</code> statements, but <code>SqlCommand.ExecuteNonQuery()</code> does not like <code>GO</code> statements. My solution, which I suppose I'll post for reference, was to split the SQL string on <code>GO</code> lines, and execute each batch separately.</p>
<p>Is there an easier/better way?</p>
| [
{
"answer_id": 40827,
"author": "Blorgbeard",
"author_id": 369,
"author_profile": "https://Stackoverflow.com/users/369",
"pm_score": 5,
"selected": false,
"text": "private void ExecuteBatchNonQuery(string sql, SqlConnection conn) {\n string sqlBatch = string.Empty;\n SqlCommand cmd... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369/"
] |
40,816 | <p>If I have an HTML helper like so:</p>
<pre><code>Name:<br />
<%=Html.TextBox("txtName",20) %><br />
</code></pre>
<p>How do I apply a CSS class to it? Do I have to wrap it in a span? Or do I need to somehow utilize the HtmlAttributes property of the helper?</p>
| [
{
"answer_id": 40846,
"author": "Dale Ragan",
"author_id": 1117,
"author_profile": "https://Stackoverflow.com/users/1117",
"pm_score": 6,
"selected": true,
"text": "Name:<br/> \n<%= Html.TextBox(\"txtName\", \"20\", new { @class = \"hello\" }) %>\n"
},
{
"answer_id": 40847,
... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40816",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/230/"
] |
40,853 | <p>I have some code like this in a winforms app I was writing to query a user's mail box Storage Quota.</p>
<pre><code>DirectoryEntry mbstore = new DirectoryEntry(
@"LDAP://" + strhome,
m_serviceaccount,
[m_pwd],
AuthenticationTypes.Secure);
</code></pre>
<p>No matter what approach I tried (like <code>SecureString</code>), I am easily able to see the password (<strong>m_pwd</strong>) either using Reflector or using strings tab of Process Explorer for the executable.</p>
<p>I know I could put this code on the server or tighten up the security using mechanisms like delegation and giving only the required privileges to the service account.</p>
<p>Can somebody suggest a reasonably secure way to store the password in the local application without revealing the password to hackers?</p>
<p>Hashing is not possible since I need to know the exact password (not just the hash for matching purpose).
Encryption/Decryption mechanisms are not working since they are machine dependent.</p>
| [
{
"answer_id": 40867,
"author": "1800 INFORMATION",
"author_id": 3146,
"author_profile": "https://Stackoverflow.com/users/3146",
"pm_score": 6,
"selected": true,
"text": "DATA_BLOB blobIn, blobOut;\nblobIn.pbData=(BYTE*)data;\nblobIn.cbData=wcslen(data)*sizeof(WCHAR);\n\nCryptProtectData... | 2008/09/02 | [
"https://Stackoverflow.com/questions/40853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4337/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.