instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>Is there a way of getting all required assemblies (excluding the .net framework) for a .net project into a folder ready to be packaged into an <a href="http://nsis.sourceforge.net/Main_Page" rel="nofollow noreferrer">nsis</a> as setup file?</p> <p>I've tried writing a small console app that uses reflection to get a...
<p>In Visual Studio (2005 at least - what I'm using right now), each reference that you have associated to a project has a property called "Copy Local", this can be set to true/false. When true it will copy the dll's for you into the current configuration directory.</p>
<p><a href="http://www.dependencywalker.com" rel="nofollow noreferrer">Dependency Walker</a> is what you need. Or maybe <a href="http://www.netomatix.com/Development/DependsNet.aspx" rel="nofollow noreferrer">Depends.Net</a></p>
7,525
<p>I started a print on my Monoprice Select v2 and let it run. I'm printing with Dikale PLA at 200&nbsp;&deg;C extruder and 60&nbsp;&deg;C build plate temperatures. My initial layer speed is 30mm/s then 60mm/s after that. Although the Monoprice comes with an aluminum build plate, I put on a <a href="https://rads.stack...
<p>You have more than one problem going on. As for the print lifting up, that could be for a multitude of reasons. Clearly better bed adhesion is required. It also appears the printer stopped printing at one layer. Now for the charred part, I think it could've been caused by the nozzle staying in one area for too long ...
<p>1) You have a layer shift. I guess the shift is caused by an <em>overheating</em> stepper driver, because it started relatively late, but could be also a mechanical issue.</p> <p>2) Print bed adhesion is a minor problem. Just test your printer with a simpler shape (large ground area).</p> <p>3) After carbonization...
1,151
<p>I have used fork() in C to start another process. How do I start a new thread?</p>
<p>Since you mentioned fork() I assume you're on a Unix-like system, in which case <a href="http://en.wikipedia.org/wiki/POSIX_Threads" rel="noreferrer">POSIX threads</a> (usually referred to as pthreads) are what you want to use.</p> <p>Specifically, pthread_create() is the function you need to create a new thread. I...
<p>Check out the <a href="https://computing.llnl.gov/tutorials/pthreads/" rel="nofollow noreferrer">pthread</a> (POSIX thread) library.</p>
8,091
<p>I have a table containing prices for a lot of different "things" in a MS SQL 2005 table. There are hundreds of records per thing per day and the different things gets price updates at different times.</p> <pre><code>ID uniqueidentifier not null, ThingID int NOT NULL, PriceDateTime datetime NOT NULL, Price decimal(1...
<p>I think the only solution with your table structure is to work with a subquery:</p> <pre><code>SELECT * FROM Thing WHERE ID IN (SELECT max(ID) FROM Thing WHERE ThingID IN (1,2,3,4) GROUP BY ThingID) </code></pre> <p>(Given the highest ID also means the newest price)</p>...
<p>maybe i missunderstood the taks but what about a: </p> <p><code>SELECT ID, ThingID, max(PriceDateTime), Price FROM Thing GROUP BY ThingID</code></p>
7,195
<p>In Delphi, I want to be able to create an private object that's associated with a class, and access it from all instances of that class. In Java, I'd use:</p> <pre><code>public class MyObject { private static final MySharedObject mySharedObjectInstance = new MySharedObject(); } </code></pre> <p>Or, if MyShare...
<p>Here is how I'll do that using a class variable, a class procedure and an initialization block:</p> <pre><code>unit MyObject; interface type TMyObject = class private class var FLogger : TLogLogger; public class procedure SetLogger(value:TLogLogger); class procedure FreeLogger; end; impl...
<p>Before version 7, Delphi didn't have static variables, you'd have to use a global variable.</p> <p>To make it as private as possible, put it in the <code>implementation</code> section of your unit.</p>
9,730
<p>Terminals and shells are very powerful but can be complicated to learn, especially to get the best out of them. Does anyone know of a more GUI based command shell that helps a user or displays answers in a more friendly way? I'm aware of IPython, but even the syntax of that is somewhat convoluted, although it's a st...
<p><a href="http://hotwire-shell.org" rel="noreferrer">Hotwire</a> is an attempt to combine the power of the traditional command line interface with GUI elements. So it has a GUI side, and tries to be helpful in suggesting commands, and in showing you possible matches from your history. (While there are keyboard shor...
<p>Check out <a href="http://hotwire-shell.org/" rel="nofollow noreferrer">http://hotwire-shell.org/</a></p>
5,022
<p>I'm behind a firewall at work at the moment and I was testing something that I had deployed to my website, and the work proxy seems to be blocking it somewhat.</p> <p>Basically I am getting a message of:</p> <blockquote> <p>Operation is not valid due to the current state of the object</p> </blockquote> <p>I've ...
<p>Edit, I forgot to write this part in the answer: You may need to add the web reference url to the safe list for your proxy. I am not sure what proxy you are using or if you have control of it, but this should solve your problem. If you don't have access to change the proxy, then I put a quick work around right bel...
<p>Another option is to go to your application's web config or app config and add the following under the element:</p> <pre><code>&lt;system.net&gt; &lt;defaultProxy useDefaultCredentials="false"&gt; &lt;proxy usesystemdefault="true" proxyaddress="10.0.0.1" port="80" bypassonlocal="true" /&gt; &lt;/de...
6,460
<p>Even though <a href="http://twistedmatrix.com/pipermail/twisted-python/2004-May/007896.html" rel="noreferrer">Python</a> and <a href="http://www.reddit.com/comments/6wmum/thread_safe_ruby_on_rails_in_22_release/" rel="noreferrer">Ruby</a> have one kernel thread per interpreter thread, they have a global interpreter ...
<p>I'm not totally sure which problem you want so solve, but if you deploy your python/django application via an apache prefork MPM using mod_python apache will start several worker processes for handling different requests.</p> <p>If one request needs so much resources, that you want to use multiple cores have a look...
<p>For Python, the <a href="http://pyprocessing.berlios.de/" rel="nofollow noreferrer">PyProcessing</a> project allows you to program with processes much like you would use threads. It is included in the standard library of the recently released 2.6 version as <a href="http://docs.python.org/library/multiprocessing.htm...
5,783
<p>This is ASP classic, not .Net. We have to get a way to SFTP into a server to upload and download a couple of files, kicked off by a user.</p> <p>What have other people used to do SFTP in ASP classic? Not necessarily opposed to purchasing a control.</p>
<p>If you have the ability to use WScript.Shell then you can just execute pscp.exe from the <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" rel="noreferrer">Putty</a> package. Obviously this is less then ideal but it will get the job done and let you use SCP/SFTP in classic ASP.</p>
<p>December 2020 :</p> <ul> <li>ASP is dead, it has been superseded by ASP .Net 18 years ago.</li> <li>At this time, the most common way to use SFTP in .Net is to use the <a href="https://github.com/sshnet/SSH.NET/" rel="nofollow noreferrer">SSH.NET NuGet package</a>.</li> </ul> <p>Maybe this question should be closed ...
2,322
<p>I am trying to get the DB2 data provider from a 32-bit .Net application to connect to DB2 running as a 32-bit application on Vista 64 (is that confusing enough yet)? Unfortunately, I am getting the following error:</p> <blockquote> <p>SQL1159 Initialization error with DB2 .NET Data Provider, reason code 7, token...
<p>Are you required to have it run as x86? I had similar issues with web apps under Visual Studio's dev web server (which is x86), but switching over to IIS (x64) worked for me. Since I was deploying to IIS x64, I called it a day at that point.</p> <p>I tried tracing with Filemon and Regmon, but didn't get any denied ...
<p>I uninstalled the previous 32bit version, reinstalled as 64bit, and now I get a completely different error. Its mentioned as requiring FP2 to fix, but since I'm using Express-C, I can't install the fixpack (IBM doesn't provide fixpacks for free DB2 products). Anyway, thanks for the help. At least I can come close...
4,901
<p>I'm looking for the fastest way to obtain the value of π, as a personal challenge. More specifically, I'm using ways that don't involve using <code>#define</code> constants like <code>M_PI</code>, or hard-coding the number in.</p> <p>The program below tests the various ways I know of. The inline assembly version is...
<p>The <a href="http://en.wikipedia.org/wiki/Monte_Carlo_method" rel="noreferrer">Monte Carlo method</a>, as mentioned, applies some great concepts but it is, clearly, not the fastest, not by a long shot, not by any reasonable measure. Also, it all depends on what kind of accuracy you are looking for. The fastest π I k...
<h2>Better Approach</h2> <p>To get the output of standard constants like <strong>pi</strong> or the standard concepts, we should first go with the builtins methods available in the language that you are using. It will return a value in the fastest and best way. I am using python to run the fastest way to get the value...
2,238
<p><a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming" rel="noreferrer">AOP</a> is an interesting programming paradigm in my opinion. However, there haven't been discussions about it yet here on stackoverflow (at least I couldn't find them). What do you think about it in general? Do you use AOP in your p...
<p>Yes.</p> <p>Orthogonal concerns, like security, are best done with AOP-style interception. Whether that is done automatically (through something like a dependency injection container) or manually is unimportant to the end goal.</p> <p>One example: the "before/after" attributes in <a href="http://www.codeplex.com/x...
<p>Yes, we do use AOP in application programming . I preferably use AspectJ for integrating aop in my Spring applications. Have a look at this article for getting a broader prospective for the same.</p> <p><a href="http://codemodeweb.blogspot.in/2018/03/spring-aop-and-aspectj-framework.html" rel="nofollow noreferrer">...
4,098
<p>I own a DIY Hypercube Evolution equipped with Tevo Titan extruder, Clone Chimera hotend and Capricorn's High-temp PTFE tube. I use RAMPS with Mega and A4988's.</p> <p>During prints, my extruder motor randomly clicks. I touched the filament and during the clicks I'ven't felt any problems with extrusion. I looked at ...
<p>Even though you may have acceptable extrusion, any clicking from that area of your printer is likely to be a missed step on the extruder motor. This may be insignificant with respect to print quality, but as you suggest, it is an irritation.</p> <p>If you are confident that your nozzle is clean of debris (which is ...
<p>Even though you may have acceptable extrusion, any clicking from that area of your printer is likely to be a missed step on the extruder motor. This may be insignificant with respect to print quality, but as you suggest, it is an irritation.</p> <p>If you are confident that your nozzle is clean of debris (which is ...
971
<p>Given a Marlin firmware and a line of G-code such as the following:</p> <blockquote> <p>G1 F100 X50 Y50 Z0 E-10</p> </blockquote> <p>What defines the speed at which the stepper motor associated with the E-value is retracting? It is my understanding that the Feed Rate defines the speed of the movement (in this ca...
<p>You instruct the printer to move from a certain X-Y position instructed by the previous move, to X=50 and Y=50. While moving at a feedrate of 100 mm/min, it will also retract 10 mm of filament (if the previous extruder distance was 0) during that move. If the movement distance is large, the retraction is slow. If yo...
<p>It seems like you are particularly talking about your extruder, please correct me if I have misread.</p> <p>In the command <code>G1 F100 X50 Y50 Z0 E-10</code>:</p> <ul> <li><code>G1</code> - move linearly</li> <li><code>F100</code> - Use a feed rate of 100 mm/minute</li> <li><code>X50 Y50 Z0</code> - tells those ...
1,093
<p>In LINQ to SQL, is it possible to check to see if an entity is already part of the data context before trying to attach it?</p> <p>A little context if it helps...</p> <p>I have this code in my <code>global.asax</code> as a helper method. Normally, between requests, this isn't a problem. But right after signing i...
<p>My rules:</p> <ol> <li>Don't initialize with the default values in declaration (<code>null</code>, <code>false</code>, <code>0</code>, <code>0.0</code>…).</li> <li>Prefer initialization in declaration if you don't have a constructor parameter that changes the value of the field.</li> <li>If the value of the field c...
<p>I normally try the constructor to do nothing but getting the dependencies and initializing the related instance members with them. This will make you life easier if you want to unit test your classes.</p> <p>If the value you are going to assign to an instance variable does not get influenced by any of the parameter...
4,419
<p>I saw this in <a href="https://stackoverflow.com/a/4384/697449">an answer to another question</a>, in reference to shortcomings of the Java spec:</p> <blockquote> <p>There are more shortcomings and this is a subtle topic. Check <a href="http://kiranthakkar.blogspot.com/2007/05/method-overloading-with-new-features-of...
<p>In the first case, you have a widening conversion happening. This can be see when runinng the "javap" utility program (included w/ the JDK), on the compiled class:</p> <pre><code>public static void main(java.lang.String[]); Code: 0: iconst_ 5 1: istore_ 1 2: iload_ 1 3: i2l 4: invokestati...
<p>Another interesting thing with this example is the method overloading. The combination of type widening and method overloading only working because the compiler has to make a decision of which method to choose. Consider the following example:</p> <pre><code>public static void hello(Collection x){ System.out.prin...
2,691
<p>What is the normal way people writing network code in Delphi use Windows-style overlapped asynchronous socket I/O?</p> <p>Here's my prior research into this question:</p> <p>The <a href="http://indyproject.org/" rel="noreferrer">Indy</a> components seem entirely synchronous. On the other hand, while ScktComp unit ...
<p>I have found that Indy, while a simpler concept in the beginning, is awkward to manage due to the need to kill sockets to free threads at application termination. In addition, I had the Indy library stop working after an OS patch upgrade. ScktComp works well for my application.</p>
<p>Indy uses synchronous sockets because it's a simpler way of programming. The asynchronous socket blocking was something added to the winsock stack back in the Windows 3.x days. Windows 3.x did not support threads and there you couldn't do socket I/O without threads. For some additional information about why Indy...
5,786
<p>I just listened to the StackOverflow team's 17th podcast, and they talked so highly of <a href="http://www.asp.net/mvc/" rel="noreferrer">ASP.NET MVC</a> that I decided to check it out.</p> <p>But first, I want to be sure it's worth it. I already created a base web application (for other developers to build on) for...
<p>If you are quite happy with WebForms today, then maybe ASP.NET MVC isn't for you.</p> <p>I have been frustrated with WebForms for a really long time. I'm definitely not alone here. The smart-client, stateful abstraction over the web breaks down severely in complex scenarios. I happen to love HTML, Javascript, an...
<p>Is the fact that ASP.net MVC is only in 'Preview 5' be a cause for concern when looking into it? </p> <p>I know that StackOverflow was created using it, but is there a chance that Microsoft could implement significant changes to the framework before it is officially out of beta/alpha/preview release?</p>
4,993
<p>I want to print this <a href="https://www.thingiverse.com/thing:2213410" rel="nofollow noreferrer">heat tower calibration test</a>.</p> <p>The instructions say to change the temperature every 25 layers. It also tells me to use G-Code command <code>M104 Sxxx</code></p> <p>First, is there a way to specify this comma...
<p>Every time you see a Z movement that matches the layer height (eg. 0.20&nbsp;mm) you can assume that is the end/start of one "layer". It should have a line like:</p> <pre><code>;Layer count: 17 ;LAYER:0. ; mine has this as the first layer M107 G0 F2400 X67.175 Y61.730 Z0.250. ; moves to Z0.250 mm for the first la...
<p>Every time you see a Z movement that matches the layer height (eg. 0.20&nbsp;mm) you can assume that is the end/start of one "layer". It should have a line like:</p> <pre><code>;Layer count: 17 ;LAYER:0. ; mine has this as the first layer M107 G0 F2400 X67.175 Y61.730 Z0.250. ; moves to Z0.250 mm for the first la...
1,181
<p>Was wondering if there was a way to put a wildcard in the schema.ini for example [*.txt] FMT=TabDelimited</p> <p>I've got an app that is imported tab delimited files and the only place I can seem to get the FMT="TabDelimited" is in the schema.ini (doesn't work in the connection string for some reason), but I will h...
<p>I guess I could potentially rename the file temporarily to match whatever I decide to put in the schema.ini or potentially modify the schema.ini on the fly and put the correct filename in there, but I'd love to do know if there was a better way.</p>
<p>A single schema.ini file can contain multiple [fileName.txt] entries and format descriptions, (for all the files in the Directory), so you might consider creating the .ini file dynamically from the directory file names. </p>
9,931
<p>Is their any profilers that support Silverlight? I have tried ANTS (Version 3.1) without any success? Does version 4 support it? Any other products I can try?</p> <p><strong>Updated</strong> since the release of Silverlight 4, it is now possible to do full profiling on SL applications... check out <a href="http://bl...
<p>Install XPerf and xperfview as available here: <a href="https://web.archive.org/web/20140825011849/http://blogs.msdn.com:80/b/seema/archive/2008/10/08/xperf-a-cpu-sampler-for-silverlight.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/cc305218.aspx</a></p> <p>(1) Startup your sample</p> <p>(2...
<p><a href="http://blogs.msdn.com/seema/archive/2008/10/08/xperf-a-cpu-sampler-for-silverlight.aspx" rel="nofollow noreferrer">Here</a> is a detailed blog entry about using XPerf... Also check out <a href="http://channel9.msdn.com/pdc2008/PC06/" rel="nofollow noreferrer">this</a> video (at PDC) about profiling silverli...
7,978
<p>What can be a practical solution to center vertically and horizontally content in HTML that works in Firefox, IE6 and IE7?</p> <p>Some details:</p> <ul> <li><p>I am looking for solution for the entire page.</p></li> <li><p>You need to specify only width of the element to be centered. Height of the element is not k...
<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;Centering&lt;/title&gt; &lt;style type="text/css" media="screen"&gt; body, html {height: 100%; padding: 0px; marg...
<p>Is this what you are trying to accomplish? If not, please explain what is different than the image below?</p> <p><img src="https://content.screencast.com/users/jessegavin/folders/Jing/media/a7adbb3d-dfc9-4f57-9cca-c47e9d399dd0/2008-09-11_1259.png" alt="alt text"></p>
7,187
<p>CSS and Javascript files don't change very often, so I want them to be cached by the web browser. But I also want the web browser to see changes made to these files without requiring the user to clear their browser cache. Also want a solution that works well with a version control system such as Subversion.</p> <hr ...
<p>I found that if you append the last modified timestamp of the file onto the end of the URL the browser will request the files when it is modified. For example in PHP:</p> <pre><code>function urlmtime($url) { $parsed_url = parse_url($url); $path = $parsed_url['path']; if ($path[0] == "/") { $filenam...
<p>Some solutions I have seen involve adding a version number to the end of the file in the form of a query string.</p> <pre><code>&lt;script type="text/javascript" src="funkycode.js?v1"&gt; </code></pre> <p>You could use the SVN revision number to automate this <a href="https://stackoverflow.com/questions/2308/aspne...
2,539
<p>Because Linux (and its variants) have a completely different set of fonts than Windows and Mac OS X, is there anyone with any experience of creating cross-platform font families - ideally finding equivalents to the common fonts found on the aforementioned operating systems?</p> <p>If so, what is the best route to t...
<p>Here are some good up-to-date listings of the most-installed fonts for PC, Mac, and Linux:</p> <p><a href="http://www.codestyle.org/css/font-family/sampler-SansSerif.shtml" rel="nofollow noreferrer">Sans serif font sampler and survey results</a></p> <p><a href="http://www.codestyle.org/css/font-family/sampler-Seri...
<p>TrueType Fonts (TTF) will generally work on Windows, Mac, and Linux platforms.</p> <p><a href="http://en.wikipedia.org/wiki/TrueType" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/TrueType</a></p>
5,924
<p>I've noticed that there seems to be quite a bit of hostility towards Linq To Entities particularly from the Alt.Net folks. I understand the resistance to more "drag and drop" programming, but from my understanding, Linq To Entities doesn't require it. </p> <p>We're currently using Linq to SQL, and we are using th...
<p>I don't think it's a hate for the <em>idea</em> of it per se. It's just that people don't like the <em>implementation</em> of it.</p> <p><a href="http://efvote.wufoo.com/forms/ado-net-entity-framework-vote-of-no-confidence/" rel="nofollow noreferrer">http://efvote.wufoo.com/forms/ado-net-entity-framework-vote-of-n...
<p>I would add that LTE implementation of TPT inheritance is nothing short of criminal. See my question <a href="https://stackoverflow.com/questions/4126668/when-quering-over-a-base-type-why-does-the-ef-provider-generate-all-those-union-a">here</a>.</p> <p>And while I'm at it, I believe that the many <a href="http://w...
7,890
<p>I've created a seperate assembly with a class that is intended to be published through wmi. Then I've created a windows forms app that references that assembly and attempts to publish the class. When I try to publish the class, I get an exception of type System.Management.Instrumentation.WmiProviderInstallation...
<p>To summarize, this is the final code that works:</p> <p>Provider class, in it's own assembly:</p> <pre><code>// the namespace used for publishing the WMI classes and object instances [assembly: Instrumented("root/mytest")] using System; using System.Collections.Generic; using System.Text; using System.Management...
<p>I used gacutil - installutil to to test your class (as a dll). The gacutil part worked, but installutil (actually mofcomp) complained about a syntax error:</p> <p>...</p> <p>error SYNTAX 0X80044014: Unexpected character in class name (must be an identifier)</p> <p>Compiler returned error 0x80044014</p> <p>...</p...
9,110
<p>What would be the best way to write Objective-C on the Windows platform?</p> <p>Cygwin and gcc? Is there a way I can somehow integrate this into Visual Studio?</p> <p>Along those lines - are there any suggestions as to how to link in and use the Windows SDK for something like this. Its a different beast but I know...
<p>Expanding on the two previous answers, if you just want Objective-C but not any of the Cocoa frameworks, then gcc will work on any platform. You can use it through Cygwin or get MinGW. However, if you want the Cocoa frameworks, or at least a reasonable subset of them, then GNUStep and Cocotron are your best bets.</p...
<p>If you are comfortable with Visual Studio environment, </p> <p>Small project: jGRASP with gcc Large project: Cocotron </p> <p>I heard there are emulators, but I could find only Apple II Emulator <a href="http://virtualapple.org/" rel="nofollow">http://virtualapple.org/</a>. It looks like limited to games. </p>
8,076
<p>I'd like a concise introduction to the different options.</p>
<p>From <a href="http://en.wikipedia.org/wiki/Flash_video" rel="nofollow noreferrer">Wikipedia</a></p> <blockquote> <blockquote> <p><strong>Embedded in an SWF file</strong> using the Flash authoring tool (supported in Flash Player 6 and later). The entire file must be transferred before playback can begin. Chang...
<p>Further to yoavf's answer, you can also use haxevideo as an open source rtmp video streaming server.</p>
2,934
<p>I'm currently trying out db4o (the java version) and I pretty much like what I see. But I cannot help wondering how it does perform in a real live (web-)environment. Does anyone have any experiences (good or bad) to share about running db4o? </p>
<p>We run DB40 .NET version in a large client/server project.</p> <p>Our experiences is that you can potentially get much better performance than typical relational databases.</p> <p>However, you really have to tweak your objects to get this kind of performance. For example, if you've got a list containing a lot of o...
<p>Judah, it sounds like you are not using transparent activation, which is a feature of the latest production version (7.4)? Perhaps if you specified the version you are using as there may be other issues which are now resolved in the latest version?</p>
4,145
<p>In an application that heavily relies on <code>.htaccess</code> RewriteRules for its PrettyURLs (CakePHP in my case), how do I correctly set up directives to exclude certain directories from this rewriting? That is:</p> <pre><code>/appRoot/.htaccess app/ static/ </code></pre> <p>By default every ...
<p>And the correct answer iiiiis...</p> <pre><code>RewriteRule ^(a|bunch|of|old|directories).* - [NC,L] # all other requests will be forwarded to Cake RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </code></pre> <p>I still don't get why the index.php file in the root directory was call...
<p>Remove the [L] from the previous rules:</p> <pre><code>RewriteBase /appRoot RewriteRule ^$ app/webroot/ &amp;nbsp; &amp;nbsp; RewriteRule (.*) app/webroot/$1 </code></pre> <p>[L] means "Stop the rewriting process here and don't apply any more rewriting rules."</p>
2,533
<p>I need to periodically download, extract and save the contents of <a href="http://data.dot.state.mn.us/dds/det_sample.xml.gz" rel="noreferrer">http://data.dot.state.mn.us/dds/det_sample.xml.gz</a> to disk. Anyone have experience downloading gzipped files with C#?</p>
<p>To compress:</p> <pre><code>using (FileStream fStream = new FileStream(@"C:\test.docx.gzip", FileMode.Create, FileAccess.Write)) { using (GZipStream zipStream = new GZipStream(fStream, CompressionMode.Compress)) { byte[] inputfile = File.ReadAllBytes(@"c:\test.docx"); zipStream.Write(input...
<p>You can use the <code>HttpContext</code> object to download a csv.gz file</p> <p>Convert you <code>DataTable</code> into string using <code>StringBuilder</code> (<code>inputString</code>)</p> <pre><code>byte[] buffer = Encoding.ASCII.GetBytes(inputString.ToString()); HttpContext.Current.Response.Clear(); HttpContext...
3,754
<p>If you already have a 3D printer, would you say that you have saved money on buying the printer, buying models and then printing the models, compared to buying something alike in retail?</p> <p>Would you say that saving money is an argument to buy a 3D printer?</p>
<p>I would say that the general answer to your specific question is no. If you want to justify buying a printer because of all the things you could print instead of buying that is not going to be easy. </p> <p>If however you are a DIYer and you have some CAD skills, or are willing to learn some, then consider the 3D p...
<h1>Yes and No.</h1> <p>There are two sides of this, <strong><em>yes</em></strong> and <strong><em>no</em></strong>. Why I say <em>yes</em> is because there are little things that the 3D Printer can come in use for, like creating charger holders or just little household objects. The <em>no</em> side of this for me wou...
228
<p>Trying to use a guid as a resource id in a rest url but cant find any resource on how to. My best right now (not working though) is: <a href="http://localhost:49157/PhotogalleryDS.svc/gallery" rel="nofollow noreferrer">http://localhost:49157/PhotogalleryDS.svc/gallery</a>('1d03beb3-6d63-498b-aad7-fab0b1480996') (I'v...
<p>I figured it out!</p> <p><a href="http://localhost:49157/PhotogalleryDS.svc/photo(guid" rel="nofollow noreferrer">http://localhost:49157/PhotogalleryDS.svc/photo(guid</a>'01231cc7-1e26-4f33-9fdf-fdf7015267dd')</p> <p>This is the way</p>
<p>My best guess based on what you've written is that you're wrapping that URL in double quotes. The position 0 in that error message probably refers to the character directly before http</p>
4,648
<p>What makes a module/service/bit of application functionality a particularly good candidate for an OSGi module? </p> <p>I'm interested in using <a href="http://en.wikipedia.org/wiki/OSGi" rel="noreferrer">OSGi</a> in my applications. We're a Java shop and we use Spring pretty extensively, so I'm leaning toward using...
<p>Well, since you can not have one part OSGi and one part non-OSGi you'll need to make your entire app OSGi. In its simplest form you make a single OSGi bundle out of your entire application. Clearly this is not a best practice but it can be useful to get a feel for deploying a bundle in an OSGi container (Equinox, Fe...
<p>I really like the <a href="http://felix.apache.org/site/tutorials-examples-and-presentations.html" rel="nofollow noreferrer">Apache Felix tutorials</a>. However, I think in general leveraging OSGi in your application isn't one of those "let's use this framework, because it's hype" decision. It's more of a design que...
3,686
<p>There are various documents describing threading on Solaris/Linux, but nowwhere describing the Windows implementation. I have a passing interest in this, it seems strange that something so critical is (seemingly) not documented.</p> <p>Threading is not the same on different OS' - "Write Once, Run Anywhere" isn't tr...
<p>It really depends on the specific JVM implementation. I assume you're wondering about Sun's Windows JVM, and I can tell you with certainty that the Sun JVM maps a Java thread to an OS thread.</p> <p>You could try spawning up a couple of threads from Java code, open up Task Manager and see what happened.</p>
<p>That document is a little more about Solaris threading than the Java threading model. All JVMs call the native thread API of the OS they're written for so there is always one Java thread for an OS thread. The diagram in the document shows that it's not until the threads are in the OS space that they change. Each OS ...
9,277
<p>I have an Interface called <code>IStep</code> that can do some computation (See "<a href="http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html" rel="nofollow noreferrer">Execution in the Kingdom of Nouns</a>"). At runtime, I want to select the appropriate implementation by class name.</p> <pre...
<p>Your question is very confusing...</p> <p>If you want to find types that implement IStep, then do this:</p> <pre><code>foreach (Type t in Assembly.GetCallingAssembly().GetTypes()) { if (!typeof(IStep).IsAssignableFrom(t)) continue; Console.WriteLine(t.FullName + " implements " + typeof(IStep).FullName); } </co...
<p>Well Assembly.CreateInstance would seem to be the way to go - the only problem with this is that it needs the fully qualified name of the type, i.e. including the namespace.</p>
4,007
<p>I´m currently writing my own firmware for a custom delta printer. Therefore I also need to read G-code from programs like Slic3r. Even with an small example like an cube I´m struggling to find out where the z-coordinate is hidden in the code. Here is a small example of the code.</p> <pre><code>; generated by Slic3r...
<p>It isn't hidden at all. It's just that the Z-axis position only changes with each layer change, so the Z coordinate is only passed at layer change. On line 17 of your example G-code, it starts the first layer at Z=0.5mm:</p> <pre><code>G1 Z0.500 F7800.000 </code></pre> <p>The next time you should expect Z to appea...
<p>It isn't hidden at all. It's just that the Z-axis position only changes with each layer change, so the Z coordinate is only passed at layer change. On line 17 of your example G-code, it starts the first layer at Z=0.5mm:</p> <pre><code>G1 Z0.500 F7800.000 </code></pre> <p>The next time you should expect Z to appea...
518
<p>I am writing a basic word processing application and am trying to settle on a native "internal" format, the one that my code parses in order to render to the screen. I'd like this to be XML so that I can, in the future, just write XSLT to convert it to ODF or XHTML or whatever.</p> <p>When searching for existing st...
<p>As you are sure about needing to represent the <em>presentational</em> side of things, it may be worth looking at the <a href="http://www.w3.org/TR/xsl/" rel="noreferrer">XSL-FO</a> W3C Recommendation. This is a full-blown page description language and the (deeply unfashionable) other half of the better-known XSLT.<...
<p>XML is an <em>external</em> format, not <em>internal</em>.</p> <p>What's wrong with <a href="http://www.w3.org/TR/xhtml1/" rel="nofollow noreferrer">XHTML</a>? It's simple and it's ubiquitous (at least HTML is). Your implementation would be easy to debug, and your users will be eternally greatful.</p>
5,113
<p>In C, what is the difference between using <code>++i</code> and <code>i++</code>, and which should be used in the incrementation block of a <code>for</code> loop?</p>
<ul> <li><p><code>++i</code> will increment the value of <code>i</code>, and then return the incremented value.</p> <pre><code> i = 1; j = ++i; (i is 2, j is 2) </code></pre></li> <li><p><code>i++</code> will increment the value of <code>i</code>, but return the original value that <code>i</code> held before being i...
<p><em>a=i++</em> means <em>a</em> contains the current <em>i</em> value.</p> <p><em>a=++i</em> means <em>a</em> contains the incremented <em>i</em> value.</p>
4,449
<p>Recently I've been having trouble printing properly on my Creality Ender-3 printer. I ran a pretty long print (approx. 15 hours) that turned out really well. I then started printing an attachment for the original print and saw that it was printing layers that were extremely thin. </p> <p>I first scraped off the ex...
<p>You need to level you bed. Thin prints happen when the extruder is too low and is printing too close to the bed.</p> <p><a href="https://i.stack.imgur.com/ybFIO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ybFIO.png" alt="Example of printing levels"></a></p> <p>Download the following test co...
<p>If your first layer is more thin than you expect it to be, the bed is too close to the nozzle. Note that you need to check the level an bed-to-nozzle distance once every few prints. Also, the first layer shouldn't be a too thin layer, the Cura default for a 0.4&nbsp;mm nozzle is about 0.28&nbsp;mm. Personally, I alw...
1,594
<p>There doesn't seem to be a way to change the padding (or row height) for all rows in a .NET ListView. Does anybody have an elegant hack-around?</p>
<p>I know this post is fairly old, however, if you never found the best option, I've got a <a href="http://qdevblog.blogspot.co.uk/2011/11/c-listview-item-spacing.html">blog post</a> that may help, it involves utilizing LVM_SETICONSPACING. </p> <p><strong>According to my blog,</strong></p> <p>Initially, you'll need t...
<p>A workaround is to use an ImageList that is as tall as you want the items to be. Just fill a blank image with the background color. You can even make the image 1 wide so as to not take much space horizontally.</p>
8,226
<p><strong>Backstory:</strong> Like <a href="https://3dprinting.stackexchange.com/search?q=build+plate+sticking">quite a lot of people here</a>, I'm having problems with parts adhering to the build plate of a resin printer. I've tried everything that I can think of: cleaning &amp; re-sanding the buildplate at 80 grit,...
<p>The whole reason to pre-coat the plate with <strong>liquid</strong> resin is to ensure, that no air bubbles are left under it and prevent contact of the plate to the resin.</p> <p>A layer of cured resin throws off your 0.</p>
<p>According to Uncle Jessy (<a href="https://www.youtube.com/watch?v=8SWGpY3LlX0" rel="nofollow noreferrer">see Youtube channel</a>), you simply need to pour some liquid resin over the build plate and then leave it for a couple of minutes for the worst to drip off. No</p> <p>He also recommends that the resin should be...
2,039
<p>Jeff mentioned in one of the podcasts that one of the things he always does is put in instrumentation for database calls, so that he can tell what queries are causing slowness etc. This is something I've measured in the past using SQL Profiler, but I'm interested in what strategies other people have used to include...
<p>If a query is more then just a simple SELECT on a single table I always run it through EXPLAIN if I am on MySQL or PostgreSQL. If you are using SQL Server then Management Studio has a Display Estimated Execution Plan which is essentially the same. It is useful to see how the engine will access each table and what in...
<p>If you're writing queries in SQL Management Studio you can enter: <code>SET STATISTICS TIME ON</code> and SQl Server will tell you how long the individual parts of a query took to parse, compile and execute. You might be able to log this information by handling the InfoMessage event of the SqlConnection class (but I...
3,020
<p>Other than Notepad++, what text editor do you use to program in Windows? </p>
<p>Another vote for <strong>gvim</strong> (<a href="http://www.vim.org/about.php" rel="nofollow noreferrer">about</a>, <a href="http://www.vim.org/download.php#pc" rel="nofollow noreferrer">download</a>). I think once you learn the keystrokes to control it, you won't want to use anything else.</p> <p>Plus, there is th...
<p>No <a href="http://www.eclipse.org/" rel="nofollow noreferrer">Eclipse</a> in the list !!!</p>
3,498
<p>I've got a Prusa i3 MK3. I have printed with PLA, PETG and tried HIPS. Haven't had any clogs with PLA and PETG, but with HIPS I've got a weird problem.</p> <p>My first three test prints in HIPS went fine, but then I got a very bad clog (required total disassembly of the extruder) twice. And every time, it was at th...
<p>This has been sitting for a long time without an answer, so let me answer with an experience I've had with PETG rather than HIPS. </p> <p>PETG seems to be a relatively soft plastic. It isn't soft like TPU, but it is softer than PLA or ABS. The HIPS filament (which I have but haven't used) appears to also be softe...
<p>HIPS does better with a wider nozzle; try a 1mm nozzle.</p>
920
<p>I've worked on a number of different embedded systems. They have all used <code>typedef</code>s (or <code>#defines</code>) for types such as <code>UINT32</code>.</p> <p>This is a good technique as it drives home the size of the type to the programmer and makes you more conscious of chances for overflow etc.</p> <...
<p>I use type abstraction very rarely. Here are my arguments, sorted in increasing order of subjectivity:</p> <ol> <li><p>Local variables are different from struct members and arrays in the sense that you want them to fit in a register. On a 32b/64b target, a local <code>int16_t</code> can make code slower compared to...
<p>Maybe I'm weird, but I use ub, ui, ul, sb, si, and sl for my integer types. Perhaps the "i" for 16 bits seems a bit dated, but I like the look of ui/si better than uw/sw.</p>
2,872
<p>This question is addressed to a degree in this question on <a href="https://stackoverflow.com/questions/33664/best-practices-for-managing-linq-to-sql-dbml-files">LINQ to SQL .dbml best practices</a>, but I am not sure how to add to a question.</p> <p>One of our applications uses LINQ to SQL and we have currently ha...
<p>Take advantage of the namespace settings. You can get to it in properties from clicking in the white space of the ORM.</p> <p>This allows me to have a Users table and a User class for one set of business rules and a second (but the same data store) Users table and a User class for another set of business rules.</p>...
<p>The approach that we've used it to keep 2 .dbml files. One of them holds the Stored Procs and all production DB access is done through this. The other is in a unit test folder and holds tables and their relationships and is used for DB data manipulation and querying for unit tests.</p>
6,362
<p>I am developing a website that will manage data for multiple entities. No data is shared between entities, but they may be owned by the same customer. A customer may want to manage all their entities from a single "dashboard". So should I have one database for everything, or keep the data seperated into individua...
<p>Personally, I prefer separate databases, specifically a database for each entity. I like this approach for the following reasons:</p> <ol> <li>Smaller = faster regarding the queries.</li> <li>Queries are simpler.</li> <li>No risk of ever accidentally displaying one customer's data to another.</li> <li>One database ...
<p>One good argument for keeping them in separate databases is that its easier to scale (you can simply have multiple installations of the server, with the client databases distributed across the servers).</p> <p>Another argument is that once you are logged in, you don't need to add an extra where check (for client ID...
4,068
<p>I don't understand where the extra bits are coming from in <a href="http://en.wikipedia.org/wiki/S-box" rel="nofollow noreferrer">this article</a> about s-boxes. Why doesn't the s-box take in the same number of bits for input as output?</p>
<p>It is the way s-boxes work. They can be m * n ==> m bit input , n bit output. For example, in the <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard" rel="nofollow noreferrer">AES</a> S-box the number of bits in input is equal to the number of bits in output.</p> <p>In <a href="http://en.wikipedia...
<p>What extra bits? They are going from 6 to 4.</p> <p>EDIT: Whoops! I'm an idiot. This is kinda like a 2nd grade multiplication table. They strip the outer bits off of the 6-bit block to be encypted, and leave the middle 4. Just like a table for an arithmatic operation, they go down one side, and find the outer b...
4,378
<p>Anyone know of a good, hopefully free FTP class for use in .NET that can actually work behind an HTTP proxy or FTP gateway? The FtpWebRequest stuff in .NET is horrible at best, and I really don't want to roll my own here.</p>
<p>Our <a href="http://www.rebex.net/ftp.net/" rel="nofollow noreferrer">Rebex FTP</a> works with proxies just fine. Following code shows how to connect to the FTP using HTTP proxy (code is taken from <a href="http://www.rebex.net/ftp.net/tutorial-ftp.aspx#proxy" rel="nofollow noreferrer">FTP tutorial page</a>).</p> <...
<p>System.Net.WebClient can handle ftp urls, and it's a bit easier to work with. You can set credentials and proxy information with it, too.</p>
9,930
<p>I am having problems getting text within a table to appear centered in IE. </p> <p>In Firefox 2, 3 and Safari everything work fine, but for some reason, the text doesn't appear centered in IE 6 or 7. </p> <p>I'm using:</p> <pre class="lang-css prettyprint-override"><code>h2 { font: 300 12px "Helvetica", serif; ...
<p>The table cell needs the text-align: center.</p>
<p>The <code>text-align: center</code> should be sufficient, since you're centering the text inside a block element (h2) - adjusting the margins will change the position of the block, not the text.</p> <p>I wonder if it's just that IE is having a dummy-spit at that <code>font</code> declaration you've got there?</p>
9,413
<p>Thinking about getting into .net technology project management</p> <p>I've had plenty of experience with PHP projects: I'm aware of most of the existing frameworks and libraries, and I've written specs and case studies based on this knowledge.</p> <p>What should I know about .net? Which top resources would you rec...
<p>Start with the basics before you get to the higher level stuff like web services (though that is important too). The most important things you need to learn, as a project manager, are the things you're going to be questioning your underlings about later. For example, my PM (also a PHP guy) has absolutely no knowledg...
<p>The biggest thing you'll probably want to learn is the differences between Windows and non-Windows programmers. They approach fundamental things differently. Knowing the difference will be key to successfully managing the project. If you listen to the stack overflow podcast, and Jeff and Joel have multiple discus...
4,037
<p>I'm kind of interested in getting some feedback about this technique I picked up from somewhere.</p> <p>I use this when a function can either succeed or fail, but you'd like to get more information about why it failed. A standard way to do this same thing would be with exception handling, but I often find it a bit ...
<p>I agree with the others who have stated that this is a little on the WTFy side. If it's clearly documented functionality, then it's less of an issue, but I think it'd be safer to take an alternate route of returning 0 for success and integers for error codes. If you don't like that idea or the idea of a global last ...
<p>In my opinion, you should use this technique only if failure is a "normal part of operation" of your method / function. For example, it's as probable that a call suceeds as that it fails. If failure is a exceptional event, then you should use exception handling so your program can terminate as early and gracefully a...
9,818
<p>I want to embed an .asp page on an html page. I cannot use an iframe. I tried:</p> <pre><code>&lt;object width="100%" height="1500" type="text/html" data="url.asp"&gt; alt : &lt;a href="url.asp"&gt;url&lt;/a&gt; &lt;/object&gt;" </code></pre> <p>works great in ff but not ie7. Any ideas? Is it possible to use th...
<p>I've solved it in the past using Javascript and XMLHttp. It can get a bit hacky depending on the circumstances. In particular, you have to watch out for the inner page failing and how it affects/downgrades the outer one (hopefully you can keep it downgrading elegantly).</p> <p>Search for XMLHttp (or check <a href="...
<p>Well, after searching around and testing I don't think it is possible. It looks to me like IE does not allow the object tag access to a resource that is not on the same domain as the parent. It would have worked for me if the content I was trying to pull in was on same domain but it wasn't. If anyone could confir...
7,646
<p>Jeff actually posted about this in <a href="http://refactormycode.com/codes/333-sanitize-html" rel="noreferrer">Sanitize HTML</a>. But his example is in C# and I'm actually more interested in a Java version. Does anyone have a better version for Java? Is his example good enough to just convert directly from C# to Ja...
<p>Don't do this with regular expressions. Remember, you're not protecting just against valid HTML; you're protecting against the DOM that web browsers create. Browsers can be tricked into producing valid DOM from invalid HTML quite easily. </p> <p>For example, see this list of <a href="http://ha.ckers.org/xss.html" r...
<p>The biggest problem by using jeffs code is the @ which currently isnt available. </p> <p>I would probably just take the "raw" regexp from jeffs code if i needed it and paste it into </p> <p><a href="http://www.cis.upenn.edu/~matuszek/General/RegexTester/regex-tester.html" rel="nofollow noreferrer">http://www.cis.u...
4,437
<p>Out of the box SSRS reports cannot have data exposed in the page header. Is there a way to get this data to show?</p>
<p>One of the things I want in my reports is to have nice headers for my reports. I like to have a logo and the user's report parameters along with other data to show to give more information for the business needs the report needs to clarify. One of the things that Microsoft SQL Server 2005 Reporting Services cannot...
<p>Here are two possible <strong>workarounds</strong>:</p> <ol> <li><p>You can place the databound field within the body of the report as a hidden textbox, and then in the header place another textbox with it's value pointed at the the one hidden within the body.</p></li> <li><p>Try using report parameters to store th...
8,940
<p>What could be the cause of JVM thread dumps that show threads waiting to lock on a monitor, but the monitors do not have corresponding locking threads? </p> <p>Java 1.5_14 on Windows 2003</p>
<p>Does your code by any change use any JNI? (i.e. are you running any native code launched from Java?).</p> <p>We've seen a similar behavior, but JDK 1.6.0_05. App appears to deadlock, but Jstack shows threads waiting for a lock that no other threads are holding onto. We have some JNI code, so it's possible we're cor...
<p>That's just a wild guess, but could it be, that a thread locks itself by trying to acquire a lock twice? Probably it would help if you could post some code.</p>
9,066
<p>I do mostly Java and C/C++ development, but I'm starting to do more web development (PHP, Rails) and Eiffel (learning a new language is always good).</p> <p>Currently, I use Eclipse for Java, C/C++, and Ruby (not Rails). Since I know the environment, I'm thinking that it would be easier for me to find a plugin and ...
<p>I have used many many IDE's and in most cases to me it breaks down to personal preferences. Sometimes the language specific ones have some addins/addons/features that are nice but unless they are things you can not live without you should go with what is most comfortable for you.</p> <p>I would think that if you ar...
<p>It entirely depends on the user and the language itself, if you are comfortable with the keyboard shortcuts then you can consider the plugin else you can go for a IDE . However most of the IDE comes with a cross-functional key maps so you use the key maps which u are more comfortable with.... </p>
7,292
<p>One of the local libraries has a new small Makerbot 3D printer. I have been submitting Sketchup files converted to STL files for printing. </p> <p>The tech guy who runs the printer for patrons is having trouble getting a project of mine to come out to be the right size. I need this item go be 2 inches wide. The tec...
<p>It appears that you have scaled the object after the raft and supports were added. As you can see in your photo of the raft, the clip is approximately 7/8ths (1.75/2) the size of the raft.</p> <p>Edit: As a side note, STL files don't actually have a concept of units. Each axis is defined in arbitrary units. That's ...
<p>My advice is to use a micrometer (i.e., sliding dial caliper) accurate to within .001" and measure the printed object. If it is 1 7/8" for example, you would open the STL file in Makerbot software and use their scaling tool to scale the object to 1.0666666...., which is what you get when you divide the desired size...
212
<p>Where can I get some decent looking free ASP.Net or CSS themes?</p>
<p>I wouldn't bother looking for ASP.NET stuff specifically (probably won't find any anyways). Finding a good CSS theme easily can be used in ASP.NET. </p> <p>Here's some sites that I love for CSS goodness:</p> <p><a href="http://www.freecsstemplates.org/" rel="noreferrer">http://www.freecsstemplates.org/</a><br> <...
<p>As always, <a href="http://www.csszengarden.com/" rel="nofollow noreferrer">http://www.csszengarden.com/</a>. Note that the images aren't public domain.</p>
4,329
<p>Besides the dynamic nature of Python (and the syntax), what are some of the major features of the Python language that Java doesn't have, and vice versa?</p>
<ol> <li><p>List comprehensions. I often find myself filtering/mapping lists, and being able to say <code>[line.replace("spam","eggs") for line in open("somefile.txt") if line.startswith("nee")]</code> is really nice.</p></li> <li><p>Functions are first class objects. They can be passed as parameters to other functio...
<p>With <a href="http://www.jython.org/Project/" rel="nofollow noreferrer">Jython</a> you can have both. It's only at Python 2.2, but still very useful if you need an embedded interpreter that has access to the Java runtime.</p>
7,242
<p>I'm trying to load a page that is basically an edit form inside a dialog (ui.dialog). I can load this page fine from an external (I'm using asp.net) page.</p> <p>The problem is that inside of my "popup" form, I need to <code>$(function() {my function here});</code> syntax to do some stuff when the page loads, alon...
<p>If you really need to load that form via AJAX you could to do all the Javascript stuff in $.ajax callback itself. So, you load the popup form like this:</p> <pre><code>$.ajax({ //... success: function(text) { // insert text into container // the code from $(function() {}); } }); </code></pre...
<p>The script isn't getting run because the document's ready event has already been fired. Remove your code from within the </p> <pre><code>$() </code></pre>
8,988
<p>Did Installing OneCare cause a "Generating user instances in SQL Server is disabled" error?</p> <p>The only change that I've made to my computer is uninstalling AVG and installing the trial for Microsoft OneCare. Did OneCare change the SQLServer installation somehow?</p> <p>This is a very "odd" question but is som...
<p>I would look more at the uninstalling of AVG as the culprit. OneCare does not care or even notice SQL Server instances as far as I can tell where as AVG does. </p> <p>I would look into your SQL Server instance and check the jobs. One or more may have been added by AVG. You should remove them. You might also wa...
<p>I didn't see anything odd in the event viewer or any db's for avg in SQLServer. btw I installed SQL server after AVG. it's curious anyway. I'll just make a VM and do a fresh install of SQLExpress so I can finish a few projects.</p> <p>it's been over a year so it's time for the annual reformat and reinstall ;-)</p>
5,946
<p>I installed the wxWidgets source code, compiled it and am linking the libraries thus obtained with my application code. Now I need to use OpenGL in my wxWidgets application. How do I enable this?</p>
<h2>For building on Windows with project files:</h2> <p>Assume $(WXWIDGETSROOT) is the root directory of your wxWidgets installation.</p> <ol> <li>Open the file $(WXWIDGETSROOT)\include\wx\msw\setup.h</li> <li>Search for the <code>#define</code> for <code>wxUSE_GLCANVAS</code>. </li> <li>Change its value from 0 to 1....
<p>(Assume $(WX_WIDGETS_ROOT) is the root directory of your wxWidgets installation.)</p> <ol> <li>Open the file $(WX_WIDGETS_ROOT)\include\wx\msw\setup.h</li> <li>Search and find the option wxUSE_GLCANVAS. Change its value from 0 to 1.</li> <li>Recompile the library.</li> </ol>
3,497
<p>The StackOverflow transcripts are enormous, and sometimes I want to link to a little bit within it.</p> <p>How do I create an HTML anchor in a FogBugz wiki page?</p>
<p>As of this writing, this feature is now supported -- just edit the wiki page's html directly (via the &lt;> button).</p> <p>See <a href="http://fogbugz.stackexchange.com/questions/2967/create-html-anchors-in-wiki-pages" rel="nofollow">this support question</a> for details. Use html anchor tags as you would in a typ...
<p>It doesn't appear to be possible.</p>
2,753
<p>We are looking for a C++ Soap web services framework that support RPC, preferably open source. Any recommendations? </p>
<p>WSO2 Web Services Framework for C++ (WSO2 WSF/C++), a binding of WSO2 WSF/C into C++ is a C++ extension for consuming Web Services in C++.</p> <p><a href="http://wso2.org/projects/wsf/cpp" rel="noreferrer">http://wso2.org/projects/wsf/cpp</a></p> <p>Apache Axis is an open source, XML based Web service framework. I...
<p>You could try <a href="http://www.cs.fsu.edu/~engelen/soap.html" rel="nofollow noreferrer">gSOAP</a>. Available under GPL and commercial licences.</p>
9,182
<p>How can you measure the amount of time a function will take to execute? </p> <p>This is a relatively short function and the execution time would probably be in the millisecond range.</p> <p>This particular question relates to an embedded system, programmed in C or C++.</p>
<p>The best way to do that on an embedded system is to set an external hardware pin when you enter the function and clear it when you leave the function. This is done preferably with a little assembly instruction so you don't skew your results too much. </p> <p>Edit: One of the benefits is that you can do it in your a...
<p>If you're looking for sub-millisecond resolution, try one of these timing methods. They'll all get you resolution in at least the tens or hundreds of microseconds:</p> <p>If it's embedded Linux, look at Linux timers:</p> <p><a href="http://linux.die.net/man/3/clock_gettime" rel="nofollow noreferrer">http://linux....
9,438
<p>Ten years ago when I first encountered the <a href="http://en.wikipedia.org/wiki/Capability_Maturity_Model" rel="noreferrer">CMM for software</a> I was, I suppose like many, struck by how accurately it seemed to describe the chaotic "level one" state of software development in many businesses, particularly with its ...
<p>At the heart of the matter lies this problem, neatly described by the CMM guidance itself...</p> <p>“<em>...Sound judgment is necessary to use the CMM correctly and with insight. Intelligence, experience and knowledge must shape an appropriate interpretation of the CMM in a specific environment. That interpretation...
<p>At school, I was taught: CMM is a good Idea, but lacking certification (anyone can say they are level 5 / level 4) it ends up being a marketing tool for offshore shops. So, yeah, the idea is sound, but how do you prove adherence?</p>
9,106
<p>Visual Studio 2008's XAML editor (SP1) cannot reformat the XML into a consistent style.</p> <p>Which tools can I use to get a nicely formatted XAML file? Studio integration preferred.</p>
<p>While browsing through the options, I found that I had to set "Position each attribute on a separate line" and "Position first attribute on same line as start tag" under "Tools > Options ... > Text-Editor > XAML > Formatting > Spacing" and reset the Keyboard mappings under "Tools > Options ... > Environment > Keyboa...
<p>I just did a post on this. This is a very versatile way to format XAML.</p> <p><a href="http://blogs.msdn.com/b/brunoterkaly/archive/2013/01/09/how-to-format-xaml-easily-and-effectively-windows-8-wpf-silverlight.aspx" rel="nofollow">http://blogs.msdn.com/b/brunoterkaly/archive/2013/01/09/how-to-format-xaml-easily-a...
6,994
<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 ...
<p>This will give you the top 50 statements by average CPU time, check here for other scripts: <a href="http://www.microsoft.com/technet/scriptcenter/scripts/sql/sql2005/default.mspx?mfr=true" rel="nofollow noreferrer">http://www.microsoft.com/technet/scriptcenter/scripts/sql/sql2005/default.mspx?mfr=true</a></p> <pre...
<p>Profiler may seem like a "needle in a haystack" approach, but it may turn up something useful. Try running it for a couple of minutes while the databases are under typical load, and see if any queries stand out as taking way too much time or hogging resources in some way. While a situation like this could point to s...
3,552
<p>I'd like to have dashes separate words in my URLs. So instead of:</p> <pre><code>/MyController/MyAction </code></pre> <p>I'd like:</p> <pre><code>/My-Controller/My-Action </code></pre> <p>Is this possible?</p>
<p>You can use the ActionName attribute like so:</p> <pre><code>[ActionName("My-Action")] public ActionResult MyAction() { return View(); } </code></pre> <p>Note that you will then need to call your View file "My-Action.cshtml" (or appropriate extension). You will also need to reference "my-action" in any Html.Ac...
<p>If you have access to the IIS URL Rewrite module ( <a href="http://blogs.iis.net/ruslany/archive/2009/04/08/10-url-rewriting-tips-and-tricks.aspx" rel="nofollow">http://blogs.iis.net/ruslany/archive/2009/04/08/10-url-rewriting-tips-and-tricks.aspx</a> ), you can simply rewrite the URLs.</p> <p>Requests to /my-contr...
5,021
<p>Until recently we were using Inno Setup for our installations, something I would like to continue doing, unless we can get an <a href="https://stackoverflow.com/questions/61691/how-to-add-uninstall-option-in-net-setup-project">uninstall option in the start menu</a> (thanks Giovanni Galbo), however we now need to GAC...
<p>According to <a href="http://jrsoftware.org/files/is5-whatsnew.htm" rel="noreferrer">http://jrsoftware.org/files/is5-whatsnew.htm</a> you should be able to do it with v5.3 and above</p> <blockquote> <p>Added .NET support (these cause an internal error if used on a system with no .NET Framework present):</p> ...
<p>Not sure about library, but you can call <a href="http://msdn.microsoft.com/en-us/library/ex0ss12c%28VS.80%29.aspx" rel="nofollow noreferrer">gacutil.exe</a> to install/uninstall assemblies.</p>
8,696
<p>Is there a way clear or reset the outputcache for an entire website without a restart?</p> <p>I'm just starting to use outputcache on a site and when I make a mistake in setting it up I need a page I can browse to that will reset it.</p>
<p>This should do the trick:</p> <pre><code>Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim path As String path="/AbosoluteVirtualPath/OutputCached.aspx" HttpResponse.RemoveOutputCacheItem(path) End Sub </code></pre>
<p>Add the following code to controller or to page code:</p> <pre><code>HttpContext.Cache.Insert("Page", 1); Response.AddCacheItemDependency("Page"); </code></pre> <p>To clear output cachne use the following command in controller:</p> <pre><code> HttpContext.Cache.Remove("Page"); </code></pre>
5,779
<p>When I drag &amp; drop a dll to the assembly folder on vista, I get the error "Access is denied: mydll.dll". How can I bypass the error message and add my dll to gac?</p>
<p>My guess would be that you have to do it as an administrator...try either disabling UAC, or using gacutil.exe to add your assembly.</p>
<p>You may not locate gacutil.exe in your windows folder while using vista. It's not included because of vista's "Logo Program blah blah" thing. Try to use windows installer to add your assemblies into gac. This is the recommended way.</p> <p>And never forget this traditional ogrish proverb: "Bi siktir git cay koy".</...
7,645
<p>Is it completely against the Java way to create struct like objects?</p> <pre><code>class SomeData1 { public int x; public int y; } </code></pre> <p>I can see a class with accessors and mutators being more Java like.</p> <pre><code>class SomeData2 { int getX(); void setX(int x); int getY(); ...
<p>Use common sense really. If you have something like:</p> <pre><code>public class ScreenCoord2D{ public int x; public int y; } </code></pre> <p>Then there's little point in wrapping them up in getters and setters. You're never going to store an x, y coordinate in whole pixels any other way. Getters and sett...
<p>You can make a simple class with public fields and no methods in Java, but it is still a class and is still handled syntactically and in terms of memory allocation just like a class. There is no way to genuinely reproduce structs in Java.</p>
5,729
<p>I've deployed some Managed Beans on WebSphere 6.1 and I've managed to invoke them through a standalone client, but when I try to use the application "jconsole" distributed with the standard JDK can can't make it works.</p> <p>Has anyone achieved to connect the jconsole with WAS 6.1?</p> <p>IBM WebSphere 6.1 it's s...
<p>WebSphere's support for JMX is crap. Particularly, if you need to connect to any secured JMX beans. Here's an interesting tidbit, their own implementation of jConsole will not connect to their own JVM. I have had a PMR open with IBM for over a year to fix this issue, and have gotten nothing but the runaround. Th...
<p>I have successfully connected to ActiveMQ and ServiceMix using the JConsole. Does WAS 6.1 use Java Management Extension (JMX) technology? JMX is required for JConsole.</p> <p>If your path is set correctly it should work fine. On windows you go to System Properties -> Advanced Tab -> Environment Variables. Have your...
4,722
<p>This is kinda oddball, but I was poking around with the GNU assembler today (I want to be able to at least read the syntax), and was trying to get this little contrived example of mine to work. Namely I just want to go from 0 to 100, printing out numbers all the while. So a few minutes later I come up with this:</p>...
<p>You can't trust what any called procedure does to any of the registers. Either push the registers onto the stack and pop them back off after calling printf or have the increment and end point values held in memory and read/written into registers as you need them. </p> <p>I hope the following works. I'm assuming th...
<p>You could rewrite it so that you use registers that aren't suppose to change, for example <code>%ebp</code>. Just make sure you push them onto the stack at the beginning, and pop them off at the end of your routine.</p> <pre><code># count.s: print the numbers from 0 to 100. .text string: .asciz "%d\n" .glo...
3,984
<p>I'm making a Circuit etching machine (CNC) and I need a good DC motor and drill bit for the spindle. </p> <p>My machine should be able to <strong>etch</strong>, <strong>drill</strong>, and <strong>cut</strong>:</p> <ul> <li><strong>Etching</strong>: take copper off the surface like chemicals or a laser would</li> ...
<p>There are several sources of PCB "etching" bits. They tend to be single straight flutes and high angle, very pointy bits.</p> <p>For the motor, high speed is good. Look for 30k+ RPM. The main thing to be concerned about is the amount of runout, or wobble in the tip. With a tiny tip, you can't afford much runout...
<h3>TL;DR</h3> <p>From Davo's and cmm's answers there seems to be a wide range of drill spindle speeds used (3k-30k rpm). So, just to add to that... 11,000 rpm would appear to be adequate.</p> <hr /> <p>I have been looking into converting a Wilson II 3D printer chassis into a CNC PCB etching machine, recently. In parti...
1,428
<p>I am wondering if it would it be feasible (at an affordable price) to 3D print a boat hull (small dimensions, maybe something like 60x40x20 cm). </p> <p>I am mostly concerned about: </p> <ul> <li><strong>durability</strong> (against salty water, UV rays, extreme temperatures (under the sun or in a cold ocean)</l...
<p>You will really need to specify your constraints better because the short answer is <strong>yes, what you describe <em>is</em> entirely possible</strong>, but without knowing whether you are limited to a particular budget, process, or aesthetic, it's not a particularly useful answer.</p> <p>Some machines (ex. Strat...
<p>Probably feasible, Affordable or simple probably not. To start from an affordability perspective, kayaks normally weigh around 20 kg, they <a href="http://www.grassrootsengineering.com/blog/2014/03/" rel="nofollow noreferrer">kayak in the video mentioned in the other answer</a> weighs in at 30kgs. Assuming you print...
508
<p>Recently a friend and I were talking about securing stored procedure code in a SQL server database. </p> <p>From distant memory, I'm pretty certain that "with encryption" is incredibly easily broken in all versions of SQL Server, however he said it has been greatly improved in SQL 2005. As a result I have not ser...
<p>It can be used to hide your code from casual observers, but as you say: it's easily circumvented.</p> <p>It really can't be any other way, since the server needs to decrypt the code to execute it. It's DRM, basically, and fails for the same reason as all the other DRM does - you can't simultaneously hide the data, ...
<p>Yes, it's easily broken. I had a situation this past week where I had to decrypt several sprocs that a former developer had encrypted for a client of mine. After decrypting it, which took a moderate effort, I wouldn't rely on that for any means of protecting intellectual property, passwords, user ids. Anything reall...
7,404
<p>I'm looking for some software to monitor a single server for performance alerts. Preferably free and with a reasonable default configuration.</p> <p>Edit: To clarify, I would like to run this software on a Windows machine and monitor a remote Windows server for CPU/memory/etc. usage alerts (not a single application...
<p>For performance monitor - start it on the server (<kbd>Win</kbd>+<kbd>R</kbd> and enter "perfmon"). Select "Performance Logs and Alerts" and expand. Select "Alerts". Select "Action" &amp; then "New Alert". Give the alert a name, click "Add" to add a counter (there are hundres of counters, for example CPU %), th...
<p>MS's solutions used to be called MOM. It looks like it's been <a href="http://www.microsoft.com/systemcenter/operationsmanager/en/us/default.aspx" rel="nofollow noreferrer">redesigned a bit</a> since I last used it.</p>
3,252
<p>The collection of fonts available to a web developer is depressingly limited. I remember reading long ago about TrueDoc, as a way of shipping fonts alongside a website - but it seems to have languished. Has anybody used this, or something similar? Is it supported by enough browsers? Am I missing a good solution?</p>...
<p>Safari, and to a lesser extent, Firefox 3 have support for <code>@font-face</code> in CSS, which lets you use custom fonts. You need to have the appropriate licence to distribute the font files though. These articles explain it in more detail:</p> <ul> <li><a href="http://www.css3.info/preview/web-fonts-with-font-f...
<blockquote> <p>Note that a responsible web developer does not use fonts that are only available on Windows (and especially ones that are only available on Vista), nor do they use a technology that isn't supported by at least the majority of browsers.</p> </blockquote> <p>Well… You can, as long as you know how it wi...
3,696
<p>I'm writing my first Perl app -- an AOL Instant Messenger bot that talks to an Arduino microcontroller, which in turn controls a servo that will push the power button on our sysadmin's server, which freezes randomly every 28 hours or so. </p> <p>I've gotten all the hard stuff done, I'm just trying to add one last b...
<p>The Perl built-in is <a href="http://perldoc.perl.org/functions/select.html" rel="noreferrer"><code>select()</code></a>, which is a pass-through to the <code>select()</code> system call, but for sane people I recommend <a href="http://search.cpan.org/dist/IO/lib/IO/Select.pm" rel="noreferrer"><code>IO::Select</code>...
<p>I found that <a href="http://search.cpan.org/dist/IO/lib/IO/Select.pm" rel="nofollow noreferrer">IO::Select</a> works fine as long as STDOUT gets closed, such as when the upstream process in the pipeline exits, or input is from a file. However, if output is ongoing (such as from "tail -f") then any partial data buf...
3,495
<p>What I want to do is something like this: I have enums with combined flagged values.</p> <pre><code>public static class EnumExtension { public static bool IsSet&lt;T&gt;( this T input, T matchTo ) where T:enum //the constraint I want that doesn't exist in C#3 { return (input &amp; match...
<p><strong>EDIT: This is now live in version 0.0.0.2 of UnconstrainedMelody.</strong></p> <p>(As requested on my <a href="http://codeblog.jonskeet.uk/2009/09/10/generic-constraints-for-enums-and-delegates/" rel="noreferrer">blog post about enum constraints</a>. I've included the basic facts below for the sake of a sta...
<p>I just wanted to add Enum as a generic constraint.</p> <p>While this is just for a tiny helper method using <a href="https://www.github.com/Fody/ExtraConstraints" rel="nofollow noreferrer"><code>ExtraConstraints</code></a> is a bit too much overhead for me.</p> <p>I decided to just just create a <code>struct</code...
2,886
<p>Is there any good way to deal with the class renaming refactor from Resharper when the file is under source control and TortoiseSVN is the client. I have am trying VisualSVN right now but I haven't had the need to rename anything recently. I don't want to change our repository just to try this out.</p> <p>Also no...
<p>TortoiseSVN 1.5 has a neat hidden feature on the check in window:</p> <p>Select a missing file and a new file and right-click. One of the options will be "fix move".</p> <p>I tend to refactor away, and then use this to fix any files where the name has changed.</p>
<p>Time to branch your repository. That's the nice part about version control, you can create new branches without totaling the old ones.</p>
3,467
<p>I have a ListBox that has a style defined for ListBoxItems. Inside this style, I have some labels and a button. One that button, I want to define a click event that can be handled on my page (or any page that uses that style). How do I create an event handler on my WPF page to handle the event from my ListBoxItem...
<p>Take a look at <a href="http://msdn.microsoft.com/en-us/library/system.windows.input.routedcommand.aspx" rel="noreferrer">RoutedCommand</a>s.</p> <p>Define your command in myclass somewhere as follows:</p> <pre><code> public static readonly RoutedCommand Login = new RoutedCommand(); </code></pre> <p>Now define...
<p>You could create a user control (.ascx) to house the listbox. Then add a public event for the page.</p> <pre><code>Public Event btnRemove() </code></pre> <p>Then on the button click event in the usercontrol</p> <pre><code>RaiseEvent btnRemove() </code></pre> <p>You can also pass objects through the event just li...
4,774
<p>I've inherited a large VB6 app at my current workplace. I'm kinda learning VB6 on the job and there are a number of problems I'm having. The major issue at the moment is I can't figure out how to check if a key exists in a Collection object. Can anyone help?</p>
<p>@Mark Biek Your keyExists closely matches my standard Exists() function. To make the class more useful for COM-exposed collections and checking for numeric indexes, I'd recommend changing sKey and myCollection to not be typed. If the function is going to be used with a collection of objects, 'set' is required (on t...
<p>While looking for a function like this i designed it as following. This should work with objects and non-objects without assigning new variables.</p> <pre><code>Public Function Exists(ByRef Col As Collection, ByVal Key) As Boolean On Error GoTo KeyError If Not Col(Key) Is Nothing Then Exists = True ...
6,188
<p>I am about to write an audio file converter for my side job at the university.<br> As part of this I would need sample rate conversion. However, my professor said that it would be pretty hard to write a sample rate converter that was <em>both</em> of good quality <em>and</em> fast.</p> <p>On my research on the subj...
<p>Try Secret Rabbit Code (= SRC = Sample Rate Conversion ) It's GPL, it's fast and it's high quality. <a href="http://www.mega-nerd.com/SRC/license.html" rel="noreferrer">http://www.mega-nerd.com/SRC/license.html</a></p>
<p>If you're worried about quality, check out <a href="http://src.infinitewave.ca/" rel="nofollow noreferrer">http://src.infinitewave.ca/</a>. Very good comparisons on different resamplers.</p>
6,291
<p>I have 2 SQLite databases, one downloaded from a server (<code>server.db</code>), and one used as storage on the client (<code>client.db</code>). I need to perform various sync queries on the client database, using data from the server database.</p> <p>For example, I want to delete all rows in the <code>client.db t...
<p>I just looked at the AIR SQL API, and there's an <code>attach</code> method on <code>SQLConnection</code> it looks exactly what you need.</p> <p>I haven't tested this, but according to the documentation it should work:</p> <pre><code>var connection : SQLConnection = new SQLConnection(); connection.open(firstDbFile)...
<p>this code can be work,it is write of me:</p> <pre><code>package lib.tools import flash.utils.ByteArray; import flash.data.SQLConnection; import flash.data.SQLStatement; import flash.data.SQLResult; import flash.data.SQLMode; import flash.events.SQLErrorEvent; import flash.events.SQLEvent; import flash.filesystem....
2,462
<p>I'm working on a side project that would be a simple web application to maintain a list of classes and their upcoming schedules.</p> <p>I would really like to use Linq to SQL for this project, but unfortunately the server environment I'm developing for only has MySql available. I've dabbled briefly with Subsonic bu...
<p>Take a look at Microsoft SQL Server Compact Edition. I believe you can work with MDF files without having to run a server. All code runs in process. I believe it has some limitations but it may work for you and I think it's free.</p>
<p>I don't understand... what do you mean by "having an MDF file in App_Data"? You need a proper SQL Server installation for that to work. You can always use the free SQL Server Express for developing the application, and then move the database to the proper SQL Server once you are done. Check <a href="http://www.micro...
5,567
<p>My boss has come to me and asked how to enure a file uploaded through web page is safe. He wants people to be able to upload pdfs and tiff images (and the like) and his real concern is someone embedding a virus in a pdf that is then viewed/altered (and the virus executed). I just read something on a procedure that ...
<p>I'd recommend running your uploaded files through antivirus software such as <a href="http://www.clamav.net/" rel="nofollow noreferrer">ClamAV</a>. I don't know about scrubbing files to remove viruses, but this will at least allow you to detect and delete infected files before you view them.</p>
<p>Yes, ClamAV should scan the file regardless of the extension.</p>
5,307
<p>We are in the early design stages of a major rewrite of our product. Right now our customers are mostly businesses. We manage accounts. User names for an account are each on their own namespace but it means that we can't move assets between servers.</p> <p>We want to move to a single namespace. But that brings the ...
<p><strong>EMAIL ADDRESS</strong></p> <p>Rational</p> <ol> <li>Users don't change emails very often</li> <li>Removes the step of asking for username and email address, which you'll need anyway</li> <li>Users don't often forget their email address (see number one)</li> <li>Email will be unique unless the user already ...
<p>OpenID seems to be a very good alternative to writing your own user management/authentication piece. I'm seeing more and more sites using OpenID these days, so the barrier to entry for your users should be relatively low.</p>
2,789
<p>I'm looking for a technique or tool which we can use to obfuscate or somehow secure our compiled c# code. The goal is not for user/data security but to hinder reverse engineering of some of the technology in our software. </p> <p>This is not for use on the web, but for a desktop application.</p> <p>So, do you know...
<p>This is a pretty good list of obfuscators from <a href="https://marketplace.visualstudio.com/search?term=.net%20obfuscators&amp;target=VS&amp;category=All%20categories&amp;vsVersion=&amp;sortBy=Relevance" rel="noreferrer">Visual Studio Marketplace</a> Obfuscators</p> <ul> <li><a href="https://www.armdot.com/" rel="...
<p>You are wasting your time going down that path. If you have code that you don't want anyone to see, you need to keep it behind closed doors. For example, only execute that code on your own server using a web service interface.</p> <p>Obfuscating your code only deters the most casual of people. As the video game ind...
8,465
<p>If I create an application on my Mac, is there any way I can get it to run on an iPhone without going through the app store?</p> <p>It doesn't matter if the iPhone has to be jailbroken, as long as I can still run an application created using the official SDK. For reasons I won't get into, I can't have this program ...
<h1>Official Developer Program</h1> <p>For a standard iPhone you'll need to pay the US$99/yr to be a member of the developer program. You can then use the adhoc system to install your application onto up to 100 devices. The developer program has the details but it involves adding UUIDs for each of the devices to your ...
<p>*Changes/Notes to make this work for <strong>Xcode 3.2.1</strong> and <strong>iPhone SDK 3.1.2</strong></p> <p>Manual Deployment over WiFi</p> <p>2) Be sure to restart Xcode after modifying the Info.plist</p> <p>3) The "uicache" command is not found, using killall -HUP SpringBoard worked fine for me.</p> <p>Othe...
5,813
<p>I'd like to discuss the case <a href="https://3dprinting.stackexchange.com/questions/1144/how-to-enlarge-a-sketchup-model">'How to enlarge a Sketchup Model'</a> question and my answer of course.</p> <p>I do agree with Robert Cartaino when he said: '<em>The folks here will work hard to curate this collection of know...
<p>Looking at other SE sites, the most common approach seems to make everything lowercase (including names and trademarks) and using hyphens whenever there would be a space or hyphen in normal usage.</p> <p>As such:</p> <ul> <li><p>MatterControl becomes mattercontrol</p></li> <li><p>Makerbot becomes makerbot</p></li>...
<p>I would say we could use synonyms to stay with clear tag namespace.In this case we apply following pattern (especially for proper name (product name)):</p> <pre><code>Topic | Existing tag | Synonym? ---------------+-----------------+-------------- MatterControl | mattercontrol | matter-control </code...
30
<p>I have just installed C# for the first time, and at first glance it appears to be very similar to VB6. I decided to start off by trying to make a 'Hello, World!' UI Edition.</p> <p>I started in the Form Designer and made a button named "Click Me!" proceeded to double-click it and typed in</p> <pre><code>MessageBox...
<p>MessageBox.Show also returns a DialogResult, which if you put some buttons on there, means you can have it returned what the user clicked. Most of the time I write something like</p> <pre><code>if (MessageBox.Show("Do you want to continue?", "Question", MessageBoxButtons.YesNo) == MessageBoxResult.Yes) { //som...
<p>In the <code>System.Windows.Forms</code> class, you can find more on the <a href="http://www.msdn.com/" rel="nofollow">MSDN</a> page for this here. Among other things you can control the message box text, title, default button, and icons. Since you didn't specify, if you are trying to do this in a webpage you should...
7,158
<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 ...
<p>Ultimately, it will not hurt any users if you target the Client Profile. This is because the client profile is a subset of the .net framework v3.5 sp1, and if v3.5 sp1 is already installed you don't need to install anything. </p> <p>The assemblies in the client profile are the same binaries as the full framework, s...
<blockquote> <p>I believe that once the .NET Framework has been installed, extra information is passed to a web server as part of a web request signifying that the framework is available.</p> </blockquote> <p>On IE, yes. It sends the .NET Framework version as part of the UA string, e.g.:</p> <pre><code>Mozilla/4.0 ...
3,648
<p>Is it possible to use overlapped I/O with an anonymous pipe? CreatePipe() does not have any way of specifying FILE_FLAG_OVERLAPPED, so I assume ReadFile() will block, even if I supply an OVERLAPPED-structure. </p>
<p>Here is an implementation for an anonymous pipe function with the possibility to specify FILE_FLAG_OVERLAPPED:</p> <pre><code>/******************************************************************************\ * This is a part of the Microsoft Source Code Samples. * Copyright 1995 - 1997 Microsoft Corpora...
<p>No. As explained <a href="http://msdn.microsoft.com/en-us/library/aa365141%28VS.85%29.aspx" rel="noreferrer">here</a>, anonymous pipes do not support asynchronous I/O. You need to use a named pipe. There's example code to do this on MSDN <a href="http://msdn.microsoft.com/en-us/library/aa365603%28VS.85%29.aspx" rel=...
8,556
<p>Before I upgraded to Firefox 3 I used to constantly use the <a href="https://addons.mozilla.org/en-US/firefox/addon/655" rel="nofollow noreferrer">View Source Chart Firefox Addon</a> which shows the source HTML in a very organized, graphical form. Unfortunately, this addon is only for Firefox 2 and the beta version ...
<p>Is <a href="https://addons.mozilla.org/en-US/firefox/addon/1843" rel="nofollow noreferrer">Firebug</a> not sufficient?</p>
<p>You could always try Firefug. It sounds like it does a similar thing, plus more :)</p>
6,947
<p>Is it possible for <code>SelectNodes()</code> called on an <code>XmlDocument</code> to return null?</p> <p>My predicament is that I am trying to reach 100% unit test code coverage; ReSharper tells me that I need to guard against a null return from the <code>SelectNodes()</code> method, but I can see no way that an ...
<p>Is it necessary to reach 100% code coverage? Indeed, is it even possible under normal (i.e. controllable, testable) circumstances? </p> <p>We often find that using "syntactic sugar" constructions like the <code>using {}</code> block, there are "hidden" code paths created (most likely <code>finally {}</code> or <cod...
<p>If you are calling SelectNodes on the XmlDocument itself and it really is an XmlDocument and not a derived class than SelectNodes won't return null.</p> <p>If you create a descendant class and override the CreateNavigator(XmlNode) method then SelectNodes could return null.</p> <p>Similarly, if you call SelectNodes...
8,178