instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>Which of the following is better code in c# and why?</p> <pre><code>((DateTime)g[0]["MyUntypedDateField"]).ToShortDateString() </code></pre> <p>or</p> <pre><code>DateTime.Parse(g[0]["MyUntypedDateField"].ToString()).ToShortDateString() </code></pre> <p>Ultimately, is it better to cast or to parse?</p>
<p>If g[0]["MyUntypedDateField"] is really a DateTime object, then the cast is the better choice. If it's not really a DateTime, then you have no choice but to use the Parse (you would get an InvalidCastException if you tried to use the cast)</p>
<p>As @Brian R. Bondy pointed it depends on implementation of <strong>g[0]["MyUntypedDateField"]</strong>. Safe practice is to use <strong>DateTime.TryParse</strong> and <strong>as</strong> operator. </p>
8,701
<p>I've recently had a need to do a bit of lisp editing and I found the nifty Ready Lisp package for OS X, which is great, except Aquamacs automatically uses a proportional font (which is idiotic, IMHO) and I want to change it to a monospace font. However, I'm not really much of an EMACS user, and the preferences menu ...
<p>This is what I have in my .emacs for OS X:</p> <pre><code>(set-default-font "-apple-bitstream vera sans mono-medium-r-normal--0-0-0-0-m-0-mac-roman") </code></pre> <p>Now, I'm not sure Bitstream Vera comes standard on OS X, so you may have to either download it or choose a different font. You can search the X font...
<p>Fast forward a decade, for recent Aquamacs like ver 3.3 please see the nice solution for setting a fixed-width by default at <a href="https://emacs.stackexchange.com/questions/45135/change-permanently-font-size-in-aquamacs">https://emacs.stackexchange.com/questions/45135/change-permanently-font-size-in-aquamacs</a><...
8,598
<p>Programming in vim I often go search for something, yank it, then go back to where I was, insert it, modify it.</p> <p>The problem is that after I search and find, I need to MANUALLY find my way back to where I was.</p> <p>Is there an automatic way to go back to where I was when I initiated my last search?</p>
<p><kbd>Ctrl</kbd>+<kbd>O</kbd> takes me to the previous location. Don't know about location before the search.</p> <p>Edit: Also, <kbd>`</kbd><kbd>.</kbd> will take you to the last change you made.</p>
<p>The simplest way is to set a mark, with <code>m[letter]</code>, then go back to it with <code>'[letter]</code></p>
7,747
<p>Every project invariably needs some type of reporting functionality. From a foreach loop in your language of choice to a full blow BI platform. </p> <blockquote> <p>To get the job done what tools, widgets, platforms has the group used with success, frustration and failure?</p> </blockquote>
<p>For knocking out fairly "run of the mill" reports, SQL Reporting Services is really quite impressive.</p> <p>For complicated analysis, loading the data (maybe pre-aggregated) into an Excel Pivot table is usually adequate for most users.</p> <p>I've found you can spend a lot of time (and money) building a comprehen...
<p>I'm the CTO at Windward and I do believe that <a href="http://www.windwardreports.com/" rel="nofollow">Windward Reports</a> is by far both the easiest to use and you can do more with it than any other reporting - and both traits are for the same reason, you design your reports in Word, Excel, &amp; PowerPoint.</p> ...
3,946
<p>I need to be able to quickly convert an image (inside a rails controller) so that the hosting company using managing our application can quickly test at any time to ensure that rmagick is not only successfully installed, but can be called throgh the rails stiack, what is the quickest clean code I can use to do this?...
<pre><code>require 'RMagick' image = Magick::Image.new(110, 30){ self.background_color = 'white' } image.write('/tmp/test.jpg') </code></pre>
<p>I'd log on to the server and try out your code in script/console. This will still go through the rails stack, but will allow you to quickly check that your code works the way you expect and that RMagick and ImageMagick are correctly installed without having to deploy anything.</p> <p>When the time comes to write y...
9,625
<p>I'm using the <a href="http://msdn.microsoft.com/en-us/library/ms178329.aspx" rel="nofollow noreferrer">ASP.NET Login Controls</a> and <a href="http://msdn.microsoft.com/en-us/library/aa480476.aspx" rel="nofollow noreferrer">Forms Authentication</a> for membership/credentials for an ASP.NET web application.</p> <p>...
<p>This works for me in Java 1.5 - I stripped out specific exceptions for readability.</p> <pre><code>import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import org.w3c.dom.Document; import java.io.ByteArrayInputStream; public Document loadXMLFromString(String xml) throws Except...
<p>To manipulate XML in Java, I always tend to use the Transformer API:</p> <pre><code>import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.stream.StreamSource; public sta...
5,330
<p>I've have observed that when the printer is finishing a layer, the flow of plastic through the nozzle starts fading out as it comes closer to the point of layer change.</p> <p>As an example, let's say that I'm printing the first layer of a cube. The nozzle first prints the perimeters ok. Then it begins to print the...
<p>If you think it is a slicing problem, look at the G-code. You might want to arrange for the infill to be orthogonal to the axes, but it ought to be easy enough to calculate the ratio between printhead motion and the extruder. G-code is just text, and fairly easy to make sense of. The <a href="http://reprap.org/wiki/...
<p>The Prusa Slic3r edition has <a href="http://manual.slic3r.org/expert-mode/fighting-ooze" rel="nofollow noreferrer">specific help references</a> in the manual that may be of value to you. One of the entries that catches my eye is the line marked "Retract on layer change" which appears to be just as you are describin...
795
<p>How does one convert an image from one color profile to another (screen to printer, or scanner to screen). In Visual C++ you would use the function in ICM.h, is there a managed way to do this with GDI+?</p> <p>I need to use GDI+, not WPF. I'd prefer to have a managed solution, but if it is not available, I guess ...
<p>There are a number of solutions.</p> <ol> <li>For GDI+, <a href="https://web.archive.org/web/20090224151626/http://support.microsoft.com/kb/317825/" rel="nofollow noreferrer">check out this article at MSDN</a> (HOW TO: Use GDI+ and Image Color Management to Adjust Image Colors).</li> <li>For WPF (.NET 3.0), see the ...
<p>You should take a look at <a href="http://www.littlecms.com/" rel="nofollow noreferrer">Lcms</a>. Its a colour management system, fairly complete, but written in C. you can use pinvoke, but I would recommend Managed C++ wrapper. I am actually currently working on a managed wrapper around the engine (just the basics,...
5,918
<p>Is there a way to implement a singleton object in C++ that is:</p> <ol> <li>Lazily constructed in a thread safe manner (two threads might simultaneously be the first user of the singleton - it should still only be constructed once).</li> <li>Doesn't rely on static variables being constructed beforehand (so the sing...
<p>Basically, you're asking for synchronized creation of a singleton, without using any synchronization (previously-constructed variables). In general, no, this is not possible. You need something available for synchronization.</p> <p>As for your other question, yes, static variables which can be statically initiali...
<p>I suppose saying don't do this because it's not safe and will probably break more often than just initializing this stuff in <code>main()</code> isn't going to be that popular.</p> <p>(And yes, I know that suggesting that means you shouldn't attempt to do interesting stuff in constructors of global objects. That's ...
2,860
<p>In SQL Server 2005 I have an "id" field in a table that has the "Is Identity" property set to 'Yes'. So, when an Insert is executed on that table the "id" gets set automatically to the next incrementing integer. Is there an easy way when the Insert is executed to get what the "id" was set to without having to do a S...
<p>In .Net at least, you can send multiple queries to the server in one go. I do this in my app:</p> <pre><code>command.CommandText = "INSERT INTO [Employee] (Name) VALUES (@Name); SELECT SCOPE_IDENTITY()"; int id = (int)command.ExecuteScalar(); </code></pre> <p>Works like a charm.</p>
<p>This is probably the best working solution I found for SQL Server.. <a href="https://stackoverflow.com/questions/17993606/sql-server-return-the-value-of-identity-column-after-insert-statement">Sql Server return the value of identity column after insert statement</a></p>
7,889
<p>How can I check <code>file permissions</code>, without having to run operating system specific command via <code>passthru()</code> or <code>exec()</code>?</p>
<p>Use <a href="http://php.net/fileperms" rel="noreferrer">fileperms()</a> function</p> <pre><code>clearstatcache(); echo substr(sprintf('%o', fileperms('/etc/passwd')), -4); </code></pre>
<p>What do you want to do by checking file permissions?</p> <p>When writing secure code, it's almost always incorrect to "check, then do" anything. The reason is that between the checking whether you can do something and actually doing it, the state of the system could change such that doing it would have a different...
3,995
<p>In a installation of WebSphere Application Server with Network Deployment, a node is:</p> <ol> <li>a physical machine</li> <li>an instance of operative system</li> <li>a logical set of WAS instances that is independent of physical machine or OS instance</li> </ol>
<p>Basically,<br> <br> A <b>server</b> is a runtime environment, a process of execution.<br> A <b>node</b> is a grouping of servers that share common configuration. It is a physical machine.<br> A <b>cell</b> is a grouping of nodes into a sigle administrative domain. For websphere, it mean that if you group several ser...
<p>A Cell is a virtual unit that is built of a Deployment Manager and one or more Nodes. A Node is another virtual unit that is built of a Node Agent and one or more Server instances.</p> <p><a href="http://itdevworld.wordpress.com/2009/05/03/websphere-concepts-cell-node-cluster-server/" rel="nofollow">Here</a> you ca...
2,677
<p>When using a browser to transform XML (Google Chrome or IE7) is it possible to pass a parameter to the XSLT stylesheet through the URL?</p> <p>example:</p> <p><strong>data.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;?xml-stylesheet type="text/xsl" href="sample.xsl"?&gt; &lt;root&g...
<p>You can generate the XSLT server-side, even if the transformation is client-side.</p> <p>This allows you to use a dynamic script to handle the parameter.</p> <p>For example, you might specify:</p> <pre><code>&lt;?xml-stylesheet type="text/xsl"href="/myscript.cfm/sample.xsl?paramter=something" ?&gt; </code></pre> ...
<p>You can generate the XSLT server-side, even if the transformation is client-side.</p> <p>This allows you to use a dynamic script to handle the parameter.</p> <p>For example, you might specify:</p> <pre><code>&lt;?xml-stylesheet type="text/xsl"href="/myscript.cfm/sample.xsl?paramter=something" ?&gt; </code></pre> ...
9,156
<p>Has anyone had any luck with printing multi-colored prints with the Palette 2 on an Ender 3? If so, what is your steps/mm for the Ender 3 and your flow rate in whatever slicer you are using? I currently have my flow rate at 100&nbsp;% and my steps/mm at 104.4, and I believe this is what is causing my Palette 2 to no...
<p>On this thread, <a href="https://support.mosaicmfg.com/hc/en-us/community/posts/360021788573-Does-anyone-tried-Palette-2-0-on-Creality-Ender-3-or-Ender-3-Pro-" rel="nofollow noreferrer">Does anyone tried Palette 2.0 on Creality Ender 3 or Ender 3 Pro?</a>, there are a couple of useful links:</p> <ul> <li><p>There i...
<p>The guide is at <a href="https://support.mosaicmfg.com/hc/en-us/articles/360011124234-Getting-Started-With-Palette-2-Setup-to-Printing-" rel="nofollow noreferrer">Getting Started With Palette 2 (Setup to Printing)</a>, which includes guides to use the correct slicer software and swapping <a href="https://support.mos...
1,269
<p>So, I was reading the Google testing blog, and it says that global state is bad and makes it hard to write tests. I believe it--my code is difficult to test right now. So how do I avoid global state?</p> <p>The biggest things I use global state (as I understand it) for is managing key pieces of information betwee...
<p>Dependency injection is what you're looking for. Rather than have those functions go out and look for their dependencies, inject the dependencies into the functions. That is, when you call the functions pass the data they want to them. That way it's easy to put a testing framework around a class because you can simp...
<p>An example of dependency injection in an MVC setting, here goes:</p> <p>index.php</p> <pre><code>$container = new Container(); include_file('container.php'); </code></pre> <p>container.php</p> <pre><code>container.add("database.driver", "mysql"); container.add("database.name","app"); </code></pre> <p>...</p> <...
6,611
<p>Which scenarios, areas of an application/system, etc. are best suited for 'classic' state based testing versus using mock objects?</p>
<p>You should be using mocks for dependencies. I don't think that its an either-or; Usually you will create mocks for dependencies, set expectations (whether it is calls or state) on them, then run the unit under test. Then you would check its state, and verify the expectations on the mocks, afterwards.</p>
<p>Its a matter of style.. Mockist vs Classic TDDers.<br> Personally.. I'd go testing real classes as far as possible. Tone down on Mocks as much as possible; only to decouple things like IO (filesystems, DB Connections, network), Third party components, etc. things that are slow/difficult to get under test. </p>
7,860
<ul> <li>What is it?</li> <li>How do I implement connection pooling with MS SQL?</li> <li>What are the performance ramifications when</li> <ul> <li>Executing many queries one-after-the other (i.e. using a loop with 30K+ iterations calling a stored procedure)?</li> <li>Executing a few queries that ...
<p>Connection pooling is a mechanism to re-use connections, as establishing a new connection is slow.</p> <p>If you use an MSSQL connection string and System.Data.SqlClient then you're already using it - in .Net this stuff is under the hood most of the time.</p> <p>A loop of 30k iterations might be better as a server...
<p>Your question was also partially answered by <a href="https://stackoverflow.com/questions/8223/connection-pooling-in-netmssql">this thread</a>. A search would have revealed this.. The definition of Connection Pooling, of which a <a href="http://www.google.com/search?q=connection+pooling" rel="nofollow noreferrer">Go...
3,063
<p>As I understand it, anything created with an <strong>alloc</strong>, <strong>new</strong>, or <strong>copy</strong> needs to be manually released. For example:</p> <pre><code>int main(void) { NSString *string; string = [[NSString alloc] init]; /* use the string */ [string release]; } </code></pre> ...
<p>Yes, your second code snippit is perfectly valid.</p> <p>Every time -autorelease is sent to an object, it is added to the inner-most autorelease pool. When the pool is drained, it simply sends -release to all the objects in the pool.</p> <p>Autorelease pools are simply a convenience that allows you to defer sendin...
<p>Yes and no. You would end up releasing the string memory but "leaking" the NSAutoreleasePool object into memory by using drain instead of release if you ran this under a garbage collected (not memory managed) environment. This "leak" simply makes the instance of NSAutoreleasePool "unreachable" like any other object ...
9,113
<p>We have an ASP.NET application that manages it's own User, Roles and Permission database and we have recently added a field to the User table to hold the Windows domain account. </p> <p>I would like to make it so that the user doesn't have to <strong>physically</strong> log in to our application, but rather would...
<p>I did pretty much exactly what you want to do a few years ago. Im trying to find some code for it, though it was at a previous job so that code is at home.</p> <p>I do remember though i used <a href="http://msdn.microsoft.com/en-us/library/ms998360.aspx" rel="nofollow noreferrer">this article</a> as my starting poi...
<p>You can use <code>System.Threading.Thread.CurrentPrincipal</code>.</p>
7,765
<p>Is it "acceptable" to have an <strong>ASP.Net 2.0</strong> application without the BLL (Business Logic Layer) as the following?</p> <ol> <li>SQL Server Data Storage &amp; Stored Procedures</li> <li>Data Link Layer (Strongly Typed Table Adapters) connecting to Stored Procs</li> <li>Presentation Layer ASPX Pages with...
<p>It's acceptable as long as you understand the consequences. The main reason you'd have a BLL is to re-use that logic elsewhere throughout your application.</p> <p>If you have all that validation logic in the presentation code, you're really making it difficult to re-use elsewhere within your application.</p>
<p>If the application is a general one, then the business logic layer can be used in complete other applications too. Like, I normally use my CMS related BLL classes in other applications.</p>
2,634
<p>I have a WPF application in VS 2008 with some web service references. For varying reasons (max message size, authentication methods) I need to manually define a number of settings in the WPF client's app.config for the service bindings.</p> <p>Unfortunately, this means that when I update the service references in t...
<p>Create a .Bat file which uses svcutil, for proxygeneration, that has the settings that is right for your project. It's fairly easy. Clicking on the batfile, to generate new proxyfiles whenever the interface have been changed is easy.</p> <p>The batch can then later be used in automated builds. Then you only need to...
<p>Somehow I prefer using svcutil.exe directly than to use the "Add Service Reference" feature of Visual Studio :P This is what we're doing on our WCF projects.</p>
9,445
<p>This question is related to <a href="https://stackoverflow.com/questions/43324/can-i-put-an-aspnet-session-id-in-a-hidden-form-field">this one</a>, though I think I was a little too long-winded there to really get a good answer. I'll keep this brief.</p> <p>I'm working on a web handler (ashx) that accepts a form po...
<p>I think you can do it be implementing the <a href="http://www.hanselman.com/blog/GettingSessionStateInHttpHandlersASHXFiles.aspx" rel="nofollow noreferrer">IReadOnlySessionState</a> interface on your HttpHandler</p>
<p>In an HttpHandler or HttpModule implementation, you cannot always access session from the BeginRequest event. There is another event you can handle, called OnAcquireRequestState. If you write your code in that event, then HttpContext.Current.Session will not be null.</p>
7,938
<p>I am trying to delete several rows from a MySQL 5.0.45 database:</p> <pre><code>delete from bundle_inclusions; </code></pre> <p>The client works for a while and then returns the error:</p> <pre><code>Lock wait timeout exceeded; try restarting transaction </code></pre> <p>It's possible there is some uncommitted t...
<p>I agree with Erik; TRUNCATE TABLE is the way to go. However, if you can't use that for some reason (for example, if you don't <em>really</em> want to delete every row in the table), you can try the following options:</p> <ul> <li>Delete the rows in smaller batches (e.g. DELETE FROM bundle_inclusions WHERE id BETWE...
<p>Guessing: truncate table bundle_inclusions</p>
9,026
<p>I'm interested in designing &amp; 3D printing as a hobby (e.g. printing chess sets, small toys for family etc.)</p> <p>Conducting a Google search has brought up a range of small, cheap printers, but beyond that I don't know how to differentiate them.</p> <p>E.g. selling points include:</p> <ul> <li>"liquid light-...
<p>Here are few things to consider from my point of view</p> <hr> <p><strong>Printing technology</strong></p> <p>The first thing that you need to take into account is printing technology. The most common[citation needed] right now is Fused Filament Fabrication. "Liquid light-sensitive resin" is being used in Stereol...
<p>One of the biggest questions you should ask yourself is: What is your end goal? </p> <ol> <li><p>Is it to get your printer and immediately print something (pre-assembled). </p></li> <li><p>Is it to learn about 3d printing by constructing a kit, encountering all kinds of potential issues getting it working, then onc...
122
<p>As one of those people that never got around to properly learning design (or having no talent for it), the design seems to be the step always holding me back. It's not a problem for rich-clients, as the standard GUI toolkits provide some acceptable ways to design a good-looking interface, but the web is another stor...
<p>Try the <a href="http://www.extjs.com/products/extjs/" rel="noreferrer">samples on ExtJs</a>. I find them immensely useful in working out the UI. (trees, panels, modals, etc etc)</p>
<p>Check out <a href="http://jacanasoftware.com" rel="nofollow noreferrer">http://jacanasoftware.com</a>. Their templates feature multi level tabs, clean css, it validates, and the CSS won't mess with your controls. I highly recommend them.</p>
6,972
<p>I am creating an application for a Windows Mobile computer. The catch is that the device (<a href="http://www.motorola.com/business/v/index.jsp?vgnextoid=d4397b103d175110VgnVCM1000008406b00aRCRD" rel="nofollow noreferrer">Motorola MC17</a>) does not have a touch screen or universal keys - there are only six programm...
<p>Last time I checked, you could use the <a href="http://developers.sugarcrm.com/tutorials/Customizing_Sugar/4/" rel="nofollow noreferrer">module builder</a> to extend the interface. From 5.0 (or maybe 4.x) on, Sugar added all those APIs, which should enable you to extend SugarCRM without hacking it in and losing it w...
<p>Basically, the Account name should be a related field in your new invoices module (base the module creation on something like QUOTES that has similar fields. Once you create the module (so simple you can almost guess your way through it in the ADMIN section) and the fields you like (using Studio) just add the RELATE...
5,856
<p>In an application that I'm writing I have some code like this:</p> <pre><code>NSWorkspace* ws = [NSWorkspace sharedWorkspace]; NSString* myurl = @"http://www.somewebsite.com/method?a=%d"; NSURL* url = [NSURL URLWithString:myurl]; [ws openURL:url]; </code></pre> <p>The main difference being that <em>myurl</em> co...
<p>I'm not sure if this is exactly what you're looking for, but there is a method in NSString that will sanitize a URL:</p> <p><a href="https://developer.apple.com/documentation/foundation/nsstring/1415058-stringbyaddingpercentescapesusin" rel="nofollow noreferrer">stringByAddingPercentEscapesUsingEncoding:</a></p>
<p>Unfortunately you need to be smarter than what is provided by Apple :</p> <pre><code>stringByAddingPercentEscapesUsingEncoding: </code></pre> <p>This will escape all invalid URL characters so that "http://foo.com/hey%20dude/", which is valid, becomes "http://foo.com/hey%2520dud/", which is not what we want. </p> ...
6,791
<p>Is it realistic or thought neccesary to develop a plugin/feature for this site, to automatically add a small info-box about a thingiverse link? An example of this is Apple's 3D touch technology. In theory, the plugin could recogize thingiverse links in questions and answers, replace the link with an image and the au...
<p>Typically, it's a better idea to wait before you try to get this kind of thing integrated.</p> <p>Enthusiasm is great in a private beta, but for the early stages, direct that enthusiasm towards the Q&amp;A. That's what'll get this site on its feet and into a successful public beta.</p> <p>When the site's more stab...
<h3>Technological issues</h3> <p>Stack Exchange works hard for its communities, but there is a limit. If thingiverse changes its API (which it can, and does, do at any time without notice) then anything we build on it has to be modified, and users will be very whiny until it's fixed.</p> <p>If we choose to integrate ...
6
<p>I have an application that displays an image inside of a Windows Forms <code>PictureBox</code> control. The <code>SizeMode</code> of the control is set to <code>Zoom</code> so that the image contained in the <code>PictureBox</code> will be displayed in an aspect-correct way regardless of the dimensions of the <code...
<p>Depending on the scaling, the relative image pixel could be anywhere in a number of pixels. For example, if the image is scaled down significantly, pixel 2, 10 could represent 2, 10 all the way up to 20, 100), so you'll have to do the math yourself and take full responsibility for any inaccuracies! :-)</p>
<p>Depending on the scaling, the relative image pixel could be anywhere in a number of pixels. For example, if the image is scaled down significantly, pixel 2, 10 could represent 2, 10 all the way up to 20, 100), so you'll have to do the math yourself and take full responsibility for any inaccuracies! :-)</p>
2,494
<p>I was trying to print parts for a small CD-ROM drive based plotter based on this thing <a href="https://www.thingiverse.com/thing:3521286" rel="nofollow noreferrer">https://www.thingiverse.com/thing:3521286</a></p> <p>But as tolerances are very small and need to match the existing parts, I realized that my printed ...
<p><a href="https://3dprinting.stackexchange.com/questions/6968/slicer-line-width-vs-extrusion-multiplier-for-layer-adhesion">You are not taking into account die swell</a>.</p> <p>When printing with a 3D printer hot plastic is forced through a nozzle, which leads to the expansion of the material. The result is, that w...
<p>There are several ways to try and adjust for this effect of squashing the material, which is ultimately about having enough space for the material you lay down.</p> <p>As mentioned: You can try to pre-scale models (not very effective as a general solution because it is a function of the model and how many adjacent ...
1,488
<p>How do I park a Bluetooth connection? I'm trying to communicate with dozens of Bluetooth devices, and the time to re-establish a connection is unacceptable. I've read that you can park connections, but not found anything that answers how to do this.</p>
<p>I know that you can park a connection if it's on the MS Bluetooth stack. There is a nice API you can use called 32feet.Net. It lets you set the socket options. Here's a quick link to the <a href="http://community.inthehand.com/library/InTheHand.Net.Bluetooth.BluetoothSocketOptionNameMembers.html" rel="nofollow noref...
<p>Parking mode is one of connected state mode, explained in the core Bluetooth spec, right from early 1.1 or so. Please follow up with various sniff modes as well, including the newer ones such as sniff sub rating. Other than park modes, you have hold modes as well.</p>
9,012
<p>The following code writes no data to the back buffer on Intel integrated video cards,for example, on a MacBook. On ATI cards, such as in the iMac, it draws to the back buffer. The width and height are correct (and 800x600 buffer) and m_PixelBuffer is correctly filled with 0xAA00AA00.</p> <p>My best guess so far is ...
<p>I've always had problems with OpenGL implementations from Intel, though I'm not sure that's your problem this time. I think you're running into some byte-order issues. Give this a read and feel free to experiment with different constants for packing and color order.</p> <p><a href="http://developer.apple.com/docume...
<blockquote> <p>I've always had problems with OpenGL implementations from Intel</p> </blockquote> <p>This is kind of what I'm worried about, but I have a hard time believing they'd screw up something as basic as glDrawPixels, and also, since I can "duplicate" the problem by changing the raster position vector, it ...
4,524
<p>I have a page with many forms in panels and usercontrols, and a requiredfield validator I just added to one form is preventing all of my other forms from submitting. what's the rule that I'm not following?</p>
<p>Are you using ValidationGroups? Try assigning each control with a validation group as well as the validator that you want to use. Something like:</p> <pre><code>&lt;asp:TextBox ID="txt1" ValidationGroup="Group1" ruant="server" /&gt; &lt;asp:RequiredFieldValidator ID="rfv1" ... ValidationGroup="Group1" /&gt; </cod...
<p>You should be setting ValidationGroup property to a different value for each group of elements. Your validator's ValidationGroup must only be same with the control that submit its form.</p>
5,564
<p>I've come across a few different applications that monitor my usage while on the computer, but what have you used, and like? whether it be writing down your activities in a composition notbook or install an app that reports silently to a server? what do you like?</p>
<p>For explicit time tracking for projects I use <a href="http://slimtimer.com" rel="nofollow noreferrer">SlimTimer</a>. I also run <a href="http://www.rescuetime.com/" rel="nofollow noreferrer">RescueTime</a> to track my time implicitly, but I end up not looking at that data very often.</p>
<p>I prefer writing the times down using pen and paper. That way you can more fairly weigh things that would have been miscalculated if you were recording them with a stopwatch or timer.</p> <p>If you start on something and have to get up for a few minutes, a timer may count that toward your working time had you negl...
9,893
<p>My Anet A8 frame are broken. I find frame project <a href="https://www.thingiverse.com/thing:2263216" rel="nofollow noreferrer">AM8 - Metal Frame for Anet A8</a>. I like it but I can't find aluminum extrusion needed, like this: <a href="https://us.misumi-ec.com/vona2/detail/110302684350/?Inch=0&amp;CategorySpec=0000...
<p>There are lots of online sources for T-slot aluminum extrusions from <a href="https://www.ebay.com/" rel="nofollow noreferrer">ebay</a> to <a href="https://www.mcmaster.com/#t-slotted-framing/=18c9twv" rel="nofollow noreferrer">McMaster</a>. If you want more options do a <a href="https://www.google.com/search?q=t-s...
<p>Not precisely cheap, but if you look on aliExpress for <em>AM8 3D Printer Extrusion Metal Frame</em> you will find kits build precisely for moving Anet A8 to aluminium frame</p>
643
<p>I have a database with names in it such as John Doe etc. Unfortunately some of these names contain quotes like Keiran O'Keefe. Now when I try and search for such names as follows:</p> <pre><code>SELECT * FROM PEOPLE WHERE SURNAME='O'Keefe' </code></pre> <p>I (understandably) get an error.</p> <p>How do I preven...
<p>The escape character is ', so you would need to replace the quote with two quotes.</p> <p>For example,</p> <p><code>SELECT * FROM PEOPLE WHERE SURNAME='O'Keefe'</code></p> <p>becomes</p> <p><code>SELECT * FROM PEOPLE WHERE SURNAME='O''Keefe'</code></p> <p>That said, it's probably incorrect to do this yourself. ...
<p>Found in under 30s on Google...</p> <p><a href="http://www.orafaq.com/wiki/SQL_FAQ#How_does_one_escape_special_characters_when_writing_SQL_queries.3F" rel="nofollow noreferrer">Oracle SQL FAQ</a></p>
4,944
<p>I want to take a screenshot via a python script and unobtrusively save it.</p> <p>I'm only interested in the Linux solution, and should support any X based environment.</p>
<p>This works without having to use scrot or ImageMagick.</p> <pre><code>import gtk.gdk w = gtk.gdk.get_default_root_window() sz = w.get_size() print "The size of the window is %d x %d" % sz pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,sz[0],sz[1]) pb = pb.get_from_drawable(w,w.get_colormap(),0,0,0,0,sz[0],sz[1...
<p>Try it:</p> <pre><code>#!/usr/bin/python import gtk.gdk import time import random import socket import fcntl import struct import getpass import os import paramiko while 1: # generate a random time between 120 and 300 sec random_time = random.randrange(20,25) # wait between 120 and 300 seconds (o...
9,499
<p>Since there are no header sections for user controls in asp.net, user controls have no way of knowing about stylesheet files. So css classes in the user controls are not recognized by visual studio and produces warnings. How can I make a user control know that it will relate to a css class, so if it is warning me ab...
<p>Here's what I did:</p> <pre><code>&lt;link rel="Stylesheet" type="text/css" href="Stylesheet.css" id="style" runat="server" visible="false" /&gt; </code></pre> <p>It fools Visual Studio into thinking you've added a stylesheet to the page but it doesn't get rendered.</p> <hr> <p>Here's an even more concise way to...
<p>You Can use <code>CSS</code> direct in <code>userControl</code>.</p> <p>Use this in <code>UserControl</code>:</p> <pre><code> &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;style type="text/css"&gt; .wrapper { margin: 0 auto -142px; /* the bottom margin is the negative value of the...
5,459
<h2>How do you find the phone numbers in 50,000 HTML pages?<br><br></h2> <blockquote> <h3>Jeff Attwood posted 5 Questions for programmers applying for jobs:</h3> <p>In an effort to make life simpler for phone screeners, I've put together this list of Five Essential Questions that you need to ask during an S...
<pre><code>egrep "(([0-9]{1,2}.)?[0-9]{3}.[0-9]{3}.[0-9]{4})" . -R --include='*.html' </code></pre>
<p>Here's why phone interview coding questions don't work: </p> <p>phone screener: how do you find the phone numbers in 50,000 HTML pages?</p> <p>candidate: hang on one second (covers phone) hey (roommate/friend/etc who's super good at programming), how do you find the phone numbers in 50,000 HTML pages?</p> <p>Sav...
7,118
<p>What code do you need to add in PHP to automatically have the browser download a file to the local machine when a link is visited?</p> <p>I am specifically thinking of functionality similar to that of download sites that prompt the user to save a file to disk once you click on the name of the software?</p>
<p>Send the following headers before outputting the file:</p> <pre><code>header("Content-Disposition: attachment; filename=\"" . basename($File) . "\""); header("Content-Type: application/octet-stream"); header("Content-Length: " . filesize($File)); header("Connection: close"); </code></pre> <p><a href="https://stack...
<p>my code works for txt,doc,docx,pdf,ppt,pptx,jpg,png,zip extensions and I think its better to use the actual MIME types explicitly.</p> <pre><code>$file_name = "a.txt"; // extracting the extension: $ext = substr($file_name, strpos($file_name,'.')+1); header('Content-disposition: attachment; filename='.$file_name);...
6,221
<p>In my specific example, I'm dealing with a drop-down, e.g.:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select name="foo" id="bar"&gt; &lt;option disabled=...
<p>The HTML specs are a bit vague (ie. completely lacking) with regard to this odd combination. They do say that a form element with the disabled attribute set should not be successful, so it really <em>can't</em> be selected.</p> <p>The browser may well render it so that it looks selected, but it shouldn't show up in...
<blockquote> <p>Are we just ruling out 'onchange' drop downs altogether, or should the "select..." option be selectable, just with no effect?</p> </blockquote> <p>"onchange" drop-downs are frowned upon by more standards-obsessed types.</p> <p>I would typically do some client-side validation. "Please select an...
7,239
<ol> <li>You have multiple network adapters.</li> <li>Bind a UDP socket to an local port, without specifying an address.</li> <li>Receive packets on one of the adapters.</li> </ol> <p>How do you get the local ip address of the adapter which received the packet?</p> <p>The question is, "What is the ip address from the...
<p>You could enumerate all the network adapters, get their IP addresses and compare the part covered by the subnet mask with the sender's address.</p> <p>Like:</p> <pre><code>IPAddress FindLocalIPAddressOfIncomingPacket( senderAddr ) { foreach( adapter in EnumAllNetworkAdapters() ) { adapterSubnet = a...
<pre> ssize_t recvfrom(int socket, void *restrict buffer, size_t length, int flags, struct sockaddr *restrict address, socklen_t *restrict address_len); ssize_t recvmsg(int socket, struct msghdr *message, int flags); [..] If address is not a null pointer and the socket is not connection-o...
4,975
<p>I have seen some photos of aluminum based Prusa i3 printers, and I like to know the numbers and the specs of the profiles? Also I want to know Is the first pic strong enough for reliable printer or I must use the second(respect to profiles I mean).</p> <p><a href="https://i.stack.imgur.com/JcgdB.jpg" rel="noreferre...
<p>They are 2020 (20mm x 20mm) T-slot extrusions. They should not be confused with V-slot extrusions, which are similar to T-slot, but have a 45-degree slot profile to accommodate V-slot wheels.</p> <p>If you are contemplating a new build, I would recommend using V-slot. Note that T-slot and V-slot come in a number of...
<p>It can really depend on where you are in the world. A few years ago, I was unable to obtain standard V-slot (&amp; T-nut) 2020 extrusion, at a reasonable price, and so I ended up using an extrusion from a local supplier instead, and managed to obtain 6&nbsp;m of extrusion for only $15!</p> <p>My aluminium extrusion...
750
<p>How do you resolve a domain name to an IP address with .NET/C#?</p>
<pre><code>using System.Net; foreach (IPAddress address in Dns.GetHostAddresses("www.google.com")) { Console.WriteLine(address.ToString()); } </code></pre>
<p>Try using the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.net.dns" rel="nofollow noreferrer">System.Net.Dns</a> class</p>
2,679
<p>Am looking for a regression test framework where I can add tests to.. Tests could be any sort of binaries that poke an application..</p>
<p>This really depends on what you're trying to do, but one of the features of the new <a href="http://search.cpan.org/dist/Test-Harness/" rel="nofollow noreferrer">Test::Harness</a> (disclaimer: I'm the original author and still a core developer) is that if your tests output TAP (the Test Anything Protocol), you can u...
<p>You did not indicate what language you are working in, but the xUnit family is available for a lot of different languages.</p> <p>/Allan</p>
9,505
<p>I am using Cura for slicing, and OctoPrint for the actual printing.</p> <p>On small pieces with roughly one square cm of surface area prints over about 6&nbsp;mm have a risk of coming off at 60&nbsp;&deg;C.</p> <p>In fact, I have had to use 71&nbsp;&deg;C so it stick properly. However, I don't want the print bed ...
<p><strong>The actual problem you are facing is bed adhesion</strong>, the proposed solution (in your question) shouldn't be the preferred solution to get your parts to stick to the plate/glass as plastic shrinks as it cools down. Note that a 5&nbsp;&deg;C temperature drop after the first layer usually isn't a problem,...
<ul> <li>You can manually edit the file. Look for the line that has the Z height of your choice, and insert the temp change g-code right above it.</li> <li>Upgrade to a real slicer like Simplify3D with has an options to set a heater temp at different layers.</li> <li>Preheat the bed before you print, then print with a ...
1,549
<p>We've been developing a windows based application using Java for a while now, but NOW we want to make a mac port and have to reverse of code from Java 6 and Java 5. Is there any easy way to do this rather than re-coding Java 6 specific code? We'd like to keep our code up to date.</p>
<p>Apple released Java 6 on the latest version of OS X. What features are you using specifically from Java6 that aren't in java5? </p>
<p>You might be able to backport the additional libraries from Java 6 to Java 5, but I imagine it would be rather more trouble that it's worth. Intel Macs with 64-bit processors (so not the original Intel Mac Mini) running Leopard have Java 6, so perhaps you could just target them?</p>
3,862
<p>Suppose that I have a form that contains three 10 fields: field1..field10. I store the form data in one or more database tables, probably using 10 database columns. </p> <p>Now suppose a few months later that I want to add 3 more fields. And in the future I may add/delete fields from this form based on changing...
<p>You could abstract fields to a separate table so that they are many-to-many to the Form table:</p> <h2>Form</h2> <p><strong>ID</strong><br/> Name<br/> etc.</p> <h2>Field</h2> <p><strong>ID</strong><br/> Label<br/> Value</p> <h2>FormField</h2> <p><strong>FormID</strong><br/> <strong>FieldID</strong></p>
<p>My team came up with a solution for this when I worked for Quest Computing on AIMS (www.totalaims.com). In summary we added maintenance screens that allowed the administrator to add metadata and also as a result add fields to the database in certain tables. The fields were also added to their own maintenance and ...
5,214
<p>When modelling for 3D printing, can I distinguish somehow the type of infill in various areas of the model? Say there may be some areas in the model where I want 100% infill (maximum strength) but some areas where the infill can be less (maybe 25%).</p> <p>I am new to 3D printing, doing my first model (enclosure fo...
<p>To achieve additional localised stiffness, you can also insert small voids (gaps) inside the model. These become double thickness walls once sliced and can be used to support things like screw holes.</p> <p>See the 'negative' parts used with a cube, and the sliced result here: <a href="https://i.stack.imgur.com/eUL...
<p>I found out I misunderstood some principles of designing/modelling for 3D printing.</p> <p>I designed my object for 100% infill which is not really necessary. It turned out that one does not mostly have to take care of the infill % and just model the object for example as solid 3D cube and the printing service will...
1,050
<p>I've got an interesting design question. I'm designing the security side of our project, to allow us to have different versions of the program for different costs and also to allow Manager-type users to grant or deny access to parts of the program to other users. Its going to web-based and hosted on our servers.</...
<p>If it's only going to be Allow/Deny, then a simple linking table between Users and Resources would work fine. If there is an entry keyed to the User-Resource in the linking table, allow access.</p> <pre><code>UserResources ------------- UserId FK-&gt;Users ResourceId FK-&gt;Resources </code></pre> <p>and the sql ...
<p>B. It allows for much better checks whether the data is complete (for example, when you add an allowable/deniable feature).</p> <p>Also, table size should only be a consideration for tables that you know will contain many records (as in, 100,000+). You even taking the time to type the table size consideration into ...
4,338
<p>I'm going to be implementing a <code>PHP/mySQL</code> setup to store credit card information.</p> <p>It seems like <code>AES_ENCRYPT/AES_DECRYPT</code> is the way to go,</p> <p><strong>but I'm still confused on one point:</strong></p> <p><strong>How do I keep the encryption key secure?</strong></p> <p>Hardwiring it ...
<p>You should think long and hard about whether you REALLY need to keep the CC#. If you don't have a great reason, DON'T! Every other week you hear about some company being compromised and CC#'s being stolen. All these companies made a fatal flaw - they kept too much information. Keep the CC# until the transaction clea...
<p>I agree, but don't the cc if you don't need too. But if you really have too, make sure the file that have it is not accessible on the web. You can write a binary that would return the key. This way it's not store in clear text. But if your server is compromise it's still easy to get it. </p>
7,947
<p>I'm trying to figure out how to detect the type of credit card based purely on its number. Does anyone know of a definitive, reliable way to find this?</p>
<p>The credit/debit card number is referred to as a <strong>PAN</strong>, or <em>Primary Account Number</em>. The first six digits of the PAN are taken from the <strong>IIN</strong>, or <em>Issuer Identification Number</em>, belonging to the issuing bank (IINs were previously known as BIN — Bank Identification Numbers...
<p>The regular expression rules that match the <a href="http://www.techrecite.com/credit-card-validation-regex-script-in-php-using-luhn-algorithm/" rel="nofollow">respective card vendors</a>:</p> <ul> <li><code>(4\d{12}(?:\d{3})?)</code> for VISA.</li> <li><code>(5[1-5]\d{14})</code> for MasterCard.</li> <li><code>(3[...
9,836
<p>I have a 3018 Pro CNC and being trying cutting a contour of a simple circular part:</p> <p><a href="https://i.stack.imgur.com/w3mDe.png" rel="nofollow noreferrer" title="Screenshot of Fusion 360 model and route"><img src="https://i.stack.imgur.com/w3mDe.png" alt="Screenshot of Fusion 360 model and route" title="Scre...
<p>I've ran the code on my own CNC machine. I slightly adapted the code as my machine doesn't understand the movement without the instruction code:</p> <pre><code>Z1 F10.0 Z-2.9 X10.792 Z-2.938 F10.0 X10.771 Z-2.971 X10.738 Z-2.992 X10.7 Z-3 X10.6 X10.562 Y0.092 X10.529 Y0.071 X10.508 Y0.038 X10.5 Y0 </code></pre> <p>i...
<p>Parts of the circle are at different heights. When I rendered your 30 or so actual G1 and G2 lines, here's what I got. It looks like a circle from above, but form the sde you can see depth changes. What are those coordinate lines with no G0 ot G1 or G2 or G3 command for?</p> <p><a href="https://i.stack.imgur.com/fbV...
2,081
<p>How can I vary the infill percentage for different layer heights of my model?</p> <p>Context: The bottom part of my model needs about 20% infill. The geometry of the top part of the model (mostly cones of various sizes) prints well with 0% infill and is of course a lot faster to print if I can specify this.</p>
<p><em>Your question is very similar to <a href="https://3dprinting.stackexchange.com/questions/6522/different-infill-in-the-same-part">Different infill in the same part</a> and <a href="https://3dprinting.stackexchange.com/questions/7019/using-multiple-infill-types-within-one-model">Using multiple infill types within ...
<p>Let's assume the model is 75mm high; the bottom portion (which needs 20% infill) is 40mm, and the top portion (which needs 0% infill) is 35mm.</p> <ul> <li>Load your model into Slic3r.</li> <li>Be sure your default fill is 20%.</li> <li>Right click on the model, and select Settings.</li> <li>Click "Load Generic".</...
1,051
<p>I'm trying to use Groovy to create an interactive scripting / macro mode for my application. The application is OSGi and much of the information the scripts may need is not know up front. I figured I could use GroovyShell and call eval() multiple times continually appending to the namespace as OSGi bundles are loade...
<p>I am not sure about what you mean about declared classes not existing between evals, the following two scripts work as expected when evaled one after another:</p> <pre><code>class C {{println 'hi'}} new C() </code></pre> <p>... </p> <pre><code>new C() </code></pre> <p>However methods become bound to the class th...
<p>This might be what you are looking for?</p> <p>From <a href="https://rads.stackoverflow.com/amzn/click/com/1932394842" rel="nofollow noreferrer" rel="nofollow noreferrer">Groovy in Action</a></p> <pre><code>def binding = new Binding(x: 6, y: 4) def shell = new GroovyShell(binding) def expression = '''f = x * y''' ...
6,751
<p>I have an absolutely positioned <code>div</code> that I want to show when the user clicks a link. The <code>onclick</code> of the link calls a js function that sets the display of the div to block (also tried: "", <code>inline</code>, <code>table-cell</code>, <code>inline-table</code>, etc). This works great in IE7,...
<p>Since setting the properties with javascript never seemed to work, but setting using Firebug's inspect did, I started to suspect that the javascript ID selector was broken - maybe there were multiple items in the DOM with the same ID? The source didn't show that there were, but looping through all divs using javasc...
<p>There is an annoying display error on Firefox 3.5 but not on IE7 or Firefox 2.0.9</p> <p>I have 3 DIV's position absolute - the first with plain text; the second with a CSS menu (sucklefish type with UL and LI) and the third ditto. The third will not display at all even though the coding has been checked and found...
3,159
<p>I'm developing a WinForms application (.Net 3.5, no WPF) where I want to be able to display foreign key lookups in a databound DataGridView. </p> <p>An example of the sort of relationship is that I have a table of OrderLines. Orderlines have a foreign key relationship to Products and Products in turn have a foreig...
<p>I think the problem you're having is that when you are binding to a grid, it is not enough to support INotifyPropertyChanged, but you have to fire the ListChanged events in your <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.ibindinglist.aspx" rel="nofollow noreferrer">IBindingList</a> implem...
<p>Here's a good "How Do I" video that demonstrates data binding:</p> <p><a href="http://windowsclient.net/learn/video.aspx?v=52579" rel="nofollow noreferrer">http://windowsclient.net/learn/video.aspx?v=52579</a></p>
4,933
<p>Say you have an entity like a vehicle that you are capturing detailed information about. The car you want to capture is painted red, black and white. The front tires are Bridgestone 275/35-18 and the rear tires are 325/30-19. And sometimes you can have just two tires (yes this would be considered a motorcycle which ...
<p>If it's a possibility for your app, you might want to look into <a href="http://incubator.apache.org/couchdb/" rel="nofollow noreferrer">couchdb</a>.</p>
<p>You're describing a <a href="http://en.wikipedia.org/wiki/Star_schema" rel="nofollow noreferrer">Star Schema</a>. I think its fairly standard practice in your kind of case</p> <p>Edit: Actually your schema is slightly modified from the Star Schema, you use the primary key of the fact table in each of the dimensio...
9,147
<p>I am implementing a quite simple state-machine order processing application. It is a e-commerce application with a few twists. The users of the application will not be editing workflows by themselves.</p> <p>Microsoft claims that asp.net and Windows Workflow is possible to combine. How hard is it to install and mai...
<p>Asp.net and WF get along just fine, and WF doesn't add much maintenance overhead.</p> <p>Whether or not this is the right design for you depends a lot on your needs. If you have a lot of event driven actions then WF might be worthwhile, otherwise the overhead of rolling your own tracking would probably add less com...
<p>If your state machine is very simple, then I would say that you should just roll your own. You have more control over everything. You can deal with persistence on your own terms and not worry about how they do it.</p> <p>WF does look pretty cool though, but I think that it's power probably lies in the fact that i...
9,269
<p>Occasionally, while printing, my <em>y</em> axis will slip and the layer will, from that point forward, be shifted, ruining the print.</p> <p>What might be the causes of an axis slipping? I have tried cooling the motor which seemed to have been getting warm, and the belts are not too tight.</p> <p>This does not ha...
<p>In my experience, the most common reason for positional offset during printing, is the <em>motor skipping steps due to physical impact</em>. </p> <p>Your stepper motors do not give <em>positional feedback</em> to your printer. So, if you forcefully move your motor during print, then the printer will not notice, and...
<p>My Y axis runs on a channel and I believe there was some grit or metal flakes in the channel left over from manufacturing. The wheels in the channel got stuck on the debris and caused the belt to slip. It made a horrible grinding noise when this happened.</p> <p>So I blew out the channel with pressurized air and te...
184
<p>I've created a model for executing worker tasks in a server application using a thread pool associated with an IO completion port such as shown in the posts below:</p> <p><a href="http://weblogs.asp.net/kennykerr/archive/2008/01/03/parallel-programming-with-c-part-4-i-o-completion-ports.aspx" rel="noreferrer">http:...
<p>Not really, at least, not last time I looked. I mean, boost::thread_group might make things marginally tidier in places, but not so as would make much of a difference, I don't think.</p> <p>Boost's thread support seems marginally useful when writing something that's cross-platform, but given that what you're writi...
<p><a href="http://www.cs.wustl.edu/~schmidt/ACE.html" rel="nofollow noreferrer">ACE</a> has some reactors that you can use to model things around your IOCPs. Some of these could have been added to boost, but boost makes building them pretty easy. </p>
5,773
<p>So my company stores alot of data in a foxpro database and trying to get around the performance hit of touching it directly I was thinking of messaging anything that can be done asynchronously for a snappier user experience. I started looking at <a href="http://activemq.apache.org/" rel="noreferrer">ActiveMQ</a> bu...
<p>ActiveMQ works well with C# using the Spring.NET integrations and NMS. A post with some links to get you started in that direction <a href="http://thefreakparade.com/2008/04/15/two-message-exchange-patterns-using-activemq-and-nms-via-springnet/" rel="noreferrer">is here</a>. Also consider using MSMQ (The System.Mess...
<p>Sorry if this isn't what you are asking for... Have you considered some sort of cache behind the scenes that acts a bit like the "bucket system" when using asynchronous sockets in c/c++ using winsock? Basicly, it works by accepting requests, and sends an immediate response back to the web app, and when it finally g...
2,625
<p>Does javascript use immutable or mutable strings? Do I need a "string builder"?</p>
<p>They are immutable. You cannot change a character within a string with something like <code>var myString = &quot;abbdef&quot;; myString[2] = 'c'</code>. The string manipulation methods such as <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim" rel="noreferrer"><cod...
<p>JavaScript strings are indeed immutable.</p>
7,416
<p>Now that most of the major browsers support full page zoom (at present, the only notable exception being Google Chrome), are liquid or elastic layouts no longer needed? Is the relative pain of building liquid/elastic layouts worth the effort? Are there any situations where a liquid layout would still be of benefit? ...
<p>Yes, because there are a vast variety of screens out there commonly ranging from 15" to 32". There is also some variation in what people consider a "comfortable" font size. All of which adds up to quite a range of sizes that your content will need to fit into.</p> <p>If anything, liquid layout is becoming even more...
<p>Liquid layouts can cause usability problems, though.</p> <p>Content containers that become too wide become exceptionally difficult to read.</p> <p>Many blogs have fixed width content containers specifically for this reason.</p> <p>Alternatively, you can create multi-column content containers so that you get an ef...
8,767
<p>The overall goal is to create a print of the liberty bell. No clapper is needed. The support beam is not needed. I am just looking to mimic the outside shape of the bell. After an application of Google-fu I found this image. It has been cleaned up and cropped a bit.</p> <p><a href="https://i.stack.imgur.com/HT...
<p>As you are already familiar with OpenSCAD, consider to use the <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/3D_to_2D_Projection" rel="nofollow noreferrer">projection() function</a> to accomplish your goal.</p> <p>If you allow for an interpretation that one can cast a shadow of the part on a surface b...
<p>You could have done that with OpenSCAD, there are instructions for extruding. </p> <p>Personally, I'd just do a 1 altitude copy with <a href="http://www.thingiverse.com/thing:1981938" rel="nofollow noreferrer">Image 2 STL 2 Heightmap Mesh Converter Generator</a>, then rotate in OpenSCAD. It's called <code>rotate_e...
566
<p>I'm trying to get some stats on how many of the visitors to our website have Silverlight enabled browsers. </p> <p>We currently use Google Analytics for the rest of our stats so ideally we'd like to just add 'Silverlight enabled' tracking in with the rest of our Google Analytics stats. But if it has to get writte...
<p>In case you missed it, there's a link to a more detailed article as well in the comments: <a href="http://blogs.msdn.com/jeffwilcox/archive/2007/10/01/using-google-analytics-with-rich-managed-web-applications-in-silverlight.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/jeffwilcox/archive/2007/10/01/using-goo...
<p>I think you answered it yourself. The page you are linking to does just that: detect which version of Silverlight the user has (not if s/he installs it). From the page:</p> <blockquote> <p>After a little poking around, I found that Google Analytics has support for reporting a user-defined field.</p> </blockquote>...
5,820
<p>Debugging asp.net websites/web projects in visual studio.net 2005 with Firefox is loads slower than using IE.</p> <p>I've read something somewhere that there is a way of fixing this but i can't for the life of me find it again.</p> <p>Does anyone know what i'm on about and can point me in the right direction plea...
<p>bingo. found the <a href="http://dotnetslackers.com/ASP_NET/re-122146_Speeding_Up_FireFox_When_Using_the_ASP_NET_Development_Server_from_Localhost.aspx" rel="noreferrer">article</a> i read before. </p> <p>i just changed my network.dns.ipv4OnlyDomains property in about:config to localhost. restarted firefox and now ...
<p>Are you serious? One of the main reasons I stick to Firefox is because its so much nicer to develop with..</p> <p>The live source update is awesome (view source > change code > rebuild > F5 in source)...</p> <p>What is actually "slow".. I mean, the some browsers tend to be slower at rendering, but I dont see how i...
4,460
<p>What JavaScript keywords (function names, variables, etc) are reserved?</p>
<p>Here is my poem, which includes all of the reserved keywords in JavaScript, and is dedicated to those who remain honest in the moment, and not just try to score:</p> <pre class="lang-none prettyprint-override"><code>Let this long package float, Goto private class if short. While protected with debugger case, Con...
<p>benc's answer is excellent, but for my two cents, I like the w3schools' page on this:</p> <p><a href="http://www.w3schools.com/js/js_reserved.asp" rel="nofollow">http://www.w3schools.com/js/js_reserved.asp</a></p> <p>In addition to listing the keywords reserved by the standard, it also has a long list of keywords ...
4,585
<p>I'm currently trying to build a personal website to create a presence on the web for myself. My plan is to include content such as my resume, any projects that I have done on my own and links to open source projects that I have contributed to, and so on. However, I'm not sure which approach would be better from a pe...
<p>I've toyed with this idea in the past but I don't think it's really a good idea for a number of reasons. Firstly, there are a number of places that can take care of most of this without you needing to do the work or maintenance. Just signing up for a linkedIn account for example will allow you to get most of your ne...
<p>I have come to see that the best way to advertise yourself is to put quality content out there. If you write about the technology that you have experience in, maybe create a few tutorials, and if you do all that often enough, that shows some authority in your chosen field of work.</p> <p>This alone is one of the be...
3,120
<p>I have a usercontrol that has several public properties. These properties automatically show up in the properties window of the VS2005 designer under the "Misc" category. Except two of the properties which are enumerations don't show up correctly.</p> <p>The first on uses the following enum:</p> <pre><code>publi...
<p>I made a little test with your problem (I'm not sure if I understood it correctly), and these properties shows up in the designer correctly, and all enums are shown appropriately. If this isn't what you're looking for, then please explain yourself further. </p> <p>Don't get hang up on the _Ugly part thrown in there...
<p>Some things to try (designer mode in VS2005 I have found to be somewhat flaky):</p> <ol> <li>Open your web.config and add: <code>batch="false"</code> to your <code>&lt;compilation&gt;</code> tag.</li> <li><p>Try setting defaults to your enums:</p> <pre><code>public enum VerticalControlAlign { Center = 0, T...
8,961
<p>I want to see all the different ways you can come up with, for a factorial subroutine, or program. The hope is that anyone can come here and see if they might want to learn a new language.</p> <h2>Ideas:</h2> <ul> <li>Procedural</li> <li>Functional</li> <li>Object Oriented</li> <li>One liners</li> <li>Obfuscated</li...
<h1>Polyglot: 5 languages, all using bignums</h1> <p>So, I wrote a polyglot which works in the three languages I often write in, as well as one from my other answer to this question and one I just learned today. It's a standalone program, which reads a single line containing a nonnegative integer and prints a single ...
<h1>Haskell : Functional - Tail Recursive</h1> <pre><code>factorial n = factorial' n 1 factorial' 0 a = a factorial' n a = factorial' (n-1) (n*a) </code></pre>
4,372
<p>I was given a C++ project that was compiled using MS Visual Studio .net 2003 C++ compiler, and a .mak file that was used to compile it. I am able to build it from the command line using nmake project.mak, but the compiler complains that afxres.h was not found. I did a little searching around and the afxres.h is in...
<p>There should be an icon in your Start menu under Programs that opens a cmd.exe instance with all the correct MSVS environment variables set up for command line building.</p>
<p>Another option is running the appropriate <code>vars</code> batch file from a regular command prompt. The name and location varies from version to version. For VS2003, I believe it's</p> <p><code>C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat</code></p>
5,591
<p>I'm working on a messaging/notification system for our products. Basic requirements are:</p> <ul> <li>Fire and forget</li> <li>Persistent set of messages, possibly updating, to stay there until the sender says to remove them</li> </ul> <p>The libraries will be written in C#. Spring.NET just released a milestone ...
<p>I'm kinda biased as I work on <a href="http://activemq.apache.org" rel="noreferrer">ActiveMQ</a> but pretty much all of benefits listed for MSMQ above also apply to ActiveMQ really. </p> <p>Some more benefits of ActiveMQ include</p> <ul> <li>great support for <a href="http://activemq.apache.org/cross-language-clie...
<p>I suggest you have a look at TIBCO Enterprise Messaging Service - EMS, which is a high performance messaging product that supports multicasting, routing, supports JMS specification and provides enterprise wide features including your requirements suchas fire-forget and message persistence using file/database using s...
5,285
<p>I want to plug in my drivers from the printer into my Raspberry Pi. I want to control the printer's axes by sending G-code directly from the Raspberry Pi command line (if possible) to the drivers.</p> <p>Is that possible and if yes does anyone know how? As I stated above without using any 3rd party program/software....
<p>A very dumb, simple way to send GCODE to your printer from the terminal can be achieved with:<br /> <code>echo &quot;gcode here&quot; &gt; /dev/ttyS0</code><br /> /dev/ttyS0 can vary, It may be /dev/ttyACM0, /dev/ttyUSB0, or any similar with a different number.</p> <p>You can figure out which path is correct for you...
<p>You can send the data to the serial port using <code>echo</code>, but you'll have to use <code>cat</code> to get the response.</p>
1,999
<p>What Firefox add-ons do you use that are useful for programmers?</p>
<p>I guess it's silly to mention Firebug -- doubt any of us could live without it. Other than that I use the following (only listing dev-related):</p> <ul> <li>Console<sup>2</sup>: next-generation error console</li> <li>DOM inspector: as the title might indicate, allows you to browse the DOM</li> <li>Edit Cookies: cha...
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/60" rel="nofollow noreferrer">Web Developer</a> for web development. <a href="https://addons.mozilla.org/en-US/firefox/addon/1730" rel="nofollow noreferrer">Scribefire</a> if you're a blogger-progammer</p>
5,702
<p>I am looking for a tool that can detect malicious requests (such as obvious SQL injection gets or posts) and will immediately ban the IP address of the requester/add to a blacklist. I am aware that in an ideal world our code should be able to handle such requests and treat them accordingly, but there is a lot of val...
<p>Your almost looking at it the wrong way, no 3party tool that is not aware of your application methods/naming/data/domain is going to going to be able to perfectly protect you.</p> <p>Something like SQL injection prevention is something that has to be in the code, and best written by the people that wrote the SQL, b...
<p>Interesting how this is being implemented years later by google and them removing the URL all together in order to prevent XSS attacks and other malicious acitivites</p>
2,367
<p>I have a WiFi module that only needs two wires connection to work. These are RX and TX pins connected to Arduino or the CR-10S printer board but I don't know if there is any physical or software UARTs TX and RX pins. My goal is to add a Wifi support to the CR-10S printer. Since this is not Arduino and the pins are n...
<p>You are looking for a capacitor that must be connected to Pin 4 of the LM2596.</p> <p>Maybe you could provide a better picture of that area so we could see the different tracks on the board.</p> <p>The LM2596 is in the center of the right side of the board (it is also labeled with LM2596D). The pins should be cou...
<h1>You are looking at the wrong board</h1> <p>Your board might on the surface look like a Creality v 2.0 board, and is indeed from the same family of boards. After trying to discern the parts and finally resorting to google image search, I almost had to maniacally laugh:</p> <p>The currently latest version is the <a h...
1,099
<p>I've been taking a look at some different products for .NET which propose to speed up development time by providing a way for business objects to map seamlessly to an automatically generated database. I've never had a problem writing a data access layer, but I'm wondering if this type of product will really save the...
<p>I have used SubSonic and EntitySpaces. Once you get the hang of them, I beleive they can save you time, but as complexity of your app and volume of data grow, you may outgrow these tools. You start to lose time trying to figure out if something like a performance issue is related to the ORM or to your code. So, t...
<p>There are lots of choices of ORMs. Linq to Sql, nHibernate. For pure object databases there is db4o.</p> <p>It depends on the application, but for a high volume enterprise application, I would not go this route. You need more control of your data.</p>
4,840
<p>I would like to create a database backed interactive AJAX webapp which has a custom (specific kind of events, editing) calendaring system. This would involve quite a lot of JavaScript and AJAX, and I thought about Google Web Toolkit for the interface and Ruby on Rails for server side.</p> <p>Is Google Web Toolkit r...
<p>RoR is actually one of the things the GWT is made to work well with, as long as you're using REST properly. It's in the Google Web Toolkit Applications book, and you can see a demo from the book using this kind of idea <a href="http://www.gwtapps.com/?page_id=33" rel="noreferrer">here</a>. That's not to say that y...
<p>You could also consider <a href="http://grails.org/" rel="nofollow noreferrer">Grails</a> ("Groovy on Rails") which gives you the benefits of a Rails framework and the use of the Java VM.</p>
5,067
<p>I'd like to automate TortoiseSVN as part of a commit process. Specifically I'd like to dynamically create a log entry for the commit dialog.</p> <p>I know that I can launch the commit dialog either from the commandline or by right clicking on a folder and selecting svncommit.</p> <p>I'd like to use the start commi...
<p>Looks like it was my own misunderstanding of the the API that caused by a problem.</p> <p>Solution:<br> 1) I've added a start commit hook script to TortoiseSVN using the hooks gui in the settings area of the right click menu.</p> <p>2) The script receive 3 pieces of information: PATH MESSAGEFILE CWD<br> ...
<p>If you just need a static template, set the tsvn:logtemplate property.</p> <p>For dynamic generation, the /logmsgfile parameter does work, but it seems to need the full path. A batch file that looks like the following might work for you.</p> <pre><code>GenerateLogMsg.exe &gt; tmp.msg "C:\Program Files\TortoiseSVN\...
8,346
<p>I hope this question does not come off as broad as it may seem at first. I am designing a software application that I would like to be both cross-platform and modular. I am still in the planning phase and can pick practically any language and toolset.</p> <p>This makes things harder, not easier, because there are se...
<p>Just to cite an example: for .NET apps there are the CAB (Composite Application Block) and the Composite Application Guidance for WPF. Both are mainly implementations of a set of several design patterns focused on modularity and loose coupling between components similar to a plug-in architecture: you have an IOC fra...
<p>With my limited Mono experience I can say I'm quite sold on it. The fact that there is active development and a lot of ongoing effort to bring it up to spec with the latest .Net technologies is encouraging. It is incredibly useful to be able to use existing .Net skills on multiple platforms. I had similar issues ...
5,360
<p>I specifically want to test </p> <ul> <li>calibration</li> <li>tolerances</li> <li>precision</li> <li>accuracy</li> </ul> <p>I'm having trouble with Print in Place models and I'm trying to find out if there's something I can do to improve my print quality. </p> <p>The printer I am using is a Kossel clone, specifi...
<p>This is a fairly open ended subject, but the different calibration/test models can be broken down into a few different groups. Although there are a few common 'standards', as soon as you get to looking at a specific parameter, you will need to look for something that is a good match for your problem (not everything ...
<p>The best place to start looking is to go to <a href="http://www.thingiverse.com" rel="nofollow noreferrer">Thingiverse</a> and search on '<a href="https://www.thingiverse.com/search?q=benchmark" rel="nofollow noreferrer">benchmark</a>'. There are a great many models there intended to test various aspects of printing...
975
<p>I've got a System.Generic.Collections.List(Of MyCustomClass) type object.</p> <p>Given integer varaibles pagesize and pagenumber, how can I query only any single page of MyCustomClass objects?</p>
<p>If you have your linq-query that contains all the rows you want to display, this code can be used:</p> <pre><code>var pageNum = 3; var pageSize = 20; query = query.Skip((pageNum - 1) * pageSize).Take(pageSize); </code></pre> <p>You can also make an extension method on the object to be able to write</p> <pre><code...
<p>Hi There is a wicked thing called PagedList which i got when watching a Rob Conery Screen Cast. </p> <p><a href="http://blog.wekeroad.com/2007/12/10/aspnet-mvc-pagedlistt/" rel="noreferrer">http://blog.wekeroad.com/2007/12/10/aspnet-mvc-pagedlistt/</a></p> <p>It has all the Skip and Take stuff built in.</p> <p>Al...
4,144
<p>Has anyone found a useful solution to the DesignMode problem when developing controls?</p> <p>The issue is that if you nest controls then DesignMode only works for the first level. The second and lower levels DesignMode will always return FALSE.</p> <p>The standard hack has been to look at the name of the process...
<p>Revisiting this question, I have now 'discovered' 5 different ways of doing this, which are as follows:</p> <pre><code>System.ComponentModel.DesignMode property System.ComponentModel.LicenseManager.UsageMode property private string ServiceString() { if (GetService(typeof(System.ComponentModel.Design.IDesigner...
<p>I had to fight this problem recently in Visual Studio 2017 when using nested UserControls. I combine several of the approaches mentioned above and elsewhere, then tweaked the code until I had a decent extension method which works acceptably so far. It performs a sequence of checks, storing the result in static boo...
5,498
<p>What's the most efficient way to resize large images in PHP?</p> <p>I'm currently using the <a href="http://en.wikipedia.org/wiki/GD_Graphics_Library" rel="noreferrer">GD</a> function imagecopyresampled to take high resolution images, and cleanly resize them down to a size for web viewing (roughly 700 pixels wide b...
<p>People say that ImageMagick is much faster. At best just compare both libraries and measure that.</p> <ol> <li>Prepare 1000 typical images.</li> <li>Write two scripts -- one for GD, one for ImageMagick.</li> <li>Run both of them a few times.</li> <li>Compare results (total execution time, CPU and I/O usage, result ...
<p>I suggest that you work something along these lines:</p> <ol> <li>Perform a getimagesize( ) on the uploaded file to check image type and size</li> <li>Save any uploaded JPEG image smaller than 700x700px in to the destination folder "as-is"</li> <li>Use GD library for medium size images (see this article for code sa...
3,376
<p>I have a habit of keeping my variable usage to a bare minimum. So I'm wondering if there is any advantage to be gained by the following:</p> <pre><code>$query = $mysqli-&gt;query('SELECT * FROM `people` ORDER BY `name` ASC LIMIT 0,30'); // Example 1 $query = $query-&gt;fetch_assoc(); // Example 2 $query_r = $que...
<p>The <a href="http://us2.php.net/manual/en/mysqli-result.free.php" rel="noreferrer">manual</a> seems to suggest that you should still be using <code>free()</code> to release the memory. I believe the reasoning is that <code>free()</code> is freeing the memory in <em>MySQL</em>, not in PHP. Since PHP can't garbage-col...
<p>Example 1 <strong>dissociates</strong> the $query variable from the MySQL result. The MySQL result still exists in memory, and will continue to exist and waste memory until garbage collection occurs.</p> <p>Example 2 <strong>frees</strong> the MySQL result immediately, releasing the used resources.</p> <p>However,...
4,606
<p>I want to 3d print my own icing smoothers, but I'm not sure if its safe to have plastic from a 3D printer in contact with cake icing. Is there any harm in this?</p>
<p>Only certain plastics are safe enough to be used to contain or manipulate food. ABS and PET-G are such materials. The 3d printing process however is not food safe because, it creates crevices in the printed part into which bacteria and other contaminants can cling to. A printed part would need to be coated in a sili...
<p>As mentioned, FDM 3D printed parts are flawed for food service and prep use regardless of the material, because of the small gaps between lines where bacteria can grow, and because your printer isn't used in a way to keep it from introducing contaminants into otherwise clean material.</p> <p>However, there are some ...
1,241
<p>I would like the version property of my application to be incremented for each build but I'm not sure on how to enable this functionality in Visual Studio (2005/2008). I have tried to specify the AssemblyVersion as 1.0.* but it doesn't get me exactly what I want. </p> <p>I'm also using a settings file and in earlie...
<p>With the "Built in" stuff, you can't, as using 1.0.* or 1.0.0.* will replace the revision and build numbers with a coded date/timestamp, which is usually also a good way. </p> <p>For more info, see the <a href="http://msdn2.microsoft.com/en-us/library/c405shex(vs.80).aspx" rel="noreferrer">Assembly Linker</a> Docum...
<p>If you want an auto incrementing number that updates each time a compilation is done, you can use <a href="http://testdox.wordpress.com/versionupdater/" rel="nofollow noreferrer">VersionUpdater</a> from a pre-build event. Your pre-build event can check the build configuration if you prefer so that the version number...
2,307
<p><strong>Before you put duplicate from this <a href="https://3dprinting.stackexchange.com/questions/147/which-are-the-food-safe-materials-and-how-do-i-recognize-them">Which are the food-safe materials and how do I recognize them?</a> please read</strong> </p> <p>I need to know if <a href="http://store.printm3d.com/#...
<p>In general, PLA is known as a "food safe" filament, especially <strong><em>Natural PLA</em></strong>. However, filament suppliers have different processes that may detriment the food safe quality.</p> <p>Doing a little digging, I found <a href="https://printm3d.com/solutions/article.php?id=47" rel="noreferrer">an a...
<p>In general no filament is safe as the printing process leaves "nooks and cranies" between the layers where germs can gain a foothold.</p> <p>For food safe, I would advise:</p> <ul> <li>print with white filament</li> <li>use an acetone vapor bath to smooth and melt many of the "nooks and cranies" away.</li> <li>Use...
256
<p>I've got my brand new VS2008 and decided to convert my main solution from VS2005. One of the projects is a SQL2005 reporting services project. Now that I've converted I cannot load it in VS2008. Is there anyway around this? </p> <p>My problem is that my solution is a hybrid and has websites libraries and reports in...
<p>As you have guessed, the baseAddresses element is completely ignored when hosting in IIS. The service's base address is determined by the web site &amp; virtual directory into which your wcf service is placed.</p> <p>Even when self-hosting, baseAddresses is not required. It is merely a convenience that avoids you ...
<p>base address required for selfhosting. IIS/WAS hosts ignores the base address.</p>
8,014
<p>I am working with an open-source UNIX tool that is implemented in C++, and I need to change some code to get it to do what I want. I would like to make the smallest possible change in hopes of getting my patch accepted upstream. Solutions that are implementable in standard C++ and do not create more external depende...
<p>I am using #3: the boost string format library - but I have to admit that I've never had any problem with the differences in format specifications.</p> <p>Works like a charm for me - and the external dependencies could be worse (a very stable library)</p> <p>Edited: adding an example how to use boost::format inste...
<p>Is this about serialization? Or printing proper? If the former, consider boost::serialization as well. It's all about "recursive" serialization of objects and sub-object.</p>
9,512
<p>I'm trying to print a cylinder with Flashprint. Problem is, that the .stl file i created (with OpenSCAD) is totally ruined once loaded into Flashprint. With ruined I mean the round outline is now with spikes and steps everywhere. And by loaded I mean directly after loading, not even creating the .gx files. The outpu...
<p>From an electrical standpoint, a two-phase stepper motors (what most 3D printers use) works the same backwards and forwards, the phase just reverses. If you are stalling on only one direction, I would look to see if you have a mechanical bind in that direction. Generally a wiring issue will cause the motor to eith...
<p>Sounds like you are configured for NC switches but are using NO switches, causing them to invert their reported state. Issue a <strong>M119</strong> command and see if the endstop statuses are correct when none are triggered.</p>
775
<p>Is there any difference between a binary semaphore and mutex or are they essentially the same?</p>
<p>They are <strong>NOT</strong> the same thing. They are used for different purposes!<br> While both types of semaphores have a full/empty state and use the same API, their usage is very different. </p> <p><strong>Mutual Exclusion Semaphores</strong><br> Mutual Exclusion semaphores are used to protect shared resour...
<p>Almost all of the above said it right. Let me also try my bit to clarify if somebody still has a doubt.</p> <ul> <li>Mutex -> used for serialization</li> <li>Semaphore-> synchronization.</li> </ul> <p>Purpose of both are different however, same functionality could be achieved through both of them with careful prog...
8,831
<p>Here's what I use:</p> <pre><code>SELECT CAST(FLOOR(CAST(getdate() as FLOAT)) as DATETIME) </code></pre> <p>I'm thinking there may be a better and more elegant way.</p> <p>Requirements:</p> <ul> <li>It has to be as fast as possible (the less casting, the better).</li> <li>The final result has to be a <code>datet...
<p><strong>SQL Server 2008 and up</strong></p> <p>In SQL Server 2008 and up, of course the fastest way is <code>Convert(date, @date)</code>. This can be cast back to a <code>datetime</code> or <code>datetime2</code> if necessary.</p> <p><strong>What Is Really Best In SQL Server 2005 and Older?</strong></p> <p>I've s...
<p>SQL2005: I recommend cast instead of dateadd. For example,</p> <pre><code>select cast(DATEDIFF(DAY, 0, datetimefield) as datetime) </code></pre> <p>averagely about 10% <em>faster</em> on my dataset, than</p> <pre><code>select DATEADD(DAY, DATEDIFF(DAY, 0, datetimefield), 0) </code></pre> <p>(and casting into smallda...
2,489
<p>Has anybody used the MS Project Gantt chart control in C#? If yes, can you share some resources regarding this?</p>
<p>You could also check <a href="http://DlhSoft.com/GanttChart" rel="nofollow noreferrer">Gantt Chart Library</a> for WPF or Windows Forms, they do not require Microsoft Project installed on the client computer, but provide similar UI for project and related Gantt Charts.</p>
<p>My company decided to buy the Infragistics NetAdvantage for .NET. We will be using their Gantt control.</p> <p>Thanks for your answers.</p>
4,208
<p>If I set temperature say 220 °C, printer heats up to it and it only varies +/- 0.5 °C under non operating condition. But if I start a print, there's a shift of +/- 15 °C.</p> <p>I've already auto tuned PID parameters and when I run <code>M503</code>, the printer shows the updated PID values.</p> <p><a href="https://...
<p>There could be a number of reasons for that behaviour:</p> <p>Please check following items:</p> <ol> <li>part blower/fan cools down the nozzle - stop the fan</li> <li>material is extruded at high speed and takes the heat</li> <li>loose thermistor (when the move occurs as it moves a bit internally) </li> <li>the po...
<p>Can you also show a "power output" graph (or something like that, which show PWD duty cycle output to the hot end)?</p> <p>Have you noted any relation between temperature raise and fall and the printing position?</p> <p>Looking at graph I can only suggest the heating is suddenly stops and then the same sudden resu...
917
<p>I'm trying to squeeze a little better quality out of my time lapses generated by OctoPrint.</p> <p>I'm using the Raspberry Pi Camera Module V2 with a Pi 3. I've already edited the Octopi config to get 720p resolution, but the encoding during time lapse rendering is horrific. Blocky as hell.</p> <p>Right now the en...
<p>You can learn a lot just by reading the forums. I'll just list a few that are quite popular...</p> <p><a href="http://forums.reprap.org/" rel="nofollow">Reprap Forums</a> - Has a ton of information on DIY printers including build logs and posts dealing with many issues.</p> <p><a href="http://www.soliforum.com" r...
<p>ADDITIVE MANUFACTURING TECHNOLOGIES 3D Printing, Rapid Prototyping, and Direct Digital Manufacturing</p> <p>Springer</p> <p>I think its a perfect book. A lot of details to all technologies. *Beware there is math and physics involved.</p> <p><a href="https://i.stack.imgur.com/52f1O.jpg" rel="nofollow noreferrer"><...
272
<p>How can I poll disk activity in Applescript? Check to see if disk X is being read, written, or idle every N seconds and do something.</p>
<p>In general, polling is less efficient than being notified when something happens. Additionally, if you're checking whether something is reading from a disk, you will probably be accessing said disk yourself, possibly influencing what you're trying to observe.</p> <p>Since 10.5, OSX includes something called the Fil...
<p>You could run the terminal command iostat periodically. You'd have to parse the results into a form you could digest.</p> <p>If you know enough about various UNIX command line tools, I'd suggest iostat piping the output to awk or sed to extract just the information you want.</p>
9,032
<p>All of my completed prints come out with rough edges. What are some methods for removing rough edges from 3D prints? Also, are there any ways to reduce rough edges on prints? For reference, I use a FlashForge Adventurer 3 and PLA filament.</p>
<ol> <li>To remove unwanted residual material:</li> </ol> <ul> <li>You can scrape with a knife</li> <li>Use sand paper</li> <li>use files</li> <li>Very fine sandpaper or files can smooth out the rough surfaces left from filing or sanding.</li> <li>Dremel tools tend to be aggressive. They tend to melt the surface if to...
<p>There are several different ways you can go about doing this</p> <ol> <li>You could calibrate your printer/software better that way so the slicer can make better gcode files that are best fit for you printer</li> <li>Take a lighter to the edge and scrape everything off, this really helps for if your print gets reall...
1,932
<p>The plastic glide rail on which my refrigerator vegetable drawer (bin) traveled recently broke.</p> <p>The rail was part of a large plastic shelf, which is no longer available for purchase.</p> <p>I'm thinking about 3D printing a new glide rail and attaching it (somehow) to the existing shelf.</p> <p>Can 3D printing...
<blockquote> <p>Can 3D printing be used for this task to make the repair any easier or more successful to complete than simply cutting a piece of plastic and (again, somehow) affixing it to the shelf?</p> </blockquote> <p><strong>Yes.</strong> 3D printed parts can be plenty strong enough to handle the kind of load you'...
<p>If you have powder plastic then I believe it will be easier for you to 3D print the shelf, resulting in smooth finish and high load capacity.</p> <p>Powder plastics offer the benefits of increased utilization rate and easy production process. Also, the excessive amount of powder can be eliminated at the finish produ...
1,782