qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
43,533
<p>I'm trying to the the flv Flash player <a href="http://www.jeroenwijering.com/?item=JW_FLV_Player" rel="nofollow noreferrer">from here</a> in a windows forms application. I currently have it playing 1 .flv file with no problems but I really need to be able to play multiple files. Has anyone had experienace of using ...
[ { "answer_id": 9561843, "author": "Jas Laferriere", "author_id": 1249024, "author_profile": "https://Stackoverflow.com/users/1249024", "pm_score": 0, "selected": false, "text": "//Load JWPlayer swf\naxShockwaveFlash1.FlashVars = \"autostart=true\";\naxShockwaveFlash1.ScaleMode = 0;\naxSh...
2008/09/04
[ "https://Stackoverflow.com/questions/43533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4500/" ]
43,536
<p>Using C# 2.0 what is the best way to implement dynamic form controls?</p> <p>I need to provide a set of controls per data object, so should i just do it manually and lay them out while increment the top value or is there a better way?</p>
[ { "answer_id": 43541, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 1, "selected": false, "text": "UserControl TextBox" } ]
2008/09/04
[ "https://Stackoverflow.com/questions/43536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428/" ]
43,569
<p>How to restrict the maximum number of characters that can be entered into an HTML <code>&lt;textarea&gt;</code>? I'm looking for a cross-browser solution.</p>
[ { "answer_id": 43571, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 5, "selected": true, "text": "TEXTAREA MAXLENGTH INPUT TEXTAREA <textarea onKeyPress=\"return ( this.value.length < 50 );\"></textarea>\n onKeyPress false KeyP...
2008/09/04
[ "https://Stackoverflow.com/questions/43569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3512/" ]
43,580
<p>Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct application/viewer.</p> <p>Assumption: The browser figures out which application/viewer to use by the mime-type (content-type?) h...
[ { "answer_id": 43616, "author": "akdom", "author_id": 145, "author_profile": "https://Stackoverflow.com/users/145", "pm_score": 3, "selected": false, "text": "sys.popen('file -i ' + fileName, mode='r')" }, { "answer_id": 1662074, "author": "apito", "author_id": 180008, ...
2008/09/04
[ "https://Stackoverflow.com/questions/43580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2260/" ]
43,584
<p>A very niche problem:</p> <p>I sometimes (30% of the time) get an 'undefined handler' javascript error on line 3877 of the prototype.js library (version 1.6.0.2 from google: <a href="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/p...
[ { "answer_id": 175102, "author": "user25551", "author_id": 25551, "author_profile": "https://Stackoverflow.com/users/25551", "pm_score": 4, "selected": true, "text": "Event.observe(document, 'myapp:application_ready', myapp.MyClass.initApp());\n Event.observe(document, 'myapp:application...
2008/09/04
[ "https://Stackoverflow.com/questions/43584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4512/" ]
43,589
<p>I need to get the first and last day of a month in the format YYYY-MM-DD given only the month and year. Is there a good, easy way to do this?</p>
[ { "answer_id": 43607, "author": "Biri", "author_id": 968, "author_profile": "https://Stackoverflow.com/users/968", "pm_score": 3, "selected": false, "text": "date(\"Y-M-d\", mktime(0, 0, 0, 8, 1, 2008)) $date = new DateTime(\"2008-09-01\");\n$date->modify(\"-1 day\");\necho $date->format...
2008/09/04
[ "https://Stackoverflow.com/questions/43589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
43,632
<p>I've seen lots of examples of making an entire regular expression case-insensitive. What I'm wondering about is having just part of the expression be case-insensitive.</p> <p>For example, let's say I have a string like this:</p> <pre><code>fooFOOfOoFoOBARBARbarbarbAr </code></pre> <p>What if I want to match all ...
[ { "answer_id": 43641, "author": "Kibbee", "author_id": 1862, "author_profile": "https://Stackoverflow.com/users/1862", "pm_score": 2, "selected": false, "text": "(?:F|f)(?:O|o)(?:O|o)\n" }, { "answer_id": 58818125, "author": "Wiktor Stribiżew", "author_id": 3832970, "...
2008/09/04
[ "https://Stackoverflow.com/questions/43632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305/" ]
43,643
<p>Given the code bellow, how do I style the radio buttons to be next to the labels and style the label of the selected radio button differently than the other labels?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-c...
[ { "answer_id": 43703, "author": "pkaeding", "author_id": 4257, "author_profile": "https://Stackoverflow.com/users/4257", "pm_score": 3, "selected": false, "text": "<style type=\"text/css\">\n.input input {\n float: left;\n}\n.input label {\n margin: 5px;\n}\n</style>\n<div class=\"inpu...
2008/09/04
[ "https://Stackoverflow.com/questions/43643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4013/" ]
43,644
<p>I need to select data when a page is viewed and update the 'views' column is there a way to do this in one query, or do I have to use to distinct queries?</p>
[ { "answer_id": 43651, "author": "GateKiller", "author_id": 383, "author_profile": "https://Stackoverflow.com/users/383", "pm_score": 2, "selected": false, "text": "Begin Tran\n\nUpdate Pages Set Views = Views + 1 Where ID = @ID\nSelect Columns From Pages Where ID = @ID\n\nCommit Tran\n" ...
2008/09/04
[ "https://Stackoverflow.com/questions/43644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115/" ]
43,711
<p>I've got some (C#) code that relies on today's date to correctly calculate things in the future. If I use today's date in the testing, I have to repeat the calculation in the test, which doesn't feel right. What's the best way to set the date to a known value within the test so that I can test that the result is a k...
[ { "answer_id": 43718, "author": "Rob Cooper", "author_id": 832, "author_profile": "https://Stackoverflow.com/users/832", "pm_score": -1, "selected": false, "text": "DateTime date;\n#if DEBUG\n date = new DateTime(2008, 09, 04);\n#else\n date = DateTime.Now;\n#endif\n" }, { "ans...
2008/09/04
[ "https://Stackoverflow.com/questions/43711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1404/" ]
43,738
<p>I have a line color property in my custom grid control. I want it to default to <code>Drawing.SystemColors.InactiveBorder</code>. I tried:</p> <pre><code>[DefaultValue(typeof(System.Drawing.SystemColors), "InactiveBorder")] public Color LineColor { get; set; } </code></pre> <p>But it doesn't seem to work. How do I...
[ { "answer_id": 43751, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 4, "selected": false, "text": "SystemColors Color SystemColors Color [DefaultValue(typeof(Color),\"InactiveBorder\")]\n" }, { "answer_id": 44073, "a...
2008/09/04
[ "https://Stackoverflow.com/questions/43738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/976/" ]
43,765
<p>For my day job, I live in Emacs. Utterly. I also have become pretty dependent on CScope to help me find things in the code.</p> <p>Normally, I have 2 windows in a split (C-x 3): <a href="http://bitthicket.com/files/emacs-2split.JPG">alt text http://bitthicket.com/files/emacs-2split.JPG</a></p> <p>And I use the r...
[ { "answer_id": 44562, "author": "Ben Collins", "author_id": 3279, "author_profile": "https://Stackoverflow.com/users/3279", "pm_score": 0, "selected": false, "text": "*browse-buffer* [C-c C-s g] *browse-buffer* *browse-buffer*" }, { "answer_id": 65992, "author": "Frank Klotz"...
2008/09/04
[ "https://Stackoverflow.com/questions/43765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3279/" ]
43,775
<p>Can you please tell me how much is <code>(-2) % 5</code>? According to my Python interpreter is 3, but do you have a wise explanation for this?</p> <p>I've read that in some languages the result can be machine-dependent, but I'm not sure though.</p>
[ { "answer_id": 43794, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 5, "selected": true, "text": "-2" }, { "answer_id": 43863, "author": "dF.", "author_id": 3002, "author_profile": "https://Stackov...
2008/09/04
[ "https://Stackoverflow.com/questions/43775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1876/" ]
43,778
<p><strong>Update:</strong> Check out this follow-up question: <a href="https://stackoverflow.com/questions/134581/gem-update-on-windows-is-it-broken"><strong>Gem Update on Windows - is it broken?</strong></a></p> <hr> <p>On Windows, when I do this:</p> <pre><code>gem install sqlite3-ruby </code></pre> <p>I get the...
[ { "answer_id": 43840, "author": "Charles Roper", "author_id": 1944, "author_profile": "https://Stackoverflow.com/users/1944", "pm_score": 6, "selected": true, "text": "$ gem list --remote --all sqlite\n\n*** REMOTE GEMS ***\n\nsqlite (2.0.1, 2.0.0, 1.3.1, 1.3.0, 1.2.9.1, 1.2.0, 1.1.3, 1....
2008/09/04
[ "https://Stackoverflow.com/questions/43778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1944/" ]
43,802
<p>I have a <code>String</code> representation of a date that I need to create a <code>Date</code> or <code>Calendar</code> object from. I've looked through <code>Date</code> and <code>Calendar</code> APIs but haven't found anything that can do this other than creating my own ugly parse method. I know there must be a w...
[ { "answer_id": 43806, "author": "Apocalisp", "author_id": 3434, "author_profile": "https://Stackoverflow.com/users/3434", "pm_score": 0, "selected": false, "text": "DateFormat.parse(String)\n" }, { "answer_id": 43807, "author": "Matt Sheppard", "author_id": 797, "auth...
2008/09/04
[ "https://Stackoverflow.com/questions/43802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2628/" ]
43,803
<p>This is what I've got. It works. But, is there a simpler or better way?</p> <p>ASPX Page&hellip;</p> <pre><code>&lt;asp:Repeater ID="RepeaterBooks" runat="server"&gt; &lt;HeaderTemplate&gt; &lt;table class="report"&gt; &lt;tr&gt; &lt;th&gt;Published&lt;/th&gt; ...
[ { "answer_id": 43818, "author": "Geoff", "author_id": 1097, "author_profile": "https://Stackoverflow.com/users/1097", "pm_score": 2, "selected": false, "text": "<ItemTemplate>\n <tr>\n <td><%# Eval(\"published\") %></td>\n ...\n" }, { "ans...
2008/09/04
[ "https://Stackoverflow.com/questions/43803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83/" ]
43,808
<p>I have a distributed Java application running on 5 application servers. The servers all use the same Oracle 9i database running on a 6th machine.</p> <p>The application need to prefetch a batch of 100 IDs from a sequence. It's relatively easy to do in a single-threaded, non-distributed environment, you can just iss...
[ { "answer_id": 43830, "author": "Matthew Watson", "author_id": 3839, "author_profile": "https://Stackoverflow.com/users/3839", "pm_score": 5, "selected": true, "text": "SQL> create sequence so_test start with 100 increment by 100 nocache;\n\nSequence created.\n\nSQL> select so_test.nextv...
2008/09/04
[ "https://Stackoverflow.com/questions/43808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/686/" ]
43,811
<p>This is probably a really simple jQuery question, but I couldn't answer it after 10 minutes in the documentation so...</p> <p>I have a list of checkboxes, and I can get them with the selector <code>'input[type=checkbox]'</code>. I want the user to be able to shift-click and select a range of checkboxes. To accompli...
[ { "answer_id": 43824, "author": "samjudson", "author_id": 1908, "author_profile": "https://Stackoverflow.com/users/1908", "pm_score": 4, "selected": true, "text": "input:checkbox :gt(index) :lt(index) input:checkbox:gt(4):lt(2) $(\"input:checkbox\").index($(this))" }, { "answer_i...
2008/09/04
[ "https://Stackoverflow.com/questions/43811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3757/" ]
43,819
<p>We are now using NHibernate to connect to different database base on where our software is installed. So I am porting many SQL Procedures to Oracle.</p> <p>SQL Server has a nice function called DateDiff which takes a date part, startdate and enddate.</p> <p>Date parts examples are day, week, month, year, etc. . ....
[ { "answer_id": 44597, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "DECLARE\nts_a timestamp;\nts_b timestamp;\ndiff interval day to second;\nBEGIN\n ts_a := systimestamp;\n ts_b := systimestamp...
2008/09/04
[ "https://Stackoverflow.com/questions/43819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2469/" ]
43,832
<p>I think I might be missing something here. Here is the relevant part of the trigger:</p> <pre><code> CURSOR columnNames (inTableName IN VARCHAR2) IS SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = inTableName; /* Removed for brevity */ OPEN columnNames('TEMP'); </code></pre> <p>And her...
[ { "answer_id": 43859, "author": "Matthew Watson", "author_id": 3839, "author_profile": "https://Stackoverflow.com/users/3839", "pm_score": 1, "selected": false, "text": "create or replace procedure so_test_procedure as \n CURSOR columnNames (inTableName IN VARCHAR2) IS \n SELECT COLUMN...
2008/09/04
[ "https://Stackoverflow.com/questions/43832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1185/" ]
43,842
<p>I have a string that contains the representation of a date. It looks like: </p> <p><strong>Thu Nov 30 19:00:00 EST 2006</strong></p> <p>I'm trying to create a Date object using SimpleDateFormat and have 2 problems. </p> <p>1.) I can't figure out the pattern to hard-code the solution into the SimpleDateFormat cons...
[ { "answer_id": 43850, "author": "pkaeding", "author_id": 4257, "author_profile": "https://Stackoverflow.com/users/4257", "pm_score": 0, "selected": false, "text": "\"EEE MMM d HH:mm:ss z yyyy\"\n" }, { "answer_id": 43852, "author": "Eli Courtwright", "author_id": 1694, ...
2008/09/04
[ "https://Stackoverflow.com/questions/43842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2628/" ]
43,866
<p>Why do I need two of them? When I have to use one or another?</p>
[ { "answer_id": 43901, "author": "Matthew Watson", "author_id": 3839, "author_profile": "https://Stackoverflow.com/users/3839", "pm_score": 8, "selected": true, "text": "SALES.acme.com SALES.acme.com SALES.acme.com" }, { "answer_id": 30327260, "author": "seorphates", "auth...
2008/09/04
[ "https://Stackoverflow.com/questions/43866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4052/" ]
43,870
<p>I am looking for a way to concatenate the strings of a field within a group by query. So for example, I have a table:</p> <pre><code>ID COMPANY_ID EMPLOYEE 1 1 Anna 2 1 Bill 3 2 Carol 4 2 Dave </code></pre> <p>and I wanted to group by company_id to get so...
[ { "answer_id": 43889, "author": "Guy C", "author_id": 4045, "author_profile": "https://Stackoverflow.com/users/4045", "pm_score": 4, "selected": false, "text": "CREATE AGGREGATE textcat_all(\n basetype = text,\n sfunc = textcat,\n stype = text,\n initcond = ''\n);\n...
2008/09/04
[ "https://Stackoverflow.com/questions/43870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4045/" ]
43,874
<p>I have a multiple selection SELECT field which I don't want the end user to be able to change the value of. </p> <p>For UI reasons, I would like to be able to do this without using the disabled="true" attribute. I've tried using onmousedown, onfocus, onclick and setting each to blur or return false but with no succ...
[ { "answer_id": 43880, "author": "ceejayoz", "author_id": 1902010, "author_profile": "https://Stackoverflow.com/users/1902010", "pm_score": 2, "selected": false, "text": "onchange <select onfocus=\"this.oldIndex=this.selectedIndex\" onchange=\"this.selectedIndex=this.oldIndex\">\n" }, ...
2008/09/04
[ "https://Stackoverflow.com/questions/43874", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1980/" ]
43,890
<p><strong>Original Question</strong></p> <p>I want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy style. The new file should only contain the first <em>n</em> seconds of the track.</p> <p>Now, I know I could just "chop the stream" at <em>n<...
[ { "answer_id": 43912, "author": "John Boker", "author_id": 2847, "author_profile": "https://Stackoverflow.com/users/2847", "pm_score": 4, "selected": false, "text": "ffmpeg -t 30 -i inputfile.mp3 outputfile.mp3\n" }, { "answer_id": 44032, "author": "Tim Farley", "author_i...
2008/09/04
[ "https://Stackoverflow.com/questions/43890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1820/" ]
43,903
<p>In a stored procedure, when is #Temptable created in SQL Server 2005? When creating the query execution plan or when executing the stored procedure?</p> <pre><code>if (@x = 1) begin select 1 as Text into #Temptable end else begin select 2 as Text into #Temptable end </code></pre>
[ { "answer_id": 77262, "author": "Chris Wuestefeld", "author_id": 10082, "author_profile": "https://Stackoverflow.com/users/10082", "pm_score": 2, "selected": false, "text": "DECLARE @MyTable TABLE (MyPK INT IDENTITY, MyName VARCHAR(100))\nINSERT INTO @MyTable ( MyName ) VALUES ( 'Icarus'...
2008/09/04
[ "https://Stackoverflow.com/questions/43903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2184/" ]
43,926
<p>A <code>.container</code> can contain many <code>.components</code>, and <code>.components</code> themselves can contain <code>.containers</code> (which in turn can contain .components etc. etc.)</p> <p>Given code like this:</p> <pre><code>$(".container .component").each(function(){ $(".container", this).css('bo...
[ { "answer_id": 43933, "author": "travis", "author_id": 1414, "author_profile": "https://Stackoverflow.com/users/1414", "pm_score": 2, "selected": false, "text": "$(\".container .component\").each(function() {\n if ($(\".container\", this).css('width') === \"auto\")\n $(\".conta...
2008/09/04
[ "https://Stackoverflow.com/questions/43926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2268/" ]
43,947
<p>Caveat: I'm relatively new to coding as well as <a href="http://macromates.com/" rel="nofollow noreferrer">TextMate</a>, so apologies if there is an obvious answer I'm missing here.</p> <p>I do a lot of HTML/CSS markup, there are certain patterns that I use a lot, for example, forms, navigation menus etc. What I wo...
[ { "answer_id": 43968, "author": "dF.", "author_id": 3002, "author_profile": "https://Stackoverflow.com/users/3002", "pm_score": 4, "selected": true, "text": "Tab Tab" } ]
2008/09/04
[ "https://Stackoverflow.com/questions/43947", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2977/" ]
43,955
<p>Is it possible to modify the title of the message box the confirm() function opens in JavaScript? </p> <p>I could create a modal popup box, but I would like to do this as minimalistic as possible. I would like to do something like this:</p> <pre><code>confirm("This is the content of the message box", "Modified tit...
[ { "answer_id": 24963561, "author": "Ramon", "author_id": 1211777, "author_profile": "https://Stackoverflow.com/users/1211777", "pm_score": 4, "selected": false, "text": "var iframe = document.createElement(\"IFRAME\");\niframe.setAttribute(\"src\", 'data:text/plain,');\ndocument.document...
2008/09/04
[ "https://Stackoverflow.com/questions/43955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2241/" ]
43,970
<p>I'm setting up a server which is on a network behind a firewall and I want programs on this computer to be able to use sendmail to send emails to any email address. We have an SMTP server running on this network (let's call it mailrelay.example.com) which is how we're supposed to get outgoing emails through the fir...
[ { "answer_id": 44014, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 2, "selected": false, "text": "DS\n DSmailrelay.example.com\n" }, { "answer_id": 107795, "author": "tardate", "author_id": 6329, ...
2008/09/04
[ "https://Stackoverflow.com/questions/43970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1694/" ]
43,971
<p>Let's say I have a web site for hosting community generated content that targets a very specific set of users. Now, let's say in the interest of fostering a better community I have an off-topic area where community members can post or talk about anything they want, regardless of the site's main theme.</p> <p>Now, ...
[ { "answer_id": 43983, "author": "UnkwnTech", "author_id": 115, "author_profile": "https://Stackoverflow.com/users/115", "pm_score": 6, "selected": true, "text": "<head> <meta name=\"robots\" content=\"noindex, nofollow\" />\n" }, { "answer_id": 19090271, "author": "Ajay Prasa...
2008/09/04
[ "https://Stackoverflow.com/questions/43971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043/" ]
43,992
<p>I want to allow my users to embed their own Flash animations in their posts. Usually the actual file is hosted on some free image hosting site. I wouldn't actually load the flash unless the user clicked a button to play (so that nothing auto-plays on page load). I know people can make some really annoying crap in...
[ { "answer_id": 52037, "author": "RickDT", "author_id": 5421, "author_profile": "https://Stackoverflow.com/users/5421", "pm_score": 2, "selected": false, "text": "var maskSpr : Sprite = new Sprite();\nmaskSpr.graphics.beginFill();\nmaskSpr.graphics.drawRect(0,0,safeWidth,safeHeight);\nmas...
2008/09/04
[ "https://Stackoverflow.com/questions/43992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744/" ]
43,995
<p>Handling multiple merges onto branches in Subversion or CVS is just one of those things that has to be experienced. It is inordinately easier to keep track of branches and merges in Mercurial (and probably any other distributed system) but I don't know why. Does anyone else know?</p> <p>My question stems from the f...
[ { "answer_id": 44708, "author": "Damien Diederen", "author_id": 3844, "author_profile": "https://Stackoverflow.com/users/3844", "pm_score": 8, "selected": true, "text": "gitk hg\nview o---A---o---B---o---C (branch #1)\n \\ \\\n o---o---M---X---? (branch #2)\n...
2008/09/04
[ "https://Stackoverflow.com/questions/43995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4003/" ]
44,007
<p>Is there any chance to get this work? I want my tests to be run by nunit2 task in NAnt. In addition I want to run NCover without running tests again. </p>
[ { "answer_id": 190097, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": true, "text": " <mkdir dir=\"${build}/coverage\" failonerror=\"false\"/>\n\n <!-- run the unit tests and generate code coverage -->\n ...
2008/09/04
[ "https://Stackoverflow.com/questions/44007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3182/" ]
44,019
<p>I need to diff two log files but ignore the time stamp part of each line (the first 12 characters to be exact). Is there a good tool, or a clever awk command, that could help me out?</p>
[ { "answer_id": 44028, "author": "Blair Conrad", "author_id": 1199, "author_profile": "https://Stackoverflow.com/users/1199", "pm_score": 5, "selected": false, "text": "cut -b13- file1 > trimmed_file1\ncut -b13- file2 > trimmed_file2\ndiff trimmed_file1 trimmed_file2\n" }, { "answ...
2008/09/04
[ "https://Stackoverflow.com/questions/44019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4061/" ]
44,034
<p>Unable to find a SQL diff tool that meets my needs, I am writing my own. Between the INFORMATION_SCHEMA and sys tables, I have a mostly-complete working version. But one thing I can't find in the metadata is the <em>definition</em> of a trigger, you know, the actual SQL code. Am I overlooking something?</p> <p>T...
[ { "answer_id": 28305390, "author": "Sathish", "author_id": 3789892, "author_profile": "https://Stackoverflow.com/users/3789892", "pm_score": 4, "selected": false, "text": "SELECT \n DB_NAME() AS DataBaseName, \n dbo.SysObjects.Name AS TriggerName,\n dbo.sysC...
2008/09/04
[ "https://Stackoverflow.com/questions/44034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4525/" ]
44,046
<p>I'm trying to determine the best way to truncate or drop extra decimal places in SQL without rounding. For example:</p> <pre><code>declare @value decimal(18,2) set @value = 123.456 </code></pre> <p>This will automatically round <code>@value</code> to be <code>123.46</code>, which is good in most cases. However,...
[ { "answer_id": 44049, "author": "SQLMenace", "author_id": 740, "author_profile": "https://Stackoverflow.com/users/740", "pm_score": -1, "selected": false, "text": "select convert(int,@value)\n" }, { "answer_id": 44052, "author": "Jimmy", "author_id": 4435, "author_pro...
2008/09/04
[ "https://Stackoverflow.com/questions/44046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105/" ]
44,048
<p>I've got an Apache server that has one access log file that is topping 600MB. This makes it really hard to search the file or parse it.<br> What software or modules for Apache are available that will make a daily copy of my access file to make it more manageable?</p>
[ { "answer_id": 44067, "author": "Eric Hogue", "author_id": 4137, "author_profile": "https://Stackoverflow.com/users/4137", "pm_score": 3, "selected": false, "text": "logrotate /etc/logrotate.conf weekly daily compress rotate 4" }, { "answer_id": 44096, "author": "Brian", ...
2008/09/04
[ "https://Stackoverflow.com/questions/44048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2863/" ]
44,066
<p>Is it possible to pass a reference to a function to another function in F#? Specifically, I'd like to pass lambda functions like</p> <p>foo(fun x -> x ** 3)</p> <p>More specifically, I need to know how I would refer to the passed function in a function that I wrote myself.</p>
[ { "answer_id": 44079, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 4, "selected": true, "text": "> List.map (fun x -> x % 2 = 0) [1 .. 5];;\n\nval it : bool list\n= [false; true; false; true; false]\n" }, { "ans...
2008/09/04
[ "https://Stackoverflow.com/questions/44066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2270/" ]
44,078
<p>I am trying to write a regular expression to strip all HTML with the exception of links (the <code>&lt;a href</code> and <code>&lt;/a&gt;</code> tags respectively. It does not have to be 100% secure (I am not worried about injection attacks or anything as I am parsing content that has already been approved and publi...
[ { "answer_id": 44088, "author": "Jimmy", "author_id": 4435, "author_profile": "https://Stackoverflow.com/users/4435", "pm_score": -1, "selected": false, "text": "<[^a](.|\\n)+?>\n" }, { "answer_id": 44124, "author": "Xetius", "author_id": 274, "author_profile": "https...
2008/09/04
[ "https://Stackoverflow.com/questions/44078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1306/" ]
44,084
<p>That's it. If you want to document a function or a class, you put a string just after the definition. For instance:</p> <pre><code>def foo(): """This function does nothing.""" pass </code></pre> <p>But what about a module? How can I document what a <em>file.py</em> does?</p>
[ { "answer_id": 44095, "author": "Grégoire Cachet", "author_id": 1044, "author_profile": "https://Stackoverflow.com/users/1044", "pm_score": 7, "selected": true, "text": "__init__.py" }, { "answer_id": 23450896, "author": "Brad Koch", "author_id": 425313, "author_profi...
2008/09/04
[ "https://Stackoverflow.com/questions/44084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1679/" ]
44,089
<p>I have connected to a server via SFTP using FileZilla and accepted adding the server's SSH key to the key cache in FileZilla. </p> <p>How can I extract this cached key to a keyfile so that may use it through other SFTP applications that require a keyfile be made available? </p> <p>I have not been able to find an...
[ { "answer_id": 44712, "author": "Doug Porter", "author_id": 4311, "author_profile": "https://Stackoverflow.com/users/4311", "pm_score": 3, "selected": false, "text": "ssh-keyscan -t rsa <my_ftp_ip_address> > c:\\known_hosts\nssh-keyscan -t dsa <my_ftp_ip_address> > c:\\known_hosts\n" }...
2008/09/04
[ "https://Stackoverflow.com/questions/44089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4311/" ]
44,100
<p>This is a fairly trivial matter, but I'm curious to hear people's opinions on it.</p> <p>If I have a Dictionary which I'm access through properties, which of these formats would you prefer for the property?</p> <pre><code>/// &lt;summary&gt; /// This class's FirstProperty property /// &lt;/summary&gt; [DefaultValu...
[ { "answer_id": 44134, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 0, "selected": false, "text": "public string FirstProperty {\nget {\n return Dictionary[PropertyName()];\n}\nset {\n Dictionary[PropertyName()] ...
2008/09/04
[ "https://Stackoverflow.com/questions/44100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1512/" ]
44,101
<p>How do you insert invisible watermarks in images for copyright purposes? I'm looking for a python library.</p> <p>What algorithm do you use? What about performance and efficiency?</p>
[ { "answer_id": 45232, "author": "tghw", "author_id": 2363, "author_profile": "https://Stackoverflow.com/users/2363", "pm_score": 2, "selected": false, "text": "def reduceOpacity(im, opacity):\n \"\"\"Returns an image with reduced opacity.\"\"\"\n assert opacity >= 0 and opacity <= ...
2008/09/04
[ "https://Stackoverflow.com/questions/44101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1044/" ]
44,109
<p>What's the best way to extend the User model (bundled with Django's authentication app) with custom fields? I would also possibly like to use the email as the username (for authentication purposes).</p> <p>I've already seen a <a href="http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inhe...
[ { "answer_id": 44178, "author": "Ryan Duffield", "author_id": 2696, "author_profile": "https://Stackoverflow.com/users/2696", "pm_score": 9, "selected": true, "text": "OneToOneField(User) User django.contrib.auth.models.User User" }, { "answer_id": 965883, "author": "Raisins"...
2008/09/04
[ "https://Stackoverflow.com/questions/44109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2841/" ]
44,131
<p>I need to display a variable-length message and allow the text to be selectable. I have made the TextBox ReadOnly which does not allow the text to be edited, but the input caret is still shown. </p> <p>The blinking input caret is confusing. How do I hide it?</p>
[ { "answer_id": 44146, "author": "Simon Gillbee", "author_id": 756, "author_profile": "https://Stackoverflow.com/users/756", "pm_score": 1, "selected": false, "text": "Enable=false System.Drawing.SystemColors SystemColors.ControlLight" }, { "answer_id": 44174, "author": "Lars ...
2008/09/04
[ "https://Stackoverflow.com/questions/44131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1042/" ]
44,145
<p>What's the best way to deal with a sharded database in Rails? Should the sharding be handled at the application layer, the active record layer, the database driver layer, a proxy layer, or something else altogether? What are the pros and cons of each?</p>
[ { "answer_id": 68921027, "author": "Oshan Wisumperuma", "author_id": 3011280, "author_profile": "https://Stackoverflow.com/users/3011280", "pm_score": 2, "selected": false, "text": "production:\n primary:\n database: my_primary_database\n adapter: mysql2\n primary_replica:\n d...
2008/09/04
[ "https://Stackoverflow.com/questions/44145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4061/" ]
44,153
<p>Like the title says: Can reflection give you the name of the currently executing method.</p> <p>I'm inclined to guess not, because of the Heisenberg problem. How do you call a method that will tell you the current method without changing what the current method is? But I'm hoping someone can prove me wrong there....
[ { "answer_id": 44165, "author": "Lex", "author_id": 4109, "author_profile": "https://Stackoverflow.com/users/4109", "pm_score": 4, "selected": false, "text": "public static T CreateWrapper<T>(Exception innerException, params object[] parameterValues) where T : Exception, new()\n{\n if...
2008/09/04
[ "https://Stackoverflow.com/questions/44153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043/" ]
44,176
<p>Is there a way to perform a full text search of a subversion repository, including all the history?</p> <p>For example, I've written a feature that I used somewhere, but then it wasn't needed, so I svn rm'd the files, but now I need to find it again to use it for something else. The svn log probably says something ...
[ { "answer_id": 44226, "author": "Jack M.", "author_id": 3421, "author_profile": "https://Stackoverflow.com/users/3421", "pm_score": 4, "selected": false, "text": "/ svn diff -r0:HEAD | less\n grep svn log 0" }, { "answer_id": 2019277, "author": "Bas Grolleman", "author_id...
2008/09/04
[ "https://Stackoverflow.com/questions/44176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3408/" ]
44,177
<p>A friend of mine told me there was a way to connect two private IPs without using a proxy server. The idea was that both computers connected to a public server and some how the server joined the private connections and won't use any more bandwidth.</p> <p>Is this true? How's this technique named?</p>
[ { "answer_id": 44231, "author": "jj33", "author_id": 430, "author_profile": "https://Stackoverflow.com/users/430", "pm_score": 0, "selected": false, "text": "ssh -R localhost:13306:localhost:3306 username@serverA\n ssh -L 3306:localhost:13306 username@serverA\n" } ]
2008/09/04
[ "https://Stackoverflow.com/questions/44177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4269/" ]
44,181
<p>I have a database with two tables (<code>Table1</code> and <code>Table2</code>). They both have a common column <code>[ColumnA]</code> which is an <code>nvarchar</code>. </p> <p>How can I select this column from both tables and return it as a single column in my result set?</p> <p>So I'm looking for something like...
[ { "answer_id": 44183, "author": "Kevin Fairchild", "author_id": 3743, "author_profile": "https://Stackoverflow.com/users/3743", "pm_score": 5, "selected": true, "text": "SELECT ColumnA FROM Table1 UNION Select ColumnB FROM Table2 ORDER BY 1\n" }, { "answer_id": 44186, "author...
2008/09/04
[ "https://Stackoverflow.com/questions/44181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1980/" ]
44,190
<p>I am looking for a simple JavaScript example that updates DOM.<br> Any suggestions?</p>
[ { "answer_id": 44216, "author": "Neall", "author_id": 619, "author_profile": "https://Stackoverflow.com/users/619", "pm_score": 4, "selected": true, "text": "var newnode = document.createTextNode('Here is some text.');\ndocument.getElementById('maincontent').appendChild(newnode);\n" },...
2008/09/04
[ "https://Stackoverflow.com/questions/44190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370899/" ]
44,194
<p>This is what I've got. It works. But, is there a simpler or better way?</p> <p>One an ASPX page, I've got the download link...</p> <pre><code>&lt;asp:HyperLink ID="HyperLinkDownload" runat="server" NavigateUrl="~/Download.aspx"&gt;Download as CSV file&lt;/asp:HyperLink&gt; </code></pre> <p>And then I've got the D...
[ { "answer_id": 44219, "author": "Simon Gillbee", "author_id": 756, "author_profile": "https://Stackoverflow.com/users/756", "pm_score": 6, "selected": true, "text": "CsvLine.Append(Format(b.Price, \"c\").Replace(\",\", \"\"))\n CsvLine.Append(String.Format(\"\\\"{0:c}\\\"\", b.Price))\n ...
2008/09/04
[ "https://Stackoverflow.com/questions/44194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83/" ]
44,207
<p>XML, granted, is very useful, but can be quite verbose. What alternatives are there and are they specialised for any particular purpose? Library support to interrogate the contents easily is a big plus point.</p>
[ { "answer_id": 20363397, "author": "Qwertie", "author_id": 22820, "author_profile": "https://Stackoverflow.com/users/22820", "pm_score": 0, "selected": false, "text": "// LES code has no built-in meaning. This just shows what it looks like.\n[DelayedWrite] // an \"attribute\"\nOutput(\n ...
2008/09/04
[ "https://Stackoverflow.com/questions/44207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3233/" ]
44,220
<p>I have been told that there is a performance difference between the following code blocks.</p> <pre><code>foreach (Entity e in entityList) { .... } </code></pre> <p>and </p> <pre><code>for (int i=0; i&lt;entityList.Count; i++) { Entity e = (Entity)entityList[i]; ... } </code></pre> <p>where</p> <pre><cod...
[ { "answer_id": 44248, "author": "OwenP", "author_id": 2547, "author_profile": "https://Stackoverflow.com/users/2547", "pm_score": 0, "selected": false, "text": "const int ArraySize = 10;\nint[] values = new int[ArraySize];\n\n//...\n\nfor (int i = 0; i \n\nIn this case, depending on the...
2008/09/04
[ "https://Stackoverflow.com/questions/44220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2894/" ]
44,241
<p>Is there a way to track which window currently has keyboard focus. I could handle WM_SETFOCUS for every window but I'm wondering if there's an alternative, simpler method (i.e. a single message handler somewhere).</p> <p>I could use OnIdle() in MFC and call GetFocus() but that seems a little hacky.</p>
[ { "answer_id": 44371, "author": "JosephStyons", "author_id": 672, "author_profile": "https://Stackoverflow.com/users/672", "pm_score": 0, "selected": false, "text": "<snip>\n\nfunction TForm1.GetCurrentHandle: integer;\nvar\n activeWinHandle: HWND;\n focusedThreadID : DWORD;\nbegin\n ...
2008/09/04
[ "https://Stackoverflow.com/questions/44241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2768/" ]
44,260
<p>We've got an interesting case where we are trying to determine how different instances of our app were launched. Is there any way for .NET to be able to query another running instance and get the command line parameters passed to that instance? I've not been able to find any way to do it in .NET so far, so I thought...
[ { "answer_id": 127201, "author": "Noah", "author_id": 4539, "author_profile": "https://Stackoverflow.com/users/4539", "pm_score": 0, "selected": false, "text": "try\n{\n ManagementScope connectScope = new ManagementScope();\n connectScope.Path = new ManagementPath(@\"\\\\\" + Environ...
2008/09/04
[ "https://Stackoverflow.com/questions/44260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4539/" ]
44,261
<p>When I open cmd on my laptop it is defaulting to the F: drive. This is troubling me does anyone know how it got that way or how to get it back to where it opens to the C: drive by default?</p>
[ { "answer_id": 44268, "author": "OwenP", "author_id": 2547, "author_profile": "https://Stackoverflow.com/users/2547", "pm_score": 3, "selected": true, "text": "%HOMEDRIVE%\\%HOMEPATH%" }, { "answer_id": 88631, "author": "tsellon", "author_id": 3575, "author_profile": ...
2008/09/04
[ "https://Stackoverflow.com/questions/44261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4491/" ]
44,270
<p>What is the best algorithm to take array like below:</p> <p><code>A {0,1,2,3}</code></p> <p>I expected to order it like array below:</p> <p><code>B {3,1,0,2}</code> </p> <p>Any ideas?</p>
[ { "answer_id": 44296, "author": "EBGreen", "author_id": 1358, "author_profile": "https://Stackoverflow.com/users/1358", "pm_score": 1, "selected": false, "text": "Make an ArrayList\nCopy the contents of the smaller array to the arraylist\nfor each item I in the larger array\n FInd I i...
2008/09/04
[ "https://Stackoverflow.com/questions/44270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4541/" ]
44,272
<p>This is a php example, but an algorithm for any language would do. What I specifically want to do is bubble up the United States and Canada to the top of the list. Here is an example of the array shortened for brevity. </p> <pre><code>array( 0 =&gt; '-- SELECT --', 1 =&gt; 'Afghanistan', 2 =&gt; 'Albania', ...
[ { "answer_id": 44889, "author": "Michał Niedźwiedzki", "author_id": 2169, "author_profile": "https://Stackoverflow.com/users/2169", "pm_score": 1, "selected": false, "text": "$a = array(\n 0 => '- select -',\n 1 => 'Afghanistan',\n 2 => 'Albania',\n 3 => 'Algeria',\n 80 =>...
2008/09/04
[ "https://Stackoverflow.com/questions/44272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1797/" ]
44,286
<p>Are there any good programs for dealing with reading large CSV files? Some of the datafiles I deal with are in the 1 GB range. They have too many lines for Excel to even deal with. Using Access can be a little slow, as you have to actually import them into a database to work with them directly. Is there a program ...
[ { "answer_id": 44955, "author": "David Locke", "author_id": 1447, "author_profile": "https://Stackoverflow.com/users/1447", "pm_score": 0, "selected": false, "text": "from augustus.kernel.unitable import *\na = UniTable().from_csv_file('filename')\nb = a.subtbl(a['key'] == some_value) #c...
2008/09/04
[ "https://Stackoverflow.com/questions/44286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1862/" ]
44,288
<p>Comparing string in C# is pretty simple. In fact there are several ways to do it. I have listed some in the block below. What I am curious about are the differences between them and when one should be used over the others? Should one be avoided at all costs? Are there more I haven't listed? </p> <pre><code>st...
[ { "answer_id": 44301, "author": "Ed S.", "author_id": 1053, "author_profile": "https://Stackoverflow.com/users/1053", "pm_score": 6, "selected": false, "text": ".Equals .CompareTo .Equals == string .Equals Object.ReferenceEquals == ==" }, { "answer_id": 44303, "author": "Owen...
2008/09/04
[ "https://Stackoverflow.com/questions/44288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2894/" ]
44,298
<p>I have a databound TextBox in my application like so: (The type of <code>Height</code> is <code>decimal?</code>)</p> <pre class="lang-xml prettyprint-override"><code> &lt;TextBox Text=&quot;{Binding Height, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True, ...
[ { "answer_id": 47663, "author": "David Schmitt", "author_id": 4918, "author_profile": "https://Stackoverflow.com/users/4918", "pm_score": 3, "selected": true, "text": "TextBox PreviewLostKeyBoardFocus <TextBox PreviewLostKeyboardFocus=\"TextBox_PreviewLostKeyboardFocus\" /> \n ...
2008/09/04
[ "https://Stackoverflow.com/questions/44298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/317/" ]
44,337
<p>As an exercise for myself, I was translating a sample program into various languages. Starting in C#, I had a visitor-pattern interface like so:</p> <pre><code>interface Visitor { void Accept(Bedroom x); void Accept(Bathroom x); void Accept(Kitchen x); void Accept(LivingRoom x)...
[ { "answer_id": 47663, "author": "David Schmitt", "author_id": 4918, "author_profile": "https://Stackoverflow.com/users/4918", "pm_score": 3, "selected": true, "text": "TextBox PreviewLostKeyBoardFocus <TextBox PreviewLostKeyboardFocus=\"TextBox_PreviewLostKeyboardFocus\" /> \n ...
2008/09/04
[ "https://Stackoverflow.com/questions/44337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4540/" ]
44,338
<p>I'm trying to be better about unit testing my code, but right now I'm writing a lot of code that deals with remote systems. SNMP, WMI, that sort of thing. With most classes I can mock up objects to test them, but how do you deal with unit testing a real system? For example, if my class goes out and gets the Win32...
[ { "answer_id": 44525, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "class LogicalDiskConsumer(object):\n\n def __init__(self, arg1, arg2, LogicalDiskFactory)\n self.arg1=arg1\n se...
2008/09/04
[ "https://Stackoverflow.com/questions/44338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4550/" ]
44,352
<p>In Python, given a module X and a class Y, how can I iterate or generate a list of all subclasses of Y that exist in module X?</p>
[ { "answer_id": 44381, "author": "Chris AtLee", "author_id": 4558, "author_profile": "https://Stackoverflow.com/users/4558", "pm_score": 5, "selected": true, "text": "import inspect\n\ndef get_subclasses(mod, cls):\n \"\"\"Yield the classes in module ``mod`` that inherit from ``cls``\"...
2008/09/04
[ "https://Stackoverflow.com/questions/44352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
44,359
<p>I have built a basic data entry application allowing users to browse external content in iframe and enter data quickly from the same page. One of the data variables is the URL. Ideally I would like to be able to load the iframes current url into a textbox with javascript. I realize now that this is not going to happ...
[ { "answer_id": 46361, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": -1, "selected": false, "text": "<iframe name='myframe' id='myframe' src='http://www.google.com'></iframe>\n document.getElementById('myframe').src\n" }, {...
2008/09/04
[ "https://Stackoverflow.com/questions/44359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4568/" ]
44,364
<p>So, I was reading the Google testing blog, and it says that global state is bad and makes it hard to write tests. I believe it--my code is difficult to test right now. So how do I avoid global state?</p> <p>The biggest things I use global state (as I understand it) for is managing key pieces of information betwee...
[ { "answer_id": 44558, "author": "JC.", "author_id": 3615, "author_profile": "https://Stackoverflow.com/users/3615", "pm_score": 2, "selected": false, "text": "public interface ISettingsProvider\n{\n string ConnectionString { get; }\n}\n\npublic class TestSettings : ISettingsProvider\n...
2008/09/04
[ "https://Stackoverflow.com/questions/44364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/681/" ]
44,376
<p>How do you shade alternating rows in a SQL Server Reporting Services report?</p> <hr> <p><strong>Edit:</strong> There are a bunch of good answers listed below--from <a href="https://stackoverflow.com/questions/44376/add-alternating-row-color-to-sql-server-reporting-services-report#44378">quick</a> and <a href="htt...
[ { "answer_id": 44378, "author": "Michael Haren", "author_id": 29, "author_profile": "https://Stackoverflow.com/users/29", "pm_score": 9, "selected": true, "text": "= IIf(RowNumber(Nothing) Mod 2 = 0, \"Silver\", \"Transparent\")\n = If(RowNumber(Nothing) Mod 2 = 0, \"Silver\", \"Transpar...
2008/09/04
[ "https://Stackoverflow.com/questions/44376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29/" ]
44,383
<p>I am looking for a method of reading emails using Pop3 in C# 2.0. Currently, I am using code found in <a href="http://www.codeproject.com/KB/IP/Pop3MimeClient.aspx?fid=341657" rel="noreferrer">CodeProject</a>. However, this solution is less than ideal. The biggest problem is that it doesn't support emails written in...
[ { "answer_id": 102135, "author": "Martin Vobr", "author_id": 16132, "author_profile": "https://Stackoverflow.com/users/16132", "pm_score": 4, "selected": false, "text": "// \n// create client, connect and log in \nPop3 client = new Pop3();\nclient.Connect(\"pop3.example.org\");\nclient.L...
2008/09/04
[ "https://Stackoverflow.com/questions/44383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/889/" ]
44,391
<p>This is related to <a href="https://stackoverflow.com/questions/43324/can-i-put-an-aspnet-session-id-in-a-hidden-form-field">another question I asked</a>. In summary, I have a special case of a URL where, when a form is POSTed to it, I can't rely on cookies for authentication or to maintain the user's session, but I...
[ { "answer_id": 2092673, "author": "awe", "author_id": 109392, "author_profile": "https://Stackoverflow.com/users/109392", "pm_score": 1, "selected": false, "text": "LosFormatter private string EncodeText(string text) {\n StringWriter writer = new StringWriter();\n LosFormatter formatte...
2008/09/04
[ "https://Stackoverflow.com/questions/44391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2527/" ]
44,394
<p>I have a MemoryStream with the contents of a Font File (.ttf) and I would like to be able to create a FontFamily WPF object from that stream <strong>WITHOUT</strong> writing the contents of the stream to disk. I know this is possible with a System.Drawing.FontFamily but I cannot find out how to do it with System.Win...
[ { "answer_id": 65662363, "author": "Patrick Klug", "author_id": 10779, "author_profile": "https://Stackoverflow.com/users/10779", "pm_score": 2, "selected": false, "text": "public static void Load(MemoryStream stream)\n{\n byte[] streamData = new byte[stream.Length];\n stream.Read(...
2008/09/04
[ "https://Stackoverflow.com/questions/44394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4572/" ]
44,396
<p>I use Eclipse, Maven, and Java in my development. I use Maven to download dependencies (jar files and javadoc when available) and Maven's eclipse plug-in to generate the .project and .classpath files for Eclipse. When the dependency downloaded does not have attached javadoc I manually add a link for the javadoc in t...
[ { "answer_id": 44405, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": -1, "selected": false, "text": "-DdownloadSources=true" }, { "answer_id": 97168, "author": "ddimitrov", "author_id": 18187, "author_profi...
2008/09/04
[ "https://Stackoverflow.com/questions/44396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4476/" ]
44,401
<p>I've got a sign up form that requires the user to enter their email and password, both are in two separate text boxes. I want to provide a button that the user can click so that the password (which is masked) will appear in a popup when the user clicks the button.</p> <p>Currently my JavaScript code for this is as ...
[ { "answer_id": 44436, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 1, "selected": false, "text": "button.value = password;\n password.value alert() function toggleShowPassword() { \n var button = $get('PASSWORD_TEXT...
2008/09/04
[ "https://Stackoverflow.com/questions/44401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/750/" ]
44,408
<p>I would like to generate a random floating point number between 2 values. What is the best way to do this in C#?</p>
[ { "answer_id": 44424, "author": "Ryan Farley", "author_id": 1627, "author_profile": "https://Stackoverflow.com/users/1627", "pm_score": 2, "selected": false, "text": "// generate a random number starting with 5 and less than 15\nRandom r = new Random();\nint num = r.Next(5, 15); \n" }...
2008/09/04
[ "https://Stackoverflow.com/questions/44408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2064/" ]
44,421
<p>I have a web application developed with ASP.net and C# that is running on my companies' intranet. Because all the users for this application are all using Microsoft Outlook without exception, I would like for the the application to open up an Outlook message on the client-side. <strong>I understand that Office is...
[ { "answer_id": 44452, "author": "Doozer", "author_id": 4581, "author_profile": "https://Stackoverflow.com/users/4581", "pm_score": 1, "selected": false, "text": "mailto:recipient@email.tld?subject=This%20is%20the%20subject&body=Hello%20there!\n" } ]
2008/09/04
[ "https://Stackoverflow.com/questions/44421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/730/" ]
44,453
<p>I've got a web application working using VB and Ajax. I'm using updatepanels to avoid the irritating "flicker" on postbacks to the server. </p> <p>I would like to have a button control defined within the updatepanel itself (tried moving it outside and got some catastrophic error, so left it there) that makes the c...
[ { "answer_id": 259156, "author": "Ryan Lundy", "author_id": 5486, "author_profile": "https://Stackoverflow.com/users/5486", "pm_score": 0, "selected": false, "text": "protected override void OnInit(EventArgs e)\n{\n var scriptManager = ScriptManager.GetCurrent(this);\n // or this.P...
2008/09/04
[ "https://Stackoverflow.com/questions/44453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
44,470
<p>Every time I publish the application in <a href="http://en.wikipedia.org/wiki/ClickOnce" rel="nofollow noreferrer">ClickOnce</a> I get get it to update the revision number by one. Is there a way to get this change automatically to change the version number in AssemblyInfo.cs file (all our error reporting looks at th...
[ { "answer_id": 152430, "author": "Rinat Abdullin", "author_id": 47366, "author_profile": "https://Stackoverflow.com/users/47366", "pm_score": 2, "selected": false, "text": "-v -mv" }, { "answer_id": 152493, "author": "Jason Stangroome", "author_id": 20819, "author_pro...
2008/09/04
[ "https://Stackoverflow.com/questions/44470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3798/" ]
44,476
<p>I'm trying to convert a multipage color tiff file to a c# CompressionCCITT3 tiff in C#. I realize that I need to make sure that all pixels are 1 bit. I have not found a useful example of this online.</p>
[ { "answer_id": 1364055, "author": "plinth", "author_id": 20481, "author_profile": "https://Stackoverflow.com/users/20481", "pm_score": 1, "selected": false, "text": "FileSystemImageSource source = new FileSystemImageSource(\"path-to-your-file.tif\", true); // true = loop over all frames\...
2008/09/04
[ "https://Stackoverflow.com/questions/44476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178/" ]
44,481
<p>For this directory structure:</p> <pre><code>. |-- README.txt |-- firstlevel.rb `-- lib |-- models | |-- foo | | `-- fourthlevel.rb | `-- thirdlevel.rb `-- secondlevel.rb 3 directories, 5 files </code></pre> <p>The glob would match: </p> <pre><code>firstlevel.rb lib/secondlevel.rb l...
[ { "answer_id": 44486, "author": "James A. Rosen", "author_id": 1190, "author_profile": "https://Stackoverflow.com/users/1190", "pm_score": 1, "selected": false, "text": "Dir.glob('**/*.rb') perhaps?\n" }, { "answer_id": 44494, "author": "Chris AtLee", "author_id": 4558, ...
2008/09/04
[ "https://Stackoverflow.com/questions/44481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3624/" ]
44,509
<p>Our company has multiple domains set up with one website hosted on each of the domains. At this time, each domain has its own authentication which is done via cookies. </p> <p>When someone logged on to one domain needs to access anything from the other, the user needs to log in again using different credentials on ...
[ { "answer_id": 44596, "author": "jason saldo", "author_id": 1293, "author_profile": "https://Stackoverflow.com/users/1293", "pm_score": 4, "selected": false, "text": "mail.xyz.example www.xyz.example logon.xyz.example abc.example xyz.example www.tre.example" }, { "answer_id": 450...
2008/09/04
[ "https://Stackoverflow.com/questions/44509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311/" ]
44,532
<p>Do you attach the images? </p> <p>Use absolute urls? </p> <p>How do you best avoid getting flagged as spam? </p>
[ { "answer_id": 45118, "author": "EndangeredMassa", "author_id": 106, "author_profile": "https://Stackoverflow.com/users/106", "pm_score": 3, "selected": false, "text": "<img src=\"cid:imagefilename.jpg\" />\n" } ]
2008/09/04
[ "https://Stackoverflow.com/questions/44532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1797/" ]
44,542
<p>Can someome provide code or pseudo-code for how the paging links on StackOverflow are generated?</p> <p>I keep racking my brain but can't think of a decent way to build the dynamic links that always show the 2 pages around the current, plus the first and last.</p> <p>Example: <code>1 ... 5 6 7 ... 593</code></p>
[ { "answer_id": 44614, "author": "Ian", "author_id": 4396, "author_profile": "https://Stackoverflow.com/users/4396", "pm_score": 2, "selected": false, "text": "numPages = ceiling(totalRecords / numPerPage)" }, { "answer_id": 44627, "author": "Jimmy", "author_id": 4435, ...
2008/09/04
[ "https://Stackoverflow.com/questions/44542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1097/" ]
44,554
<p>As <a href="https://blog.stackoverflow.com/2008/09/podcast-20/">Jeff Atwood asked</a>: &quot;What’s your logging philosophy? Should all code be littered with <code>.logthis()</code> and <code>.logthat()</code> calls? Or do you inject logging after the fact somehow?&quot;</p>
[ { "answer_id": 44577, "author": "Pierre Arnaud", "author_id": 4597, "author_profile": "https://Stackoverflow.com/users/4597", "pm_score": 1, "selected": false, "text": "System.Diagnostics.Assert" }, { "answer_id": 549143, "author": "Bob Moore", "author_id": 9368, "aut...
2008/09/04
[ "https://Stackoverflow.com/questions/44554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/672/" ]
44,569
<p>I have never used octal numbers in my code nor come across any code that used it (hexadecimal and bit twiddling notwithstanding).</p> <p>I started programming in C/C++ about 1994 so maybe I'm too young for this? Does older code use octal? C includes support for these by prepending a 0, but where is the code that us...
[ { "answer_id": 44575, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 3, "selected": false, "text": "chmod mkdir" }, { "answer_id": 44590, "author": "Ben Collins", "author_id": 3279, "author_profile": "h...
2008/09/04
[ "https://Stackoverflow.com/questions/44569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2543/" ]
44,617
<p>I would like to be able to add a "message" to a unit test, such that it actually appears within the TestResult.xml file generated by NUnit. For example, this is currently generated:</p> <pre><code>&lt;results&gt; &lt;test-case name="MyNamespace.Tests.MyTest" executed="True" success="True" time="0.203" asserts=...
[ { "answer_id": 339415, "author": "Cpt. Jack Sparrow", "author_id": 43050, "author_profile": "https://Stackoverflow.com/users/43050", "pm_score": 3, "selected": false, "text": "Assert.AreEqual(250.00, destination.Balance, \"some message here\");\n" }, { "answer_id": 48751457, ...
2008/09/04
[ "https://Stackoverflow.com/questions/44617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2696/" ]
44,656
<p>The code that I want to write is like this:</p> <pre><code>void MethodOnThreadA() { for (;;) { // Do stuff if (ErrorConditionMet) ThrowOnThread(threadB, new MyException(...)); } } void MethodOnThreadB() { try { for (;;) { // Do stuff ...
[ { "answer_id": 44761, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 4, "selected": true, "text": "At some random time, throw an exception on thread B:\n try {\n //do stuff\n} finally {\n CloseResourceOne();\n //...
2008/09/04
[ "https://Stackoverflow.com/questions/44656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4592/" ]
44,660
<p>I need to write a program that can sift through specially-formatted text files (essentially CSV files with a fixed set of column types that have different delimiters for some columns ... comma in most places, colons in others) to search for formatting errors. I figure regular expressions will be the way to go.</p> ...
[ { "answer_id": 30513515, "author": "Michael Kropat", "author_id": 27581, "author_profile": "https://Stackoverflow.com/users/27581", "pm_score": 2, "selected": false, "text": "Dim matcher As RegExp\nSet matcher = New RegExp\nmatcher.Pattern = \"^super cool string$\"\nIf matcher.Test(someS...
2008/09/04
[ "https://Stackoverflow.com/questions/44660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4602/" ]
44,693
<p>In C++, what alternatives do I have for exposing a collection, from the point of view of performance and data integrity?</p> <p>My problem is that I want to return an internal list of data to the caller, but I don't want to generate a copy. Thant leaves me with either returning a reference to the list, or a pointer...
[ { "answer_id": 44697, "author": "Ben Collins", "author_id": 3279, "author_profile": "https://Stackoverflow.com/users/3279", "pm_score": 2, "selected": false, "text": "const std::vector<mydata>& getData()\n{\n return _myPrivateData;\n}\n const_cast" }, { "answer_id": 44762, "...
2008/09/04
[ "https://Stackoverflow.com/questions/44693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3081/" ]
44,713
<p>How can I create an empty one-dimensional string array?</p>
[ { "answer_id": 44720, "author": "ZombieSheep", "author_id": 377, "author_profile": "https://Stackoverflow.com/users/377", "pm_score": 1, "selected": false, "text": "string[] newArray = new string[0];\n List<string>\n newListOfString.ToArray();\n" }, { "answer_id": 44725, "aut...
2008/09/04
[ "https://Stackoverflow.com/questions/44713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3821/" ]
44,715
<p>Ruby setters—whether created by <code>(c)attr_accessor</code> or manually—seem to be the only methods that need <code>self.</code> qualification when accessed within the class itself. This seems to put Ruby alone the world of languages:</p> <ul> <li>All methods need <code>self</code>/<code>this</code> (like Perl, ...
[ { "answer_id": 44779, "author": "Mike Stone", "author_id": 122, "author_profile": "https://Stackoverflow.com/users/122", "pm_score": 6, "selected": false, "text": "qwerty = 4 qwerty self. self. class A\n def test\n 4\n end\n def use_variable\n test = 5\n test\n end\n def us...
2008/09/04
[ "https://Stackoverflow.com/questions/44715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4615/" ]
44,757
<p>I heard on a recent podcast (Polymorphic) that it is possible to cache a user control as opposed to the entire page. </p> <p>I think my header control which displays static content and my footer control could benefit from being cached. </p> <p>How can I go about caching just those controls?</p>
[ { "answer_id": 44770, "author": "Mike", "author_id": 4523, "author_profile": "https://Stackoverflow.com/users/4523", "pm_score": 3, "selected": true, "text": "VaryByParam VaryByControl" } ]
2008/09/04
[ "https://Stackoverflow.com/questions/44757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/648/" ]
44,771
<p>Ok, so my method in my webservice requires a type to be passed, it is called in the ServiceMethod property of the AutoCompleteExtender, I am fuzzy about how I should do that so I called it like this:</p> <pre><code>ServiceMethod="DropDownLoad&lt;&lt;%=(typeof)subCategory%&gt;&gt;" </code></pre> <p>where subCategor...
[ { "answer_id": 44923, "author": "bentford", "author_id": 946, "author_profile": "https://Stackoverflow.com/users/946", "pm_score": 2, "selected": true, "text": "[WebMethod]\npublic string[] GetSearchList(string prefixText, int count)\n{\n}\n\n[WebMethod]\npublic string[] GetSearchList2<T...
2008/09/04
[ "https://Stackoverflow.com/questions/44771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4140/" ]
44,777
<p>I'm sending mail from my C# Application, using the SmtpClient. Works great, but I have to decide if I want to send the mail as Plain Text or HTML. I wonder, is there a way to send both? I think that's called multipart.</p> <p>I googled a bit, but most examples essentially did not use SmtpClient but composed the who...
[ { "answer_id": 44877, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 6, "selected": false, "text": "MailMessage msg = new MailMessage(username, nu.email, subject, body);\nmsg.BodyEncoding = Encoding.UTF8;\nmsg.SubjectEncodin...
2008/09/04
[ "https://Stackoverflow.com/questions/44777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91/" ]
44,778
<p>What would be your preferred way to concatenate strings from a sequence such that between every two consecutive pairs a comma is added. That is, how do you map, for instance, <code>['a', 'b', 'c']</code> to <code>'a,b,c'</code>? (The cases <code>['s']</code> and <code>[]</code> should be mapped to <code>'s'</code> a...
[ { "answer_id": 44781, "author": "Mark Biek", "author_id": 305, "author_profile": "https://Stackoverflow.com/users/305", "pm_score": 11, "selected": true, "text": "my_list = ['a', 'b', 'c', 'd']\nmy_string = ','.join(my_list)\n 'a,b,c,d'\n my_string = ','.join(map(str, my_list)) \n" }, ...
2008/09/04
[ "https://Stackoverflow.com/questions/44778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4285/" ]
44,780
<p>What's the best way to implement a SQL script that will grant select, references, insert, update, and delete permissions to a database role on all the user tables in a database?</p> <p>Ideally, this script could be run multiple times, as new tables were added to the database. SQL Server Management Studio generates ...
[ { "answer_id": 45907, "author": "ninesided", "author_id": 1030, "author_profile": "https://Stackoverflow.com/users/1030", "pm_score": 2, "selected": true, "text": " IF EXISTS (\n SELECT 1 FROM sysobjects\n WHERE name = 'sp_grantastic'\n AND type = 'P'\n)\nDROP PROCEDURE sp_grant...
2008/09/04
[ "https://Stackoverflow.com/questions/44780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3475/" ]
44,787
<p>Scenario: You have an ASP.Net webpage that should display the next image in a series of images. If 1.jpg is currently loaded, the refresh should load 2.jpg.<br> Assuming I would use this code, where do you get the current images name.</p> <pre><code>string currImage = MainPic.ImageUrl.Replace(".jpg", ""); currIma...
[ { "answer_id": 44804, "author": "chakrit", "author_id": 3055, "author_profile": "https://Stackoverflow.com/users/3055", "pm_score": 3, "selected": false, "text": "ViewState var lastPicNum = (int)ViewState[\"lastPic\"];\nlastPicNum++;\n\nMainPic.ImageUrl = string.Format(\"~/Images/{0}.jpg...
2008/09/04
[ "https://Stackoverflow.com/questions/44787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4298/" ]
44,795
<p>I'm on .NET 2.0, running under Medium Trust (so <a href="http://msdn.microsoft.com/en-us/library/system.timezoneinfo.aspx" rel="nofollow noreferrer">TimeZoneInfo</a> and the Registry are not allowed options). I'm asking the user for two dates and a time zone, and would really love to be able to automatically determ...
[ { "answer_id": 44819, "author": "Domenic", "author_id": 3191, "author_profile": "https://Stackoverflow.com/users/3191", "pm_score": 0, "selected": false, "text": "TimeZoneInfo TimeZoneInfo" } ]
2008/09/04
[ "https://Stackoverflow.com/questions/44795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2688/" ]
44,799
<p>We're currently building an application that executes a number of external tools. We often have to pass information entered into our system by users to these tools.</p> <p>Obviously, this is a big security nightmare waiting to happen.</p> <p>Unfortunately, we've not yet found any classes in the .NET Framework tha...
[ { "answer_id": 48832, "author": "Shadow2531", "author_id": 1697, "author_profile": "https://Stackoverflow.com/users/1697", "pm_score": 2, "selected": false, "text": "\n#include <iostream>\n#include <string>\n#include <windows.h>\n#include <cstdlib>\nusing namespace std;\n\n// Escape and ...
2008/09/04
[ "https://Stackoverflow.com/questions/44799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1931/" ]
44,803
<p>Scenario: Document library in SharePoint with column x of "Person or Group" type. From within a VBA macro (or VSTO add-in) we're trying to access the MetaProperty on the document to set/get the user name. Any attempt to access the value via the ContentTypeProperties collection throws a </p> <blockquote> <p>Type...
[ { "answer_id": 48832, "author": "Shadow2531", "author_id": 1697, "author_profile": "https://Stackoverflow.com/users/1697", "pm_score": 2, "selected": false, "text": "\n#include <iostream>\n#include <string>\n#include <windows.h>\n#include <cstdlib>\nusing namespace std;\n\n// Escape and ...
2008/09/04
[ "https://Stackoverflow.com/questions/44803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4544/" ]