instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>Are there any utilities out there which can draw pictures of the merge history of a subversion repo - we always commit merges with a (fairly) consistent log message, and it would be handy to be able to automatically extract this info into a single picture that shows what branches occurred when, and what the state of...
<p>I use <a href="https://www.smartsvn.com/features/" rel="nofollow noreferrer">SmartSVN</a> for this; I has a very quick and easy to use revision graph, which can show svm:mergeinfo as colour coded links and arrows between branches. It's pretty hard to beat when looking at a good-size source tree</p>
<p>I think Tortoise svn does <a href="http://svn.haxx.se/tsvnusers/archive-2008-05/0149.shtml" rel="nofollow noreferrer"><strong>not yet</strong></a> support version tree.</p> <p>So far, Clearcase explorer is the best i've come across.</p>
7,997
<p>I have a PHP script that runs as a CGI program and the HTTP <code>Authenticate</code> header gets eaten and spit out. So I would like to implement some kind of FORM based authentication. As an added constraint, there is no database so no session data can be stored.</p> <p>I am very open to having a master username ...
<p>A few ways you could do this.</p> <ol> <li><a href="http://fragments.turtlemeat.com/htaccess.php" rel="nofollow noreferrer">htaccess</a> -- have your webserver handle securing the pages in question (not exactly cgi form based though).</li> <li>Use cookies and some sort of hashing algorithm (md5 is good enough) to s...
<p>... About salt, add the username in your hash salt will prevent someone who knows your salt and have access to your password file to write a rainbow table and crack number of your users's password.</p>
3,805
<p>Is there any way to include the SVN repository revision number in the version string of a .NET assembly? Something like Major.Minor.SVNRev</p> <p>I've seen mention of doing this with something like CC.NET (although on ASP.NET actually), but is there any way to do it without any extra software? I've done similar t...
<p>Here's and C# example for updating the revision info in the assembly automatically. It is based on the answer by Will Dean, which is not very elaborate.</p> <p>Example :</p> <ol> <li>Copy AssemblyInfo.cs to AssemblyInfoTemplate.cs in the project's folder <em>Properties</em>.</li> <li>Change the <em>Build Action</e...
<p>You can use a shared Assembly Version file that you can reference in all of your projects.</p> <p><a href="http://uppercut.googlecode.com" rel="nofollow noreferrer">UppercuT</a> does this - <a href="http://ferventcoder.com/archive/2009/05/21/uppercut---automated-builds---versionbuilder.aspx" rel="nofollow noreferre...
3,327
<p>As you may or may not know, this is the third iteration of a proposal site that covers 3D Printing. The first 2 made it to the beta phase, but did not graduate from the beta successfully:</p> <ul> <li><a href="http://area51.stackexchange.com/proposals/41850/digital-fabrication">Digital Fabrication</a></li> <li><a ...
<p>If someone has a question from one of those older sites, they should go ahead and ask it. But a wholesale importing of content from elsewhere is not really a desirable way to build this site. </p> <p>There is a lot of ownership and careful curation that goes with vetting the content of this site. Questions imported...
<p>Although I was sad to see the <a href="http://area51.stackexchange.com/proposals/41850/digital-fabrication">Digital Fabrication</a> beta close, I think there would be little to be gained by trying to import it's questions. The scope was different, and it was a very different group of comitters - only 1.8% of <a href...
18
<p>I've inherited a desktop application which has a custom .NET file chooser that is embedded in a control, but it has some issues.<br> I'd like to replace it with a non-custom File Chooser (like the <code>OpenFileDialog</code>). </p> <p>However, for a variety of reasons it needs to be embedded in the parent control ...
<p>The .Net control is a thin wrapper for the common dialog built into windows, and that <em>is</em> a dialog. So there is no way to embed it as though it were a control.</p>
<p>Depending on your needs, you COULD abuse the web browser control to show local files and folders. It won't match all the functionality of the OpenFileDialog, but it could work.</p> <p>Here's one that I remembered from way-back. <a href="http://www.ssware.com/megapack.htm" rel="nofollow noreferrer">The Shell Mega-...
7,888
<p>I am using a wxGenericDirCtrl, and I would like to know if there is a way to hide directories, I'd especially like to hide siblings of parent nodes.</p> <p>For example if my directory structure looks like this:</p> <pre><code>+-a | +-b | | | +-whatever | +-c | | | +-d | | | +-e | | | ...
<p>Listing/walking directories in Python is very easy, so I would recommend trying to "roll your own" using one of the simple tree controls (such as TreeCtrl or CustomTreeCtrl). It should really be quite easy to call the directory listing code when some directory is expanded and return the result.</p>
<p>I don't think that's possible.</p> <p>It would be relatively easy to add this functionality to the underlying C++ wxWidgets control, but since you're using wxPython, you'd then have to rebuild that as well which is a tremendous issue.</p>
7,619
<p>ValidateEvents is a great ASP.net function, but the Yellow Screen of Death is not so nice. I found a way how to handle the HttpRequestValidationException gracefully <a href="http://www.romsteady.net/blog/2007/06/how-to-catch-httprequestvalidationexcep.html" rel="nofollow noreferrer">here</a>, but that does not work...
<p>Found it and <a href="http://www.stum.de/2008/09/08/gracefully-handling-httprequestvalidationexception-with-aspnet-ajax/" rel="nofollow noreferrer">blogged about it</a>. Basically, the EndRequestHandler and the args.set_errorHandled are our friends here.</p> <pre><code>&lt;script type="text/javascript" language="ja...
<p>hmmmm, it seems you would need to find some sort of JavaScript to check for html input or a client side validator. </p>
7,017
<p><a href="https://photos.app.goo.gl/O6yPf3sDeV1yhS0C2" rel="nofollow noreferrer">https://photos.app.goo.gl/O6yPf3sDeV1yhS0C2</a></p> <p>I tried to illustrate my problem in the videos above, two of them show the weird movement and the other shows me clicking on the home button repeatedly.</p> <p>Some Info:</p> <ul>...
<p>As far as I can see on the attached videos your homing movement is reversed. as per Marlin, the homing for X shall move towards the left side and for Y to the back of the printer.</p> <p>That could occur when: cable connectors to stepper motors are reversed, or the motor is assembled the other way (you can set reve...
<p>The problem was the logic of the endstops that were reversed</p>
859
<p>I have a Windows 2008 Server (x64) running Microsoft SQL 2008 (x64) and I'm creating a Linked Server connection to an Oracle server. I'm able to make the connection, but I cannot see any information regarding which schema a table belongs to.</p> <p>In SQL 2005, my linked servers show the schema information as I wo...
<p>@Boojiboy - When you are looking at the tables via a linked server, there used to be a column for what schema. It appears that in the latest the new Oracle OLEDB drivers don't show this information any longer.</p>
<p>Also in the SQL 08 > Server Objects > Providers make sure your OraOLEDB.Oracle provider is allowing inprocessing</p>
4,632
<p>everyone.</p> <p>I'm a relative newcomer to 3D printing, so I don't know what constitutes an unacceptably bad spool of filament.</p> <p>About 1/6 of the way into a roll of PETG (and maybe 4 hours into a 6-hour print), an over/under wrap brought things to a screeching halt. I aborted the print, then snipped the fil...
<p>Filament should come off of the roll without overlapping itself. That being said depending on what you paid for it would determine if you should complain. Normally you get what you pay for. If you paid \$10 for it, I would think that is why it was so cheap, but if you paid >\$25 it should be nice stuff.</p>
<p>Knot happens when you loosen the filament yourself and then leave it like that or try to manually re-spool it. To avoid this kind of situation as well as the curly filament coming off the spool and getting tangled there, try to not loosen it and also build or print a "spool guide" for your 3d printer: <a href="http:...
194
<p>I'm trying to write a Crystal Report which has totals grouped in a different way to the main report. The only way I've been able to do this so far is to use a subreport for the totals, but it means having to hit the data source again to retrieve the same data, which seems like nonsense. Here's a simplified example:<...
<p>Hmm... as nice as it is to call the stored proc from the report and have it all contained in one location, however we found (like you) that you eventually hit a point where you can't get crystal to do what you want even tho the data is right there.</p> <p>We ended up introducing a business layer which sits under th...
<p>The only way I can think of doing this without a second run through the data would be by creating some formulas to do running totals per group. The problem I assume you are running into with the existing running totals is that they are intended to follow each of the groups that they are totaling. Since you seem to w...
3,012
<p>The company I work for is protective of IP and has security procedures for disposing of anything that could be stolen for industrial espionage. Paper gets shredded and sent to trusted recycling center, all old data storage media gets obliterated, but what do we do with 3D prints? For any functional prototype, I ha...
<p>Big batches need you to be time efficient - or use a method that uses little work. So my suggestions are mainly needing oversight. Keep a fire extinguisher and safety gear handy though!</p> <h1>Melting together</h1> <p>Most filaments are melting at or around 200 °C.</p> <p>I recently got rid of my box of (PLA) waste...
<p>If your company has a shredder which would handle large amounts of paper at one time, it should be able to handle the plastics from 3D printing. Most larger shredders can handle paper clips and staples. 3D plastics would be even less of a burden than them. You may need to break the pieces down into smaller chunks, b...
1,028
<p>How can I exclude the bin folder from SourceSafe in a Visual Studio 2008 web application? I want to be able to check in everything recursively from the solution node without picking up anything in the bin folder.</p>
<ul> <li>Right-click the folder in your project</li> <li>select "Exclude from project"</li> </ul>
<p>You can hide the folder through Windows explorer, although it'll disappear from your Visual Studio Solution Exporer, I don't think that'll affect the website.</p>
9,890
<p>I have an application that sends messages to an external web service. I build and deploy this application using <a href="http://msdn.microsoft.com/en-us/library/wea2sca5(VS.80).aspx" rel="nofollow noreferrer">MSBuild</a> and <a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NE...
<p>I just started looking into <a href="http://www.soapui.org/" rel="nofollow noreferrer">http://www.soapui.org/</a> and it seems like it will work nicely for testing web services.</p> <p>Also, maybe look at adding an abstraction layer in your web service, each service call would directly call a testable method (outsi...
<p>At my work place we are using <a href="http://www.typemock.com/index.php" rel="nofollow noreferrer">Typemock</a> and <a href="http://www.nunit.org/" rel="nofollow noreferrer">nUnit</a> for our unit testing.</p>
5,497
<p>I want to make an etag that matches what Apache produces. How does apache create it's etags?</p>
<p>Apache uses the standard format of inode-filesize-mtime. The only caveat to this is that the mtime must be epoch time and padded with zeros so it is 16 digits. Here is how to do it in PHP:</p> <pre><code>$fs = stat($file); header("Etag: ".sprintf('"%x-%x-%s"', $fs['ino'], $fs['size'],base_convert(str_pad($fs['mti...
<p>If you're dynamically generating your page though, this probably won't make sense. If you're in PHP, you can pick the inode and file size of the main script, but the modify time won't tell you if your data has changed. Unless you have a good caching process or just generate static pages, etags aren't helpful. If you...
6,671
<p>I found this low temperature filament for 3d printing, <a href="https://www.sainsmart.com/products/low-temperature-filament-0-5kg-1-75mm-white" rel="nofollow noreferrer">Low Temperature Filament 0.5kg 1.75mm, White</a> </p> <p>Correct me if I'm wrong but I'm pretty sure I can use it for a <em>really</em> precise no...
<p>You won't need specialized nozzles, you understand the material wrong:</p> <p>The benefit the properties of this material grant is not super fine prints (which you can get with small nozzles like 0.1 mm already), it is that you can print at super low temperatures. Printing it at standard 200°C will mean, that it wo...
<p>I have been looking for some where that could make a custom nozzle and the only place I have found so far that I think might be able to is: <a href="https://www.emachineshop.com/" rel="nofollow noreferrer">https://www.emachineshop.com/ </a></p> <p>You would need to draw up the design of the nozzle in the software o...
764
<p>Is there a clean way to redirect all attempts to going to an HTTP:// version of a site to its HTTPS:// equivalent?</p>
<p>I think the cleanest way is as described <a href="http://www.iis-aid.com/articles/how_to_guides/redirect_http_to_https_iis_7" rel="nofollow noreferrer">here on IIS-aid.com</a>. It's web.config only and so if you change server you don't have to remember all the steps you went through with the 403.4 custom error page ...
<p>I think by 'cleanly' you mean like with a 300 redirect. Config for a lot of servers &amp; languages <a href="http://www.somacon.com/p145.php" rel="nofollow noreferrer">here</a>.</p>
6,844
<p>I have replaced the stock extruder on my Ender 3 with one of these:</p> <p><a href="https://i.stack.imgur.com/wDmXL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wDmXL.jpg" alt="New Extruder"></a></p> <p>The grip gear has a smaller diameter, so I calibrated the esteps as per the top google sea...
<p>Consider that the extruder is skipping because it is unable to push filament at the rate you are requesting. By reducing the steps to ninety percent, you are reducing the rate by that much as well.</p> <p>Typically, a skipping extruder is an indication of clogging, but it does not have to be clogging caused by part...
<p>I have this same extruder on my Voxelab Aquila. Default E-steps are 93. Using the printer menu to feed 100 mm of eSun black PETG filament I measured a feed length of 66 mm, so 34 mm under extruded.</p> <p>Using the formula 100 / 66 * 93 gave me a new E-step value of 140.9. Upon re-testing, I found I was now over ext...
1,469
<p>I need to copy files using Windows command-line (available on XP Pro or later by default) and show progress during the process.</p> <p>The progress indicator could be in a terminal or a GUI window. It is intended to be used during batch file scripting.</p>
<p>I used the copy command with the /z switch for copying over network drives. Also works for copying between local drives. Tested on XP Home edition.</p>
<p>Here is the script I use:</p> <pre><code>@ECHO off SETLOCAL ENABLEDELAYEDEXPANSION mode con:cols=210 lines=50 ECHO Starting 1-way backup of MEDIA(M:) to BACKUP(G:)... robocopy.exe M:\ G:\ *.* /E /PURGE /SEC /NP /NJH /NJS /XD "$RECYCLE.BIN" "System Volume Information" /TEE /R:5 /COPYALL /LOG:from_M_to_G.log ECHO Fin...
8,324
<p>I am writing a batch file script using Windows command-line environment and want to change each occurrence of some text in a file (ex. "FOO") with another (ex. "BAR"). What is the simplest way to do that? Any built in functions?</p>
<p>A lot of the answers here helped point me in the right direction, however none were suitable for me, so I am posting my solution.</p> <p>I have Windows 7, which comes with PowerShell built-in. Here is the script I used to find/replace all instances of text in a file:</p> <pre><code>powershell -Command &quot;(gc myFi...
<p>I have faced this problem several times while coding under Visual C++. If you have it, you can use Visual studio Find and Replace Utility. It allows you to select a folder and replace the contents of any file in that folder with any other text you want.</p> <p>Under Visual Studio: Edit -> Find and Replace In the ...
8,483
<p><a href="https://i.stack.imgur.com/Bujra.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bujra.png" alt="0.200 mm layer height, single wall" /></a></p> <p><a href="https://i.stack.imgur.com/gCYkr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gCYkr.png" alt="0.075 mm layer heig...
<p>The fact that these are all perfectly spaced, and don't mirror the edges of irregular prints, makes me think it's definitely not ghosting. That said, I can't see the Y direction on either print, just the X direction, so this all assumes it's only happening in one direction. One thing to think about: Your motors have...
<p>This is a great blog post, <a href="https://www.evernote.com/shard/s211/client/snv?noteGuid=701c36c4-ddd5-4669-a482-953d8924c71d&amp;noteKey=1ef992988295487c98c268dcdd2d687e&amp;sn=https%3A%2F%2Fwww.evernote.com%2Fshard%2Fs211%2Fsh%2F701c36c4-ddd5-4669-a482-953d8924c71d%2F1ef992988295487c98c268dcdd2d687e&amp;title=T...
1,189
<p>I have a datagrid getting bound to a dataset, and I want to display the average result in the footer for a column populated with integers.</p> <p>The way I figure, there's 2 ways I can think of:</p> <p>1."Use the <strong>Source</strong>, Luke"<br> In the code where I'm calling DataGrid.DataBind(), use the DataTabl...
<p>See this KB Article. <a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277" rel="noreferrer">How to configure SQL Server 2005 to allow remote connections</a>.<br> Oh, and remember that the SQLServer name will probably be MyMachineName\SQLExpress</p>
<p>If you're running it on a 2k3 box, you need to install all updates for Sql Server and the 2003 server. </p> <p>Check the event logs after you start the Sql Server. It logs everything well, telling you if its being blocked, and where it is listening for connections.</p> <p>From a remote machine, you can use telne...
3,082
<p>For a typical Web client -to- Servlet/WS -to- Business Tier (Spring or EJB) app, what are the trade-offs of approaches like remote RPC or messaging for Web (Servlet) tier to remote Business tier, aside from the basic sync/async aspects?</p>
<p>By web client do you mean web browser? If so looking at stuff like DWR or JAX-RS are my recommendations. RMI or JMS only really work when both sides are Java code.</p> <p>With any remoting technology the biggest issue using them tends to be how intrusive the technology becomes on your business objects. e.g. using R...
<p>SUN RMI broke for us. </p> <p>The settings and garbage collection for a very long running application with continuous meassaging. We are patching to make it work continuously. JMS applications we run don't get the out of memory errors or gc problems that RMI does. Anything that needs to call System.gc() periodical...
9,657
<p>How, if you have a database per client of a web application instead of one database used by all clients, do you go about providing updates and enhancements to all databases efficiently?</p> <p>How do you roll out changes to schema and code in such a scenario?</p>
<p><a href="http://www.bittorrent.com/" rel="nofollow noreferrer">bittorrent</a>?</p> <p>There have been a few web-based versions already (<a href="http://www.bitlet.org/" rel="nofollow noreferrer">bitlet</a>, <a href="http://torrentfreak.com/w3btorrent-a-bittorrent-client-for-your-web-server/" rel="nofollow noreferre...
<p>@travis</p> <p>Unfortunately It has to be over HTTP inside the users browser. I'll update the question to be more clear about that.</p>
5,571
<p>I have two threads, one updating an int and one reading it. This is a statistic value where the order of the reads and writes is irrelevant.</p> <p>My question is, do I need to synchronize access to this multi-byte value anyway? Or, put another way, can part of the write be complete and get interrupted, and then t...
<p>At first one might think that reads and writes of the native machine size are atomic but there are a number of issues to deal with including cache coherency between processors/cores. Use atomic operations like Interlocked* on Windows and the equivalent on Linux. C++0x will have an "atomic" template to wrap these i...
<p>The only portable way is to use the sig_atomic_t type defined in signal.h header for your compiler. In most C and C++ implementations, that is an int. Then declare your variable as "volatile sig_atomic_t."</p>
7,779
<p>What is the best way to layout a large django project? The tutorials provide simple instructions for setting up apps, models, and views, but there is less information about how apps and projects should be broken down, how much sharing is allowable/necessary between apps in a typical project (obviously that is large...
<p>The major guidelines are similar to any other large code project. Apps should address a single, clearly-defined responsibility. The name "application" is a misnomer; Django apps should be thought of more as reusable components which can be plugged together to create a real application. Tests for each app should b...
<p>My current layout stems from me wanting to have a test-version of my sites. This means having two projects for every site, since they need different configurations, and forces me to move all the applications out of the projects.</p> <p>I've created two folders: $APP_ROOT/devel and $APP_ROOT/prod. These contain al...
6,580
<p>After reading a bit more about how Gnutella and other P2P networks function, I wanted to start my own peer-to-peer system. I went in thinking that I would find plenty of tutorials and language-agnostic guidelines which could be applied, however I was met with a vague simplistic overview.</p> <p>I could only find v...
<p>I had to write a basic Gnutella client in C# using Web Services and I think the class notes on the P2P stuff are still available <a href="http://www.cs.virginia.edu/~humphrey/cs451/ClassNotes/CS451_DisSys_0327.pdf" rel="nofollow noreferrer">here</a> and <a href="http://www.cs.virginia.edu/~humphrey/cs451/ClassNotes/...
<p>You might have better success researching Bittorrent, I believe that the creator has written some papers, and it seems others are as well.</p> <p><a href="http://bittyrant.cs.washington.edu/#papers" rel="nofollow noreferrer">BitTyrant</a> <a href="http://bittorrent.org/" rel="nofollow noreferrer">Bittorent.org, see...
4,360
<p>So I have about 10 short css files that I use with mvc app. There are like error.css login.css etc... Just some really short css files that make updating and editing easy (At least for me). What I want is something that will optimize the if else branch and not incorporate it within the final bits. I want to do somet...
<p>Specifically, like this in C#:</p> <pre><code>#if (DEBUG) Debug Stuff #endif </code></pre> <p>C# has the following preprocessor directives:</p> <pre><code>#if #else #elif // Else If #endif #define #undef // Undefine #warning // Causes the preprocessor to fire warning #error // Causes the preprocessor to fire...
<p>Compiler constants. I don't remember the C# syntax, but this is how I do it in VB:</p> <pre><code>#If CONFIG = "Debug" Then 'do somtehing #Else 'do something else #EndIf </code></pre>
7,372
<p>Of course I'm referring to side by side and not stacking or overlapping. 200 x 200 mm PEI and Kapton sheets are more readily available than 400 x 400 sheets. I'm wondering if anyone has tried this and if the edges of the sheets cause a problem.</p>
<p>Aligning build surfaces isn't the main issue with 1 mm thick surfaces when aligning four 200 x 200 mm surfaces to make one 400 x 400 surface. The main issue is slight bucking at the seams from thermal mismatch. Using this with PETG tends to tear up the build surface at the seams. The image shows aligned surfaces....
<p>I haven't tried such a thing, but a speculative answer covering the constraints and expected failure modes may suffice here.</p> <p>Unless the sheets have squared (rather than rounded) corners, the corners will almost certainly be a problem. In particular you'd end up with a hole right at the middle of the bed.</p> ...
1,755
<p>I am trying to come up with the best way to render some hierarchical data in to a nested unordered list using ASP.NET MVC. Does anyone have any tips on how to do this?</p>
<p>I suggest jquery tree view plugins for making it function like a tree, but as for render, just put it in a recursive lambda helper to do the nesting.</p>
<p>For that (rendering hierarchical menu, treeview, etc) i use recursive calls of custom component (ascx, or aspx in new preview5).<br> I give component first level of items (List of items), and component then check for each item in list if there's any child items and call itself with list of that child items.<br> You ...
8,256
<p>Many applications have grids that display data from a database table one page at a time. Many of them also let the user pick the number of records per page, sort by any column, and navigate back and forth through the results.</p> <p>What's a good algorithm to implement this pattern without bringing the entire table...
<p>On MS SQL Server 2005 and above, <a href="http://msdn.microsoft.com/en-us/library/ms186734.aspx" rel="noreferrer">ROW_NUMBER()</a> seems to work:</p> <p><a href="http://blogs.x2line.com/al/archive/2005/11/18/1323.aspx" rel="noreferrer">T-SQL: Paging with ROW_NUMBER()</a></p> <pre><code>DECLARE @PageNum AS INT; DEC...
<p>There is a discussion about this <a href="https://web.archive.org/web/20211020131201/https://www.4guysfromrolla.com/webtech/042606-1.shtml" rel="nofollow noreferrer">Here</a></p> <p>The technique gets page number 100,000 from a 150,000 line database in 78ms</p> <blockquote> <p>Using optimizer knowledge and SET R...
3,141
<p>Anti aliasing <a href="http://forums.msdn.microsoft.com/en-US/wpf/thread/1ad9a62a-d1a4-4ca2-a950-3b7bf5240de5" rel="noreferrer">cannot be turned off</a> in WPF. But I want to remove the blurred look of WPF fonts when they are small. </p> <p>One possibility would be to use a .net 2.0 component. This looks like it wo...
<p>Have you tried putting a <a href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.integration.windowsformshost?redirectedfrom=MSDN&amp;view=net-5.0" rel="nofollow noreferrer">WindowsFormsHost</a> control on a WPF window/control? That will allow WPF to render a WinForms control.</p> <p><strong>UPDAT...
<p>Try using the <a href="http://msdn.microsoft.com/en-us/library/system.windows.uielement.snapstodevicepixels.aspx" rel="nofollow noreferrer">UIElement.SnapsToDevicePixels</a> property on the UI elements of your window. People tend to report it works best for <a href="http://blogs.msdn.com/seema/archive/2006/10/31/on...
4,201
<p>Basically I have some code to check a specific directory to see if an image is there and if so I want to assign a URL to the image to an ImageControl.</p> <pre><code>if (System.IO.Directory.Exists(photosLocation)) { string[] files = System.IO.Directory.GetFiles(photosLocation, "*.jpg"); if (files.Length &gt...
<p>As far as I know, there's no method to do what you want; at least not directly. I'd store the <code>photosLocation</code> as a path relative to the application; for example: <code>"~/Images/"</code>. This way, you could use MapPath to get the physical location, and <code>ResolveUrl</code> to get the URL (with a bit ...
<p>I think this should work. It might be off on the slashes. Not sure if they are needed or not.</p> <pre><code>string url = Request.ApplicationPath + "/" + photosLocation + "/" + files[0]; </code></pre>
3,676
<p>I have a personal pet project I'd like to start on, targeted at windows mobile 6. I've never done win mobile dev and would like to know what resources are out there, good tools to use, perhaps a jump start tutorial, as well as any gotchas I might want to keep in mind when developing for the platform?</p>
<p>Windows Mobile 6 devices come with .NET Compact Framework 2.0 in ROM and also expose .NET APIs for a lot of things (camera, system notifications, email, contacts, ...).</p> <p>I'd recommend using Visual Studio 2008 and the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=06111A3A-A651-4745-88EF-3D4...
<p>A good reference book to check out is "Microsoft Mobile Development Handbook" by Wigley, Moth, and Foot. It covers a lot of topics in mobile development with the .NET compact framework, and also the Windows Mobile platform. </p> <p>You also might want to learn about Windows CE, which Windows Mobile is a flavor of....
9,442
<p>If not, what are the significant differences?</p> <hr> <p><strong>Edit:</strong> Daren Thomas asks:</p> <blockquote> <p>which ones?</p> <p>I use gvim on Windows and MacVim on the mac. Seem similar enough to be the same to me...</p> </blockquote> <p>By which ones, I'm guessing that you mean a specific impl...
<p>I use <a href="http://ftp.gnu.org/pub/gnu/emacs/windows/" rel="nofollow noreferrer">GNU emacs built for Windows</a>, and have found very few, if any, differences. There's the option to load your .emacs file from _emacs or .emacs (although .emacs works fine on XP and above). You can configure it to use Windows-style ...
<p>which ones?</p> <p>I use <code>gvim</code> on Windows and <code>MacVim</code> on the mac. Seem similar enough to be the same to me...</p>
6,285
<p>I've seen this done in Borland's <a href="https://en.wikipedia.org/wiki/Turbo_C++" rel="noreferrer">Turbo C++</a> environment, but I'm not sure how to go about it for a C# application I'm working on. Are there best practices or gotchas to look out for?</p>
<p>Some sample code:</p> <pre><code> public partial class Form1 : Form { public Form1() { InitializeComponent(); this.AllowDrop = true; this.DragEnter += new DragEventHandler(Form1_DragEnter); this.DragDrop += new DragEventHandler(Form1_DragDrop); } void Form1_DragEnter(object sen...
<p>You can implement Drag&amp;Drop in WinForms and WPF. </p> <ul> <li>WinForm (Drag from app window)</li> </ul> <p>You should add mousemove event:</p> <pre><code>private void YourElementControl_MouseMove(object sender, MouseEventArgs e) { ... if (e.Button == MouseButtons.Left) { ...
9,412
<p>My dream IDE does full code hints, explains and completes PHP, Javascript, HTML and CSS. I know it exists!</p> <p>so far, <a href="http://www.zend.com/en/products/studio/features" rel="noreferrer">Zend studio 6</a>, under the Eclipse IDE does a great job at hinting PHP, some Javascript and HTML, any way I can expan...
<p>I think the JavaScript and CSS need to be in separate files for this to work.</p> <p>Example of CSS autocomplete in Eclipse:</p> <p>Starting to type <code>border</code></p> <blockquote> <p><img src="https://i.stack.imgur.com/h4Sj9.png" alt="css example in eclipse"></p> </blockquote> <p>Then setting thickness</...
<p>The default CSS and HTML editors for Eclipse are really good. The default javascript editor does an OK job, but it needs a little work.</p> <p>I just tested this in Eclipse 3.3.2</p> <pre><code>function test(){ } te&lt;CTRL+SPACE&gt; </code></pre> <p>and it completed the method for me as did this:</p> <pre><co...
2,681
<p>Large pages are available in <code>Windows Server 2003</code> and <code>Windows Vista</code>. </p> <p>But how do I enable large pages for my application? </p>
<p>Martin's answer is correct on Windows Server 2003:</p> <blockquote> <p>You will have to assign the "Lock pages in memory" privilege to any user that runs your > application. This includes administrators</p> <ol> <li>Select Control Panel -> Administrative Tools -> Local Security Policy</li> <li>Select Loc...
<p>You will have to assign the <code>Lock pages in memory</code> privilege to any user that runs your application. This includes administrators.</p> <ol> <li>Select Control <strong>Panel -> Administrative Tools -> Local Security</strong> Policy </li> <li>Select Local <strong>Policies -> User Rights Assignment</strong...
6,007
<p>I equipped my Makerbot Replicator 2x with <a href="https://www.aliexpress.com/item/Makerbot-Replicator-2-3D-Printer-Part-Makerbot-TMC2100-V1-0-Stepper-Motor-Driver-Module-With-Heatsink/32870918354.html" rel="nofollow noreferrer">silent stepper drivers TMC2100</a>. According to the product page I reduced V<sub>ref</s...
<p>Most Stepper drivers will have lots of energy passing through them so it is crucial to having a moderately sized heatsink to cool them off otherwise they will get too hot. Most stepper drivers found online come with heatsinks but you could search online for mini heatsinks.</p>
<p>What constitutes too hot? A Hybrid stepper motor operating at 80 degrees is normal. They dissipate heat via their mounting plate (which should not be plastic), otherwise you may need to use active cooling. Now if the motors are dying from the heat then you have a problem.</p>
1,255
<p>I have the original Prusa i3m3 printer. Prusa recommends cleaning the bed before each print with isopropanol (isopropyl alcohol), with only occasional cleaning with acetone. The textured bed prohibits using acetone.</p> <p>Given the SARS-COV-2 situation and COVID-19, isopropanol is impossible to find, and will no...
<p><strong>Ethanol</strong> (Ethyl Alcohol) should work just fine as long as it's around 80% or more. It's very similar to isopropanol as a cleaning solvent. What you're basically doing is removing any stray grease from the bed with a solvent that evaporates quickly. </p> <p><strong>Methanol</strong> would also probab...
<p>Dish soap will remove grease very well. Once you rinse it with a moist sponge and dry with a clean cloth most residues will be gone.</p>
1,618
<p>I understand the value of the three-part service/host/client model offered by WCF. But is it just me or does it seem like WCF took something pretty direct and straightforward (the ASMX model) and made a mess out of it? </p> <p>Is there an alternative to using SvcUtil's command line step back in time to generate the...
<p>Okay, here we go. First, Michele Leroux Bustamante's book has been updated for VS2008. The website for the book is not gone. It's up right now, and it has tons of great WCF info. On that website she provides updated code compatible with VS2008 for all the examples in her book. If you order from Amazon, you will...
<p>MSDN? I usually do pretty well with the Library reference itself, and I usually expect to find valuable articles there.</p>
7,275
<p>Although the general case is undecidable, many people still do solve problems that are equivilent well enough for day to day use.</p> <p>In cohen's phd thesis on computer viruses, he showed how virus scanning is equivilent to the halting problem, yet we have an entire industry based around this challenge.</p> <p>I...
<blockquote> <p>Is solving the halting problem easier than people think?</p> </blockquote> <p>I think it is exactly as difficult as people think.</p> <blockquote> <p>Will types become turing complete over time?</p> </blockquote> <p><a href="http://en.wikipedia.org/wiki/C%2B%2B#Templates" rel="noreferrer">My dear...
<p>The Halting Problem is really only interesting if you look at it in the general case, since if the Halting problem were decidable, all other undecidable problems would also be decidable via reduction.</p> <p>So, my opinion on this question is, no, it is not easy in the cases that matter. That said, in the real wor...
6,196
<pre><code>public static IList&lt;T&gt; LoadObjectListAll&lt;T&gt;() { ISession session = CheckForExistingSession(); var cfg = new NHibernate.Cfg.Configuration().Configure(); var returnList = session.CreateCriteria(typeof(T)); var list = returnList.List(); var castList = list.Cast&lt;typeof(T)&gt;()...
<p><code>T</code> is not a type nor a <code>System.Type</code>. <code>T</code> is a type parameter. <code>typeof(T)</code> returns the type of <code>T</code>. The <code>typeof</code> operator does not act on an object, it returns the <code>Type</code> object of a type. <a href="http://msdn.microsoft.com/en-us/librar...
<p>The most glaring error I can see is that an <code>IList</code> is definitely different from an <code>IList&lt;T&gt;</code>. An <code>IList</code> is non-generic (e.g., <code>ArrayList</code>).</p> <p>So your method signature should be:</p> <pre><code>public static IList&lt;T&gt; LoadObjectListAll() </code></pre>
6,472
<p>If you had a differential of either venturing into Delphi land or Qt land which would you choose? I know they are not totally comparable. I for one have Windows development experience with Builder C++ (almost Delphi) and MFC (almost Qt), with a bit more time working with Builder C++. Please take out the cross platfo...
<p>If you are talking UI frameworks, then you should be comparing Qt with the VCL, not the IDE (Delphi in this case). I know I'm being a stickler, but Delphi is the IDE, Object-Pascal is the language, and VCL is the graphical framework.</p> <p>That being said, I don't think there is anything that even comes close to m...
<p>I'd choose delphi. Only because I have more experience with it. I don't think that there is other reasonabl criterias. </p>
9,841
<p>I've got a menu that contains, among other things, some most-recently-used file paths. The paths to these files can be long, so the text sometimes gets clipped like "C:\Progra...\foo.txt"</p> <p>I'd like to pop a tooltip with the full path when the user hovers over the item, but this doesn't seem possible with the...
<p>If you are creating your menu items using the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.menuitem.aspx" rel="noreferrer" title="MenuItem Members">System.Windows.Forms.MenuItem</a> class you won't have a "ToolTipText" property.</p> <p>You should use the <a href="http://msdn.microsoft.com/e...
<p>Maybe you forgot to associate the tooltip with the control using <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.settooltip.aspx" rel="nofollow noreferrer">SetToolTip</a>.</p>
8,262
<p>I have to develop an application which parses a log file and sends specific data to a server. It has to run on both Linux and Windows. </p> <p>The problem appears when I want to test the log rolling system (which appends .1 to the name of the creates a new one with the same name). On Windows (haven't tested yet on ...
<blockquote> <p>Is there a way to open file in a non-exclusive way,</p> </blockquote> <p>Yes, using Win32, passing the various FILE_SHARE_Xxxx flags to CreateFile.</p> <blockquote> <p>is it cross platform?</p> </blockquote> <p>No, it requires platform-specific code.</p> <p>Due to annoying backwards compatibilit...
<p>I'd make sure you don't keep files open. This leads to weird stuff if your app crashes for example. What I'd do:</p> <ol> <li>Abstract (reading / writing / rolling over to a new file) into one class, and arrange closing of the file when you want to roll over to a new one in that class. (this is the neatest way, and...
4,734
<p>I want to print a flowerpots, for advanced watering system.</p> <p>Plants are going to be eaten.</p> <p>What is the most suitable material, when we consider the fact, that we do not want to just make forms and do clay flowerpots(which may seem most healthier), but having them directly printed.</p> <p>What are the...
<p>If you break up a large piece into multiple smaller pieces and properly glue them together, you basically add stiffeners (as a result of printing walls). This could lead to a more stiff model; this might have been confused by calling large prints more brittle opposed to constructed models.</p> <p>If printing is con...
<p>I'd recommend getting the object to fit together by design, rather than glue - though I tend (if the item is never to be disassembled) use Zap-a-gap - that stuff sticks like crazy though you must not squeeze the parts together but let it naturally sit.</p>
1,353
<p>I want to open a TCP client socket in Python. Do I have to go through all the low-level BSD create-socket-handle / connect-socket stuff or is there a simpler one-line way?</p>
<p>Opening sockets in python is pretty simple. You really just need something like this:</p> <pre><code>import socket sock = socket.socket() sock.connect((address, port)) </code></pre> <p>and then you can <code>send()</code> and <code>recv()</code> like any other socket</p>
<p>For developing portable network programs of any sort in Python, <a href="http://twistedmatrix.com" rel="noreferrer">Twisted</a> is quite useful. One of its benefits is providing a convenient layer above low-level socket APIs.</p>
9,432
<p>I want to delete all but the 4 newest directories in my parent directory. How would you do this in Bash?</p>
<pre><code>ls -atrd */ | head --lines=-4 | xargs rm -rf </code></pre> <p><strong>Edit:</strong> added 'a' argument to ls</p>
<p>Another, BSD-safe, way to do it, with arrays (why not?)</p> <pre><code>#!/bin/bash ARRAY=( `ls -td */` ) ELEMENTS=${#ARRAY[@]} COUNTER=4 while [ $COUNTER -lt $ELEMENTS ]; do echo ${ARRAY[${COUNTER}]} let COUNTER=COUNTER+1 done </code></pre>
9,743
<p>I'm trying to write a blog post which includes a code segment inside a <code>&lt;pre&gt;</code> tag. The code segment includes a generic type and uses <code>&lt;&gt;</code> to define that type. This is what the segment looks like:</p> <pre><code>&lt;pre&gt; PrimeCalc calc = new PrimeCalc(); Func&lt;int, int...
<pre><code>&lt;pre&gt; PrimeCalc calc = new PrimeCalc(); Func&amp;lt;int, int&amp;gt; del = calc.GetNextPrime; &lt;/pre&gt; </code></pre>
<p>It's probably something specific to your blog software, but you might want to give the following strings a try (remove the underscore character): &amp;_lt; &amp;_gt;</p>
6,359
<p>I can get Python to work with Postgresql but I cannot get it to work with MySQL. The main problem is that on the shared hosting account I have I do not have the ability to install things such as Django or PySQL, I generally fail when installing them on my computer so maybe it's good I can't install on the host.</p> ...
<p>MySQLdb is what I have used before.</p> <p>If you host is using Python version 2.5 or higher, support for sqlite3 databases is built in (sqlite allows you to have a relational database that is simply a file in your filesystem). But buyer beware, sqlite is not suited for production, so it may depend what you are tr...
<p>Take a pick at</p> <p><a href="https://docs.djangoproject.com/en/1.8/ref/databases/" rel="nofollow">https://docs.djangoproject.com/en/1.8/ref/databases/</a></p> <p>MySQLdb is mostly used driver, but if you are using python3 and django 1.8.x that will not work, then you should use mysqlclient that is a folk of MySQ...
2,319
<p>I feel like questions along the lines of, "my printer is crashing for no obvious reason, what should I do?" may be too broad and open-ended for this format. It's better handled by a forum where people can have running discussions to rule out a series of tests. What do you guys think?</p>
<p>For common problems that get asked a lot, I wouldn't just close these as <em>too broad.</em> A better solution is to create a <strong>canonical post</strong> like this:</p> <p><a href="https://superuser.com/a/260078/697"><strong>How do I troubleshoot when I have no clue where to start?</strong></a></p> <p>These at...
<p>In addition to <a href="https://3dprinting.meta.stackexchange.com/a/84/63">Robert Cartaino♦</a>'s suggestion, I think that there is value in this class of question.</p> <p>Over on <em>Robotics</em> we find that troubleshooting questions can often lead to interesting and often more generalised answers, and can lead ...
19
<p>In one of the answers to <a href="https://stackoverflow.com/questions/31572/broadcast-like-udp-with-the-reliability-of-tcp#31629">Broadcast like UDP with the Reliability of TCP</a>, a user mentions the <a href="http://spread.org" rel="noreferrer">Spread</a> messaging API. I've also run across one called <a href="ht...
<p>MPI was deisgned tightly-coupled compute clusters with fast, reliable networks. Spread and ØMQ are designed for large distributed systems. If you're designing a parallel scientific application, go with MPI, but if you are designing a persistent distributed system that needs to be resilient to faults and network in...
<p>You're addressing very different APIs here, with different notions about the kind of services provided and infrastructure for each of them. I don't know enough about MPI and Spread to answer for them, but I can help a little more with ZeroMQ.</p> <p>ZeroMQ is a simple messaging communication library. It does noth...
5,598
<p>Yes, I know. The existence of a running copy of <code>SQL Server 6.5</code> in 2008 is absurd.</p> <p>That stipulated, what is the best way to migrate from <code>6.5</code> to <code>2005</code>? Is there any direct path? Most of the documentation I've found deals with upgrading <code>6.5</code> to <code>7</code>...
<p>Hey, I'm still stuck in that camp too. The third party application we have to support is FINALLY going to 2K5, so we're almost out of the wood. But I feel your pain 8^D</p> <p>That said, from everything I heard from our DBA, the key is to convert the database to 8.0 format first, and then go to 2005. I believe they...
<p>I am by no means authoritative, but I believe the only supported path is from 6.5 to 7. Certainly that would be the most sane route, then I believe you can migrate from 7 directly to 2005 pretty painlessly.</p> <p>As for scripting out all the objects - I would advise against it as you will inevitably miss something...
2,270
<p>I am looking for a simple way to get a mime type where the file extension is incorrect or not given, something similar to <a href="https://stackoverflow.com/questions/51438/getting-a-files-mime-type-in-java">this question</a> only in .Net.</p>
<p>I did use urlmon.dll in the end. I thought there would be an easier way but this works. I include the code to help anyone else and allow me to find it again if I need it.</p> <pre><code>using System.Runtime.InteropServices; </code></pre> <p>...</p> <pre><code> [DllImport(@"urlmon.dll", CharSet = CharSet.Auto)]...
<p>When working with Windows Azure Web role or any other host that runs your app in Limited Trust do not forget that you will not be allowed to access registry or unmanaged code. Hybrid approach - combination of try-catch-for-registry and in-memory dictionary looks like a good solution that has a bit of everything. </p...
8,285
<p>I've just coded a 700 line class. Awful. I hang my head in shame. It's as opposite to <a href="http://en.wikipedia.org/wiki/Don&#39;t_repeat_yourself" rel="nofollow noreferrer">DRY</a> as a British summer.</p> <p>It's full of cut and paste with minor tweaks here and there. This makes it's a prime candidate for re...
<p>#region</p> <p>I made a 1,000 line class only one line with it!</p> <p>In all seriousness, the best way to avoid repetition is the things covered in your list, as well as fully utilizing polymorphism, examine your class and discover what would best be done in a base class, and how different components of it can be...
<p>First of all, I would recommend refactoring much sooner than when you are done with the first version of the class. Anytime you see duplication, eliminate it ASAP. This may take a little longer initially, but I think the results end up being a lot cleaner, and it helps you rethink your code as you go to ensure you...
8,491
<p>Where is the correct Marlin firmware file and location to add code that I want to shop up in the LCD menu of my printer, and then execute the function I write when the button is pressed?</p> <p>For example I want to add a menu item that says "Preheat Custom" that is in the same menu as "preheat PLA" and "preheat AB...
<p>The answer to your question (baring in mind that the question is raised for Marlin 1.1.9) is the file <a href="https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/ultralcd.cpp" rel="nofollow noreferrer">ultralcd.cpp</a>. Nowadays, you can also enable extra option through the <a href="https://github.com/Marlin...
<p>Preheat Constants - Up to 5 are supported without changing the code just add a new one and then build</p> <pre><code>#define PREHEAT_1_LABEL &quot;PLA&quot; #define PREHEAT_1_TEMP_HOTEND 215 #define PREHEAT_1_TEMP_BED 70 #define PREHEAT_1_TEMP_CHAMBER 35 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to...
1,132
<p>I have some UI in VB 2005 that looks great in XP Style, but goes hideous in Classic Style.</p> <p>Any ideas about how to detect which mode the user is in and re-format the forms on the fly?</p> <hr> <p>Post Answer Edit:</p> <p>Thanks Daniel, looks like this will work. I'm using the first solution you posted with...
<p>Try using a combination of <a href="http://www.pinvoke.net/default.aspx/uxtheme/GetCurrentThemeName.html" rel="nofollow noreferrer">GetCurrentThemeName</a> (<a href="http://msdn.microsoft.com/en-us/library/bb773365%28VS.85%29.aspx" rel="nofollow noreferrer">MSDN Page</a>) and <a href="http://msdn.microsoft.com/en-us...
<p>There's the <a href="http://msdn.microsoft.com/en-us/library/bb759813%28VS.85%29.aspx" rel="nofollow noreferrer">IsThemeActive</a> WinAPI function.</p>
5,506
<p>I'm using Delphi and need to get the current Windows DNS server IP address so I can do a lookup. What function should I call to find it? The only solution I have right now does an ipconfig/all to get it, which is horrible.</p>
<p>Found a nice one using the function GetNetworkParams().Seems to work quite good. You can find it here: <a href="http://www.swissdelphicenter.ch/torry/showcode.php?id=2452" rel="nofollow noreferrer">http://www.swissdelphicenter.ch/torry/showcode.php?id=2452</a></p>
<p>See <em><a href="http://msdn.microsoft.com/en-us/library/aa365968(VS.85).aspx" rel="nofollow noreferrer">GetNetowrkParams</a></em> method (Platform SDK: IP Helper)</p>
8,748
<p>I have a serious problem and I can't find a way to solve it because I have no idea why is it happening. For some reason the things I print get really messy, like a mountain range growing on the print. It looks like overflow but it can't be because I'm already using 0.82 flow modifier and if I go any lower the printo...
<p>It definitely looks like over extruding. But similar effect can appear with proper extruding (or not too much exceeded) but with too high temperature.</p> <p>If it appears only on some parts of the first layer then it can be:</p> <ul> <li>bed leveling issue (or eventually bed is bent)</li> <li>caret mechanism issu...
<p>This is happening on the first or second layer, correct? It looks like your nozzle is trammed too close to the build plate. If there is less gap between the nozzle and bed than the slicer expects, it will over-extrude the first layer. That tends to produce "bacon" patterns of ripples on the bottom of the print as th...
334
<p>I'm downloading an entire directory from a web server. It works OK, but I can't figure how to get the file size before download to compare if it was updated on the server or not. Can this be done as if I was downloading the file from a FTP server?</p> <pre><code>import urllib import re url = "http://www.someurl.co...
<p>I have reproduced what you are seeing:</p> <pre><code>import urllib, os link = "http://python.org" print "opening url:", link site = urllib.urlopen(link) meta = site.info() print "Content-Length:", meta.getheaders("Content-Length")[0] f = open("out.txt", "r") print "File on disk:",len(f.read()) f.close() f = ope...
<p>@PabloG Regarding the local/server filesize difference</p> <p>Following is high-level illustrative explanation of why it may occur:</p> <p>The size on disk sometimes is different from the actual size of the data. It depends on the underlying file-system and how it operates on data. As you may have seen in Windows wh...
2,778
<p>I need to remove duplicate rows from a fairly large SQL Server table (i.e. 300,000+ rows).</p> <p>The rows, of course, will not be perfect duplicates because of the existence of the <code>RowID</code> identity field.</p> <p><strong>MyTable</strong></p> <pre><code>RowID int not null identity(1,1) primary key, Col1 va...
<p>Assuming no nulls, you <code>GROUP BY</code> the unique columns, and <code>SELECT</code> the <code>MIN (or MAX)</code> RowId as the row to keep. Then, just delete everything that didn't have a row id:</p> <pre><code>DELETE FROM MyTable LEFT OUTER JOIN ( SELECT MIN(RowId) as RowId, Col1, Col2, Col3 FROM MyTab...
<p><strong>A very simple way to delete duplicate rows of table in postgresql.</strong></p> <pre><code>DELETE FROM table1 a USING table1 b WHERE a.id &lt; b.id AND a.column1 = b.column1 AND a.column2 = b.column2; </code></pre>
3,944
<p>I'm about to create a web application that requires a lot of different web forms where the user needs to be able to input a lot of different types of information. What I mean is that one of those forms may require some text input fields, some integer input fields, some decimal input fields, some date input fields, s...
<p>I would be tempted to look at Ext JS for this. </p> <p><a href="http://extjs.com/products/extjs/" rel="nofollow noreferrer">Ext JS</a></p>
<p>have you had a look at <a href="http://javascript.neyric.com/inputex/" rel="nofollow noreferrer">InputEx</a></p>
6,548
<p>I want to limit my users to a directory and its sub directories but the "Parent Directory" button allows them to browse to an arbitrary directory.</p> <p>How should I go about doing that?</p>
<p>You can probably do this by setting your own <a href="https://docs.oracle.com/javase/8/docs/api/javax/swing/filechooser/FileSystemView.html" rel="noreferrer">FileSystemView</a>.</p>
<p>No need to be that complicated. You can easily set selection mode of a JFileChooser like this</p> <pre><code>JFileChooser fc = new JFileChooser(); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fc.setMultiSelectionEnabled(false); </code></pre> <p>You can read more reference here <a href="http://docs.oracl...
5,246
<p>How can I <strong>pre pend</strong> (insert at beginning of file) a file to all files of a type in folder and sub-folders using <code>Powershell</code>?</p> <p>I need to add a standard header file to all <code>.cs</code> and was trying to use <code>Powershell</code> to do so, but while I was able to append it in a ...
<p>Here is a very simple example to show you one of the ways it could be done.</p> <pre><code>$Content = "This is your content`n" Get-ChildItem *.cs | foreach-object { $FileContents = Get-Content -Path $_ Set-Content -Path $_ -Value ($Content + $FileContents) } </code></pre>
<p>Have no idea, but if you have the code to append just do it the other way round. Something like</p> <ol> <li>rename existing file,</li> <li>create an empty file named the same as above </li> <li>append header to new empty file,</li> <li>append renamed file to previous,</li> <li>delete renamed file</li> </ol>
9,959
<p>I would like to get a pretty accurate method to do finite element analysis (FEA) on my 3d designs considering the infill. I use <em>Autodesk Inventor</em> to design parts but the FEA can only be applied to a solid body (100% infill). Does anyone know software that can convert a 3d design to another but considering t...
<p>This is the throat block for direct drive extrusion, Anet8 is a cheap clone of Prusa printers, so it's easy to find parts for Anet printers. </p> <p>This is one extruder kit that may help your needs, <a href="https://es.aliexpress.com/store/product/1Set-3D-Printer-makerbot-MK8-Extruder-Aluminum-extrusion-Frame-Bloc...
<p>Like @ZuOverture said the name of this component is the filament drive. Most of the manufactures sell the whole extrusion device already assembled, to avoid mismatches between the components of the extrusion device. If your device is somehow damaged, and without possibilities to be used in the printer the easiest so...
742
<p>I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example:</p> <pre><code>var results = from myRow in myDataTable where results.Field("RowNo") == 1 select results; </code></pre> <p>This is not allowed. How do I...
<p>You can't query against the <code>DataTable</code>'s <em>Rows</em> collection, since <code>DataRowCollection</code> doesn't implement <code>IEnumerable&lt;T&gt;</code>. You need to use the <code>AsEnumerable()</code> extension for <code>DataTable</code>. Like so:</p> <pre><code>var results = from myRow in myDataTabl...
<p>I propose following solution:</p> <pre><code>DataView view = new DataView(myDataTable); view.RowFilter = "RowNo = 1"; DataTable results = view.ToTable(true); </code></pre> <p>Looking at the <a href="https://learn.microsoft.com/de-de/dotnet/api/system.data.dataview?view=netframework-4.8" rel="nofollow noreferrer">...
3,202
<p>I'm trying to install <a href="http://laconi.ca/" rel="noreferrer">Laconica</a>, an open-source Microblogging application on my Windows development server using XAMPP as per the <a href="http://laconi.ca/trac/wiki/InstallationWindows" rel="noreferrer">instructions provided</a>.</p> <p>The website cannot find PEAR, a...
<p>You need to fix your <code>include_path</code> system variable to point to the correct location. </p> <p>To fix it edit the <code>php.ini</code> file. In that file you will find a line that says, "<code>include_path = ...</code>". (You can find out what the location of php.ini by running <code>phpinfo()</code> on a...
<p>Try adding the drive letter:</p> <pre><code>include_path='.;c:\xampplite\php\pear\PEAR' </code></pre> <p>also verify that PEAR.php is actually there, it might be in \php\ instead:</p> <pre><code>include_path='.;c:\xampplite\php' </code></pre>
8,815
<p>This is probably best shown with an example. I have an enum with attributes:</p> <pre><code>public enum MyEnum { [CustomInfo("This is a custom attrib")] None = 0, [CustomInfo("This is another attrib")] ValueA, [CustomInfo("This has an extra flag", AllowSomething = true)] ValueB, } </code>...
<p>This is probably the easiest way.</p> <p>A quicker way would be to Statically Emit the IL code using Dynamic Method and ILGenerator. Although I've only used this to GetPropertyInfo, but can't see why you couldn't emit CustomAttributeInfo as well. </p> <p>For example code to emit a getter from a property</p> <pre>...
<p>I generally find reflection to be quite speedy as long as you don't dynamically invoke methods.<br> Since you are just reading the Attributes of an enum, your approach should work just fine without any real performance hit.</p> <p>And remember that you generally should try to keep things simple to understand. Over ...
3,835
<p>I know the colours are changed in Environment > Fonts and Colors but I haven't found out which Display Item the object is.</p> <p>Can someone please tell how I can colour the following code:</p> <blockquote> <p>lblMessage.Text = "You have successfully answered my question!"</p> </blockquote> <p>I have the strin...
<p>For my big apps I just use a incrementing version number id (1.0, 1.1, ...) that i store in a comment of the main file (usually index.php).<Br /> For just websites I usually just have a revision number (1,2,3,...).</p>
<p>I maintain a system of web applications with various components that live in separate SVN repos. To be able to version track the system as a whole, I have another SVN repo which contains all other repos as external references. It also contains install / setup script(s) to deploy the whole thing. With that setup, the...
4,959
<p>I'm using Google App Engine and Django templates.<br> I have a table that I want to display the objects look something like:<br></p> <pre><code>Object Result: Items = [item1,item2] Users = [{name='username',item1=3,item2=4},..] </code></pre> <p>The Django template is:</p> <pre><code>&lt;table&gt; &lt;tr a...
<p>I found a "nicer"/"better" solution for getting variables inside Its not the nicest way, but it works.</p> <p>You install a custom filter into django which gets the key of your dict as a parameter</p> <p>To make it work in google app-engine you need to add a file to your main directory, I called mine <em>django_ha...
<p>shouldn't this:</p> <pre><code>{{ user.item }} </code></pre> <p>be this?</p> <pre><code>{{ item }} </code></pre> <p>there is no user object in the context within that loop....?</p>
5,654
<p>A few weeks ago I got a thermal runaway message on my modded Ender 3 during a print, and I have not been able to get it working since then! I have tried fixing and replacing everything, and I still keep getting the message!</p> <p>When the printer starts/heats up, the thermistor is able to read the temperature with ...
<p>If the error only happens when the printer starts moving it's logical that the issue is in the wire loom that starts to bend and flex once the print starts.</p> <p>As a quick test and if your comfortable with a little wiring work a temporarily line could be connected directly from the sensor to board. Skipping rewir...
<p>I've had this problem on a Prusa MK2s. The print was always at the center of the build plate and that's the location (underneath) of the thermistor. The part was small, the cooling fan was chilling the bed at the same time it was trying to maintain temperature. Moving the part a few centimeters away from the center ...
2,002
<p>I have a string, say <code>'123'</code>, and I want to convert it to the integer <code>123</code>.</p> <p>I know you can simply do <code>some_string.to_i</code>, but that converts <code>'lolipops'</code> to <code>0</code>, which is not the effect I have in mind. I want it to blow up in my face when I try to convert...
<p>Ruby has this functionality built in:</p> <pre><code>Integer('1001') # =&gt; 1001 Integer('1001 nights') # ArgumentError: invalid value for Integer: "1001 nights" </code></pre> <p>As noted in answer by <a href="https://stackoverflow.com/questions/49274/safe-integer-parsing-...
<p>Re: <a href="https://stackoverflow.com/questions/49274/safe-integer-parsing-in-ruby#49280">Chris's answer</a></p> <p>Your implementation let's things like "1a" or "b2" through. How about this instead:</p> <pre><code>def safeParse2(strToParse) if strToParse =~ /\A\d+\Z/ strToParse.to_i else raise Except...
7,179
<p>I am about to reenter the MFC world after years away for a new job. What resources to people recommend for refreshing the memory? I have been doing mainly C# recently.</p> <p>Also any MFC centric websites or blogs that people recommend?</p>
<ul> <li>For blogs: Your best bet would be the <a href="http://blogs.msdn.com/vcblog/default.aspx" rel="nofollow noreferrer">Visual C++ Team Blog</a>.</li> <li>For books: <a href="https://rads.stackoverflow.com/amzn/click/com/1572316950" rel="nofollow noreferrer" rel="nofollow noreferrer">Programming Windows with MFC</...
<p>Books are one thing, but I always found that practice was the key with MFC. <a href="http://www.codeguru.com" rel="nofollow noreferrer">CodeGuru</a> was my favourite destination to answer anything MFC-related. </p> <p>There's also that new website. What's it called...that's it - <a href="https://stackoverflow.com/"...
4,745
<p>I have a Maker Farm Prusa i3v 8" i just finished building. Initially when i first homed it, it ran fine, it even ran a test g code for movement. The problem is now the Z axis wont move anymore. First i checked for physical issues such as binding or nuts coming out of traps, everything's OK there. In Pronterface ...
<p>If you are using Repetier the code to test the endstops is m119 I think. If your z stop is triggered, you may have to invert it in the config.h file. I had this same issue for days before i figured out the control board was reading the switch as normal close instead of normal open. Hope that helps!</p>
<p>Try sending a motion command manually, such as G1 X20 Z10, to eliminate any bugginess from the software interface as a reason for the Z not moving properly when commanded to. Next you could check the park location in Pronterface, perhaps the extruder head is sitting there waiting for the next command.</p>
682
<p>Does Java impose any extra restrictions of its own. Windows (upto Vista) does not allow names to include</p> <pre><code>\ / &lt; &gt; ? * : </code></pre> <p>I know HOW to validate names (a regular expression).</p> <p>I need to validate filenames entered by users. </p> <p>My application does not need to run on a...
<p>No, you can escape any character that Java doesn't allow in String literals but the filesystem allows.</p> <p>Also, if trying to port an Windows app to Mac or Unix it is best to use:</p> <pre><code>File.separator </code></pre> <p>To determine the correct file separator to use on each platform.</p>
<p>When you create a <code>new File</code> the inputted arguments will be normalized by a platform specific implementation of the <code>java.io.FileSystem</code> class. There are no Java specific restrictions that I know of.</p> <p>and yes, always use <code>File.separator</code>.</p>
8,926
<p>I am trying to get the <code>Edit with Vim</code> context menu to open files in a new tab of the previously opened Gvim instance (if any).</p> <p>Currently, using <code>Regedit</code> I have modified this key:</p> <pre><code>\HKEY-LOCAL-MACHINE\SOFTWARE\Vim\Gvim\path = "C:\Programs\Vim\vim72\gvim.exe" -p --remote-...
<p>Try setting it to: "C:\Programs\Vim \vim72\gvim.exe" -p --remote-tab-silent "%1" "%*"</p> <p>See: <a href="http://www.vim.org/tips/tip.php?tip_id=1314" rel="noreferrer">http://www.vim.org/tips/tip.php?tip_id=1314</a></p> <p>EDIT: As pointed out by Thomas, vim.org tips moved to: <a href="http://vim.wikia.com/" rel=...
<p>I would recommend trying <a href="http://cream.sourceforge.net/index.html" rel="nofollow noreferrer">Cream</a>.</p> <p> Cream is a set of scripts and add-ons that sit on top of gVim. Cream doesn't change the appearance of gVim, but it does change the way it behaves.</p> <p>One of those behaviours is a tabbed docum...
9,306
<p>I need to do some post processing of my 3D-printed models that includes adding some holes. For each of PLA, ABS, PETG and other 3D-printing materials:</p> <p>In what ways is drilling a hole in a model made from that material like or unlike drilling wood? Is it worth getting special "plastic drilling bits" that cost...
<p>Have to get this out of the way... Can you just print the hole into the part instead of drilling? That's usually best, when possible. </p> <p>If you need to drill, you'll definitely want to print an undersized hole and then ream it out with the drill. This both provides alignment for the drill and adds extra plasti...
<p>I realize this is an old post .. but playing around with drilling PLA myself .. 100 % infill .. and use dish soap for a lubricant .. it seemed to work really well .. I am a hobby machinist .. had a lathe and mill years back and used all the proper oils etc .. but in this case didnt want to expose the pla to oils a...
164
<p>I have a svn repo on my machine (Windows). Anyone have a script to back it up to a network share?</p> <p>I'm using the repo locally since I'm disconnected a lot. The network share is on a server with a backup strategy. I'm a perfect candidate for git/hg but I don't want to give up my VS integration just yet.</p>
<p>I wrote a batch file to do this for a bunch of repos, you could just hook that batch file up to windows scheduler and run it on a schedule.</p> <pre><code>svnadmin hotcopy m:\Source\Q4Press\Repo m:\SvnOut\Q4Press </code></pre> <p>I use the hotcopy but the svn dump would work just as well.</p>
<p>svnadmin dump C:\SVNRepositorio\Repositorio > \\Backups\BkTmpSubversion\subversiontemp.dump</p> <p>Try this.</p>
4,077
<p>I'm currently using the awesome attachment-fu plugin for a Rails app, but as a novice developer, I've never encountered a scenario like the one I've found myself in.</p> <p>Essentially, I'm using the attachment-fu plugin on two levels.</p> <ol> <li>Is for user avatars in the user class.</li> <li>Is to allow file a...
<p>Is "outsourcing" avatar support entirely to <a href="http://en.gravatar.com/" rel="nofollow noreferrer">Gravatar</a> an option? There are some Rails plugins that will display avatars hosted by Gravatar. You might not need to re-invent the wheel there.</p>
<p>Couldn't you use <a href="http://wiki.rubyonrails.org/rails/pages/UnderstandingPolymorphicAssociations" rel="nofollow noreferrer">Polymorphic Associations</a>?</p> <p>I'm about to hit this in my app with attachment_fu, so I'm not exactly sure on attachment_fu, but for the old school <a href="http://wiki.rubyonrails...
4,032
<p>I have a query that originally looks like this:</p> <pre><code>select c.Id, c.Name, c.CountryCode, c.CustomerNumber, cacc.AccountNumber, ca.Line1, ca.CityName, ca.PostalCode from dbo.Customer as c left join dbo.CustomerAddress as ca on ca.CustomerId = c.Id left join dbo.CustomerAccount as cacc on cacc.CustomerId = ...
<p>You've asked for the canonical reason why Boost::MultiIndex was made: list insertion order with fast lookup by key. <a href="http://www.boost.org/doc/libs/1_36_0/libs/multi_index/doc/tutorial/basics.html#list_fast_lookup" rel="nofollow noreferrer">Boost MultiIndex tutorial: list fast lookup</a></p>
<p>@wesc: STL has std::map... so what's the difference with unordered_map? I don't think STL would implement twice the same thing and call it differently.</p>
5,656
<p>I tried printing a <a href="https://www.thingiverse.com/thing:2939079" rel="nofollow noreferrer">"improved" calibration cube</a> and noticed that the printer was laying down dots instead of a solid line. This was right after switching out my extruder motor and tweaking retraction settings. I believe my first setting...
<p>I have seen this a lot of times on my tronXY-X1 with an e3d-v6 via Bowden tube. It is <em>not</em> related to retraction but a different settin: Your first layer is set too thin or not leveled to the right height. </p> <p>Having the first layer too thin, means that with a tiny error, the calculated correct extrusio...
<p>It's not about printing settings but only about the bed: the bed is too close to the nozzle.</p> <p>Maybe you adjusted it when it was cold, instead of doing it when it's already heated to the desired temperature and the nozzle is heated at about 180°C to get close to operating temperature without oozing.</p> <p>Or...
1,561
<p>What are good libraries for C with datastructures like vectors, deques, stacks, hashmaps, treemaps, sets, etc.? Plain C, please, and platform-independent.</p>
<p>The <a href="http://library.gnome.org/devel/glib/stable/" rel="noreferrer">Glib</a> library used on the Gnome project may also be some use. Moreover it is pretty well tested.</p> <p>IBM developer works has a good tutorial on its use: <a href="https://www.ibm.com/developerworks/linux/tutorials/l-glib/" rel="noreferr...
<p>Maybe <a href="http://sglib.sourceforge.net/" rel="nofollow noreferrer">http://sglib.sourceforge.net/</a> if you want an easy to use, very fast, macro based library.</p>
2,467
<p>When manually controlling the z-axis in reprap, it works fine. If I use the home button, it doesn't move. Instead, it stalls/freezes/hangs. It attempts to turn, but can't successfully make a full turn. </p>
<p>lower the moving speed of the Z-axis motor, search for </p> <blockquote> <p>homing feed rate</p> </blockquote> <p>in config.h as it looks like the given speed is to high.</p>
<p>Looks like endstop signal for Z is inverted. In this case Z will move in manual mode but when homing it will try and stop as limit detected immediately. Change Z_MIN_ENDSTOP_INVERTING to opposite value.</p>
1,030
<p>I have been hearing the podcast blog for a while, I hope I dont break this. The question is this: I have to insert an xml to a database. This will be for already defined tables and fields. So what is the best way to accomplish this? So far I am leaning toward programatic. I have been seeing varios options, one is D...
<p>In an attempt to try and help, we may need some clarification. Maybe by restating the problem you can let us know if this is what you're asking:</p> <p><strong>How can one import existing xml into a SQL 2005 database, without relying on the built-in xml type?</strong></p> <p>A fairly straight forward solution that...
<p>If your XML conforms to a particular XSD schema, you can look into using the "xsd.exe" command line tool to generate C# object classes that you can bind the XML to, and then form your insert statements using the properties of those objects: <a href="http://msdn.microsoft.com/en-us/library/x6c1kb0s(VS.71).aspx" rel="...
8,449
<p>On a JSTL/JSP page, I have a java.util.Date object from my application. I need to find the day <em>after</em> the day specified by that object. I can use &lt;jsp:scriptlet&gt; to drop into Java and use java.util.Calendar to do the necessary calculations, but this feels clumsy and inelegant to me.</p> <p>Is there so...
<p>I'm not a fan of putting java code in your jsp.</p> <p>I'd use a static method and a taglib to accomplish this.</p> <p>Just my idea though. There are many ways to solve this problem.</p> <pre><code>public static Date addDay(Date date){ //TODO you may want to check for a null date and handle it. Calendar cal...
<p>Unfortunately there is no tag in the standard JSP/JSTL libraries that I know of that would allow you to do this date calculation.</p> <p>The simplest, and most inelegant, solution is to just use some scriptlet code to do the calculation. You've already stated that you think this is a clunky solution, and I agree w...
9,991
<p>Lately I've been having a lot of trouble with printing overhangs in TPU. The failures are very geometry/toolpath dependent, entirely reproducible in their location (same gcode gives same failures each time it's printed), and seem to occur where there is a convex (model-inward) curve over an overhang of more than 40°...
<p>The root cause was a badly worn nozzle.</p> <p>The problem described in this question gradually became more and more severe and began affecting PLA and PET prints with thin layers too. Eventually I traced it to the CHT nozzle, by swapping in a 50¢ plain brass nozzle, and found someone with otherwise very similar ext...
<p>I fixed my overhangs by increasing the nozzle temp. You need to heat it up enough that the elasticity is lost which makes it misbehave on overhangs and curl up.</p>
2,174
<p>I got this message from my Creality Ender 6 printer.</p> <p>Now every time I want to print, or when it heats up, the printer gives me this message.</p> <p>Can anyone please help with this?</p> <p><a href="https://i.stack.imgur.com/oCLzI.jpg" rel="nofollow noreferrer" title="Heating failed error"><img src="https://i....
<p>I've seen a version of this error on my Ender 3 when I heated the hot end without the silicone sock (or any other insulating wrap).</p> <p>If this occurred after changing a nozzle, replacing a heat break (or entire hot end), installing a new cooling duct, or similar, it's likely you just inadvertently left off the i...
<p>Someone with experience using an Ender may give a more specific answer to you question. This is a general answer, not for a specific model.</p> <p>&quot;Soon enough&quot; is saying the printer timed out before reaching temperature.</p> <ol> <li><p>Do you see the temperature increasing on both the hot end and bed? ...
1,848
<p>I have a large text template which needs tokenized sections replaced by other text. The tokens look something like this: ##USERNAME##. My first instinct is just to use String.Replace(), but is there a better, more efficient way or is Replace() already optimized for this?</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.replace.aspx" rel="noreferrer" title="MSDN">System.Text.RegularExpressions.Regex.Replace()</a> is what you seek - IF your tokens are odd enough that you need a regex to find them.</p> <p><a href="http://blogs.msdn.com/debuggingtoo...
<p>This is an ideal use of Regular Expressions. Check out <a href="http://regular-expressions.info" rel="nofollow noreferrer">this helpful website</a>, the <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx" rel="nofollow noreferrer">.Net Regular Expressions class</a>, and this v...
4,063
<p>How do you define your UserControls as being in a namespace below the project namespace, ie. [RootNameSpace].[SubSectionOfProgram].Controls?</p> <p><strong>Edit due to camainc's answer:</strong> I also have a constraint that I have to have all the code in a single project.</p> <p><strong>Edit to finalise question:...
<p>I'm not sure if this is what you are asking, but this is how we do it.</p> <p>We namespace all of our projects in a consistent manner, user controls are no different. We also namespace using the project settings window, although you could do it through a combination of the project window and in code.</p> <p>Each s...
<p>Do you mean you want to be able to access user controls at runtime (in code) via </p> <blockquote> <p><code>[ProjectNamespace].[YourSpecialNamespace].Controls</code></p> </blockquote> <p>rather than the default of </p> <blockquote> <p><code>[ProjectNamespace].Controls</code></p> </blockquote> <p>? Because I ...
8,808
<p>What is BODMAS and why is it useful in programming?</p>
<p><a href="http://www.easymaths.com/What_on_earth_is_Bodmas.htm" rel="noreferrer">http://www.easymaths.com/What_on_earth_is_Bodmas.htm</a>:</p> <blockquote> <p>What do you think the answer to 2 + 3 x 5 is?</p> <p>Is it (2 + 3) x 5 = 5 x 5 = 25 ?</p> <p>or 2 + (3 x 5) = 2 + 15 = 17 ?</p> <p>BODMAS can...
<p>I read somewhere that especially in C/C++ splitting your expressions into small statements was better for optimisation; so instead of writing hugely complex expressions in one line, you cache the parts into variables and do each one in steps, then build them up as you go along.</p> <p>The optimisation routines will...
2,561
<p>I am currently writing a small calendar in ASP.Net C#. Currently to produce the rows of the weeks I do the following for loop:</p> <pre><code>var iWeeks = 6; for (int w = 0; w &lt; iWeeks; w++) { </code></pre> <p>This works fine, however, some month will only have 5 weeks and in some rare cases, 4.</p> <p>How can...
<p>Here is the method that does it:</p> <pre><code>public int GetWeekRows(int year, int month) { DateTime firstDayOfMonth = new DateTime(year, month, 1); DateTime lastDayOfMonth = new DateTime(year, month, 1).AddMonths(1).AddDays(-1); System.Globalization.Calendar calendar = System.Threading.Thread.Current...
<p>How about checking which week the first and last days will be in?</p>
3,116
<p>What does it mean when you get or create a date in UTC format in JavaScript?</p>
<p>A date represents a specific point in time. This point in time will be called differently in different places. As I write this, it's 00:27 on Tuesday in Germany, 23:27 on Monday in the UK and 18:27 on Monday in New York.</p> <p>To take an example method: getDay returns the day of the week in the local timezone. ...
<p>getUTC is for converting times to Coordinated Universal Time (UTC, the acronym is ordered differently than what it stands for) which is the standard time based on the time in Greenwich, London.</p> <p>The universal time is calculated using a time offset (in minutes when in JavaScript.) This offset is based on the t...
3,610
<p>Is there any free or commercial component written in .NET (no COM interop) that will work with most twain scanners?</p>
<blockquote> <h3><a href="https://github.com/tmyroadctfig/twaindotnet" rel="noreferrer">TwainDotNet</a></h3> </blockquote> <p>I've just wrapped up the code from Thomas Scheidegger's article (<a href="http://www.codeproject.com/KB/dotnet/twaindotnet.aspx" rel="noreferrer">CodeProject: .NET TWAIN image scanning</a>) into...
<p>Just started a project in .net and found great info <a href="http://www.csharpfriends.com/Forums/ShowPost.aspx?PostID=60471" rel="nofollow noreferrer">here</a> (*dead link as of Feb 2014) about using Windows Image Acquisition. Lots of sample VB code and some c#.</p>
6,032
<p>I'm troubleshooting a problem with creating Vista shortcuts.</p> <p>I want to make sure that our Installer is reading the Programs folder from the right registry key.</p> <p>It's reading it from:</p> <pre><code>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Programs </code></pr...
<p>Don't use the registry to read this. Use <a href="http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx" rel="nofollow noreferrer">SHGetFolderPath</a> with CSIDL_PROGRAMS.</p> <p>For a reason why, see Raymond Chen's comments on the "Shell Folders" key:</p> <p><a href="http://blogs.msdn.com/oldnewthing/arch...
<p>Sounds correct to me.</p>
8,228
<p>Is it okay to directly connect together the grounds of the logic supply and the motor supply when using a Pololu style stepper driver?</p> <p><a href="https://i.stack.imgur.com/yijCn.jpg" rel="nofollow noreferrer" title="A4988 connection schematic"><img src="https://i.stack.imgur.com/yijCn.jpg" alt="A4988 connectio...
<p>That depends on how much noise you have on your motor power supply ground. You definitely want the 100&nbsp;µF capacitor to have a good high frequency response. Motors turning on and off can be noisy, and that noise can cause false clock signals in your logic circuitry if you tie the grounds together. </p>
<p>That depends on how much noise you have on your motor power supply ground. You definitely want the 100&nbsp;µF capacitor to have a good high frequency response. Motors turning on and off can be noisy, and that noise can cause false clock signals in your logic circuitry if you tie the grounds together. </p>
1,341
<p>I'm sure this is easy but I can't figure it out:</p> <p>I have an ASP.NET page with some UpdatePanels on it. I want the page to <em>completely</em> load with some 'Please wait' text in the UpdatePanels. Then once the page is <em>completely loaded</em> I want to call a code-behind function to update the UpdatePane...
<p>I fiddled around with the ScriptManager suggestions - which I reckon I would have eventually got working but it seems to me that the Timer idea is easier to implement and not really(!) that much of a hack?!</p> <p>Here's how I got my panel updated <em>after</em> the initial page render was complete...</p> <p>defau...
<p>The ScriptManager.RegisterStartupScript allows a script to run on startup inside of an update panel. if you use the old ClientScript.RegisterStartupScript then the script you render will be outside the bounds of the udpate panel, and thus won't be executed during async page loads.</p>
5,191
<p>Are there any specific type of FDM 3D printers that I should look for?</p>
<p>and welcome to 3D Printing Stack Exchange.</p> <p>No. Not all 3D printers can print flexible material.</p> <p>The first place you will have trouble is in the extruder itself. Flexible filament will find any way to escape from the confines of the rollers and the guide tube. Any opening will allow the filament to...
<p>Not all printers are suitable to print flexible filament. E.g. 1.75 mm filament printers with a Bowden extruder/hotend combination will not work (you may have more luck using 2.85 mm filament, which is stiffer because of the increased diameter). For 1.75 mm filament you require a direct drive extruder, e.g. with the...
1,019
<p>I'd like to be able to introspect a C++ class for its name, contents (i.e. members and their types) etc. I'm talking native C++ here, not managed C++, which has reflection. I realise C++ supplies some limited information using RTTI. Which additional libraries (or other techniques) could supply this information?</p>
<p>What you need to do is have the preprocessor generate reflection data about the fields. This data can be stored as nested classes. </p> <p>First, to make it easier and cleaner to write it in the preprocessor we will use typed expression. A typed expression is just an expression that puts the type in parenthesis. So...
<p>If you declare a pointer to a function like this:</p> <pre><code>int (*func)(int a, int b); </code></pre> <p>You can assign a place in memory to that function like this (requires <code>libdl</code> and <code>dlopen</code>)</p> <pre><code>#include &lt;dlfcn.h&gt; int main(void) { void *handle; char *func_...
6,275
<p>Is there an equivalent operator to Haskell's list difference operator <code>\\</code> in F#?</p>
<p>Was bounced, yet I believe it is worth to write here the implementation of <code>( /-/ )</code> (the F# version of Haskell's <code>\\</code>):</p> <pre><code>let flip f x y = f y x let rec delete x = function | [] -&gt; [] | h :: t when x = h -&gt; t | h :: t -&gt; h :: delete x t let inline ( /-/ ) xs ys =...
<p>Assuming you really want conventional set difference rather than the weird ordered-but-unsorted multiset subtraction that Haskell apparently provides, just convert the lists to sets using the built-in <code>set</code> function and then use the built-in <code>-</code> operator to compute the set difference:</p> <pre...
8,438