instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>I'm just about to make my first trip into the world of JNI (Java Native Interface) to provide file system change notifications from platform specific C/C++ code to Java. That is unless someone suggest some brilliant library for doing this that I've missed.</p> <p>Being new to JNI I've managed to find much documenta...
<p>I strongly dislike make because of its implicit ruleset and treatment of whitespace. Personally I would use cpp tasks (<a href="http://ant-contrib.sourceforge.net/cpptasks/index.html" rel="nofollow noreferrer">http://ant-contrib.sourceforge.net/cpptasks/index.html</a>) to do my C compilation. They are not as flex...
<p>You could also try the terp C++ tasks at <a href="http://codemesh.com/products/terp" rel="nofollow noreferrer">Codemesh</a>. They are not free but they offer a high level of abstraction coupled with the ability to discover/specify the C++ compiler and the ability to iterate over more than one compiler/processor arch...
3,611
<p>I've inherited a hoary old piece of code (by hoary, I mean warty with lots of undocumented bug fixes than WTF-y) and there's one part that's giving me a bit of trouble. Here's how it connects to the remote registry to get the add/remove programs key:</p> <pre><code>try { remoteKey = RegistryKey.OpenRemoteBaseKe...
<p>You probably have to use impersonation to change the credentials of the thread that calls the remote registry methods. See here (<a href="http://msdn.microsoft.com/en-us/library/system.security.principal.windowsimpersonationcontext.aspx" rel="nofollow noreferrer">linky</a>) for some information on MSDN. Basically,...
<p>You probably have to use impersonation to change the credentials of the thread that calls the remote registry methods. See here (<a href="http://msdn.microsoft.com/en-us/library/system.security.principal.windowsimpersonationcontext.aspx" rel="nofollow noreferrer">linky</a>) for some information on MSDN. Basically,...
7,162
<p>I've got a DataSet in VisualStudio 2005. I need to change the datatype of a column in one of the datatables from <code>System.Int32</code> to <code>System.Decimal</code>. When I try to change the datatype in the <code>DataSet Designer</code> I receive the following error:</p> <blockquote> <p>Property value is n...
<p>I get the same error but only for columns with its <code>DefaultValue</code> set to any value (except the default <code>&lt;DBNull&gt;</code>). So the way I got around this issue was:</p> <ol> <li>Column DefaultValue : Type in <code>&lt;DBNull&gt;</code></li> <li>Save and reopen the dataset</li> </ol>
<ul> <li>Close the DataSet in the visual designer</li> <li>Right click the dataset, choose <code>Open With...</code></li> <li>Choose <code>XML (Text) Editor</code></li> <li>Find the column in the XML, in your dataset it will look something like:</li> </ul> <pre><code>&lt;xs:element name="DataColumn1" msprop:Generato...
6,943
<p>I'm not really sure if I'm asking the right question here, but I just made a noob mistake of buying 3 mm filaments instead of 1.75 mm. I have a Makerbot Replicator 2 which I've been using and so far it is pulling in 1.75 mm quite well.</p> <p>Is there any way I can still make use the 3 mm filaments, or do I need to ...
<p>This is not a definitive answer (and has turned into a ramble), as I have not yet had to change my filament size. </p> <p>However, initially, I would have thought that only the hotend and the hotend's nozzle would need to be changed, from one that can handle the 1.75 mm filament to 3 mm. If the extruder is spring l...
<p>Late to the party here but I am doing this exact thing. I stupidly bought like a dozen rolls of 3mm filament for about $6 a Kg. I think trying the switch should be fun...but I have 7 printers so its no big deal to tinker on one of them.</p> <p>What you need to do is modify the extruder. I have done this successfully...
507
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/46663/how-do-you-send-email-from-a-java-app-using-gmail">How do you send email from a Java app using Gmail?</a> </p> </blockquote> <p>How do I send an SMTP Message from Java?</p>
<p>Here's an example for Gmail smtp:</p> <pre><code>import java.io.*; import java.net.InetAddress; import java.util.Properties; import java.util.Date; import javax.mail.*; import javax.mail.internet.*; import com.sun.mail.smtp.*; public class Distribution { public static void main(String args[]) throws Excep...
<pre><code>import javax.mail.*; import javax.mail.internet.*; import java.util.*; public void postMail(String recipients[], String subject, String message , String from) throws MessagingException { //Set the host smtp address Properties props = new Properties(); props.put("mail.smtp.host", "smtp.jcom...
9,932
<p>I'm really asking this by proxy, another team at work has had a change request from our customer.</p> <p>The problem is that our customer doesn't want their employees to login with one user more than one at the same time. That they are getting locked out and sharing logins. </p> <p>Since this is on a web farm, wha...
<p>You could look at using a distributed cache system like <a href="http://www.danga.com/memcached/" rel="noreferrer">memcached</a></p> <p>It would solve this problem pretty well (it's MUCH faster than a database), and is also excellent for caching pretty much anything else too</p>
<p>It depends on how the authentication is done. If you store the last successful login datetime (whatever the backend), so maybe you can change the schema to store a flag "logged_in" and that won't involve an extra performance cost. (ok, it's not clean at all)</p>
5,369
<p>Unable to find a SQL diff tool that meets my needs, I am writing my own. Between the INFORMATION_SCHEMA and sys tables, I have a mostly-complete working version. But one thing I can't find in the metadata is the <em>definition</em> of a trigger, you know, the actual SQL code. Am I overlooking something?</p> <p>T...
<p>sp_helptext works to get the sql that makes up a trigger.</p> <p>The text column in the syscomments view also contains the sql used for object creation.</p>
<p>this query return trigger with its name and body.</p> <pre><code>Select [tgr].[name] as [trigger name], [tbl].[name] as [table name] , OBJECT_DEFINITION(tgr.id) body from sysobjects tgr join sysobjects tbl on tgr.parent_obj = tbl.id WHERE tgr.xtype = 'TR' </code></pre>
6,566
<p>When developing a new web based application which version of html should you aim for?</p> <p>EDIT:</p> <p>cool I was just attempting to get a feel from others I tend to use XHTML 1.0 Strict in my own work and Transitional when others are involved in the content creation.</p> <p>I marked the first XHTML 1.0 Transi...
<p>HTML 4.01. There is absolutely <strong>no reason</strong> to use XHTML for anything but experimental or academic problems that you only want to run on the 'obscure' web browsers.</p> <p>XHTML Transitional is completely pointless even to <em>those</em> browsers, so I'm not sure why anyone would aim for that. It's ac...
<p>HTML 4.0 Strict, or ISO HTML.</p>
2,572
<p>I'm using the <a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/AutoComplete/AutoComplete.aspx" rel="nofollow noreferrer">AutoComplete</a> control from the ASP.NET AJAX Control Toolkit and I'm experiencing an issue where the AutoComplete does not populate when I set the focus to the assigned textbox. </p>...
<p>We had exactly the same problem. What we had to do is write a script at the bottom of the page that quickly blurs then refocuses to the textbox. You can have a look at the (terribly hacky) solution here: <a href="http://www.drive.com.au" rel="nofollow noreferrer">http://www.drive.com.au</a> </p> <p>The textbox id...
<p>How are you setting focus? I haven't tried the specific scenario you've suggested, but here's how I set focus to my controls:</p> <pre><code>Public Sub SetFocus(ByVal ctrl As Control) Dim sb As New System.Text.StringBuilder Dim p As Control p = ctrl.Parent While (Not (p.GetType() Is GetType(System.W...
6,444
<p>What is the best way to write a Safari extension? I've written a couple XUL extensions for Firefox, and now I'd like to write versions of them for Safari. Is there a way that would allow you to add buttons or forms to the browser UI, since this is not possible with an Input manager or Service menu?</p>
<p>Safari plugin development is non-trivial. The interface is written in Objective-C, and most of it is not even part of WebKit (so you can't see the source), but there's machinery to inspect and patch the object hierarchy of a running application. It requires understanding of Cocoa and Objective-C, but no lower.</p> ...
<p>Also, to note - Apple has stated that InputManagers are being severely limited as of Leopard and will not run in 64-bit applications per Apple <a href="http://developer.apple.com/releasenotes/Cocoa/AppKit.html#NSInputManager" rel="nofollow noreferrer">Leopard Release Notes</a>. This is especially interesting consid...
8,512
<p>I've writen an Excel-based, database reporting tool. Currentely, all the VBA code is associated with a single XLS file. The user generates the report by clicking a button on the toolbar. Unfortunately, unless the user has saved the file under another file name, all the reported data gets wiped-out.</p> <p>When I ha...
<p>You can modify the user's personal.xls file, stored in the excel startup directory (varies between Office versions). If you have lots of users though, that can be fiddly.</p> <p>An alternative way to get over your problem is to store the macro in a template (.xlt) file. Then when the users opens it they can't save ...
<p>Have you looked into ClickOnce deploying the Excel file?</p>
4,929
<p>In C++ when a virtual function is called from within a constructor it doesn't behave like a virtual function.</p> <p>I think everyone who encountered this behavior for the first time was surprised but on second thought it made sense:</p> <p>As long as the derived constructor has not been executed the object is <st...
<p>There's a fundamental difference in how the languages define an object's life time. In Java and .Net the object members are zero/null initialized before any constructor is run and is at this point that the object life time begins. So when you enter the constructor you've already got an initialized object.</p> <p>In...
<p>Delphi makes good use of virtual constructors in the VCL GUI framework: </p> <pre><code>type TComponent = class public constructor Create(AOwner: TComponent); virtual; // virtual constructor end; TMyEdit = class(TComponent) public constructor Create(AOwner: TComponent); override; // override virt...
5,743
<p>I'm needing to access Excel workbooks from .Net. I know all about the different ways of doing it (I've written them up in a <a href="http://blog.functionalfun.net/2008/06/reading-and-writing-excel-files-with.html" rel="noreferrer" title="Reading and Writing Excel files in .Net">blog post</a>), and I know that using ...
<p>I haven't done any proper benchmarks, but I tried out several other components,and found that <a href="http://spreadsheetgear.com/" rel="nofollow noreferrer">SpreadsheetGear</a> was considerably faster than XlsIO which I was using before. I've written up some of my findings in this <a href="http://blog.functionalfun...
<p>Yes but I'm not going to publish them both out of a courtesy to Syncfusion (they ask you not to publish benchmarks), because I'm not an experienced tester so my tests are probably somewhat flawed but mostly because what you actually benchmark makes a huge difference to who wins and by how much. </p> <p>I took one o...
3,528
<p>I used jQuery to set hover callbacks for elements on my page. I'm now writing a module which needs to temporarily set new hover behaviour for some elements. The new module has no access to the original code for the hover functions.</p> <p>I want to store the old hover functions before I set new ones so I can restor...
<p>Calling an event <code>bind</code> method (such as <code>hover</code>) does not delete old event handlers, only adds your new events, so your idea of 'restoring' the old event functions wouldn't work, as it wouldn't delete your events.</p> <p>You can add your own events, and then remove them without affecting any o...
<p>I'm not sure if this is what you mean, but you can bind custom events and then trigger them.</p> <p><a href="http://docs.jquery.com/Events/bind" rel="nofollow noreferrer">http://docs.jquery.com/Events/bind</a></p> <p>So add your hover event, script the functionality you need for that hover, then trigger your custo...
7,135
<p>My Craftbot Plus Craftware slicer estimates cost per job based on filament prices I add as parameters. What costs per meter would you use? I created spreadsheets to calculate this for 1.75mm diameter filament and arrived at PLA = 6.6 cents per meter, ABS = 6.1 and PET XT = 18.6 cents per meter.</p> <p>Edit: than...
<p>This strongly depends on the cost of the spool in question. Prices are not consistent among materials at all; a spool of ABS can cost anywhere from \$15 to \$60 and the same price range applies to pretty much all other plastic.</p> <p>For the purpose of this question I am going to assume that a 1 kilogram spool cos...
<p>The simplest method is to divide spool price by its length. That's obvious I think. If PLA 1.75 (1kg net) has about 120m length and it costs 16usd then it looks like 1m costs arount 13c. =price/length</p> <p>I think everyone can buy different filament at different price from different vendors so there is no good ge...
333
<p>"Microsoft SQL Server Profiler is a graphical user interface to SQL Trace for monitoring an instance of the Database Engine or Analysis Services."</p> <p>I find using SQL Server Profiler extremely useful during development, testing and when I am debugging database application problems. Does anybody know if there is...
<p>Something cool that is in version 5.0.37 of the community server is <a href="http://web.archive.org/web/20110609054749/http://dev.mysql.com/tech-resources/articles/using-new-query-profiler.html" rel="noreferrer">MySQL's new profiler</a>. </p> <p>This may give you what info you are looking for.</p>
<p>I don't know about any profiling apps as such, but it's commonplace to use the EXPLAIN syntax for analysing queries. You can use these to figure out the best indexes to create, or you can try changing the overall query and see how it changes the efficiency, etc.</p>
4,062
<p>I would like to automatically generate PDF documents from <a href="https://en.wikipedia.org/wiki/WebObjects" rel="nofollow noreferrer">WebObjects</a> based on mulitpage forms. Assuming I have a class which can assemble the related forms (java/wod files) is there a good way to then parse the individual forms into a P...
<p>The canonical response when asked about PDFs from WebObjects has generally been <a href="http://www.reportmill.com/" rel="nofollow noreferrer">ReportMill</a>. It's a PDF document generating framework that works a lot like WebObjects, and includes its own graphical PDF builder tool similar to WebObjects Builder an...
<p>ScArcher2>></p> <p>I have looked into different routes for creating PDFs on the fly including FOP and a few Java libraries. I think what I am really asking is if anyone has already done this in the WebObjects framework. My hope is that someone familiar with WebObjects might have done this already and have some insi...
3,250
<p>Can anyone provide some real examples as to how best to keep script files for views, stored procedures and functions in a SVN (or other) repository.</p> <p>Obviously one solution is to have the script files for all the different components in a directory or more somewhere and simply using TortoiseSVN or the like to...
<p>Sounds like you're not wanting to use Revision Control properly, to me.</p> <blockquote> <p>Obviously one solution is to have the script files for all the different components in a directory or more somewhere and simply using TortoiseSVN or the like to keep them in SVN</p> </blockquote> <p>This is what s...
<p>You can always try integrating SourceSafe with SQL Server. Here's a quick start : <a href="http://msdn.microsoft.com/en-us/library/ms181089(VS.80).aspx" rel="nofollow noreferrer">link</a> . To work with it you've got to have Managment Studio Developers Edition.</p>
7,433
<p>In Ruby 1.8 and earlier,</p> <pre><code>Foo </code></pre> <p>is a constant (a Class, a Module, or another constant). Whereas</p> <pre><code>foo </code></pre> <p>is a variable. The key difference is as follows:</p> <pre><code>module Foo bar = 7 BAZ = 8 end Foo::BAZ # =&gt; 8 Foo::bar # NoMethodError: und...
<p>I don't know what ruby would do if you used extended UTF8 characters as identifiers in your source code, but I know what I would do, which would be to slap you upside the back of the head and tell you DON'T DO THAT</p>
<blockquote> <p>I would love to see</p> </blockquote> <pre><code>my_proc = λ { |...| ... } x ∈ my_enumerable # same as my_enumerable.include?(x) my_infinite_range = (1..∞) return 'foo' if x ≠ y 2.21 ≈ 2.2 </code></pre> <p>I would love to see someone trying to type that program on an English keyboard :P</p>
4,278
<p>Is this function declaration in C#:</p> <pre><code>void foo(string mystring) </code></pre> <p>the same as this one in C:</p> <pre><code>void foo(char *) </code></pre> <p>i.e. In C#, does the called function receive a pointer behind the scenes?</p>
<p>In this specific instance, it is more like:</p> <pre><code>void foo(const char *); </code></pre> <p>.Net strings are immutable and passed by reference. However, in general C# receives a pointer or reference to an object behind the scenes.</p>
<p>As far as I know, all classes in C# (not sure about the others) are reference types.</p>
9,028
<p>I'm looking for something like the <code>tempfile</code> module in Python: A (preferably) secure way to open a file for writing to. This should be easy to delete when I'm done too...</p> <p>It seems, .NET does not have the &quot;batteries included&quot; features of the <code>tempfile</code> module, which not only cr...
<p>I've also had the same requirement before, and I've created a small class to solve it:</p> <pre><code>public sealed class TemporaryFile : IDisposable { public TemporaryFile() : this(Path.GetTempPath()) { } public TemporaryFile(string directory) { Create(Path.Combine(directory, Path.GetRandomFileName()...
<p>I don't know of any built in (within the framework) classes to do this, but I imagine it wouldn't be too much of an issue to roll your own..</p> <p>Obviously it depends on the type of data you want to write to it, and the "security" required..</p> <p><a href="http://www.developerfusion.co.uk/show/3913/" rel="nofol...
4,048
<p>I want to start using Python for small projects but the fact that a misplaced tab or indent can throw a compile error is really getting on my nerves. Is there some type of setting to turn this off?</p> <p>I'm currently using NotePad++. Is there maybe an IDE that would take care of the tabs and indenting?</p>
<p>The answer is no.</p> <p>At least, not until something like the following is implemented:</p> <pre><code>from __future__ import braces </code></pre>
<p>Many Python IDEs and generally-capable text/source editors can handle the whitespace for you.</p> <p>However, it is best to just "let go" and enjoy the whitespace rules of Python. With some practice, they won't get into your way at all, and you will find they have many merits, the most important of which are:</p> ...
8,862
<p>I have a windows service that runs various system monitoring operations. However, when running <code>SNMP</code> related checks, I always get a <code>NullReference exception</code>. </p> <p>The code runs fine when run through the user interface (under my username and password), but always errors running as the se...
<p>Some ways to debug:</p> <ul> <li>Is there any additional information in the Windows events log?</li> <li>I believe you should be able to listen to some kind of global-exception event like Application_Exception in windows services. I can't remember the exact name but you can atelast dump stack trace from there.</li>...
<p>A couple of things we've seen - more about differences between interactive vs services, but might help...</p> <p>One thing we've seen that does not seem relevant is the difference with what is on the user vs system path. </p> <p>Another thing we've seen relates to temporary files - the service we had was creating ...
7,106
<p>How do you run an external program and pass it command line parameters using C? If you have to use operating system API, include a solution for Windows, Mac, and Linux.</p>
<p>It really depends on what you're trying to do, exactly, as it's:</p> <ol> <li>OS dependent</li> <li>Not quite clear what you're trying to do.</li> </ol> <p>Nevertheless, I'll try to provide some information for you to decide.<br> On UNIX, <code>fork()</code> creates a clone of your process from the place where you...
<p>If you need to check/read/parse the output of your external command, I would suggest to use popen() instead of system().</p>
3,785
<p>If you have Subversion installed on your development machine and you don't work in a team, is there any reason why you should use the <em>svn</em> protocol instead of <em>file</em>?</p>
<p>If you are working by yourself on a single machine, then in my experience using the file:// protocol works fine. Even when my team was using Subversion off a remote server, I would set up a local file-based repository for my own personal projects. If you get to the point where you need to access it from a different ...
<p>Even if working by myself ... my protocol is to <strong>always</strong> use source control even for personal projects. It gives you a single point of backup for all of your code work, and allows you to change your mind and/or retrieve older versions.</p>
5,255
<p>Should libraries that the application relies on be stored in source control? One part of me says it should and another part say's no. It feels wrong to add a 20mb library that dwarfs the entire app just because you rely on a couple of functions from it (albeit rather heavily). Should you just store the jar/dll or ma...
<p>store everything you will need to build the project 10 years from now.I store the entire zip distribution of any library, just in case</p> <p>Edit for 2017: This answer did not age well:-). If you are still using something old like ant or make, the above still applies. If you use something more modern like maven or...
<p>store everything you'll need to build the project, so you can check it out and build without doing anything.</p> <p>(and, as someone who has experienced the pain - please keep a copy of everything needed to get the controls installed and working on a dev platform. I once got a project that could build - but without...
7,167
<p>Carbon 3d made a 100x faster printer which has a simple and cheap mechanism using a Teflon layer. It appears to have a 20mn in RnD Costs and $7000 mass market production cost.</p> <p>The only access method for one is a USD$ 161,250 yearly subscription.</p> <p>Their printer is not available in shapeways... Is there...
<p>I will take the question seriously, and consider reasons why Carbon 3D might choose to offer their technology through a yearly subscription, rather than building a product accessible to the consumer market. These reasons are speculation and do not reflect any specific knowledge about Carbon 3D, the details of their...
<p>It looks like they have only one innovation: their resins. Everything else looks like standard SLA. </p> <p>All the things Carbon 3D are pitching on their website are more about having a dedicated support team than some fancy printer, and that's what they're selling. </p> <p>As to why they don't make a home versio...
667
<p>I've come back to using NHibernate after using other technologies (<a href="http://www.lhotka.net/" rel="nofollow noreferrer">CSLA</a> and <a href="http://subsonicproject.com/" rel="nofollow noreferrer">Subsonic</a>) for a couple of years, and I'm finding the querying a bit frustrating, especially when compared to S...
<p>The thing with LINQ for NHibernate is still in beta; I'm looking forward to NHibernate 2.1, where they say it will finally make the cut.</p> <p>I made a presentation on LINQ for NHibernate around a month ago, you might find it useful. I blogged about it here, including slides and code:</p> <p><a href="http://dotne...
<p>scrap nHibernate and go back to Subsonic if you can. In my opinion, Subsonic is a far more fluent and testable ORM/DAL. I absolutely hate HQL what's the point of a weakly typed query in an ORM? And why would I use Linq/nH/SQL when I can just use Linq to SQL and cut out a layer?</p> <p>nHibernate was a good ORM w...
6,500
<p>Some WPF controls (like the <code>Button</code>) seem to happily consume all the available space in its' container if you don't specify the height it is to have.</p> <p>And some, like the ones I need to use right now, the (multiline) <code>TextBox</code> and the <code>ListBox</code> seem more worried about just tak...
<p>There are also some properties you can set to force a control to fill its available space when it would otherwise not do so. For example, you can say:</p> <pre><code>HorizontalContentAlignment="Stretch" </code></pre> <p>... to force the contents of a control to stretch horizontally. Or you can say:</p> <pre><code...
<p>Use the <strong>HorizontalAlignment</strong> and <strong>VerticalAlignment</strong> layout properties. They control how an element uses the space it has inside its parent when more room is available than it required by the element.</p> <p>The width of a StackPanel, for example, will be as wide as the widest element...
5,677
<p>Let's say I have a list of server names stored in a vector, and I would like to contact them one at a time until one has successfully responded. I was thinking about using STL's find_if algorithm in the following way:</p> <pre><code>find_if(serverNames.begin(), serverNames.end(), ContactServer()); </code></pre> <p...
<p>I think I would go for it.</p> <p>The only thing I would worry about is the readability (and therefore maintainability) of it. To me, it reads something like "Find the first server I can contact", which makes perfect sense.</p> <p>You might want to rename <code>ContactServer</code> to indicate that it is a predica...
<p>Isn't that what <code>find_if</code> is for?</p> <p>Note though, that it will find <em>all</em> the servers, if you iterate over the iterator - but you aren't going to do that (according to OP).</p>
4,724
<p>I'm interested in grabbing the EPG data from DVB-T streams. Does anyone know of any C libraries or an alternative means of getting the data?</p>
<p>tv_grab_dvb can do this. See the <a href="http://www.darkskiez.co.uk/svn/tv_grab_dvb/trunk/" rel="nofollow noreferrer">subversion repository</a> for sources.</p> <p>tv_grab_dvb is made to work with the stream grabbed from the DVB-T card using <a href="http://sourceforge.net/projects/dvbtools/" rel="nofollow norefer...
<p>...a new answer to an old question:</p> <p>I wrote a utility called <code>dvbtee</code> that can be used as a c++ library, a cross-platform command line utility, or a node.js module.</p> <p>(despite it being a c++ library, one could still link to it from c code)</p> <p>The command line utility will parse your str...
8,146
<p>I'm working with a group at the MIT Launch startup accelerator for high school and I was hoping to do some market research regarding some of the current problems with desktop 3D printers. I was hoping to get some feedback from all your experience with 3D printing and the hours of troubleshooting you've likely encoun...
<p>First, regarding <strong>"Why do 3D Printers Suck?"</strong> - The answer is <strong>They Don't!</strong></p> <p>Every tool has its limitations and you need to work withing the limitations of the tool.</p> <p>Second, there are <strong>A LOT</strong> of different types/technologies, manufacturers, and price points ...
<p>First, regarding <strong>"Why do 3D Printers Suck?"</strong> - The answer is <strong>They Don't!</strong></p> <p>Every tool has its limitations and you need to work withing the limitations of the tool.</p> <p>Second, there are <strong>A LOT</strong> of different types/technologies, manufacturers, and price points ...
652
<p>I have a classic client/server (fat client and database) program written in Delphi 2006. When certain conditions are met in the client, I need to notify all the other clients very quickly. Up until now this has been done using UDP broadcasts, but this is no longer viable as clients now connect from outside the LAN a...
<p>The simple answer is that the standard protocols available in Delphi (and other tools) don't allow for notification in reverse. I looked into this for a project where I wanted to use SOAP. They all assume client asks server, server responds and that's it. </p> <p>For me, the solution was the RemObjects SDK. This al...
<p>You should be able to use Multicast UDP for the same purpose. The only difference will be to join the multicast group from every client.</p> <p><a href="http://en.wikipedia.org/wiki/IP_Multicast" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/IP_Multicast</a></p> <p><a href="http://en.wikipedia.org/wiki/In...
8,300
<p>Occasionally, on a ASP (classic) site users will get this error:</p> <pre><code>[DBNETLIB][ConnectionRead (recv()).]General network error. </code></pre> <p>Seems to be random and not connected to any particular page. The SQL server is separated from the web server and my guess is that every once and a while the "...
<p>Using the same setup as yours (ie separate web and database server), I've seen it from time to time and it has always been a connection problem between the servers - typically when the database server is being rebooted but sometimes when there's a comms problem somewhere in the system. I've not seen it triggered by ...
<p>I'd seen this error many times. It could be caused by many things including network errors too :).</p> <p>But one of the reason could be built-in feature of MS-SQL. </p> <p>The feature detects DoS attacks -- in this case too many request from web server :).</p> <p>But I have no idea how we fixed it :(.</p>
6,899
<p>Need some advice on working out the team velocity for a sprint.</p> <p>Our team normally consists of about 4 developers and 2 testers. The scrum master insists that every team member should contribute equally to the velocity calculation i.e. we should not distinguish between developers and testers when working out ...
<p>Since Agile development is about transparency and accountability it sounds like the testers should have assigned tasks that account for their velocity. Even if that means they have a task for surfing the web waiting for testing (though I would think they would be better served developing test plans for the dev team...
<p>Sounds to me like your system is working, just not as well as you'd like. Is this a paid project? If it is, you could make pay be a meritocracy. Pay people based on how much of the work they get done. This would encourage cross discipline work. Although, it might also encourage people to work on pieces that weren't ...
7,080
<p>I recently asked about <a href="https://stackoverflow.com/questions/39742/does-git-have-anything-like-svn-propset-svnkeywords-or-pre-post-commit-hooks">keyword expansion in Git</a> and I'm willing to accept the design not to really support this idea in Git. </p> <p>For better or worse, the project I'm working on at...
<p>What's going on here: Git is optimized to switch between branches as quickly as possible. In particular, <code>git checkout</code> is designed to not touch any files that are identical in both branches.</p> <p>Unfortunately, RCS keyword substitution breaks this. For example, using <code>$Date$</code> would require...
<p>You could set the ident attribute on your files, but that would produce strings like</p> <pre><code>$Id: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef$ </code></pre> <p>where <code>deadbeef...</code> is the sha1 of the blob corresponding to that file. If you really need that keyword expansion, and you need it in the gi...
8,763
<p>I'm packaging up a .NET 2.0 based web app for deployment through a Windows Installer based package. Our app uses Report Viewer 2008 and I'm including the Microsoft Report Viewer Redistributable 2008 installer. When I check the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e-bb5...
<p>Keep in mind that MSFT might be requiring the 3.5 Framework so they can write against it in future updates/releases, which might place your app in an unsupported (by MSFT) state.</p>
<p>If it works without a hitch then you don't need .NET 3.5 Framework for now. Installing .NET 3.5 Framework is easy enough to do along with later versions of your software <em>if and only if your software stops working at that point</em>.</p>
4,056
<p>I'm in an environment with a lot of computers that haven't been properly inventoried. Basically, no one knows which IP goes with which mac address and which hostname. So I wrote the following:</p> <pre><code># This script goes down the entire IP range and attempts to # retrieve the Hostname and mac address and outp...
<p>Today I also needed reverse DNS lookup and I've found very simple standard solution:</p> <pre><code>require 'resolv' host_name = Resolv.getname(ip_address_here) </code></pre> <p>It seems it uses timeout which helps in rough cases.</p>
<p>This also works:</p> <pre><code>host_name = Socket.getaddrinfo(current_ip,nil) append_to_file("#{host_name[0][2]} - #{current_ip} - #{mac_addr}\n") </code></pre> <p>I'm not sure why <code>gethostbyaddr</code> didn't also work.</p>
2,513
<p>I am wondering if there is a method or format string I'm missing in .NET to convert the following:</p> <pre><code> 1 to 1st 2 to 2nd 3 to 3rd 4 to 4th 11 to 11th 101 to 101st 111 to 111th </code></pre> <p><a href="http://www.dotnet-friends.com/fastcode/csharp/fastcodeincsc3bd4149-03d0-40fe-90fd-63bc...
<p>No, there is no inbuilt capability in the .NET Base Class Library.</p>
<p>I think the ordinal suffix is hard to get... you basically have to write a function that uses a switch to test the numbers and add the suffix.</p> <p>There's no reason for a language to provide this internally, especially when it's locale specific.</p> <p>You can do a bit better than that link when it comes to the...
9,466
<p>The surfaces of my printed parts using PLA plastic look rough and uneven.</p> <p>Would changing filament to a better one make any difference?</p> <p>If not, what kind of methods can I use to achieve a smoother finish for my for 3D-printed objects?</p>
<p><a href="https://en.wikipedia.org/wiki/Polylactic_acid">PLA</a> parts can be finished with a coat of epoxy like <a href="http://www.smooth-on.com/Epoxy-Coatings-XTC/c1397_1429/index.html">XTC-3D from Smooth-On</a>. This will smooth out the part and give it a pretty nice shine.</p> <p>I've also had a fair amount of ...
<p>It is called <strong>Acetone Finishing</strong></p> <p>Basically the 3D printed part stays in acetone vapor and the outer shell turns to smooth surface. I have heard that it works better with ABS. </p> <p>This article shows how <em>with videos</em>:</p> <ul> <li>(<a href="https://ultimaker.com/en/community/10412-...
89
<p>This is regarding the circuit of my 3D printer Tronxy X5SA's stepper motor for X axis.</p> <p><strong>I had an observation:</strong> It has a cooling fan (40X10 24V) which is having issues lately - it stops working sometimes, and when pushed to rotate, spins back.</p> <p><strong>Problem:</strong> Now one of the step...
<p>I think this is resolved. After looking at every conceivable source of over-extrusion and coming up negative, <code>R.. GitHub STOP HELPING ICE</code> suggested that it might be a mechanical problem in Z axis movement, like in <a href="https://3dprinting.stackexchange.com/questions/8022/first-3-mm-prints-poorly-then...
<p>I had the same problem with my Ender-3 V2.</p> <p>You need to check if the feeder bracket is square like explained in <a href="https://www.youtube.com/watch?v=xnzNd_FIMKY" rel="nofollow noreferrer">this YouTube</a></p> <p>If that is not the problem maybe you need a custom bracket to change the spacing between the Z-...
1,696
<p>Has anyone had a chance to dig into how <a href="http://blogs.msdn.com/andrewkennedy/archive/2008/08/20/units-of-measure-in-f-part-one-introducing-units.aspx" rel="noreferrer">F# Units of Measure</a> work? Is it just type-based chicanery, or are there CLR types hiding underneath that could (potentially) be used fro...
<p>According to a <a href="http://blogs.msdn.com/andrewkennedy/archive/2008/08/22/units-of-measure-in-f-part-two-unit-conversions.aspx#8920660" rel="noreferrer">response</a> on the next related blog post, they are a purely static mechanism in the F# compiler. So there is no CLR representation of the units data.</p> <p...
<p>The best (and I think official) place to find out about this is on Andrew Kennedy's blog.</p> <p>Here are the (current) relevant posts.</p> <ul> <li><a href="https://learn.microsoft.com/en-us/archive/blogs/andrewkennedy/units-of-measure-in-f-part-one-introducing-units" rel="nofollow noreferrer">Units of Measure in F...
6,211
<p>At the moment there are two tags related to fans:</p> <ul> <li><a href="https://3dprinting.stackexchange.com/questions/tagged/print-fan" class="post-tag" title="show questions tagged &#39;print-fan&#39;" rel="tag">print-fan</a></li> <li><a href="https://3dprinting.stackexchange.com/questions/tagged/fans" class="pos...
<p>There aren't that many topics labelled with either one of the existing tags, so re-tagging will not be a problem.</p> <p>Indeed these tags are generic tags and do not cover the range of fans specifically for the application they are used for. There are 3 types of applications for fans in 3D printers, </p> <ul> <li...
<p>3 tags is probably overly complex. I've not looked at the question list but I expect that these questions should also have a print quality or electronics tag, making the categorisation of the question fairly clear. The problem to me of having several tags is choosing which one would be relevant to a question, and al...
51
<p>Can anyone out there recommend a good online resource for CSS 'design patterns'?</p> <p>I know design patterns in a software context usually refer to OO based design patterns, but I mean design patterns in the broader sense of the term: i.e. common, clean solutions to common problems / tasks.</p> <p>An example of ...
<p><strong>Some websites that address web design patterns are listed below</strong>. They do not specifically provide the HTML and/or CSS in order to achieve the desired results, but they do provide examples of live sites that you can <em>view source</em> on (or, even better, use <a href="http://getfirebug.com/" rel="n...
<p>The already mentioned <a href="http://www.alistapart.com/" rel="nofollow noreferrer">A List Apart</a> is really good. Another site I've used since I started web development is SitePoint.com. Here is their <a href="http://reference.sitepoint.com/css" rel="nofollow noreferrer">CSS Reference</a>. If you want a good ...
5,616
<p>I am trying to print the 3 jaw lathe chuck on <a href="https://www.thingiverse.com/thing:624625" rel="nofollow noreferrer">Thingiverse</a>. This specific piece is the scroll.stl, but it applies on every big piece. The print material is (transparent) PLA, that I print on custom glass bed, which is heated by a regular...
<p>Several things I've done to stop warping when it occurred:</p> <ol> <li><p>Use a wider brim.</p></li> <li><p>If the brim isn't sticking, use a higher bed temperature for the first layer.</p></li> <li><p>If the brim comes up only on one side or warping is only on one side, make sure the bed is level. </p></li> <li>...
<p>Glass is tricky. Try using a glue stick. It makes the problem getting it off more than keeping it on. Magigoo and Aquanet also come highly recommended for glass. Another thing would be printing with a raft. Raft's stick pretty well, and most prints stick to a raft, and those prints won't lift. A third trick would be...
1,289
<p>I have scripts calling other script files but I need to get the filepath of the file that is currently running within the process. </p> <p>For example, let's say I have three files. Using <a href="http://docs.python.org/library/functions.html#execfile" rel="noreferrer">execfile</a>:</p> <ul> <li><code>script_1.py<...
<p>p1.py:</p> <pre><code>execfile(&quot;p2.py&quot;) </code></pre> <p>p2.py:</p> <pre><code>import inspect, os print (inspect.getfile(inspect.currentframe())) # script filename (usually with path) print (os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))) # script directory </code></pre>
<p>I used the approach with __file__<br> <code>os.path.abspath(__file__)</code><br> but there is a little trick, it returns the .py file when the code is run the first time, next runs give the name of *.pyc file<br> so I stayed with:<br> <code>inspect.getfile(inspect.currentframe())</code><br> or<br> <code>sys._getfr...
7,327
<p>What's the best way to implement a SQL script that will grant select, references, insert, update, and delete permissions to a database role on all the user tables in a database?</p> <p>Ideally, this script could be run multiple times, as new tables were added to the database. SQL Server Management Studio generates ...
<p>I'm sure there is an easier way, but you could loop through the sysobjects table in the database and grant permissions to any user table objects that exist. You could then run that multiple times whenever new tables are added.</p>
<p>We use something similar where I work. Looping through every Tables, Views, Stored Procedures of the system. </p> <pre><code>CREATE PROCEDURE dbo.SP_GrantFullAccess @username varchar(300) AS DECLARE @on varchar(300) DECLARE @count int SET @count = 0 PRINT 'Granting access to user ' + @username + ' on the fo...
6,654
<p>In the linux file system, where should user scripts be placed?</p> <p>I'm thinking specifically python scripts to be called by cron.</p>
<p>the information i got:</p> <pre><code>/usr/local/sbin custom script meant for root /usr/local/bin custom script meant for all users including non-root </code></pre> <p>chatlog snips from irc.debian.org #debian:</p> <pre><code>(02:48:49) c33s: question: where is the _correct_ location, to put custom scri...
<p>You can also add paths to your crontab file as shown in a <a href="https://stackoverflow.com/questions/13204/why-doesnt-my-cron-job-work-properly#13220">previous cron-related question</a>.</p>
3,595
<p>I've done some WPF programing and one thing I never got was the command pattern. Every example seems to be for built in ones, edit, cut, paste. Anyone have an example or suggestion of best practice for custom commands?</p>
<p>Ah ha! A question I can answer! Firstly, I should mention that I have personally found it easier to define and hook up commands in code rather than in XAML. It allows me to hook up the handlers for the commands a little more flexibly than an all XAML approach does.</p> <p>You should work out what commands you want ...
<p>The thing about XAML is that it is fine for 'simple' programs, but sadly, it doesn't work well when you want to do things like share functions. Say you have several classes and UI's all of which had commands that were never disabled, you'd have to write a 'CanAlwaysExecute' method for each Window or UserControl! Tha...
2,990
<p>I'm struggling to find the right terminology here, but if you have jQuery object...</p> <pre><code>$('#MyObject') </code></pre> <p>...is it possible to extract the base element? Meaning, the equivalent of this:</p> <pre><code>document.getElementById('MyObject') </code></pre>
<p>Yes, use <code>.get(index)</code>. According to the <a href="https://api.jquery.com/get/#get1" rel="nofollow noreferrer">documentation</a>:</p> <blockquote> <p>The <code>.get()</code> method grants access to the DOM nodes underlying each jQuery object.</p> </blockquote>
<p>A jQuery object is a set of elements. In your case, a set of one element. This differs from certain other libraries, which wrap single elements and provide alternate syntax for selectors that return multiple matches. </p> <p><em><a href="https://stackoverflow.com/questions/47837/getting-the-base-element-from-a-jque...
7,011
<p>Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the only* way in Silverlight...</p> <p>Or point to a library?</p> <p>I'm not concerned with rendering i'm wanting to manipulate a jpg before uploading.</p> <p>*There are no GDI+(S...
<p><a href="http://www.imagemagick.org/script/index.php" rel="nofollow noreferrer">ImageMagick</a> does a pretty good job. If you're ok with handing off editing tasks to your server...</p> <p>(Seriously? The recommended way of manipulating images in Silverlight is to work with <em>raw bytes</em>? That's... incredibly ...
<p>where is silverlight executed? Is there any reason at all to send an complete picture to the client to make the client crop it? Do it on the server... (if you are not creating an image editor that is..)</p>
5,769
<p>My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible?</p> <p>If it's not, how would you do it with POST? Just out of curiosity.</p> <p>Cheers!</p>
<p>You can actually do it all with GET methods. However, you'll want to use a full challenge response protocol for the logins. (You can hash on the client side using javascript. You just need to send out a unique challenge each time.) You'll also want to use SSL to ensure that no one can see the strings as they go ...
<p>Logging in securely is very subjective. Full 'security' is not easy to achieve (if at all possible...debatable). However, you can come close. </p> <p>If POST is not an option, maybe you can use a directory security method such as .htaccess or windows authentication depending on what system you're on.</p> <p>Both...
9,540
<p>I currently use nant, ccnet (cruise control), svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out. </p> <p>Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this easier?</p> <p><strong>Update: A...
<p>I like MSBuild. One reason is that .csproj files are msbuild files, and building in VS is just like building at the command line. Another reason is the good support from TeamCity which is the CI server I've been using. If you start using MSBuild, and you want to do more custom things in your build process, get th...
<p>I use MSBuild <em>alongside</em> Nant, because the current version of Nant can't as yet compile .NET 3.5 applications (same was true when .NET 2.0 first came out).</p>
3,183
<p>On my Vista machine I cannot install the .Net framework 3.5 SP1. Setup ends few moments after ending the download of the required files, stating in the log that: </p> <pre><code>[08/26/08,09:46:11] Microsoft .NET Framework 2.0SP1 (CBS): [2] Error: Installation failed for component Microsoft .NET Framework 2.0SP1 (C...
<p><a href="http://blogs.msdn.com/astebner/archive/2007/08/24/4548657.aspx" rel="nofollow noreferrer">Here is an article describing what might be your problem.</a></p>
<p>I also experienced it on my XP.</p> <p>I searched for it, and the result was that some kind of beta .NET remained on my PC.</p> <p>There is a <a href="http://blogs.msdn.com/astebner/archive/2005/04/08/406671.aspx" rel="nofollow noreferrer">tool to remove all</a> .NET framework from the system. I run it and after i...
4,731
<p>SQL:</p> <pre><code>SELECT u.id, u.name, isnull(MAX(h.dateCol), '1900-01-01') dateColWithDefault FROM universe u LEFT JOIN history h ON u.id=h.id AND h.dateCol&lt;GETDATE()-1 GROUP BY u.Id, u.name </code></pre>
<p>A solution, albeit one that defers handling of the null value to the code, could be:</p> <blockquote> <p>DateTime yesterday = DateTime.Now.Date.AddDays(-1);</p> </blockquote> <pre><code>var collection= from u in db.Universe select new { u.id, u.name, MaxDate =(DateTime?) ...
<p>This isn't a full answer for you, but on the left join piece you can use the DefaultIfEmpty operator like so:</p> <pre><code>var collection = from u in db.Universe join history in db.History on u.id = history.id into temp from h in temp.DefaultIfEmpty() where h.dateCol &lt; DateTime.Now.Date.AddDays(-1) select u.i...
2,325
<p>Are there SLA printable resins that can be printed with optical clarity and whose index of refraction make them potentially useful for optical applications? I would assume the surface may need polishing, and that's okay - I'm just asking whether the materials and process are otherwise suitable.</p>
<p>No, at least not at a consumer level. The layering created by the printing process would create imperfections, and clear resin frequently yellows if not cured properly and then protected form strong UV light. Resins that do not yellow tend to have a blue cast to them.</p> <p>You would be better off using a commercia...
<h1>Clear Resin isn't clear everywhere</h1> <p>Any light-curing resin has a specific bandwidth to which it is totally opaque just to be able to cure. This is typically a blue color, but at this and adjacent wavelength, the lens will not allow light to pass through it, no matter if you can manage to get imperfections do...
2,153
<p>To date I have used <a href="http://replicat.org/" rel="nofollow noreferrer">RepG</a> and <a href="https://www.repetier.com/" rel="nofollow noreferrer">Repetier with CuraEngine</a> to do my slicing. In various instances when printing a layer of a cylinder it will start in the middle and head out toward either side....
<p>I have seen this behavior a lot in CuraEngine slices. Mostly older versions of the slicer. Not sure if they actually improved it. You could see this a lot in long and complicated forms. I also don't like this. Not only for unnecessary moves, but also for imperfections due the start in the middle. Sometimes you can t...
<p>It doesn’t really have much of effect in the actual print. I’m pretty sure the setting can be modified either in the GUI or through gcode. Usually it’s just the standard process when filling in a flat surface. There could be some minor benefits that are quality related. But my main assumption would be for ironing if...
1,521
<p>Having read the threads <a href="https://stackoverflow.com/questions/60919/is-sqlcommanddispose-enough">Is SqlCommand.Dispose enough?</a> and <a href="https://stackoverflow.com/questions/23867/closing-and-disposing-a-wcf-service">Closing and Disposing a WCF Service</a> I am wondering for classes such as SqlConnectio...
<h3>I want to clarify this situation.</h3> <p>According to Microsoft guidelines, it's a good practice to provide <code>Close</code> method where suitable. <a href="https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern" rel="noreferrer">Here</a> is a citation from <a href="https://rads.stac...
<p>I just had an issue on net6 app using <code>TransactionScope</code>: I had multiple consequently created, opened and disposed connections, but was catching <code>This platform does not support distributed transactions</code> on completing scope (while clearly there were no distributed transactions).</p> <p>The issue...
8,622
<p>I'm interested in finding good icons/images that can be used in both 'free' and proprietary programs. </p> <p>Please include a description of any license restrictions associated with the source of the icons you suggest.</p>
<p>I use two search engines:</p> <p><a href="http://www.iconfinder.net/index.php?q=file" rel="noreferrer">IconFinder</a> and <a href="http://www.iconlook.com/search.icon?q=file&amp;s12=on&amp;s16=on&amp;s22=on&amp;s32=on&amp;s48=on&amp;s64=on&amp;s128=on" rel="noreferrer">IconLook</a>.</p> <p>If you can't find what y...
<p>I've had the best luck with <a href="http://www.iconbuffet.com" rel="nofollow noreferrer">Icon Buffet</a> and <a href="http://stockicons.com" rel="nofollow noreferrer">StockIcons</a></p>
7,025
<p>Does SQL Server 2008 ship with the .NET 3.5 CLR, so that stored procedures written in CLR can use 3.5 features?</p>
<p>Actually it ships with .NET 3.5 SP1. So yes, the stored procs can use 3.5 features and libraries.</p>
<p>I swear this isn't being pedantic, but is an important distinction -- I don't know what specifically you need when you say ".NET 3.5 CLR" -- probably the .NET 3.5 Framework? Possibly C# 3.0 language features? But the CLR that .NET 3.5 runs on <a href="http://msdn.microsoft.com/en-us/netframework/aa663314.aspx" rel...
3,255
<p>I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me.</p> <p>I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument</p> <p>I have 2 questions, the second regarding a workaround...
<p>VB.NET XML Literals are very powerful, but most often adding some LINQ to them makes them truly awesome. This code should do exactly what you're trying to do.</p> <pre><code>Dim Elements = New Dictionary(Of String, String) Elements.Add("Key1", "Value1") Elements.Add("Key2", "Value2") Elements.Add("Key3", "Value3") ...
<p>We would all be remiss not to mention that dynamic XML element names are generally a bad idea. The whole point of XML is to create a store a data structure in a form that is readily:</p> <ol> <li>Verifiable</li> <li>Extendable</li> </ol> <p>Dynamic element names fail that first condition. Why not simply use a stan...
7,379
<p>I've got a situation where I have a main form that pops up an advanced configuration form that just has half a dozen matched check boxes and combo boxes to select some advanced options (the check boxes to enable/disable, the combo to select a media if enabled).</p> <p>If I just pass the individual settings for the ...
<p>I personally would create a carrier object to store the values. You then get the nice intellisense for it, and changes to it would be quite straightforward. It would also be faster than dictionary lookups for parameter values. And of course, you get type safety. :)</p>
<p>Something like this should be good:</p> <pre><code>MyConfigurationDialog dialog = new MyConfigurationDialog(); //Copy the dictionary so that the dialog can't mess with our settings dialog.Settings = new Dictionary(existingSettings); if(DialogResult.OK == dialog.Show()) { //grab the settings that the dialog may ...
6,135
<p>Without the use of any external library, what is the simplest way to fetch a website's HTML content into a String?</p>
<p>I'm currently using this:</p> <pre><code>String content = null; URLConnection connection = null; try { connection = new URL("http://www.google.com").openConnection(); Scanner scanner = new Scanner(connection.getInputStream()); scanner.useDelimiter("\\Z"); content = scanner.next(); scanner.close(); }catch...
<p>Its not library but a tool named curl generally installed in most of the servers or you can easily install in ubuntu by </p> <pre><code>sudo apt install curl </code></pre> <p>Then fetch any html page and store it to your local file like an example </p> <pre><code>curl https://www.facebook.com/ &gt; fb.html </code...
5,139
<p>I have just bought my own 3D printer. However, I am now reading that there may be some safety risks to 3D printing. I will be taking some precautions, such as buying an enclosed 3D printer (the FlashForge Adventurer 3), using PLA instead of ABS, and putting my 3D printer in my garage. However, I am still concerned a...
<p>Technically, you should never leave your printer running unattended. Printer fires are rare, but it can happen, especially with cheap printers with poor quality control. Personally, I would just make sure that there is a fire alarm near by, so you'd be alerted if there was a fire.</p> <p>Also, the fumes concern is v...
<p>Install an overhead vent, like those you would have above your stove, to direct fumes and micro-filaments away from the area. You could alternatively use a box fan with a thin air filter attached to it, but the idea is to draw those fumes away from the room.</p>
1,893
<p>I am currently aware that ASP.NET 2.0 is out and about and that there are 3.x versions of the .Net Framework.</p> <p>Is it possible to upgrade my ASP.NET web server to version 3.x of the .Net Framework?</p> <hr> <p>I have tried this, however, when selecting which version of the .Net framwork to use in IIS (the AS...
<blockquote> <p>if I install 3.5 and have IIS setup to use 2.0. I will be able to use 3.5 features?</p> </blockquote> <p>Yes, that is correct. You have IIS set to 2.0 for both 2.0 and 3.5 sites, as they both run on the same CLR. 3.5 uses a different compile method than 2.0. This is declared in the web.config for the...
<p>The version you are selecting in IIS is the version of the CLR to use. There are only two versions of the CLR. The .NET Framework 3.5 runs on CLR 2.0</p>
2,662
<p>What are the alternative's to using the <a href="http://www.ithenticate.com" rel="nofollow noreferrer">iThenticate</a> service for content comparison?</p>
<p>Wikipedia page on <a href="http://en.wikipedia.org/wiki/Plagiarism_detection" rel="nofollow noreferrer">plagiarism detection</a> has a list of commercial and free services.</p>
<p>I generally recommend <a href="http://www.copyscape.com" rel="nofollow">Copyscape</a> and/or <a href="http://etest.vbi.vt.edu/etblast3/" rel="nofollow">eTBlast</a> if you choose not to use iThenticate. </p>
7,414
<p>A requirement for an ASP.Net 2.0 project I'm working on limits a certain field to a max of 10 words (not characters). I'm currently using a CustomValidator control with the following ServerValidate method:</p> <pre><code>Protected Sub TenWordsTextBoxValidator_ServerValidate(ByVal source As Object, ByVal args As Sys...
<p>You can use one of the builtin validators with a regex that counts the words.</p> <p>I'm a little rusty with regex so go easy on me:</p> <pre><code>(\b.*\b){0,10} </code></pre>
<p>I voted for mharen's answer, and commented on it as well, but since the comments are hidden by default let me explain it again:</p> <p>The reason you would want to use the regex validator rather than the custom validator is that the regex validator will also automatically validate the regex client-side using javasc...
7,583
<p>I have an ender 5, and I'm not certain that the bed is getting up to temperature. Or maybe I'm not understanding what it should be like when it gets up to temperature.</p> <p>If I use an infrared thermometer, where should I aim it, and what should it be saying in comparison to what the screen on the printer says?</p...
<h2>Sensor mounting</h2> <p>An Infrared Thermometer prefers a non-reflective surface to accurately read the temperature reliably - glass is reflective for Infrared light under many angles and can in the worst case result in measuring anything <em>but</em> what you want to measure. To that degree, a piece of paper tape ...
<p>The actual numerical reading doesn't really matter - as long as the first layer goes down, and stays down through the entire print.</p> <p>I've noticed that the center of the bed is ~2 degrees C under the set temp, and the edges could be 15 degrees low.</p> <p>So &quot;verify by effect&quot; - if the bed seems too c...
2,092
<p>What is the best way to copy a directory (with sub-dirs and files) from one remote Linux server to another remote Linux server? I have connected to both using SSH client (like Putty). I have root access to both. </p>
<p>There are two ways I usually do this, both use ssh:</p> <pre><code>scp -r sourcedir/ user@dest.com:/dest/dir/ </code></pre> <p>or, the more robust and faster (in terms of transfer speed) method:</p> <pre><code>rsync -auv -e ssh --progress sourcedir/ user@dest.com:/dest/dir/ </code></pre> <p>Read the man pages fo...
<p>As non-root user ideally:</p> <p>scp -r src $host:$path</p> <p>If you already some of the content on $host consider using rsync with ssh as a tunnel.</p> <p>/Allan</p>
9,479
<p>User equals untrustworthy. Never trust untrustworthy user's input. I get that. However, I am wondering when the best time to sanitize input is. For example, do you blindly store user input and then sanitize it whenever it is accessed/used, or do you sanitize the input immediately and then store this "cleaned" versio...
<p>Unfortunately, almost no one of the participants ever clearly understands what are they talking about. Literally. Only <a href="https://stackoverflow.com/a/36088/285587">Kibbee</a> managed to make it straight.</p> <p>This topic is all about sanitization. But the truth is, such a thing like wide-termed &quot;general ...
<p>I find that cleaning it immediately has two advantages. One, you can validate against it and provide feedback to the user. Two, you do not have to worry about consuming the data in other places.</p>
5,526
<p>I am starting to work on a hobby project with a <strong>Python</strong> codebase and I would like to set up some form of continuous integration (i.e. running a battery of test-cases each time a check-in is made and sending nag e-mails to responsible persons when the tests fail) similar to <strong>CruiseControl</stro...
<p>We run <a href="http://buildbot.net/trac" rel="noreferrer">Buildbot - Trac</a> at work. I haven't used it too much since my codebase isn't part of the release cycle yet. But we run the tests on different environments (OSX/Linux/Win) and it sends emails — and it's written in Python.</p>
<p>We are using <a href="http://bitten.edgewall.org/" rel="noreferrer">Bitten</a> wich is integrated with trac. And it's python based.</p>
2,295
<p>Say we have the following method:</p> <pre><code>private MyObject foo = new MyObject(); // and later in the class public void PotentialMemoryLeaker(){ int firedCount = 0; foo.AnEvent += (o,e) =&gt; { firedCount++;Console.Write(firedCount);}; foo.MethodThatFiresAnEvent(); } </code></pre> <p>If the class wit...
<p>Yes, save it to a variable and unhook it.</p> <pre><code>DelegateType evt = (o, e) =&gt; { firedCount++; Console.Write(firedCount); }; foo.AnEvent += evt; foo.MethodThatFiresAnEvent(); foo.AnEvent -= evt; </code></pre> <p>And yes, if you don't, you'll <em>leak</em> memory, as you'll hook up a new delegate object e...
<p>Yes in the same way that normal event handlers can cause leaks. Because the lambda is actually changed to:</p> <pre><code>someobject.SomeEvent += () =&gt; ...; someobject.SomeEvent += delegate () { ... }; // unhook Action del = () =&gt; ...; someobject.SomeEvent += del; someobject.SomeEvent -= del; </code></p...
3,720
<p>I'm setting up my first 3D Printer, a Prusa i3 MK2 clone. When I try to heat the bed, nothing happens. Then Marlin throws this error after a while: </p> <pre><code>Bed Heating Failed PRINTER HALTED Please reset </code></pre> <p>In Pronterface I see this in the console:</p> <pre><code>Error:Heating failed, syste...
<p>If you are sure that PID is enabled (and not using bang-bang heating, as this gives a very similar heating profile) and did not fix the fluctuations, the best guess for this phenomenon is that the printer board has incorrect capacitors installed on the printer board. This is not very uncommon and can be found on the...
<h1>Software</h1> <p>You might want to look at your firmware. When running a PID tune, the firmware decides on a smoothing.</p> <p>in Marlin, <code>configuration.h</code> contains a line that determines how much the machine shall try to work out the curves. For my ender 3 it reads:</p> <pre><code>#define PID_K1 0.95 ...
1,131
<p>How do I implement a Copy menu item in a Windows application written in C#/.NET 2.0?</p> <p>I want to let the user to mark some text in a control and then select the Copy menu item from an Edit menu in the menubar of the application and then do a Paste in for example Excel. </p> <p>What makes my head spin is how t...
<p>With the aid of some heavy pair programming a colleague of mine and I came up with this, feel free to refactor.</p> <p>The code is placed in the main form. The copyToolStripMenuItem_Click method handles the Click event on the Copy menu item in the Edit menu.</p> <pre><code> /// &lt;summary&gt; /// Recursive...
<p>It seems to me that you might be better off breaking this into smaller tasks/questions. You have a few issues you are stuck on from the way it sounds.</p> <p>You have multiple 'child' windows open. Is this an MDI application? When an action is performed on one of those child windows, it should fire an event in that...
8,826
<p>In Microsoft SQL Server, is there a way to detect whether a database has had its isolation level set via the T-SQL command <code>ALTER DATABASE &lt;database&gt; SET READ_COMMITTED_SNAPSHOT ON;</code>?</p> <p>I cannot find a simple way to detect this in either T-SQL or via the Management Studio's GUI.</p>
<pre><code>SELECT is_read_committed_snapshot_on FROM sys.databases WHERE name= 'YourDatabase' </code></pre> <p>Return value:</p> <ul> <li><strong>1</strong>: <code>READ_COMMITTED_SNAPSHOT</code> option is <strong>ON</strong>. Read operations under the <code>READ COMMITTED</code> isolation level are based on snapshot s...
<p>Neither on SQL2005 nor 2012 does <code>DBCC USEROPTIONS</code> show <code>is_read_committed_snapshot_on</code>:</p> <pre><code>Set Option Value textsize 2147483647 language us_english dateformat mdy datefirst 7 lock_timeout -1 quoted_identifier SET arithabort SET ansi_null_dflt_on SET ansi_warning...
7,521
<p>What is the best way to include an html entity in XSLT?</p> <pre><code>&lt;xsl:template match="/a/node"&gt; &lt;xsl:value-of select="."/&gt; &lt;xsl:text&gt;&amp;nbsp;&lt;/xsl:text&gt; &lt;/xsl:template&gt; </code></pre> <p>this one returns a <strong>XsltParseError</strong></p>
<p>You can use CDATA section</p> <pre><code>&lt;xsl:text disable-output-escaping="yes"&gt;&lt;![CDATA[&amp;nbsp;]]&gt;&lt;/xsl:text&gt; </code></pre> <p>or you can describe &amp;nbsp in local DTD:</p> <pre><code>&lt;!DOCTYPE xsl:stylesheet [ &lt;!ENTITY nbsp "&amp;#160;"&gt; ]&gt; </code></pre> <p>or just use <code...
<p> </p> <p>One space character between text tags should be enough.</p>
5,180
<p>Using VB.NET, how do I toggle the state of Caps Lock? </p>
<p>From: <a href="http://www.vbforums.com/showthread.php?referrerid=61394&amp;t=537891" rel="noreferrer">http://www.vbforums.com/showthread.php?referrerid=61394&amp;t=537891</a></p> <pre><code>Imports System.Runtime.InteropServices Public Class Form2 Private Declare Sub keybd_event Lib "user32" ( _ ByVal...
<p>I use this</p> <pre><code>Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer) Private Const KEYEVENTF_EXTENDEDKEY As Integer = &amp;H1 Private Const KEYEVENTF_KEYUP As Integer = &amp;H2 'put this where you want to turn caps lo...
8,339
<p>PERL? Perl? perl? What's good style?</p> <p>I know the answer&mdash;I just wanted to make sure the question was out there and questioners were aware that there is a correct form.</p>
<p>The correct casing is "Perl" for the language and "perl" for the executable. Using "PERL" flags you as someone who isn't particularly familiar with the language or community.</p> <p>See also <a href="http://perldoc.perl.org/perlfaq1.html#What%27s-the-difference-between-%22perl%22-and-%22Perl%22?" rel="noreferrer">W...
<p>perl or Perl is fine.</p>
9,796
<p>In <a href="https://web.archive.org/web/20141127115939/https://blogs.msmvps.com/kathleen/2008/09/05/in-praise-of-nested-classes/" rel="noreferrer">Kathleen Dollard's 2008 blog post</a>, she presents an interesting reason to use nested classes in .net. However, she also mentions that FxCop doesn't like nested classes...
<p>Use a nested class when the class you are nesting is only useful to the enclosing class. For instance, nested classes allow you to write something like (simplified):</p> <pre><code>public class SortedMap { private class TreeNode { TreeNode left; TreeNode right; } } </code></pre> <p>You can ...
<p>As <a href="https://stackoverflow.com/a/16093091/199154">nawfal</a> mentioned implementation of Abstract Factory pattern, that code can be axtended to achieve <a href="https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaEncyclopedia/ClassClusters/ClassClusters.html" rel="nofollow noreferrer...
7,128
<p>There is some documentation on the internet that shows that Windows changes the behavior of the NotifyIcon.BalloonTipShown command if the user is currently idle and this is <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=343411&amp;SiteID=1" rel="nofollow noreferrer">detected by checking for keyboard ...
<p>How about the Win32 <a href="http://www.codeproject.com/KB/cs/GetIdleTimeWithCS.aspx" rel="nofollow noreferrer">LASTINPUTINFO</a> function?</p> <pre><code>using System.Runtime.InteropServices; [DllImport("User32.dll")] static extern bool GetLastInputInfo(ref LASTINPUTINFO plii); struct LASTINPUTINFO { publi...
<p>Thanks for the responses, I ended up going with the GetLastInputInfo function as it is pretty straight forward to implement in the application I'm working on.</p>
3,966
<p>I've done this before in C++ by including sqlite.h but is there a similarly easy way in C#?</p>
<p><a href="https://www.nuget.org/packages/Microsoft.Data.Sqlite" rel="nofollow noreferrer">Microsoft.Data.Sqlite</a> by Microsoft has over 9000 downloads every day, so I think you are safe using that one.</p> <p>Example usage from <a href="https://learn.microsoft.com/dotnet/standard/data/sqlite/" rel="nofollow norefer...
<p>if you have any problem with the library you can use <code>Microsoft.Data.Sqlite;</code></p> <pre><code> public static DataTable GetData(string connectionString, string query) { DataTable dt = new DataTable(); Microsoft.Data.Sqlite.SqliteConnection connection; Microsoft.Da...
4,560
<p>I need to know how the performance of different XML tools (parsers, validators, XPath expression evaluators, etc) is affected by the size and complexity of the input document. Are there resources out there that document how CPU time and memory usage are affected by... well, what? Document size in bytes? Number of no...
<p>If I was faced with that problem and couldn't find anything on google I would probably try to do it my self.</p> <p>Some "back-of-an-evelope" stuff to get a feel for where it is going. But it would kinda need me to have an idea of how to do a xml parser. For non algorithmical benchmarks take a look here:</p> <ul>...
<p>I was planning to load extremely large XML files in my application. I asked the question here on Stack Overflow: <a href="https://stackoverflow.com/questions/264020/fastest-possible-xml-handling-in-delphi-for-very-large-documents">Fastest Possible XML handling for very large documents</a>.</p> <p>And yes, it was t...
5,172
<p>Are there any extruders and printers that do a good job with ceramic clay?</p> <p>I assume the clay has to be fine grained and with enough water added to be able to be pushed out through the extruder's nozzle. I also assume the print speed would have to be arther low for the already printed layers to gain stability...
<p>What you are looking for is the Frostruder style extruders.</p> <p>Here is a link to a <a href="http://www.thingiverse.com/thing:1143" rel="nofollow noreferrer">thingiverse file for it</a>.</p> <p>You honestly cannot expect fantastic results but it will get the job done! There are many other types. Quality will depe...
<p>I cant speak for the quality or type of clay, but there are several designs out there that print in clay. Here is the first one that popped up on my google search.</p> <p><a href="http://www.wasproject.it/w/en/wasp-launches-the-new-professional-clay-extruder/" rel="nofollow noreferrer">http://www.wasproject.it/w/en...
451
<p>Is it possible to use <a href="http://subversion.apache.org/" rel="noreferrer">Apache Subversion</a> (SVN) as general purpose backup tool? (As a kind of <a href="http://en.wikipedia.org/wiki/Rsync" rel="noreferrer">rsync</a> alternative.)</p>
<p>I found this article to be a pretty cool description of using svn to backup your home directory, and more:</p> <blockquote> <p>I use Subversion to backup my Linux boxes. With some minor creativity, it easily covers:</p> <ul> <li>Daily snapshots and offsite backup.</li> <li>Easy addition and removal of files and fold...
<p>I've used CVS as a substitute for ghost so I don't see why not.</p> <p>I'ts nice as you can tag a baseline: you can change manage machines.</p> <p>This works better on unixes than windows, obviously.</p>
8,720
<p>How do you get a Media Type (MIME type) from a file using Java? So far I've tried JMimeMagic &amp; Mime-Util. The first gave me memory exceptions, the second doesn't close its streams properly.</p> <p>How would you probe the file to determine its actual type (not merely based on the extension)?</p>
<p>In Java 7 you can now just use <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#probeContentType%28java.nio.file.Path%29" rel="noreferrer"><code>Files.probeContentType(path)</code></a>.</p>
<p>I did it with following code. </p> <pre><code>import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; public class MimeFileType { public static void main(String args[]){ try{ URL url = new URL ("h...
7,449
<p>I need a quick algorithm to select 5 random elements from a generic list. For example, I'd like to get 5 random elements from a <code>List&lt;string&gt;</code>.</p>
<p>Iterate through and for each element make the probability of selection = (number needed)/(number left)</p> <p>So if you had 40 items, the first would have a 5/40 chance of being selected. If it is, the next has a 4/39 chance, otherwise it has a 5/39 chance. By the time you get to the end you will have your 5 items, ...
<p>When N is very large, the normal method that randomly shuffles the N numbers and selects, say, first k numbers, can be prohibitive because of space complexity. The following algorithm requires only O(k) for both time and space complexities.</p> <p><a href="http://arxiv.org/abs/1512.00501" rel="nofollow">http://arxi...
7,044
<p>I’ve just brought my printer back out after a month and it’s first print created a solid block of resin about 1.5&nbsp;cm deep and the full width and length of the print bed. What could cause this?</p> <p>My only thought so far is that the FEP film / vat bed is looking a little cloudy even after cleaning. I wondere...
<p>Is the laser (or whatever light source it uses) visible? The cloudy film sounds like a good candidate for light diffusion and thus solidifying the entire resin, but if there are visible components to the light source it may help narrow it down.</p> <p>If it uses a projector ("LCD") solutions, it may also be that th...
<p>I had an issue with mine. I had a tiny hole that dripped some resin on the LCD screen. I scrapped it off as best I could but there were some serious printing problems on that side. I got a new LCD screen and replaced that and now print jobs that use to work are not printing solid blocks. I have no luck trying to re...
1,535
<p>Does anyone know of a powershell cmdlet out there for automating task scheduler in XP/2003? If you've ever tried to work w/ schtasks you know it's pretty painful.</p>
<p>Ok, Pablo has sparked my interest in saying that the scheduler is accessible via COM.</p> <p>In PowerShell you can do this:</p> <pre><code>$svc = new-object -com Schedule.Service </code></pre> <p>... and that gives you a handle to the task scheduler. You can see what members it has using:</p> <pre><code>$svc | g...
<p>@slipsec: I don't have access to a 2003 server to try, but googling "2003 server" SCHTASKS there are links related to questions about it. Perhaps you misspell the command? Like Matt says, you also can use AT, but in this case you don't have access to the scheduled tasks via the Control Panel, only via the AT command...
5,388
<p>How do I get it to work with my project?</p> <p><a href="http://ajax.asp.net/" rel="noreferrer">http://ajax.asp.net/</a></p> <p><a href="http://www.codeplex.com/AjaxControlToolkit/" rel="noreferrer">http://www.codeplex.com/AjaxControlToolkit/</a></p>
<p><strong>Install the ASP.NET AJAX Control Toolkit</strong></p> <ol> <li><p>Download the ZIP file AjaxControlToolkit-Framework3.5SP1-DllOnly.zip from the <a href="http://www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx?ReleaseId=16488" rel="noreferrer">ASP.NET AJAX Control Toolkit Releases</a> page of...
<p>you will also need to have a asp:ScriptManager control on every page that you want to use ajax controls on. you should be able to just drag the scriptmanager over from your toolbox one the toolkit is installed following Zack's instructions.</p>
6,131
<p>How does one automatically find categories for text based on content?</p>
<ol> <li>Read <strong><a href="http://www.cs.waikato.ac.nz/~ml/weka/book.html" rel="nofollow noreferrer">Data Mining: Practical Machine Learning Tools and Techniques</a></strong> - Ian H. Witten, Eibe Frank</li> <li>Use <strong><a href="http://www.cs.waikato.ac.nz/~ml/weka/" rel="nofollow noreferrer">Weka</a></strong>...
<p>There is a good paper written on this: <a href="http://www.cs.utexas.edu/users/hyukcho/classificationAlgorithm.html" rel="nofollow noreferrer">http://www.cs.utexas.edu/users/hyukcho/classificationAlgorithm.html</a></p>
9,122
<p>I need to 3D print several composites. The constituent materials are photopolymer resins. The composites are very similar to a Rubik's cube. Considering it that way, each voxel (every small piece of the Rubik's cube) is either entirely printed by material A or B.</p> <p>I have the binary files ready for the parts. M...
<p>It appears that your question is directed to solving the problem of converting your file of parameters to a 3D printable form. I'm far from an OpenSCAD wizard, but I suspect that your parameters file could be read into a properly coded OpenSCAD document to create the necessary STL to be printed.</p> <p>Your referenc...
<p>Stratasys industrial machines generally use proprietary software to prepare the print files for printing and don't use common slicers like Ultimaker Cura or Prusa-slicer.</p> <p>The software that is suggested by the manufacturer for both arranging and preparing prints on their machines of the Objet type is <a href="...
2,087
<p>.NET Framework: 2.0 Preferred Language: C#</p> <p>I am new to TDD (Test Driven Development).</p> <p>First of all, is it even possible to unit test Windows Service?</p> <p>Windows service class is derived from ServiceBase, which has overridable methods, </p> <ol> <li>OnStart </li> <li>OnStop</li> </ol> <p>How ca...
<p>I'd probably recommend designing your app so the "OnStart" and "OnStop" overrides in the Windows Service just call methods on a class library assembly. That way you can automate unit tests against the class library methods, and the design also abstracts your business logic from the implementation of a Windows Servi...
<p>Guy's probably the best answer.</p> <p>Anyway, if you really want to, you could just invoke in the unit test these two method as described by <a href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicebase%28v=VS.90%29.aspx" rel="nofollow">MSDN documentation</a> but, since they are protected, you...
6,355
<p>I have seen these being used every which way, and have been accused of using them the wrong way (though in that case, I was using them that way to demonstrate a <a href="http://blog.gadodia.net/extension-methods-in-vbnet-and-c/" rel="noreferrer">point</a>).</p> <p>So, what do you think are the best practices for em...
<p>The upcoming release of the Framework Design Guidelines, 2nd Edition will have some guidance for implementing extension methods, but in general:</p> <p>You should only define extension methods "where they make semantic sense" and are providing helper functionality relevant to every implementation.</p> <p>You also ...
<p>When I first found out about Extensions I really overused and abused them.</p> <p>For the most part I have started to get away from using any Extension Methods for a number of reasons.</p> <p>Some of the reasons I stopped using them are noted in Scott's blog link above, such as "Think twice before extending types ...
2,531
<p>When the print head changes direction, the printer must accelerate and decelerate the print head. When calibrated correctly, the printer is able to do this quickly and without causing the printer to shake too much, without drastically slowing down the print process.</p> <p>If I set it too high, my printer shakes vi...
<p>As Tom pointed out, binary search is the best way. In case that term isn't familiar to all readers, here's a little more detail:</p> <ol> <li><p>Establish an acceleration value that you're sure is too low (call it <span class="math-container">$L$</span>), and one that you're sure is too high (<span class="math-cont...
<p>Most printers use between 2000 and 5000 mm/s<sup>2</sup>.... extrusion moves are usually 2000 (on average, between different printers), travel is normally seen at 3000-5000, though for most lower end or duel direct drive extruder (heavy) printers, this value should be lower (some as low as 500-1000, some as high as ...
131
<p>I have a print I need to make holes in.<br> I have read some other threads where the answers was in short, "don't, print the holes", and "make sure to make the hole from the top or bottom".<br> The problem is I need the hole in the side of a print with about 1 mm walls. </p> <p>The holes I need is to run a USB ca...
<p>You're going to have to drill those holes. The plastic will melt if you drill too quickly. If at all possible, use a slow speed drill, a hand drill, or wrap a cloth around a drill bit and twist it with your hand. If you go too fast, the part will melt. If you press to hard the part will break.</p> <p>Once the hole ...
<p>As a follow up on this I wanted to post some pictures of the result with only the soldering iron.<br> I was soldering some cables and when it was still hot I figured I could give it a go. </p> <p>The hole is on the underside and in a closed compartment so it's not visible.</p> <p>Anyways, about 3 mm hole at this ...
1,442
<p>You write a function and, looking at the resulting assembly, you see it can be improved.</p> <p>You would like to keep the function you wrote, for readability, but you would like to substitute your own assembly for the compiler's. Is there any way to establish a relationship between your high-livel language functio...
<p>If you are looking at the assembly, then its fair to assume that you have a good understanding about how code gets compiled down. If you have this knowledge, then its sometimes possible to 'reverse enginer' the changes back up into the original language but its often better not to bother. </p> <p>The optimisations ...
<p>It depends on the language you wrote your function in. Some languages like C are very low-level, translating each function call or statement to specific assembly statements. If you did use C, you can replace your function with inline assembly to improve performance.</p> <p>Other high-level languages may convert e...
8,986
<p>Here's a perfect example of the problem: <a href="http://blog.teksol.info/2009/03/27/argumenterror-on-number-sum-when-using-classifier-bayes.html" rel="nofollow noreferrer">Classifier gem breaks Rails</a>.</p> <p>** Original question: **</p> <p>One thing that concerns me as a security professional is that Ruby doe...
<p>I don't think this is a concern.</p> <p>Yes, the mythical "somebody" can replace the implementation of MD5 with something insecure. But in order to do that, the mythical somebody must actually be able to get his code into the Ruby process. And if he can do that, then he presumably could also inject his code into a ...
<p>If someone monkeypatched an object or a module, then you need to look at 2 cases: He added a new method. If he is the only one adding this meyhod (which is very likely), then no problems arise. If he is not the only one, you need to see if both methods do the same and tell the library developer about this severe pr...
5,223
<p>To make things easier when switching between machines (my workstation at the office and my personal laptop) I have thought about trying an external hard drive to store my working directory on. Specifically I am looking at Firewire 800 drives (most are 5400 rpm 8mb cache). What I am wondering is if anyone has exper...
<p>It depends on the size of the project. The throughput is low and the latency is high, so you're going to get hit every which way, but due to the latency you'll be hit harder if you have a lot of little files rather than a few large ones.</p> <p>Have you considered simply carrying around a GIT or other distributed r...
<p>I use vmware and the virtual machines are on an external usb drive. Performance is fine. You might have some issues with the drive name changing - not an issue if you use virtual machines.</p>
8,263
<p>What techniques do you know\use to create user-friendly GUI ? </p> <p>I can name following techniques that I find especially useful: </p> <ul> <li>Non-blocking notifications (floating dialogs like in Firefox3 or Vista's pop-up messages in tray area)</li> <li>Absence of "Save" button<br> MS OneNote as an example.<...
<p>If you do give the user a question, don't make it a yes/no question. Take the time to make a new form and put the verbs as choices like in mac. </p> <p>For example:</p> <pre><code> Would you like to save? Yes No </code></pre> <p>Should Be:</p> <pre><code> Would you like to save? Save ...
<p>The best technique I found is to put your self in the users shoes. What would you like to see from the GUI and put that in front. This also gives you the ability to prioritize as those things should be done first then work from there.</p> <p>To do this I try to find "layers of usefulness" and add / subtract from th...
6,437
<p>I am trying to install VS2008 sp1 to my work machine - it has a pathetic 10Gb C drive. The SP1 bootstrapper doesn't give the option to install items to D, only C. It needs 3Gb free and the machine only has about 700Mb.</p> <p>VS allowed me to install to D originally why not the SP. The only thing I can think of tha...
<p>Worth a read:</p> <p><a href="http://blogs.msdn.com/heaths/archive/2008/07/24/why-windows-installer-may-require-so-much-disk-space.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/heaths/archive/2008/07/24/why-windows-installer-may-require-so-much-disk-space.aspx</a></p>
<p>You could also download the full VS2008 SP1 ISO image from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61&amp;displaylang=en" rel="nofollow noreferrer">here</a>.</p> <p>Then you can either burn it to DVD or use a tool such as <a href="http://download.microsoft...
3,016