instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>Is there an easy way to return data to web service clients in JSON using Rails?</p>
| <p>Rails resource gives a RESTful interface for your model. Let's see.</p>
<h1>Model</h1>
<pre><code>class Contact < ActiveRecord::Base
...
end
</code></pre>
<h1>Routes</h1>
<pre><code>map.resources :contacts
</code></pre>
<h1>Controller</h1>
<pre><code>class ContactsController < ApplicationController
.... | <p>ActiveRecord also provides methods to interact with JSON. To create JSON out of an AR object, just call object.to_json. TO create an AR object out of JSON you should be able to create a new AR object and then call object.from_json.. as far as I understood, but this did not work for me.</p>
| 8,200 |
<p>How does Z offset (<code>M851</code>) work with an auto leveling sensor? Does it add the Z offset to the offset of the <code>G29</code> mesh? or the <code>G29</code> value replaces the <code>M851</code>?</p>
<p>My printer is an Anet A8 with Marlin firmware, I was having issues with the autoleveling sensor and reset ... | <p><code>G28</code> instructs the printer to home itself to the X an Y endstops and the Z sensor determines the homing of the Z axis; i.e. when the sensor triggers, this is not necessarily (and most commonly) not the position where the nozzle is at Z=0.</p>
<p><code>G29</code> determines the shape of the bed by probing... | <p>You must use the sequence </p>
<pre><code>G28
G29
</code></pre>
<p>If you do <code>G28</code> after <code>G29</code> it will reset bed leveling. I guess you don't want that.</p>
<p>On my printer deployed z-probe falls 2.3 mm lower than nozzle. In printer settings I've therefore stored static Z-offset of -2.3... | 882 |
<p>I've found out how to convert errors into exceptions, and I display them nicely if they aren't caught, but I don't know how to log them in a useful way. Simply writing them to a file won't be useful, will it? And would you risk accessing a database, when you don't know what caused the exception yet?</p>
| <p>You could use <a href="http://www.php.net/manual/en/function.set-error-handler.php" rel="noreferrer">set_error_handler</a> to set a custom exception to log your errors. I'd personally consider storing them in the database as the default Exception handler's backtrace can provide information on what caused it - this o... | <p>I think it depends a lot of where your error occured. If the DB is down logging it to the DB is no good idea ;)</p>
<p>I use the <a href="http://php.net/syslog" rel="nofollow noreferrer">syslog()</a> function for logging the error, but I have no problems writing it to a file when I'm on a system which has no syslog... | 4,069 |
<p>In my base page I need to remove an item from the query string and redirect. I can't use<br/></p>
<pre><code>Request.QueryString.Remove("foo")
</code></pre>
<p>because the collection is read-only. Is there any way to get the query string (except for that one item) without iterating through the collection and re-bu... | <p>You'd have to reconstruct the url and then redirect. Something like this:</p>
<pre><code>string url = Request.RawUrl;
NameValueCollection params = Request.QueryString;
for (int i=0; i<params.Count; i++)
{
if (params[i].GetKey(i).ToLower() == "foo")
{
url += string.Concat((i==0 ? "?" : "&"), ... | <p>Can you clone the collection and then redirect to the page with the cloned (and modified) collection?</p>
<p>I know it's not much better than iterating...</p>
| 7,520 |
<p>I'm considering using Flash but I'm pretty addicted to autocomplete and Step-at-a-time debugging.</p>
| <p>By using Eclipse with the ActionScript plugin you get full code hinting in the same format that you do with intellisense. </p>
<p>Or you can use <a href="http://www.flashdevelop.org/community/" rel="nofollow noreferrer">FlashDevelop</a> that has both intellisense and can <a href="http://www.flashdevelop.org/communi... | <p>If you mean ActionScript I once heard that <a href="http://www.primalscript.com/" rel="nofollow noreferrer">PrimalScript</a> will do Intellisense. Never tested it though. As for debugging, MAYBE, <a href="http://www.primalscope.com/" rel="nofollow noreferrer">PrimalScope</a> will have that too. I'd recommend you try... | 7,168 |
<p>We need a 3D printer, that can print with plastic suitable for medical applications. We have about $5000 for the printer. What printers can we choose? I am not a specialist in 3D printing, so please answer in detail. </p>
<p>We need to print breathing tubes with cuffs. The tubes should be flexible, but rigid enough... | <p>I am not an expert but I think you will find that because 3D printers use a layer by layer construction method, and the boundary between the layers creates grooves along the surface or leaves a rough texture on the surface. That the textured surface left by 3D printer construction would trap microbes and make 3D pri... | <p>Find another medical facility that is doing it, and ask what equipment and filament they use. They may also have a source for medical related models.</p>
<p>I would expect medical stuff to be regulated by the FDA, so there are probably limitations on what you can get.</p>
| 731 |
<p>On one of the nozzles on my printer, the filament comes out at a 45 degree angle. It seems that this causes problems with adhesion to the bed and overall quality.</p>
<ul>
<li>What caused this problem? </li>
<li>How do I fix it? </li>
<li>How do I prevent it from
happening in the future?</li>
</ul>
| <p>I've personally had this happen when I had a minor clog in my nozzle. </p>
<p>My first steps to fix this would be:</p>
<ol>
<li>Make sure the exterior of your nozzle is clean. I've had bits of plastic pull at the extruding filament and change it's direction.</li>
<li>Attempt a "cold pull" or "<a href="http://suppo... | <p>You very likely have partial clog in your hotend (the side which is clogged is the angle the extruding filament bends to) or have some plastic somehow stuck on the nozzle surface which the extruding plastic almost sticks to, like two droplets of water merging into one.</p>
<p>If its the latter, clean the hotend. It... | 165 |
<p>I don't ever recall coming across anything for C that's as extensive as C++'s Boost library.</p>
| <p>You can have a look at glib. It provides quite a few interesting things like containers, unicode support, threading...</p>
<p>Have a look at <a href="http://library.gnome.org/devel/glib/stable/" rel="noreferrer">its documentation</a> </p>
| <p>ACE (Adaptive Communication Environment) is sometimes mentioned. It's not quite an apples-to-apples comparison. Boost provides more "basic building blocks" whereas ACE provides more of an tightly integrated framework geared towards telco products. I have used both extensively and I find Boost vastly superior. One bi... | 7,569 |
<p>Does anyone use <a href="http://phing.info/trac/" rel="nofollow noreferrer">Phing</a> to deploy PHP applications, and if so how do you use it? We currently have a hand-written "setup" script that we run whenever we deploy a new instance of our project. We just check out from SVN and run it. It sets some basic config... | <p>From Federico Cargnelutti's <a href="http://phpimpact.wordpress.com/2007/06/30/phing-php-project-build-system-based-on-apache-ant/" rel="noreferrer">blog post</a>:</p>
<blockquote>
<p>Features include file transformations (e.g. token
replacement, XSLT transformation,
Smarty template transformations), file
s... | <p>I don't see any compelling reason to go with phing. I mean, should PHP programmers attempt a rewrite of Eclipse "just because" it might somehow be easier to write Eclipse plugins in PHP? I don't think so.</p>
<p>Ant has better documentation, including some nice o'reilly books, and it's well-established in the Java ... | 5,725 |
<p>I'm working on an ASP.NET website which targets desktop browsers. We want to enable an optional mobile view (e.g. <a href="http://m.sample.com" rel="nofollow noreferrer">http://m.sample.com</a>) which will offer a few simple pages which will be mostly text. There will be not need for AJAX or even Javascript, and the... | <p>I have done this in the past and the way I did it is by separating the pages by creating a directory for Desktop and creating a directory for Mobile. This gives you better separation of the views, since in reality they are a lot different. In ASP.NET Forms I used the <a href="http://msdn.microsoft.com/en-us/magazi... | <p>I know from personal experience there really isn't much you need to do for the iPhone. I usually rather just browse your regular site with my iPhone. </p>
<p>Just my two cents though.</p>
| 8,400 |
<p>We have a SQL server database. To manipulate the data non-programmatically, I can use SQL Server Management Studio by right-clicking a table and selecting "Open Table". However this is slow for very large tables and sorting and filtering is cumbersome.</p>
<p>Typically what we have done until now is to create an Ac... | <p>Joel Coehoorn's answer is of course correct, that if the data is critical or there are naive users using the data, then a application front end should be developed. That being said, I have cases where a wise user (ok, me) user needs to just get in there and poke around. </p>
<p>Instead of directly looking at the ... | <p>Editing raw data is a dangerous no-no. Better to identify the situations where you find yourself doing that and put together an application interface to act as an intermediary that can prevent you from doing stupid things like breaking a foreign key.</p>
| 6,156 |
<p>I decided to make a system for a client using <a href="https://web.archive.org/web/20080517021542/http://www.castleproject.org/activerecord/index.html" rel="nofollow noreferrer">Castle ActiveRecord</a>, everything went well until I found that the transactions do not work, for instance;</p>
<pre><code> ... | <p>Ben's got it. That doc is a little confusing. Refer to the last block <a href="https://web.archive.org/web/20080417014143/http://www.castleproject.org/ActiveRecord/documentation/v1rc1/usersguide/scopes.html" rel="nofollow noreferrer">on the page</a>, "Nested transactions". </p>
| <p>I finally fixed, it happened that I was doing wrong, I overrode the Save method of the Member class and made sessionScope inside and inside of it a transaction scope, so when a involved all of that in a transaction scope it saved in the database, so when I threw the exception everything was already saved, I think th... | 5,968 |
<p>I wrote a script to export twitter friends as foaf rdf description. Now I'm looking for a tool to visualize the friend networks. I tried <a href="http://foafscape.berlios.de/" rel="nofollow noreferrer">http://foafscape.berlios.de/</a> but for 300+ Nodes it is really slow and does a bad job on auto formatting.</p>
<... | <p>perhaps the <a href="http://prefuse.org/" rel="noreferrer">prefuse</a> visualization toolkit might help you. It's based on Java and has many sample apps including a <a href="http://prefuse.org/gallery/graphview/" rel="noreferrer">graph viewer</a>.</p>
| <p>If you're using Java, you could use <a href="http://www.jgraph.com/" rel="nofollow noreferrer">JGraph</a>.</p>
| 9,979 |
<p>From question <em><a href="https://stackoverflow.com/questions/71323/how-to-replace-a-character-for-a-newline-in-vim">How to replace a character for a newline in Vim?</a></em>. You have to use \r when replacing text for a newline, like this</p>
<pre><code>:%s/%/\r/g
</code></pre>
<p>But when replacing end of lines... | <p>From <a href="http://vimdoc.sourceforge.net/htmldoc/pattern.html#/%5Cr" rel="noreferrer">vim docs on patterns</a>:</p>
<blockquote>
<p><code>\r</code> matches <CR></p>
<p><code>\n</code> matches an end-of-line -
When matching in a string instead of
buffer text a literal newline
character i... | <p>First of all, open <a href="http://vimdoc.sourceforge.net/htmldoc/change.html#:s" rel="noreferrer"><code>:h :s</code></a> to see the section "4.2 Substitute" of documentation on "Change". Here's what the command accepts:</p>
<pre><code>:[range]s[ubstitute]/{pattern}/{string}/[flags] [count]
</code></pre>
<p>Notice... | 9,690 |
<p>I have a number of fairly large printed pieces. The parts, when assembled, form a very large sword. (The model is this: <a href="https://www.thingiverse.com/thing:4178060" rel="nofollow noreferrer">https://www.thingiverse.com/thing:4178060</a>, and is not mine.) It is about 7' from tip to pommel, and individual p... | <p><strong>Previous answer assuming not yet printed</strong>:</p>
<p>If you want to drill holes, print smaller guide holes to guide the drill bit. The best glue depends on the material. Printing structures like dovetails makes the connection less dependent on the strength of the glue.</p>
<p><strong>Answer with the p... | <p>A stronger joint than glue can be had by welding, albeit uglier and best used in hidden areas. One way to weld is with friction, using a Dremel to spin a piece of filament so fast it heats up and melts with the two plastic pieces you are joining. You tack the pieces together with a couple spot welds, then move along... | 1,783 |
<p>Is it possible to 3D print an axial turbine 2 - 4 inches (50 - 100 mm) in radius, capable withstanding temperatures about 800 - 1000°C and rotation speeds of 100 - 120 x 10<sup>3</sup> rpm?</p>
<p>How expensive is that? Is it cheaper to mill such a turbine from a whole piece of alloy?</p>
<p>What technologies and ... | <p>You ask some very interesting questions! Firstly, when researching topics such as this, you will have far more luck using 'additive manufacturing' as a search term rather than '3D printing'. In the professional industrial environment, '3D printing' is not a term that is really used to describe the manufacturing you ... | <p>Some companies are already on the move with this idea. I think I remember hearing that <a href="http://optics.org/news/6/4/7" rel="nofollow noreferrer">Pratt and Whitney</a> and Boeing are 3D printing some of the smaller air foils.</p>
<p>The advantages being that they can achieve manufacturing of more complex, mor... | 439 |
<p>The Entity Framework does not support the <code>Expression.Invoke</code> operator. You receive the following exception when trying to use it:</p>
<blockquote>
<p>"The LINQ expression node type 'Invoke' is not supported in LINQ to Entities.</p>
</blockquote>
<p>Has anyone got a workaround for this missing functi... | <p><a href="http://www.albahari.com/nutshell/predicatebuilder.aspx" rel="noreferrer">PredicateBuilder</a> and <a href="http://www.albahari.com/nutshell/linqkit.aspx" rel="noreferrer">LINQKit</a> now support Entity Framework.</p>
<p>Sorry, guys, for not doing this earlier!</p>
| <p>The Entity framework converts LINQ expressions into Entity Command trees and within that only its canonical functions are supported. You'd have to use the command trees with canonical functions to do something like PredicateBuilder.</p>
| 3,172 |
<p>I'd like to print a cylinder, 50 mm diameter, 200 mm long, with 1.5 mm diameter holes tightly fit like this:</p>
<p><a href="https://i.stack.imgur.com/i11dN.png" rel="nofollow noreferrer" title="3D rendering of a cylinder with holes"><img src="https://i.stack.imgur.com/i11dN.png" alt="3D rendering of a cylinder with... | <h1>That's a hell of a print!</h1>
<p>You are printing a model that has a highly complex structure there, with about 650ish holes, assuming there is space for about 2 perimeters between each hole.</p>
<p><a href="https://i.stack.imgur.com/gcrSm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gcrSm.pn... | <p>Holes, circles, and curves are slow to print, and get slower as the number of wall segments increase.</p>
<p>Ideally you'd use square holes, but hexagonal-sided ones would be a fair compromise too.</p>
<p>Your slicer should be able to give a breakdown on the times for each kind of line in the part. Check and see ho... | 2,077 |
<p>Does a caching-nameserver usually cache the negative DNS response SERVFAIL? </p>
<p>EDIT:
To clarify the question, I can see the caching nameserver caching negative responses NXDOMAIN, NODATA. But it does not do this for SERVFAIL responses. Is this intentional?</p>
| <p>SERVFAIL is covered by §7.1 of RFC2308:</p>
<blockquote>
<p>Server failures fall into two major
classes. The first is where a
server can determine that it has been
misconfigured for a zone. This may
be where it has been listed as a server, but not configured to be a
server for the zone, or where i... | <p>One of the timeout fields in the SOA is a "negative timeout". It is usually set to a short time, such as 30 or 60 seconds. So, yes, but for a shorter time than a "positive" response.</p>
| 9,908 |
<p>I am building a site that uses a simple AJAX Servlet to talk JMS (ActiveMQ) and when a message arrives from the topic to update the site.</p>
<p>I have Javascript that creates an XMLHttpRequest for data. The Servlet processes the Get Request and sends back JSON. However I have no idea how to connect my Servlet into... | <p>The problem with having a servlet implement MessageListener is that servlets are synchronous and MessageListeners are asynchronous. Instead you should create some other object to act as the MessageListener and update some state somewhere (possibly a database or a JMX MBean or a Stateful Session EJB) when messages c... | <p>You probably need to get a JMS connection from JNDI, like this:</p>
<pre><code>Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
props.setProperty(Context.PROVIDER_URL,
"tcp://hostname:61616");
javax.naming.Cont... | 9,049 |
<p>I am getting a <code>NoClassDefFoundError</code> when I run my Java application. What is typically the cause of this?</p>
| <p>While it's possible that this is due to a classpath mismatch between compile-time and run-time, it's not necessarily true.</p>
<p>It is important to keep two or three different exceptions straight in our head in this case:</p>
<ol>
<li><p><strong><code>java.lang.ClassNotFoundException</code></strong> This excepti... | <p>I got this message after removing two files from the SRC library, and when I brought them back I kept seeing this error message.</p>
<p>My solution was: Restart Eclipse. Since then I haven't seen this message again :-)</p>
| 5,466 |
<p>We are currently working in a private beta and so are still in the process of making fairly rapid changes, although obviously as usage is starting to ramp up, we will be slowing down this process. That being said, one issue we are running into is that after we push out an update with new JavaScript files, the clien... | <p>As far as I know a common solution is to add a <code>?<version></code> to the script's src link.</p>
<p>For instance:</p>
<pre><code><script type="text/javascript" src="myfile.js?1500"></script>
</code></pre>
<hr>
<blockquote>
<p>I assume at this point that there isn't a better way than find-... | <p>A simple trick that works fine for me to prevent conflicts between older and newer javascript files. That means: If there is a conflict and some error occurs, the user will be prompted to press Ctrl-F5.</p>
<p>At the top of the page add something like</p>
<pre><code><h1 id="welcome"> Welcome to this ... | 5,235 |
<p>We need to move off traditional FTP for security purposes (it transmits it's passwords unencrypted). I am hearing SSH touted as the obvious alternative. However I have been driving FTP from an ASP.NET program interface to automate my web-site development, which is now quite a highly web-enabled process. </p>
<p>Can... | <p>the question has three subquestions:</p>
<p>1) choosing the secure transfer protocol</p>
<p>The secure version of old FTP exists - it's called FTP/SSL (plain old FTP over SSL encrypted channel). Maybe you can still use your old deployment infrastructure - just check whether it supports the FTPS or FTP/SSL.</p>
<p... | <p>G'day,</p>
<p>You might like to look at <a href="http://www.proftpd.org/" rel="nofollow noreferrer">ProFPD</a>.</p>
<p>Heavily customisable. Based on Apache module structure.</p>
<p>From their web site:</p>
<blockquote>
<p>ProFTPD grew out of the desire to have a secure and configurable FTP server, and out of a sign... | 6,012 |
<p>What are some effective strategies for preventing the use of my proprietary images?</p>
<p>I'm talking about saving them, direct linking to them etc...</p>
<p>Presently I have a watermark on the image, but I'd rather not.</p>
<p>.NET platform preferred, but if there's a strategy that's on another platform that in... | <p>It's not possible to make it "impossible" to download. When a user visits your site you're sending them the pictures. The user will have a copy of that image in the browsers cache and he'd be able to access it even after he leaves the site ( depending on the browser, of course ). Your only real option is to watermar... | <p>Anything you send to the client is, like, on the client. Not much you can do about it besides making somewhere between "sorta hard" and "quite hard" to save the image.</p>
| 4,159 |
<p>I have a Prusa i3 printer with mk8 extruder. I am using PETG with (200-240/75-85) degrees recommended temp on it's box. but when I do printing i hear some knocking sound that means there is a problem in extrusion. last time I did increase my temp up to 270 degrees!! maybe this sound solved! but it damaged my extrude... | <p>This is the throat block for direct drive extrusion, Anet8 is a cheap clone of Prusa printers, so it's easy to find parts for Anet printers. </p>
<p>This is one extruder kit that may help your needs, <a href="https://es.aliexpress.com/store/product/1Set-3D-Printer-makerbot-MK8-Extruder-Aluminum-extrusion-Frame-Bloc... | <p>Like @ZuOverture said the name of this component is the filament drive. Most of the manufactures sell the whole extrusion device already assembled, to avoid mismatches between the components of the extrusion device. If your device is somehow damaged, and without possibilities to be used in the printer the easiest so... | 741 |
<p>I have a data structure that represents a directed graph, and I want to render that dynamically on an HTML page. These graphs will usually be just a few nodes, maybe ten at the very upper end, so my guess is that performance isn't going to be a big deal. Ideally, I'd like to be able to hook it in with jQuery so tha... | <p>I've just put together what you may be looking for: <a href="http://www.graphdracula.net" rel="noreferrer">http://www.graphdracula.net</a></p>
<p>It's JavaScript with directed graph layouting, SVG and you can even drag the nodes around. Still needs some tweaking, but is totally usable. You create nodes and edges eas... | <p>As guruz mentioned, the <a href="http://philogb.github.io/jit/" rel="nofollow noreferrer">JIT</a> has several lovely graph/tree layouts, including quite appealing RGraph and HyperTree visualizations.</p>
<p>Also, I've just put up a super simple SVG-based <a href="http://github.com/jackrusher/jssvggraph" rel="nofoll... | 2,869 |
<p>I have just upgraded my board to TH3D's <a href="https://www.th3dstudio.com/product/ezboard-lite/" rel="nofollow noreferrer">EZBoard Lite</a> with their <a href="https://www.th3dstudio.com/knowledgebase/ezboard-installation-guide/" rel="nofollow noreferrer">Unified Firmware (U2.R1.15)</a> and whilst dialling in all ... | <p>There are multiple ways to achieve this:</p>
<h2>In G-code</h2>
<p>You don't necessarily need to do that in firmware, TH3D is based on Marlin firmware and is just a monolithic implementation for most popular printers and boards that helps novice users to easily configure their printer, but in the meantime it hides o... | <p>I dont know if you managed to solve this but if not I was facing the same issue and managed to do it just by searching all sketches for those parameters in Arduino IDE. They are not all in configuration.h like shown in the Teaching Tech video. Most of them are in configuration_backend.h and some in conditionals_LCD.... | 1,546 |
<p><a href="https://stackoverflow.com/questions/180/function-for-creating-color-wheels">Original Question</a></p>
<p>I am looking for a function that attempts to quantify how "distant" (or distinct) two colors are. This question is really in two parts: </p>
<ol>
<li>What color space best represents human vision?</li>... | <p>Convert to La*b* (aka just plain "Lab", and you'll also see reference to "CIELAB"). A good quick measaure of color difference is </p>
<blockquote>
<p>(L1-L2)^2 + (a1-a2)^2 + (b1-b2)^2</p>
</blockquote>
<p>Color scientists have other more refined measures, which may not be worth the bother, depending on accur... | <p>The easiest <em>distance</em> would of course be to just consider the colors as 3d vectors originating from the same origin, and taking the distance between their end points.</p>
<p>If you need to consider such factors that green is more prominent in judging intensity, you can weigh the values.</p>
<p><a href="htt... | 2,372 |
<p><a href="https://3dprinting.stackexchange.com/questions/871/is-22-guage-stranded-hookup-wire-the-correct-wire-to-connect-the-switching-power">I'm still looking at wires</a> for my Prusa i3, to go between the power supply and <a href="http://reprap.org/wiki/RAMPS_1.4" rel="nofollow noreferrer">RAMPS 1.4</a>, and <a h... | <p><strong>THHN</strong> wire is thermoplastic high heat-resistant nylon coated wire.<br>
<strong>THWN</strong> is thermoplastic heat- and moisture-resistant nylon coated wire.</p>
<p><strong>"T"</strong> stands for thermoplastic insulation covering the wire itself.<br>
<strong>"H"</strong> stands for a heat resistanc... | <h2>No "mystery meat" wire in AC electrical</h2>
<p>That kit is random Chinese "no-name" hookup wire and cannot be used for AC power. It's fine for low voltage hobbyist tinkering, which is what it's sold for. If it was better than that, <em>they'd say</em>.</p>
<p><strong>But who knows?</strong> Ma... | 254 |
<p>Can anyone tell me if there is a way with generics to limit a generic type argument <code>T</code> to only:</p>
<ul>
<li><code>Int16</code></li>
<li><code>Int32</code></li>
<li><code>Int64</code></li>
<li><code>UInt16</code></li>
<li><code>UInt32</code></li>
<li><code>UInt64</code></li>
</ul>
<p>I'm aware of the <... | <p>There's no constraint for this. It's a real issue for anyone wanting to use generics for numeric calculations.</p>
<p>I'd go further and say we need</p>
<pre><code>static bool GenericFunction<T>(T value)
where T : operators( +, -, /, * )
</code></pre>
<p>Or even</p>
<pre><code>static bool GenericFunct... | <p>If all you want is use <strong>one numeric type</strong>, you could consider creating something similar to an alias in C++ with <code>using</code>.</p>
<p>So instead of having the very generic</p>
<pre><code>T ComputeSomething<T>(T value1, T value2) where T : INumeric { ... }
</code></pre>
<p>you could have... | 5,265 |
<p>Help! I am using jQuery to make an AJAX call to fill in a drop-down dynamically given the user's previous input (from another drop-down, that is filled server-side). In all other browsers aside from Firefox (IE6/7, Opera, Safari), my append call actually appends the information below my existing option - "Select An ... | <p>Can you just change your success function to reset the selected item to the first option?</p>
<pre><code>$("#Products").append(result).selectedIndex = 0;
</code></pre>
<p>or to set it to the previous selection?</p>
<pre><code>var tmpIdx = $("#Products").selectedIndex;
$("#Products").append(result).selectedIndex =... | <p>I just did the following and it worked fine:</p>
<pre><code><select name="Products" id="Products">
<option value="">Select Product</option>
</select>
<script type="text/javascript">
$('#Products').append('<option value="1">test 1</option><option value="3">test 3</... | 8,171 |
<p>I'm using a few (2 or 3) master pages in my ASP.NET MVC application and they must each display bits of information from the database. Such as a list of sponsors, current fundings status etc.</p>
<p>So my question was, where should I put these master-page database calling code?</p>
<p>Normally, these should goes in... | <p>One way to do this is to put in the masterpage view the hook for the ViewData and then you define a BaseController : Controller (or multiple base classes) where you do all the db calls you need.</p>
<p>What you wanna do is quite the same thing described in <a href="http://weblogs.asp.net/stephenwalther/archive/2008... | <p>If you don't mind strongly typed view data, you can put all the master page data in a common base class for viewData. You can set this data in the base class's constructor. All your views requiring additional data will then need strongly typed viewdata that inherits from this base class.</p>
<p>To allow a call to V... | 8,541 |
<p>We have an error that we can't seem to find and don't have the need/resources to try and track it down. What we do need to do is just keep the freaking "Please tell Microsoft about this problem" dialog boxes from cluttering up the server.</p>
<p>It is from an MS-Access error (we think) but I can't find where Acces... | <p>From <a href="http://www.codeproject.com/KB/exception/UnhandledExceptionClass.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/exception/UnhandledExceptionClass.aspx</a>:</p>
<blockquote>
<p>If you also want to disable the Windows “Send Error Report” dialog on your computer, right-click on the “My Co... | <p>When working in .net, you can catch all unhandled exceptions (which is what causes this message). But I'm not aware of a way to do the same in Access.</p>
<p><a href="http://devcity.net/Articles/60/1/unhandled_exceptions.aspx" rel="nofollow noreferrer">http://devcity.net/Articles/60/1/unhandled_exceptions.aspx</a>... | 7,866 |
<p>Imagine the scene, you're updating some legacy Sybase code and come across a cursor. The stored procedure builds up a result set in a #temporary table which is all ready to be returned except that one of columns isn't terribly human readable, it's an alphanumeric code.</p>
<p>What we need to do, is figure out the p... | <p>You have to have a XRef table if you want to take out the cursor. Assuming you know the 100 distinct lookup values (and that they're static) it's simple to generate one by calling proc_code_xref 100 times and inserting the results into a table</p>
| <p>They say, that if you must use cursor, then, you must have done something wrong ;-) here's solution without cursor:</p>
<pre><code>declare @lookup_code char(8)
select distinct lookup_code
into #lookup_codes
from #workinprogress
while 1=1
begin
select @lookup_code = lookup_code from #lookup_codes
if @@row... | 3,538 |
<p>So I recently installed a genuine E3D V6 (direct) on my AM8 (Anet a8 with upgraded frame). I have already been able to fix most of the print quality problems. But the last one is a hard one for me. </p>
<p>It prints super fine up until a certain height. Then the extruder starts slipping and starts making weird nois... | <p>I used a different heat break with a PFTE lining inside. After that it ran smoothly. </p>
<p>Probably what was happening was that my filament was getting too hot and started to stick on the full metal heat break. </p>
| <p>I have had some similar problems as you describe with my custom build CoreXY printer. I used an all-metal heat break for my 2.85 mm diameter filament. The heat break clogged up. I found that the inner diameter of the heatbreak, although specifically designed for 3 mm filament, narrowed down having a ledge inside. I ... | 901 |
<blockquote>
<p>Note that this question continues from <a href="https://stackoverflow.com/questions/15414/">Is it possible to coax Visual Studio 2008 into using italics for comments?</a></p>
</blockquote>
<p>If the long question title got you, here's the problem:</p>
<blockquote>
<p>How to convert the style prope... | <p>Alright, I've successfully used FontForge to create a copy of Consolas (although this should work with any font) with the bold style actually being italics.</p>
<p>These are the steps that I followed:</p>
<ul>
<li>Install <a href="http://fontforge.sourceforge.net/" rel="noreferrer">FontForge</a>. It's a lot easier... | <p>I did the italics-as-bold trick on Consolas back in July 2007 and posted a <a href="http://damieng.com/blog/2007/07/11/italic-syntax-highlighting-in-visual-studio-2005" rel="nofollow noreferrer">screenshot of it on my blog</a>.</p>
<p>I used FontLab which does a great job but a custom tool to copy and set the header... | 3,814 |
<p>I cannot figure out how to change the title bar icon (the icon in the furthest top left corner of the application) in Adobe AIR. It is currently displaying the default 'Adobe AIR' red icon. </p>
<p>I have been able to change it in the system tray, however.</p>
| <p>Does the following help?</p>
<p><a href="http://groups.google.com/group/chennai-flex-user-group/browse_thread/thread/cffb9ab56450c28e" rel="nofollow noreferrer">http://groups.google.com/group/chennai-flex-user-group/browse_thread/thread/cffb9ab56450c28e</a></p>
| <p>The first link shows how to change the Taskbar Icon, the second shows the application icon I believe used on the desktop. I am going to recompile and install the application and see if it works.</p>
<p>Edit: Yea, the one that changes the Desktop Icon also changes the Title Bar icon. It's in the app.xml file.</p>
| 3,892 |
<p>Is there any way in the Servlet API to access properties specified in web.xml (such as initialization parameters) from within a Bean or Factory class that is not associated at all with the web container?</p>
<p>For example, I'm writing a Factory class, and I'd like to include some logic within the Factory to check ... | <p>One way you could do this is:</p>
<pre><code>public class FactoryInitialisingServletContextListener implements ServletContextListener {
public void contextDestroyed(ServletContextEvent event) {
}
public void contextInitialized(ServletContextEvent event) {
Properties properties = new Properties... | <p>I think that you will have to add an associated bootstrap class which takes a reference to a ServletConfig (or ServletContext) and transcribes those values to the Factory class. At least this way you can package it separately.</p>
<p>@toolkit : Excellent, most humbled - This is something that I have been trying to ... | 6,302 |
<p>Whilst analysing some legacy code with FXCop, it occurred to me is it really that bad to catch a general exception error within a try block or should you be looking for a specific exception. Thoughts on a postcard please.</p>
| <p>Obviously this is one of those questions where the only real answer is "it depends."</p>
<p>The main thing it depends on is where your are catching the exception. In general libraries should be more conservative with catching exceptions whereas at the top level of your program (e.g. in your main method or in the t... | <p>For my IabManager class, which I used with in-app billing (from the TrivialDrive example online), I noticed sometimes I'd deal with a lot of exceptions. It got to the point where it was unpredictable.</p>
<p>I realized that, as long as I ceased the attempt at trying to consume an in-app product after one exception... | 4,195 |
<p>What are the methods to auto eject parts (into a collection area/box/basket) in order for the 3D printer to continue printing?</p>
<p>For some reason this feature isn't common (yet?). Is there a hidden reason why?</p>
<p>Will using the print head to ram the part off the build plate into a basket nearby cause the p... | <p>While the "best" method is probably unanswerable since it would be based on very specific requirements and subject to change as soon as a better method were devised, here are some feasible methods to auto-eject 3d printed parts.</p>
<p>Some of these are methods that I've considered for my personal use, others have ... | <p>Here's a wild idea. Since you're planning to have a bed which only moves in the Z-axis, build a roller system which feeds a thin, flexible layer of some material (unobtanium, I fear) to cover the build plate. The feed rollers have a weak spring to provide some tension to keep this layer flat but not overly stretche... | 406 |
<p>I just assembled Ender 3 and noticed that the X-axis movement doesn't correspond to the commands. When I make it move 1 mm with the encoder it moves 16 mm. Everything is in the "out of the box" configuration.</p>
<p>The current steps/mm for the X-axis read (from the display) 80 steps/mm.</p>
<p>Am I suppos... | <p>Direct Drive v.s. Bowden has no relation to the maximum print temperature. What determines the maximum print temperature is the design of the hotend itself. There are "all-metal" designs, where the PTFE tube (Bowden or not) stops in the cold zone and the heatbreak and all other components that get hot are ... | <p>Bowden tubes extending to the nozzle to make a seal will damage the Teflon (PTFE) tube if exceeding 250°C for an extended time. An all-metal hotend for a Bowden would have either the nozzle sealed against the heatbreak or an integrated nozzle and heatbreak. Then the Bowden tube would attach with a minimum gape wi... | 1,960 |
<p>Consider the class below that represents a Broker:</p>
<pre><code>public class Broker
{
public string Name = string.Empty;
public int Weight = 0;
public Broker(string n, int w)
{
this.Name = n;
this.Weight = w;
}
}
</code></pre>
<p>I'd like to randomly select a Broker from an a... | <p>Your algorithm is nearly correct. However, the test should be <code><</code> instead of <code><=</code>:</p>
<pre><code>if (randomNumber < broker.Weight)
</code></pre>
<p>This is because 0 is inclusive in the random number while <code>totalWeight</code> is exclusive. In other words, a broker with weight 0... | <p>I've come up with a generic version of this solution:</p>
<pre><code>public static class WeightedEx
{
/// <summary>
/// Select an item from the given sequence according to their respective weights.
/// </summary>
/// <typeparam name="TItem">Type of item item in the given sequence.&... | 8,074 |
<p>I'm just curious if any project exists that attempts to group all (or most) of PHP's built-in functions into a more object-oriented class hierarchy. For example, grouping all the string functions into a single String class, etc.</p>
<p>I realize this won't actually solve any problems (unless the modifications took ... | <p>I think something like this is intergral for PHP to move forward. Being mainly a .Net programmer, I find PHP painful to work in with it's 1 million and 1 global functions. It's nice that PHP 5.3 has namespaces, but it doesn't help things much when their own libraries aren't even object oriented, let alone employ n... | <p>I don't agree. Object Oriented Programming is not inherently better than procedural programming. I believe that you should not use OO unless you need polymorphic behavior (inheritance, overriding methods, etc). Using objects as simple containers for code is not worth the overhead. This is <em>particularly</em> true ... | 8,710 |
<p>I like to study languages outside my comfort zone, but I've had a hard time finding a place to start for functional languages. I heard a lot of good things about <a href="https://rads.stackoverflow.com/amzn/click/com/0070004846" rel="noreferrer" rel="nofollow noreferrer">Structure and Interpretations of Computer Pr... | <p><a href="http://www.ccs.neu.edu/home/matthias/BTLS/" rel="noreferrer">The Little Schemer</a> teaches recursion really well, and it's fun and simple to read. </p>
<p>I also liked <a href="http://www.scheme.com/tspl3/" rel="noreferrer">The Scheme Programming Language</a> for a broader introduction into the language. ... | <p>I have heard good things about <a href="https://rads.stackoverflow.com/amzn/click/com/0201342758" rel="nofollow noreferrer" rel="nofollow noreferrer">Haskell Functional Programming</a>, but I also found this <a href="http://www.amazon.com/LISP-Functional-Programming-Books/lm/36GEU8N3B2JPW" rel="nofollow noreferrer">... | 4,313 |
<p>I am trying to implement AJAX in my Google App Engine application, and so I am looking for a good AJAX framework that will help me. Anyone has any idea?</p>
<p>I am thinking about Google Web Toolkit, how good it is in terms of creating AJAX for Google App Engine?</p>
| <p>As Google Web Toolkit is a <a href="http://code.google.com/support/bin/answer.py?answer=54830&topic=10208" rel="nofollow noreferrer">subset of Java</a> it works best when you Java at the backend too. Since Google App Engine is currently <a href="http://code.google.com/appengine/kb/general.html#language" rel="no... | <p>If you want to be able to invoke method calls from JavaScript to Python, <a href="http://json-rpc.org/wiki/python-json-rpc" rel="nofollow noreferrer">JSON-RPC</a> works well with Google App Engine. See Google's article, "<a href="http://code.google.com/appengine/articles/rpc.html" rel="nofollow noreferrer">Using AJ... | 7,757 |
<p>I know I should use different nozzles for filaments that use vastly different temperatures but what about filament types that use similar temperatures?</p>
<p>For example, PLA and PLA composites like ColorFabb Woodfill filament. Should I use a separate nozzle for that?</p>
| <p>There is absolutely no reason to use different nozzles, <em>not even if filaments do require different temperatures</em>.</p>
<p>The only exception is when printing abrasive filaments (such as glow-in-the-dark and carbon-fiber) in which case you should use an abrasion-resistant, stainless steel nozzle. This nozzle ... | <p>It depends on the size of the nozzle you are using. If you are using a small nozzle, e.g. 0.2 mm, normally, you should increase the nozzle diameter (filament manufacturers often refer to about 0.5 mm nozzle diameters). Wood/cork, or whatever particle filled filament requires a somewhat larger diameter to p... | 390 |
<p>Is there a way to tell MS SQL that a query is not too important and that it can (and should) take its time?</p>
<p>Likewise is there a way to tell MS SQL that it should give higher priority to a query?</p>
| <p>Not in versions below SQL 2008. In SQL Server 2008 there's the resource governor. Using that you can assign logins to groups based on properties of the login (login name, application name, etc). The groups can then be assigned to resource pools and limitations or restrictions i.t.o. resources can be applied to those... | <p>I'm not sure if this is what you're asking, but I had a situation where a single UI click added 10,000 records to an email queue (lots of data in the body). The email went out over the next several days so it didn't need to be a high priority, in fact it would bog the server every time it happened.</p>
<p>I split ... | 8,594 |
<p>What options exist for accessing different databases from C++?
Put differently, what alternatives are there to ADO?
What are the pros and cons?</p>
| <ol>
<li><a href="http://msdn.microsoft.com/en-us/library/ms710252.aspx" rel="nofollow noreferrer">Microsoft ODBC</a>.</li>
<li>The MFC ODBC classes such as <a href="http://msdn.microsoft.com/en-us/library/2dhc1abk.aspx" rel="nofollow noreferrer">CDatabase</a>.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/... | <p>One thing - if speed is important and your code doesn't need to be portable, then it may be worth it to use the native libraries. </p>
<p>I don't know much about SQL Server, but I do know that the Oracle OCI calls are faster than using ODBC. But, they tie you to Oracle's version of SQL. It would make sense for SQL ... | 7,277 |
<p>I'm trying to use Visual Studio 2008's extensibility to write an addin that will create a project folder with various messages in it after parsing an interface. I'm having trouble at the step of creating/adding the folder, however. I've tried using </p>
<pre><code>ProjectItem folder =
item.ProjectItem.Collection.A... | <p>Yup, that was it...</p>
<pre><code>DirectoryInfo dirInfo = new DirectoryInfo(newDirectoryParent + newDirectoryName);
if (dirInfo.Exists)
{
dirInfo.Delete(true);
item.DTE.ExecuteCommand("View.Refresh", string.Empty);
}
ProjectItem folder = item.ProjectItem.Collection.AddFolder(newDirectoryName, string.Empt... | <p>here's an idea i thought of because i've been using NAnt for so long and thought it might work. </p>
<p>Open the .csproj file in a text editor and add the directory as such:</p>
<pre><code><ItemGroup>
<compile include="\path\rootFolderToInclude\**\*.cs" />
</ItemGroup>
</code></pre>
<p>if an ... | 8,991 |
<p>I would like to quickly send email from the command line. I realize there are probably a number of different ways to do this.</p>
<p>I'm looking for a simple way to do this from a linux terminal (likely a bash shell but anything should do) and an alternative way to do this on Windows. I want to be able to whip up... | <pre><code>$ echo "This is the email body" | mail -s "This is the subject" me@email.com
</code></pre>
<p>Alternatively:</p>
<pre><code>$ cat | mail -s "A few lines off the top of my head" me@here.com
This is where my
multiline
message would go
^D
</code></pre>
<p>^D - means press <kbd>ctrl</kbd>+<kbd>d</kbd></p>
| <p>If you want to invoke an email program, then see this article:</p>
<p><a href="https://stackoverflow.com/questions/17373/how-do-i-open-the-default-mail-program-with-a-subject-and-body-in-a-cross-platf">How do I open the default mail program with a Subject and Body in a cross-platform way?</a></p>
| 5,708 |
<p>I'm looking for a way to get the size of an instance of a reference type. sizeof is only for value types. Is this possible?</p>
| <p>You need <a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.sizeof.aspx" rel="noreferrer">Marshal.SizeOf</a></p>
<p><strong>Edit:</strong> This <em>is</em> for unsafe code, but then, so is sizeof().</p>
| <p>Beware that Marshal.SizeOf is for unsafe code...</p>
<p>I don't think it's possible for managed code though, maybe you can explain your problem, there may be another way to solve it</p>
| 4,614 |
<p>I am considering creating my own website using Java and am trying to decide what framework to use. However, doing a quick search for Java frameworks returns more than 50 to choose from!</p>
<p>My website is just going to be for my own enjoyment of building it in the beginning, but if it becomes popular, it would be... | <p>I've used <a href="http://tapestry.apache.org/tapestry3/" rel="noreferrer">Tapestry 3</a>, <a href="http://wicket.apache.org/" rel="noreferrer">Wicket</a>, <a href="http://echo.nextapp.com/site/" rel="noreferrer">Echo</a>, and <a href="http://www.oracle.com/technetwork/java/javaee/javaserverfaces-139869.html" rel="n... | <p>Can't believe no one has mentioned GWT</p>
| 4,423 |
<p>I'm looking for a way to delete a file which is locked by another process using C#. I suspect the method must be able to find which process is locking the file (perhaps by tracking the handles, although I'm not sure how to do this in C#) then close that process before being able to complete the file delete using <co... | <p>Killing other processes is not a healthy thing to do. If your scenario involves something like uninstallation, you could use the <a href="https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexa" rel="nofollow noreferrer"><strong><code>MoveFileEx</code></strong> API function</a> to mark the... | <p>Oh, one big hack I employed years ago, is that Windows won't let you <em>delete</em> files, but it does let you <em>move</em> them.</p>
<p>Pseudo-sort-of-code:</p>
<pre><code>mv %WINDIR%\System32\mfc42.dll %WINDIR\System32\mfc42.dll.old
Install new mfc42.dll
Tell user to save work and restart applications
</code><... | 2,345 |
<p>I am attempting to update a project from ASP.NET MVC Preview 3 to Preview 5 and it seems that Controller.ReadFromRequest(string key) has been removed from the Controller class. Does anyone know of any alternatives to retrieving information based on an identifier from a form?</p>
| <p>Looks like they've added controller.UpdateModel to address this issue, signature is:</p>
<pre><code>UpdateModel(object model, string[] keys)
</code></pre>
<p>I haven't upgraded my app personally, so I'm not sure of the actual usage. I'll be interested to find out about this myself, as I'm using <code>controller.Re... | <p>could you redo that link in something like tinyurl.com?</p>
<p>I need this info too but can get that mega-link to work.</p>
| 5,670 |
<p>is there an alternative for <code>mysql_insert_id()</code> php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. However, there are times that the primary key is not a serial column....</p>
| <p>From the PostgreSQL point of view, in pseudo-code:</p>
<pre><code> * $insert_id = INSERT...RETURNING foo_id;-- only works for PostgreSQL >= 8.2.
* INSERT...; $insert_id = SELECT lastval(); -- works for PostgreSQL >= 8.1
* $insert_id = SELECT nextval('foo_seq'); INSERT INTO table (foo...) values ($insert_... | <p>Check out the <a href="http://www.postgresql.org/docs/current/interactive/sql-insert.html" rel="nofollow noreferrer">RETURNING optional clause</a> for an INSERT statement. (Link to official PostgreSQL documentation)</p>
<p>But basically, you do:</p>
<pre><code>INSERT INTO table (col1, col2) VALUES (1, 2) RETURNING... | 7,980 |
<p>When printing objects higher than approximately 8-10 cm, sometimes nozzle hits the printed model and knocks over it. After 7-8 hours of printing that's really annoying. I'm using Creality Ender 3 Pro with Ultimaker Cura. How can I avoid this problem?</p>
<p>As a note; it happens with thick, wide models without... | <p>It seems the problem was because of Z-axis leveling (level of the X-axis), I found out that the right side was more than 3-4 mm below the left side when the Z-axis height exceeds around 8-10 cm. Below 8-10 cm, the two sides were even. I calibrated the X-axis by turning the eccentric nuts of the wheels... | <p>There are options in Cura to avoid that the extruder hovers over printed parts when traveling. There is also an option to lift Z axis while traveling. Those options are hidden by default. You can only enable them in advanced settings mode.</p>
| 1,360 |
<p>What was the motivation for having the <code>reintroduce</code> keyword in Delphi?</p>
<p>If you have a child class that contains a function with the same name as a virtual function in the parent class and it is not declared with the override modifier then it is a compile error. Adding the reintroduce modifier in s... | <p>If you declare a method in a descendant class that has the same name as a method in an ancestor class then you are hiding that ancestor method — meaning if you have an instance of that descendant class (that is referenced as that class) then you will not get the behavior of the ancestor. When the ancestor's method i... | <p><strong>reintroduce</strong> allows you to declare a method with the same name as the ancestor, but with different parameters. It has nothing to do with bugs or mistakes!!!</p>
<p>For example, I often use it for constructors...</p>
<pre><code>constructor Create (AOwner : TComponent; AParent : TComponent); reintrod... | 7,736 |
<p>Our company has multiple domains set up with one website hosted on each of the domains. At this time, each domain has its own authentication which is done via cookies. </p>
<p>When someone logged on to one domain needs to access anything from the other, the user needs to log in again using different credentials on ... | <p>The SSO solution that I've implemented here works as follows:</p>
<ol>
<li>There is a master domain, <code>login.mydomain.example</code> with the script <code>master_login.php</code> that manages the logins.</li>
<li>Each client domain has the script <code>client_login.php</code></li>
<li>All the domains have a shar... | <p>If you use Active Directory you could have each app use AD for authentication, login could then be seamless. </p>
<p>Otherwise, if the applications can talk to each other behind the scenes, you could use sessionids and have one app handling id generation serving all of your other applications.</p>
| 6,628 |
<p>I've been trying to figure out a regex to allow me to search for a particular string while automatically skipping comments. Anyone have an RE like this or know of one? It doesn't even need to be sophisticated enough to skip <code>#if 0</code> blocks; I just want it to skip over <code>//</code> and <code>/*</code> ... | <p>This is a harder problem than it might at first appear, since you need to consider comment tokens inside strings, comment tokens that are themselves commented out etc.</p>
<p>I wrote a string and comment parser for C#, let me see if I can dig out something that will help... I'll update if I find anything.</p>
<p>E... | <p>I would make a copy and strip out the comments first, then search the string the regular way.</p>
| 7,764 |
<p>I've started printing PETG recently and I'm happy with results so far, awesome strength and good looking (except for stringing). But I've noticed that PETG prints better with more distance nozzle-plate than usual, and under-extrusion make parts looking better than both normal/over-extrusion.</p>
<ul>
<li>What dista... | <p>Here is the mental framework that I use to reason about PETG: In a nutshell you want to <strong>avoid nozzle contact</strong>.</p>
<p>Unlike most other plastics, PETG sticks to hot brass really well and every time the nozzle moves through material it will pick up some of it. Material around the the nozzle then stic... | <p>On my Ender 3 Pro's I have found the following works well (also remember settings can be effected by different brand/quality of filament):</p>
<ul>
<li>Bed to nozzle 0.2-0.3 mm,</li>
<li>Multiplier 100 %,</li>
<li>Nozzle ~230 °C/bed 70 °C,</li>
<li>Speed 50 mm/s.</li>
<li>Cooling off first few layers but from there ... | 1,195 |
<p>I am planning on buying a cheap 3D printer to get into 3D printing, but the printer I'm planning to buy only takes 1.75 mm filament, I was wondering if it might be possible to change the hotend of that printer or something to take in 3.0 mm filament, the reason I want to use 3.0 mm filament is because it is cheaper ... | <p>First it really depends on your printer / extruder. That said generally 1.75 mm is cheaper and much more common.</p>
<p>If one were to change the hotend, likely you will need to replace most or all of the hot end. In the case of my personal hot ends, when I did this conversion I had to replace both the tube and the ... | <p>I had my printer Anycubic-Chiron converted from 1.75 mm filament to 3.00 mm, as it is big enough to handle bigger filament and the printer itself came with two sizes of the heatsink - the other fit to 3.00 mm filament.</p>
<p>In addition, I changed my extruder to a "Bulldog" extruder kit for 1.75 and 3 mm ... | 461 |
<p>Is there any way to have a binary compiled from an ActionScript 3 project print stuff to <em>stdout</em> when executed?</p>
<p>From what I've gathered, people have been going around this limitation by writing hacks that rely on local socket connections and AIR apps that write to files in the local filesystem, but t... | <p>With AIR on Linux, it is easy to write to stdout, since the process can see its own file descriptors as files in /dev.</p>
<p>For stdout, open <code>/dev/fd/1</code> or <code>/dev/stdout</code> as a <code>FileStream</code>, then write to that.</p>
<p>Example:</p>
<pre><code>var stdout : FileStream = new FileStrea... | <p>If you are using a debug Flash Player, you can have the Flash Player log trace messages to a file on your system.</p>
<p>If you want real time messages, then you could tail the file.</p>
<p>More info:</p>
<p><a href="http://blog.flexexamples.com/2007/08/26/debugging-flex-applications-with-mmcfg-and-flashlogtxt/" ... | 5,958 |
<p>I have a web application that should behave differently for internal users than external ones. The web application is available over the Internet, and therefore obviously to the internal users as well.</p>
<p>All the users are anonymous, not authenticated, but the page should render differently for internal users t... | <p>I recommend using IP addresses as well. I'm dealing with this exact same situation setting up an authentication system right now as well and the conditions described by Epso and Robin M are exactly what is happening. External users coming to the site give me their actual IP address while all internal users provide... | <p>There might be a firewall that is doing some sort of NAT, to enable inside clients to use the external dns-name to reach the server.</p>
<p>Is the IP-number you get on customer site the same at the external customer-server ip? In that case you can hard code for that one IP-address. All internal computers behind tha... | 6,748 |
<p>Here is a quick test program:</p>
<pre><code> public static void main( String[] args )
{
Date date = Calendar.getInstance().getTime();
System.out.println("Months:");
printDate( "MMMM", "en", date );
printDate( "MMMM", "es", date );
printDate( "MMMM", "fr", date );
printDate( "MMMM", "de"... | <p>Not all languages share english capitalization rules. I guess you'd need to alter the data used by the API, but your non-english clients might not appreciate it...</p>
<p><a href="http://french.about.com/library/writing/bl-capitalization.htm" rel="noreferrer">about.com on french capitalization</a></p>
| <p>I'm having a problem now where a sentence begins with "dimanche 07 mars", which wouldn't matter if it were not at the beginning of a sentence. I guess this cannot be changed, unless I do manual string manipulation on the first character of the string.</p>
| 9,228 |
<p>Why does my 3 mm PLA filament always snap near the spool some time (usually a few hours) after a print has finished?</p>
<p>I have had it snap mid print but this is quite rare.</p>
<p>I have 3 rolls of 3 mm PLA filament from Velleman and 3DPrima. They all exhibit this behavior. They are between 2 and 3 y... | <p>PLA seems to become brittle with age. Micro-fractures develop on the surface, and they will grow if filament is taken off the spool and held straight. This behaviour does not seem to be linked to moisture content. The best course of action is probably to use PLA quickly. Don't give it time to age.</p>
| <p>PLA snapping is pretty universal. The best countermeasure is to always remove the filament from the printer after a print and place it in a low-humidity chamber. Other answers speak of moisture-induced micro-cracks, for which I have no evidence for or against.</p>
<p>This has occurred for me when I've been lazy a... | 1,541 |
<p>E3D mentions on their <a href="http://wiki.e3d-online.com/wiki/E3D-v6_Assembly#Usage_Guidance" rel="nofollow noreferrer">own wiki</a>:</p>
<blockquote>
<p>Excessively long retractions will cause issues by dragging soft filament into cold areas. [...] for bowden systems you might want to go up to 2 mm. Retrac... | <p>Yes, you can increase retraction past E3D's max 2 mm recommendation to compensate for Bowden tube stretch and slop. The reason for the recommendation is that jams will occur with most all-metal hot ends if you pull molten filament up into the cold zone. Any molten filament that enters the cold zone rapidly cool... | <p>In addition to the already excellent answers above, I want to mention that maybe a change in hotend temperature (lower) can also help reducing ooze/stringing. That is, if not other parameters prevent that.</p>
| 238 |
<p>I recently found out carbon fiber and glow in the dark PLA can damage the printer nozzle, now I'm suspicious of all the "exotic" filaments.</p>
<p>So, does wood filament cause damage to the nozzle? (under normal use, or at least what someone who only used PLA/ABS before would consider normal use)</p>
<p>Let's assu... | <p>If you haven't been to their site before, you should check out the forums on 3DHubs. There's a lot of how-to's. A quick Google search yields <a href="https://www.3dhubs.com/talk/thread/accelerated-nozzle-wear" rel="noreferrer">this</a> link to a similar question.</p>
<p>The key thing to note is that in all technica... | <p>If you haven't been to their site before, you should check out the forums on 3DHubs. There's a lot of how-to's. A quick Google search yields <a href="https://www.3dhubs.com/talk/thread/accelerated-nozzle-wear" rel="noreferrer">this</a> link to a similar question.</p>
<p>The key thing to note is that in all technica... | 175 |
<p>I'm doing a fair bit of work in Ruby recently, and using</p>
<pre><code> ruby script/console
</code></pre>
<p>Is absolutely critical. However, I'm really disappointed with the default Windows console in Vista, especially in that there's a really annoying bug where moving the cursor back when at the bottom of the s... | <p>I use <a href="http://sourceforge.net/projects/console/" rel="nofollow noreferrer">Console2</a>.</p>
<p>I like the tabbed interface and that copy works properly if text breaks at the end of a line.</p>
| <p><a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" rel="nofollow noreferrer">Powershell</a></p>
<blockquote>
<p>Windows PowerShell is Microsoft's task automation framework, consisting of a command-line shell and associated scripting language built on top of, and i... | 6,246 |
<p>I want to delete foo() if foo() isn't called from anywhere.</p>
| <p><a href="http://www.mono-project.com/Gendarme" rel="nofollow noreferrer">Gendarme</a> will detect private methods with no upstream callers. It is available cross platform, and the latest version handles "<a href="http://www.mono-project.com/Gendarme.Rules.Performance" rel="nofollow noreferrer">AvoidUncalledPrivateCo... | <p><a href="http://www.jetbrains.com/resharper/" rel="nofollow noreferrer">Resharper</a> does this, and not just with methods. It also does it with using statements, variables etcetera.</p>
| 9,132 |
<p>Short version: I want to trigger the Form_Load() event without making the form visible. This doesn't work because Show() ignores the current value of the Visible property:</p>
<pre><code>tasksForm.Visible = false;
tasksForm.Show();
</code></pre>
<p>Long version: I have a WinForms application with two forms: main a... | <p>I totally agree with Rich B, you need to look at where you are placing your application logic rather than trying to cludge the WinForms mechanisms. All of those operations and data that your Tasks form is exposing should really be in a separate class say some kind of Application Controller or something held by your ... | <p>If you make the method public, then you could access it directly.... however, there could be some unexpected side effects when you call it. But making it public and calling it directly will not draw the screen or open the form.</p>
| 9,249 |
<p>I want to put songs on a web page and have a little play button, like you can see on Last.fm or Pandora. There can be multiple songs listed on the site, and if you start playing a different song with one already playing, it will pause the first track and begin playing the one you just clicked on. I think they use Fl... | <p>There are <strong>many</strong> flash mp3 players that you can use that do this. Usually, you just have to edit a text file to point at the mp3s you want to have available.</p>
<p>Here is the first one that showed up on a google search for <code>flash mp3 player</code>: <a href="http://www.flashmp3player.org/demo.h... | <p>This is fairly simple if you want to embed the WMP you can use all the controls via JavaScript. There is a great MSDN section on it but I cant seem to find it now.<br /><br />Edit: I found <a href="http://msdn.microsoft.com/en-us/library/ms909930.aspx" rel="nofollow noreferrer">this</a> on MSDN it contains the prope... | 7,059 |
<p>I have something like this:</p>
<pre>
barProgress.BeginAnimation(RangeBase.ValueProperty, new DoubleAnimation(
barProgress.Value, dNextProgressValue,
new Duration(TimeSpan.FromSeconds(dDuration)));
</pre>
<p>Now, how would you stop that animation (the <code>DoubleAnimation</code>)? The reason I want to do ... | <p>To stop it, call <code>BeginAnimation</code> again with the second argument set to <code>null</code>.</p>
| <p>You can use this code:</p>
<pre><code>[StoryBoardName].Remove([StoryBoardOwnerControl]);
</code></pre>
| 4,066 |
<p>When writing code do you consciously program defensively to ensure high program quality and to avoid the possibility of your code being exploited maliciously, e.g. through buffer overflow exploits or code injection ?</p>
<p>What's the "minimum" level of quality you'll always apply to your code ?</p>
| <p>In my line of work, our code has to be top quality.<br>
So, we focus on two main things:</p>
<ol>
<li>Testing</li>
<li>Code reviews</li>
</ol>
<p>Those bring home the money.</p>
| <p>I always work to prevent things like injection attacks. However, when you work on an internal intranet site, most of the security features feel like wasted effort. I still do them, maybe just not as well.</p>
| 2,854 |
<p>The page <em><a href="http://www.codinghorror.com/blog/archives/001167.html" rel="noreferrer">Protecting Your Cookies: HttpOnly</a></em> explains why making HttpOnly cookies is a good idea.</p>
<p>How do I set this property in Ruby on Rails?</p>
| <p>Set the 'http_only' option in the hash used to set a cookie</p>
<p>e.g. <pre>cookies["user_name"] = { :value => "david", :httponly => true }</pre></p>
<p>or, in Rails 2:</p>
<p>e.g. <pre>cookies["user_name"] = { :value => "david", :http_only => true }</pre></p>
| <p>I also wrote a patch that is included in Rails 2.2, which defaults the CookieStore session to be http_only. </p>
<p>Unfortunately session cookies are still by default regular cookies.</p>
| 9,788 |
<p>What is the best way for me to determine a controller variable's value during execution?</p>
<p>For example, is there a way I can insert a break in the code, and cause the value of the variable to be output to the screen (or the log)?</p>
| <p>Yes. The easiest way is to raise the value as a string. Like so: <code>raise @foo.to_s</code></p>
<p>Or, you can install the debugger (<code>gem install ruby-debug</code>), and then start the development server with the <code>--debugger</code> flag. Then, in your code, call the <code>debugger</code> instruction.</p... | <p>Raising an exception is the fastest way if you just need to look at a value, but it's worth the time to learn how to use the debugger properly. It's rare that you would only need to just see the value of a variable, you are likely trying to find a bug in your code, and that's what a debugger is for.</p>
<p>Sending ... | 8,570 |
<p>In Cura, when you enable "Print support structure", is there a way to see what it will look like?</p>
| <p>Select the View Modes Button in the upper right hand corner, and select Layers.</p>
<p><a href="https://i.stack.imgur.com/grPQi.png" rel="noreferrer"><img src="https://i.stack.imgur.com/grPQi.png" alt="Cura"></a></p>
| <p>Cura generates support based on the outlines of the layers which will be printed, rather based on the triangles of the 3D model.
It is therefore not possible to show the generated support in the solid view.</p>
<p>You can view the support in the layer view however.
In Cura 2 that's on the left bottom of the screen.... | 205 |
<p>I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look like this:</p>
<pre><code><system.web>
<authentication mode="Forms">
<forms loginUrl="De... | <p><strong>Here was the problem and solution</strong>: </p>
<p>Earlier in development I had gone to the Website menu and clicked on Asp.net configuration. This resulted in the following line being added to the web.config: </p>
<pre><code><system.web>
<roleManager enabled="true" />
</system.web>
</... | <p>this is just a random shot, but are you getting blocked because of the order of authorization for Admin? Maybe you should try switching your deny all and your all Admin.</p>
<p>Just in case it's getting overwritten by the deny.</p>
<p>(I had code samples in here but they weren't showing up.</p>
| 8,016 |
<p>I've created a webservice and when I want to use its methods I instantiate it in the a procedure, call the method, and I finally I dispose it, however I think also it could be okay to instantiate the webservice in the "private void Main_Load(object sender, EventArgs e)" event.</p>
<p>The thing is that if I do it th... | <p>It depends on how often you are going to be calling the web service. If you're going to be calling it almost constantly, it would probably be better to use method #2. However, if it's not going to be getting called quite so often, you are better off using method #1, and only instantiating it when you need it.</p>
| <p>Right now I made a solution for a mobile device and it turns to be used on irregular times, it could be used in 10 minutes, 1 hour, 4 hours its very variable, it seems that the better aproach is the first strategy.</p>
<p>Last year we went on a project where we used webservices, the fact is that we instantiated our... | 3,416 |
<p>I have an Ender 5 printer, which is a frame-based printer with no enclosure. However, I want to print ABS. Some experiments with a massive cardboard box have shown me I need an enclosure.</p>
<p>Because the printer has a box frame, fitting some perspex sheets will be easy. The bit that won't be easy is the top - th... | <p>Sides without a top will help.</p>
<p>Sides with a top will help more.</p>
<p>Do you need either? That depends. How warm, how dry, how drafty is your printing room?</p>
| <p>If ambient temp gets under 70°F, layer adhesion becomes a real problem. I have found that enclosing the space and adding heat makes the printing more reliable.</p>
<p>This answer is based on a few years of solely printing ABS. I've got my printer on a tool cart and the spool holder is above on a post. The first tim... | 1,583 |
<p>I know I can call the GetVersionEx Win32 API function to retrieve Windows version. In most cases returned value reflects the version of my Windows, but sometimes that is not so.</p>
<p>If a user runs my application under the compatibility layer, then GetVersionEx won't be reporting the real version but the version ... | <p>The best approach I know is to check if specific API is exported from some DLL. Each new Windows version adds new functions and by checking the existance of those functions one can tell which OS the application is running on. For example, Vista exports <a href="http://msdn.microsoft.com/en-us/library/ms724451(VS.85)... | <p><strong>Note:</strong> Gabr is asking about an approach that can bypass the limitations of <code>GetVersionEx</code>. JCL code uses GetVersionEx, and is thus subject to compatibility layer. This information is for people who don't need to bypass the compatibility layer, only.</p>
<p>Using the Jedi JCL, you can a... | 8,131 |
<p>I have a seemingly unique problem. I'm trying to design models that print with single extrusion walls and are not closed volumes. For example, a topographical map model printed on an edge. It has height and width, but no depth. I want the model to print with a single, non-closed extrusion per layer. Printing back an... | <p>Use Cura to slice and check out the "Surface Mode" option (might be hidden by default; if so, search for and unhide it). Also known as <code>magic_mesh_surface_mode</code>. The "Surface" choice sounds close to what you want and might suffice.</p>
| <p>If you are designing a model that has single extrusion walls, you are constructing a design which has volume. A single extrusion wall will be dependent on the nozzle diameter and extrusion multiplier. For the sake of discussion, consider the theoretical nozzle 0.4 mm with a true 0.4 mm extrusion and a 0.2 mm layer t... | 2,020 |
<p>I've created a ListBox to display items in groups, where the groups are wrapped right to left when they can no longer fit within the height of the ListBox's panel. So, the groups would appear similar to this in the listbox, where each group's height is arbitrary (group 1, for instance, is twice as tall as group 2):<... | <p>By setting the Height property on the WrapPanel to the height of the ScrollContentPresenter, it will never scroll vertically. However, if you remove that Binding, it will never wrap, since in the layout pass, it has infinite height to layout in. </p>
<p>I would suggest creating your own panel class to get the beh... | <p>I would think that you are correct that it has to do with the binding. What happens when you remove the binding? With the binding are you trying to fill up at least the entire height of the list box? If so, consider binding to MinHeight instead, or try using the <code>VerticalAlignment</code> property.</p>
| 9,987 |
<p>I search about that topic, but all what I found, was the mechanical part of the 3d printer. But I didn't find, how to program it using arduino.</p>
<p>I want to make a cartesian 3d printer. I don't have a printer yet, but I will buy all the components that I need actually.</p>
<p>I know, how to control stepper mot... | <p>Yes.
Look up Arduino Ramps 1.4</p>
<p><a href="http://reprap.org/wiki/RAMPS_1.4" rel="noreferrer">http://reprap.org/wiki/RAMPS_1.4</a></p>
<p>Following the programing is all done for you in the firmware. That said you can edit it. Just open the firmware files -- it is compiled when you upload them. Generally howe... | <p>While Star Wind's answer is best as far as addressing what was not asked, but was probably the intent of the question, for educational purposes:</p>
<p>To control the printer you need an microcontroller (most popular are Arduino) which will interface with the motor drivers. Microcontrollers cannot output the curren... | 330 |
<p>Is there a simple way to format numbers in a Winforms 1.1 datagrid? The Format property of the DataGridTextBoxColumn seems to be completely ignored. I know there is a <a href="http://support.microsoft.com/kb/318581" rel="nofollow noreferrer">solution</a> that involves subclassing a Column control, and it's fairly ... | <p>My personal opinion is that a datagridcolumnstyle is the way to go. Without seeing the code that you have, I can't say for certain why your formatting isn't taking hold when no style is defined - but mixing in formatting with data calculations and other parts of the code can get very messy very quickly.</p>
<p>Cre... | <p>I did subclass and it was easy and did work. I still don't like it so much. I was already subclassing column styles for other reasons. I'd rather handle all databinding myself, where I can more easily change it and test it. This whole mixing of the UI with the data is old school, and not in a good way.</p>
<p>T... | 5,467 |
<p>Does anyone know of any good library that abstracts the problem of path manipulation in a nice way? I'd like to be able to combine and parse paths with arbitrary separators ('/' or ':' for example) without reinventing the wheel.</p>
<p>It's a shame that <code>System.IO.Path</code> isn't more reusable.</p>
<p>Thank... | <p>System.IO.Path.Combine will work great for many different types of paths:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.io.path.combine.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.io.path.combine.aspx</a></p>
<p>System.IO.Path.Combine uses the current platform st... | <p>You're describing regular expressions! Use that as the underpinning for what you need to do. </p>
| 7,529 |
<p>The <code>System.Windows.Threading.DispatcherObject</code> class (which <code>DependencyObject</code> is based on) contains a useful function, called <code>CheckAccess()</code>, that determines whether or not the code is running on the UI thread.</p>
<p>When I wanted to use it yesterday, I was puzzled to find out t... | <p>A Microsoft employee <a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/bd0e6f6c-cadd-48f1-8e1a-163c2f17e4ca/" rel="noreferrer">recently stated</a> CheckAccess is used only for "advanced scenarios", so they hid it from Intellisense.</p>
<blockquote>
<p>"CheckAccess and VerifyAccess have
always be... | <p>I can't find any documentation that says you shouldn't use those methods directly, but I haven't looked very long.</p>
<p>Also you refer to the EditorVisibleAttribute, which doesn't exist. According to Reflector it's the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.editorbrowsableattribute... | 3,813 |
<p>I'm working on a project using 3D printed parts, everything is working very nicely except for one part that needs a 3 mm x 1.2 mm diameter rod. I can print with PLA/PLA+ but such a thin object doesn't seem viable for 3D printing. Is it still possible or am I better off using a 1.2 mm metal dowel?</p>
<p>The bigger p... | <p>It would be impossible to print this standing with the rod straight up, and even if you got it to print the part would be very weak due to the thin cross-section of the rod aligning with the layers.</p>
<p>The only way to print this part and get a usable result is to print it in the orientation shown in the picture,... | <p>If you insist on printing it entirely, I would suggest cutting the model in two halves through the centerline, printing them flat and gluing both parts together after printing. This will make sure the axial direction of the rod is in the XY plane, and doesn't require support.</p>
<p>However, the beauty of 3D printin... | 2,098 |
<p>It is difficult to describe with words what's happening, so take a look at the picture. Somehow PrusaSlicer decides to move and print in the air (blue line), where instead it can continue going from outwards to inward. I understand it wants to print first the outer layer but in this case it is obvious it will not ho... | <p>The inability to do this is not fundamental, but it's currently a limitation in slicing software, and not likely to change soon.</p>
<p>You can see from <a href="https://www.youtube.com/watch?v=c9b7Ey4LyCs" rel="nofollow noreferrer">this demo</a> that the kind of printing you want is possible. However, it's currentl... | <blockquote>
<p>How to configure PrusaSlicer to prevent printing in the air</p>
</blockquote>
<p>You need either support or change the print orientation.</p>
<p>You cannot print into the air, you can however print lines on top of a prior layer with a certain overlap, or bridge a certain gap. E.g. (screw) holes are ofte... | 2,202 |
<p>How do you page through a collection in LINQ given that you have a <code>startIndex</code> and a <code>count</code>?</p>
| <p>A few months back I wrote a blog post about Fluent Interfaces and LINQ which used an Extension Method on <code>IQueryable<T></code> and another class to provide the following natural way of paginating a LINQ collection.</p>
<pre><code>var query = from i in ideas
select i;
var pagedCollection = qu... | <p>This question is somewhat old, but I wanted to post my paging algorithm that shows the whole procedure (including user interaction).</p>
<pre><code>const int pageSize = 10;
const int count = 100;
const int startIndex = 20;
int took = 0;
bool getNextPage;
var page = ideas.Skip(startIndex);
do
{
Console.WriteLi... | 2,247 |
<p>What is the easiest way to create and verify PGP/GPG signatures from within a Python application? </p>
<p>I can call pgp or gpg using subprocess and parse the output, but I was looking for a way that didn't require an external program to be installed (my application is cross-platform mac/windows/unix).</p>
| <p>I think <a href="http://www.gnupg.org/related_software/gpgme/" rel="nofollow noreferrer">GPGME</a> and the <a href="http://pyme.sourceforge.net/" rel="nofollow noreferrer">PyMe Python wrapper</a> should do what you need.</p>
| <p>In addition to PyMe, consider <a href="http://code.google.com/p/python-gnupg/" rel="nofollow">python-gnupg</a> and the <a href="http://py-gnupg.sourceforge.net/" rel="nofollow">gnupginterface</a>.</p>
| 6,113 |
<p>I am printing a mechanical part for my printer. </p>
<p>It's a new mount for my extruders and I have been attempting to use BVOH as a support filament so that when my print is done it will cut down on the need to finish the part and possible mistakes. </p>
<p>My problem is I can get the BVOH to adhere to the bed w... | <p>Can you tell by looking at the de-adhesion what isn't sticking? </p>
<p>It may be that printing the ASA at higher temperature is melting the BVOH enough that it doesn't stick, being molten. If so, then it may be possible to print the first layer of ASA at a cooler temperature, slower if necessary to still succeed... | <p>Here's how I got it to work. I set the heat bed to 110°C and disabled the underlayer of the raft layer. I set the BVOH and the ASA to 235°C after the 4th layer I set the heatbed to 90°C and after the 6th layer I set the bed down to 60°C so that the BVOH hardened and adhered to the bed making sure that nothing curle... | 1,306 |
<p>I'm building a 40x40x40cm corexy and I am quite impatient so I want the heated to reach the target temperature as fast as possible, so I ordered a <a href="https://www.aliexpress.com/item/400X400mm-1200W-220V-w-NTC-100K-Thermistor-Keenovo-Silicone-Heater-Pad-for-Huge-Mega-Cube-3D/32550597606.html?spm=a2g0s.9042311.0... | <p>I had a similar issue building my Prusa i3 Mk2s clone. I was constantly hooking & unhooking my Arduino from my PC while the printer was plugged into the mains. At some point it had enough & it released some "magic smoke". Later on I found out this was the power regulator on the Arduino.</p>
<p>Y... | <p>The answer is, yes you can, but you need to follow guidelines.</p>
<p>Reversing +/- or otherwise incorrectly connecting power can destroy your electronics and cause fire hazard.</p>
<hr />
<p>From <a href="http://reprap.org/wiki/RAMPS_1.4" rel="nofollow noreferrer">RepRap wiki - RAMPS 1.4</a></p>
<blockquote>
<p>Max... | 872 |
<p>Can people point me to resources on lexing, parsing and tokenising with Python?</p>
<p>I'm doing a little hacking on an open source project (<a href="http://www.hotwire-shell.org/" rel="noreferrer">hotwire</a>) and wanted to do a few changes to the code that <a href="http://code.google.com/p/hotwire-shell/source/br... | <p>I'm a happy user of <a href="http://www.dabeaz.com/ply/" rel="noreferrer">PLY</a>. It is a pure-Python implementation of Lex & Yacc, with lots of small niceties that make it quite Pythonic and easy to use. Since Lex & Yacc are the most popular lexing & parsing tools and are used for the most projects, PL... | <p>I suggest <a href="http://www.canonware.com/Parsing/" rel="nofollow noreferrer">http://www.canonware.com/Parsing/</a>, since it is pure python and you don't need to learn a grammar, but it isn't widely used, and has comparatively little documentation. The heavyweight is ANTLR and PyParsing. ANTLR can generate java a... | 5,756 |
<p>In an embedded application (written in C, on a 32-bit processor) with hard real-time constraints, the execution time of critical code (specially interrupts) needs to be constant.</p>
<p>How do you insure that time variability is not introduced <strong>in the execution</strong> of the code, specifically due to the p... | <p>If you can get your hands on the hardware, or work with someone who can, you can turn off the cache. Some CPUs have a pin that, if wired to ground instead of power (or maybe the other way), will disable all internal caches. That will give predictability but not speed!</p>
<p>Failing that, maybe in certain places ... | <p>Understand your worst case runtime for complex operations and use timers.</p>
| 9,450 |
<p>I recently decided to upgrade to auto bed-leveling using an inductive proximity sensor and an aluminum build plate on my Prusa i3. I also wanted to try to secure the build plate using neodymium magnets at 4 points, with the magnets being secured with bolts to the Y-carriage, and steel washers glued to the bottom of ... | <p>Good question. The magnets from the build plate will almost certainly interfere with your inductive sensor, the movement from the carriage will induce a current in the inductor as it approaches the magnet and may cause it to trigger. If you're looking for a mag build, I'd suggest looking at: <a href="http://www.3dpr... | <p>You might use the magnets themselves or additional ones on top for the leveling process, as partly discussed in this thread:<br>
<a href="http://forums.reprap.org/read.php?1,479795" rel="nofollow">http://forums.reprap.org/read.php?1,479795</a></p>
<p>A mechanical or piezo switch might also solve the issue for you w... | 282 |
<p>I'm looking for an existing library to summarize or paraphrase content (I'm aiming at blog posts) - any experience with existing natural language processing libraries?</p>
<p>I'm open to a variety of languages, so I'm more interested in the abilities & accuracy.</p>
| <p>I think he wants to generate blog posts by automatically paraphrasing whatever was it the blogs this system is monitoring.</p>
<p>This would be really interesting if you could combine 2 to 10 blog posts that are similar, but from different sources and then do a paraphrased "real" summary automatically (the size of ... | <p>Your getting into really far out AI type domain. I have done extensive work in text transformation into machine knowledge mainly using Attempto Controlled English (see: <a href="http://attempto.ifi.uzh.ch/site/" rel="nofollow noreferrer">http://attempto.ifi.uzh.ch/site/</a>), it is a natural language (english) that ... | 4,497 |
<p>I am trying to program a small server+client in Javascript on Firefox, using XPCOM.</p>
<p>To get the HTTP message in Javascript, I am using the nsIScriptableInputStream interface.
This f**ing component through the read() method randomly cut the message and I cannot make it reliable.</p>
<p>Is anybody know a solut... | <p>I had the same problem with unreliability... I ended up using XMLHTTPRequest, which when used from the XPCOM component can do cross site requests. The second part of the <a href="http://developer.mozilla.org/en/XMLHttpRequest" rel="nofollow noreferrer">docs</a> detail how to instantiate the XPCOM version.</p>
<p>If... | <p>If you control the protocol (that is, both the client and server) I would highly recommend using Javascript/JSON for your server-to-client messages. The client can open a stream either via dynamically adding a <script> tag to the DOM. The server can then send a stream of Javascript commands like:</p>
<pre><... | 9,857 |
<p>Let's say that there is a solution that contains two projects (Project1 and Project2).</p>
<p>Project1 is set as a StartUp Project (its name is displayed in a bold font). I double-click some file in Project2 to open it. The file opens, but something else happens too - Project2 gets set as a StartUp Project.</p>
<p... | <p>The way to select a startup project is described in <a href="http://blogs.msdn.com/saraford/default.aspx" rel="noreferrer">Sara Ford's blog "Visual Studio Tip of the Day</a>" (highly recommended). She has a post there about <a href="http://blogs.msdn.com/saraford/archive/2008/07/29/did-you-know-how-to-select-the-sta... | <p>I ran into a bug where the project in bold would not be the startup project despite it being selected in the solution properties as the "single startup project".</p>
<p>One work around for this bug was un-checking deploy, from the Configuration Manager, for the non-bold project that was being incorrectly used as th... | 2,645 |
<p>This is a follow on question to "<a href="https://stackoverflow.com/questions/33778/how-do-i-delete-1-file-from-a-revision-in-svn">How do I delete 1 file from a revision in SVN?</a>" but because it probably has a very different answer and I believe that others would benefit from knowing the answer. (I don't know the... | <p>With a simple </p>
<pre><code>svn log -v [folder]
</code></pre>
<p>you can browse quickly the adding and deletion.</p>
<pre><code>------------------------------------------------------------------------
r14 | kame | 2008-08-29 04:23:43 +0200 (ven., 29 aoû2008) | 1 line
Chemins modifié :
A /a.txt
Readded a
---... | <p>I would have said you can't - you have created a new file and thus revision tree in the eyes of SVN.</p>
<p>It may be possible to recover the old tree independently (not sure if you managed an actual delete or just SVN Delete) but there is no link between the old revision tree and the new one.</p>
| 5,394 |
<p>My application dynamically loads assemblies at runtime from specific subfolders. These assemblies are compiled with dependencies to other assemblies. The runtime trys to load these from the application directory. But I want to put them into the modules directory.</p>
<p>Is there a way to tell the runtime that the d... | <p>One nice approach I've used lately is to add an event handler for the AppDomain's AssemblyResolve event.</p>
<pre><code>AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler);
</code></pre>
<p>Then in the event handler method you can load ... | <p>You can use the <code><codeBase></code> element found in the application configuration file. More information on "<a href="http://msdn.microsoft.com/en-us/library/15hyw9x3.aspx" rel="nofollow noreferrer">Locating the Assembly through Codebases or Probing</a>".</p>
<blockquote>
<p>Well, the loaded assembly d... | 4,205 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.