qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
14,464
<p>I have a structure which I need to populate and write to disk (several actually).</p> <p>An example is:</p> <pre><code>byte-6 bit0 - original_or_copy bit1 - copyright bit2 - data_alignment_indicator bit3 - PES_priority bit4-bit5 - PES_scrambling control. bit6-bit7 - reserved </code></pre> <p>In C ...
[ { "answer_id": 14475, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 5, "selected": false, "text": "[StructLayout(LayoutKind.Explicit, Size=1, CharSet=CharSet.Ansi)]\npublic struct Foo \n{ [FieldOffset(0)]public byte orig...
2008/08/18
[ "https://Stackoverflow.com/questions/14464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1006/" ]
14,491
<p>What is the proper way for an MFC application to cleanly close itself?</p>
[ { "answer_id": 14492, "author": "Mike", "author_id": 1743, "author_profile": "https://Stackoverflow.com/users/1743", "pm_score": 4, "selected": false, "text": "AfxGetMainWnd()->PostMessage(WM_CLOSE);\n" }, { "answer_id": 14841, "author": "Mat Noguchi", "author_id": 1799, ...
2008/08/18
[ "https://Stackoverflow.com/questions/14491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1743/" ]
14,504
<p>I would really like to see a proportional font IDE, even if I have to build it myself (perhaps as an extension to Visual Studio). What I basically mean is MS Word style editing of code that sort of looks like the typographical style in <a href="http://www.research.att.com/~bs/3rd.html" rel="nofollow noreferrer">The ...
[ { "answer_id": 14583, "author": "Thomas Owens", "author_id": 572, "author_profile": "https://Stackoverflow.com/users/572", "pm_score": 1, "selected": false, "text": "int var1 = 1 //Comment\nint longerVar = 2 //Comment\nint anotherVar = 4 //Command\n int var2 = 1 //Comment\nint long...
2008/08/18
[ "https://Stackoverflow.com/questions/14504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1659/" ]
14,505
<p>In the Full .NET framework you can use the Color.FromArgb() method to create a new color with alpha blending, like this:</p> <pre><code>Color blended = Color.FromArgb(alpha, color); </code></pre> <p>or</p> <pre><code>Color blended = Color.FromArgb(alpha, red, green , blue); </code></pre> <p>However in the Compac...
[ { "answer_id": 2870347, "author": "fede", "author_id": 345622, "author_profile": "https://Stackoverflow.com/users/345622", "pm_score": 0, "selected": false, "text": "device.RenderState.AlphaBlendEnable = true;\ndevice.RenderState.AlphaFunction = Compare.Greater;\ndevice.RenderState.Alpha...
2008/08/18
[ "https://Stackoverflow.com/questions/14505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194/" ]
14,527
<p>I need to be able to find the last occurrence of a character within an element.</p> <p>For example:</p> <pre><code>&lt;mediaurl&gt;http://www.blah.com/path/to/file/media.jpg&lt;/mediaurl&gt; </code></pre> <p>If I try to locate it through using <code>substring-before(mediaurl, '.')</code> and <code>substring-after...
[ { "answer_id": 14547, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 0, "selected": false, "text": "Example: tokenize(\"XPath is fun\", \"\\s+\")\nResult: (\"XPath\", \"is\", \"fun\")\n" }, { "answer_id": 14686, "au...
2008/08/18
[ "https://Stackoverflow.com/questions/14527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/274/" ]
14,530
<p>I took a look at the "Beginner's Guide to LINQ" post here on StackOverflow (<a href="https://stackoverflow.com/questions/8050/beginners-guide-to-linq">Beginners Guide to LINQ</a>), but had a follow-up question:</p> <p>We're about to ramp up a new project where nearly all of our database op's will be fairly simple d...
[ { "answer_id": 32688, "author": "SQLMenace", "author_id": 740, "author_profile": "https://Stackoverflow.com/users/740", "pm_score": 5, "selected": false, "text": "var p = \n from n in x.AddressTypes \n where n.Name == \"Billing\" \n select n;\n\nvar p = \n from n in x.Address...
2008/08/18
[ "https://Stackoverflow.com/questions/14530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1683/" ]
14,545
<p>What I mean by autolinking is the process by which wiki links inlined in page content are generated into either a hyperlink to the page (if it does exist) or a create link (if the page doesn't exist).</p> <p>With the parser I am using, this is a two step process - first, the page content is parsed and all of the li...
[ { "answer_id": 31864, "author": "palotasb", "author_id": 3063, "author_profile": "https://Stackoverflow.com/users/3063", "pm_score": 0, "selected": false, "text": "SELECT title FROM articles" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/14545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14446/" ]
14,577
<p>Imagine the scene, you're updating some legacy Sybase code and come across a cursor. The stored procedure builds up a result set in a #temporary table which is all ready to be returned except that one of columns isn't terribly human readable, it's an alphanumeric code.</p> <p>What we need to do, is figure out the p...
[ { "answer_id": 988077, "author": "B0rG", "author_id": 122093, "author_profile": "https://Stackoverflow.com/users/122093", "pm_score": 0, "selected": false, "text": "declare @lookup_code char(8)\n\nselect distinct lookup_code\ninto #lookup_codes\nfrom #workinprogress\n\nwhile 1=1\nbegin\n...
2008/08/18
[ "https://Stackoverflow.com/questions/14577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1030/" ]
14,582
<p>I've been using Subversion for code control with TortoiseSVN to interface with the server for the past few months, and in general it's been going great! However, occasionally my FoxPro IDE will change the case of a file extension without warning where "<em>program.prg</em>" becomes "<em>program.<strong>PRG</em></st...
[ { "answer_id": 51399368, "author": "Hugo González Castro", "author_id": 10098670, "author_profile": "https://Stackoverflow.com/users/10098670", "pm_score": 0, "selected": false, "text": "FixCaseSensitiveFileNames.bat call FixCaseSensitiveFileNames.bat C:\\MyRepo -n @echo off\nREM *** Thi...
2008/08/18
[ "https://Stackoverflow.com/questions/14582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1339/" ]
14,614
<p>First off, I understand the reasons why an interface or abstract class (in the .NET/C# terminology) cannot have abstract static methods. My question is then more focused on the best design solution.</p> <p>What I want is a set of "helper" classes that all have their own static methods such that if I get objects A,...
[ { "answer_id": 14622, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 1, "selected": false, "text": "static class HelperMethods\n { //IHelper h = new HeleperA();\n //h.DumpToDatabase() \n public static void DumpToDa...
2008/08/18
[ "https://Stackoverflow.com/questions/14614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1108/" ]
14,617
<p>I'm trying to retrieve a file from a server using SFTP (as opposed to FTPS) using Java. How can I do this?</p>
[ { "answer_id": 14629, "author": "David Hayes", "author_id": 1769, "author_profile": "https://Stackoverflow.com/users/1769", "pm_score": 5, "selected": false, "text": "SshClient ssh = new SshClient();\nssh.connect(host, port);\n//Authenticate\nPasswordAuthenticationClient passwordAuthenti...
2008/08/18
[ "https://Stackoverflow.com/questions/14617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1769/" ]
14,618
<p>What's the best way of implementing a multiple choice option in Windows Forms? I want to enforce a single selection from a list, starting with a default value.</p> <p>It seems like a ComboBox would be a good choice, but is there a way to specify a non-blank default value?<br> I could just set it in the code at some...
[ { "answer_id": 14710, "author": "wusher", "author_id": 1632, "author_profile": "https://Stackoverflow.com/users/1632", "pm_score": 1, "selected": false, "text": "private sub populateList( items as List(of UserChoices))\n dim choices as UserChoices\n dim defaultChoice as UserChoices \...
2008/08/18
[ "https://Stackoverflow.com/questions/14618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1077/" ]
14,634
<p>Let's take a web development environment, where developers checkout a project onto their local machines, work on it, and check in changes to development.<br> These changes are further tested on development and moved live on a regular schedule (eg weekly, monthly, etc.).<br> Is it possible to have an auto-moveup of t...
[ { "answer_id": 14680, "author": "icco", "author_id": 1063, "author_profile": "https://Stackoverflow.com/users/1063", "pm_score": 1, "selected": false, "text": "hg update\n svn co http://host/repository/branchname/\n svn up\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/14634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
14,656
<p>Can a (||any) proxy server cache content that is requested by a client over https? As the proxy server can't see the querystring, or the http headers, I reckon they can't.</p> <p>I'm considering a desktop application, run by a number of people behind their companies proxy. This application may access services acros...
[ { "answer_id": 2861265, "author": "Jesse Hallett", "author_id": 103017, "author_profile": "https://Stackoverflow.com/users/103017", "pm_score": 0, "selected": false, "text": "application server <---> Squid or Varnish (cache) <---> Apache (performs SSL encryption)\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/14656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
14,697
<p>I've looked at several URL rewriters for ASP.Net and IIS and was wondering what everyone else uses, and why. </p> <p>Here are the ones that I have used or looked at:</p> <ul> <li><a href="http://www.codeproject.com/KB/aspnet/urlrewriter.aspx" rel="nofollow noreferrer">ThunderMain URLRewriter</a>: used in a previou...
[ { "answer_id": 12120464, "author": "Paras", "author_id": 615798, "author_profile": "https://Stackoverflow.com/users/615798", "pm_score": 0, "selected": false, "text": " protected void Application_Start(object sender, EventArgs e)\n {\n\n RegisterRoutes(Route...
2008/08/18
[ "https://Stackoverflow.com/questions/14697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1414/" ]
14,698
<p>When I try to precompile a *.pc file that contains a #warning directive I recieve the following error:</p> <blockquote> <p>PCC-S-02014, Encountered the symbol "warning" when expecting one of the following: (bla bla bla).</p> </blockquote> <p>Can I somehow convince Pro*C to ignore the thing if it doesn't know wha...
[ { "answer_id": 14999, "author": "Jon Bright", "author_id": 1813, "author_profile": "https://Stackoverflow.com/users/1813", "pm_score": 0, "selected": false, "text": "grep -v -E '^#(warning|pragma|define)' unchangeable.h >unchangeable.pc.h\n" }, { "answer_id": 23585, "author":...
2008/08/18
[ "https://Stackoverflow.com/questions/14698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1733/" ]
14,708
<p>What's the DOS FINDSTR equivalent for <a href="http://en.wikipedia.org/wiki/Windows_PowerShell" rel="noreferrer">PowerShell</a>? I need to search a bunch of log files for "ERROR".</p>
[ { "answer_id": 14724, "author": "Monroecheeseman", "author_id": 1351, "author_profile": "https://Stackoverflow.com/users/1351", "pm_score": 5, "selected": false, "text": "Get-ChildItem -Recurse -Include *.log | select-string ERROR \n" }, { "answer_id": 14725, "author": "slips...
2008/08/18
[ "https://Stackoverflow.com/questions/14708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1351/" ]
14,712
<p>does anyone have a clue why the TortoiseSVN windows client (in Win32 XP and Vista) is so incredible slow when used with Putty and PAM? It seems it connects for each request since datatransfers (checkout) are not slow at all?</p> <p>Any ideas how to change it?</p> <p>Update: I had no problems with SSH before. But I...
[ { "answer_id": 22714832, "author": "bebbo", "author_id": 1412279, "author_profile": "https://Stackoverflow.com/users/1412279", "pm_score": 0, "selected": false, "text": "svn+ssh://xxx.yy/path/to/svn/trunk/foobar\n xxx.yy\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/14712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
14,717
<p>We're having sporadic, random query timeouts on our SQL Server 2005 cluster. I own a few apps that use it, so I'm helping out in the investigation. When watching the % CPU time in regular ol' Perfmon, you can certainly see it pegging out. However, SQL activity monitor only gives cumulative CPU and IO time used by a ...
[ { "answer_id": 14766, "author": "SQLMenace", "author_id": 740, "author_profile": "https://Stackoverflow.com/users/740", "pm_score": 5, "selected": true, "text": "SELECT TOP 50\n qs.total_worker_time/qs.execution_count as [Avg CPU Time],\n SUBSTRING(qt.text,qs.statement_star...
2008/08/18
[ "https://Stackoverflow.com/questions/14717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212/" ]
14,731
<p>Normally I would just use:</p> <pre><code>HttpContext.Current.Server.UrlEncode("url"); </code></pre> <p>But since this is a console application, <code>HttpContext.Current</code> is always going to be <code>null</code>.</p> <p>Is there another method that does the same thing that I could use?</p>
[ { "answer_id": 14736, "author": "Andrew Taylor", "author_id": 1776, "author_profile": "https://Stackoverflow.com/users/1776", "pm_score": 6, "selected": false, "text": "HttpUtility.UrlEncode Method (String)\n" }, { "answer_id": 14745, "author": "Kibbee", "author_id": 1862...
2008/08/18
[ "https://Stackoverflow.com/questions/14731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1469/" ]
14,760
<p>In the Visual Studio toolbar, you can enter commands into the search box by prefixing them with a > symbol. Is there any way to disable this? I've never used the feature, and it's slightly annoying when trying to actually search for something that you know is prefixed by greater-than in the code. It's particularly a...
[ { "answer_id": 15301, "author": "James Sutherland", "author_id": 1739, "author_profile": "https://Stackoverflow.com/users/1739", "pm_score": 0, "selected": false, "text": "alias" }, { "answer_id": 15335, "author": "eplawless", "author_id": 1370, "author_profile": "htt...
2008/08/18
[ "https://Stackoverflow.com/questions/14760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1739/" ]
14,770
<p>In .NET there are two version numbers available when building a project, File Version and Assembly Version. How are you using these numbers? Keeping them the same? Auto-incrementing one, but manually changing the other?</p> <p>Also what about the <code>AssemblyInformationalVersion</code> attribute?</p> <p>I'd fo...
[ { "answer_id": 14835, "author": "Jon Dewees", "author_id": 1365, "author_profile": "https://Stackoverflow.com/users/1365", "pm_score": 6, "selected": false, "text": "[assembly: AssemblyVersion(Foo.StaticVersion.Bar)]\n namespace Foo\n{\n public static class StaticVersion\n {\n ...
2008/08/18
[ "https://Stackoverflow.com/questions/14770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1752/" ]
14,775
<p>I have been a VB.net developer for a few years now but I am currently applying to a few companies that use C#. I have even been told that at least one of the companies doesn't want VB.net developers. </p> <p>I have been looking online trying to find real differences between the two and have asked on crackoverflow. ...
[ { "answer_id": 14814, "author": "Keith", "author_id": 905, "author_profile": "https://Stackoverflow.com/users/905", "pm_score": 2, "selected": false, "text": "Function(x) x.ToString()\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/14775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1632/" ]
14,791
<p>We have a website that uses <code>#include file</code> command to roll info into some web pages. The authors can access the text files to update things like the occasional class or contact information for the department.</p> <p>My question is this, I don't <em>see</em> anyone using this method and wonder if it is ...
[ { "answer_id": 14814, "author": "Keith", "author_id": 905, "author_profile": "https://Stackoverflow.com/users/905", "pm_score": 2, "selected": false, "text": "Function(x) x.ToString()\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/14791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/730/" ]
14,801
<p>Suppose you have the following EJB 3 interfaces/classes:</p> <pre><code>public interface Repository&lt;E&gt; { public void delete(E entity); } public abstract class AbstractRepository&lt;E&gt; implements Repository&lt;E&gt; { public void delete(E entity){ //... } } public interface FooRepository&l...
[ { "answer_id": 15279, "author": "ScArcher2", "author_id": 1310, "author_profile": "https://Stackoverflow.com/users/1310", "pm_score": 3, "selected": true, "text": "public static void main(String[] args){\n FooRepository fooRepository = new FooRepositoryImpl();\n fooReposito...
2008/08/18
[ "https://Stackoverflow.com/questions/14801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1793/" ]
14,828
<p>I work on quite a few DotNetNuke sites, and occasionally (I haven't figured out the common factor yet), when I use the Database Publishing Wizard from Microsoft to create scripts for the site I've created on my Dev server, after running the scripts at the host (usually GoDaddy.com), and uploading the site files, I g...
[ { "answer_id": 16369, "author": "Ian Robinson", "author_id": 326, "author_profile": "https://Stackoverflow.com/users/326", "pm_score": 0, "selected": false, "text": "customErrors mode=\"Off\"\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/14828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1795/" ]
14,857
<p><strong>Bounty:</strong> I will send $5 via paypal for an answer that fixes this problem for me.</p> <p>I'm not sure what VS setting I've changed or if it's a web.config setting or what, but I keep getting this error in the error list and yet all solutions build fine. Here are some examples:</p> <pre> Error 5 ...
[ { "answer_id": 592331, "author": "configurator", "author_id": 9536, "author_profile": "https://Stackoverflow.com/users/9536", "pm_score": 0, "selected": false, "text": "gacutil mscorlib" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/14857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1414/" ]
14,872
<blockquote> <p>CREATE DATABASE permission denied in database 'master'. An attempt to attach an auto-named database for file C:\Documents and Settings\..\App_Data\HelloWorld.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.</p> </blockquote>...
[ { "answer_id": 1412028, "author": "zanona", "author_id": 165750, "author_profile": "https://Stackoverflow.com/users/165750", "pm_score": 2, "selected": false, "text": "<system.web>\n <identity impersonate=\"true\" userName=\"admin_user\" password=\"admin_password\" />\n...\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/14872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1659/" ]
14,873
<p>I've noticed that a few Wordpress blogs have query statistics present in their footer that simply state the number of queries and the total time required to process them for the particular page, reading something like:</p> <blockquote> <p>23 queries. 0.448 seconds</p> </blockquote> <p>I was wondering how this is...
[ { "answer_id": 14972, "author": "pix0r", "author_id": 72, "author_profile": "https://Stackoverflow.com/users/72", "pm_score": 5, "selected": true, "text": "<?php echo $wpdb->num_queries; ?> <?php _e('queries'); ?>. <?php timer_stop(1); ?> <?php _e('seconds'); ?>\n" }, { "answer_i...
2008/08/18
[ "https://Stackoverflow.com/questions/14873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1339/" ]
14,874
<p>For part of my application I have a need to create an image of a certain view and all of its subviews.</p> <p>To do this I'm creating a context that wraps a bitmap with the same-size as the view, but I'm unsure how to draw the view hierarchy into it. I can draw a single view just be setting the context and explicit...
[ { "answer_id": 14947, "author": "Chris Hanson", "author_id": 714, "author_profile": "https://Stackoverflow.com/users/714", "pm_score": 2, "selected": false, "text": "-[NSView dataWithPDFInsideRect:] NSData" }, { "answer_id": 15489, "author": "Chris Hanson", "author_id": 7...
2008/08/18
[ "https://Stackoverflow.com/questions/14874", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1043/" ]
14,893
<p>Or, actually establishing a build process when there isn't much of one in place to begin with.</p> <p>Currently, that's pretty much the situation my group faces. We do web-app development primarily (but no desktop development at this time). Software deployments are ugly and unwieldy even with our modest apps, and...
[ { "answer_id": 14903, "author": "Eric Z Beard", "author_id": 1219, "author_profile": "https://Stackoverflow.com/users/1219", "pm_score": 3, "selected": false, "text": "<appSettings file=\"Local.config\">\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/14893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1734/" ]
14,923
<p>I'm thinking of learning the <code>ASP.NET MVC</code> framework for an upcoming project. Can I use the advanced routing to create long URLs based on the sitemap hierarchy?</p> <p>Example navigation path:</p> <p><strong>Home > Shop > Products > Household > Kitchen > Cookware > Cooksets > Nonstick</strong></p> <p>...
[ { "answer_id": 36833, "author": "Andrei Rînea", "author_id": 1796, "author_profile": "https://Stackoverflow.com/users/1796", "pm_score": 4, "selected": true, "text": "public class ShopController : Controller\n{\n...\n public ActionResult Products(string categoryPath)\n {\n /...
2008/08/18
[ "https://Stackoverflow.com/questions/14923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83/" ]
14,934
<p>.NET, Java and other high level database API's in various language often provide techniques known as prepared statements and parameter binding as opposed to sending plain text commands to the Database server. What I would like to know is what happens when you execute a statement like this:</p> <pre><code>SqlCommand...
[ { "answer_id": 14986, "author": "Kev", "author_id": 419, "author_profile": "https://Stackoverflow.com/users/419", "pm_score": 0, "selected": false, "text": "string sql = \"SELECT * FROM tblDomains WHERE DomainName = @DomName AND DomainID = @Did\";\nDatabase db = DatabaseFactory.CreateDat...
2008/08/18
[ "https://Stackoverflow.com/questions/14934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
14,943
<p>What is the best way to disable <kbd>Alt</kbd> + <kbd>F4</kbd> in a c# win form to prevent the user from closing the form?</p> <p>I am using a form as a popup dialog to display a progress bar and I do not want the user to be able to close it.</p>
[ { "answer_id": 14949, "author": "Timbo", "author_id": 1810, "author_profile": "https://Stackoverflow.com/users/1810", "pm_score": 4, "selected": false, "text": "FormClosing FormClosingEventArgs.Cancel true" }, { "answer_id": 14960, "author": "Martin", "author_id": 770, ...
2008/08/18
[ "https://Stackoverflow.com/questions/14943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1375/" ]
14,967
<p>I'm a recent AI graduate (circa 2 years) working for a modest operation. It has fallen to me (primarily as I'm the first 'adopter' in the department) to create a basic (read useful?) C# coding standards document. </p> <p>I think I should explain that I'm probably the most junior software engineer going, but I'm loo...
[ { "answer_id": 6120801, "author": "Dan Abramov", "author_id": 458193, "author_profile": "https://Stackoverflow.com/users/458193", "pm_score": 0, "selected": false, "text": "try\n{\n if (condition)\n {\n Something(new delegate\n {\n SomeCall(a, b);\n ...
2008/08/18
[ "https://Stackoverflow.com/questions/14967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1816/" ]
15,023
<p>In WindowsForms world you can get a list of available image encoders/decoders with</p> <pre><code>System.Drawing.ImageCodecInfo.GetImageDecoders() / GetImageEncoders() </code></pre> <p>My question is, is there a way to do something analogous for the WPF world that would allow me to get a list of available </p> <p...
[ { "answer_id": 17448, "author": "Frank Krueger", "author_id": 338, "author_profile": "https://Stackoverflow.com/users/338", "pm_score": 2, "selected": false, "text": "Bitmap Encoders:\nSystem.Windows.Media.Imaging.BmpBitmapEncoder\nSystem.Windows.Media.Imaging.GifBitmapEncoder\nSystem.Wi...
2008/08/18
[ "https://Stackoverflow.com/questions/15023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
15,024
<p>Questions #1 through #4 on the <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" rel="nofollow noreferrer">Joel Test</a> in my opinion are all about the development tools being used and the support system in place for developers:</p> <ol> <li>Do you use source control? </li> <li>Can you make a bui...
[ { "answer_id": 904897, "author": "Jonas Kölker", "author_id": 58668, "author_profile": "https://Stackoverflow.com/users/58668", "pm_score": 2, "selected": false, "text": "$(apt-cache search bug tracking)" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/15024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1795/" ]
15,034
<p>When building a VS 2008 solution with 19 projects I sometimes get:</p> <pre><code>The "GenerateResource" task failed unexpectedly. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.IO.MemoryStream.set_Capacity(Int32 value) at System.IO.MemoryStream.EnsureCapaci...
[ { "answer_id": 8679710, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "<GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/15034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1365/" ]
15,040
<p>I am using xampp on Windows, but I would like to use something closer to my server setup.</p> <p><a href="http://phpimpact.wordpress.com/2008/05/24/virtual-appliances-lamp-development-made-easy/" rel="nofollow noreferrer">Federico Cargnelutti tutorial</a> explains how to setup LAMP VMWARE appliance; it is a great i...
[ { "answer_id": 15683, "author": "UnkwnTech", "author_id": 115, "author_profile": "https://Stackoverflow.com/users/115", "pm_score": 4, "selected": true, "text": "apt-get -yq update\napt-get -yq upgrade\napt-get -yq install sudo\napt-get -yq install gcc\napt-get -yq install g++\napt-get -...
2008/08/18
[ "https://Stackoverflow.com/questions/15040", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1771/" ]
15,047
<p>I'm working on a WinForm .Net application with the basic UI that includes toolbar buttons, menu items and keystrokes that all initiate the same underlying code. Right now the event handlers for each of these call a common method to perform the function.</p> <p>From what I've read this type of action could be handle...
[ { "answer_id": 15207, "author": "Dale Ragan", "author_id": 1117, "author_profile": "https://Stackoverflow.com/users/1117", "pm_score": 5, "selected": true, "text": "public interface ICommand\n{\n void Execute();\n}\n public class CutCommand : ICommand\n{\n public void Execute()\n ...
2008/08/18
[ "https://Stackoverflow.com/questions/15047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1752/" ]
15,056
<p>What are some macros that you have found useful in Visual Studio for code manipulation and automation? </p>
[ { "answer_id": 15113, "author": "travis", "author_id": 1414, "author_profile": "https://Stackoverflow.com/users/1414", "pm_score": 3, "selected": false, "text": "''''replaceunicodechars.vb\nOption Strict Off\nOption Explicit Off\nImports EnvDTE\nImports System.Diagnostics\n\nPublic Modul...
2008/08/18
[ "https://Stackoverflow.com/questions/15056", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1185/" ]
15,062
<p>How do I convert function input parameters to the right type?</p> <p>I want to return a string that has part of the URL passed into it removed.</p> <p><strong>This works, but it uses a hard-coded string:</strong></p> <pre><code>function CleanUrl($input) { $x = "http://google.com".Replace("http://", "") re...
[ { "answer_id": 15068, "author": "ESV", "author_id": 150, "author_profile": "https://Stackoverflow.com/users/150", "pm_score": 3, "selected": false, "text": "function CleanUrl([string] $url)\n{\n return $url.Replace(\"http://\", \"\")\n}\n" }, { "answer_id": 15094, "author"...
2008/08/18
[ "https://Stackoverflow.com/questions/15062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/636/" ]
15,066
<p>I have a form in C# that has a button that, when clicked, I want the background image to cycle through a set of images (which I have as resources to the project). The images are named '_1', '_2', etc. and each time I click the button I want its background image to increment to the next one and go back to "_1" when ...
[ { "answer_id": 12660196, "author": "zahir", "author_id": 311618, "author_profile": "https://Stackoverflow.com/users/311618", "pm_score": 0, "selected": false, "text": "class YourClass\n{\n private IEnumerator<Image> enumerator;\n\n YourClass(IEnumerable<Image> images)\n {\n ...
2008/08/18
[ "https://Stackoverflow.com/questions/15066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/271/" ]
15,087
<p>The company I work for has an old Access 2000 application that was using a SQL Server 2000 back-end. We were tasked with moving the back-end to a SQL Server 2005 database on a new server. Unfortunately, the application was not functioning correctly while trying to do any inserts or updates. My research has found ...
[ { "answer_id": 15101, "author": "Martin", "author_id": 770, "author_profile": "https://Stackoverflow.com/users/770", "pm_score": 0, "selected": false, "text": "EXEC sp_dbcmptlevel Name_of_your_database, 80;\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/15087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1749/" ]
15,109
<p>I have a setup project created by Visual Studio 2005, and consists of both a C# .NET 2.0 project and C++ MFC project, and the C++ run time. It works properly when run from the main console, but when run over a Terminal Server session on a Windows XP target, the install fails in the following way - When the Setup....
[ { "answer_id": 15286, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 3, "selected": true, "text": "%TEMP% %TEMP% 1 2" }, { "answer_id": 289025, "author": "saschabeaumont", "author_id": 592, "author_pro...
2008/08/18
[ "https://Stackoverflow.com/questions/15109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1743/" ]
15,142
<p>What are the advantages/disadvantages of keeping SQL in your C# source code or in Stored Procs? I've been discussing this with a friend on an open source project that we're working on (C# ASP.NET Forum). At the moment, most of the database access is done by building the SQL inline in C# and calling to the SQL Server...
[ { "answer_id": 229708, "author": "huo73", "author_id": 15657, "author_profile": "https://Stackoverflow.com/users/15657", "pm_score": 6, "selected": false, "text": "(Pseudocode)\n\nFunction createOrder(Order yourOrder) \nBegin\n Call SP_createOrder(yourOrder)\nEnd\n" }, { "answer...
2008/08/18
[ "https://Stackoverflow.com/questions/15142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463/" ]
15,163
<p>In some VB6 code, I have a handler for a TreeView's Collapse event:</p> <pre><code>Private Sub MyTree_Collapse(ByVal Node as MSComCtlLib.Node) </code></pre> <p>This is called whenever a node in the tree is collapsed, whether by the user or programmatically. As it turns out, through some roundabout execution, it m...
[ { "answer_id": 16629, "author": "Matt Dillard", "author_id": 863, "author_profile": "https://Stackoverflow.com/users/863", "pm_score": 2, "selected": false, "text": "MyTree_Collapse m_bHandlingCallback Private Sub MyTree_Collapse(ByVal Node as MSComCtlLib.Node)\n If m_bHandlingCallbac...
2008/08/18
[ "https://Stackoverflow.com/questions/15163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/863/" ]
15,171
<p>In the linux file system, where should user scripts be placed?</p> <p>I'm thinking specifically python scripts to be called by cron.</p>
[ { "answer_id": 15476, "author": "Mo.", "author_id": 1870, "author_profile": "https://Stackoverflow.com/users/1870", "pm_score": 2, "selected": false, "text": "/home/username/.bin\n" }, { "answer_id": 1759292, "author": "pete", "author_id": 214121, "author_profile": "h...
2008/08/18
[ "https://Stackoverflow.com/questions/15171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/479/" ]
15,187
<p>I'd like to take an existing application (written in OCaml) and create an Emacs "interface" for it (like, for example, the Emacs GDB mode). I would prefer to do this without writing a ton of Lisp code. In MVC terms, I'd like for the View to be Emacs, but for the Model and Controller to remain (primarily) OCaml.</p> ...
[ { "answer_id": 15260, "author": "Mike Stone", "author_id": 122, "author_profile": "https://Stackoverflow.com/users/122", "pm_score": 2, "selected": false, "text": "(shell-command-to-string\n \"bash -c \\\"script-to-exec args\\\"\")\n" }, { "answer_id": 28643496, "author": ...
2008/08/18
[ "https://Stackoverflow.com/questions/15187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412/" ]
15,204
<p>What is the best way to iterate through a strongly-typed generic List in C#.NET and VB.NET?</p>
[ { "answer_id": 15210, "author": "mbillard", "author_id": 810, "author_profile": "https://Stackoverflow.com/users/810", "pm_score": 6, "selected": true, "text": "foreach(ObjectType objectItem in objectTypeList)\n{\n // ...do some stuff\n}\n For Each objectItem as ObjectType in objectTy...
2008/08/18
[ "https://Stackoverflow.com/questions/15204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1224/" ]
15,219
<p>I'm using the Infragistics grid and I'm having a difficult time using a drop-down list as the value selector for one of my columns.</p> <p>I tried reading the documentation but Infragistics' documentation is not so good. I've also taken a look at this <a href="http://news.infragistics.com/forums/p/9063/45792.aspx" ...
[ { "answer_id": 16347, "author": "Erick B", "author_id": 1373, "author_profile": "https://Stackoverflow.com/users/1373", "pm_score": 2, "selected": false, "text": "UltraWebGrid uwgMyGrid = new UltraWebGrid();\nuwgMyGrid.Columns.Add(\"colTest\", \"Test Dropdown\");\nuwgMyGrid.Columns.FromK...
2008/08/18
[ "https://Stackoverflow.com/questions/15219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/810/" ]
15,228
<p>I'm working on a site which needs to be able to support two or more looks, changable at runtime. I'd hoped to be able to handle the change with a CSS switch, but it looks like I'll need to use a different masterpage for each design.</p> <p>So, what's the best way to set the masterpage at runtime? Page.MasterPageFil...
[ { "answer_id": 15242, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "this.Page.MasterPageFile = \"~/default.master\";\n" }, { "answer_id": 15274, "author": "Brian G Swanson", "auth...
2008/08/18
[ "https://Stackoverflow.com/questions/15228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5/" ]
15,240
<p>I'd like to make a debug logging function with the same parameters as <code>printf</code>. But one that can be removed by the pre-processor during optimized builds.</p> <p>For example:</p> <pre><code>Debug_Print("Warning: value %d &gt; 3!\n", value); </code></pre> <p>I've looked at variadic macros but those aren...
[ { "answer_id": 15262, "author": "Graeme Perrow", "author_id": 1821, "author_profile": "https://Stackoverflow.com/users/1821", "pm_score": 4, "selected": false, "text": "\n int debug_printf( const char *fmt, ... );\n #if defined( DEBUG )\n #define DEBUG_PRINTF(x) debug_printf x\n #else\n...
2008/08/18
[ "https://Stackoverflow.com/questions/15240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1841/" ]
15,241
<p>The main web application of my company is crying out for a nifty set of libraries to make it in some way maintainable and scalable, and one of my colleagues has suggested CSLA. So I've bought the book but as :</p> <blockquote> <p><em>programmers don't read books anymore</em></p> </blockquote> <p>I wanted to gaug...
[ { "answer_id": 1219364, "author": "Gregory Higley", "author_id": 27779, "author_profile": "https://Stackoverflow.com/users/27779", "pm_score": 5, "selected": false, "text": "WCFDataPortal" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/15241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1116/" ]
15,247
<p>Given a list of locations such as</p> <pre class="lang-html prettyprint-override"><code> &lt;td&gt;El Cerrito, CA&lt;/td&gt; &lt;td&gt;Corvallis, OR&lt;/td&gt; &lt;td&gt;Morganton, NC&lt;/td&gt; &lt;td&gt;New York, NY&lt;/td&gt; &lt;td&gt;San Diego, CA&lt;/td&gt; </code></pre> <p>What's the easies...
[ { "answer_id": 17132, "author": "Bernie Perez", "author_id": 1992, "author_profile": "https://Stackoverflow.com/users/1992", "pm_score": 5, "selected": true, "text": "<head>\n <script \n type=\"text/javascript\"\n href=\"http://maps.google.com/maps?\n file=api&v=2&key=xxxxx\...
2008/08/18
[ "https://Stackoverflow.com/questions/15247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/116/" ]
15,254
<p>Is it possible to actually make use of placement new in portable code when using it for arrays?</p> <p>It appears that the pointer you get back from new[] is not always the same as the address you pass in (5.3.4, note 12 in the standard seems to confirm that this is correct), but I don't see how you can allocate a ...
[ { "answer_id": 15273, "author": "Yossi Kreinin", "author_id": 1648, "author_profile": "https://Stackoverflow.com/users/1648", "pm_score": 1, "selected": false, "text": "\ntypedef A Arr[NUMELEMENTS]; \n\n A* p = new (buffer) Arr;\n" }, { "answer_id": 15343, "author": "OJ.", ...
2008/08/18
[ "https://Stackoverflow.com/questions/15254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1739/" ]
15,266
<p>Using <strong>NSURLRequest</strong>, I am trying to access a web site that has an expired certificate. When I send the request, my <strong>connection:didFailWithError</strong> delegate method is invoked with the following info:</p> <pre><code>-1203, NSURLErrorDomain, bad server certificate </code></pre> <p>My sear...
[ { "answer_id": 245903, "author": "Louis Gerbarg", "author_id": 30506, "author_profile": "https://Stackoverflow.com/users/30506", "pm_score": 3, "selected": false, "text": "CFURLRef myURL = CFURLCreateWithString(kCFAllocatorDefault, CFSTR(\"http://www.apple.com\"), NULL);\nCFHTTPMessageRe...
2008/08/18
[ "https://Stackoverflow.com/questions/15266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/544/" ]
15,272
<p>I want a data structure that will allow querying <em>how many items in last <strong>X</strong> minutes</em>. An item may just be a simple identifier or a more complex data structure, preferably the timestamp of the item will be in the item, rather than stored outside (as a hash or similar, wouldn't want to have prob...
[ { "answer_id": 15904, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 3, "selected": true, "text": "list.push_end(new_data)\nwhile list.head.age >= age_limit:\n list.pop_head()\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/15272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/163/" ]
15,310
<p>First off I understand that it is a horrible idea to run extremely large/long running reports. I am aware that Microsoft has a rule of thumb stating that a SSRS report should take no longer than 30 seconds to execute. However sometimes gargantuan reports are a preferred evil due to external forces such complying wi...
[ { "answer_id": 10481764, "author": "StuartLC", "author_id": 314291, "author_profile": "https://Stackoverflow.com/users/314291", "pm_score": 2, "selected": false, "text": "Times New Roman, Courier New, or Arial FontFamily" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/15310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1644/" ]
15,315
<p>Is there a method for handling errors from COM objects in RDML? For instance, when calling Word VBA methods like <code>PasteSpecial</code>, an error is returned and the LANSA application crashes. I cannot find anything in the documentation to allow handling of these errors.</p> <p>Actually, error handling in genera...
[ { "answer_id": 10481764, "author": "StuartLC", "author_id": 314291, "author_profile": "https://Stackoverflow.com/users/314291", "pm_score": 2, "selected": false, "text": "Times New Roman, Courier New, or Arial FontFamily" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/15315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
15,326
<p>Here is the scenario: </p> <p>I have a table with a margin-bottom of 19px. Below that I have a form that contains some fieldsets. One of them is floated right. The problem is that the margin-bottom is not getting the full 19px in IE7. I've gone through all of the IE7 css/margin/float bugs that I can think of and ha...
[ { "answer_id": 15356, "author": "eplawless", "author_id": 1370, "author_profile": "https://Stackoverflow.com/users/1370", "pm_score": 1, "selected": false, "text": "Ctrl+Shift+Y CSS -> View Style Information <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http...
2008/08/18
[ "https://Stackoverflow.com/questions/15326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1797/" ]
15,334
<p>I have recently started using Vim as my text editor and am currently working on my own customizations.</p> <p>I suppose keyboard mappings can do pretty much anything, but for the time being I'm using them as a sort of snippets facility almost exclusively.</p> <p>So, for example, if I type <code>def{TAB}</code> (<c...
[ { "answer_id": 32324, "author": "Sébastien RoccaSerra", "author_id": 2797, "author_profile": "https://Stackoverflow.com/users/2797", "pm_score": 2, "selected": false, "text": ":ab[breviate] :ab[breviate] [<expr>] {lhs} {rhs}\n add abbreviation for {lhs} to {rhs}. If {lhs} already...
2008/08/18
[ "https://Stackoverflow.com/questions/15334", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1670/" ]
15,366
<p>What's the best practice for making sure that certain ajax calls to certain pages are only accepted from authenticated users?</p> <p>For example:</p> <p>Let's say that I have a main page called <strong>blog.php</strong> (I know, creativity abounds). Let's also say that there is a page called <strong>delete.php</s...
[ { "answer_id": 15368, "author": "pix0r", "author_id": 72, "author_profile": "https://Stackoverflow.com/users/72", "pm_score": 4, "selected": true, "text": "session_start() session_id()" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/15366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305/" ]
15,390
<p>What are some standard practices for managing a medium-large JavaScript application? My concerns are both speed for browser download and ease and maintainability of development.</p> <p>Our JavaScript code is roughly "namespaced" as:</p> <pre><code>var Client = { var1: '', var2: '', accounts: { /* 1...
[ { "answer_id": 15402, "author": "Steve M", "author_id": 1693, "author_profile": "https://Stackoverflow.com/users/1693", "pm_score": 5, "selected": true, "text": "<script src='/path/to/js/$file.js' type='text/javascript'>" }, { "answer_id": 39011, "author": "paulgreg", "au...
2008/08/18
[ "https://Stackoverflow.com/questions/15390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1848/" ]
15,395
<p>Linq To SQL or Entity framework both integrate nicely with SQL Server 2005.</p> <p>The SQL Server 2008 spec sheet promises even better integration - but I can't see it.</p> <p>What are some examples of what you can do Linq-wise when talking to a 2008 server that you can't when talking to SQL Server 2005?</p>
[ { "answer_id": 153273, "author": "Amy B", "author_id": 8155, "author_profile": "https://Stackoverflow.com/users/8155", "pm_score": 1, "selected": false, "text": "var orders = (\nfrom c in Customers\nfrom o in c.Orders\nselect new {c, o}\n).Skip(10).Take(10).ToList();\n" } ]
2008/08/18
[ "https://Stackoverflow.com/questions/15395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1855/" ]
15,414
<p>I'm quite used to my IDE setup in Delphi 7, where I have my comments rendered in italics.</p> <p>This doesn't appear to be possible in VS2008. There's only an option for bold font, not italics.</p> <p>Is there some kind of registry hack or font magic I can perform to get it to work? The font I'm using is Consolas,...
[ { "answer_id": 15434, "author": "Factor Mystic", "author_id": 1569, "author_profile": "https://Stackoverflow.com/users/1569", "pm_score": 2, "selected": false, "text": "HKCU\\Software\\Microsoft\\VisualStudio\\9.0\\FontAndColors\\{A27B4E24-A735-4D1D-B8E7-9716E1E3D8E0} \nComment FontFlag...
2008/08/19
[ "https://Stackoverflow.com/questions/15414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
15,423
<p>I'd like to know what's the way to actually set the icon of a <code>.bat</code> file to an arbitrary icon. How would I go about doing that programmatically, independently of the language I may be using.</p>
[ { "answer_id": 15437, "author": "Sören Kuklau", "author_id": 1600, "author_profile": "https://Stackoverflow.com/users/1600", "pm_score": 7, "selected": true, "text": ".bat .lnk" }, { "answer_id": 856655, "author": "Joey", "author_id": 73070, "author_profile": "https:/...
2008/08/19
[ "https://Stackoverflow.com/questions/15423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/883/" ]
15,470
<p>I know this site is written using ASP.Net MVC and I do not see "/Home" in the url. This proves to me that it can be done. What special route and do I need?</p>
[ { "answer_id": 15474, "author": "Nick Berardi", "author_id": 17, "author_profile": "https://Stackoverflow.com/users/17", "pm_score": 5, "selected": true, "text": "routes.MapRoute(\n \"Home\",\n \"\",\n new { action = Index, controller = Home }\n);\n" }, { "answer_id": 27...
2008/08/19
[ "https://Stackoverflow.com/questions/15470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/692/" ]
15,478
<p>GDI+ DrawLines function has a clipping bug that can be reproduced by running the following c# code. When running the code, two line paths appear, that should be identical, because both of them are inside the clipping region. But when the clipping region is set, one of the line segment is not drawn. </p> <pre><code...
[ { "answer_id": 15813, "author": "TK.", "author_id": 1816, "author_profile": "https://Stackoverflow.com/users/1816", "pm_score": 0, "selected": false, "text": "e.Graphics.FillRectangle( new SolidBrush( Color.Black ), b );" }, { "answer_id": 16914, "author": "TK.", "author_...
2008/08/19
[ "https://Stackoverflow.com/questions/15478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1873/" ]
15,481
<p>Sometimes a labeled break or continue can make code a lot more readable. </p> <pre><code>OUTERLOOP: for ( ;/*stuff*/; ) { //...lots of code if ( isEnough() ) break OUTERLOOP; //...more code } </code></pre> <p>I was wondering what the common convention for the labels was. All caps? first cap? </p>
[ { "answer_id": 15501, "author": "RodeoClown", "author_id": 943, "author_profile": "https://Stackoverflow.com/users/943", "pm_score": 4, "selected": false, "text": "for ( ;/*stuff*/; ) \n{\n lotsOfCode();\n\n if ( !isEnough() )\n {\n moreCode();\n }\n}\n" }, { "...
2008/08/19
[ "https://Stackoverflow.com/questions/15481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1870/" ]
15,486
<p>So I came across an interesting problem today. We have a WCF web service that returns an IList. Not really a big deal until I wanted to sort it.</p> <p>Turns out the IList interface doesn't have a sort method built in. </p> <p>I ended up using the <code>ArrayList.Adapter(list).Sort(new MyComparer())</code> method ...
[ { "answer_id": 15492, "author": "lubos hasko", "author_id": 275, "author_profile": "https://Stackoverflow.com/users/275", "pm_score": -1, "selected": false, "text": "IList List<T> System.Linq" }, { "answer_id": 15494, "author": "Brad Leach", "author_id": 708, "author_...
2008/08/19
[ "https://Stackoverflow.com/questions/15486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/493/" ]
15,496
<p>After reading <a href="https://stackoverflow.com/questions/9033/hidden-features-of-c">Hidden Features of C#</a> I wondered, What are some of the hidden features of Java?</p>
[ { "answer_id": 15538, "author": "Michael Neale", "author_id": 699, "author_profile": "https://Stackoverflow.com/users/699", "pm_score": 5, "selected": false, "text": "List<String> ls = List(\"a\", \"b\", \"c\");\n List<Map<String, String>> data = List(Map( o(\"name\", \"michael\"), o(\"s...
2008/08/19
[ "https://Stackoverflow.com/questions/15496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
15,513
<p>I've been tasked with <em>improving the performance of an ASP.NET 2.0 application</em>.<br> The page I'm currently focused on has many problems but one that I'm having trouble digging into is the render time of the page. Using Trace.axd the duration between Begin Render and End Render is 1.4 seconds. From MSDN I ...
[ { "answer_id": 15516, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 2, "selected": false, "text": "<%@Page Trace=\"true\" %>\n" } ]
2008/08/19
[ "https://Stackoverflow.com/questions/15513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1767/" ]
15,514
<p>In my example below I'm using a <code>dijit.form.DateTextBox</code>:</p> <pre><code>&lt;input type="text" name="startDate" dojoType="dijit.form.DateTextBox" constraints="{datePattern:'MM/dd/yyyy'}" value='&lt;c:out value="${sessionScope.adminMessageForm.startDate}"/&gt;' /&gt; </code></pre> <p>So for example, if ...
[ { "answer_id": 15677, "author": "RodeoClown", "author_id": 943, "author_profile": "https://Stackoverflow.com/users/943", "pm_score": 4, "selected": true, "text": "<input type=\"text\" name=\"startDate\" dojoType=\"dijit.form.DateTextBox\" \n constraints=\"{datePattern:'MM/dd/yyyy'}\" \...
2008/08/19
[ "https://Stackoverflow.com/questions/15514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/700/" ]
15,537
<p>If I press <kbd>Ctrl</kbd>+<kbd>B</kbd> that ought to give me ASCII code 2, but <kbd>Ctrl</kbd>+<kbd>C</kbd> is going to be interpreted as a Break.</p> <p>So I figure I've got to redirect a file in. How do I get these characters into a file?</p>
[ { "answer_id": 15542, "author": "Steve M", "author_id": 1693, "author_profile": "https://Stackoverflow.com/users/1693", "pm_score": 2, "selected": false, "text": "perl -e 'print \"\\xFF\"'\n FF" }, { "answer_id": 15574, "author": "Daniel Fone", "author_id": 1848, "aut...
2008/08/19
[ "https://Stackoverflow.com/questions/15537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/257/" ]
15,593
<p>I understand what <a href="http://msdn.microsoft.com/en-us/library/ms404247.aspx" rel="noreferrer">System.WeakReference</a> does, but what I can't seem to grasp is a practical example of what it might be useful for. The class itself seems to me to be, well, a hack. It seems to me that there are other, better means ...
[ { "answer_id": 15616, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 4, "selected": false, "text": "class Cache<TKey,TValue> : IEnumerable<KeyValuePair<TKey,TValue>>\n{ Dictionary<TKey,WeakReference> dict = new Dictionary...
2008/08/19
[ "https://Stackoverflow.com/questions/15593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1875/" ]
15,621
<p>I have a few C# <code>.dll</code> projects which are common to many applications. Currently, I have one big repository. I have each DLL stored as a separate project within the repository and every application project stored as a project within the same repository.</p> <p>I recently switched to Subversion for sourc...
[ { "answer_id": 15633, "author": "Judge Maygarden", "author_id": 1491, "author_profile": "https://Stackoverflow.com/users/1491", "pm_score": 3, "selected": false, "text": "branch/\ntags/\ntrunk/\n branch/\ntags/\ntrunk/\n project1/\n project2/\n project1/\n branch/\n tags/\n ...
2008/08/19
[ "https://Stackoverflow.com/questions/15621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1511/" ]
15,656
<p>Another SSRS question here: <br /> We have a development, a QA, a Prod-Backup and a Production SSRS set of servers. <br /> On our production and prod-backup, SSRS will go to sleep if not used for a period of time. <br /><br /> This does not occur on our development or QA server. <br />In the corporate environme...
[ { "answer_id": 10721575, "author": "Lynn Crumbling", "author_id": 656243, "author_profile": "https://Stackoverflow.com/users/656243", "pm_score": 5, "selected": false, "text": "C:\\Program Files\\Microsoft SQL Server\\\n MSRS10_50.MSSQLSERVER\\Reporting Services\\ReportServer\\rs...
2008/08/19
[ "https://Stackoverflow.com/questions/15656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1580/" ]
15,674
<p>When using Subversion (svn) for source control with multiple projects I've noticed that the revision number increases across all of my projects' directories. To illustrate my svn layout (using fictitious project names): </p> <pre> /NinjaProg/branches /tags /trunk /StealthApp/bra...
[ { "answer_id": 16057, "author": "grom", "author_id": 486, "author_profile": "https://Stackoverflow.com/users/486", "pm_score": 2, "selected": false, "text": "<Location /svn>\n DAV svn\n SVNParentPath /var/www/svn\n\n AuthType Basic\n AuthName \"Subversion Repository\"\n AuthUserFile...
2008/08/19
[ "https://Stackoverflow.com/questions/15674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1339/" ]
15,678
<p>I have a solution with several projects, where the startup project has a post-build event that does all the copying of "plugin" projects and other organizing tasks. After upgrading the solution from VS 2005 to VS 2008, it appears as though the post-build event only fires if I modify the startup project, which means ...
[ { "answer_id": 15699, "author": "lomaxx", "author_id": 493, "author_profile": "https://Stackoverflow.com/users/493", "pm_score": 2, "selected": false, "text": "devenv project.csproj /clean\n" }, { "answer_id": 3814728, "author": "Cristian Diaconescu", "author_id": 11545, ...
2008/08/19
[ "https://Stackoverflow.com/questions/15678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/470/" ]
15,687
<p>So, you are all ready to do a big SVN Commit and it bombs because you have inconsistent line endings in some of your files. Fun part is, you're looking at 1,000s of files spanning dozens of folders of different depths.</p> <p>What do you do?</p>
[ { "answer_id": 9727551, "author": "David W.", "author_id": 368630, "author_profile": "https://Stackoverflow.com/users/368630", "pm_score": 3, "selected": false, "text": "$ find . -type f -name \"*.java\" -exec dos2unix {}\\;\n dos2unix svn:eol-style" }, { "answer_id": 59680444, ...
2008/08/19
[ "https://Stackoverflow.com/questions/15687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307/" ]
15,694
<p>I've recently been looking into targeting the .NET Client Profile for a WPF application I am building. However, I was frustrated to notice that the Client Profile is only valid for the following OS configurations: </p> <ul> <li>Windows XP SP2+</li> <li><strike>Windows Server 2003</strike> <strong>Edit:</strong> <a ...
[ { "answer_id": 15738, "author": "Sören Kuklau", "author_id": 1600, "author_profile": "https://Stackoverflow.com/users/1600", "pm_score": 2, "selected": false, "text": "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; .NET CLR 2.0.50727).\n" } ]
2008/08/19
[ "https://Stackoverflow.com/questions/15694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/708/" ]
15,708
<p>One of my favourite tools for linux is <a href="http://en.wikipedia.org/wiki/Lsof" rel="noreferrer" title="Wikipedia">lsof</a> - a real swiss army knife!</p> <p>Today I found myself wondering which programs on a WinXP system had a specific file open. Is there any equivalent utility to lsof? Additionally, the file i...
[ { "answer_id": 599268, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 6, "selected": false, "text": "lsof -p pid handle -p pid\nlistdlls -p pid\n pslist" }, { "answer_id": 731125, "author": "Sean", "author_id": ...
2008/08/19
[ "https://Stackoverflow.com/questions/15708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1848/" ]
15,709
<p>So for my text parsing in C# <a href="https://stackoverflow.com/questions/13963/best-method-of-textfile-parsing-in-c">question</a>, I got directed at YAML. I'm hitting a wall with this library I was recommended, so this is a quickie.</p> <pre><code>heading: name: A name taco: Yes age: 32 heading: name: Another...
[ { "answer_id": 15726, "author": "Grey Panther", "author_id": 1265, "author_profile": "https://Stackoverflow.com/users/1265", "pm_score": 4, "selected": false, "text": "---\nheading:\n name: A name\n taco: Yes\n age: 32\n---\nheading:\n name: Another name\n taco: No\n age: 27\n - heading:...
2008/08/19
[ "https://Stackoverflow.com/questions/15709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61/" ]
15,716
<p>I have created a UserControl that has a <code>ListView</code> in it. The ListView is publicly accessible though a property. When I put the UserControl in a form and try to design the <code>ListView</code> though the property, the <code>ListView</code> stays that way until I compile again and it reverts back to the d...
[ { "answer_id": 15717, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 0, "selected": false, "text": "public ListView MyListView { get { return this.listView1; } }\n" }, { "answer_id": 15803, "author": "Fredrik ...
2008/08/19
[ "https://Stackoverflow.com/questions/15716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/788/" ]
15,729
<p>As I browse through the site, I find a lot of terms that many developers just starting out (and even some advanced developers) may be unfamiliar with.</p> <p>It would be great if people could post here with a term and definition that might be unknown to beginners or those from different programming backgrounds. </p...
[ { "answer_id": 15717, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 0, "selected": false, "text": "public ListView MyListView { get { return this.listView1; } }\n" }, { "answer_id": 15803, "author": "Fredrik ...
2008/08/19
[ "https://Stackoverflow.com/questions/15729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1693/" ]
15,732
<p>I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?</p>
[ { "answer_id": 15739, "author": "SCdF", "author_id": 1666, "author_profile": "https://Stackoverflow.com/users/1666", "pm_score": 5, "selected": false, "text": "import org.apache.xerces.parsers.DOMParser;\nimport java.io.File;\nimport org.w3c.dom.Document;\n\npublic class SchemaTest {\n ...
2008/08/19
[ "https://Stackoverflow.com/questions/15732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650/" ]
15,734
<p>I know that there is no official API for Google Analytics but is there a way to access Google Analytics Reports with C#?</p>
[ { "answer_id": 23441943, "author": "Valentin V", "author_id": 430254, "author_profile": "https://Stackoverflow.com/users/430254", "pm_score": 0, "selected": false, "text": "async/await dynamic" } ]
2008/08/19
[ "https://Stackoverflow.com/questions/15734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1890/" ]
15,744
<p>I'm wondering about instances when it makes sent to use #define and #if statements. I've known about it for a while, but never incorporated it into my way of coding. How exactly does this affect the compilation?</p> <blockquote> <p>Is #define the only thing that determines if the code is included when compiled? I...
[ { "answer_id": 15758, "author": "Eric Haskins", "author_id": 100, "author_profile": "https://Stackoverflow.com/users/100", "pm_score": 5, "selected": true, "text": "#define #define #if static void Main(string[] args)\n {\n#if DEBUG\n //this only compiles if in D...
2008/08/19
[ "https://Stackoverflow.com/questions/15744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1888/" ]
15,774
<p>I run an ASP.NET website solution with a few other projects in it. I've known that MSBuild projects are capable of this, but is it the best way? Are they easy to create? Is nAnt, CruiseControl.NET or any other solution better?</p> <p>When I build the site (using <a href="http://msdn.microsoft.com/en-us/asp.net/aa33...
[ { "answer_id": 32861, "author": "icelava", "author_id": 2663, "author_profile": "https://Stackoverflow.com/users/2663", "pm_score": 2, "selected": false, "text": "<!-- To modify your build process, add your task inside one of the targets below and uncomment it. \nOther similar extension ...
2008/08/19
[ "https://Stackoverflow.com/questions/15774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1888/" ]
15,798
<p>I need to validate an XML string (and not a file) against a DTD description file. </p> <p>How can that be done in <code>python</code>?</p>
[ { "answer_id": 15931, "author": "Michael Twomey", "author_id": 995, "author_profile": "https://Stackoverflow.com/users/995", "pm_score": 6, "selected": true, "text": "from StringIO import StringIO\n\nfrom lxml import etree\n\ndtd = etree.DTD(StringIO(\"\"\"<!ELEMENT foo EMPTY>\"\"\"))\nr...
2008/08/19
[ "https://Stackoverflow.com/questions/15798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/446497/" ]
15,816
<p>I use VNC to connect to a Linux workstation at work. At work I have a 20" monitor that runs at 1600x1200, while at home I use my laptop with its resolution of 1440x900. If I set the vncserver to run at 1440x900 I miss out on a lot of space on my monitor, whereas if I set it to run at 1600x1200 it doesn't fit on the...
[ { "answer_id": 15926, "author": "Pat", "author_id": 238, "author_profile": "https://Stackoverflow.com/users/238", "pm_score": 5, "selected": false, "text": "$vncserver :0 -geometry 1600x1200\n$vncserver :1 -geometry 1440x900\n" }, { "answer_id": 1083668, "author": "Nathan Fel...
2008/08/19
[ "https://Stackoverflow.com/questions/15816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1084/" ]
15,828
<p>Is there a free or open source library to read Excel files (.xls) directly from a C# program? </p> <p>It does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've been using Export to Unicode text function of Excel, and parsing the resulting (tab-delimited) file, but I'd l...
[ { "answer_id": 15839, "author": "Ryan Farley", "author_id": 1627, "author_profile": "https://Stackoverflow.com/users/1627", "pm_score": 6, "selected": false, "text": "select * from [Sheet1$]" }, { "answer_id": 15970, "author": "hitec", "author_id": 120, "author_profil...
2008/08/19
[ "https://Stackoverflow.com/questions/15828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/838/" ]
15,838
<p>Can the performance of this sequential search algorithm (taken from <a href="http://books.google.co.uk/books?id=to6M9_dbjosC&amp;dq=the+practice+of+programming&amp;pg=PP1&amp;ots=3YH6Ggq0_a&amp;sig=F2-ajdO37xA4iRec2sCyQF55Jjc&amp;hl=en&amp;sa=X&amp;oi=book_result&amp;resnum=1&amp;ct=result" rel="noreferrer">The Pra...
[ { "answer_id": 15876, "author": "Mark Harrison", "author_id": 116, "author_profile": "https://Stackoverflow.com/users/116", "pm_score": 1, "selected": false, "text": "for (i = 0; i < n; ++i)\n foo(a[i]);\n char **p = a;\nfor (i = 0; i < n; ++i)\n foo(*p);\n ++p;\n for (p = a; *p...
2008/08/19
[ "https://Stackoverflow.com/questions/15838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/381/" ]
15,851
<p>After I was convinced that labeled breaks/continues are a total "nono" over <a href="https://stackoverflow.com/questions/15481/java-coding-standard-best-practices-labeled-brakecontinue#15501">here</a>, I need help to remove the label out of my code.</p> <p>I have a square matrix and a vector that has the same lengt...
[ { "answer_id": 15855, "author": "Patrick", "author_id": 429, "author_profile": "https://Stackoverflow.com/users/429", "pm_score": 1, "selected": false, "text": "for( int idx = 0; idx < vectorLength; idx++) {\n if( conditionAtVectorPosition( v, idx ) ) continue;\n\n for( rowIdx = 0; row...
2008/08/19
[ "https://Stackoverflow.com/questions/15851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1870/" ]
15,880
<p>I need to read from Outlook .MSG file in .NET <em>without</em> using COM API for Outlook (cos it will not be installed on the machines that my app will run). Are there any free 3rd party libraries to do that? I want to extract From, To, CC and BCC fields. Sent/Receive date fields would be good if they are also store...
[ { "answer_id": 2365689, "author": "Knox", "author_id": 4873, "author_profile": "https://Stackoverflow.com/users/4873", "pm_score": 3, "selected": false, "text": "Public Sub ProcessMail()\n\n Dim Sess As RDOSession\n Dim myMsg As RDOMail\n Dim myString As String\n\n Set Sess = Cre...
2008/08/19
[ "https://Stackoverflow.com/questions/15880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39/" ]
15,899
<p>I have a <code>XmlDocument</code> in java, created with the <code>Weblogic XmlDocument</code> parser.</p> <p>I want to replace the content of a tag in this <code>XMLDocument</code> with my own data, or insert the tag if it isn't there.</p> <pre><code>&lt;customdata&gt; &lt;tag1 /&gt; &lt;tag2&gt;mfkdslmlfkm&...
[ { "answer_id": 15961, "author": "alanl", "author_id": 1464, "author_profile": "https://Stackoverflow.com/users/1464", "pm_score": 0, "selected": false, "text": "query fn:replace(string,pattern,replace)\n" }, { "answer_id": 15967, "author": "Olly", "author_id": 1174, ...
2008/08/19
[ "https://Stackoverflow.com/questions/15899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86/" ]
15,917
<p>I'm using NHibernate on a project and I need to do data auditing. I found <a href="http://www.codeproject.com/KB/cs/NHibernate_IInterceptor.aspx" rel="nofollow noreferrer">this article</a> on codeproject which discusses the IInterceptor interface.</p> <p>What is your preferred way of auditing data? Do you use dat...
[ { "answer_id": 212932, "author": "kͩeͣmͮpͥ ͩ", "author_id": 26479, "author_profile": "https://Stackoverflow.com/users/26479", "pm_score": 2, "selected": false, "text": "public interface IRepository<EntityType> where EntityType:IAuditably\n{ \n public void Save(EntityType entity);\n}\n...
2008/08/19
[ "https://Stackoverflow.com/questions/15917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1122/" ]
15,949
<p>I have a tomcat instance setup but the database connection I have configured in <code>context.xml</code> keeps dying after periods of inactivity.</p> <p>When I check the logs I get the following error:</p> <p>com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the s...
[ { "answer_id": 16168, "author": "ScArcher2", "author_id": 1310, "author_profile": "https://Stackoverflow.com/users/1310", "pm_score": 5, "selected": true, "text": "* Jakarta-Commons DBCP\n* Jakarta-Commons Collections\n* Jakarta-Commons Pool\n removeAbandonedTimeout=\"60\"\n testWhileIdl...
2008/08/19
[ "https://Stackoverflow.com/questions/15949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22/" ]
15,954
<p>How can a <code>sdbm</code> hash function (such as <a href="http://www.cse.yorku.ca/~oz/hash.html" rel="nofollow noreferrer">this</a>) be implemented in C# ?</p>
[ { "answer_id": 15971, "author": "Timbo", "author_id": 1810, "author_profile": "https://Stackoverflow.com/users/1810", "pm_score": 2, "selected": false, "text": "uint sdbm( string str )\n{\n uint hash = 0;\n foreach( char ch in str )\n {\n hash = ch + (hash << 6) + (hash <...
2008/08/19
[ "https://Stackoverflow.com/questions/15954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1658/" ]