instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>I am wondering if anyone can help me achieve a good 3d print using polypropylene. I am trying to print custom insoles for shoes and I'm getting some bad warping/lifting (see image).</p> <p><a href="https://i.stack.imgur.com/ZKi1R.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/ZKi1R.jpg" alt="example of warping using polypropylene"></a></p> <p>Some details about the print and process:</p> <ul> <li>I have a Prusa i3 Mk2S with a Flexion extruder</li> <li>I am using what I believe is a good quality filament (Verbatim PP): <a href="https://www.verbatim.com.au/3d-printing/pp-filament/3d-pp-filament.html" rel="noreferrer">https://www.verbatim.com.au/3d-printing/pp-filament/3d-pp-filament.html</a></li> <li>I am coating my hotbead with clear packaging adhesive (OPP tape) as per the manufacturers instructions. This appears to help quite a bit.</li> <li>Bed heated to 75 degrees. I tried 100 but got hit with the "Heatbed Thermal Runaway" error which I believe indicates that not enough voltage is getting to the bed heater.</li> <li>I've tried printing at 220 degrees and 170 degrees.</li> <li>I've tried enclosing the printer in a makeshift enclosure to reduce the speed that the material is cooling at.</li> <li>Other settings: speed 40mm/s constant, 0.2mm layer height, 20% infill, 3 top bottom and side layers. </li> </ul> <p>The print takes about 5 hours and seems to stay down for an hour or two before starting to warp.</p> <p>Does anyone have any suggestions of things I should try?</p>
<p>You should enable the "brim" functionality of your slicer. This adds additional perimeters to the first layer, expanding the base of the model. The larger surface area gives more adhesion.</p>
<p>One thing that seemed to help is making sure the heated bed was 100C. I was able to do this on my Prusa by turning off the front fan (for the whole print). If I have both the fan on and the heated bed at 100C I get the "Heatbed Thermal Runaway" error.</p> <p>This produced a print that was better but still a bit warped.</p>
670
<p>I have a spool of PLA filament where the diameter is visibly inconsistent. So it will only print a meter or two and then start slipping instead of being fed into the nozzle. Is this still useful for anything or can it be salvaged somehow?</p> <p>I can't return it, the shipping costs more than the spool.</p>
<p>In principle you can re-extrude it with a somewhat simpler machine/setup than making filament from scratch, but controlling the diameter is the hard part of making filament - as you can see from how the manufacturer of yours botched it.</p> <p>I would first try insisting on a refund without returning the item unless they pay return shipping, and that they cover the original shipping cost. The product they delivered is not usable for the purpose it was advertised for.</p> <p>As for salvaging it - if that's what you really want to do, or if you end up stuck with it - as long as it's not too wide to fit through the filament path to the nozzle, an extruder that's spring loaded can <em>probably</em> manage to push it reliably. You will of course have pulsating under- and over-extrusion which will make it largely unusable for serious parts that need to be dimensionally accurate, strong, or visually appealing, but there are lots of things without these requirements it might be useful for. If your printer isn't capable of handling it, you could perhaps sell or trade it to someone whose printer can handle it.</p> <p>Getting more on the wild end of things, there are filament diameter sensors that can be integrated with your printer and firmware (I'm pretty sure Klipper supports this; not sure about Marlin and others) to measure the diameter and compensate extruder motor steps to keep the extruded volume per requested E-axis length constant. This would in theory make it possible to use the bad filament for serious prints.</p>
<p>Personally I store all my filament waste in tubs for the day a recycling/reuse solution offers itself. You can &quot;compact&quot; waste prints using hot air which also sticks the whispy pieces together. Someone will eventually come out with a &quot;re-extruder&quot; that simply cooks old filament and then produces a consistent 1.75mm or 3mm output. Cost is the limiting factor here, both in up-front equipment and ongoing electricity cost.</p> <p>Plain unused filament is specified as a pin for a hinge in some designs. However that doesn't use very much.</p> <p>It can also be used as string, but tends to break at the knot if tied tightly.</p> <p>Filament could be platted into a rope, but that's going to be more decorative than useful.</p> <p>Last thought, I've not tried it but filament has a low melting temperature compared to metals. You may be able to &quot;cast&quot; a 3D shape in a metal mold an a hot oven or with a gas torch or perhaps even in a fire. Fumes could be an issue, and you'd have to somehow stop the plastic from igniting.<br> I doubt it would be possible to cast a thin round cylinder; the top would be flat at best.</p> <hr /> <p>I happened to come across a &quot;spring mandrel&quot; at <a href="https://www.thingiverse.com/thing:92266" rel="nofollow noreferrer">https://www.thingiverse.com/thing:92266</a> <br> One could soften the poor filament and then wind it around a structure like that, and when cooled you have a low-pressure coil spring of a length and diameter you chose. Probably not that strong or robust, but worth a try if you need springs for other prints.</p>
2,136
<p>In php, I often need to map a variable using an array ... but I can not seem to be able to do this in a one liner. c.f. example:</p> <pre><code>// the following results in an error: echo array('a','b','c')[$key]; // this works, using an unnecessary variable: $variable = array('a','b','c'); echo $variable[$key]; </code></pre> <p>This is a minor problem, but it keeps bugging every once in a while ... I don't like the fact, that I use a variable for nothing ;)</p>
<p>I wouldn't bother about that extra variable, really. If you want, though, you could also remove it from memory after you've used it:</p> <pre><code>$variable = array('a','b','c'); echo $variable[$key]; unset($variable); </code></pre> <p>Or, you could write a small function:</p> <pre><code>function indexonce(&amp;$ar, $index) { return $ar[$index]; } </code></pre> <p>and call this with:</p> <pre><code>$something = indexonce(array('a', 'b', 'c'), 2); </code></pre> <p>The array should be destroyed automatically now.</p>
<p>Or something like this, if you need the array value in a variable</p> <pre><code>$variable = array('a','b','c'); $variable = $variable[$key]; </code></pre>
3,413
<p>Instead of relying on my host to send an email, I was thinking of sending the email messages using my <strong>Gmail</strong> account. The emails are personalized emails to the bands I play on my show. </p> <p>Is it possible to do it?</p>
<p>Be sure to use <code>System.Net.Mail</code>, not the deprecated <code>System.Web.Mail</code>. Doing SSL with <code>System.Web.Mail</code> is a gross mess of hacky extensions.</p> <pre><code>using System.Net; using System.Net.Mail; var fromAddress = new MailAddress(&quot;from@gmail.com&quot;, &quot;From Name&quot;); var toAddress = new MailAddress(&quot;to@example.com&quot;, &quot;To Name&quot;); const string fromPassword = &quot;fromPassword&quot;; const string subject = &quot;Subject&quot;; const string body = &quot;Body&quot;; var smtp = new SmtpClient { Host = &quot;smtp.gmail.com&quot;, Port = 587, EnableSsl = true, DeliveryMethod = SmtpDeliveryMethod.Network, UseDefaultCredentials = false, Credentials = new NetworkCredential(fromAddress.Address, fromPassword) }; using (var message = new MailMessage(fromAddress, toAddress) { Subject = subject, Body = body }) { smtp.Send(message); } </code></pre> <p>Additionally go to the <a href="https://myaccount.google.com/security" rel="noreferrer"><em>Google Account &gt; Security</em></a> page and look at the <em>Signing in to Google &gt; 2-Step Verification</em> setting.</p> <ul> <li>If it is enabled, then you have to generate a password allowing .NET to bypass the 2-Step Verification. To do this, click on <a href="https://myaccount.google.com/apppasswords" rel="noreferrer"><em>Signing in to Google &gt; App passwords</em></a>, select app = Mail, and device = Windows Computer, and finally generate the password. Use the generated password in the <code>fromPassword</code> constant instead of your standard Gmail password.</li> <li>If it is disabled, then you have to turn on <a href="https://myaccount.google.com/lesssecureapps" rel="noreferrer"><em>Less secure app access</em></a>, which is not recommended! So better enable the 2-Step verification.</li> </ul>
<p><a href="https://i.stack.imgur.com/xrl3W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xrl3W.png" alt="How to Set App-specific password for gmail" /></a></p> <p>If your Google password doesn't work, you may need to create an app-specific password for Gmail on Google. <a href="https://support.google.com/accounts/answer/185833?hl=en" rel="nofollow noreferrer">https://support.google.com/accounts/answer/185833?hl=en</a></p>
5,219
<p>Lutz Roeder's Reflector, that is.</p> <p>Its obfuscated.</p> <p><img src="https://i.stack.imgur.com/GHoWj.png" alt="enter image description here"></p> <p>I still don't understand this. Can somebody please explain?</p>
<p>It would have been kind of ironic if it weren't ;-)</p>
<p>Are you allowed to reflect it according to the EULA (if any) ? I would guess not, and not surprised that you can't.</p>
3,330
<p>My project has some money to spend before the end of the fiscal year and we are considering replacing a Sun-Fire-V490 server we've had for a few years. One option we are looking at is the <a href="http://www.sun.com/servers/coolthreads/overview/index.jsp" rel="nofollow noreferrer">CoolThreads</a> technology. All I know is the Sun marketing, which may not be 100% unbiased. Has anyone actually played with one of these?</p> <p>I suspect it will be no value to us, since we don't use threads or virtual machines much and we can't spend a lot of time retrofitting code. We do spawn a ton of processes, but I doubt CoolThreads will be of help there.</p> <p>(And yes, the money would be better spent on bonuses or something, but that's not going to happen.)</p>
<p>IIRC The coolthreads technology is referring to the fact that rather than just ramping up the clock speed ever higher to improve performance they are now looking at multiple core processors with hyperthreading effectively giving you loads of processors on one chip. Overall the processing capacity available is higher but without the additional electrical power and aircon requirements you would expect (hence cool). Its usefulness definitely depends on what you are planning to run on it. If you are running Apache with the multiple threads core it will love it as it can run the individual response threads on the individual cpu cores. If you are simply running single thread processes you will get some performance increases over a single cpu box but not as great (any old fashioned non mod_perl/mod_python CGID processes would still be sharing the the cpu a bit). If your application consists of one single threaded process running maxed out on the box you will get very little improvement on a single core cpu running at the same speed.</p> <p>Peter</p> <p>Edit:</p> <p>Oh and for a benchmark. We compared a T2000 in our server farm to our current V240s (May have been V480's I don't recall) The T2000 took the load of 12-13 of the Older boxes in a live test without any OS tweeking for performance. As I said Apache loves it :-)</p>
<p>It hit me last night that our core processes aren't multi-threaded, but the machine in question does have a bunch of system processes that are. In particular, it acts as an NFS server. It sounds like running hundreds of processes will benefit from all those cores, as well.</p> <p>I'll see if we can get a demo unit to test on first.</p>
8,232
<p>I'm not talking about making something that's outright disproportionate of course. I've been working in Blender and I've use Absolute grid Snap to snap my vertices to the grid. The problem is that it (didn't seem) to always work perfectly for centimeters, and seemed to work better for meters. (edit: I've learned what the problem was and it was simply the placement of the vertices in side view, being at slightly different elevations. I'm going to emphasize that the difference was very slight. It was just enough to show up in the measurements. When I switched from front view to side view I was able to adjust the elevation to the grid and that fixed the problem.)</p>
<p>It depends on what you're working on. If you're producing mechanical/functional parts (even if that just means having to connect to one another or to some non-printed part), 3 mm (0.3 cm) error is almost surely going to prevent them from working. Even 0.3 mm error might be a problem.</p> <p>If you're doing standalone prints that don't have to interface with anything else, e.g. art, non-articulated figurines, etc., then it becomes just a question of what's visually acceptable, and that's a matter both of scale and of the detail level you want. For typical tabletop-RPG scale, for example, most of the acutal visual features are going to be smaller than 3 mm, so that much error is not going to work out. It might work for large busts, though.</p> <p>In any case, I would recommend trying to solve the underlying problem. Either change your grid snap, or work at a larger scale and just scale down the final model.</p>
<p>Welcome to the SE 3D Printing site. Your questions are also welcome, as well as your answers to your questions, and the questions of others.</p> <p>I am not a Blender user. I use CAD systems because most of what I do I want to have a certain dimensional precision.</p> <p>If the problem is as simple as "The overall object is designed to be 7.345 centimeters but I want it to be 7.000 centimeters," you can fix that when you print the model. Use the scaling feature of your slicer to scale by <span class="math-container">$(7.000/7.345)$</span> or <span class="math-container">$95.303\%$</span>. It will print as the size you want.</p> <p>The problem may be deeper, though, in that you may be having trouble setting points within the model where you want them. In that case, the snap-to-grid feature is distorting your model's appearance and geometry, and there is nothing you can do to fix it.</p> <p>If it can't be fixed by scaling, I would suggest that you should either turn off the snap-to features or set up a grid that matches the granularity you actually want for your design.</p>
1,368
<p>How can I discover any USB storage devices and/or CD/DVD writers available at a given time (using C# .Net2.0).</p> <p>I would like to present users with a choice of devices onto which a file can be stored for physically removal - i.e. not the hard drive.</p>
<pre><code>using System.IO; DriveInfo[] allDrives = DriveInfo.GetDrives(); foreach (DriveInfo d in allDrives) { if (d.IsReady &amp;&amp; d.DriveType == DriveType.Removable) { // This is the drive you want... } } </code></pre> <p>The DriveInfo class documentation is here:</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.io.driveinfo.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.io.driveinfo.aspx</a></p>
<p>This is a complete module for VB.NET : <br> Imports System.IO <br> Module GetDriveNamesByType <br> Function GetDriveNames(Optional ByVal DType As DriveType = DriveType.Removable) As ListBox <br> For Each DN As System.IO.DriveInfo In My.Computer.FileSystem.Drives <br> If DN.DriveType = DType Then <br> GetDriveNames.Items.Add(DN.Name) <br> End If <br> Next <br> End Function <br> End Module <br></p> <pre><code>'Drive Types &lt;br&gt; 'Unknown: The type of drive is unknown. &lt;br&gt; 'NoRootDirectory: The drive does not have a root directory. &lt;br&gt; 'Removable: The drive is a removable storage device, such as a floppy disk drive or a USB flash drive. &lt;br&gt; 'Fixed: The drive is a fixed disk. &lt;br&gt; 'Network: The drive is a network drive. &lt;br&gt; 'CDRom: The drive is an optical disc device, such as a CD or DVD-ROM. &lt;br&gt; 'Ram: The drive is a RAM disk. &lt;br&gt; </code></pre>
7,480
<p>I am having a strange DB2 issue when I run DBUnit tests. My DBUnit tests are highly customized, but I don't think it is the issue. When I run the tests, I get a failure: </p> <blockquote> <p>SQLCODE: -1084, SQLSTATE: 57019</p> </blockquote> <p><a href="https://www1.columbia.edu/sec/acis/db2/db2m0/sql1000.htm" rel="nofollow noreferrer">which translates to</a> </p> <blockquote> <p>SQL1084C Shared memory segments cannot be allocated.</p> </blockquote> <p>It sounds like a weird memory issue, though here's the big strange thing. If I ssh to the test database server, then go in to db2 and do "connect to MY_DB", the tests start succeeding! This seems to have no relation to the supposed memory error that is being reported.</p> <p>I have 2 tests, and the first one actually succeeds, the second one is the one that fails. However, it fails in the DBUnit setup code, when it is obtaining the connection to the DB server to load my xml dataset.</p> <p>Any ideas what might be going on?</p>
<p>Oracle provides a utility called <code>tnsping</code>:</p> <pre><code>R:\&gt;tnsping someconnection TNS Ping Utility for 32-bit Windows: Version 9.0.1.3.1 - Production on 27-AUG-20 08 10:38:07 Copyright (c) 1997 Oracle Corporation. All rights reserved. Used parameter files: C:\Oracle92\network\ADMIN\sqlnet.ora C:\Oracle92\network\ADMIN\tnsnames.ora TNS-03505: Failed to resolve name R:\&gt; R:\&gt;tnsping entpr01 TNS Ping Utility for 32-bit Windows: Version 9.0.1.3.1 - Production on 27-AUG-20 08 10:39:22 Copyright (c) 1997 Oracle Corporation. All rights reserved. Used parameter files: C:\Oracle92\network\ADMIN\sqlnet.ora C:\Oracle92\network\ADMIN\tnsnames.ora Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = **) (PROTOCOL = TCP) (Host = ****) (Port = 1521))) (CONNECT_DATA = (SID = ENTPR0 1))) OK (40 msec) R:\&gt; </code></pre> <p>This should show what file you're using. The utility sits in the Oracle <code>bin</code> directory.</p>
<p>The easiest way is probably to check the <strong>PATH</strong> environment variable of the process that is connecting to the database. Most likely the tnsnames.ora file is in <em>first Oracle bin directory in path</em>..\network\admin. TNS_ADMIN environment variable or value in registry (for the current Oracle home) may override this.</p> <p>Using filemon like suggested by others will also do the trick.</p>
3,170
<p>I'm receiving "Package Load Failure" error when I open VS 2005 after I installed the latest VisualSVN (v. 1.5.2). Anyone facing this error? Is there any tool out there to help identify which package didn't load and/or help unload a specific package?</p>
<p>Installing the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=30402623-93ca-479a-867c-04dc45164f5b" rel="nofollow noreferrer">Visual Studio SDK</a> will install the "Package Load Analyzer" package. This allows you to see what package failed to load and why.</p>
<p>There should be VisualSVN log files in your temp folder (somewhat like "C:\Documents and Settings\\Local Settings\Temp\VisualSVN-2007-06-02-00-01-416.log").</p> <p>Do you see anything in that file that helps?</p>
6,718
<p>I'd like to allow a user to set up an SSH tunnel to a particular machine on a particular port (say, 5000), but I want to restrict this user as much as possible. (Authentication will be with public/private keypair).</p> <p>I know I need to edit the relevant ~/.ssh/authorized_keys file, but I'm not sure exactly what content to put in there (other than the public key).</p>
<p>On Ubuntu 11.10, I found I could block ssh commands, sent with and without -T, and block scp copying, while allowing port forwarding to go through. </p> <p>Specifically I have a redis-server on "somehost" bound to localhost:6379 that I wish to share securely via ssh tunnels to other hosts that have a keyfile and will ssh in with:</p> <pre><code>$ ssh -i keyfile.rsa -T -N -L 16379:localhost:6379 someuser@somehost </code></pre> <p>This will cause the redis-server, "localhost" port 6379 on "somehost" to appear locally on the host executing the ssh command, remapped to "localhost" port 16379. </p> <p>On the remote "somehost" Here is what I used for authorized_keys:</p> <pre><code>cat .ssh/authorized_keys (portions redacted) no-pty,no-X11-forwarding,permitopen="localhost:6379",command="/bin/echo do-not-send-commands" ssh-rsa rsa-public-key-code-goes-here keyuser@keyhost </code></pre> <p>The no-pty trips up most ssh attempts that want to open a terminal. </p> <p>The permitopen explains what ports are allowed to be forwarded, in this case port 6379 the redis-server port I wanted to forward.</p> <p>The command="/bin/echo do-not-send-commands" echoes back "do-not-send-commands" if someone or something does manage to send commands to the host via ssh -T or otherwise. </p> <p>From a recent Ubuntu <code>man sshd</code>, authorized_keys / command is described as follows:</p> <blockquote> <p>command="command" Specifies that the command is executed whenever this key is used for authentication. The command supplied by the user (if any) is ignored.</p> </blockquote> <p>Attempts to use scp secure file copying will also fail with an echo of "do-not-send-commands" I've found sftp also fails with this configuration. </p> <p>I think the restricted shell suggestion, made in some previous answers, is also a good idea. Also, I would agree that everything detailed here could be determined from reading "man sshd" and searching therein for "authorized_keys" </p>
<p>See <a href="http://www.networknewz.com/networknewz-10-20030707AuthenticatingbyPublicKeyOpenSSH.html" rel="nofollow noreferrer">this post on authenticating public keys</a>.</p> <p>The two main things you need to remember are:</p> <ol> <li>Make sure you <code>chmod 700 ~/.ssh</code></li> <li>Append the public key block to authorized-keys</li> </ol>
2,956
<p>I searched for this and found <a href="https://stackoverflow.com/users/1632/maudite">Maudite's</a> question about <a href="https://stackoverflow.com/questions/14155/text-editors#14203">text editors</a> but they were all for Windows.</p> <p>As you have no doubt guessed, I am trying to find out if there are any text/code editors for the Mac besides what I know of. I'll edit my post to include editors listed.</p> <h3>Free</h3> <ol> <li><a href="http://www.barebones.com/products/textwrangler/" rel="noreferrer">Textwrangler</a></li> <li><a href="https://developer.apple.com/xcode/" rel="noreferrer">Xcode</a></li> <li><a href="https://github.com/macvim-dev/macvim" rel="noreferrer">Mac Vim</a></li> <li><a href="http://aquamacs.org/" rel="noreferrer">Aquamacs</a> and closer to the original <a href="http://homepage.mac.com/zenitani/emacs-e.html" rel="noreferrer">EMacs</a></li> <li><a href="http://www.jedit.org/" rel="noreferrer">JEdit</a></li> <li><a href="http://editra.org/" rel="noreferrer">Editra</a></li> <li><a href="https://www.eclipse.org/" rel="noreferrer">Eclipse</a></li> <li><a href="https://netbeans.org/kb/articles/mac.html" rel="noreferrer">NetBeans</a></li> <li><a href="http://kodapp.com/" rel="noreferrer">Kod</a></li> <li><a href="https://github.com/textmate/textmate#readme" rel="noreferrer">TextMate2</a> - GPL</li> <li><a href="http://brackets.io/" rel="noreferrer">Brackets</a></li> <li><a href="https://atom.io/" rel="noreferrer">Atom.io</a></li> </ol> <h3>Commercial</h3> <ol> <li><a href="https://macromates.com/" rel="noreferrer">Textmate</a></li> <li><a href="http://www.barebones.com/products/bbedit/" rel="noreferrer">BBEdit</a></li> <li><a href="http://www.codingmonkeys.de/subethaedit/" rel="noreferrer">SubEthaEdit</a></li> <li><a href="http://www.panic.com/coda/" rel="noreferrer">Coda</a></li> <li><a href="http://www.sublimetext.com/2" rel="noreferrer">Sublime Text 2</a></li> <li><a href="http://smultron.sourceforge.net/" rel="noreferrer">Smultron</a></li> <li><a href="http://www.jetbrains.com/webstorm/" rel="noreferrer">WebStorm</a></li> <li><a href="http://osxpeppermint.com" rel="noreferrer">Peppermint</a></li> </ol> <h3>Articles related to the subject</h3> <ol> <li><a href="http://mac360.com/index.php/mac360/comments/faceoff_which_is_the_best_text_editor_ever/" rel="noreferrer">Faceoff, which is the best text editor ever?</a></li> <li><a href="http://maceditors.com" rel="noreferrer">Maceditors.com, mac editors features compared</a></li> </ol> <p>Thank you everybody that has added suggestions.</p>
<p>I haven't used it myself, but another <strong>free</strong> one that I've heard good thing about is <a href="http://smultron.sourceforge.net/" rel="noreferrer">Smultron</a>.</p> <p>In my own research on this, I found this interesting article: <a href="http://mac360.com/index.php/mac360/comments/faceoff_which_is_the_best_text_editor_ever/" rel="noreferrer">Faceoff: Which Is The Best Mac Text Editor Ever?</a></p>
<p>I like Aptana Studio and Redcar for rails programming.</p>
4,089
<p>We have to connect to a third party SOAP service and we are using WCF to do so. The service was developed using Apache AXIS, and we have no control over it, and have no influence to change how it works. The problem we are seeing is that it expects the requests to be formatted using Web Services Security, so we are doing all the correct signing, etc. The response from the 3rd party however, is not secured. If we sniff the wire, we see the response coming back fine (albeit without any timestamp, signature etc.). The underlying .NET components throw this as an error because it sees it as a security issue, so we don't actually receive the soap response as such. Is there any way to configure the WCF framework for sending secure requests, but not to expect security fields in the response? Looking at the OASIS specs, it doesn't appear to mandate that the responses must be secure.</p> <p>For information, here's the exception we see:</p> <p>The exception we receive is:</p> <pre><code>System.ServiceModel.Security.MessageSecurityException was caught Message="Security processor was unable to find a security header in the message. This might be because the message is an unsecured fault or because there is a binding mismatch between the communicating parties. This can occur if the service is configured for security and the client is not using security." Source="mscorlib" StackTrace: Server stack trace: at System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessageCore(Message&amp; message, TimeSpan timeout) at System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessage(Message&amp; message, TimeSpan timeout) at System.ServiceModel.Security.SecurityProtocol.VerifyIncomingMessage(Message&amp; message, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates) at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) </code></pre> <p>Incidentally, I've seen plenty of posts stating that if you leave the timestamp out, then the security fields will not be expected. This is not an option - The service we are communicating with mandates timestamps. </p>
<p>Funny you should ask this question. I asked Microsoft how to do this about a year ago. At the time, using .NET 3.0, it was not possible. Not sure if that changed in the 3.5 world. But, no, there was no physical way of adding security to the request and leaving the response empty.</p> <p>At my previous employer we used a model that required a WS-Security header using certificates on the request but the response was left unsecured.</p> <p>You can do this with ASMX web services and WSE, but not with WCF v3.0.</p>
<p>Funny you should ask this question. I asked Microsoft how to do this about a year ago. At the time, using .NET 3.0, it was not possible. Not sure if that changed in the 3.5 world. But, no, there was no physical way of adding security to the request and leaving the response empty.</p> <p>At my previous employer we used a model that required a WS-Security header using certificates on the request but the response was left unsecured.</p> <p>You can do this with ASMX web services and WSE, but not with WCF v3.0.</p>
8,860
<p>Does anybody if the Anycube Mega X comes with a nozzle for 1.75 mm filaments or is it 2.85 mm? I saw online that it works with 1.75 mm filaments but the Cura settings given by the manufacturer had 2.85 mm.</p> <p>I should mention that using a 1.75 mm filament works BUT my designs have clear under-extrusion, which is very likely caused by having 2.85 mm in the settings. So at this moment, I am trying to gauge whether to change the settings to 1.75 mm or buying 2.85 mm filaments (this only works if the Mega X comes with the appropriate nozzle).</p>
<p>Reading all 49 pages of the manual was fruitless. I'm astonished that there is no reference to the filament diameter used in this printer.</p> <p>From <a href="https://www.3djake.com/anycubic-3d-printer-and-accessories/mega-x" rel="nofollow noreferrer">3dJake's web site</a> comes a confirmation that the printer uses 1.75 mm filament.</p> <p>It's not a matter of changing a nozzle to use 2.85 mm filament, as the entire filament path is based, in this printer, on the 1.75 mm specification.</p> <p>To find 3Djake's site, I used &quot;anycubic mega x filament diameter&quot; as the search terms. Many other links appeared, confirming the 1.75 mm filament size.</p>
<p>This is a well-known problem with Cura. The filament diameter is set to 2.85 mm by default (probably because Ultimaker printers use 2.85 mm filament). This will cause extreme under-extrusion if your printer uses 1.75 mm filament. Simply change the filament diameter to 1.75 mm in Cura's printer definition, and everything should be fine.</p> <p>Older versions of Cura would reset the filament diameter to 2.85 mm if you installed an update or new release, but I think the Ultimaker have fixed that annoying little bug.</p>
1,927
<p>What's the best way to programmatically merge a .reg file into the registry? This is for unit testing; the .reg file is a test artifact which will be added then removed at the start and end of testing.</p> <p>Or, if there's a better way to unit test against the registry...</p>
<p>It is possible to remove registry keys using a .reg file, although I'm not sure how well it's documented. Here's how:</p> <pre><code>REGEDIT4 [-HKEY_CURRENT_USER\Software\&lt;otherpath&gt;] </code></pre> <p>The <code>-</code> in front of the key name tells <code>Regedit</code> that you want to remove the key.</p> <p>To run this silently, type:</p> <pre><code>regedit /s "myfile.reg" </code></pre>
<p>One of the most frustrating things about writing unit tests is dealing with dependencies. One of the greatest things about Test-Driven Development is that it produces code that is decoupled from its dependencies. Cool, huh?</p> <p>When I find myself asking questions like this one, I look for ways to decouple the code I'm writing from the dependency. Separate out the reading of the registry from the complexity that you'd like to test.</p>
5,551
<p>How can you reliably and dynamically load a JavaScript file? This will can be used to implement a module or component that when 'initialized' the component will dynamically load all needed JavaScript library scripts on demand.</p> <p>The client that uses the component isn't required to load all the library script files (and manually insert <code>&lt;script&gt;</code> tags into their web page) that implement this component - just the 'main' component script file.</p> <p><strong>How do mainstream JavaScript libraries accomplish this (Prototype, jQuery, etc)?</strong> Do these tools merge multiple JavaScript files into a single redistributable 'build' version of a script file? Or do they do any dynamic loading of ancillary 'library' scripts?</p> <p>An addition to this question: <strong>is there a way to handle the event after a dynamically included JavaScript file is loaded?</strong> Prototype has <code>document.observe</code> for document-wide events. Example:</p> <pre><code>document.observe("dom:loaded", function() { // initially hide all containers for tab content $$('div.tabcontent').invoke('hide'); }); </code></pre> <p><strong>What are the available events for a script element?</strong></p>
<p>You may create a script element dynamically, using <a href="http://www.prototypejs.org/" rel="nofollow noreferrer">Prototypes</a>:</p> <pre><code>new Element(&quot;script&quot;, {src: &quot;myBigCodeLibrary.js&quot;, type: &quot;text/javascript&quot;}); </code></pre> <p>The problem here is that we do not know <em>when</em> the external script file is fully loaded.</p> <p>We often want our dependant code on the very next line and like to write something like:</p> <pre><code>if (iNeedSomeMore) { Script.load(&quot;myBigCodeLibrary.js&quot;); // includes code for myFancyMethod(); myFancyMethod(); // cool, no need for callbacks! } </code></pre> <p>There is a smart way to inject script dependencies without the need of callbacks. You simply have to pull the script via a <em>synchronous AJAX request</em> and eval the script on global level.</p> <p>If you use Prototype the Script.load method looks like this:</p> <pre><code>var Script = { _loadedScripts: [], include: function(script) { // include script only once if (this._loadedScripts.include(script)) { return false; } // request file synchronous var code = new Ajax.Request(script, { asynchronous: false, method: &quot;GET&quot;, evalJS: false, evalJSON: false }).transport.responseText; // eval code on global level if (Prototype.Browser.IE) { window.execScript(code); } else if (Prototype.Browser.WebKit) { $$(&quot;head&quot;).first().insert(Object.extend( new Element(&quot;script&quot;, { type: &quot;text/javascript&quot; }), { text: code } )); } else { window.eval(code); } // remember included script this._loadedScripts.push(script); } }; </code></pre>
<p>all the major javascript libraries like jscript, prototype, YUI have support for loading script files. For example, in YUI, after loading the core you can do the following to load the calendar control</p> <pre><code>var loader = new YAHOO.util.YUILoader({ require: ['calendar'], // what components? base: '../../build/',//where do they live? //filter: "DEBUG", //use debug versions (or apply some //some other filter? //loadOptional: true, //load all optional dependencies? //onSuccess is the function that YUI Loader //should call when all components are successfully loaded. onSuccess: function() { //Once the YUI Calendar Control and dependencies are on //the page, we'll verify that our target container is //available in the DOM and then instantiate a default //calendar into it: YAHOO.util.Event.onAvailable("calendar_container", function() { var myCal = new YAHOO.widget.Calendar("mycal_id", "calendar_container"); myCal.render(); }) }, // should a failure occur, the onFailure function will be executed onFailure: function(o) { alert("error: " + YAHOO.lang.dump(o)); } }); // Calculate the dependency and insert the required scripts and css resources // into the document loader.insert(); </code></pre>
4,153
<p>I am currently in the look for a 3D printer and one major issue I find it the fumes/VOCs that printing can emit. I am not planning to do ABS or similar but I've read from studies that PLA also may emit VOCs. I live in an apartment and I plan to put the printer in my office, in which I work remotely, so I spend 8+ hours per day in that room. Additionally, I'm not looking to print huge volumes, I'd rather say probably 1-2 prints per month or so.</p> <p>Now, through my research I found that it's better to go with an FDM printer rather resin, as the latter not only stinks (and fumes are dangerous) but also is quite overwhelming for a beginner. Cool, then I was looking for FDM printers with enclosure (e.g. Qidi maker or da Vinci) and others without (e.g. Creality Ender 3 V2 or Prusa).</p> <p>Let's start with the enclosed printers. So, most of them advertise that they have filters on their vents but from some quick research I see lots of people complain that these are useless. In some cases some have printed an adaptor, placed it on the fan's place and use an air hose to direct the fumes outside, to a window for example. That is fine, requires some bit of work but I guess it will keep most dangerous particles away.</p> <p>For enclosureless 3d printers like Ender V2, I noticed that I can buy an enclosure, like the ones that Creality advertises as fireproof. Or still I could DIY one via IKEA parts. I thought that I could enclose my printer there when I needed to print something, seal it and when done, just put it in the balcony to rest, by opening the enclosure there for the VOCs to come out and disperse in the environment. Would that work? Would that enclosure keep the VOCs from contaminating my room? Does anybody tried something similar? Would that be practical? Would that affect the printing quality?</p> <p>So in the end the question is: should I rely on an enclosure without ventilation and then put it on the balcony to rest and release the fumes? Or should I build a DIY air filtering system to redirect the fumes outside through my window? Which one would keep away those VOCs?</p>
<p>The VOC issue is overblown. Unless you print constantly, you don't need any air treatment. Often that kind of treatment is installed by people who like DIY for the fun of it, not because it's really needed.</p> <p><a href="https://www.sciencedirect.com/science/article/pii/S0360132319304196" rel="nofollow noreferrer">Characterization of volatile organic compound emissions from consumer level material extrusion 3D printers</a> shows that dangerous chemicals may, in some cases without ventilation, exceed some of the limit concentration, but not much. So, in general, nothing goes significantly above the allowed concentrations.</p> <p>With less than 2-3 prints a day the natural ventilation of the room (which you need anyway if you work there) is enough to keep VOC to a safe level (unless you watch the whole print with the nose at few cm from it).</p> <p>If you want to be extra safe, use one of those flexible enclosures around the printer. It won't be super good for PLA (it gets warm inside and PLA should not be printed in a hot environment) but it will contain the VOC. When the print is done, or simply when you finish work, remove the enclosure, open slightly the window and come back in an hour or so.</p> <p>That's more than enough.</p> <p>If you want to filter for the fun of it, buy a HEPA filter and put an activated carbon filter after it, plus the fans to push the air through these two filters. But then you won't be in the room to work due to the noise, so I'm not sure you gained anything.</p>
<p>An enclosure without ventilation would definitely not be enough to contain VOCs from my experience with ABS and HIPS (both have relatively strong smells). The fumes will simply seep out of the openings in the enclosure.</p> <p>I put my 3d printer in a bathroom with an exhaust fan. The fan's outlet is IP-controllable, so I have OctoPrint run the fan every few minutes to exhaust the fumes (or constantly). It works great. When the fan is on no fumes escape. You can verify by burning some incense and seeing that the smoke flows into the bathroom from outside. Putting a facial tissue close to the door will demonstrate the suction effect also.</p>
1,984
<p>I am very close to buying a 3D printer and have started to do some preliminary design work from the things I'd like to make, but I have a question: Which corner of the print bed corresponds to the origin (0,0,0) in slicer software? Is this the same across slicers and printers?</p> <p>The reason I ask this is because of the difficulty some have in removing items from the bed. It seems to me like I'd want to print small items closer to the front of the printer to make access easier, but it looks like most slicer hosts only show a box representing the build volume with no real indication of what's "front".</p>
<p>Depending on what kind of printer you have, the build table origin and slicer origin (0,0) are usually either the front left corner, or the center of the build plate. This can be changed by the end-user in most open-source printers. There is no standard or requirement for a particular origin location. The important thing is merely that the slicer and printer coordinate systems match, so parts actually come out where your slicer thinks they should. </p> <p>In practice, it's usually quite easy to tell what's "front" in your slicer's build volume. When you open the program, the bed usually appears as it does when you stand in front of your printer. It is rarely an issue. </p> <p>In terms of difficulty removing prints from the bed, a removable build plate is an excellent solution. Plastic has a higher coefficient of thermal expansion than most build plate materials (like glass), so throwing the print+plate in your freezer will generate large separation forces and help remove the part for you. Non-removable build surfaces are a deal-breaker for most serious 3D printer users I know. Either don't buy such a printer, or add a removable plate yourself. </p>
<p>Normally the home position of the printer is the front left corner of the bed. The slicing software will ask you where this is so you can than position your object anywhere on the bed. The slicing software will make all the necessary adjustments for you. You normally would print the object in the middle of the bed, especially when heated, so it would be the most consistent in temperature. </p> <p>Personally, I have more of an issue keeping the object stuck to the bed than getting it off. Once the bed cools, the objects are easy to pop off. My experience using PLA and a glue stick. </p>
279
<p>I need to check programmatically (in .NET) whether a given user (domain account) is a member of the built-in Administrators group on a current computer (the one where the application gets executed).</p> <p>Is it possible?</p>
<p>I don't know about .Net, but in win32, the easy way is to call IsUserAnAdmin(). If you need more control, you can open the process token and check with CheckTokenMembership for each group you need to check</p> <p><strong>Edit:</strong> See <a href="http://www.pinvoke.net/default.aspx/advapi32/CheckTokenMembership.html" rel="nofollow noreferrer">pinvoke.net</a> for .NET sample code (Thanks chopeen)</p>
<p>You could loop the groups like i did in this answer:</p> <p><a href="https://stackoverflow.com/questions/45437/determining-members-of-local-groups-via-c#45458">Determining members of local groups via C#</a></p> <p>After reading some more, the easiest thing would be to use the <code>System.DirectoryServices.AccountManagement</code> namespace. Here is how it can be used:</p> <p><a href="http://www.leastprivilege.com/SystemDirectoryServicesAccountManagement.aspx" rel="nofollow noreferrer">http://www.leastprivilege.com/SystemDirectoryServicesAccountManagement.aspx</a></p> <p>Sample:</p> <pre><code>public static bool IsUserInGroup(string username, string groupname, ContextType type) { PrincipalContext context = new PrincipalContext(type); UserPrincipal user = UserPrincipal.FindByIdentity( context, IdentityType.SamAccountName, username); GroupPrincipal group = GroupPrincipal.FindByIdentity( context, groupname); return user.IsMemberOf(group); } </code></pre>
7,550
<p>Can someone explain this result to me. The first test succeeds but the second fails, although the variable tested is changed in the first test.</p> <pre><code>&gt;&gt;&gt; class MyTest(unittest.TestCase): def setUp(self): self.i = 1 def testA(self): self.i = 3 self.assertEqual(self.i, 3) def testB(self): self.assertEqual(self.i, 3) &gt;&gt;&gt; unittest.main() .F ====================================================================== FAIL: testB (__main__.MyTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "&lt;pyshell#61&gt;", line 8, in testB AssertionError: 1 != 3 ---------------------------------------------------------------------- Ran 2 tests in 0.016s </code></pre>
<p>From <a href="http://docs.python.org/lib/minimal-example.html" rel="noreferrer">http://docs.python.org/lib/minimal-example.html</a> :</p> <blockquote> <p>When a setUp() method is defined, the test runner will run that method prior to each test.</p> </blockquote> <p>So setUp() gets run before both testA and testB, setting i to 1 each time. Behind the scenes, the entire test object is actually being re-instantiated for each test, with setUp() being run on each new instantiation before the test is executed.</p>
<p>The setUp method, as everyone else has said, runs before every test method you write. So, when testB runs, the value of i is 1, not 3.</p> <p>You can also use a tearDown method which runs after every test method. However if one of your tests crashes, your tearDown method will never run.</p>
9,803
<p>In the STL almost all containers have an erase function. The question I have is in a vector, the erase function returns an iterator pointing to the next element in the vector. The map container does not do this. Instead it returns a void. Anyone know why there is this inconsistancy?</p>
<p>See <a href="http://www.sgi.com/tech/stl/Map.html" rel="noreferrer">http://www.sgi.com/tech/stl/Map.html</a></p> <blockquote> <p>Map has the important property that inserting a new element into a map does not invalidate iterators that point to existing elements. Erasing an element from a map also does not invalidate any iterators, except, of course, for iterators that actually point to the element that is being erased.</p> </blockquote> <p>The reason for returning an iterator on erase is so that you can iterate over the list erasing elements as you go. If erasing an item doesn't invalidate existing iterators there is no need to do this.</p>
<p>I have no idea if this is the answer, but one reason might be with the cost of locating the next element. Iterating through a map is inherently "slow".</p>
7,600
<p>I print my ABS at:</p> <ul> <li>240 °C;</li> <li>with a bedtemp of 80 °C; </li> <li>5 % rectilinear infill;</li> <li>0.25 mm layer height;</li> <li>2 solid layers top and bottom; </li> <li>Fan is completely disabled;</li> <li>0.25 mm extrusion width;</li> <li>50 mm/s perimeter print speed;</li> <li>60 mm/s infill speed;</li> <li>20 mm/s top solid and solid speed;</li> <li>No acceleration.</li> </ul> <p>When printing ABS, I place an aluminum foil lined cardboard box over my printer to help keep the ambient temps up for less warping and stronger prints. I've never actually measured the temperature inside, but the cardboard box insulates very well. </p> <p>I get this weird kind of tearing in my prints, I'm not sure if it's from too large of gaps in my infill, too fast print speeds, or not enough top layers. </p> <p><a href="https://i.stack.imgur.com/r0Y27.jpg" rel="nofollow noreferrer" title="Torn print"><img src="https://i.stack.imgur.com/r0Y27.jpg" alt="Torn print" title="Torn print"></a></p> <p>Another guess is some kind of drooping because of the high ambient temps. </p> <p>The tearing only occurs on large top layer surfaces. </p>
<p>Looking at the infill pattern visible through the tears in the top layer, it looks as if you have unreliable extrusion on the infill layers also.</p> <p>The solid fill layer is lifted and torn, so it is unlikely that one or two more layers of solid fill will make the result better. In my experience, bumps lead to taller bumps and print failure.</p> <p>These diagnostic steps have helped me:</p> <ul> <li><p>Print a 3 layer solid fill version, the top surface should be smooth and free of bumps;</p></li> <li><p>Print a single layer version, it should be smooth, well attached to the print bed, of even thickness, and a good surface for the next layer.</p></li> </ul> <p>Given your results, I am suspicious that you may have one of these problems, which I've listed in the order of likelihood:</p> <ol> <li><p>Partially blocked nozzle</p></li> <li><p>Excessive drag from the filament supply, such as a spool with crossed filament which jams itself, preventing unwrapping;</p></li> <li><p>Extruder feed roller slipping (perhaps full of dust), often a side effect of 1 and 2;</p></li> <li><p>G-code error dropping the temperature;</p></li> <li><p>Bad heater or thermistor, perhaps intermittent short of the thermistor, causing under heating even though the "average" indicated temperature is correct.</p></li> </ol> <p>Printing gliders is a cool application. It shows off the weight advantage extrusion 3-D printing can deliver. Nice.</p>
<p>This looks a bit like you may have a level issue with your printer. I've had similar results when my nozzle isn't clean and my bed is slightly off level. When the nozzle isn't clean (inside and out) either the flow rate out is different than what you set it to be due to back pressure or there is material on the nozzle causing the nozzle to drag through the molten plastic. </p> <p>I also use a lower nozzle temperature, around 220-230°C. Printing with 10% infill is my standard setting with two shell layers, honeycomb fill or diamond fill. </p>
673
<p>Is there a standard way for a web server to be able to determine a user's timezone within a web page? </p> <p>Perhaps from an HTTP header or part of the <code>user-agent</code> string?</p>
<p>There are no HTTP headers that will report the clients timezone so far although it has been suggested to include it in the HTTP specification.</p> <p>If it was me, I would probably try to fetch the timezone using clientside JavaScript and then submit it to the server using Ajax or something.</p>
<p>There's no such way to figure the timezone in the actual HTML code or any <code>user-agent</code> string, but what you can do is make a basic function getting it using JavaScript.</p> <p>I don't know how to code with JavaScript yet so my function might take time to make.</p> <p>However, you can try to get the actual timezone also using JavaScript with the <code>getTzimezoneOffset()</code> function in the <code>Date</code> section or simply <code>new Date().getTimezoneOffset();</code>.</p>
2,234
<p>I'm new at 3D Printing. I made a model of what I want to print using blender, but it's really small with a little system that must be very precise to work.</p> <p>What I have is like a hollow cylinder with a diameter of 11mm, and a thickness of 1mm. This goes inside a counter part, that is carve with the cylinder shape, but with a little extra gap so it can rotate like an axis. Maybe this picture explains better:</p> <p><a href="https://i.stack.imgur.com/trZRu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/trZRu.png" alt="enter image description here"></a></p> <p>And this should be the front view of the counter part:</p> <p><a href="https://i.stack.imgur.com/XaNBg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XaNBg.png" alt="enter image description here"></a></p> <p>So, I need to know if it's possible to print that cylinder hard enough to work as an axis. And what should be the gap size between the cylinder and the counter part's hole to rotate properly? If it's is like 0.05mm, can I print that level of detail with a 3D printer too?</p> <p>What hardware and material should I use to do this?</p> <p>Thanks in advance. Sorry for bad english, I hope you understand!</p> <p><strong>EDIT:</strong></p> <p><a href="https://i.stack.imgur.com/uD2N1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uD2N1.png" alt="enter image description here"></a></p> <p>(6mm is the depth of the hole)</p>
<p>It is definitively possible to do what you want, but your questions are samewhat problematic:</p> <blockquote> <p>So, I need to know if it's possible to print that cylinder hard enough to work as an axis.</p> </blockquote> <p>"hard enough" is a mysterious quantity. What is the intended application? The load of the axis, the rotation speed, the medium in which the part will be in, its operating temperature... they all affect the answer.</p> <blockquote> <p>And what should be the gap size between the cylinder and the counter part's hole to rotate properly?</p> </blockquote> <p>Reading at the question and the comments, I think you may have the wrong representation model in your mind. There are four different concepts at work here:</p> <ul> <li><em>Accuracy</em> is the maximum dimensional variation between parts. </li> <li><em>Tolerance</em> is the amount of random deviation or variation permitted for a given dimension.</li> <li><em>Allowance</em> is a planned difference between a nominal or reference value and an exact value.</li> <li><em>Clearance</em> is the intentional space between two parts.</li> </ul> <p>So: what you want to achieve for the object to rotate is to have at least some <em>clearance</em> once you have the parts printed. Therefore, you want to design your part with an <em>allowance</em> which is at least as much as the <em>accuracy</em>.</p> <p>Note that a machine cannot produce parts with a tighter tolerance than its accuracy. So you must design your part with a <em>tolerance</em> equal or greater than your printer <em>accuracy</em>.</p> <p>The correct number will therefore be entirely dependant from the specific printer you will be using. You can find out the specific <em>accuracy</em> of a printer by printing a <a href="https://www.thingiverse.com/search?q=Tolerance%20test&amp;sa=&amp;dwh=815ab32c4d0733c" rel="noreferrer">tolerance test</a> (I know, I know... why isn't it called "accuracy test"?)</p> <p>See this <a href="https://3dprinting.stackexchange.com/a/5187/9134">unrelated answer</a> - from wich I took the above definitions - for learning more about the above and a concrete example.</p> <blockquote> <p>If it's is like 0.05mm, can I print that level of detail with a 3D printer too?</p> </blockquote> <p>I hope it is now clear why this question makes no sense: <em>clearance</em> is a variable which depends from <em>accuracy</em> (and the application), not the other way around.</p> <blockquote> <p>I can't add so much gap because I have really limited space</p> </blockquote> <p>This comment too is incorrect: the "gap" (clearance) can be very very small. You have to have the correct <em>allowance</em> in your design, and allowance will <em>not</em> intrinsically make a part larger.</p> <blockquote> <p>What hardware and material should I use to do this?</p> </blockquote> <p>Again: this is entirely dependent from your application (load, operating temperature, orientation, speed...)</p> <p>A consumer-grade FDM printer (easy accessible, cheap and cheap to operate) will allow you to print a rotating part, a SLA/DLP printer (less common, toxic resins, more expensive to operate) will allow to print the same part with different materials and tighter tolerances...</p> <blockquote> <p>I don't worry about breaking, but it cannot be flexible</p> </blockquote> <p>Again: without an explanaton of the intended use (or the numbers associated to it) it's impossible to answer this comment conclusively. Resins tend to harden to more rigid solids, but you have thrown around tolerances as small as 0.05mm in your writing, and over 12mm of axis, that is a deviation of less than 0.5% from "perfectly straight". I'm hard pressed to think you will find a printable material with such a rigidity.</p>
<p>It is considered good practice to limit your post to one question at a time. The question about hardware and material is too broad to be a good question and I will set that aside.</p> <p>Equally unfortunate, your drawing is ambiguous. I suppose if English is not your native language, I'm not helping things either.</p> <p>The drawing has some errors that make it challenging to be certain of a correct answer, but I can provide you with some useful information as a direct result of a test print created today.</p> <p>The test print for my printer creates a series of spool shapes within retainer shapes. More complex than a simply cylinder making the test that much more difficult.</p> <p>My printer is able to print without problem parts that are 1.0 mm apart, 0.8 mm apart and 0.6 mm apart. The test failed at the 0.4 mm spacing and the 0.3 mm spacing, telling me that I need to perform some tuning.</p> <p>Your question asks about 0.05 mm spacing. I think you will not find an FDM printer that will manage such separation without bonding together the individual components. FDM printers use filament.</p> <p>You may also not find that an SLA or DLP printer can provide such tight tolerances. It is the most likely source of a success, however. I have only minimal exposure to tolerance in this type of printer. SLA/DLP printers use lasers/light and liquid resin. They can accomplish 0.05 mm layer thickness, even as small as 0.025 mm layers, but I do not know the figures for horizontal precision/accuracy/tolerance.</p> <p>SLS printers use a nylon powder and a laser to fuse the powder together to form the model. My SLS printer uses 0.050 mm powder. To accomplish the separation you require would mean a single layer of powder will separate the individual segments of the model. This is not practical for this type of printer.</p> <p>Your best bet would be to consult with a 3D printing service that uses SLA printers. SLA is likely to be more precise than DLP due to the method of exposing the resin, although that is not a universal truth.</p>
854
<p>What is the best way of implementing a cache for a PHP site? Obviously, there are some things that shouldn't be cached (for example search queries), but I want to find a good solution that will make sure that I avoid the 'digg effect'.</p> <p>I know there is WP-Cache for WordPress, but I'm writing a custom solution that isn't built on WP. I'm interested in either writing my own cache (if it's simple enough), or you could point me to a nice, light framework. I don't know much Apache though, so if it was a PHP framework then it would be a better fit.</p> <p>Thanks.</p>
<p>You can use <a href="http://uk3.php.net/manual/en/function.ob-get-contents.php" rel="noreferrer">output buffering</a> to selectively save parts of your output (those you want to cache) and display them to the next user if it hasn't been long enough. This way you're still rendering other parts of the page on-the-fly (e.g., customizable boxes, personal information).</p>
<p><a href="https://whatcd.github.io/Gazelle/" rel="nofollow noreferrer">Project Gazelle</a> (an open source torrent site) provides a step by step guide on setting up Memcached on the site which you can easily use on any other website you might want to set up which will handle a lot of traffic.</p> <p>Grab down the source and read the documentation.</p>
7,896
<p>The Visual Studio refactoring support for C# is quite good nowadays (though not half as good as some Java IDE's I've seen already) but I'm really missing C++ support.</p> <p>I have seen <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/RefactorCPP/index.xml" rel="noreferrer">Refactor!</a> and am currently trying it out, but maybe one of you guys know a better tool or plugin? <hr> I've been working with <a href="http://www.wholetomato.com/" rel="noreferrer">Visual Assist X</a> now for a week or two and got totally addicted. Thanks for the tip, I'll try to convince my boss to get me a license at work too. <hr> I've been bughunting for a few days since Visual Assist X kept messing up my Visual Studio after a few specific refactorings, It took me (and customer support) a week to hunt down but let's say for now that Visual Assist X is not a good combination with <a href="http://bluemars.org/clipx/" rel="noreferrer">ClipX</a>.</p>
<p>Visual Assist X by Whole Tomato software is not free, but it's absolutely worth the money if you use Visual Studio for C++.</p> <p><a href="http://www.wholetomato.com/" rel="noreferrer">http://www.wholetomato.com/</a></p>
<p>I'm not familiar with the tools you mentioned but the refactoring support for C++ in <a href="http://www.eclipse.org/downloads/packages/" rel="nofollow noreferrer">Eclipse 3.4</a> is getting pretty useful and growing.</p>
3,692
<p>In python, there are some special variables and filenames that are surrounded by double-underscores. For example, there is the</p> <pre><code>__file__ </code></pre> <p>variable. I am only able to get them to show up correctly inside of a code block. What do I need to enter to get double underscores in regular text without having them interpreted as an emphasis?</p>
<p>__file__</p> <p>Put a backslash before the first underscore.</p> <p>Like this:</p> <pre><code>\__file__ </code></pre>
<p><code>_\_file__</code> enter this will help you.</p>
7,644
<p>We wanted to test the post process properties of PVA but did not want to print anything. We unloaded the ABS that was in the printer and then started loading some PVA. After the PVA was loaded we let it keep going through the loading process until it pushed all the PVA out and we had our test sample. We then stopped the loading process and started the loading process again to put the ABS back so we could continue with normal printing procedures. Now, the ABS will not load into the right side and started making a clicking/ticking noise. Our printer is a Flashforge Dreamer. What is wrong with my printer and how can I fix it?</p>
<p>Run some cleaning filament through the extruder at the printing temperature of your PVA or ABS filament, whichever is greater, until the old stuff has been completely displaced. Then load the new filament until the cleaning filament has been completely displaced.</p> <p>This should be done every time you are switching materials, unless you don't mind disassembling the extruder and/or hotend and clean it out manually.</p>
<p>Run some cleaning filament through the extruder at the printing temperature of your PVA or ABS filament, whichever is greater, until the old stuff has been completely displaced. Then load the new filament until the cleaning filament has been completely displaced.</p> <p>This should be done every time you are switching materials, unless you don't mind disassembling the extruder and/or hotend and clean it out manually.</p>
922
<p>In JavaScript, what is the best way to determine if a date provided falls within a valid range?</p> <p>An example of this might be checking to see if the user input <code>requestedDate</code> is part of the next valid work week. Note that this is not just checking to see if one date is larger than another as a valid date would be equal to or greater than the lower end of the range while less than or equal to the upper end of the range.</p>
<p>This is actually a problem that I have seen come up before a lot in my works and the following bit of code is my answer to the problem.</p> <pre><code>// checkDateRange - Checks to ensure that the values entered are dates and // are of a valid range. By this, the dates must be no more than the // built-in number of days appart. function checkDateRange(start, end) { // Parse the entries var startDate = Date.parse(start); var endDate = Date.parse(end); // Make sure they are valid if (isNaN(startDate)) { alert("The start date provided is not valid, please enter a valid date."); return false; } if (isNaN(endDate)) { alert("The end date provided is not valid, please enter a valid date."); return false; } // Check the date range, 86400000 is the number of milliseconds in one day var difference = (endDate - startDate) / (86400000 * 7); if (difference &lt; 0) { alert("The start date must come before the end date."); return false; } if (difference &lt;= 1) { alert("The range must be at least seven days apart."); return false; } return true; } </code></pre> <p>Now a couple things to note about this code, the <code>Date.parse</code> function should work for most input types, but has been known to have issues with some formats such as "YYYY MM DD" so you should test that before using it. However, I seem to recall that most browsers will interpret the date string given to Date.parse based upon the computers region settings.</p> <p>Also, the multiplier for 86400000 should be whatever the range of days you are looking for is. So if you are looking for dates that are at least one week apart then it should be seven.</p>
<p>So if i understand currenctly, you need to look if one date is bigger than the other.</p> <pre><code>function ValidRange(date1,date2) { return date2.getTime() &gt; date1.getTime(); } </code></pre> <p>You then need to parse the strings you are getting from the UI, with Date.parse, like this:</p> <pre><code>ValidRange(Date.parse('10-10-2008'),Date.parse('11-11-2008')); </code></pre> <p>Does that help?</p>
9,970
<p>So I've designed a few components in Fusion 360, but I'm kinda new to CAD. I did the tutorials AutoDesk have on YouTube, modelled an Arduino enclosure, a shampoo bottle, a lamp shade, etc. but what I'm doing now isn't as straightforward...</p> <p>Before I used to create solids, but what I'm doing right now is essentially a flimsy plastic part, just a sheet of plastic with a rim, and some other &quot;rib&quot; features, and doing solids you have to make a sketch, and every line has to be doubled because of the thickness of the material.</p> <p>Today I'm trying surfaces after being clued by the &quot;Thicken&quot; command, I figured maybe that was more efficient, but I'm not sure if I'm on the right track.</p> <p>When I work with solids, I end-up with the option to <em>join</em> whatever new feature to the main body, but with surfaces I end-up with a bunch of bodies that are essentially supposed to be one, and I don't know how to join them together after.</p> <p>I guess they could be put together in a &quot;component&quot;, but I think components are more like a nut is a solid, a bolt is a solid, and a component is a nut and a bolt, not a bolt head, and a threaded cylinder... So the way the software is made right now at this point, while it clued me to use surfaces, now it's cluing me that there's something I'm missing, or nor doing right...</p> <p>There's no CAD Stack Exchange site, and I realize this might be a bit specific, but the part is to be 3D printed, I bought a new 3D printer not long ago for a project, but I need to get better at CAD before I can make it...</p> <p>Attached is a screenshot of what I worked on, it's paths that I've extruded to create surfaces (tall edges), thickened those surfaces to create bodies, patched some surfaces to fill areas, thickened those as well (ended-up with stair-shaped corners that I fixed somehow), then I cut some bodies from the bodies below to end-up with that you see now...</p> <p>I think I'm on the right path with surfaces, but I don't think my workflow is right, and I was wondering if anyone could help me...</p> <p>Right now, there's supposed to be two screw wells in two corners of the circle, essentially wells with a hole in the bottom for a thumbtack to go through, and there's going to be a cap to cap it off, it's kind of the same process as what I've done so far, but like I said, I don't think I'm doing it right...</p> <p><a href="https://forum-images-and-sharing.000webhostapp.com/img/2020-12-08.png" rel="nofollow noreferrer"><img src="https://forum-images-and-sharing.000webhostapp.com/img/2020-12-08.png" alt="What I've got so far..." /></a></p>
<p>Ok, let's go down the main two ways to a part, and in practice you usually use both to design for 3D printing. Only for machining, you try to keep to the cutting method only.</p> <ul> <li>Cutting Method</li> <li>Building Method</li> </ul> <h1>Cutting Method</h1> <p>You start with a piece of &quot;stock&quot;. A cube or cylinder created by extruding the simple shape. Now you go and create profiles that you either extrude into the part or rotate around the axis - your profile &quot;cuts&quot; the &quot;stock&quot;. When doing this, you think of parts like a machinist: you remove the material as a mill or lathe would.</p> <p><a href="https://i.stack.imgur.com/Nwo3F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nwo3F.png" alt="a cut in progress" /></a></p> <h1>Buildup Method</h1> <p>You start with the profile of the piece, then extrude it, then add the next detail and so on. I work a lot with that, and you can have a lot of sketches in the end:</p> <p><a href="https://i.stack.imgur.com/lkTrb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lkTrb.png" alt="enter image description here" /></a></p>
<p>After @Trish posted their answer, I went back to my design, and used substractive design, because I watch a lot of machining videos, and instead of the &quot;thicken&quot; feature that kinda did what I wanted, I used the &quot;shell&quot; command that did exactly what I wanted, see below.</p> <p><a href="https://i.stack.imgur.com/vxzP0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vxzP0.jpg" alt="Shell solids instead of thicken faces" /></a></p>
1,793
<p>I am new here and would like to work on a project to 3D print a precision prototype. What is the most affordable way to do it? How do I go about it?</p>
<p>[The question ask asked is vague, but since you are new it is understandable.]</p> <p>If you want to build a precision prototype then you have to decide on the level of precision that is necessary. There are different types of 3D printers and services available which give various levels of precision and functionality.</p> <p>Fused Filament Fabrication/Fused Deposition Modeling - This is typically a means of producing functional prototypes using plastic filament. In terms of precision it is currently the lest precise, but the most cost effective.</p> <p>Binder Jetting - This is basically crazy glue with food coloring which is inkjet printed onto a white powder layer by layer (vast oversimplification). Useful for producing prototypes with colours for product mockups but not for functional parts. This is mid the mid point in terms of price and precision. </p> <p>Stereo Lithography / Photo polymerization - Lasers cause a liquid resin to harden and stick to each other. Also notable for being the first form of 3D printing, this is the highest precision that is easily attainable. The cost varies based on the provider but it is usually the most expensive option.</p> <p>Depending on your needs you may find that it is cheaper to develop a single prototype part (just one part not an entire machine) by sending out to a contract manufacturer as opposed to purchasing a 3D printer. </p> <p>Here are some examples of what to do when:</p> <ul> <li>If you want to develop a diamond engagement ring for a customer: Send out to a contract manufacturer, for Stereo Lithography</li> <li>If you broke part of the cupboard and its easy to design a new one: Consider purchasing a sub $400 USD FFF machine and learn to use it.</li> <li>If you are developing a new line of designer sneaker: Send out to a contract manufacturer for Binder Jetting.</li> <li>If you are doing miniature figurines for a stop motion animation television series: Invest in a Binder Jet machine and learn how to use it.</li> </ul> <p>In my experience, people don't buy a 3D printer until they have held a 3D printed part in their hand or have seen the machinery in person. If you are new, start with a contract manufacturer and when you start spending so much on them that it is equaling the cost of owning a machine, then invest in your own system.</p>
<p>These two videos seem to give a good, general, entry-level introduction to the various technologies and processes that are involved in 3D printing:</p> <ul> <li><a href="https://www.youtube.com/watch?v=3LBTkLsjHGQ" rel="nofollow noreferrer">The Ultimate Beginner's Guide to 3D Printing - Part 1</a></li> <li><a href="https://www.youtube.com/watch?v=VN1RO1Oey-w" rel="nofollow noreferrer">The Ultimate Beginner's Guide to 3D Printing - Part 2</a></li> </ul>
1,245
<p>How could i implement Type-Safe Enumerations in Delphi in a COM scenario ? Basically, i'd like to replace a set of primitive constants of a enumeration with a set of static final object references encapsulated in a class ? . In Java, we can do something like:</p> <pre><code>public final class Enum { public static final Enum ENUMITEM1 = new Enum (); public static final Enum ENUMITEM2 = new Enum (); //... private Enum () {} } </code></pre> <p>and make comparisons using the customized enumeration type:</p> <pre><code>if (anObject != Enum.ENUMITEM1) ... </code></pre> <p>I am currently using the old Delphi 5 and i would like to declare some enums parameters on the interfaces, not allowing that client objects to pass integers (or long) types in the place of the required enumeration type. Do you have a better way of implementing enums other than using the native delphi enums ? </p>
<p>What is wrong with native Delphi enums? They are type safe.</p> <pre><code>type TMyEnum = (Item1, Item2, Item3); if MyEnum &lt;&gt; Item1 then... </code></pre> <p>Since Delphi 2005 you can have consts in a class, but Delphi 5 can not.</p> <pre><code>type TMyEnum = sealed class public const Item1 = 0; const Item2 = 1; const Item3 = 2; end; </code></pre>
<p>I think I know why Borland choose not to use type safe enums in the TLB editor. Enums in COM can be different values while Delphi only since Delphi 6 (I think) can do that. </p> <pre><code>type TSomeEnum = (Enum1 = 1, Enum2 = 6, Enum3 = 80); // Only since Delphi 6 </code></pre>
5,040
<p>I noticed foot arches are already digitized, but custom arch supports are usually expensive. PLA and ABS aren't the best material for printing arch supports, especially if they replace the shoe's innersole. </p> <p>Is there a more flexible material for 3D printing that could be used for making custom orthotics?</p>
<p>The standard choice for this would be TPU, <a href="https://en.wikipedia.org/wiki/Thermoplastic_polyurethane" rel="nofollow noreferrer">thermoplastic polyurethane</a>.</p> <blockquote> <p>TPU is a common filament material for use in fused filament fabrication 3D printing due to the fact that it is an elastic thermoplastic which makes it ideal for printing objects that need to be flexible and elastic.</p> <p>...</p> <p>Properties of commercially available TPU include:</p> <ul> <li>high abrasion resistance</li> <li>low-temperature performance</li> <li>high shear strength</li> <li>high elasticity</li> <li>transparency</li> <li>oil and grease resistance</li> </ul> </blockquote> <p>In addition to TPU, there are plasticizer-modified PLA filaments with similar flexibility, but not necessarily with the other nice properties like abrasion resistance. I've printed with one from 3D Solutech and had good results, <a href="https://3dprinting.stackexchange.com/q/8512/11157">after figuring out what to do about stringing</a>.</p> <p>Also, it's possible to achieve a decent degree of flexibility merely with printed geometry, rather than special materials. It's possible that PETG with an appropriate geometry could work for your application.</p>
<p>Armadillo by Ninjatek is perfect with 100&nbsp;% infill and 6 layers 6 walls and 6 the other thing? As a foot pharmacist I can say the cost is associated with the education as pedorthic modalities are different to each person. Ideally it would be easy to 3D print arch supports, but it would also be easy to "hurt" the person wearing them. buy a book on pedorthics before u wear them!</p>
1,346
<p>The following bit of code catches the EOS Exception</p> <pre><code>using (var reader = new BinaryReader(httpRequestBodyStream)) { try { while (true) { bodyByteList.Add(reader.ReadByte()); } } catch (EndOfStreamException) { } } </code></pre> <p>So why do I still receive first-chance exceptions in my console? </p> <blockquote> <p>A first chance exception of type 'System.IO.EndOfStreamException' occurred in mscorlib.dll</p> </blockquote> <p>Is there a way to hide these first chance exception messages?</p>
<p>To avoid seeing the messages, right-click on the output window and uncheck "Exception Messages".</p> <p>However, seeing them happen might be nice, if you're interested in knowing when exceptions are thrown without setting breakpoints and reconfiguring the debugger.</p>
<p>I think the stream is throwing this exception, so your try is scoped to narrow to catch it.</p> <p>Add a few more try catch combos around the different scopes until you catch it where its actually being thrown, but it appears to be happening either at our outside of your using, since the stream object is not created in the using's scope.</p>
8,273
<p>I have a model that contains a cavity, into which I want to insert a piece of metal, so I can use a magnet to stick to the print. How can I introduce a pause into the G-code without manipulating it manually in Ultimaker Cura?</p>
<p>Ultimaker Cura contains "Extensions"; in version 4.1.0, the process is as follows:</p> <ul> <li>Extensions -> Post Processing -> Modify G-code</li> <li>Add a Script -> Pause at height <ul> <li>Choose the one that matches your firmware!</li> </ul></li> <li>Choose the <code>Pause height</code> to match the height the insertion should take place. Usually, this is to be the layer just before the roof is to be printed to keep the inserted objects from protruding from their cavities.</li> <li>Choose a park position well outside of the print. X 10 Y 10 is usually a good position for this.</li> <li>Add a little retraction if you want.</li> </ul> <p>In printing, you have to wait till the cavity is formed, insert the item quickly and press the control button to resume. The shorter the pause, the better the next layer will hold to the already printed.</p> <p>Also, keep in mind to make the cavity a little larger than the insert, both in XY and Z, to compensate for the plastic shrinking a little and to allow the nozzle to pass well over the inserted item.</p>
<p><a href="/a/10588/">This answer</a> already explains how you insert the G-codes to enable a pause into your model. But, <strong>this will only work if the printer supports the G-codes that are inserted by Cura</strong>. E.g. <a href="/q/11236">this question</a> shows that this does not always work!</p> <p>To pause the printer you would need to resort into other methods, e.g. a manually inserted <a href="https://reprap.org/wiki/G-code#G4:_Dwell" rel="nofollow noreferrer"><code>G4</code> (Dwell)</a> would be a viable solution as shown in <a href="/a/11242">this answer</a>.</p>
1,410
<p>I just upgraded the nozzle (to 1 mm) on an Ender 3v2 and want to make a test print. I added a new printer for the new nozzle size.... and can't find a setting for it. Some screenshots on the internet show a nozzle diameter setting in the machine settings, but I do not have that. (<strong>Manage printers</strong> &gt; <strong>Printers</strong> &gt; <strong>Machine Settings</strong> &gt; <strong>Extruder 1</strong>). Obviously, this was the first place I looked, and I also looked in the sidebar several times.</p> <p>I have Cura 4.11.0 and am using the Ender 3 profile.</p> <p>I've seen arguments about it's no longer a valid setting because line width is more important, I've seen discussions that you need to install some mods to get to that variable, and I've seen people say to make a custom printer and then you can change the nozzle diameter. I've also seen lots of people asking for help, and sometimes even posting &quot;Oh I found it&quot; later, but no details on where the setting is, why it's missing, etc.</p> <p><a href="https://old.reddit.com/r/ender3/comments/bw5d43/nozzle_diameter_settings_in_cura_40_missing/" rel="nofollow noreferrer">https://old.reddit.com/r/ender3/comments/bw5d43/nozzle_diameter_settings_in_cura_40_missing/</a></p> <p><a href="https://community.ultimaker.com/topic/21438-suggestion-easy-change-nozzle-size/" rel="nofollow noreferrer">https://community.ultimaker.com/topic/21438-suggestion-easy-change-nozzle-size/</a></p>
<h1>Mechanical interaction</h1> <h2>Operator induced regular actions</h2> <p>When an operator reaches into the machine and operates something on the bed, this can induce errors that slowly accumulate. The most typical operation would be to remove something from the printbed, cleaning the printbed or swapping the printbed wholesale all can result in a slow but steady unleveling.</p> <p>Regular leveling can counteract this. With good training, you might vet away with once in a dozen or less.</p> <h2>Maintenance of/work on the printhead</h2> <p>During maintenance such as swapping nozzles, checking connections and cleaning the printhead, there is a very high chance that the printbed is touched due to the usually very cramped area one has to work in. For example, it is near impossible not to touch the printed when swapping nozzles on my Ender3, if I want to use my torque screwdriver. This is true even with the Z-Axis at the highest position, due to the dimensions of my torque screwdriver.</p> <p>By virtue of the work on the printhead, the 0-level is usually thrown off anyway, and as such a relevel is <strong>always</strong> in order after any printhead maintenance more invasive than cleaning the fan ducts.</p> <p>Avoiding nozzle swaps unless necessary can reduce the workload - it might be cheaper in the long term to have two machines with different setups than one machine where you swap the nozzle for each print - unless you charge for the accompanying work on the setup change.</p> <h2>Operator induced irregular actions</h2> <p>There are cases where the operator did not plan to operate in the area of the printbed but actually might impact it by reckless or accidental action. In other words: accidents happen, tools drop onto the printbed and hands end there if an operator stumbles.</p> <p>While releveling might not be <em>necessary</em> after all such accidental contacts, occasionally checking it and fixing it is good practice.</p> <h2>Mechanical failure</h2> <p>The way you test and maintain your Z-level is paramount in how often you need to validate the Z-level. If your springs are too strong and push the leveling knobs off on their own or your Z-sensor is mounted only weakly, then these create problems on their own.</p> <p>Note that even in normal operation, the oscillation of the printer will make any bolt under stress that is not glued in place or jammed in tight loosen a little over time. This does include the bed leveling knobs.</p>
<p>The only ones I have found are.</p> <p>Manually putting pressure on the bed when removing prints.</p> <p>Removing the bed covering, eg a glass plate</p> <p>Damaging the bed in some way. For example my bed has high spots on it (always has). This means that if I remove the glass plate I use and put it back, it sits slightly different. If I orient the glass a different way from prior it always needs levelling.</p> <p>Changing filament types.</p> <p>Changing cover types eg magnetic and glass are different thicknesses.</p> <p>Changing first layer needs. Sometimes I need the first layer squished a bit depending what I'm doing.</p> <p>Lastly on my Ender 3 Pro if the z-axis switch isn't screwed in tight enough it can slip down a fraction.</p>
2,149
<p>I am trying to implement a request to an unreliable server. The request is a nice to have, but not 100% required for my perl script to successfully complete. The problem is that the server will occasionally deadlock (we're trying to figure out why) and the request will never succeed. Since the server thinks it is live, it keeps the socket connection open thus LWP::UserAgent's timeout value does us no good what-so-ever. What is the best way to enforce an absolute timeout on a request? </p> <p>FYI, this is not an DNS problem. The deadlock has something to do with a massive number of updates hitting our Postgres database at the same time. For testing purposes, we've essentially put a while(1) {} line in the servers response handler. </p> <p>Currently, the code looks like so:</p> <pre><code>my $ua = LWP::UserAgent-&gt;new; ua-&gt;timeout(5); $ua-&gt;cookie_jar({}); my $req = HTTP::Request-&gt;new(POST =&gt; "http://$host:$port/auth/login"); $req-&gt;content_type('application/x-www-form-urlencoded'); $req-&gt;content("login[user]=$username&amp;login[password]=$password"); # This line never returns $res = $ua-&gt;request($req); </code></pre> <p>I've tried using signals to trigger a timeout, but that does not seem to work. </p> <pre><code>eval { local $SIG{ALRM} = sub { die "alarm\n" }; alarm(1); $res = $ua-&gt;request($req); alarm(0); }; # This never runs print "here\n"; </code></pre> <p>The final answer I'm going to use was proposed by someone offline, but I'll mention it here. For some reason, SigAction works while $SIG(ALRM) does not. Still not sure why, but this has been tested to work. Here are two working versions:</p> <pre><code># Takes a LWP::UserAgent, and a HTTP::Request, returns a HTTP::Request sub ua_request_with_timeout { my $ua = $_[0]; my $req = $_[1]; # Get whatever timeout is set for LWP and use that to # enforce a maximum timeout per request in case of server # deadlock. (This has happened.) use Sys::SigAction qw( timeout_call ); our $res = undef; if( timeout_call( 5, sub {$res = $ua-&gt;request($req);}) ) { return HTTP::Response-&gt;new( 408 ); #408 is the HTTP timeout } else { return $res; } } sub ua_request_with_timeout2 { print "ua_request_with_timeout\n"; my $ua = $_[0]; my $req = $_[1]; # Get whatever timeout is set for LWP and use that to # enforce a maximum timeout per request in case of server # deadlock. (This has happened.) my $timeout_for_client = $ua-&gt;timeout() - 2; our $socket_has_timedout = 0; use POSIX; sigaction SIGALRM, new POSIX::SigAction( sub { $socket_has_timedout = 1; die "alarm timeout"; } ) or die "Error setting SIGALRM handler: $!\n"; my $res = undef; eval { alarm ($timeout_for_client); $res = $ua-&gt;request($req); alarm(0); }; if ( $socket_has_timedout ) { return HTTP::Response-&gt;new( 408 ); #408 is the HTTP timeout } else { return $res; } } </code></pre>
<p>You might try <a href="http://search.cpan.org/%7Ebradfitz/LWPx-ParanoidAgent-1.02/lib/LWPx/ParanoidAgent.pm" rel="noreferrer">LWPx::ParanoidAgent</a>, a subclass of LWP::UserAgent which is more cautious about how it interacts with remote webservers.</p> <p>Among other things, it allows you to specify a global timeout. It was developed by Brad Fitzpatrick as part of the LiveJournal project.</p>
<p>From what I understand, the timeout property doesn't take into account DNS timeouts. It's possible that you could make a DNS lookup separately, then make the request to the server if that works, with the correct timeout value set for the useragent.</p> <p>Is this a DNS problem with the server, or something else?</p> <p>EDIT: It could also be a problem with IO::Socket. Try updating your IO::Socket module, and see if that helps. I'm pretty sure there was a bug in there that was preventing LWP::UserAgent timeouts from working.</p> <p>Alex</p>
9,898
<p>I've been strictly in a C++ environment for years (and specialized statistical languages). Visual Studio until 2001, and Borland since. Mostly specialized desktop applications for clients. </p> <p>I'm not remaining willfully ignorant of it, but over the years when I've dipped into other things, I've spent my time playing around with JavaScript, PHP, and a lot of Python. </p> <p>Is "<a href="http://en.wikipedia.org/wiki/ASP.NET" rel="noreferrer">ASP.NET</a>" the language? Is C# the language and "ASP.NET" the framework? What's a good answer to "What is ASP.NET"? Is there a correspondence between ASP.NET and anything I'd be familiar with in C++? </p> <p>I know I can google the same title, but I'd rather see answers from this crowd. (Besides, in the future, I think that Google should point here for questions like that.)</p>
<blockquote> <p>ASP.NET is a web application framework developed and marketed by Microsoft, that programmers can use to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language.</p> </blockquote> <p><a href="http://en.wikipedia.org/wiki/ASP.NET" rel="nofollow noreferrer">ASP.NET </a> (Wikipedia)</p> <p>That's on the second result searching on Google so I'm guessing (half-expecting) that you don't understand what that means either.</p> <p>Webpage development started with simple static HTML pages. That meant the client asked for a page by means of an URL and the server sent the page back to him/her exactly as it has been designed. Sometime after that several technologies emerged in order to provide a more "dynamic" or personalized experience.</p> <p>Several "server side languages" were developed (PHP, Perl, ASP...) which allowed the server to process the Web page before sending it back to the client. This way when a client requested a webpage the server could interpret the request, process it (for example connecting to a database and fetching some results) and send it back modifying the contents and making them "dynamic". The fact that the process took place on the server stands for the name of "server side".</p> <p>So the original ASP (predecessor of the ASP.NET) was a server side language that was focused on serving web pages. In such way it supported several shortcuts such as the possibility to intercalate HTML and ASP source into the file which was on that time much popular due to PHP implementation. It was also (as most of these languages) a dynamic language and it was interpreted.</p> <p>ASP.NET is an evolution of that original ASP with some improvements. First it does truly (try to) separate the presentation (HTML) from the code (.cs) which may be implemented by using Visual Basic or C# syntax. It also incorporate some sort of compilation to the final ASP pages, encapsulating them into assemblies and thus improving performance. Finally it has access to the full .NET framework which supports a wide number of helper classes.</p> <p>So, summing up, it is a programming language located on the server and designed to make webpages.</p>
<p>Take a look at MS' info for those who don't know or understand the platform.</p> <p><a href="http://www.asp.net/get-started" rel="nofollow noreferrer">http://www.asp.net/get-started</a></p>
4,549
<p>Using the viewer control for display of SQL Reporting Services reports on web page (Microsoft.ReportViewer.WebForms), can you move the View Report button? It defaults to the very right side of the report, which means you have to scroll all the way across before the button is visible. Not a problem for reports that fit the window width, but on very wide reports that is quickly an issue.</p>
<p>It's kind of a hack, but you can move it in JavaScript. Just see what HTML the ReportViewer generates, and write the appropriate JavaScript code to move the button. I used JavaScript to hide the button (because we wanted our own View Report button). Any JavaScript code that manipulates the generated ReportViewer's HTML must come after the ReportViewer control in the .aspx page. Here's my code for hiding the button, to give you an idea of what you'd do:</p> <pre><code>function getRepViewBtn() { return document.getElementsByName("ReportViewer1$ctl00$ctl00")[0]; } function hideViewReportButton() { // call this where needed var btn = getRepViewBtn(); btn.style.display = 'none'; } </code></pre>
<p>I had the same problem and ended up using an extension on Travis Collins answer; As well as changing the table column width I also align the "View Report" button left so that it appears neearer to rest of the controls.</p> <pre><code> &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#_ctl0_MainContent_reportViewer_fixedTable tr:first td:first-child").attr("width", "1"); $("#_ctl0_MainContent_reportViewer_fixedTable tr:first td:last-child").attr("align", "left"); }); &lt;/script&gt; </code></pre> <p>You may need to tweak the JQuery selector depending on the element naming assigned to your existing control.</p>
4,108
<p>I'm working on building an app to scan directly from TWAIN scanner to a Java applet. I'm already aware of <a href="http://www.gnome.sk/Twain/jtp.html" rel="noreferrer">Morena</a> and <a href="http://asprise.com/product/jtwain/" rel="noreferrer">JTwain</a>, but they cost money. I need free. I could re-invent the wheel with JNI, but it seems like someone has probably already done this as a FOSS tool.</p> <p>Is anyone familiar with a <strong>free</strong> tool that can get a Java applet to read directly from a TWAIN scanner?</p>
<p>Calling the TWAIN API from anything except C/C++ is going to be a major pain, it relies entirely on complicated C structures that you have to replicate exactly in memory. If you need only fairly basic scanning, you could use something like <a href="https://github.com/twall/jna/" rel="nofollow noreferrer">GitHub site</a> to call my old free 'EZTwain Classic' DLL (google for eztw32.dll)</p>
<p>I've actually purchased the chestysoft activeX control. Been using it for about 3 years. Works great but as with all ActiveX you are restricted to IE. And this one is 32-bit only. I'm looking into a flash approach now. Since flash can capture from a camera why not from a scanner. If I remember I'll report back what I find.</p>
3,249
<p>This is a segment of code from an app I've inherited, a user got a Yellow screen of death:</p> <blockquote> <p>Object reference not set to an instance of an object</p> </blockquote> <p>on the line: </p> <pre><code>bool l_Success ... </code></pre> <p>Now I'm 95% sure the faulty argument is <code>ref l_Monitor</code> which is very weird considering the object is instantiated a few lines before. Anyone have a clue why it would happen? Note that I have seen the same issue pop up in other places in the code.</p> <pre><code>IDMS.Monitor l_Monitor = new IDMS.Monitor(); l_Monitor.LogFile.Product_ID = "SE_WEB_APP"; if (m_PermType_RadioButtonList.SelectedIndex == -1) { l_Monitor.LogFile.Log( Nortel.IS.IDMS.LogFile.MessageTypes.ERROR, "No permission type selected" ); return; } bool l_Success = SE.UI.Utilities.GetPermissionList( ref l_Monitor, ref m_CPermissions_ListBox, (int)this.ViewState["m_Account_Share_ID"], (m_PermFolders_DropDownList.Enabled) ? m_PermFolders_DropDownList.SelectedItem.Value : "-1", (SE.Types.PermissionType)m_PermType_RadioButtonList.SelectedIndex, (SE.Types.PermissionResource)m_PermResource_RadioButtonList.SelectedIndex); </code></pre>
<p>You sure that one of the properties trying to be accessed on the l_Monitor instance isn't null?</p>
<p>Sprinkle in a few variables for all the property-queries on that (loooooongg) line temporarily. Run the debugger, Check values and Corner the little bug.</p>
7,886
<p>What would be the Master Pages equivalent in the Java web development world? I've heard of Tiles, Tapestry and Velocity but don't know anything about them. Are they as easy to use as Master Pages? </p> <p>I want something as easy as set up one template and subsequent pages derive from the template and override content regions, similar to Master Pages.</p> <p>Any examples would be great!!</p>
<p>You should also check out <a href="https://facelets.java.net/" rel="nofollow noreferrer">Facelets</a>; there is a <a href="http://www.ibm.com/developerworks/java/library/j-facelets/" rel="nofollow noreferrer">good introductory article</a> on DeveloperWorks.</p> <p>The Facelets <code>&lt;ui:insert/&gt;</code> tag is comparable to the ASP.NET <code>&lt;asp:ContentPlaceHolder/&gt;</code> tag used in master pages; it lets you provide default content for that area of the page, but this can be overridden.</p> <p>To fill the Facelets template in another page, you start with a <code>&lt;ui:composition/&gt;</code> element that points to the template file. This is roughly equivalent to declaring the MasterPageFile attribute in an ASP.NET page.</p> <p>Inside the <code>&lt;ui:composition/&gt;</code> element, you use <code>&lt;ui:define/&gt;</code> elements to override the template defaults, similar to the way an <code>&lt;asp:Content/&gt;</code> tag is used. These elements can contain any kind of content - from simple strings to JSF elements.</p> <p>So, to bring it all together...</p> <p>In <em>master.xhtml</em>:</p> <pre><code>&lt;!-- HTML header content here --&gt; &lt;ui:insert name="AreaOne"&gt;Default content for AreaOne&lt;/ui:insert&gt; &lt;ui:insert name="AreaTwo"&gt;Default content for AreaTwo&lt;/ui:insert&gt; &lt;!-- HTML footer content here --&gt; </code></pre> <p>In <em>page.xhtml</em>:</p> <pre><code>&lt;ui:composition template="/WEB-INF/templates/master.xhtml"&gt; &lt;ui:define name="AreaOne"&gt;Here is some new content&lt;/ui:define&gt; &lt;ui:define name="AreaTwo"&gt; &lt;p&gt;Some new content here too&lt;/p&gt; &lt;/ui:define&gt; &lt;/ui:composition&gt; </code></pre> <p>And this will render as:</p> <pre><code>&lt;!-- HTML header content here --&gt; Here is some new content &lt;p&gt;Some new content here too&lt;/p&gt; &lt;!-- HTML footer content here --&gt; </code></pre> <p>You also get some other benefits with Facelets, such as the ability to reuse page components with different data.</p> <p>(Edited to provide more information.)</p>
<p>I've used <a href="http://wiki.sitemesh.org/display/sitemesh/Home" rel="nofollow">sitemesh</a> in previous projects and it's pretty easy to set up. Essentially, you create decorators which are equivalents of master pages. You then define which child pages use which decorators. See <a href="http://today.java.net/pub/a/today/2004/03/11/sitemesh.html" rel="nofollow">introduction to sitemesh</a> for more information.</p>
4,515
<p>How do I smooth 3D printed objects? What is the best / common method to do this?</p>
<p>From a general point of view, there are a few things to consider.</p> <p><strong>If you buy a kit</strong>:</p> <p>Pros:</p> <ul> <li>You get some insurance that <em>you have all the parts that you need</em> to get a functional printer - all the electronics, structure, bolts, nuts, screws, washers, wires and so on.</li> <li>Most likely, all the parts you get are made to <em>fit together</em>.</li> <li>You will (usually) get a <em>manual</em>, often a community that can help you out, and sometimes even technical support.</li> <li>Sometimes, it can be <em>cheaper</em> than buying each part separately (but it can also be more expensive)</li> </ul> <p>Cons:</p> <ul> <li>You have limited/no options to customize your printer to your own preferences without purchasing additional parts. </li> <li>Some kits can be difficult to upgrade later or may be locked to some configuration or software.</li> </ul> <p><strong>My opinion:</strong></p> <p>The way I look at it, the better option for <em>you</em> depends on how you want to spend your time. That is:</p> <ol> <li>If you get a kit, you can spend more time building.</li> <li>If you collect all the parts yourself, you will have to spend time planning, ordering parts (possibly multiple times) in addition to actually building the printer. A possible lack of manuals could also increase the building difficulty.</li> </ol> <p>If you don't already own a 3D printer, I would recommend getting a kit, simply because struggling with trivial things like parts not fitting together can take away the fun for many people.</p>
<p>Three great answers have already been posted, and it has been extremely interesting to read them. I shall try not to repeated what has already been said.</p> <p>I have sourced the parts <em>separately</em> for three different printers:</p> <ul> <li>P3Steel (the frame was a kit, mind: <a href="https://3dprinting.stackexchange.com/questions/3312/orientation-of-long-thin-rod-on-p3steel-v4">Orientation of long thin rod on P3Steel v4</a>)</li> <li>Wilson II</li> <li>Kossel XL and Mini</li> </ul> <p>I have been coding Arduinos and Pis and building robots and quadcopters for a few years now. Then, in November 2016, because I needed a prop guard for a ZMR250 quadcopter that I found hard to obtain, but easy to print, I started reading about 3D printers (mostly RepRap wiki, and then individual blogs of straight forward builds, as well as design modifications, of Prusa, P3Steel, Wilson and Delta/Kossel printers), watching countless construction videos and asking questions here on SE 3D Printers, and reading other's questions and answers, as well as going through eBay for hours at a time, looking up parts and making numerous Bill Of Materials (BOMs) and blogging the information that I gleaned. So this gave me a good grounding and starting point for when I did get around to ordering. In fact, the process is still on going...</p> <p>After ordering the parts, in December, piecemeal, I then had to wait for a month for the parts to arrive from China, during which time I read some more, and revised what I had already learned.</p> <p>I then, finally, got to work on the P3Steel, in January, but two and a half weeks later, before I had finished it, I had to move to BKK for an extended period.</p> <p>I suffered delays with the P3Steel build due to postal latency, obviously, but also, some partial kits where missing critical parts (see <a href="https://3dprinting.stackexchange.com/questions/3332/is-the-8mm-x-20mm-bearing-axle-for-the-x-axis-idler-of-a-p3steel-a-custom-part">Is the 8mm x 20mm bearing axle for the X-axis idler (of a P3Steel) a custom part?</a>), so I had to get them machined in Thailand (because it only costs around $3 to get something machined here). Hopefully, when I get back to the UK, I should have everything to hand and be able to finish the build in a few weeks maximum</p> <p>Once in Bangkok, I started sourcing parts for a Wilson II, and then, subsequently, a Kossel, mostly because the aluminium and steel rods are a quarter, to a half, the price that they are in Europe. Also, I had to go through the ordering process again, getting parts from China for these two printers - however, the parts from China only take two weeks to arrive to Thailand, not a month or so, for the UK. The Wilson II parts I plan to take back to the UK, in order to complete the build there, hopefully printing the plastic parts on the P3Steel, when/if the P3Steel is completed.</p> <p>Note, that seven, or eight months, down the line from when I first took an interest in 3D printing, I <em>still</em> haven't completed a single printer, yet. However, I sure as hell have learnt a lot. Note: most of the delay is due to the six month relocation away from my printer build in the UK.</p> <p>Also, due to my reading of the modification blogs for the Wilson and Kossel, I have recently been re-purchasing upgrades, before I have even fitted a bolt together, for the Kossel and Wilson, let alone completed either of the base builds. For example, I have just purchased Chinese aluminium vertices, rather than the plastic PLA prints that I got from Sintron. So I have ended up with a fair collection of spare (redundant?) parts, but again, it has helped me gain a great insight as to what works well, and what does not.</p> <p>To reiterate that which <a href="https://3dprinting.stackexchange.com/questions/409/what-are-the-pros-and-cons-of-collecting-parts-yourself-versus-getting-a-diy-ki#answer-415">TestGeek has said</a>, <em>one major tip</em> I would have is (and I read this on a forum when I was first getting into 3D printer building), if you are sourcing the parts separately, is to buy bulk (get packs of 10 pcs, 50 pcs, 100 pcs), and buy more than you require: nuts, bolts, bearings, GT2 belt, GT2 pulleys. The price comes down phenomenally, and you can resell the spares, locally, for about as much as you paid for the whole lot, online, thereby covering, or almost covering, the cost of the printer. Plus, spares come in handy for further builds down the road. Don't buy anything from the US (unless you are already in the US, I guess) - the import/postage fees are outrageous.</p> <hr /> <h3>TL;DR</h3> <p>In the same way as you learn more from building a kit as opposed to buying a pre-built printer, you will learn more sourcing the parts separately, but it might cost more, in redundant parts. Also:</p> <ul> <li>Research extensively first</li> <li>Buy bulk</li> <li>Be prepared for delays, be patient</li> <li>Be prepared for an iterative design</li> </ul>
173
<p>Is a home 3D printer capable of printing a good bicycle air pump?</p> <p>I've searched the Internet and there is very limited info on it. Things need to be rigid and very minutious in the valve part of the pump. I could give an example of what I thought in the image <a href="https://i.stack.imgur.com/cFuku.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cFuku.jpg" alt="enter image description here"></a> </p>
<h1>depends</h1> <p>You certainly can print <em>parts</em> of <strong>a</strong> bicycle pump, for example, the outer case and maybe the inner piston, maybe even the housing for the connection valves.</p> <p>However, you cant print the buffer spring or the valves itself. You will have trouble printing the adapters. And you will have to print in ABS to smooth the inside of your pump with acetone vapor, so you have a smooth surface that forms an air seal under operation.</p> <p>It would be cheaper and more durable to just print just the fittings and use a PVC Pipe as the cylinder itself.</p> <p>As in all things, if this is a <strong>good</strong> pump depends a lot on design and your machine.</p>
<p>It should be possible to print such a product. You should be printing this in a tough material at a fine layer resolution and probably need to machine the inside of the cylinder or use grease and use a rubber valve. </p>
1,124
<p>Working with dates in ruby and rails on windows, I'm having problems with pre-epoch dates (before 1970) throwing out of range exceptions. I tried using both <a href="http://ruby-doc.org/core-2.2.0/Time.html" rel="nofollow noreferrer"><code>Time</code></a> and <a href="http://ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/DateTime.html" rel="nofollow noreferrer"><code>DateTime</code></a> objects, but still have the same problems.</p>
<p>If you only need dates (no times), the <a href="http://ruby-doc.org/stdlib-2.2.3/libdoc/date/rdoc/Date.html" rel="nofollow noreferrer"><code>Date</code></a> class in ruby should handle dates before 1970. But it has only a resolution of days. I don't know if there are solutions, if you also need times before 1970 <a href="http://safari.ibmpressbooks.com/0768667208/ch07lev1sec18" rel="nofollow noreferrer">(source)</a></p>
<p>You can also check out the section on dates on <a href="http://ruby-doc.org/stdlib/libdoc/date/rdoc/index.html" rel="nofollow noreferrer">ruby-doc.org</a>. I'm still learning Ruby but it sounds like you could use either the <a href="http://ruby-doc.org/stdlib/libdoc/date/rdoc/index.html" rel="nofollow noreferrer">Civil or Commerical Date</a> to go back before 1970.</p>
4,770
<p>I have an UP! mini and I am using the UP Studio and ABS 1.75 mm.</p> <p>My prints are always stuck to the rafts and are impossible to remove without destroying the print.</p> <p>I've had a look at the settings on the Up Studio but I don't know which ones to change to improve the situation.</p>
<p>The OpenSCAD <code>surface</code> function will do this. You can feed it a greyscale image or a textfile containing a matrix. Documentation and examples can be found at <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Surface" rel="nofollow noreferrer">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Surface</a></p> <p>OpenSCAD is a cross platform free open source cad package.</p>
<p>FreeCAD can import JPG (and IIRC TIFF and PNG as well) image files and produce a lithophane type height-map based on the brightness of each pixel. I'd be rather surprised if other 3D CAD software aimed at the 3D printing user base couldn't do the same. Most of the common free-to-use 3D CAD packages have Linux versions; FreeCAD certainly does (I use it on Kubuntu 20.04, and it should work on any recent version of any flavor of Debian-based Linux, if your hardware meets it requirements).</p>
1,955
<p>I'm getting an error when my application starts. It appears to be after it's initialized its connection to the database. It also may be when it starts to spawn threads, but I haven't been able to cause it to happen on purpose.</p> <p>The entire error message is:<br> FATAL ERROR in native method: JDWP NewGlobalRef, jvmtiError=JVMTI_ERROR_NULL_POINTER(100) JDWP exit error JVMTI_ERROR_NULL_POINTER(100): NewGlobalRef</p> <p>erickson: I'm not very familiar with the DB code, but hopefully this string is helpful: jdbc:sqlserver://localhost;databasename=FOO</p> <p>Tom Hawtin: It's likely I was only getting this error when debugging, but it wasn't consistent enough for me to notice.</p> <p>Also, I fixed a bug that was causing multiple threads to attempt to update the same row in DB and I haven't gotten the JVMTI... error since.</p>
<p>JVMTI is the debugging and profiling protocol. So, I'm guessint it's something peculiar to the environment you are attempting to run your application in.</p>
<p>I'm guessing you are using a native-code&ndash;based database driver (JDBC driver type 1 or 2). And I'm guessing that driver is buggy. If you could provide more information about the driver and your datasource configuration or connection string, it might help determine some answers.</p>
7,558
<p>I'm attempting to model and print a globe. The semi-circular arm that holds the globe has an outer diameter of 98mm and inner diameter of 92mm, so the arm is fairly thin. The arm has a small hole on either end that fits around a protrusion at each pole of the globe to hold it in place. The hole extends into the arm only a few millimeters, so it doesn't go all the way through.</p> <p>I printed the arm in ABS and it ended up being a bit too flexible to hold the globe securely. Obviously I could do things like making the arm thicker or extending the globe's protrusions all the way through the arm, but I'd prefer not to if I don't have to (you know, artistic integrity or whatever).</p> <p>Would printing in PLA result in a more rigid part? I've tried to do some googling on this, but couldn't really find a definitive answer. Most comparisons focus on strength which I assume doesn't necessarily correlate to flexibility.</p> <p>I'd also welcome any other suggestions for making the part more rigid.</p>
<p><strong>The flexibility of 3d plastics has a lot to do with the additives manufacturers use</strong>. The same base material with additive X may have very different properties than the one with additive Y.</p> <p>That said, <strong>generally speaking PLA is known to be more rigid</strong> (and brittle) than ABS, but less strong. So: you have a fair chance at giving it a go with PLA, albeit you my end up with a more delicate object in the end.</p> <p>There is a well <a href="https://m.youtube.com/user/ThomasSanladerer" rel="noreferrer">known youtube channel</a>, whose author has performed a lot of <a href="https://m.youtube.com/playlist?list=PLDJMid0lOOYl8TZJV9xHznKFq5yA5ZTi2" rel="noreferrer">quasi-scientific testing</a> on common brands of filament (PLA and not) where you can get an idea of the relative rigidity of the filaments. You can find the table with the results <a href="https://docs.google.com/spreadsheets/d/1j9QazgoocuzHxg6qUXevq3dpAmmT2E87089FX6gRgWU/htmlview" rel="noreferrer">here</a> (look for the "bend test" columns).</p> <p>However the very firs thing that came to mind when reading your post, is that you could simply <strong>swap pins and holes</strong> by putting the holding pins on the arm, and the holes on the globe instead. This would allow you to preserve your design <em>and</em> to have longer pins.</p> <p>Things you could try when it comes to printing (unless you are already doing them):</p> <ul> <li><strong>Print the arm flat</strong> so that the layers stretch from pole to pole uninterrupted.</li> <li><strong>Print with near solid infill</strong> (solid infill can be problematic if your extrusion calibration is not perfect), like 95% <strong>and cubic infill</strong> (for more uniform properties along the full length of the axis.</li> </ul> <p>Finally, <strong>you could <a href="https://hackaday.com/2017/06/17/annealing-plastic-for-stronger-prints/" rel="noreferrer">try to anneal</a> the arm</strong> in your kitchen oven. This process works by warming the part until it becomes pliable and then letting it cool very slowly. The end result is that the molecules arrange themselves in a more "crystal-like" way and the part becomes stronger and more rigid. <strong>Beware that annealing changes your part dimensions</strong> so you should definitively do some experiments with a test cube and find out the direction and percentage of the shrinking before going "all out" on the arm.</p>
<p>Print thinner layers. Also, you did not mention the other dimension of your arm. If you view the globe with the arm to the left, then you have said the thickness in the X direction (left to right) is 6mm. But what about in the Z axis (away from you)? You could make it thicker in that direction to improve its rigidity.</p>
793
<p>I know that MAC OS X 10.5 comes with Apache installed but I would like to install the latest Apache without touching the OS Defaults incase it causes problems in the future with other udpates. So I have used the details located at: <a href="http://diymacserver.com/installing-apache/compiling-apache-on-leopard/" rel="nofollow noreferrer">http://diymacserver.com/installing-apache/compiling-apache-on-leopard/</a> But I'm unsure how to make this the 64 Bit version of Apache as it seems to still install the 32 bit version.</p> <p>Any help is appreciated</p> <p>Cheers</p>
<p>Add this to your ~/.bash_profile which means that your architecture is 64-bit ant you’d like to compile Universal binaries.</p> <pre><code>export CFLAGS="-arch x86_64" </code></pre>
<p><a href="http://www.mail-archive.com/dev@httpd.apache.org/msg38674.html" rel="nofollow noreferrer">This page</a> claims that a flag for gcc (<code>maix64</code>) should do the trick. Give it a whirl, and if you need any more help, post back here.</p>
4,544
<p>I am trying to modify this <a href="https://www.thingiverse.com/thing:2516525" rel="noreferrer">thing</a>. It's prints OK, but there are some design choices I don't like, so, since the previous makers uploaded their source files, I tried my hand at Sketchup.</p> <p>My latest round of changes have produced a weird phenomenon, and I'm not sure how to describe it. The slicer sees the GCODE as I intend, but for some reason the printer is printing something different than what the slicer is showing me. I am primarily concerned with the top of this case, but the base does not have the additional screw holes I made, so the phenomenon, whatever it is, is not limited to a single part.</p> <ul> <li>Sketchup v17.2.25555</li> <li>Cura v3.0.3</li> <li>OctoPi/OctoPrint 1.2.7</li> <li>PrintrBot LC custom</li> <li>Grey Inland PLA+ @~180C, bed @~60C (my temps are higher than the software thinks they are, so I have to put the temp lower in the software)</li> </ul> <p>You can see the parts in Sketchup:</p> <p><a href="https://i.stack.imgur.com/FCSH7.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/FCSH7.jpg" alt="enter image description here"></a></p> <p>The corner on the left was giving me no end of trouble! I left it with a messed up hole because I could more easily clean it up with a drill bit than spend another few hours futzing with that corner.</p> <p><a href="https://i.stack.imgur.com/9ay0V.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/9ay0V.jpg" alt="enter image description here"></a></p> <p>This is in Cura, after I have sliced it. Looks fine to me! There is a bit of red in that problematic corner, but I only noticed that after the print came out weird.</p> <p><a href="https://i.stack.imgur.com/5RYPm.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/5RYPm.jpg" alt="enter image description here"></a></p> <p>This is the output of the printer. Notice how the edge near the GPIO pins is shorter than the rest, and how the hole is inverted into a protrusion. This is the opposite of what I want, and the opposite of what I see in the other softwares.</p> <p><a href="https://i.stack.imgur.com/DYrkP.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/DYrkP.jpg" alt="enter image description here"></a></p> <p><a href="https://i.stack.imgur.com/QRpAo.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/QRpAo.jpg" alt="enter image description here"></a></p>
<h1>first issue</h1> <p>bed inclination. it has to be heavy issue :)</p> <p>if you have any other printouts then please reveal them so we could see if it's the problem</p> <h1>next issue</h1> <p>inversion of hole into solid object</p> <p>i would say it's caused by wrong calculation of <a href="https://en.wikipedia.org/wiki/Normal_(geometry)" rel="nofollow noreferrer">normal vector</a> to some face(s)</p> <p>algorithm uses normal to calculates what is "inside" and what is not</p> <p>it's hard to say if it's an issue of </p> <ul> <li>object itself</li> <li>application in which you modify it (even if duplicating or joining with other objects)</li> <li>slicer engine</li> </ul> <p>to fix the issue, you can try edit your object (recreate this hole)</p> <p>but first - definitelly i'd align your bed properly ;)</p> <p><strong>EDIT</strong></p> <p>after closer look i bet it's the issue of bad object. it looks like pointed line is kinda remnant of some operations made on object in the past</p> <p>in other words - it's possible place where normals are reverted and doesn't "create" inside but outside</p> <p>all above this line is reverted. <strong>part of body disappeared and part of hole appeared</strong></p> <p>this is the issue for sure!</p> <p><a href="https://i.stack.imgur.com/QupM7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QupM7.png" alt="enter image description here"></a> <a href="https://i.stack.imgur.com/ZTVh2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZTVh2.png" alt="enter image description here"></a></p>
<p>Looks like you are over extruding.</p> <p>check out this visual guide for example (I like it a lot):</p> <p><a href="http://support.3dverkstan.se/article/23-a-visual-ultimaker-troubleshooting-guide" rel="nofollow noreferrer">http://support.3dverkstan.se/article/23-a-visual-ultimaker-troubleshooting-guide</a></p> <p>For the protruding thingy, it seems (as the other hole is filled up with over extruded filament, it seems) that it's the "hole" printed. For the rest of the "wall" where that hole should have been, it seems it was just not printed. What size is it (if too thin, the slicer might just discard it, doesn't seems like it but you didn't tell nozzle size etc).</p> <p>I don't know, but I think you should start with calibrating your machine first so that you actually <em>can</em> print small holes like that.</p> <p>For the missing wall, what does the slice result look like?</p>
722
<p>In my example below I'm using a <code>dijit.form.DateTextBox</code>:</p> <pre><code>&lt;input type="text" name="startDate" dojoType="dijit.form.DateTextBox" constraints="{datePattern:'MM/dd/yyyy'}" value='&lt;c:out value="${sessionScope.adminMessageForm.startDate}"/&gt;' /&gt; </code></pre> <p>So for example, if the user starts to enter "asdf" into the date the field turns yellow and a popup error message appears saying <code>The value entered is not valid.</code>. Even if I remove the <code>constraints="{datePattern:'MM/dd/yyyy'}"</code> it still validates. </p> <p>Without going into details as to why, I would like to be able keep the dojoType and still prevent validation in particular circumstances.</p>
<p>Try overriding the validate method in your markup.</p> <p>This will work (just tested):</p> <pre><code>&lt;input type="text" name="startDate" dojoType="dijit.form.DateTextBox" constraints="{datePattern:'MM/dd/yyyy'}" value='&lt;c:out value="${sessionScope.adminMessageForm.startDate}"/&gt;' validate='return true;' /&gt; </code></pre>
<p>My only suggestion is to programmatically remove the dojoType on the server-side or client-side. It is not possible to keep the dojoType and not have it validate. Unless you create your own type that has you logic in it.</p>
3,633
<p>My printer came with a knock off BuildTak like build surface. What can I use to clean it? I don't want to damage it. </p>
<p>For BuildTak, my first recommendation is isopropyl alcohol (aka rubbing alcohol or isopropanol). Readily available just about anywhere basic medical supplies are sold, it cuts though light oils and greases, and dissolves most common build surface adhesives like hairspray or Elmer's glue stick. In fact I often give my Ender's bed a light spray of isopropyl after an initial layer of hairspray, as the alcohol thins the hairspray a bit so I can take a plastic scraper and spread it around a little more evenly, before it sets to a very tacky initial surface that holds well.</p> <p>Depending on where you live, denatured alcohol aka methyated spirits might be easier to get, and this stuff also works well as a cleaner and degreaser. The methanol does a little better job at actually removing old build adhesive instead of just "reactivating" it, and it also seems to do a little better than isopropyl at releasing and capturing old print residues that didn't make it off the surface with the rest of the print.</p> <p>Be aware that both the liquid and the vapors of both of these are toxic, denatured alcohol a little more so than isopropanol. You should have plenty of ventilation through your workspace while using either one.</p> <p>For a deep clean, especially with a removable build surface, it's hard to beat a mild dish detergent and water, and a scrub with a Teflon-safe Scotch-Brite sponge (they're usually blue). A clean rinse, pat dry with a towel, then give it a spray of isopropanol to finish drying it and it's ready to go. This is more of a hassle and I don't recommend it as a quick between-prints cleaning, but it can bring a well-used bed surface right back to life when more volatile cleaning agents won't do it. </p> <p>Whether it's worth the frustration getting the plate properly rinsed (soap, being slippery, is not going to aid adhesion), versus just scraping the surface back off and putting a new one on, depends on how easy it is to bring the bed surface to the sink. My Ender's magnetic surface makes this much easier than a simple adhesive-backed surface right on the aluminum. By the same token it also makes the surface easier to replace, and they're not that expensive (so I highly recommend them if you like BuildTak), but \$12 is \$12, compared to 5 minutes in the sink with some Palmolive.</p>
<p>Besides IPA (80 %), which is one of the best cleaners for general pourpose, 99 % ethanol ("Spiritus") can work as a good substitute.</p> <p>Acetone too can be used on BuildTak and its clones in a pitch without damaging it, as long as it is kept away from the edges, where it could weaken the bond to the aluminium. Using it repeatedly could however smooth the surface over some.</p> <p>Mineral Spirits might be useful to prepare the aluminium for a new bed, but sould <strong>not</strong> be used on the BuildTak or its clones, as it could harm the surface and leave residue.</p>
1,554
<p>I want to build a mini CNC machine and need some lead screws. I was wondering I can simply 3D print some. There are a few 3D models out there but I want to know if printing it in PLA+ has enough strength for a small CNC. Is it possible?</p>
<p>Expanding on some previous comments which are probably enough to warrant an answer:</p> <p>What Trish said is completely right. Leadscrews are readily available parts and any dimensional errors in the leadscrews will be reflected in the output of your CNC machine unless you have some sort of compensation for them. Moreover, if the material is not highly rigid, the dimensions are subject to change over time, so any compensation would have to be ongoing manual adjustment or closed-loop rather than a one-time calibration. &quot;PLA+&quot; is an especially bad choice because it usually means PLA that's been modified with additives to make it less brittle, deforming under stress instead of holding its shape until it breaks catastrophically. <a href="https://www.youtube.com/watch?v=uAoZCpXoPWo" rel="nofollow noreferrer">CNC Kitchen's video on PLA+</a> elaborates on this.</p> <p>With that said, if you don't need a high level of precision, or if you're in a situation where you're unable to obtain manufactured components, I think 3D printed leadscrews would work ok if you print them in the XY plane rather than along the Z axis. While nozzle width and discrete layers produce a sort of &quot;stairstep&quot; quantization of printed threads in the Z direction, that doesn't happen with the threads in the XY plane; the nozzle width limits feature resolution (oscillations per unit length) but the positioning of the threads is quantized only to the X and Y (micro)step size, which is typically on the order of 10 microns. Moreover, the strength and rigidity of the part printed in this direction can be very high, due to the offset-layered zigzag structure.</p> <p>Back to accuracy of the part, though, it's important to note that whatever flaws your printer might have in XY positioning accuracy will be reflected in the resulting leadscrew. This includes <em>non-linear effects</em> such as belt paths being slightly trapezoidal instead of having perfectly colinear points of attachment to the carriage. In general, when manufacturing parts that will affect the accuracy of the resulting machine, you want to use processes that amplify the precision your tooling was manufactured with rather than processes that reproduce or amplify its flaws.</p>
<p>Is it possible? Yes. Is it advisable? <strong>No</strong></p> <p>Lead screws need to be smooth and have little to no stretch and there can be a lot of tension on them. However, 3D prints are quite rough by the way they are made and super weak on tension forces - and not have a good compression withstanding either.</p> <p>a 3D printed leadscrew is therefore <strong>not adviseable</strong>, especially since ready-made leadscrews and fitting nuts are cheap in the shape of nuts and threaded rods for the crudest setup.</p>
1,896
<p>I have a few C# <code>.dll</code> projects which are common to many applications. Currently, I have one big repository. I have each DLL stored as a separate project within the repository and every application project stored as a project within the same repository.</p> <p>I recently switched to Subversion for source control and I fear that I did not do a good job of structuring the repository. I would like to hear what others are doing.</p>
<p>Subversion repositories are typical sub-divided into:</p> <pre><code>branch/ tags/ trunk/ </code></pre> <p>You would either place all of your DLL and application projects into the <strong>trunk</strong> and then use <strong>branch</strong> and <strong>tags</strong> for all of them as necessary too:</p> <pre><code>branch/ tags/ trunk/ project1/ project2/ </code></pre> <p>Alternatively, you could create folders for each project in the root and then place the common branch, tags and trunk folders within them.</p> <pre><code>project1/ branch/ tags/ trunk/ project2/ branch/ tags/ trunk/ </code></pre> <p>Note that this practice is simply convention and nothing in SVN requires (or really promotes) doing it exactly this way. However, everyone is used to it. So, you would be doing people a favor to go along.</p> <p>To elaborate further, the <strong>trunk</strong> is where your main development will take place. When you want to mark a particular revision (e.g. a release version), then simply <strong>svn</strong> <strong>copy</strong> the project into the tags directory. Also, just copy code into the <strong>branch</strong> directory when you want to do something dramatic or prolonged and don't want to hinder progress in the <strong>trunk</strong>. Later you can <strong>svn</strong> <strong>merge</strong> your <strong>branch</strong> back into the <strong>trunk</strong> when it is ready for action!</p> <p>If you want to correct mishaps in your current Subverion repository, then just use <strong>svn</strong> <strong>move</strong> to relocate them. Unlike the delete and add process of <a href="http://www.nongnu.org/cvs/" rel="noreferrer">CVS</a>, move will retain version history for the new location.</p>
<p>if your sub projects can be released at different versions (like controls, web parts, ect...) then it may make sense to build your structure like this:</p> <p><strong>Solution</strong><br> Project 1 </p> <blockquote> <ul> <li>Branch </li> <li>Tags </li> <li>Trunk </li> </ul> </blockquote> <p>Project 2</p> <blockquote> <ul> <li>Branch </li> <li>Tags </li> <li>Trunk </li> </ul> </blockquote> <p>This way you can manage each project release independently.</p> <p>Otherwise the most common structure is:</p> <blockquote> <ul> <li>Branch </li> <li>Tags </li> <li>Trunk </li> <li>Docs (Optional)</li> </ul> </blockquote>
3,638
<p>Looking for a way to read the unique ID / serial# of a USB thumb drive; please note that<br> - I am looking for the value of the manufacturer, not the one Windows allocates for it.<br> - I need to support multiple OS (Windows, Unix, Mac), thus needs to be a Java solution</p> <p>The idea is to be able to distinguish between different USB thumb drives.</p>
<p>I've never tried using it (it's been on my todo list for a good few months now), but there is the "marge" project on java.net:</p> <p><a href="http://marge.java.net/" rel="nofollow noreferrer">http://marge.java.net/</a></p> <p>This should let you connect to bluetooth devices (although I don't think it is 100% feature complete, there is demo code on there), and then the ClientDevice class has a "getBluetoothAddress" method which I <em>believe</em> should be unique to that device</p> <p><a href="http://marge.java.net/javadoc/v06/marge-core/net/java/dev/marge/entity/ClientDevice.html" rel="nofollow noreferrer">http://marge.java.net/javadoc/v06/marge-core/net/java/dev/marge/entity/ClientDevice.html</a></p> <p>As I say though, I've never tried it...</p>
<p>I have never investigated this thoroughly, but from memory the <a href="http://users.frii.com/jarvi/rxtx/" rel="nofollow noreferrer">RXTX</a> library implementation of the javax.comm packages are supposedly very good and now have USB support.</p>
9,896
<p>I'd like to take some time to learn more about dynamic languages built on top of the DLR and I'm not sure which language would be better to learn.</p> <p>Having limited time, I really only have time to look learn one of them.</p> <p>Any opinions on which of the two (Iron Ruby or Iron Python) would be more useful in the long run?</p>
<p>Without getting into the relative merits of the languages (which would be an entire pissing contest in itself), IronPython (stable 1.1.1, beta 2.0) is further along in development than IronRuby (alpha)</p>
<p>As other said, IronPython is more stable and mature, and you can find more samples and lots of regular Python code that you will be able to try out.</p> <p>IronRuby is great but beware: to try it you need to get the code right from the SVN and compile it by yourself. Or you can download the <a href="http://www.codeplex.com/sdlsdk/" rel="nofollow noreferrer">Dynamic Silverlight SDK</a> and get it that way, but you'll have to spend sometime learning this environment also.</p>
6,423
<p>What is the most straightforward way to create a hash table (or associative array...) in Java? My google-fu has turned up a couple examples, but is there a standard way to do this?</p> <p>And is there a way to populate the table with a list of key->value pairs without individually calling an add method on the object for each pair?</p>
<pre><code>Map map = new HashMap(); Hashtable ht = new Hashtable(); </code></pre> <p>Both classes can be found from the java.util package. The difference between the 2 is explained in the following <a href="http://www.jguru.com/faq/view.jsp?EID=430247" rel="noreferrer">jGuru FAQ entry</a>.</p>
<pre><code>Hashtable&lt;Object, Double&gt; hashTable = new Hashtable&lt;&gt;(); </code></pre> <p><strong>put values</strong> ...</p> <p><strong>get max</strong></p> <pre><code>Optional&lt;Double&gt; optionalMax = hashTable.values().stream().max(Comparator.naturalOrder()); if (optionalMax.isPresent()) System.out.println(optionalMax.get()); </code></pre>
4,897
<p>This is my first 3D printer so I'm not entirely sure what could be the cause of this issue.</p> <p>I recently got a SUNLU S8 3D printer and have been trying to print the first test file, however, the layers end up stringy (for lack of a better word -- if anyone knows whether this is called something else, I'd appreciate the knowledge because Google searching for stringy layers does not yield similar results).</p> <p>Anyway, I tried to increase the nozzle temperature from 205 °C to 215 °C and that seems to help slightly (filament is PLA and came with the printer). I also noticed that the extruder's feeder gear is grinding on the filament so I suspect that may be part of the problem.</p> <p>Before I purchase an extruder kit, I figured I'd reach out and ask this community what they think could be the problem.</p> <p>Does anyone know what might be causing this issue?</p> <p><a href="https://i.stack.imgur.com/Pzyj9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pzyj9.jpg" alt="Stringy first couple layers" /></a></p> <p><strong>Edit</strong></p> <p>I cleaned the tubing and nozzle, and then releveled the bed. The filament was still stringy and whispy, however, I decided to let it print for a while. Although the picture is a top-down view, the walls of the print are also holey.</p> <p><a href="https://i.imgur.com/HQhQQuv.jpg" rel="nofollow noreferrer"><img src="https://i.imgur.com/HQhQQuv.jpg" alt="After Cleaning" /></a></p>
<p>In the video, there is this still from <a href="https://youtu.be/bKsGNrEKx9M?t=32" rel="nofollow noreferrer">0:32</a>:</p> <p><a href="https://youtu.be/bKsGNrEKx9M?t=32" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jf2F8.png" alt="enter image description here" /></a></p> <p>The labeling is iPro 8000, which is a <a href="http://infocenter.3dsystems.com/product-library/sla/ipro-8000-9000" rel="nofollow noreferrer">3dSystems resin printer using SLA technology.</a></p>
<p>If you look at the video at 37 seconds, it appears to be SLA or DLP.</p> <p>Further reading: <a href="https://www.solidprint3d.co.uk/wp-content/uploads/2019/04/SLA_vs_DLP.pdf" rel="nofollow noreferrer">https://www.solidprint3d.co.uk/wp-content/uploads/2019/04/SLA_vs_DLP.pdf</a></p>
1,877
<p>I'm writing a pretty straightforward <code>e-commerce app</code> in <strong>asp.net</strong>, do I need to use transactions in my stored procedures?</p> <p>Read/Write ratio is about 9:1</p>
<p>Many people ask - do I need transactions? Why do I need them? When to use them?</p> <p>The answer is simple: use them all the time, unless you have a very good reason not to (for instance, don't use atomic transactions for "long running activities" between businesses). The default should always be yes. You are in doubt? - use transactions.</p> <p>Why are transactions beneficial? They help you deal with crashes, failures, data consistency, error handling, they help you write simpler code etc. And the list of benefits will continue to grow with time.</p> <p>Here is some more info from <a href="http://blogs.msdn.com/florinlazar/" rel="nofollow noreferrer">http://blogs.msdn.com/florinlazar/</a></p>
<p>Use them if:</p> <ol> <li>There are some errors that you may want to test for and catch which won't be caught except by you going out and doing the work (looking things up, testing values, etc.), usually from within a transaction so that you can roll back the whole operation.</li> <li>There are multi-step operations of any sort, which should, logically, be rolled back as a group if they fail.</li> </ol>
8,527
<p>my primary language is spanish, but I use all my software in english, including windows; however I'd like to use speech recognition in spanish.</p> <p>Do you know if there's a way to use vista's speech recognition in other language than the primary os language?</p>
<p>Citation from Vista <a href="http://blogs.msdn.com/speech/archive/2007/09/01/windows-speech-recognition-language-support-in-windows-vista.aspx" rel="nofollow noreferrer">speech recognition blog</a>:</p> <blockquote> <p>In Windows Vista, Windows Speech Recognition works in the current language of the OS. That means that in order to use another language for speech recognition, you have to have the appropriate language pack installed. Language packs are available as free downloads through Windows Update for the Ultimate and Enterprise versions of Vista. Once you have the language installed, you’ll need to change the display language of the OS to the language you want to use. Both of these are options on the “Regional and Language Options” control panel. You can look in help for “Install a display language” or “Change the display language”.</p> </blockquote>
<p>You can install the language pack, but not apply it on your user. Then you might be able to change the language of the speech recognition, although I haven't tried it since I don't have Vista Ultimate.</p>
5,713
<p>At the moment, I am thinking about print fans that cool the plastic when printing. I am not asking about the design of the fanducts, which might be a whole book on its own. I would like to know how to find out the best application of print cooling for a given PLA filament, - that is fan speeds and setup in a slicer of your choice (to learn what the different options are).</p>
<p>Everybody's combination of fan hardware and print settings is different. Unless someone else has the exact same printer and slicer profiles as you, there's no way to really say anything like "use X% for PLA" or whatever. For practical purposes, you just empirically figure it out with test prints based on a few simple rules of thumb:</p> <ul> <li><strong>Use lots of cooling for PLA, moderate cooling for PETG, and minimal cooling for ABS.</strong> (Note that sometimes ABS does benefit from gentle airflow, and PLA shouldn't necessarily always just be blasted at max power.)</li> <li><strong>Use less cooling on big prints where each layer takes a long time, more cooling on small prints where each layer is very quick.</strong></li> <li>Axial / box fan? You'll probably want to run it at full power. Radial / squirrel cage blower? You may want to run lower power. </li> <li><strong>Overhangs curling up or sagging? More airflow may be needed.</strong> (Lower layer heights also help enormously.)</li> <li><strong>Hot end temp sagging when the fan kicks on? Try less airflow.</strong> (Or insulate your hot block better.)</li> <li><strong>Weak layer bonding? Try less airflow.</strong> (Or raise your hot end temp.)</li> <li><strong>Small, fast prints getting mushy or corners "pulling in"? You need more airflow.</strong> (Or lower heatbed temps.)</li> <li><strong>Print warping / corners lifting off the bed? Try less airflow, particularly on the lowest few layers.</strong> (Or higher heatbed temps, or a better adhesion layer, or less nozzle/bed gap for the first layer, or any other approach.)</li> <li><strong>Fan too noisy? Try less airflow.</strong> (Or get a better fan.)</li> <li><strong>Filament stringing during travel moves? Try less airflow pointed directly at the nozzle.</strong> (Or tune your retraction settings better, or get the moisture out of your filament, or lower hot end temp.)</li> </ul>
<p>I use PLA and both my fans stopped working. I am not techy and couldn't figure out how to fix them so I set up a house fan that blew directly at the motor keeping it cool and it works as good if not better than the fans that came with the 3d printer. You cannot let your motors over heat because your filament will get curled up insize the nozzle.So try that before buying 3d printer fans.</p>
341
<p>I want to create a custom control in C#. But every time I have to fully redraw my control, it flickers, even if I use double buffering (drawing to an Image first, and blitting that).</p> <p>How do I eliminate flicker when I have to fully redraw?</p>
<p>You could try putting the following in your constructor after the InitiliseComponent call. </p> <pre><code>SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); </code></pre> <p>EDIT:</p> <p>If you're giving this a go, if you can, remove your own double buffering code and just have the control draw itself in response to the appropriate virtual methods being called.</p>
<p>You say you've tried double buffering, but then you say drawing to an Image first and blitting that. Have you tried setting DoubleBuffered = true in the constructor rather than doing it yourself with an Image?</p>
8,978
<p>Most electronics use micro-controllers like an AVR, but I'm seeing ARM chips in new electronics. ARM chips are said to be more powerful, but in what areas related to 3D printing could this help? What are the features that the AVR struggles with and where an ARM could be better?</p> <p>High Speed movement? Delta printers? Graphic display?</p> <p>And is the AVR really the limitation there?</p>
<p>3D printer controllers have to do a lot of stuff very, very fast. Performing kinematics and dynamics calculations while sending many thousands of precisely-synchronized step pulses per second is <em>really, really hard</em>. The 8bit AVR line of microcontrollers used in older 3D printer controllers is basically a late-1990s era Mr Coffee processor. They are completely, utterly maxed out on processor time just executing basic printing functions in simple (eg Cartesian) printers, and adding additional calculation load will bog them down and cause slowdowns, stuttering, pausing, and so on. </p> <p>"But my 8bit printer works fine," you say. No, it doesn't. Your print performance is limited by it, whether you realize it or not. Slicers now automatically hide a lot of the firmware's performance shortcomings from you. For example, the standard practice of greatly slowing down print speeds on perimeters is largely a result of 8bit processors having inadequate resources for two things:</p> <ol> <li>Performing centripetal acceleration calculations for curves across multiple gcode segments </li> <li>Keeping up with gcode transmission/processing and motion planning for gcode with lots of very small segments, such as in organic models or smooth arcs</li> </ol> <p>When presented with a series of very small segments in a smooth arc or complex curve, the 8bit firmware will likely choke on the required command processing rate and introduce stuttering to the print. These incredibly brief pauses allow residual pressure in the extruder to push out some extra plastic, making a little zit on the print. So most slicers automatically decimate curves and output gcode with reduced resolution to lighten the load on the firmware. Problem solved, right?</p> <p>But there's another issue -- the GRBL motion control algorithms underlying all the major open source 3D printer controllers were designed with lots of shortcuts and hacks to allow 8bit processors to execute fast enough. For example, the basic algorithm only looks at the speed or velocity change at the corner between two segments, and uses that to decide when to decelerate/accelerate along the direction of motion. It does not calculate or consider centripetal/radial acceleration whatsoever. This is a really effective hack when printing boxy, low-res models, but it fails miserably on smooth curves with lots of little segments. The firmware does not detect any appreciable velocity change at the corner of any two nearly-linear segments within the faceted curve, and thus does not slow down for the curve. So complex geometry is effectively printed at constant velocity, with no acceleration.</p> <p>Printing complex perimeters unaccelerated means the commanded feedrate must be very low to get good quality. Most printers are limited to about 40mm/s or less on complex perimeters, despite being able to run perhaps 80-120mm/s on low-complexity infill before hitting other speed limits.</p> <p>Between the command processing rate limits and motion planner shortcomings required by low power processors, print speeds must be much lower in practice than is strictly required by the physics and printer hardware. This all comes from 8bit processors. The workarounds and best practices to deal with this problem are so deeply baked into the toolchains and ecosystem that very few people realize there is even a problem. But it's a real limit that can be overcome: a high-speed processor running a more rigorous motion planner could generate higher average print speeds with <em>better</em> print quality. </p> <p>That said, the ARM-based firmwares are only slowly moving towards more advanced motion planners. This is a big development area right now that is actually driving an upcoming shift away from low-end ARMs like the Cortex M3 towards even faster processors. It's actually not all that hard to max out an 84 MHz Arduino Due by piling on a bunch of firmware features. </p> <p>The use of 8bit processors also makes printers LOUDER. The biggest consumer of processor time in a typical 8bit printer is the stepper interrupt that fires the step pulses to make the motors move. It is quite typical for >60% of all clock cycles on an Atmega AVR to go to firing step pulses. Because this occurs as an interrupt, other processing tasks that the printer must perform -- like acceleration calculations and heater control -- get squeezed into the brief spaces between stepper interrupt events. </p> <p>Without careful firmware design, the step pulses will completely "crowd out" other functionality like LCD display updates and acceleration calculations. In order to allow higher motion rates without using all the processor resources, 8bit firmwares have a mode called "step doubling" that fires two (or four, or eight) step pulses per stepper interrupt so that half (or a quarter, or an eighth) as many stepper interrupts can be used to produce the same motion speed. This practice de-bottlenecks the processor, but it causes rougher and louder motor motion because the step pulses are fired in bursts rather than a constant frequency. In effect, the microstepping level of the motor is functionally dropped to a coarser mode when the stepper interrupt fires double or quad steps. So the motors get louder, less precise, and in extreme cases may have problems with resonance. </p> <p>An interesting side effect is that if you switch a Marlin-based printer from 1/16 microstepping to 1/32 microstepping, and keep the same print speeds, the firmware will simply start step-doubling, dropping your effective microstepping level right back down to 1/16.</p> <p>ARM-based firmwares also use step doubling, but the allowable step rates are typically ~8 times higher before double/quad stepping is used. That can mean higher speeds and/or smoother motion. </p> <p>Another issue with 8bit AVRs is the lack of hardware floating point and need to spend many clock cycles on high-precision calculations or handling very large numbers. Delta kinematics, auto-leveling functions, calculating moves with extremely high step counts for large printers, and other advanced functionality all take a <strong>lot</strong> of clock cycles on an 8bit processor. Poor firmware design or carelessly adding a feature that requires a few extra square roots and trig functions can completely bog down the processor. This kind of feature creep and code bloat has seriously impacted Marlin's performance over time as people ask more and more of the old AVR. </p> <p>In comparison, a 32bit processor doesn't just have a faster clock and more clock cycles, it is also able to do much more complex math in fewer clock cycles, because it has dedicated hardware functionality that takes care of many of the steps an 8bit processor must do in software. </p> <p>Do 8bit processors work? Sure, they work surprisingly well for what they are and what we ask of them. But they unquestionably limit the performance and features of modern 3D printers. Even today's current generation of 32bit processors is already being maxed out by high speed printers and math-heavy features. The 8bit processor is already two generations behind what would qualify as a "modern" 3D printer controller. </p>
<p>AVR processors are 8 bit - thus they can only fetch data from memory 8 bits at a time - while an ARM is 32 bit and can fetch data 32 bits at a time. Position resolution requires a 24 bit value minimum - this means the AVR takes 3 data fetches for the position - whereas the ARM takes 1 data fetch.</p> <p>Worse still, AVR processors internally divide the clock by 3, so that a 40&nbsp;MHz AVR is running at 13.3 MHz typically, while an ARM is 1 clock cycle per bus transaction and instruction processing - this includes a 32 bit by 32 bit multiple in 1 clock cycle.</p> <p>The memory map on ARM processors is 32 bit wide or 4&nbsp;GB while 8 bit processors only have an address bus of 16 bits or 64&nbsp;KB - which means that bank switching comes into play on any program over 64&nbsp;KB - this takes instructions and time to be done - while with the ARM this is not an issue. </p> <p>The cost aspects is about the same as AVRs - it just requires redesigned firmware.</p> <p>As for FPGAs: </p> <ul> <li>They cost the same or more than the processor </li> <li>They are fast, specialized, devices and can be configured for specialized task </li> <li>They have additional cost factors: <ul> <li>lots more decoupling caps are needed because of the speed of the circuits in the FPGA. </li> <li>Require additional power supplies, and ground planes and power plans - which tends to mean (and require) a minimum of a 4 layer board, or possibly 6 layers, which adds to the cost of the electronics </li> </ul></li> </ul> <p>The result of adding a FPGA to a AVR will cost a lot more than going to a more powerful ARM processor. </p>
192
<p>I'm using an identical call to "CryptUnprotectData" (exposed from Crypt32.dll) between XP and Vista. Works fine in XP. I get the following exception when I run in Vista:</p> <pre><code>"Decryption failed. Key not valid for use in specified state." </code></pre> <p>As expected, the versions of crypt32.dll are different between XP and Vista (w/XP actually having the more recent, possibly as a result of SP3 or some other update).</p> <p>More specifically, I'm encrypting data, putting it in the registry, then reading and decrypting using "CryptUnprotectData". UAC is turned off.</p> <p>Anyone seen this one before?</p>
<p>The <a href="http://msdn.microsoft.com/en-us/library/aa380882.aspx" rel="nofollow noreferrer">CryptUnprotectData function</a> documentation states that it usually only works when the user has the same logon credentials as the encrypter.</p> <p>This suggests to me that maybe the key is tied to the user's current token. Since you mention Vista, this makes me think UAC and restricted tokens.</p> <p>Can you show us some code? Can you give us more information about what you're doing with the data -- i.e. are you moving it between processes, or users, or computers?</p>
<p>Nice. Hopefully this is my bone-head move of the week! ;-)</p> <blockquote> <p>This suggests to me that maybe the key is tied to the user's current token.</p> </blockquote> <p>That was it. Turns out I was using encrypted data from another machine (the XP one) and trying to decrypt on the Vista machine.</p> <p>As the MSDN documentation states:</p> <blockquote> <p>Usually, only a user with the same logon credentials as the encrypter can decrypt the data. In addition, <strong>the encryption and decryption must be done on the same computer.</strong></p> </blockquote> <p>Once I re-encrypted the data on the Vista machine, decryption works as expected.</p> <p>Thanks.</p>
8,977
<p>My voltage at the controller at max load is ~11.4&nbsp;V (heated bed + motors + hotend). Is this normal? </p> <p>I'm measuring 11.8&nbsp;V at the PSU, so 0.4&nbsp;V -> 5&nbsp;W lost in the wires.</p> <p>I have a pretty beefy ~2&nbsp;mm diameter copper wire that's ~1&nbsp;m long. Its area is 2.5&nbsp;mm<sup>2</sup>. The diameter with shielding is 3.5&nbsp;mm.</p> <p>Could there be a bad connection somewhere?</p> <p>Checked the wire is warm to touch, so looks like it's actually the cause. Is this normal? Should I go for even bigger wires?</p>
<p>Regardless of how the voltage is lowered, you aren't delivering the power to the heating elements that they are designed to deliver. For a resistive heater, the power scales with the square of the voltage.</p> <p>Delivering 11.4&nbsp;V to the heaters will result in the power being <span class="math-container">$11.4^2/12.0^2 = 0.9025$</span> or 90&nbsp;% of the intended power.</p> <p>There are two things you could do to increase the power at the heaters.</p> <ol> <li>Your voltage is starting out low, which you may be able to increase at the power supply to 12.0&nbsp;V.</li> <li>The voltage drop in the 1-meter cables can be reduced by using shorter cables or larger cross-sectional area conductors. 13 gauge is not a very heavy wire for low-voltage high-current DC. I would suggest 10 gauge, and would prefer 8 gauge.</li> </ol> <p>The logic in the controller board should be fine as you are now. Controller boards include regulators that being the nominal 12&nbsp;V down to the 5&nbsp;V or 3.3&nbsp;V required by the digital logic. These will automatically adjust for changes in the 12&nbsp;V supply.</p> <p>To actually answer your question, the permitted voltage drop is application dependent. As a rule, though, I would suggest that the voltage on the pins of the controller should be 12&nbsp;&plusmn;&nbsp;5&nbsp;%, or from 12.6&nbsp;V to 11.4&nbsp;V. The voltage you measured should be acceptable if it is the true minimum voltage.</p>
<p>Per <a href="https://www.calculator.net/voltage-drop-calculator.html?material=copper&amp;wiresize=6.571&amp;voltage=12&amp;phase=dc&amp;noofconductor=1&amp;distance=6&amp;distanceunit=feet&amp;amperes=18&amp;x=34&amp;y=15" rel="nofollow noreferrer">this website</a> it matches the expectations. Using 13AWG =~ 2.5 mm^2, 18amps, 12volts, 6feet = 2meters (1m back and forth).</p> <p>Results in 0.4v drop.</p>
1,308
<p>I am prototyping some C# 3 collection filters and came across this. I have a collection of products:</p> <pre><code>public class MyProduct { public string Name { get; set; } public Double Price { get; set; } public string Description { get; set; } } var MyProducts = new List&lt;MyProduct&gt; { new MyProduct { Name = "Surfboard", Price = 144.99, Description = "Most important thing you will ever own." }, new MyProduct { Name = "Leash", Price = 29.28, Description = "Keep important things close to you." } , new MyProduct { Name = "Sun Screen", Price = 15.88, Description = "1000 SPF! Who Could ask for more?" } }; </code></pre> <p>Now if I use LINQ to filter it works as expected:</p> <pre><code>var d = (from mp in MyProducts where mp.Price &lt; 50d select mp); </code></pre> <p>And if I use the Where extension method combined with a Lambda the filter works as well:</p> <pre><code>var f = MyProducts.Where(mp =&gt; mp.Price &lt; 50d).ToList(); </code></pre> <p><strong>Question:</strong> What is the difference, and why use one over the other?</p>
<p>LINQ turns into method calls like the code you have.</p> <p>In other words, there should be no difference.</p> <p>However, in your two pieces of code you are not calling .ToList in the first, so the first piece of code will produce an enumerable data source, but if you call .ToList on it, the two should be the same.</p>
<p>Other than the ToList difference, #2 is a lot more readable and natural IMO</p>
2,717
<p>So after a long print the walls in the print begin to weaken and it appears they might not be printed at all. In the upside down picture you can see the weakness where the two pieces are separated. I'm wondering if perhaps reducing my speed and changing the extrusion size from .35 to .45 which is larger than the extruder itself. Thanks for any help and suggestions!</p> <p><a href="https://i.stack.imgur.com/L3xt3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L3xt3.jpg" alt="enter image description here"></a></p>
<p>What you refer to as weak walls in fact are under-extruded walls. This can be caused by multiple sources, but, since the print recovers this most probably is caused by filament that is entangled on the spool (this causes more friction for the extruder and as such less flow, so under-extrusion; like as if the filament is being pulled back). Any other source that may induce extra friction is equally valid. E.g. kink in filament when using a Bowden configuration (long time extra friction in tube) or friction on the spool itself (I once had severe under-extrusion as the spindle of the spool caught a plastic bag which got wrapped around).</p>
<p>A filament tangle is one possibility, one alternative is that you are seeing a jam in the extruder. The trigger for a jam might be excessive retraction, heat soak or some other issue with the heat-break. Less likely, you might have an electrical problem which is position dependant.</p> <p>The extrusion-related issues won't necessarily react in an 'obvious' way to any tweaks you make to the parameters (for example, slower might exacerbate heat-soak because the downward filament flow and thus cooling effect is lower).</p>
1,405
<p>I'm using a native DLL (FastImage.dll) in a C# ASP.NET Web Service that sometimes locks (can't delete it---says access denied); this requires stopping IIS to delete the DLL. The inability to delete this DLL in the bin folder of my published Web Service prevents me from publishing successfully (even though it thinks it published successfully!), which makes development and fixing the bug difficult (especially when it just happily runs old code since my changes may not be reflected on the server!). Note that the bug causing the Web Service to bomb and lock up the DLL is in my code, which is outside of said DLL, so I think this is a more general problem than just the FreeImage library (not to bring them any heat).</p> <ol> <li>Has anyone experienced this?</li> <li>Is there a way to make sure that when it says "Publish succeeded" from the VS IDE that it really means it, or to run sort of script to check that the files are really deleted before it attempts to Publish (like a pre-build step in VC++). (Right now I manually delete the files before publishing to make sure that I know the DLLs were replaced, instead of running old DLLs. It's still a problem, though if I can't delete the DLL.)</li> <li>How would I detect whether a file was successfully deleted from a batch file? (so I can stop and start IIS if it fails)</li> <li>Is it possible to stop and start IIS from a script (preferably from the Publish... action in the VS IDE) and if so, how?</li> </ol>
<p>Using the IISReset command line tool will only restart IIS on the local machine, not on a remote server to which you are publishing.</p> <p>Assuming that you are publishing to a Windows 2003 server, I'd suggest trying the slightly less drastic step of stopping and restarting the IIS AppPool in the web site or virtual folder in which the web service runs. (That way you are not taking all sites that run on the target server offline.) This too assumes that the web service runs in its own app pool. Ideally it should, so you keep it isolated.</p> <p>I'd recommend getting away from using the Publishing process and to look into using a Web Deployment Project. Here is a post on ScottGu's blog detailing <a href="http://weblogs.asp.net/scottgu/archive/2005/11/06/429723.aspx" rel="nofollow noreferrer" title="VS 2005 Web Deployment Projects">VS 2005 Web Deployment Projects</a>.</p> <p>The advantage to the Web Deployment Project approach is that it provides you with all the power and capability of MSbuild, as it is really just a convenience wrapper around MSBuild. Here's a post from the MSBuild team about <a href="http://blogs.msdn.com/msbuild/archive/2005/10/12/480212.aspx" rel="nofollow noreferrer">pre-build and post-build capabilities</a></p> <p>Hope this helps.</p>
<p>You could use the IISReset command line tool to stop/restart iis. So you could write a simple batch file to stop iis, copy your files, and then restart iis. I'm not sure how to integrate this with the VS publish feature however.</p>
5,594
<p>I have a Monoprice Select Mini v2 and it came with a 256 MB SD card. I have a bunch of 16 GB cards. I have made sure that the new SD card has a FAT32 filesystem. I copy the gcode file onto this card and when I put it in the printer, it can't find any files!</p> <p>And yes, the file is at the root level of the filesystem and it uses the proper naming convention. The file works on the old card.</p> <p>Since the old card still works, this isn't an emergency, but I want to have a backup and I don't have any other cards that small.</p>
<p>Unfortunately, the answer isn't as simple as that a specific size of SD card works and another size doesn't. The <a href="https://github.com/MarlinFirmware/Marlin/wiki/SD-cards" rel="nofollow noreferrer">Marlin firmware wiki</a> mentions:</p> <blockquote> <p>The SD- or MMC- Card must be formatted as FAT and must have a MMC interface. This is more likely with cards &lt;= 2&nbsp;GB.</p> </blockquote> <p>MMC is the predecessor of SD. SD cards are <em>not</em> necessarily fully backwards compatible with MMC. Apparently, Marlin uses some features specific to MMC, so your card should support it.</p> <p>The SD card support in Marlin is based on the <a href="https://www.arduino.cc/en/Reference/SD" rel="nofollow noreferrer">Arduino SD Card Library</a>, which further mentions:</p> <blockquote> <p>The library supports FAT16 and FAT32 file systems on standard SD cards and SDHC cards.</p> </blockquote> <p>Based on this:</p> <ul> <li><p>Cards should be formatted FAT16 or FAT32.</p></li> <li><p>Cards bigger than 32&nbsp;GB definitely won't work (not SD or SDHC).</p></li> <li><p>Cards at most 2&nbsp;GB will probably work.</p></li> <li><p>Cards between 2&nbsp;GB and 32&nbsp;GB <em>might</em> work, depending on the specifics of the card.</p></li> </ul>
<p>The maximum size is 32 GB, however using microSD has a little disadvantage:</p> <ol> <li><p>The microSD adapter and Micro memory are wrong assembled and the chip are unable to be read.</p> <p>Solution: stick with a tape adhesive to keep Micro memory and SD adapter well aligned</p> </li> <li><p>The SD adapter can't be read on the 3D printer</p> <p>Solution: Add an extra tape adhesive over the SD adapter just like sticker, to make tight the assembly inside the reader.</p> </li> </ol> <p>Clean the contacts of the SD adapter, normally has the same issue like nintendo cartridge.</p> <p>I´m planning to get a bunch of SD cards instead microSD's, none of SD 8 GB and 16 GB are failing due wrong contact assembly.</p>
785
<p>What is the best way to manage a list of windows (keeping them in order) to be able to promote the next window to the top-level when the current top-level window is closed.<br> This is for a web application, so we're using jQuery Javascript.</p> <p>We'd talked through a few simplistic solutions, such as using an array and just treating [0] index as the top-most window.</p> <p>I'm wondering if there's any potentially more efficient or useful alternative to what we had brainstormed.</p>
<blockquote> <p>Can I hook into the Crystal API and simply list all of the properties of every field or something? Please someone tell me that there's an Open Source project somewhere that does this... @:-)</p> </blockquote> <p>There is in fact, such an API. I wrote a VB6 application to do just what you asked and more. I think I even migrated it to VB.Net. As it was for my own use, I didn't spend much time making it 'polished'. I've been intending to release it, but I haven't had the time...</p> <p>Another approach that I've used in the past is to create an Access application to help manage large, report-development projects. One of it's many features includes the ability to extract the tables that are used by the report, and the SQL statements used by its Commands and SQL Expressions. It's intent is to give one a global perspective of which reports use which tables. I probably still have it somewhere...</p> <p>** edit 1 **</p> <p>BusinessObjects Enterprise XI (R?) has a feature named 'Meta Manager'. It will periodically examine the contents of the Repository and save the results to a database. It uses the Report-Application Service (RAS) to generate the meta data. It's an additional, 5-figure license, of course.</p> <p>** edit 2 **</p> <p>Consider using PowerShell to do the work: <a href="https://github.com/craibuc/PsCrystal" rel="noreferrer">PsCrystal</a>.</p>
<p>One helpful technique is to output both versions of the report to plain text, then diff those outputs.</p> <p>You could write something using the crystal report component to describe every property of the report, like you described. Then you could output <em>that</em> to text, and diff <em>those</em>. I'm not aware of any open source tool that does it for you, but it would not be terribly hard to write it.</p> <p>@question in the post: Diffing the outputs would only show formatting changes if the <em>relative</em> positions had changed. For example, if i had this:</p> <p>before: First name, last name, addresss</p> <p>after: Last Name, First Name, Address</p> <p>Then that would show up as a difference.</p> <p>But if I had just bumped the address column over a few pixels, or changed it from plain text to bold, then you are right, that would not show up.</p>
4,031
<p><code>GNU sed version 4.1.5</code> seems to fail with International chars. Here is my input file:</p> <pre><code>Gras Och Stenar Trad - From Moja to Minneapolis DVD [G2007DVD] 7812 | X &lt;br&gt; Gras Och Stenar Trad - From Möja to Minneapolis DVD [G2007DVD] 7812 | Y </code></pre> <p>(Note the umlaut in the second line.)</p> <p>And when I do</p> <pre><code>sed 's/.*| //' &lt; in </code></pre> <p>I would expect to see only the <code>X</code> and <code>Y</code>, as I've asked to remove ALL chars up to the <code>'|'</code> and space beyond it. Instead, I get:</p> <pre><code>X&lt;br&gt; Gras Och Stenar Trad - From M? Y </code></pre> <p>I know I can use tr to remove the International chars. first, but is there a way to just use sed?</p>
<p>I think the error occurs if the input encoding of the file is different from the preferred encoding of your environment. </p> <p>Example: <code>in</code> is UTF-8</p> <pre><code>$ LANG=de_DE.UTF-8 sed 's/.*| //' &lt; in X Y $ LANG=de_DE.iso88591 sed 's/.*| //' &lt; in X Y </code></pre> <p>UTF-8 can safely be interpreted as ISO-8859-1, you'll get strange characters but apart from that everything is fine.</p> <p>Example: <code>in</code> is ISO-8859-1</p> <pre><code>$ LANG=de_DE.UTF-8 sed 's/.*| //' &lt; in X Gras Och Stenar Trad - From MöY $ LANG=de_DE.iso88591 sed 's/.*| //' &lt; in X Y </code></pre> <p>ISO-8859-1 cannot be interpreted as UTF-8, decoding the input file fails. The strange match is probably due to the fact that sed tries to recover rather than fail completely.</p> <p>The answer is based on Debian Lenny/Sid and sed 4.1.5.</p>
<p><code>sed</code> is not very well setup for non-ASCII text. However you can use (almost) the same code in <code>perl</code> and get the result you want:</p> <pre><code>perl -pe 's/.*\| //' x </code></pre>
9,295
<p>we have a lot of users running in different shared and solo-owned repositories in Subversion. As part of our work, we do project-shared code and individual work, and we need to control access, ideally on a group basis. Currenly, we use <a href="http://svnmanager.sourceforge.net/" rel="noreferrer">SVNManager</a> to allow users to manage access and create repositories. However, in order to get that working we had to do quite a bit of hacking. </p> <p>Does anyone know of a free, open-source, linux-compatible SVN management system?</p> <p>Thanks for your help.</p>
<p>I would recommend SVN Access: <a href="http://www.jaj.com/projects/svnaccess/" rel="nofollow noreferrer">http://www.jaj.com/projects/svnaccess/</a> or <a href="http://freshmeat.net/projects/svnaccess/" rel="nofollow noreferrer">http://freshmeat.net/projects/svnaccess/</a> I have used it as is, and have modified it for an enterprise-wide solution at my day job.</p>
<p>I use KDESVN. Once it's set up it works great, but you only get one chance to set up your branch structure, so plan to create a test repository first.</p>
3,601
<p>I'm using the <a href="http://msdn.microsoft.com/en-us/library/ms178329.aspx" rel="nofollow noreferrer">ASP.NET Login Controls</a> and <a href="http://msdn.microsoft.com/en-us/library/aa480476.aspx" rel="nofollow noreferrer">Forms Authentication</a> for membership/credentials for an ASP.NET web application. It keeps redirecting to a Login.aspx page at the root of my application that does not exist. My login page is within a folder.</p>
<p>Use the LoginUrl property for the forms item?</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms defaultUrl="~/Default.aspx" loginUrl="~/login.aspx" timeout="1440" &gt;&lt;/forms&gt; &lt;/authentication&gt; </code></pre>
<p>I found the answer at <a href="http://www.codersource.net/asp_net_forms_authentication.aspx" rel="nofollow noreferrer">CoderSource.net</a>. I had to put the correct path into my web.config file.</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;system.web&gt; ... &lt;!-- The &lt;authentication&gt; section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --&gt; &lt;authentication mode="Forms"&gt; &lt;forms loginUrl="~/FolderName/Login.aspx" /&gt; &lt;/authentication&gt; ... &lt;/system.web&gt; ... &lt;/configuration&gt; </code></pre>
5,308
<p>I don't edit CSS very often, and almost every time I need to go and google the <a href="http://www.w3.org/TR/REC-CSS2/box.html" rel="noreferrer">CSS box model</a> to check whether <code>padding</code> is inside the <code>border</code> and <code>margin</code> outside, or vice versa. (Just checked again and <code>padding</code> is inside).</p> <p>Does anyone have a good way of remembering this? A little mnemonic, a good explanation as to why the names are that way round ...</p>
<p>When working with CSS finally drives you mad the padded cell that they will put you in has the padding on the <em>inside</em> of the walls.</p>
<p>Margin:When you want move the block. Padding: When you want move the items within a block.</p>
5,266
<p>I wanted to show the users Name Address (see <a href="http://www.ipchicken.com" rel="nofollow noreferrer">www.ipchicken.com</a>), but the only thing I can find is the IP Address. I tried a reverse lookup, but didn't work either:</p> <pre><code>IPAddress ip = IPAddress.Parse(this.lblIp.Text); string hostName = Dns.GetHostByAddress(ip).HostName; this.lblHost.Text = hostName; </code></pre> <p>But HostName is the same as the IP address.</p> <p>Who know's what I need to do?</p> <p>Thanks. Gab.</p>
<p>Edit of my previous answer. Try (in vb.net): </p> <pre><code> Dim sTmp As String Dim ip As IPHostEntry sTmp = MaskedTextBox1.Text Dim ipAddr As IPAddress = IPAddress.Parse(sTmp) ip = Dns.GetHostEntry(ipAddr) MaskedTextBox2.Text = ip.HostName </code></pre> <p>Dns.resolve appears to be obsolete in later versions of .Net. As stated here before I believe the issue is caused by your IP address not having a fixed name or by it having multiple names. The example above works with Google addresses, but not with an address we use that has a couple of names associated with it. </p>
<p>Not all IP addresses need to have hostnames. I think that's what is happening in your case. Try it ouy with more well-known IP/hostname pairs eg:</p> <blockquote> <p>Name: google.com Address: 72.14.207.99</p> <p>Name: google.com Address: 64.233.187.99</p> <p>Name: google.com Address: 64.233.167.99</p> </blockquote> <p>...I might just be wrong</p>
3,839
<p>Wifi support on Vista is fine, but <a href="http://msdn.microsoft.com/en-us/library/bb204766.aspx" rel="nofollow noreferrer">Native Wifi on XP</a> is half baked. <a href="http://msdn.microsoft.com/en-us/library/aa504121.aspx" rel="nofollow noreferrer">NDIS 802.11 Wireless LAN Miniport Drivers</a> only gets you part of the way there (e.g. network scanning). From what I've read (and tried), the 802.11 NDIS drivers on XP will <em>not</em> allow you to configure a wireless connection. You have to use the Native Wifi API in order to do this. (Please, correct me if I'm wrong here.) Applications like <a href="http://www.metageek.net/products/inssider" rel="nofollow noreferrer">InSSIDer</a> have helped me to understand the APIs, but InSSIDer is just a scanner and is not designed to configure Wifi networks.</p> <p>So, the question is: where can I find some code examples (C# or C++) that deal with the configuration of Wifi networks on XP -- e.g. profile creation and connection management?</p> <p>I should note that this is a XP Embedded application on a closed system where we can't use the built-in Wireless Zero Configuration (WZC). We have to build all Wifi management functionality into our .NET application.</p> <p>Yes, I've Googled myself blue. It seems that someone should have a solution to this problem, but I can't find it. That's why I'm asking here.</p> <p>Thanks.</p>
<p>You kind of have to get a "feel" for what programmers had to do back in the day. The vast majority of the code I work with is older than I am and ran on machines that were "new" when my parents were in high school.</p> <p>Common FORTRAN-isms I deal with, that hurt readability are:</p> <ul> <li>Common blocks</li> <li>Implicit variables</li> <li>Two or three DO loops with shared CONTINUE statements</li> <li>GOTO's in place of DO loops</li> <li>Arithmetic IF statements</li> <li>Computed GOTO's</li> <li>Equivalence REAL/INTEGER/other in some common block</li> </ul> <p>Strategies for solving these involve:</p> <ol> <li>Get <a href="http://www.polyhedron.com/spag0html" rel="noreferrer">Spag / plusFORT</a>, worth the money, it solves a lot of them automatically and Bug Free(tm)</li> <li>Move to Fortran 90 if at all possible, if not move to free-format Fortran 77</li> <li>Add IMPLICIT NONE to each subroutine and then fix every compile error, time consuming but ultimately necessary, some programs can do this for you automatically (or you can script it)</li> <li>Moving all COMMON blocks to MODULEs, low hanging fruit, worth it</li> <li>Convert arithmetic IF statements to IF..ELSEIF..ELSE blocks</li> <li>Convert computed GOTOs to SELECT CASE blocks</li> <li><p>Convert all DO loops to the newer F90 syntax</p> <pre><code>myloop: do ii = 1, nloops ! do something enddo myloop </code></pre></li> <li><p>Convert equivalenced common block members to either ALLOCATABLE memory allocated in a module, or to their true character routines if it is Hollerith being stored in a REAL</p></li> </ol> <p>If you had more specific questions as to how to accomplish some readability tasks, I can give advice. I have a code base of a few hundred thousand lines of Fortran which was written over the span of 40 years that I am in some way responsible for, so I've probably run across any "problems" you may have found.</p>
<p>Here's another one that has bit me from time to time. When you are working on FORTRAN code make sure you skip all six initial columns. Every once and a while, I'll only get the code indented five spaces and nothing works. At first glance everything seems okay and then I finally realize that all the lines are starting in column 6 instead of column 7.</p> <p>For anyone not familiar with FORTRAN, the first 5 columns are for line numbers (=labels), the 6th column is for a continuation character in case you have a line longer than 80 characters (just put something here and the compiler knows that this line is actually part of the one before it) and code always starts in column 7.</p>
5,161
<p>What are the main differences (if any) between the box models of IE8 and Firefox3?</p> <p>Are they the same now?</p> <p>What are the other main differences between these two browsers? Can a web developer assume that these two browsers as the same since they (seem to) support the latest web standards?</p>
<p>The Internet Explorer box model has been "fixed" since Internet Explorer 6 so long as your pages are in standard compliants mode.</p> <p>See: <a href="http://en.wikipedia.org/wiki/Quirks_mode" rel="noreferrer">Quirks mode</a> and <a href="http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug" rel="noreferrer">Internet Explorer box model bug</a>.</p> <p>Until I learnt about doctype declerations getting IE to work properly was a real PAIN, because IE runs in "quirks mode" by default. So having a standards mode doctype will eliminate a whole bunch of the most painful CSS problems.</p>
<p>Things that will always differ between the two (and other browsers) are default values (font sizes in headings, for example). The way they achieve default visuals is often different, as well, such as whether or not they use padding or margin to achieve the indentation in bulleted lists.</p> <p>Something quite positive that I just noticed is that IE8 finally fixes IE's handling of <code>margin: 0 auto</code> for block elements that you want horizontally centered in their respective parents. </p>
6,727
<p>Let's say I want a way to display just the the center 50x50px of an image that's 250x250px in HTML. How can I do that. Also, is there a way to do this for css:url() references? <p> I'm aware of <em>clip</em> in CSS, but that seems to only work when used with absolute positioning.</p>
<p>One way to do it is to set the image you want to display as a background in a container (td, div, span etc) and then adjust background-position to get the sprite you want. </p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>div{ width: 50px; height: 50px; background: no-repeat -100px -100px/500% url("https://qce.quantum.ieee.org/2022/wp-content/uploads/sites/6/2022/02/QCE22-250x250-website@1x.jpg") };</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> </div> </div> </p>
8,208
<p>For my blog I am wanting to use the Output Cache to save a cached version of a perticular post for around 10 minutes, and thats fine...</p> <pre><code>&lt;%@OutputCache Duration="600" VaryByParam="*" %&gt; </code></pre> <p>However, if someone posts a comment, I want to clear the cache so that the page is refreshed and the comment can be seen.</p> <p>How do I do this in ASP.Net C#?</p>
<p>I've found the answer I was looking for:</p> <pre><code>HttpResponse.RemoveOutputCacheItem("/caching/CacheForever.aspx"); </code></pre>
<p><code>HttpRuntime.Close()</code> .. I try all method and this is the only that work for me</p>
3,267
<p>So I am trying to get the XSD-Schema from this object. When I open the File I just get something like this code (snippet):</p> <pre><code>¸†2¡Q·2ºyƒeCã2ï…w ïÀ|¼ðAøä[0Ÿ |&gt;‚|ó‘å2²ºFƒ¼Æò1ùàåcj@Þ`ùиÌ{áÈ;0/|¾ ùÌ'Ÿ„ Á|d½¬¬¯Õ ¯±|l¾…­Œo@Þ`ùиÌ{áÈ;0/|¾ùÌ'Ÿ„ Á|d½œ¬¯Ó ¯±|h\æ­Œo@Þ`ù¸| ßBs¦5–Œ~ôè»­£(™c´“Ç£[yp1:æ'Éc4Jó Uâ˜ÍÇ&lt;h—8^'Ð¯É </code></pre> <p>What is this? How can I convert it back? I need to edit the structure manually. <br>Thank you in advance.</p>
<p>Three likely culprit:</p> <ul> <li><strong>The file is compressed but your machine can't detect it</strong>. So for example the 3MF model has been zipped, and what you are trying to do is opening the zip archive in the text editor, rather than the file that is in the zip archive. Solution: try to see if common decompress utilities like zip, gzip, 7z can open the file.</li> <li><strong>The file is a 3MF model but the <a href="https://en.wikipedia.org/wiki/Character_encoding" rel="nofollow noreferrer">character encoding</a> in the file being different than the one your editor is expecting</strong> (typically <code>Unicode/UTF-8</code>, these days). Solution: read on the rest of this answer.</li> <li><strong>The file is a binary one that is totally unrelated to 3MF</strong>. So in essence: an error, you are trying to open maybe an MP3 or a JPG file believing it to be a 3MF instead.</li> </ul> <p>As for the "wrong encoding" option... Oversimplifying a bit, the story goes like this:</p> <ul> <li>computers write data to files in bytes,</li> <li>a byte can only be set to one of its 256 possible values,</li> <li>in the early days of computing, when computers were just glorified calculators, it was enough to have a 1:1 ratio between the byte possible values and the symbols one wanted to use, so <a href="http://www.asciitable.com/" rel="nofollow noreferrer">ASCII</a> was born (actually ASCII only "mapped" the first 127 values of the byte, but that is a detail). So: value #49 would represent a <code>1</code>, value #90 a <code>Z</code> and so on...</li> <li>shortly afterwards, computers became powerful enough that people wanted to use them to process human languages, so the need for more characters (like accented ones <code>åáä</code> or the ones from non-latin alphabets like Cyrillic <code>язы́к</code> or arabic <code>عَرَبِيّ‎</code>, or...) came to be and engineers speaking different languages had the "brilliant" idea to each use the other 127 "free slots" in a byte for their favourite languages, thus a plethora of <a href="https://en.wikipedia.org/wiki/Extended_ASCII" rel="nofollow noreferrer">extended ASCII</a> encodings was born, <strong>each using the same byte value, but each mapping to a different symbol</strong>.</li> <li>later on, people began to realise the need to combine the use of say Gaelic, English, Japanese and Farsi with mathematical symbols, and thus they came up to way to map symbols to values expressed as the product of more bytes (so for example: 2 bytes encoding could map 256x256=65536 symbols). Again: each system using the same values but different symbols.</li> <li>finally after decades of frustrated users and expensive bugs, engineers around the world settled for a multi-byte <strong>standard that has 1,114,112 possible values that could contain all characters one can possibly need</strong>, and <a href="https://en.wikipedia.org/wiki/Unicode" rel="nofollow noreferrer">Unicode</a> was born.</li> </ul> <p>Back to your question: despite unicode having been around for a few decades now, legacy software and sloppy programming are a thing, and there are still systems that do not use unicode internally but some legacy "special purpose" encoding.</p> <p>Unfortunately, it is <a href="https://softwareengineering.stackexchange.com/a/187174/29074">impossible to say with certainty how a file was encoded</a>, so <strong>occasionally you may find yourself opening a file and starting decoding it according to a "conversion table" that is not the one used by the author of the file itself</strong>. This is what it looks like is happening to you.</p> <p>Onward to what you can try to do to fix this...</p> <p>First of all: as attentive readers may have already inferred, <strong>you will need the actual file</strong> for this. In fact if you cut-and-paste its "content" from an editor what you are really doing is cutting-and-pasting the <em>decoding</em> your computer did of the byte values, and not the byte values themselves.</p> <p>Then your best bets are:</p> <ul> <li><strong>Try one of the online detectors</strong> like <a href="https://nlp.fi.muni.cz/projects/chared/" rel="nofollow noreferrer">this one</a>, using "English" as a language. These detectors work by trying all the decoders they know of until the decoded file will have English (or another language of your choice) words in it. This may not work for you as a 3MF file is mostly numbers, not text, but it is worth a shot.</li> <li><strong>Guesstimate what encoder may have been used</strong>. For example: if you got the file from an old windowsXP machine from Eastern Europe, chances are it may have been encoded with "windows-1251". Use an <a href="http://www.motobit.com/util/charset-codepage-conversion.asp" rel="nofollow noreferrer">online converter</a> to see if you were right about it.</li> <li><strong>Use brute force</strong>. For this you will require to write a simple programme or ask somebody to do it for you, but the key idea here is to have a script taking your original file and decoding it using all encoders in that programming language knows of. Then it will be up to you to open each decoded file individually and verify if it worked or not.</li> </ul>
<p>Seems to be your are trying to edit a file with the wrong file editor.</p> <p>If you have Microsoft® Windows® 8.1, you can print directly using the 3MF format included. Simply set the print options in the 3D Print PropertyManager and print to the 3D printer. A preview of the print bed and the model's location within the print bed lets you modify settings before committing to a 3D print job.</p> <p>To access the 3D print dialog box and specify print options, click File > 3DPrint. The print dialog box that is available depends on your installed 3D print driver.</p> <p>If you need to get the STL you may need to use a file conversion, <a href="https://www.youtube.com/watch?v=6MVeFiCN7bA" rel="nofollow noreferrer">here</a> is a youtube tutorial to makeprintable</p>
794
<p>I have a page which does quite a bit of work and I don't want the user to be able to navigate away from that page (close browser, hit back button, etc.) without getting a warning. I found that the onbeforeunload event (which I think is IE-specific, which works fine for me as the project uses lots of ActiveX) works great.</p> <p>Problem is, I want the user to be able to click on a little "help" icon in the upper-right corner and pop up a help window at any time. This causes onbeforeunload to fire, even though the main window never goes anywhere and the page never unloads. </p> <p>The JavaScript function that runs when the onbeforeunload event runs just puts text into event.returnValue. If I could ascertain, somehow, that the help icon is the one that was clicked then I could just not put text into event.returnValue in that situation. But how could I have the page figure that out?</p>
<p>Let me guess: the help "icon" is actually a link with a <code>javascript:</code> url? Change it to a real button, a real link, or at least put the functionality in an onclick event handler (that prevents the default behavior). Problem solved.</p> <pre><code>&lt;!-- clicking this link will do nothing. No onbeforeunload handler triggered. Nothing. And you could put something in before the return false bit... ...and the onunload handler would still not get called... --&gt; &lt;a href="http://www.google.com/" onclick="return false;"&gt;blah1&lt;/a&gt; &lt;!-- this should also do nothing, but IE will trigger the onbeforeunload handler --&gt; &lt;a href="javascript:void(0)"&gt;blah2&lt;/a&gt; </code></pre>
<p>I have a method that is a bit clunky but it will work in most instances.</p> <p>Create a "Holding" popup page containing a FRAMESET with one, 100% single FRAME and place the normal onUnload and onbeforeUnload event handlers in the HEAD.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script language="Javascript" type="text/javascript"&gt; window.onbeforeunload = exitCheck; window.onunload = onCloseDoSomething; function onCloseDoSomething() { alert("This is executed at unload"); } function exitCheck(evt) { return "Any string here."} &lt;/script&gt; &lt;/head&gt; &lt;frameset rows="100%"&gt; &lt;FRAME name="main" src="http://www.yourDomain.com/yourActualPage.aspx"&gt; &lt;/frameset&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Using this method you are free to use the actual page you want to see, post back and click hyperlinks without the outer frame onUnload or onbeforeUnload event being fired.</p> <p>If the outer frame is refreshed or actually closed the events will fire.</p> <p>Like i said, not full-proof but will get round the firing of the event on every click or postback.</p>
8,219
<p>Visual Studio solutions contain two types of hidden user files. One is the solution <code>.suo</code> file which is a binary file. The other is the project <code>.user</code> file which is a text file. Exactly what data do these files contain?</p> <p>I've also been wondering whether I should add these files to source control (Subversion in my case). If I don't add these files and another developer checks out the solution, will Visual Studio automatically create new user files?</p>
<p>These files contain user preference configurations that are in general specific to your machine, so it's better not to put it in SCM. Also, VS will change it almost every time you execute it, so it will always be marked by the SCM as 'changed'. I don't include either, I'm in a project using VS for 2 years and had no problems doing that. The only minor annoyance is that the debug parameters (execution path, deployment target, etc.) are stored in one of those files (don't know which), so if you have a standard for them you won't be able to 'publish' it via SCM for other developers to have the entire development environment 'ready to use'.</p>
<p>If you set your executable dir dependencies in <strong>ProjectProperties>Debugging>Environment</strong>, the paths are stored in '.user' files. </p> <p>Suppose I set this string in above-mentioned field: <strong>"PATH=C:\xyz\bin"</strong> This is how it will get stored in '.user' file: </p> <p><code>&lt;LocalDebuggerEnvironment&gt;PATH=C:\xyz\bin$(LocalDebuggerEnvironment)&lt;/LocalDebuggerEnvironment&gt;</code></p> <p>This helped us a lot while working in OpenCV. We could use different versions of OpenCV for different projects. Another advantage is, it was very easy to set up our projects on a new machine. We just had to copy corresponding dependency dirs. So for some projects, I prefer to add the '.user' to source control. </p> <p>Even though, it is entirely dependent on projects. You can take a call based on your needs.</p>
9,794
<p>We have a live MySQL database that is 99% INSERTs, around 100 per second. We want to archive the data each day so that we can run queries on it without affecting the main, live database. In addition, once the archive is completed, we want to clear the live database.</p> <p>What is the best way to do this without (if possible) locking INSERTs? We use INSERT DELAYED for the queries.</p>
<p><a href="http://www.maatkit.org/" rel="noreferrer">http://www.maatkit.org/</a> has mk-archiver</p> <blockquote> <p>archives or purges rows from a table to another table and/or a file. It is designed to efficiently “nibble” data in very small chunks without interfering with critical online transaction processing (OLTP) queries. It accomplishes this with a non-backtracking query plan that keeps its place in the table from query to query, so each subsequent query does very little work to find more archivable rows.</p> </blockquote> <p>Another alternative is to simply create a new database table each day. MyIsam does have some advantages for this, since INSERTs to the end of the table don't generally block anyway, and there is a merge table type to being them all back together. A number of websites log the httpd traffic to tables like that.</p> <p>With Mysql 5.1, there are also partition tables that can do much the same.</p>
<p>Could you keep two mirrored databases around? Write to one, keep the second as an archive. Switch every, say, 24 hours (or however long you deem appropriate). Into the database that was the archive, insert all of todays activity. Then the two databases should match. Use this as the new live db. Take the archived database and do whatever you want to it. You can backup/extract/read all you want now that its not being actively written to.</p> <p>Its kind of like having mirrored raid where you can take one drive offline for backup, resync it, then take the other drive out for backup. </p>
9,084
<p>Maybe my understanding of agile development isn't as good as it should be, but I'm curious how an agile developer would potentially use off-the-shelf (OTS) software when the requirements and knowledge of what the final system should be are changing as rapidly as I understand them to (often after each iteration of development).</p> <hr> <p>I see two situations that are of particular interest to me:</p> <p>(1) An OTS system meets the initial set of requirements with little to no modification, other than potential integration into an existing system. However, within a few iterations of development, this system no longer meets the needs without rewriting the core code. The developers must choose to either spend additional time learning the core code behind this OTS software or throw it away and build from scratch. Either would have a drastic impact on development time and project cost.</p> <p>(2) The initial needs are not like any existing OTS system available, however, in the end when the customer accepts the product, it ends up being much like existing solutions due to requirement additions and subtractions. If the developers had more requirements and spent more time working on them up front, this solution could have been used instead of building again. The project was delivered, but later and at a higher cost than necessary.</p> <hr> <p>As a software engineer, part of my responsibilities (as I have been taught), are to deliver high-quality software to the customer on time at the lowest possible cost (among other things). Agile development allows for high-quality software, but in some cases, it might not be apparent that there are better alternatives until it is too late and too much money has been spent.</p> <p>My questions are:</p> <ol> <li>How does off-the-shelf software fit in with agile development?</li> <li>How do the agile manager and agile developer deal with these cases?</li> <li>What do the agile paradigms say about these cases?</li> </ol>
<h2>Scenario1:</h2> <p>This can occur regardless off the OTS nature of the component. Agile does not mean near-sighted.. you'd need to know the big chunks.. the framework bits and spend thinking time on it beforehand. That said, you can only build to what you know .. Delay only till the last responsible moment.Then you need to pick one of the alternatives and start on it. (I'd Avoid third party application unless the cost of developing it in-house is infeasible.. but that's just me). Prototype multiple solutions to check feasibility with list of known requirements. Keep things loosely coupled (replacable), easy to change and full tested. If you reach the fork of keep hacking or rewrite, you'd need to think of which has better value for the business and pick that option. It's comes down 'Now that we're here, what's the best we can do now?' </p> <h2>Scenario2:</h2> <p>This can happen although the chances are slim compared to the team spending 2-3 months trying to get the requirements 'finalized' only to find that the market needs or customer minds have changed and 'Now we want it this way'. Once again, its a question of what is the point of time till which you are prepared to investigate and explore before committing on a path of action. Decide wisely with whatever information you have upto that point.. Hindsight is always 20-20 but the customers wont wait forever. You can't wait till the point of time where the requirements coalesce to fit a known OTS component :)</p> <p><strong>Agile says Do whatever makes sense and strip out the non-value-adding activities :) Agile is no magic bullet.</strong> just my 2 agile cents :)</p>
<p>I think I read somewhere that if during an iteration you discover that you have more than 20% more work that you initially thought then you should abandon the sprint and start planning a new one taking into account the additional work.</p> <p>So this would mean replanning with the business to see if they still want to go ahead with the original requirements now that you know more.</p> <p>At our company we also make use of prototyping before the sprint to try and identify these kind of situations before they arise on a sprint. Although of course that still may not identify the kind of situation that you describe.</p>
7,481
<p>I began printing the parts for the Ultrascope DIY telescope designed by the Open Space Agency. See <a href="http://www.openspaceagency.com/ultrascope" rel="noreferrer">http://www.openspaceagency.com/ultrascope</a>.</p> <p>All of the STL files for the 3D printable parts are canted 45 degrees. Brackets, tubes, everything I have seen so far. Is there a reason for this? I printed one part last night and simply rotated the part so it would lay flat because I didn't want to deal with supports. I am relatively new to 3D printing -- Am I missing something I should know? Is this a thing?</p>
<p>The orientation of the part in the STL file depends on the Software that creates the file. I had a software that would export the parts standing upright instead of laying flat. Depending on the CAD software it can be beneficial for the creator of the model to create in in a different orientation as the one you want to use for printing. Also not all CAD Engineers know (or care) about the best orientation for printing a part.</p> <p>So my guess is that this is an issue of file export/ STL file creation.</p> <p>It is totally normal to rotate the parts into a position that is best for printing.</p>
<p>Layer lines are failure lines.</p> <p>Sometimes I choose to print a part in a weird or sub-optimal orientation just to minimise the load across layer lines when in use.</p> <p>That may mean more support material and longer print time, but a completed part that fails is no use at all.</p>
244
<p>The job at hand:</p> <p>I want to make sure that my website's users view a page before they start a download. If they have not looked at the page but try to hotlink to the files directly they should go to the webpage before the download is allowed.</p> <p>Any suggestions that are better than my idea to send out a cookie and - before the download starts - check if the cookie exists (via .htaccess)?</p> <p>The webpage and the download files will be located on different servers.</p> <p>Environment:</p> <ul> <li>Apache 2 on all machines</li> <li>PHP 5 on all machines</li> <li>MySQL 5 available on the "webpage" server (no access from the download servers)</li> </ul> <p>Nathan asked what the problem is that I try to solve, and in fact it is that I want to prevent hotlinks from - for example - forums. If people download from our server, using our bandwidth, I want to show them an page with an ad before the download starts. It doesn't need to be totally secure, but we need to make some money to finance the servers, right? :)</p>
<p>Instead of allowing hotlinking to the files, store them outside of a web accessible route. Instead make download requests go to a php script that initiates the download. You can put checks in place to ensure that the requesting page was the one you wanted read.</p>
<p>I was about to suggest the .htaccess referral trick, but it isn't a very secure method. It's easy to make a PHP script, with a custom http-referral added. If you enter the download page there, it will think you come from that page.</p> <p>Is this a relevant problem? Can you tell something about the context of your download page?</p>
7,826
<p>I've tried using source control for a couple projects but still don't really understand it. For these projects, we've used TortoiseSVN and have only had one line of revisions. (No trunk, branch, or any of that.) If there is a recommended way to set up source control systems, what are they? What are the reasons and benifits for setting it up that way? What is the underlying differences between the workings of a centralized and distributed source control system?</p>
<p>I recommend checking out the following from Eric Sink:</p> <p><a href="http://www.ericsink.com/scm/source_control.html" rel="noreferrer">http://www.ericsink.com/scm/source_control.html</a></p> <p>Having some sort of revision control system in place is probably the most important tool a programmer has for reviewing code changes and understanding who did what to whom. Even for single person projects, it is invaluable to be able to diff current code against previous known working version to understand what might have gone wrong due to a change.</p>
<p>Even if you don't branch, you may find it useful to use tags to mark releases.</p> <p>Imagine that you rolled out a new version of your software yesterday and have started making major changes for the next version. A user calls you to report a serious bug in yesterday's release. You can't just fix it and copy over the changes from your development trunk because the changes you've just made the whole thing unstable.</p> <p>If you had tagged the release, you could check out a working copy of it and use it to fix the bug.</p> <p>Then, you might choose to create a branch at the tag and check the bug fix into it. That way, you can fix more bugs on that release while you continue to upgrade the trunk. You can also merge those fixes into the trunk so that they'll be present in the next release.</p>
3,438
<p>The new extensions in .Net 3.5 allow functionality to be split out from interfaces.</p> <p>For instance in .Net 2.0</p> <pre><code>public interface IHaveChildren { string ParentType { get; } int ParentId { get; } List&lt;IChild&gt; GetChildren() } </code></pre> <p>Can (in 3.5) become:</p> <pre><code>public interface IHaveChildren { string ParentType { get; } int ParentId { get; } } public static class HaveChildrenExtension { public static List&lt;IChild&gt; GetChildren( this IHaveChildren ) { //logic to get children by parent type and id //shared for all classes implementing IHaveChildren } } </code></pre> <p>This seems to me to be a better mechanism for many interfaces. They no longer need an abstract base to share this code, and functionally the code works the same. This could make the code more maintainable and easier to test.</p> <p>The only disadvantage being that an abstract bases implementation can be virtual, but can that be worked around (would an instance method hide an extension method with the same name? would it be confusing code to do so?)</p> <p>Any other reasons not to regularly use this pattern?</p> <hr> <p>Clarification:</p> <p>Yeah, I see the tendency with extension methods is to end up with them everywhere. I'd be particularly careful having any on .Net value types without a great deal of peer review (I think the only one we have on a string is a <code>.SplitToDictionary()</code> - similar to <code>.Split()</code> but taking a key-value delimiter too)</p> <p>I think there's a whole best practice debate there ;-)</p> <p>(Incidentally: DannySmurf, your PM sounds scary.)</p> <p>I'm specifically asking here about using extension methods where previously we had interface methods.</p> <hr> <p>I'm trying to avoid lots of levels of abstract base classes - the classes implementing these models mostly already have base classes. I think this model could be more maintainable and less overly-coupled than adding further object hierarchies.</p> <p>Is this what MS has done to IEnumerable and IQueryable for Linq?</p>
<p>I think the judicious use of extension methods put interfaces on a more equatable position with (abstract) base classes.</p> <p><br/> <strong>Versioning.</strong> One advantage base classes have over interfaces is that you can easily add new virtual members in a later version, whereas adding members to an interface will break implementers built against the old version of the library. Instead, a new version of the interface with the new members needs to be created, and the library will have to work around or limit access to legacy objects only implementing the original interface.</p> <p>As a concrete example, the first version of a library might define an interface like so:</p> <pre><code>public interface INode { INode Root { get; } List&lt;INode&gt; GetChildren( ); } </code></pre> <p>Once the library has released, we cannot modify the interface without breaking current users. Instead, in the next release we would need to define a new interface to add additional functionalty:</p> <pre><code>public interface IChildNode : INode { INode Parent { get; } } </code></pre> <p>However, only users of the new library will be able to implement the new interface. In order to work with legacy code, we need to adapt the old implementation, which an extension method can handle nicely:</p> <pre><code>public static class NodeExtensions { public INode GetParent( this INode node ) { // If the node implements the new interface, call it directly. var childNode = node as IChildNode; if( !object.ReferenceEquals( childNode, null ) ) return childNode.Parent; // Otherwise, fall back on a default implementation. return FindParent( node, node.Root ); } } </code></pre> <p>Now all users of the new library can treat both legacy and modern implementations identically.</p> <p><br/> <strong>Overloads.</strong> Another area where extension methods can be useful is in providing overloads for interface methods. You might have a method with several parameters to control its action, of which only the first one or two are important in the 90% case. Since C# does not allow setting default values for parameters, users either have to call the fully parameterized method every time, or every implementation must implement the trivial overloads for the core method.</p> <p>Instead extension methods can be used to provide the trivial overload implementations:</p> <pre><code>public interface ILongMethod { public bool LongMethod( string s, double d, int i, object o, ... ); } ... public static LongMethodExtensions { public bool LongMethod( this ILongMethod lm, string s, double d ) { lm.LongMethod( s, d, 0, null ); } ... } </code></pre> <p><br/> Please note that both of these cases are written in terms of the operations provided by the interfaces, and involve trivial or well-known default implementations. That said, you can only inherit from a class once, and the targeted use of extension methods can provide a valuable way to deal with some of the niceties provided by base classes that interfaces lack :)</p> <hr> <p><strong>Edit:</strong> A related post by Joe Duffy: <a href="http://joeduffyblog.com/2010/02/09/extension-methods-as-default-interface-method-implementations/" rel="nofollow noreferrer">Extension methods as default interface method implementations</a></p>
<p>One problem I can see is that, in a large company, this pattern could allow the code to become difficult (if not impossible) for anyone to understand and use. If multiple developers are constantly adding their own methods to existing classes, separate from those classes (and, God help us all, to BCL classes even), I could see a code base spinning out of control rather quickly.</p> <p>Even at my own job, I could see this happening, with my PM's desire to add every bit of code that we work on to either the UI or the data access layer, I could totally see him insisting on 20 or 30 methods being added to System.String that are only tangentially-related to string handling.</p>
2,957
<p>How are you instrumenting your UI's? In the past I've read that people have instrumented their user interfaces, but what I haven't found is examples or tips on <em>how</em> to instrument a UI.</p> <p>By instrumenting, I mean collecting data regarding usage and performance of the system. A MSDN article on Instrumentation is <a href="http://msdn.microsoft.com/en-us/library/x5952w0c.aspx" rel="nofollow noreferrer" title="here">http://msdn.microsoft.com/en-us/library/x5952w0c.aspx</a>. I would like to capture which buttons users click on, what keyboard shortucts they use, what terms they use to search, etc.</p> <ul> <li>How are you instrumenting your UI?</li> <li>What format are you storing the instrumentation?</li> <li>How are you processing the instrumented data?</li> <li>How are you keeping your UI code clean with this instrumentation logic?</li> </ul> <p>Specifically, I am implementing my UI in WPF, so this will provide extra challenges compared to instrumenting a web-based application. (i.e. need to transfer the instrumented data back to a central location, etc). That said, I feel the technology may provide an easier implementation of instrumentation via concepts like attached properties.</p> <ul> <li>Have you instrumented a WPF application? Do you have any tips on how this can be achieved?</li> </ul> <hr /> <p>Edit: The following blog post presents an interesting solution: <a href="https://blog.pixelingene.com/2008/08/techniques-for-ui-auditing-on-wpf-apps/" rel="nofollow noreferrer">Pixel-In-Gene Blog: Techniques for UI Auditing on WPF apps</a></p>
<p>The following blog post gives quite a few good ideas for instrumenting a WPF application: <a href="https://blog.pixelingene.com/2008/08/techniques-for-ui-auditing-on-wpf-apps/" rel="nofollow noreferrer">Techniques for UI Auditing on WPF apps</a>.</p>
<p>I have not yet developed using WPF.. But I would assume that its the same as most other applications in that you want to keep the UI code as light as possible.. A number of design patterns may be used in this such as the obvious <a href="http://en.wikipedia.org/wiki/Model-view-controller" rel="nofollow noreferrer">MVC</a> and <a href="http://en.wikipedia.org/wiki/Facade_pattern" rel="nofollow noreferrer">Façade</a>. I personally always try and keep the objects travelling between the UI and BL layers as light as possible, keeping them to primitives if I can.</p> <p>This then helps me focus on improving the UI layer without the concerns of anything going on once I throw my (primitive) data back..</p> <p>I hope I understood your question correctly, and sorry I cannot offer more contextual help with WPF.</p>
2,967
<pre><code>public class MyClass { public int Age; public int ID; } public void MyMethod() { MyClass m = new MyClass(); int newID; } </code></pre> <p>To my understanding, the following is true:</p> <ol> <li>The reference m lives on the stack and goes out of scope when MyMethod() exits.</li> <li>The value type newID lives on the stack and goes out of scope when MyMethod() exits.</li> <li>The object created by the new operator lives in the heap and becomes reclaimable by the GC when MyMethod() exits, assuming no other reference to the object exists. </li> </ol> <p>Here is my question:</p> <ol> <li>Do value types within objects live on the stack or the heap?</li> <li>Is boxing/unboxing value types in an object a concern?</li> <li>Are there any detailed, yet understandable, resources on this topic?</li> </ol> <p>Logically, I'd think value types inside classes would be in the heap, but I'm not sure if they have to be boxed to get there.</p> <p>Edit:</p> <p>Suggested reading for this topic:</p> <ol> <li><a href="http://www.microsoft.com/MSPress/books/6522.aspx" rel="nofollow noreferrer">CLR Via C# by Jeffrey Richter</a></li> <li><a href="http://books.google.com/books?id=Kl1DVZ8wTqcC&amp;dq=essential+.net&amp;pg=PP1&amp;ots=5a-UEHSLVJ&amp;sig=D2_xn2kzMnP8zLXDVIV6AJtfbCY&amp;hl=en&amp;sa=X&amp;oi=book_result&amp;resnum=1&amp;ct=result#PPP1,M1" rel="nofollow noreferrer">Essential .NET by Don Box</a></li> </ol>
<p>Value-type values for a class <em>have</em> to live together with the object instance in the managed heap. The thread's stack for a method only lives for the duration of a method; how can the value persist if it only exists within that stack?</p> <p>A class' object size in the managed heap is the sum of its value-type fields, reference-type pointers, and additional CLR overhead variables like the Sync block index. When one assigns a value to an object's value-type field, the CLR copies the value to the space allocated within the object for that particluar field.</p> <p>Take for example, a simple class with a single field.</p> <pre><code>public class EmbeddedValues { public int NumberField; } </code></pre> <p>And with it, a simple testing class.</p> <pre><code>public class EmbeddedTest { public void TestEmbeddedValues() { EmbeddedValues valueContainer = new EmbeddedValues(); valueContainer.NumberField = 20; int publicField = valueContainer.NumberField; } } </code></pre> <p>If you use the MSIL Disassembler provided by the .NET Framework SDK to peek at the IL code for EmbeddedTest.TestEmbeddedValues()</p> <pre><code>.method public hidebysig instance void TestEmbeddedValues() cil managed { // Code size 23 (0x17) .maxstack 2 .locals init ([0] class soapextensions.EmbeddedValues valueContainer, [1] int32 publicField) IL_0000: nop IL_0001: newobj instance void soapextensions.EmbeddedValues::.ctor() IL_0006: stloc.0 IL_0007: ldloc.0 IL_0008: ldc.i4.s 20 IL_000a: stfld int32 soapextensions.EmbeddedValues::NumberField IL_000f: ldloc.0 IL_0010: ldfld int32 soapextensions.EmbeddedValues::NumberField IL_0015: stloc.1 IL_0016: ret } // end of method EmbeddedTest::TestEmbeddedValues </code></pre> <p>Notice the CLR is being told to <strong>stfld</strong> the loaded value of "20" in the stack to the loaded EmbeddValues' NumberField field location, directly into the managed heap. Similarly, when retrieving the value, it uses <strong>ldfld</strong> instruction to directly copy the value out of that managed heap location into the thread stack. No box/unboxing happens with these types of operations.</p>
<p>A variable or other storage location of a structure type is an aggregation of that type's public and private instance fields. Given</p> <pre><code>struct Foo {public int x,y; int z;} </code></pre> <p>a declaration <code>Foo bar;</code> will cause <code>bar.x</code>, <code>bar.y</code>, and <code>bar.z</code> to be stored wherever <code>bar</code> is going to be stored. Adding such a declaration of <code>bar</code> to a class will, from a storage-layout perspective, be equivalent to adding three <code>int</code> fields. Indeed, if one never did anything with <code>bar</code> except access its fields, the fields of <code>bar</code> would behave the same as would three fields <code>bar_x</code>, <code>bar_y</code>, and <code>bar_cantaccessthis_z</code> [accessing the last one would require doing things with <code>bar</code> other than accessing its fields, but it would take up space whether or not it's ever actually used for anything].</p> <p>Recognizing structure-type storage locations as being aggregations of fields is the first step to understanding structures. Trying to view them as holding some kind of object might seem "simpler", but doesn't match how they actually work.</p>
4,447
<p>In a review for a certain filament I read that somebody recommended &quot;<a href="https://www.amazon.de/gp/customer-reviews/RVMUN4CW9ZLKX/ref=cm_cr_arp_d_rvw_ttl?ie=UTF8&amp;ASIN=B01080YND6" rel="nofollow noreferrer">a feeding rate of 105%</a>&quot;.</p> <p>What does he mean, and how could I set this in Cura?</p> <p>When I search for &quot;<em>feed</em>&quot; in the print settings properties of Cura, nothing is found, so I suspect he means &quot;<em>speed</em>&quot;.</p> <p>When I search for speed, multiple speed settings turn up, not only one.</p> <p>How could I do what he recommended?</p> <p>Thank you!</p> <p><a href="https://i.stack.imgur.com/DoQ2L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DoQ2L.png" alt="enter image description here" /></a></p>
<h2>[Extruder] feed rate [modifier] is used synonymous to extrusion multiplier</h2> <p>The feed rate of the extruder is the rate at which filament is pushed (fed) into the hotend. An overwrite value that modifies that rate from the normal rate is in most slicers called &quot;extrusion multiplier&quot;.</p> <p>It is a <em>quickfix</em> to manipulate print behavior, especially addressing under extrusion due to various problems, such as mis-sized filament or to compensate for deformability of it compared to the filament the extruder is calibrated for.</p> <p>It is however not a permanent fix. See also <a href="https://3dprinting.stackexchange.com/questions/11074/why-and-how-am-i-supposed-to-change-the-extrusion-multiplier?noredirect=1&amp;lq=1">here</a>, <a href="https://3dprinting.stackexchange.com/questions/6968/slicer-line-width-vs-extrusion-multiplier-for-layer-adhesion?noredirect=1&amp;lq=1">here</a> and <a href="https://3dprinting.stackexchange.com/questions/8382/isnt-using-the-extrusion-multiplier-like-cheating/8384#8384">here.</a></p>
<p>In the context of the linked source (in German <em>&quot;Die Feeding Rate sollte mit 105 % eingestellt werden&quot;</em>), with <em>&quot;a feeding rate of 105 %&quot;</em> is meant the extrusion multiplier (there is no reference in the source to Cura). This is explained in <a href="https://3dprinting.stackexchange.com/a/20006">this answer</a>. The answer is correct for the translation, but should have warned for the incorrect wording. Technically, <em>feed rate</em> is <strong>not</strong> a synonym for <em>extrusion multiplier</em>.</p> <p>The source is wrongly using the term <em>&quot;feeding rate&quot;</em>, feeding rate is the rate at which all steppers are scaled, not solely the E (extruder) stepper.</p> <p>In G-code this is found to be the <code>F</code> parameter, e.g. in <code>G1 F1200 X76.468 Y148.947 E0.0264</code> the feed rate of 1200 mm/min is applied on all steppers, in this example X, Y and E. Changing the feed rate changes all speeds for all steppers simultaneously. This is found in G-code <a href="https://marlinfw.org/docs/gcode/M220.html" rel="nofollow noreferrer"><code>M220</code></a>.</p> <p>The extrusion multiplier (or known as <em>&quot;Flow Percentage&quot;</em>) only acts on the E stepper motor, this is not reflected in the G-code, but adjusted in the firmware planner. The G-code to adjust the flow percentage is <a href="https://marlinfw.org/docs/gcode/M221.html" rel="nofollow noreferrer"><code>M221</code></a></p>
2,211
<p>I have been studying the differences between version 2.x and version 4 of the <a href="https://reprap.org/wiki/P3Steel" rel="nofollow noreferrer">P3Steel frames</a> - in particular the AC08 bracket at the top of the frame which secures the top of the smooth bars and threaded rods of the Z axis on both the left and right sides. Here is the laser cut parts, for version 1.x, showing the part labelled as AC08:</p> <p><a href="https://i.stack.imgur.com/2AN9z.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2AN9z.jpg" alt="Laser cut parts for P3Steel v1"></a></p> <p>Version 1.x/2.x has the AC08 bracket with two holes, one for the threaded rod and one for the top of the smooth bar (from the <a href="http://reprap.org/wiki/P3Steel_Vitamins#Lasercut_parts" rel="nofollow noreferrer">lasercut image</a>):</p> <p><a href="https://i.stack.imgur.com/6yZMo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6yZMo.jpg" alt="P3Steel v2 Z axis top bracket"></a></p> <p>However, in version 4, the corresponding top Z axis bracket only has one hole for the smooth bar and just an indentation for the bearing which holds the top of the threaded rod (from <a href="https://twitter.com/AlvaroReyRdz/status/738406531943763968" rel="nofollow noreferrer">Twitter</a>):</p> <p><a href="https://i.stack.imgur.com/MZe2i.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MZe2i.jpg" alt="P3Steel v4 Z axis top bracket"></a></p> <p>Here is a close up of the <a href="https://drive.google.com/open?id=0BxUhvFbuwEAZNjA0dUhwNmFMd2c" rel="nofollow noreferrer">diagram</a> from the <a href="https://drive.google.com/open?id=0BxUhvFbuwEAZfkJDUUE0bm1pTXNfMFRKemdUUzJNZ2xIT0xybFJLdmdyQV9MZGFpcG42UlE&amp;authuser=0" rel="nofollow noreferrer">google docs repository</a>, listed in the <a href="http://reprap.org/wiki/P3Steel#Frame_versions" rel="nofollow noreferrer">v4 section</a> on the RepRap Wiki page for the P3Steel, which shows the bearing assembly just apparently "resting" against the indentation:</p> <p><a href="https://i.stack.imgur.com/dAVUM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dAVUM.png" alt="Close up of P3Steel Z axis top bracket"></a></p> <p>Here is the bracket shown with the bar and threaded rod (again, from <a href="https://drive.google.com/file/d/0BxUhvFbuwEAZQjkyTDM3SndMSTA/view" rel="nofollow noreferrer">google docs</a>):</p> <p><a href="https://i.stack.imgur.com/X0fcG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X0fcG.png" alt="P3Steel v4 z axis top bracket"></a></p> <p>Does anyone know why the top of the threaded rod is not secured by a hole, as it was in version 1.x/2.x? It just does not look particularly well secured.</p> <p>Under the list of version 4 changes, see <a href="https://reprap.org/wiki/P3Steel#Frame_versions" rel="nofollow noreferrer">2. Frame versions</a>, it is mentioned:</p> <blockquote> <p>The extruder no longer hits the Z axis top bracket</p> </blockquote> <p>Is this the reason why the change has been made?</p>
<p>I've just seen this right now, I'm Alvaro Rey, the designer of the p3steel v4 mod. The change was made, because with previous versions with the extruder homed, if you go up in the Z axis, the extruder motor could hit the Z axis top plate. So, in order to avoid that, I just changed the design.</p> <p>The bearing in the z axis is not necessary but some people prefer to use it, in order to avoid wobble in the threaded rod. </p> <p>Anyways, I designed a printer part to fix the bearing in the Z top plate.</p>
<p><em>This is mere supposition on my part, and not a definitive answer. This was posted prior to Alvaro's answer.</em></p> <hr /> <p>In response, or - rather - with respect to, to the comments under the question by <a href="https://3dprinting.stackexchange.com/questions/3015/z-axis-top-brackets-of-p3steel-differ-between-v1-x-2-x-and-v4#comment3919_3015">tjb1</a> and <a href="https://3dprinting.stackexchange.com/questions/3015/z-axis-top-brackets-of-p3steel-differ-between-v1-x-2-x-and-v4#comment3916_3015">Tom</a>, I have been reading around the topic, and found some interesting articles.</p> <p>The excerpt below from &quot;<a href="http://www.soliforum.com/topic/2342/backlash-hysterisis-and-wobble-an-exploration-of-the-topic/" rel="nofollow noreferrer">An exploration of the topic</a>&quot;, backs up Tom's argument about constraining the rods at both ends being bad practice, and explains why it is so. Whilst acknowledging that a loose, or floating end, is still an issue that needs to be dealt with, the article also states that constraining the end is not really a solution, as it can create more problems elsewhere (I have added the bold highlighting to the relevant text):</p> <blockquote> <p>Wobble is pretty simple. Because the lead screw is mounted rigidly to the motor, it needs to be perfectly straight and square to the axis its trying to move. If it's not, as the motor rotates, that offset will be converted into an elliptical motion instead of turning in a perfect circle. In big CNC world, as the axis is normally bolted to a huge/heavy table which refuses to yield to this movement, it results in breaking your motor or motor coupling (weakest point in the connection). This is what flex couplings are designed to fix – if you can’t guarantee a perfectly square mating between motor and axis, you use a coupler with flex so that any movement can be soaked up in flexing the coupler and the lead screw/rod moves in a nice circle without busting your motor or mounts. This is true when you have a good solid supported connection on the lead screw like you’d see on a ‘proper’ CNC. <strong>However on the Solidoodle, as the top end of the Z-Axis is ‘unsupported’ and its only connection to <em>anything</em> is to the table via a tiny little nut, its free to ‘flop about in the breeze’ so to speak.</strong> Even a small 0.1mm offset from center can result in a much much greater ‘wiggle’ at the top of the screw clearly visible to the eye. Throw in even a 0.05mm bend in the rod, and it gets further amplified.</p> <p>Adding better support to the axis, through a taller nut, multiple nuts, or <strong>supporting the end, would reduce the influence of this wobble. You do however, risk moving it to something else entirely</strong> – for example, making the lead screw rigid would mean that the forces would end up moving the motor itself, potentially causing fatigue issues with how its bolted to the sheet metal case (mine already moves a fair bit and its ‘stock’... making the screw rigid would see the motor having to absorb all that movement instead of half of it disappearing in movement of the screw...). Solving the motor movement by securing it ‘better’ to the case would mean that the movement now gets soaked up in the motor shaft and bearing, leading to premature stepper motor death.</p> </blockquote> <p>Thus, when first posting this question, I had originally presumed that the earlier versions of the model would be superior: Due to the fact that the earlier versions secured the top of the z-axis screw mechanism, then that would reduce the amount of &quot;flapping about&quot; of the loose end, which in turn would result in <em>less wobble</em>. However, I had not bargained for the negative consequences (such as the increased motor wear, mentioned above).</p> <p>So, is the reason that the top brackets of the z-axis, in the version 4 of the frame, lost their threaded rod/leadscrew top-end constraint, therefore to prevent premature motor wear, at the expense of exhibited wobble?</p>
420
<p>What does the <code>,</code> operator do in C?</p>
<p>The expression:</p> <pre><code>(expression1, expression2) </code></pre> <p>First <code>expression1</code> is evaluated, then <code>expression2</code> is evaluated, and the value of <code>expression2</code> is returned for the whole expression.</p>
<p>I'm reviving this simply to address questions from @Rajesh and @JeffMercado which i think are very important since this is one of the top search engine hits.</p> <p>Take the following snippet of code for example </p> <pre><code>int i = (5,4,3,2,1); int j; j = 5,4,3,2,1; printf("%d %d\n", i , j); </code></pre> <p>It will print</p> <pre><code>1 5 </code></pre> <p>The <code>i</code> case is handled as explained by most answers. All expressions are evaluated in left-to-right order but only the last one is assigned to <code>i</code>. The result of the <code>(</code> <em>expression</em> )<code>is</code>1`. </p> <p>The <code>j</code> case follows different precedence rules since <code>,</code> has the lowest operator precedence. Because of those rules, the compiler sees <em>assignment-expression, constant, constant ...</em>. The expressions are again evaluated in left-to-right order and their side-effects stay visible, therefore, <code>j</code> is <code>5</code> as a result of <code>j = 5</code>.</p> <p>Interstingly, <code>int j = 5,4,3,2,1;</code> is not allowed by the language spec. An <em>initializer</em> expects an <em>assignment-expression</em> so a direct <code>,</code> operator is not allowed.</p> <p>Hope this helps.</p>
7,577
<p>My Flashforge Adventurer 3 is not printing properly. Filament feeder makes repetitive loud thumping noise and not enough filament is extruded. Resulting print (if completed) is not solid.</p> <p>Results vary with filament. Flashforge brand (red) PLA works best. Any other filament fails completely unless I print at High quality, with head temperature at 235 degrees. Nozzle has been un-clogged repeatedly, but right from the start, when feeding filament in, it does not flow through properly. </p> <p>I had used the included tool to clear blockages in the extruder several times before now, but after posting this question I tried again. Ordinary use of the tool made no difference. So I applied more force, and, pushed filament through by hand directly into the extruder and used a pin to try to clear the extruder. It now appears to be working adequately Not perfectly. I am able to print with default settings. It still thumps -or ticks- a bit. I am alarmed at the amount of force I had to use to clear the extruder blockage. </p>
<p>Advice from another source suggested thoroughly cleaning the feed gear on the bowden extruder. When I looked closely there were plastic flakes all over the mechanism. I used compressed air and a brush to clean it. I also discovered expert mode in the FlashPrint software, which enabled me to slow down the speed at which fill is laid down. Now I have good printing results with any filament.</p> <p>EDIT AND UPDATE:: I have continued to have problems with PLA. For most of the last year I printed using ABS with no similar problems. I guess that PLA is simply rougher, scratchier than ABS and catches in the tube. I found a comment that putting olive oil on the filament fixes it. I used Vaseline. Things were fine for a while, but a retailer said this would lead to other problems.</p> <p>So far, no permanent answer to this question.</p>
<p>I had a lot of thumps lately after I moved my printer location.</p> <p>Turns out my printer wasn't level and the extruder was pushing harder (further down) on different places, causing thumps. This really shows because the calibration is only in 1 spot.</p> <p>I used some printer paper and a bubble level then recalibrated. Not a single thump since.</p>
1,133
<p>I'm developing an Eclipse plug-in, based on a bunch of core Eclipse plug-ins like SWT, JDT, GEF and others. </p> <p>I need my plug-in to be compatible with Eclipse 3.3, since many potential customers are still using it. However, personally I like the new features in Eclipse 3.4 and would like to use it for my development. This means I need PDE to reference 3.3 code and, when debug, execute a 3.3 instance.</p> <p>Any tips on how this can be achieved?</p> <p>Thanks.</p>
<p>You can change the 'Target platform' setting to point to the location of an existing set of eclipse 3.3 plugins. This will compile your code against the 3.3 plugins, making sure that they stay compatible no matter which version of eclipse you are using to develop the application. </p> <p>The setting is under Window->Preferences->Plug-in development->Target Platform</p>
<p>And is it no way how to develop plugin for newer palfrom? Eg.: develop new plugin for 3.5 into 3.4...</p>
5,990
<p>What's the simplest way to connect and query a database for a set of records in C#?</p>
<p>@Goyuix -- that's excellent for something written from memory. tested it here -- found the connection wasn't opened. Otherwise very nice.</p> <pre><code>using System.Data.OleDb; ... using (OleDbConnection conn = new OleDbConnection()) { conn.ConnectionString = "Provider=sqloledb;Data Source=yourServername\\yourInstance;Initial Catalog=databaseName;Integrated Security=SSPI;"; using (OleDbCommand cmd = new OleDbCommand()) { conn.Open(); cmd.Connection = conn; cmd.CommandText = "Select * from yourTable"; using (OleDbDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { Console.WriteLine(dr["columnName"]); } } } } </code></pre>
<p>Charge the libraries</p> <pre><code>using MySql.Data.MySqlClient; </code></pre> <p>This is the connection:</p> <pre class="lang-cs prettyprint-override"><code>public static MySqlConnection obtenerconexion() { string server = "Server"; string database = "Name_Database"; string Uid = "User"; string pwd = "Password"; MySqlConnection conect = new MySqlConnection("server = " + server + ";" + "database =" + database + ";" + "Uid =" + Uid + ";" + "pwd=" + pwd + ";"); try { conect.Open(); return conect; } catch (Exception) { MessageBox.Show("Error. Ask the administrator", "An error has occurred while trying to connect to the system", MessageBoxButtons.OK, MessageBoxIcon.Error); return conect; } } </code></pre>
2,335
<p>Why does this happen (circled in red), and how can I fix it? It is making my prints come out horrible.</p> <p>Not shown in the picture, but the option "Coasting" was Enabled:</p> <ul> <li>Coasting Volume 0.064 mm<sup>3</sup></li> <li>Minimum Volume Before Coasting: 0.8</li> <li>Coasting Speed 90%</li> </ul> <hr> <p><a href="https://i.stack.imgur.com/a4sB6.jpg" rel="nofollow noreferrer" title="Rendered G-code view of a sliced model"><img src="https://i.stack.imgur.com/a4sB6.jpg" alt="Rendered G-code view of a sliced model" title="Rendered G-code view of a sliced model"></a></p>
<p>If you enable the option "Coasting", the extruder will follow the extrusion path at the end of switching to the next layer or the next section, but will not deposit any material as it uses the build up pressure in the nozzle to deposit the final bits. This shows up in your G-code representation by empty (non-depositing) gaps (in reality, when fine-tuned correctly, will be filled).</p> <p><em>E.g. sliced without "Coasting" enabled:</em> <a href="https://i.stack.imgur.com/1YJCg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1YJCg.png" alt="Print without enabling the coasting option"></a></p> <p><em>E.g. sliced with "Coasting" enabled:</em> <a href="https://i.stack.imgur.com/SAtyB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SAtyB.png" alt="enter image description here"></a></p>
<p>I have had a similar thing happen when slicing a large piece that has - in real life - walls of about 2 cm. By scaling it down to 1.5%, this become less than the wall thickness, and the wall was simply omitted by CURA.</p> <p>In my experience, a model showing gaps <em>can</em> have in these locations a thickness less than 1 wall.</p>
951
<p>Does your work environment use Harvest SCM? I've used this now at two different locations and find it appalling. In one situation I wrote a conversion script so I could use CVS locally and then daily import changes to the Harvest system while I was sleeping. The corp was fanatic about using Harvest, despite 80% of the programmers crying for something different. It was needlessly complicated, slow and heavy. It is now a job requirement for me that Harvest is not in use where I work.</p> <p>Has anyone else used Harvest before? What's your experience? As bad as mine? Did you employ other, different workarounds? Why is this product still purchased today?</p>
<p>Chances are, your company has some sort of contract with CA - are you using a lot of other CA software in-house?</p> <p><strong>Edit:</strong> Guess so!</p>
<p>I have been using HARVEST for the last 4 years and i love it. The kind of support it gives you to control the code movement is really fantastic. We use HARVEST to deploy applications on to Websphere. It also do an amazing work in deploying the plugins into the web server along with the application. When you want to have a process in place for moving the code in a big enterprise environment, i don't think any other tool can even come closer to HARVEST.</p>
4,579
<p>I've done several flash projects working as the ActionScripter with a designer doing all the pretty things and animation. When starting out I found quite a lot of information about ActionScript coding and flash design. Most of the information available seems to focus on one or the other.</p> <p>I didn't find any information about building flash projects in a way that lets the coder do their thing AND gives the designer freedom as well.</p> <p>Hopefully more experienced people can share, these are some of the things i discovered after a few projects</p> <ul> <li>Version control is a must (as always) but can be difficult to explain to designers</li> <li>No ActionScript in the flash <code>.fla</code> files, they are binary and as a coder you want to try to keep away as much as possible</li> <li>Model View Controller is the best way I've found to isolate visual design changes</li> <li>Try to build the views so that they use frame labels, this allows the designer to decide what actually happens </li> </ul> <p>What are your experiences? ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>
<p>I've been doing Flash for 9 years and I still find this a difficult thing to get right. </p> <p>There is a balance of power between designers and developers, which will inevitably tip one way or the other. </p> <p>If you work for a developer led studio, then you are lucky, as the designers will be instructed to make a design that fits your functionality. In Flex / MXML this is the only way to work.</p> <p>If, on the other hand, you work in a graphic design/creative/advertising studio, you will be instructed to build whatever the designer puts together in PhotoShop, whether or not it is feasible to build within the time.</p> <p>The key to getting around this is communication and education. Designers and design-focussed managers may not know what is involved in creating a particular piece of functionality, and if you explain to them why a particular thing is hard to do they <strong>might</strong> be persuaded to go and rethink their design. On the other hand, they may well think you're just a whiner! It never feels good when you have to tell someone "sorry, I can't really do that" when you know that you could make it work, given a few late nights!</p> <p>As well as the things you and others have already noted, like using FlashDevelop and external AS classes, here's some other things I recommend:</p> <ul> <li>Start with a site map / wireframe that both the developers and designers agree to.</li> <li>Load all your text from XML into dynamic text fields, and make sure your buttons etc are designed to expand to fit content</li> <li>Make sure your designers have some idea how to correctly cut-up graphics and lay them out in Flash. A developer shouldn't be messing about in PhotoShop when you're up against a deadline.</li> <li>Make sure you get all you graphics assets well before the deadline - inevitably there'll be things they've missed and things that need changing.</li> <li>Be firm and don't let your design team try to sneak in extra features at the last minute.</li> <li>Let the designers use the timeline for character animation etc, but for simple tweens use an ActionScript tweening engine.</li> </ul> <p>Hope these tips are some use!</p>
<p>On our team everyone uses TortoiseSVN and a Trac instance per project. Designers are using the standard Flash designer to edit .FLAs and developers are using <a href="http://www.flashdevelop.org/community/" rel="nofollow noreferrer">FlashDevelop</a> to manage ActionScript files and debug the project.</p> <p>The tool-chain works like this:</p> <ol> <li>Developers program the behavior of each window by hand-editing MXML files (it's not as hard as it sounds) and developing the corresponding .AS files at the same time.</li> <li>Designers make graphics for skins and other UI elements that get (link) exported and store them in .FLAs alongside the code.</li> <li>Developers [Import()] the resources in the .AS files.</li> </ol> <p>This way everything gets into source control and designers don't even look at a line of ActionScript. Off course I'm oversimplifying the process but I hope you'll get the idea.</p>
4,500
<p>I am having problems manually looping through xml data that is received via an HTTPService call, the xml looks something like this: </p> <pre><code>&lt;DataTable&gt; &lt;Row&gt; &lt;text&gt;foo&lt;/text&gt; &lt;/Row&gt; &lt;Row&gt; &lt;text&gt;bar&lt;/text&gt; &lt;/Row&gt; &lt;/DataTable&gt; </code></pre> <p>When the webservice result event is fired I do something like this:</p> <pre><code>for(var i:int=0;i&amp;lt;event.result.DataTable.Row.length;i++) { if(event.result.DataTable.Row[i].text == "foo") mx.controls.Alert.show('foo found!'); } </code></pre> <p>This code works then there is more than 1 "Row" nodes returned. However, it seems that if there is only one "Row" node then the <em>event.DataTable.Row</em> object is not an error and the code subsequently breaks. </p> <p>What is the proper way to loop through the <em>HTTPService</em> result object? Do I need to convert it to some type of <em>XMLList</em> collection or an <em>ArrayCollection</em>? I have tried setting the resultFormat to <em>e4x</em> and that has yet to fix the problem...</p> <p>Thanks.</p>
<p>The problem lies in this statement</p> <pre><code>event.result.DataTable.Row.length </code></pre> <p><code>length</code> is not a property of <code>XMLList</code>, but a method:</p> <pre><code>event.result.DataTable.Row.length() </code></pre> <p>it's confusing, but that's the way it is.</p> <p><em>Addition:</em> actually, the safest thing to do is to always use a <code>for each</code> loop when iterating over <code>XMLList</code>s, that way you never make the mistake, it's less code, and easier to read:</p> <pre><code>for each ( var node : XML in event.result.DataTable.Row ) </code></pre>
<p>I would store it in an Xml object and then use its methods to search for the node value you need.</p> <pre><code>var returnedXml:Xml = new Xml(event.result.toString()); </code></pre>
6,219