instruction
stringlengths 27
22.5k
| chosen
stringlengths 27
28.2k
| rejected
stringlengths 19
24.9k
| __index_level_0__
int64 0
10k
|
|---|---|---|---|
<p>We have been using CruiseControl for quite a while with NUnit and NAnt. For a recent project we decided to use the testing framework that comes with Visual Studio, which so far has been adequate.</p>
<p>I'm attempting to get the solution running in CruiseControl. I've finally got the build itself to work; however, I have been unable to get any tests to show up in the CruiseControl interface despite adding custom build tasks and components designed to do just that. Does anyone have a definitive link out there to instructions on getting this set up?</p>
|
<p>Not sure if that helps (i found the ccnet Documentation somewhat unhelpful at times):</p>
<p><a href="http://confluence.public.thoughtworks.org/display/CCNET/Using+CruiseControl.NET+with+MSTest" rel="noreferrer">Using CruiseControl.NET with MSTest</a></p>
|
<p>The CC.Net interface is generated via an XSL transform on your XML files put together as specified in the ccnet.config file for your projects. The XSL is already written for things like FxCop - check your server's CC xsl directory for examples - shouldn't be too hard to write your own to add in the info - just remember to add the XML output from your tests into the main log.</p>
| 2,373
|
<p>What I would like to do is create a clean virtual machine image as the output of a build of an application.</p>
<p>So a new virtual machine would be created (from a template is fine, with the OS installed, and some base software installed) --- a new web site would be created in IIS, and the web app build output copied to a location on the virtual machine hard disk, and IIS configured correctly, the VM would start up and run.</p>
<p>I know there are MSBuild tasks to script all the administrative actions in IIS, but how do you script all the actions with Virtual machines? Specifically, creating a new virtual machine from a template, naming it uniquely, starting it, configuring it, etc...</p>
<p>Specifically I was wondering if anyone has successfully implemented any VM scripting as part of a build process.</p>
<p>Update: I assume with Hyper-V, there is a different set of libraries/APIs to script virtual machines, anyone played around with this? And anyone with real practical experience of doing something like this?</p>
|
<p>To find out which files on your system have been encrypted with EFS, you can simply run this command:</p>
<pre><code>CIPHER.EXE /U /N
</code></pre>
|
<p>Clippy noticed that you have sensitive information in your files and automatically encrypted them.</p>
<p>Are you sure it's for EFS? I've had things prompt me to backup my keys before, but I didn't know exactly what they were to. I was assuming it was like a DRM protected file or something. It was a while ago so i don't remember exactly what the specific details were. I never backed it up and haven't been locked out of anything.</p>
| 3,280
|
<p>I've looked at several URL rewriters for ASP.Net and IIS and was wondering what everyone else uses, and why. </p>
<p>Here are the ones that I have used or looked at:</p>
<ul>
<li><a href="http://www.codeproject.com/KB/aspnet/urlrewriter.aspx" rel="nofollow noreferrer">ThunderMain URLRewriter</a>: used in a previous project, didn't quite have the flexibility/performance we were looking for</li>
<li><a href="http://web.archive.org/web/20070202012119/blog.ewal.net/2004/04/14/a-url-redirecting-url-rewriting-httpmodule/" rel="nofollow noreferrer">Ewal UrlMapper</a>: used in a current project, but source seems to be abandoned</li>
<li><a href="http://www.urlrewriting.net/149/en/home.html" rel="nofollow noreferrer">UrlRewritingNet.UrlRewrite</a>: seems like a decent library but documentation's poor grammar leaves me feeling uneasy</li>
<li><a href="http://urlrewriter.net/" rel="nofollow noreferrer">UrlRewriter.NET</a>: this is my current fav, has great flexibility, although the extra functions pumped into the replacement regexs changes the standard .Net regex syntax a bit</li>
<li><a href="http://www.managedfusion.com/products/url-rewriter/" rel="nofollow noreferrer">Managed Fusion URL Rewriter</a>: I found this one in a <a href="https://stackoverflow.com/questions/2262/aspnet-url-rewriting#2268">previous question</a> on stack overflow, but haven't tried it out yet, from the example syntax, it doesn't seem to be editable via web.config</li>
</ul>
|
<p>There's System.Web.Routing that was just released with .NET 3.5.</p>
<p>You can just use Request.RewritePath() in a custom HttpModule</p>
<p>I prefer using an IHttpHandlerFactory implementation and have full control over all incoming URLs and where they're mapped to.</p>
|
<p>+1 for UrlRewritingNet.UrlRewrite too but why do I always need to end my URL with .aspx? I think it should be improved better regular expression partern.</p>
<p>Why do I always have to end with aspx in virtualURL localhost/Products/Beverages.aspx", "localhost/Products/Condiments.aspx". I just want to type localhost/Products/Beverages", "localhost/Products/Condiments" which look like MVC route.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms972974#urlrewriting_topic2" rel="nofollow">This</a> one look good but it is not working for my site. I still can't figure it out.</p>
| 3,548
|
<p>I am trying to implement string unescaping with Python regex and backreferences, and it doesn't seem to want to work very well. I'm sure it's something I'm doing wrong but I can't figure out what...</p>
<pre><code>>>> import re
>>> mystring = r"This is \n a test \r"
>>> p = re.compile( "\\\\(\\S)" )
>>> p.sub( "\\1", mystring )
'This is n a test r'
>>> p.sub( "\\\\\\1", mystring )
'This is \\n a test \\r'
>>> p.sub( "\\\\1", mystring )
'This is \\1 a test \\1'
</code></pre>
<p>I'd like to replace \\[char] with \[char], but backreferences in Python don't appear to follow the same rules they do in every other implementation I've ever used. Could someone shed some light?</p>
|
<p>Isn't that what Anders' second example does?</p>
<p>In 2.5 there's also a <code>string-escape</code> encoding you can apply:</p>
<pre><code>>>> mystring = r"This is \n a test \r"
>>> mystring.decode('string-escape')
'This is \n a test \r'
>>> print mystring.decode('string-escape')
This is
a test
>>>
</code></pre>
|
<p>You are being tricked by Python's representation of the result string. The Python expression:</p>
<pre><code>'This is \\n a test \\r'
</code></pre>
<p>represents the string</p>
<pre><code>This is \n a test \r
</code></pre>
<p>which is I think what you wanted. Try adding 'print' in front of each of your p.sub() calls to print the actual string returned instead of a Python representation of the string.</p>
<pre><code>>>> mystring = r"This is \n a test \r"
>>> mystring
'This is \\n a test \\r'
>>> print mystring
This is \n a test \r
</code></pre>
| 3,474
|
<p>There are multiple Ruby implementations in the works right now. Which are you looking forward to and why? Do you actively use a non-MRI implementation in production?</p>
<p>Some of the options include:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Ruby_MRI" rel="nofollow noreferrer">Ruby MRI (original 1.8 branch)</a></li>
<li><a href="http://www.atdot.net/yarv/" rel="nofollow noreferrer">YARV (official 1.9)</a></li>
<li><a href="http://jruby.codehaus.org/" rel="nofollow noreferrer">JRuby</a></li>
<li><a href="http://rubini.us/" rel="nofollow noreferrer">Rubinius</a></li>
<li><a href="http://ironruby.rubyforge.org/" rel="nofollow noreferrer">IronRuby</a> - <a href="http://ironruby.net/" rel="nofollow noreferrer">Ironruby.net</a></li>
<li><a href="http://ruby.gemstone.com/" rel="nofollow noreferrer">MagLev</a> (Thanks <a href="https://stackoverflow.com/users/11526/julian">Julian</a>) <a href="https://maglev.github.io/" rel="nofollow noreferrer">Github link</a></li>
<li><a href="http://www.macruby.org/" rel="nofollow noreferrer">MacRuby</a> (Thanks <a href="https://stackoverflow.com/users/63112/damien-pollet">Damien Pollet</a>)</li>
</ul>
|
<p><a href="http://ruby.gemstone.com/" rel="noreferrer">Maglev</a>. It will have the speed benefit of all the optimization that has gone into a major Smalltalk VM over many, many year. Plus it will automatically persist all your data pretty much automatically so there is no more need to monkey around with Object-Relational mapping layers and so on.</p>
|
<p>What about Enterprise Ruby? This has been out there for a while.</p>
<p><a href="https://www.phusionpassenger.com/enterprise" rel="nofollow">https://www.phusionpassenger.com/enterprise</a></p>
| 9,582
|
<p>This is about when a .NET remoting exception is thrown. If you take a look at MSDN, it will mention that a remoting exception is thrown when something goes wrong with remoting. If my server is not running, I get a socket exception which is fine.</p>
<p>What I am trying to figure out is: does getting a remoting exception indicate for sure that my server is up and running? If yes, that would solve the problem. If not: Is there a way to figure out if the remoting exception originated on the client side or the server side?</p>
<h3>Update:</h3>
<p>The problem I am trying to solve is that the server is down initially and then client sends some message to the server. Now I get a socket exception saying "No connection could be made..." which is fine.</p>
<p>There is a thread that is sending messages to the server at regular intervals to see if the server is available. Now, the server comes up, and at that point, you could get the response which is fine or you could get some exception and most probably it will be a remote exception. So, what I am trying to ask is that: in case I don't get a message and I get a remote exception is there a chance that the server is up and running and I am still getting this exception?</p>
<p>All I am doing is just calling a method on the remote object that does nothing and returns. If there is no exception then I am good. Now, if there is a remoting exception and if I knew the remoting exception occurred on the server then I know in spite getting the exception, I am connected to the server.</p>
|
<p>Getting a remoting exception does not guarantee that your server is up and running. If something else happens to be running and listening on that port, the connection will succeed, and you will not get a socket exception. What happens in this case depends on how the application which actually got your connection behaves, but it will probably wind up generating a remoting exception in your client.</p>
<p>It would take a bit more investigation to verify this, but I believe the remoting exception indicates a problem in the communications between the client and the server, so there isn't a "client side" or "server side" that generated it. It means that the two weren't talking happily and it could have been caused by either one.</p>
|
<p>Try assuring that you send the correct message and the messages received by the server are also correct, e.g. using assertions (it is called Design by Contract).
If you have such possibility, try debugging the server side and client side at the same time. (running two VS instances at the same time)</p>
| 9,951
|
<p>I am wondering - of course if the 3D printer's bed big enough - printing multiple copies of the same print could save me significant amount of time in a small production line, excluding minor wastage such as setup time, post-processing time, etc.</p>
<p><a href="https://i.stack.imgur.com/aQ1Zt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/aQ1Zt.png" alt="enter image description here"></a></p>
<p>e.g. if my foo print takes 10 hours, printing 2x copies at the same time would take 2x times more, increasing linearly or it would be significantly less?</p>
|
<p>Actually no. It will take slightly more for each addition. You also then have the point of failure, where one gets knocked off and ruins all the prints.</p>
<p>The fastest way to print multiple objects is one at a time. In fact slic3r lets you do just that with their <a href="http://manual.slic3r.org/advanced/sequential-printing" rel="noreferrer">sequential printing feature</a>.</p>
<p>The reason is, the time it takes to lift 0.5mm, travel the few MM over to the next object, lower the 0.5mm back down.. Repeat for inner shells, outer shells, infill.. all add time. Doesn't seem like much till you do it 14,000 times.</p>
<p>In the case of your example, it would be negligible. In more complicated or well spaced prints its another story.</p>
<p>For extra extra fast, look into loss PLA casting...</p>
|
<p>Actually the answer is yes and no. So I had to print 12 of the same small objects for a science experiment. Just some rocks I made from domes with some displaced faces, anyway my printers minimum wall width is 0.5 mm. The objects were 2 cm³. The first print failed because of them being disconnected but then I connected the 12 items by 1×1×5 mm solidified cylinders in blender and ran it through my cutter and it printed no problem. Afterwards I jusy clipped off the cylinder and was good to go. Just make sure you're object is connected at every point facing another. Based on your picture it should be connected something like this:</p>
<p><img src="https://i.stack.imgur.com/mEYHE.jpg" alt="enter image description here" /></p>
| 534
|
<p>Yesterday, I was reading 3dprinting.meta and read a suggestion that (which I rephrase as) we should ask questions for the purpose of bringing answers inside our tent.</p>
<p>I spent some time thinking about questions I have been asked by friends who purchased FDM machines and were starting to undertake their own designs. In particular, among the engineers I hang with there is a desire for the generally-accepted-as-valid design principles -- the design rules that, when followed, will usually work. I haven't come across a reference that lays out such rules for FDM printing, and so I launched a question which someone who knew of such a rule set could answer, or which I could later attempt to answer if a better answer didn't appear.</p>
<p>I asked <a href="https://3dprinting.stackexchange.com/questions/6726/primer-on-3d-printing-design-rules">this question</a>.</p>
<p>The question drew a "have you googled that?" response, coupled with a helpful link. Other comments ensued, along with two down-votes on the question.</p>
<p>My question here is in two parts:
Is this an appropriate activity -- to ask a question hoping to receive a better answer that I would write myself, and
If the motivation for the question is appropriate, how should the question have been better formed?</p>
<p>I realize that two downvotes isn't all that important, but it is important to me to understand and act in concert with the community culture. </p>
|
<p><strong>TL;DR</strong> The <em>answer</em> that this question was looking for can be covered in 4 or 5 basic points, without much ambiguity. The question is therefore not fundamentally <em>too broad</em>, but could maybe be made a bit more specific.</p>
<p>Too broad seems a bit of a mis-assessment, but I think it's maybe a mistake to ask where to find this information, since that does read a little bit like "find me a link". I think a better question would be to ask what are the basic design rules - and then worry if that is too broad.</p>
<p>We need to focus as a community on taking questions which don't quite fit, and improving them, otherwise we will not get people coming back with more questions and later helping others. There is still a focus amongst some members on only answering specific 'problem' questions, rather than generating a comprehensive resource covering the whole subject. SE intends to be the top search result (and presumably the answer and un-informed student was looking for).</p>
<p>Maybe 'design rules" seems to broad, when you presumably care about the factors that are unique to FDM. (i.e. exclude all the general engineering principles which would be common to subtractive machining, injection moulding, etc. even though they are obviously still relevant). I feel this was kind of implicit in the question, but some may have been mislead by the terminology.</p>
<p>Should tolerances be included? With an electronics background rather than engineering, <code>Design Rules</code> implies a final sign-off stage check of low level trivial detail rather than the entry point to the design flow.</p>
<p>I think the question also suffers slightly from a <em>I have an answer in mind, so it seems that I'm asking the question in a way that leads to that answer</em>, kind of an X-Y of getting the answer posted (in this case, the answer is the true goal, not the question).</p>
|
<p>The "Have you googled this" comment was a little like the comments that we used to see, and which, of late, we fortunately haven't seen much of (please see <a href="https://3dprinting.meta.stackexchange.com/questions/134/post-closing-issues/263#263">my answer</a> to <a href="https://3dprinting.meta.stackexchange.com/questions/134/post-closing-issues">Post Closing Issues</a>).</p>
<p>However, it <em>was</em> backed up with an extremely useful link and a query for clarification so it may not have been meant as a straight forward "Have you googled this"-esque comment.</p>
<p>I reworded that comment slightly, to soften it.</p>
<p>I think that the negative votes probably reflected the accompanying [too broad] close votes.</p>
<p>However, as I mentioned in <a href="https://3dprinting.stackexchange.com/questions/6726/primer-on-3d-printing-design-rules?noredirect=1#comment10424_6726">my comment</a>, your question didn't seem that broad to me, or rather, while it might have been <em>seen</em> as being a <em>little</em> broad, it seemed no broader than your linked to question or other examples that I've seen. <em>Note that this is my personal opinion, and doesn't mean that the question shouldn't be closed, or, conversely, should be left open. It is for the community to decide</em>.</p>
<p>The on-topic page <em>is</em> in a state or flux, and has been for a while now. I attempted to propose a definitive version with <a href="https://3dprinting.meta.stackexchange.com/questions/276/game-plan-what-is-on-topic">Game plan - What is on-topic?</a>, but I haven't got around to following it up as I wasn't sure if the community approved - the feedback wasn't particularly conclusive. The mod team should get together to discuss, I guess. Or if anyone feels like chipping in, please left a comment or answer on the Meta post - or mention it in one of the <a href="https://3dprinting.meta.stackexchange.com/questions/307/do-we-have-a-chatroom">chatrooms</a>.</p>
| 56
|
<p>ABS is a very strong material, but it also has some downsides. One of them, which is the necessity of having a printer with enclosure, completely discouraged me from using it, as it would be a waste of money. This is quite sad, because I cannot make prints that will be able to withstand a large load of tension without breaking. </p>
<p>Is there any way to print ABS without any enclosure? Maybe there are several types of this material and some are easier to print?</p>
|
<p>There is no requirement for an enclosure when printing ABS. Like many things in FDM, there are improvements to be made, but there is a scale of what is possible.</p>
<p>A heated bed is much more necessary (for similar reasons, the thermal expansion is significant and without a heated bed you have very high risk of warping).</p>
<p>An enclosure is important for high quality, large ABS prints. Otherwise, a warm location which is free of drafts will be fine, particularly for parts which are only a few cm high.</p>
<p>If you're not using an enclosure, the part cooling fan should probably <em>not</em> be used to print ABS. You should also be aware that ABS tends to generate more noticeable fumes than PLA (although this varies with product, and how sensitive you are).</p>
|
<p>I print ABS in my basement in an unenclosed Prusa3D i3m3s, just as I print other filaments. Perhaps an enclosure would be helpful, but I don't have problems as it is. Your experience may vary.</p>
<p>Before that I printed ABS on a large home-brew delta machine. No problems related to lack of enclosure.</p>
<p>Before that I printed ABS on a Thing-o-Matic, also with no problems.</p>
<p>I'm not saying that every print was perfect, but in the first two (chronologically) cases, the enclosure was not the largest contributor to print artifacts.</p>
| 1,378
|
<p>I've found how to sort query results by a given field in a Lucene.Net index instead of by score; all it takes is a field that is indexed but not tokenized. However, what I haven't been able to figure out is how to sort that field while ignoring stop words such as "a" and "the", so that the following book titles, for example, would sort in ascending order like so:</p>
<ol>
<li>The Cat in the Hat</li>
<li>Horton Hears a Who</li>
</ol>
<p>Is such a thing possible, and if yes, how?</p>
<p>I'm using Lucene.Net 2.3.1.2.</p>
|
<p>I wrap the results returned by Lucene into my own collection of custom objects. Then I can populate it with extra info/context information (and use things like the highlighter class to pull out a snippet of the matches), plus add paging. If you took a similar route you could create a "result" class/object, add something like a SortBy property and grab whatever field you wanted to sort by, strip out any stop words, then save it in this property. Now just sort the collection based on that property instead.</p>
|
<p>When you create your index, create a field that only contains the words you wish to sort on, then when retrieving, sort on that field but display the full title.</p>
| 9,173
|
<p>I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).</p>
<p>The control is implemented in two different user controls. In one control, RaisePostBackEvent is fired on the server-side when <code>__doPostBack</code> is invoked. In the other control, RaisePostBackEvent is never invoked. I checked the <code>__EVENTTARGET</code> parameter and it does match the ClientID of the control... where else might I look to troubleshoot this?</p>
|
<p>There's a lot of ways this can fall apart. Are you adding the control to the page dynamically in code behind? If so alot of times your UniqueID can be off - even though the client id's are equal. Do you have a code sample that might demonstrate what you're doing?</p>
|
<p>Double check that it is indeed a derivation of the UserControl class, not the WebControl one.<br>
This one has had me by surprise many times. If you need to use WebControl for the styling, you need to let your control implement INamingContainer. (Don't worry, its a marker interface)</p>
<p>So..</p>
<pre><code>public class MyControl : UserControl {}
</code></pre>
<p>Or</p>
<pre><code>public class MyControl : WebControl, INamingContainer {}
</code></pre>
| 3,089
|
<p>In a project our team is using object lists to perform mass operations on sets of data that should all be processed in a similar way. In particular, different objects would ideally act the same, which would be very easily achieved with polymorphism. The problem I have with it is that inheritance implies the <em>is a</em> relationship, rather than the <em>has a</em> relationship. For example, several objects <em>have a</em> damage counter, but to make this easy to use in an object list, polymorphism could be used - except that would imply an <em>is a</em> relationship which wouldn't be true. (A person <em>is not a</em> damage counter.)</p>
<p>The only solution I can think of is to have a member of the class return the proper object type when implicitly casted instead of relying on inheritance. Would it be better to forgo the <em>is a</em> / <em>has a</em> ideal in exchange for ease of programming?</p>
<p>Edit:
To be more specific, I am using C++, so using polymorphism would allow the different objects to "act the same" in the sense that the derived classes could reside within a single list and be operated upon by a virtual function of the base class. The use of an interface (or imitating them via inheritance) seems like a solution I would be willing to use.</p>
|
<p>I think you should be implementing interfaces to be able to enforce your <em>has a</em> relationships (am doing this in C#):</p>
<pre><code>public interface IDamageable
{
void AddDamage(int i);
int DamageCount {get;}
}
</code></pre>
<p>You could implement this in your objects:</p>
<pre><code>public class Person : IDamageable
public class House : IDamageable
</code></pre>
<p>And you'd be sure that the DamageCount property and has a method to allow you to add damage, without implying that a person and a house are related to each other in some sort of heirarchy.</p>
|
<p>Sometimes it's worth giving up the ideal for the realistic. If it's going to cause a massive problem to "do it right" with no real benefit, then I would do it wrong. With that said, I often think it's worth taking the time to do it right, because unnecessary multiple inheritance increases complexity, and it <em>can</em> contribute to the system being less maintainable. You really have to decide what's best for your circumstance.</p>
<p>One option would be to have these objects implement a <code>Damageable</code> interface, rather than inheriting from <code>DamageCounter</code>. This way, a person <em>has-a</em> damage counter, but <em>is</em> damageable. (I often find interfaces make a lot more sense as adjective than nouns.) Then you could have a consistent damage interface on <code>Damageable</code> objects, and not expose that a damage counter is the underlying implementation (unless you need to).</p>
<p>If you want to go the template route (assuming C++ or similar), you could do this with mixins, but that can get ugly really quickly if done poorly.</p>
| 3,296
|
<p>So I got the SKR mini E3 for my Ender 5 after hearing all the positive reviews.</p>
<p>When it arrives I plug everything in, make sure it's secure and test the axis... they all worked correctly.</p>
<p>I then tested auto home... everything worked.</p>
<p>I then tested the heating... everything worked again.</p>
<p>Finally, I go to do a test print-- it heats up and then homes. When it is finished heating, the hot end assembly starts moving slowly until it goes into the corner and contacts the side of the printer. Obviously, I turned it off right away.</p>
<p>Currently, I am uncertain whether it is a firmware issue, a board issue, or something else? If anyone could please help me solve this, that would be greatly appreciated!</p>
|
<p>This issue is related to the way Creality has defined the origin of the printer. Usually, the origin of the printer is at the front left when facing the printer. Creality has chosen to set the origin in their default Creality configuration at the back right.</p>
<p>Vanilla Marlin (Ender 5 configuration) has the origin at the front left. When facing the printer this makes more sense. Do note that there are printers with the origin in the middle and in the back right location, but these are outnumbered by far in preference of the front left location.</p>
<p>This means that when you switch boards you need to carefully look at the settings of the endstops and the definitions of the being min or max endstops and inverting or not of the steppers.</p>
|
<p>So I found an answer on Reddit when I asked the same question: It actually had to do with the homing -- basically, it was starting at 220, 220 instead of 0,0, which resulted in when the print started for it to head straight into the corner. In order to counter this, I had to change some of the firmware. Everything works now. Thank you for your help!</p>
| 1,787
|
<p>Which databases does Adobe Flash support, if any?</p>
|
<p>None.</p>
<p>Instead, you would need to create some middleware (say, a webservice) that you talked to that did the database CRUD for you.</p>
|
<p><a href="https://stackoverflow.com/questions/38674/does-adobe-flash-support-databases#38675">@SCdF</a> is correct. From <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14482&sliceId=2" rel="nofollow noreferrer">the horse's mouth</a>:</p>
<blockquote>
<p>A Macromedia Flash movie cannot
communicate directly with a database.
However, Macromedia Flash movies can
"talk" to server-side applications
(also referred to as "middleware").
Middleware can query a database and
relay data back and forth. There are
many server applications available.
Some of the most common are CGI, ASP,
PHP, ColdFusion and Tango.</p>
</blockquote>
| 5,962
|
<p>I have some design diagrams only on paper. Scanning them to bitmaps is easy, but I've had no luck getting useful vectors out of them. I've tried vectorizers in programs like gimp, and a few online services. Generally, I end up with enormous numbers of spurious vectors (from dust, dotted lines, text on the diagram, slightly variations in scanning contrast, etc).</p>
<p>What tools and/or techniques can I use to get a more useful vector result, that I can then modify in a normal CAD tool without spending absurd amounts of time cleaning it all up first?</p>
|
<p>There is the capable but somewhat expensive <a href="http://www.scan2cad.com/" rel="nofollow" title="Scan2CAD">Scan2CAD</a>.</p>
<p>Otherwise, if you're happy with outlines and not centre lines, scan b&w, aggressively clean up macules, mask off text, and then vectorize in potrace, autotrace, etc. Alternatively, load the bitmap at the correct resolution into a drawing package as a raster layer and draw the lines/objects you want over it. This avoids the horrors of dotted lines.</p>
<p>Both ways are quite a bit of work, sadly.</p>
|
<p>I would recommend using something like <a href="http://www.getpaint.net/index.html" rel="nofollow noreferrer">Paint.NET</a> to "fix" the images before attempting to convert them to CAD.</p>
<p>To my knowledge, most of the Image-to-CAD applications are going to use the grayscale intensity of each pixel to get the Z-axis value. So, you can help this process by pre-filtering the image into grayscale and playing with the contrast until you get enough distinction between the features you want to stand out in your CAD model or print. Here's a quick example using a sample image:</p>
<p>Poor Contrast
<a href="https://i.stack.imgur.com/JuyOg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JuyOg.png" alt="Poor Contrast"></a></p>
<p>Better Contrast
<a href="https://i.stack.imgur.com/yEjjk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yEjjk.png" alt="Better Contrast"></a></p>
<p>Whichever program you use will generally have an easier time detecting the edges of the flower pedals in the second image the further towards the center it goes.</p>
<p>GIMP has <a href="https://www.gimp.org/tutorials/Color2BW/" rel="nofollow noreferrer">greyscale</a> and <a href="https://www.gimp.org/tutorials/ContrastMask/" rel="nofollow noreferrer">contrast</a> tools as well.</p>
| 221
|
<p>Is the Sql Server 2008 control available for download? Does it yet support the 2008 RDL schema?</p>
|
<p>If you are talking about the ReportViewer control, it is <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e-bb5f-416d75a1b9ef&DisplayLang=en" rel="nofollow noreferrer">available</a>.</p>
<p>However you need Windows XP, Windows Vista or Windows Server 2003 to install it. It is also written that .NET 3.5 is required, but I'm not sure about this one. I managed to install it with .NET 2.0 on an XP.</p>
|
<p>The ReportViewer control should work just fine with SQL Server 2008.</p>
| 5,294
|
<p>I cannot get my extruder to work on my Creality Ender-4 printer. I have heated the nozzle but the extruder does not move.</p>
<p>I tested the motor and cable on another system and they work just fine.</p>
<p>Could it be the board or what could it be?</p>
|
<p>Most filaments you can leave in the extruder indefinitely without any ill effects.</p>
<p>There are some filaments that need to be stored away from moisture, particularly Nylon, because they absorb moisture from the air and don't print well if they contain a lot of absorbed moisture. However, this isn't an inherent issue with having the filaments in the extruder (if you had some setup that protected the filament from moisture while in the extruder, that would be fine as well - but in most cases it is more practical to store such filament in an airtight box). </p>
<p>Most commodity filaments (ABS/PLA/PETG) don't suffer from this as much (PLA supposedly also absorbs moisture but I haven't noticed this to be a problem, perhaps it depends on the conditions of the room in which your printer is kept) so they're fine to leave in the extruder.</p>
|
<p>If you "planing" to leave the filament there for months, then it would be a good idea to store it away, but for most filaments it is not a big deal to be stay loaded... provided that the humidity is not high (e.g. a shower or kitchen next to it would be not so good). </p>
<p>My experiences with "moistured" filament is that they get brittle, but only breaks when I don't print something. And it is a pain in the a** to get out the last part of the filament that broke right at the entrance... so store it away is always a good idea, if you are not too lazy ;) </p>
| 929
|
<p>Some of the features I think it must include are:</p>
<ol>
<li>Print Entire Solution</li>
<li>Ability to print line numbers</li>
<li>Proper choice of coding font and size to improve readability</li>
<li>Nice Header Information</li>
<li>Ability to print regions collapsed</li>
</ol>
<p>Couple feature additions:</p>
<ol>
<li>Automatically insert page breaks
after methods/classes</li>
<li>Keep long lines readable (nearly all
current implementations are broken)</li>
</ol>
<p><em>Note: There are many reasons to need to print code... One very good one is escrow.</em></p>
|
<p>I use <a href="http://submain.com/?nav=products.pcp.net" rel="nofollow noreferrer">PrettyCode.Print for .NET</a>. It does everything on your list, and more. (I use it for printing code excerpts for copyright registration paperwork, which is similar to your escrow case.)</p>
<p>It is a little slow to open a really big solution, but not unbearably so, and the output quality is excellent.</p>
|
<p>Couple feature additions:</p>
<ul>
<li>Automatically insert page breaks after methods/classes </li>
<li>Keep long lines readable (nearly all current implementations are broken)</li>
</ul>
| 7,509
|
<p>I'm using ant to generate javadocs, but get this exception over and over - why?</p>
<p>I'm using JDK version <strong>1.6.0_06</strong>.</p>
<pre><code>[javadoc] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
[javadoc] at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDocletWriter.getAnnotations(HtmlDocletWriter.java:1739)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDocletWriter.writeAnnotationInfo(HtmlDocletWriter.java:1713)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDocletWriter.writeAnnotationInfo(HtmlDocletWriter.java:1702)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDocletWriter.writeAnnotationInfo(HtmlDocletWriter.java:1681)
[javadoc] at com.sun.tools.doclets.formats.html.FieldWriterImpl.writeSignature(FieldWriterImpl.java:130)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.FieldBuilder.buildSignature(FieldBuilder.java:184)
[javadoc] at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:597)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.FieldBuilder.invokeMethod(FieldBuilder.java:114)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractMemberBuilder.build(AbstractMemberBuilder.java:56)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.FieldBuilder.buildFieldDoc(FieldBuilder.java:158)
[javadoc] at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:597)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.FieldBuilder.invokeMethod(FieldBuilder.java:114)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractMemberBuilder.build(AbstractMemberBuilder.java:56)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.buildFieldDetails(ClassBuilder.java:301)
[javadoc] at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:597)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.invokeMethod(ClassBuilder.java:101)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.buildClassDoc(ClassBuilder.java:124)
[javadoc] at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:597)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.invokeMethod(ClassBuilder.java:101)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:108)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:155)
[javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164)
[javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106)
[javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
[javadoc] at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:597)
[javadoc] at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
[javadoc] at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
[javadoc] at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
[javadoc] at com.sun.tools.javadoc.Start.begin(Start.java:128)
[javadoc] at com.sun.tools.javadoc.Main.execute(Main.java:41)
[javadoc] at com.sun.tools.javadoc.Main.main(Main.java:31)
</code></pre>
|
<p>It looks like this has been reported as a <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6442982" rel="noreferrer">Java bug</a>. It appears to be caused by using annotations from a 3rd party library (like JUnit) and not including the jar with that annotation in the javadoc invocation. </p>
<p>If that is the case, just use the -classpath option on javadoc and include the extra jar files. </p>
|
<p>I got this problem too. I can compile properly without any errors or warnings. But when I generating javadoc , I got below error.</p>
<blockquote>
<p><strong><em>[javadoc] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc</em></strong></p>
</blockquote>
<p>Here is my classpath loading for my third-party-libs ...</p>
<pre><code><path id="build.classpath">
<fileset dir=".">
<include name="libs/*.jar" />
</fileset>
</code></pre>
<p></p>
<p>At my java compile target ..</p>
<pre><code><target name="compile" depends="clean, makedir">
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${build.dir}" classpathref="build.classpath">
<compilerarg value="-Xlint:unchecked"/>
</javac>
</code></pre>
<p></p>
<p>And at my javadoc target...</p>
<pre><code><target name="docs" depends="compile">
<javadoc packagenames="src" sourcepath="${src.dir}" destdir="${docs.dir}"
failonerror="no"
author="true"
version="true"
windowtitle="${Name} API"
doctitle="${Name}"
bottom="Copyright © 2014 ColayHIlls.com . All Rights Reserved.">
<fileset dir="${src.dir}">
<include name="main/java/com/colayhills/jpcenter/business/service/**" />
</fileset>
</javadoc>
<echo message="java docs has been generated!"/>
</target>
</code></pre>
<p>So , I added <code>classpathref="build.classpath"</code> option to <code><javadoc</code> tag. Now It is fine for me.</p>
| 6,663
|
<p>I find that getting Unicode support in my cross-platform apps a real pain in the butt.</p>
<p>I need strings that can go from C code, to a database, to a Java application and into a Perl module. Each of these use a different Unicode encodings (UTF8, UTF16) or some other code page. The biggest thing that I need is a cross-platform way of doing conversions.</p>
<p>What kind of tools, libraries or techniques do people use to make handling these things easier?</p>
|
<p>Have a look at this: <a href="http://www.icu-project.org/" rel="nofollow noreferrer" title="International Components for Unicode">http://www.icu-project.org/</a></p>
|
<p>How are you doing the cross-platform calls? Is it all called from Java? </p>
<p><a href="http://java.sun.com/docs/books/tutorial/i18n/text/string.html" rel="nofollow noreferrer">http://java.sun.com/docs/books/tutorial/i18n/text/string.html</a> might be useful.</p>
<p>I'm a bit confused about exactly what you are trying to do. Is the database essentially interface between all the code? Then it should be easy - just make the DB UTF-8 and each of the clients will need to do their own conversions.</p>
<p>Sounds like an interesting problem, could you share some more details?</p>
| 5,996
|
<p>I'm really interested in speech-to-text algorithms, but I'm not sure where to start studying up on them. A bunch of searching around led me to <a href="http://cslu.cse.ogi.edu/HLTsurvey/download.html" rel="noreferrer">this</a>, but it's from 1996 and I'm fairly certain that there have been improvements since then.</p>
<p>Does anyone who has any experience with this sort of stuff have any recommendations for reading / source code to examine? Or just general advice on what I should be trying to learn about if I want to get into the world of writing speech recognition programs (sometimes it's hard to know what to search for if you don't have much knowledge about the domain).</p>
<p>Edit: I'd like to do something cross-platform, but for the moment I'd be targeting linux. </p>
<p>Edit 2: Thanks csmba for the well-thought out reply. At this point in time, I'm mainly interested in being able to create applications that allow automation, or execution of different commands through voice. So, a limited amount of recognizable commands being able to be strung together. An example would be a music player that took commands like "Play the album Hello Everything by Squarepusher", or an application launcher that allowed the user to create voice-shortcuts to launch specific apps.</p>
<p>I realize that it's a pretty giant problem, and that I have nowhere near the level of knowledge required right now to tackle implementing an entire recognition engine, although the techniques involved with doing so fascinate me, and it is something I'd like to work myself up to doing. In all likelihood, I'll probably end up picking up a book or two on the subject and studying up / playing with "simple" implementations in my free time.</p>
|
<p>This is a HUGE questions, I wouldn't know how to begin... So let me just try giving you the right "terms" so you can refine your quest:</p>
<p>First, understand that Speech Recognition is a diverse and complicated subject, and it has many different applications. People tend to map this domain to the first thing that comes to their head (usually, that would be computers understanding what you are saying like in IVR systems). So first lets distinguise the concept into the main categories:</p>
<p><strong>Human-to-Machine:</strong> Applications that deal with understanding what a human is saying, but the human knows he is talking to a machine and the <em>grammar</em> is very limited. Examples are </p>
<ul>
<li>Computer automation</li>
<li>Specialized: Pilots automating some controls for example (noise a huge problem) </li>
<li>IVR (Interactive Voice Response) systems like Google-411 or when you call the bank and the computer on the other side says "say 'service' to get customer service"</li>
</ul>
<p><strong>human-to-human</strong> (Spontaneous speech): This is a bigger, more complex problem. Here we can also break it down into different applciations:</p>
<ul>
<li>Call Center: conversation between Agent-Customer, phone quality, compressed</li>
<li>Intelligence: radio/phone/live conversations between 2 or more individuals</li>
</ul>
<p>Now, Speech-To-Text is not what you should be saying that you care about. What you care about is solving a problem. Different technologies are used to solve different problems. See an overview <a href="http://knol.google.com/k/csmba/speech-analytics/2p76v0g9rhval/3#" rel="nofollow noreferrer">here</a> of some of them. to summarize, other approaches are Phonetic transcription, LVCSR and direct based.</p>
<p>Also, are you interested in being the PHd behind the technology? you would need a Masters equivalent involving <em>Signal processing</em> and probably a PHd to be cutting edge. In which case, you will work for a company that develops the actual <strong>speech engine</strong>. Companies like Nuance and IBM are the big ones, but also Phillips and other startups exist.</p>
<p>On the other hand, if you want to be the one implementing applications, you will not be working on the engine, but working on building application that USE the engine. A good analogy I think is form the gaming industry:
Are you developing the graphic engine (like the Cry engine), or working on one of several hundred games, all use the same graphic engine?</p>
<p>Don't get me wrong, there is plenty to work on the quality of the search also outside the IBM/Nuance of the world. The engine is usually very open, and there are a lot of algorithmic tweaking to be done that can dramatically affect performance. Each business application has different constraints and cost/benefit function, so you can make experiments for many years building better voice recognition based applications.</p>
<p>one more thing: in general, you would also want to have good statistics background the lower in the stack you want to be.</p>
<blockquote>
<p>At this point in time, I'm mainly interested in being able to create applications that allow automation</p>
</blockquote>
<p>Good, we are converging here... Then you have no interest in "Speech-to-Text". That buzzwords takes you to the world of full transcription, a place you do not need to go to. You should be focusing on some of the more Human-to-Machine technologies like Voice XML and the ones used in IVR systems (Nuance is the biggest player there)</p>
|
<p>What platform are you targeting ?. There is <a href="http://www.microsoft.com/speech/speech2007/default.mspx" rel="nofollow noreferrer">Microsoft Speech APIs</a> that you can use if its for windows. </p>
| 3,561
|
<p>I work for a software vendor whose market is developer tools and we have been looking for a QA person for our products. </p>
<p>Since we are a small shop the position will be a combination of Support and QA however since we make developer tools, our support consists in large part of actual development (in that the person must read and understand our customers code and find and point out bugs in it).<br>
The QA portion will also consist of writing applications (in a variety of platforms and languages) and testing how they work with our tools. </p>
<p>The main issue I am running into is when you tell someone with development experience that the position contains "QA" it its title (or even in the job description) they shy away from considering the job.<br>
I'm very interested in feedback and suggestions for how I can find a good person to fill this job and ensure that they are happy doing it. Any ideas?</p>
|
<p>Money and responsibility.</p>
<p>The reason I shy away from these types of jobs is they dont tend to hold my interest long enough. Having real development tasks should keep you out of that category. The other problem is the salary is usually significantly lower with that in the title.</p>
|
<p>I think you have a toughie here:</p>
<ul>
<li>The cost of a full time developer for doing the job you require would be too high.</li>
<li>Most dev's (including myself) would get incredibly fed up, very quickly. Most dev's passion is coding, they want to do it as much as possible. Where TBH, from what you have said, it may be very little in the job role you have.</li>
<li>I would say perhaps look for a Junior, someone fresh with little experience. They will probably mould better to your testing/QA process, and it gives them a chance to start looking at production code, with perhaps opportunity to work with it.</li>
<li>Unless you are lucky, I would not expect a "developer" to stay for long, so either expect a bit of turnover, or possibly expand to a full dev role if required, and get a cheaper sole tester in.</li>
<li>I know you are a small shop, so finances may be a large part to play, but I would say you need to weigh up the possibility of getting a dev in and fixing the problems you have if they occur that often. Testers are cheap by comparison. May be best to get a tester in, find all the issues, then get a contractor/part time dev in to fix issues.</li>
</ul>
| 8,192
|
<p>For our application, we keep large amounts of data indexed by three integer columns (source, type and time). Loading significant chunks of that data can take some time and we have implemented various measures to reduce the amount of data that has to be searched and loaded for larger queries, such as storing larger granularities for queries that don't require a high resolution (time-wise).</p>
<p>When searching for data in our backup archives, where the data is stored in bzipped text files, but has basically the same structure, I noticed that it is significantly faster to untar to stdout and pipe it through grep than to untar it to disk and grep the files. In fact, the untar-to-pipe was even noticeably faster than just grepping the uncompressed files (i. e. discounting the untar-to-disk).</p>
<p>This made me wonder if the performance impact of disk I/O is actually much heavier than I thought. So here's my question:</p>
<p><i>Do you think putting the data of multiple rows into a (compressed) blob field of a single row and search for single rows on the fly during extraction could be faster than searching for the same rows via the table index?</i></p>
<p>For example, instead of having this table</p>
<pre><code>CREATE TABLE data ( `source` INT, `type` INT, `timestamp` INT, `value` DOUBLE);
</code></pre>
<p>I would have</p>
<pre><code>CREATE TABLE quickdata ( `source` INT, `type` INT, `day` INT, `dayvalues` BLOB );
</code></pre>
<p>with approximately 100-300 rows in data for each row in quickdata and searching for the desired timestamps on the fly during decompression and decoding of the blob field.</p>
<p>Does this make sense to you? What parameters should I investigate? What strings might be attached? What DB features (any DBMS) exist to achieve similar effects?</p>
|
<blockquote>
<p>This made me wonder if the performance impact of disk I/O is actually much heavier than I thought.</p>
</blockquote>
<p>Definitely. If you have to go to disk, the performance hit is many orders of magnitude greater than memory. This reminds me of the classic Jim Gray paper, <a href="http://research.microsoft.com/research/pubs/view.aspx?tr_id=655" rel="nofollow noreferrer">Distributed Computing Economics</a>:</p>
<blockquote>
<p>Computing economics are changing. Today there is rough price parity between (1) one database access, (2) ten bytes of network traffic, (3) 100,000 instructions, (4) 10 bytes of disk storage, and (5) a megabyte of disk bandwidth. This has implications for how one structures Internet-scale distributed computing: one puts computing as close to the data as possible in order to avoid expensive network traffic. </p>
</blockquote>
<p>The question, then, is how much data do you have and how much memory can you afford?</p>
<p>And if the database gets <em>really</em> big -- as in nobody could ever afford that much memory, even in 20 years -- you need clever distributed database systems like Google's <a href="http://research.google.com/archive/bigtable.html" rel="nofollow noreferrer">BigTable</a> or <a href="http://hadoop.apache.org/core/" rel="nofollow noreferrer">Hadoop</a>.</p>
|
<p>I made a similar discovery when working within Python on a database: the cost of accessing a disk is very, very high. It turned out to be much faster (ie nearly two orders of magnitude) to request a whole chunk of data and iterate through it in python than it was to create seven queries that were narrower. (One per day in question for the data)</p>
<p>It blew out even further when I was getting hourly data. 24x7 lots of queries it lots!</p>
| 4,561
|
<p>We all know the various ways of testing OO systems. However, it looks like I'll be going to do a project where I'll be dealing with PLC ladder logic (don't ask :/), and I was wondering if there's a good way of testing the validity of the system.</p>
<p>The only way I see so far is simply constructing a huge table with all known states of the system and which output states that generates. This would do for simple 'if input A is on, turn output B on' cases. I don't think this will work for more complicated constructions though.</p>
|
<p>The verification of "logical" systems in the IC design arena is known as "Design Verification", which is the process of ensuring that the system you design in hardware (RTL) implements the desired functionality. </p>
<p>Ladder logic can be transformed to one of the modern HDL's like Verilog..
transform each ladder </p>
<pre><code>|---|R15|---+---|/R16|---------(R18)--------|
| |
|---|R12|---+
</code></pre>
<p>to an expression like </p>
<pre><code>always @(*) R18 = !R16 && ( R15 | R12);
</code></pre>
<p>or you could use an assign statement</p>
<pre><code>assign R18 = R16 && (R15 | R12);
</code></pre>
<p>a latching relay</p>
<pre><code>assign R18 = (set condition) || R18 && !(break condition);
</code></pre>
<p>Then use a free verilog simulator like <a href="http://www.icarus.com/eda/verilog/" rel="nofollow noreferrer">Icarus</a> to develop a testbench and test your system.
Make sure you're testcases give good CODE coverage of your logic! And If your ladder editing software gives you decent naming capabilities, use them, rather than Rnn. </p>
<p>(Note: in Ladder Logic for PLC convention, Rnn is for internal relays, while, Xnn is an input and Ynn is an output, as can be quickly gleaned from one of the online tutorials.</p>
<p>Verilog will be an easier language to develop your tests and testbenches in!</p>
<p>It may be helpful to program in some unit delays.</p>
<p>Sorry, I have never looked for ladder logic to/from verilog translators..
but ladder logic in my day was only just being put into a computer for programming PLC's - most of the relay systems I used were REAL Relays, wired into the cabinets!!</p>
<p>Good luck.
jbd</p>
<p>There are a couple of ladder logic editors (with simultors) available for free..
here is one that runs on windows supposedly:</p>
<p><a href="http://cq.cx/ladder.pl" rel="nofollow noreferrer">http://cq.cx/ladder.pl</a></p>
|
<p>There is a program called LogixPro which has an IO simulator for ladder logic, you can try that.</p>
| 9,642
|
<p>Does anyone have examples of how to use <a href="http://www.oracle-base.com/articles/8i/DBMS_APPLICATION_INFO.php" rel="nofollow noreferrer">DBMS_APPLICATION_INFO</a> package with JBOSS? </p>
<p>We have a various applications which run within JBOSS and share db pools. I would like, at the start of each session these applications to identify themselves to the database using DBMS_APPLICATION_INFO so I can more easily track which sections of the application is causing database issues.</p>
<p>I'm not too familiar with session life cycles in JBOSS, but at the end of the day, what needs to happen is at the start and end of a transaction, this package needs to be called.</p>
<p>Has anyone done this before?</p>
|
<p>yes, you can write a wrapper class around your connection pool, and a wraper around the connection
so lets say you have:</p>
<pre>
OracleConnection conn=connectionPool.getConnection("java:scott@mydb");
</pre>
<p>Change it to:</p>
<pre>
public class LoggingConnectionPool extends ConnectionPool{
public OracleConnection getConnection(String datasourceName, String module, String action){
OracleConnection conn=getConnection(datasourceName);
CallableStatement call=conn.preparedCall("begin dbms_application_info.setModule(module_name => ?, action_name => ?); end;");
try{
call.setString(1,module);
call.setString(2,action);
call.execute();
finally{
call.close();
}
return new WrappedOracleConnection(conn);
}
</pre>
<p>Note the use of WrappedOracleConnection above. You need this because you need to trap the close call</p>
<pre>
public class WrappedOracleConnection extends OracleConnection{
public void close(){
CallableStatement call=this.preparedCall("begin dbms_application_info.setModule(module_name => ?, action_name => ?); end;");
try{
call.setNull(1,Types.VARCHAR);
call.setNull(2,Types.VARCHAR);
call.execute();
finally{
call.close();
}
}
// and you need to implement every other method
//for example
public CallableStatement prepareCall(String command){
return super.prepareCall(command);
}
...
}
</pre>
<p>Hope this helps, I do something similar on a development server to catch connections that are not closed (not returned to the pool).</p>
|
<p>In your <em>-ds.xml</em>, you can set a connection property called <strong>v$session.program</strong> and the value of that property will populate the <strong>PROGRAM</strong> column of each session in the <strong>V$SESSION</strong> view created for connections originating from your connection pool. I usually set it to the <em>jboss.server.name</em> property.</p>
<p>See <a href="http://www.magpiebrain.com/2006/05/09/specifying-a-program-name-in-oracle-jdbc-connections/" rel="nofollow">here</a> for an example.</p>
| 7,680
|
<p>In my application I have a DataGridView control that displays data for the selected object. When I select a different object (in a combobox above), I need to update the grid. Unfortunately different objects have completely different data, even different columns, so I need to clear all the existing data and columns, create new columns and add all the rows. When this is done, the whole control flickers horribly and it takes ages. Is there a generic way to get the control in an update state so it doesn't repaint itself, and then repaint it after I finish all the updates? </p>
<p>It is certainly possible with TreeViews:</p>
<pre><code>myTreeView.BeginUpdate();
try
{
//do the updates
}
finally
{
myTreeView.EndUpdate();
}
</code></pre>
<p>Is there a generic way to do this with other controls, DataGridView in particular?</p>
<p>UPDATE: Sorry, I am not sure I was clear enough. I see the "flickering", because after single edit the control gets repainted on the screen, so you can see the scroll bar shrinking, etc.</p>
|
<p>Rather than adding the rows of the data grid one at a time, use the <code>DataGridView.Rows.AddRange</code> method to add all the rows at once. That should only update the display once. There's also a <code>DataGridView.Columns.AddRange</code> to do the same for the columns.</p>
|
<p>You may also try this, its work.</p>
<pre><code>public static void DoubleBuffered(Control formControl, bool setting)
{
Type conType = formControl.GetType();
PropertyInfo pi = conType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
pi.SetValue(formControl, setting, null);
}
</code></pre>
| 8,943
|
<p>I am building a <a href="https://andypi.co.uk/2017/09/17/dolly-build-notes-prusa-i3-mk2-clone-3d-printer/" rel="nofollow noreferrer">dolly</a> and I am confused as to which proximity sensor to use. </p>
<p>Should I go for M8 or M12 and 5 V or 6-36 V? </p>
<p>What should be the best detecting distance? Should it be 2/4/8 mm. Which one should I select?</p>
|
<p>Tomas Sanladerer has produced a nice video on this topic: <a href="https://www.youtube.com/watch?v=il9bNWn66BY" rel="nofollow noreferrer">https://www.youtube.com/watch?v=il9bNWn66BY</a></p>
<p>@ 7:31 you see an overview of the precision of various sensors, including the ones you mention. It appears that the M12-4 and M18-8 sensors are more accurate than the M8-8.</p>
|
<p>As always cost will be a factor. I found the M4 sensors to be be just not good enough, they have to be too close, and eventually it's going to catch on your print and damage sensor mounting and/or the hot-end assembly.</p>
<p>The 8mm range sensors seem like a good distance, but you'll need to decide between a wider, heavier but cheaper model or the think, lighter more expensive model.</p>
<p>If your goal is to optimise for speed, go the lighter version.</p>
<p>In terms of sensing accuracy, if your layer height is typically 0.2mm then I don't think there's much point paying for more accuracy.</p>
| 851
|
<p>I have been playing with this for a while, but the closest I have gotten is a button that opens the <code>Paste Special</code> dialog box and requires another couple of mouse clicks to paste the contents of the clipboard as unformatted text. </p>
<p>So often I am doing a <code>copy-paste</code> from a web site into a document where I don't want the additional baggage of the HTML formatting, it would be nice to be able to do this with a shortcut key or a toolbar button.</p>
|
<p>Make the button call the macro:</p>
<pre><code>public sub PasteSpecialUnformatted()
selection.pastespecial datatype:=wdpastetext
end sub
</code></pre>
|
<p>I use <a href="http://www.getfingertips.com/" rel="nofollow noreferrer">FingerTips</a> for this. By default it will make CTRL+W -> Paste Special. Furthermore it supports macro text and a lot of useful start-programs-quick things and some Microsoft Outlook tricks to support Getting Things Done.</p>
| 9,989
|
<p>When working on ASP.NET 1.1 projects I always used the Global.asax to catch all errors. I'm looking for a similar way to catch all exceptions in a Windows Forms user control, which ends up being a hosted IE control. What is the proper way to go about doing something like this?</p>
|
<p>You need to handle the <code>System.Windows.Forms.Application.ThreadException</code> event for Windows Forms. This article really helped me: <a href="http://bytes.com/forum/thread236199.html" rel="noreferrer">http://bytes.com/forum/thread236199.html</a>.</p>
|
<p>Code from MSDN: <a href="http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2</a></p>
<pre><code>Sub Main()
Dim currentDomain As AppDomain = AppDomain.CurrentDomain
AddHandler currentDomain.UnhandledException, AddressOf MyHandler
Try
Throw New Exception("1")
Catch e As Exception
Console.WriteLine("Catch clause caught : " + e.Message)
Console.WriteLine()
End Try
Throw New Exception("2")
End Sub
Sub MyHandler(sender As Object, args As UnhandledExceptionEventArgs)
Dim e As Exception = DirectCast(args.ExceptionObject, Exception)
Console.WriteLine("MyHandler caught : " + e.Message)
Console.WriteLine("Runtime terminating: {0}", args.IsTerminating)
End Sub
</code></pre>
| 2,488
|
<p>I have designed this in Blender:</p>
<p><a href="https://i.stack.imgur.com/ucC7j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ucC7j.png" alt="Screenshot"></a></p>
<p>The bottom is a regular n-gon with 0.8mm in height. In Slic3r, I see that the bottom-most layer is not solid:</p>
<p><a href="https://i.stack.imgur.com/5QkC7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5QkC7.png" alt="Screenshot"></a></p>
<p>The green parts (of the first image) are going into that layer, because I wanted to ensure that I don't have air between the bottom and the green parts. Unfortunately they become printed non-solid / empty. </p>
<p>This does not only take extra time for printing, it's also not what I want. What seems to be the bottom here is in fact the top of something and I want it to be a flat surface.</p>
<p>How can I tell Slic3r to recognize overlapping items and generate them in a solid way?</p>
<p>I have already set the infill to 100%, but that doesn't change anything. The Boolean modifier of Blender is also not very helpful. It creates topologies with gaps.</p>
|
<p>I printed the thing for some layers to see what the printer actually does:
<a href="https://i.stack.imgur.com/mwBgB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mwBgB.jpg" alt="Inner ring"></a></p>
<p>There are clearly too many retractions and unretractions.</p>
<p>This can be seen in advance by letting Slic3r show the retractions and unretractions.
<a href="https://i.stack.imgur.com/8Vo55.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8Vo55.png" alt="Slic3r screenshots"></a></p>
<p><a href="https://i.stack.imgur.com/fDdn7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fDdn7.jpg" alt="Green items"></a></p>
<p>For the green "walls", it became clear that it prints them exactly onto the empty space, so in fact the seem to be floating. </p>
<p>That made it obvious to me: the normals were pointing into the wrong direction. Therefore, Slic3r seems to have interpreted the material side of the green parts inside out. I had the same issue on some other parts as well.</p>
<p>I went to Blender, selected the object(s), chose edit mode and found a function called "Recalculate normals". Since then, the bottom layer is solid.</p>
<p>Also printing time is reduced by half an hour.</p>
<p><a href="https://i.stack.imgur.com/kDh7y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kDh7y.png" alt="Result after recalculating the normals"></a></p>
|
<p>Blender is not a preferred program to model solids, it is great though for many other visualizations. Apparently, the green parts are not solid models in your original Blender design, they are most probably surfaces, when you create an STL, the model is not solid, it contains surfaces. All this causes problems for your slicer (the slicer ignores the surfaces and makes an empty hole instead, hence the sliced image). You should look into the options, manuals or fora of Blender to create solid models. Otherwise, use a proper 3D modelling tool for creating solid models.</p>
| 1,111
|
<p>I've been unsuccessful in getting Emacs to switch from 8 space tabs to 4 space tabs when pressing the <kbd>TAB</kbd> in buffers with the major mode <code>text-mode</code>. I've added the following to my <code>.emacs</code>:</p>
<pre><code>(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
;;; And I have tried
(setq indent-tabs-mode nil)
(setq tab-width 4)
</code></pre>
<p>No matter how I change my <code>.emacs</code> file (or my buffer's local variables) the <kbd>TAB</kbd> button always does the same thing.</p>
<ol>
<li>If there is no text above, indent <strong>8</strong> spaces</li>
<li>If there is text on the previous line, indent to the beginning of the second word</li>
</ol>
<p>As much as I love Emacs this is getting annoying. Is there a way to make Emacs to at least indent 4 space when there's not text in the previous line?</p>
|
<h2>Short answer:</h2>
<p>The key point is to tell emacs to insert whatever you want when indenting, this is done by changing the indent-line-function. It is easier to change it to insert a tab and then change tabs into 4 spaces than change it to insert 4 spaces. The following configuration will solve your problem:</p>
<pre><code>(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq indent-line-function 'insert-tab)
</code></pre>
<h2>Explanation:</h2>
<p>From <a href="http://www.gnu.org/s/emacs/manual/html_node/elisp/Mode_002dSpecific-Indent.html#Mode_002dSpecific-Indent" rel="noreferrer">Indentation Controlled by Major Mode @ emacs manual</a>:</p>
<blockquote>
<p>An important function of each major
mode is to customize the key to
indent properly for the language being
edited.</p>
<p>[...]</p>
<p>The indent-line-function variable is
the function to be used by (and
various commands, like when calling
indent-region) to indent the current
line. The command
indent-according-to-mode does no more
than call this function.</p>
<p>[...]</p>
<p>The default value is indent-relative
for many modes.</p>
</blockquote>
<p>From indent-relative @ emacs manual:</p>
<blockquote>
<p>Indent-relative Space out to under next
indent point in previous nonblank line.</p>
<p>[...]</p>
<p>If the previous nonblank line has no
indent points beyond the column point
starts at, `tab-to-tab-stop' is done
instead.</p>
</blockquote>
<p>Just change the value of indent-line-function to the insert-tab function and configure tab insertion as 4 spaces.</p>
|
<p>Have you tried</p>
<pre><code>(setq tab-width 4)
</code></pre>
| 9,538
|
<p>I bought an Ender 3 V2 printer and printed successfully with PLA and PLA+. Ender 3 V2 is rated at <= 250 °C but when I set temperature above 200 °C to print to PLA+, I get an error message "Nozzle is too lowperature" and the printer freezes (the term lowperature is actual and not a typo error).</p>
<p>I tried to raise the temperature gradually. I started at 200 °C and have gone to 205 °C and a little bit more. I started printing and I might get this message again or might not. Also, the temperature seems to change or lower while printing. It is not stable.</p>
<p>Any suggestions as to what causes this unstable behavior?</p>
<hr />
<p>Following the above behavior, I was able to raise the temperature to 213 °C and I was printing for 10 minutes or so, then I got the message "thermal runaway".</p>
<hr />
<p>I managed to capture the event <a href="https://youtu.be/oo0f237iTVo" rel="nofollow noreferrer">here</a></p>
|
<p>This sounds like a bad thermistor. Try replacing the head thermistor, see if this fixes it.</p>
<p>As for the strange error message, it looks like the word Temperature is being drawn on the wrong line, and then "is too low" writes over it.</p>
<p>See the way the word lines up below:</p>
<pre><code>nozzle temperature
is too lowperature
</code></pre>
|
<p>The problem was solved after the supplier replaced the motherboard.
However after that I had to try various versions of firmware as different ones had different behavior to the printer.
If you face a similar situation be aware of the cabling and connections when changing the motherboard. You may have to do the plugins twice to be sure that they are correctly attached.</p>
| 2,035
|
<p>I have a number of users with multi-megabyte files that need to be processed before they can be uploaded. I am trying to find a way to do this without having to install any executable software on their machines. </p>
<p>If every machine shipped with, say, Python it would be easy. I could have a Python script do everything. The only scripting language I can think of that's on every machine is JavaScript. However I know there are security restrictions that prevent reading and writing local files from web browsers. </p>
<p>Is there any way to use this extremely pervasive scripting language for general purpose computing tasks?</p>
<hr>
<p>EDIT: To clarify the requirements, this needs to be a cross platform, cross browser solution. I believe that HTA is an Internet Explorer only technology (or that the Firefox equivalent is broken).</p>
|
<p>Would Google Gears work here? Yes, users have to install something, but I think the experience is fairly frictionless. And once it's installed, no more worries.</p>
|
<p>The application that I maintain and develop for work is an <a href="http://msdn.microsoft.com/en-us/library/ms536471.aspx" rel="nofollow noreferrer">HTML Application</a> or <a href="http://msdn.microsoft.com/en-us/library/ms536471.aspx" rel="nofollow noreferrer">HTA</a>, linked with a SQL Server 2005 backend. This allows various security restrictions to be "avoided". All the client-side components in the application are done with javascript, including writing files to locally mapped network drives and loading data into screens/pages in an AJAXy way. </p>
<p>Perhaps HTA could be helpful for your situation.</p>
| 6,245
|
<p>I am designing a new System and I have a lot of Interfaces that will grow over time with the system. What is the best practice to name this interfaces</p>
<pre><code>ISomethingV01
ISomethingV02
etc
</code></pre>
<p>and I do this</p>
<pre><code>public interface ISomething{
void method();
}
</code></pre>
<p>then I have to add method 2 so now what I do?</p>
<pre><code>public interface ISomethingV2:ISomething{
void method2();
}
</code></pre>
<p>or same other way?</p>
|
<p>Ideally, you shouldn't be changing your interfaces very often (if at all). If you do need to change an interface, you should reconsider its purpose and see if the original name still applies to it.</p>
<p>If you still feel that the interfaces will change, and the interfaces changes are small (adding items) and you have control of the whole code base, then you should just modify the interface and fix all the compilation errors.</p>
<p>If your change is a change in how the interface is to be used, then you need to create a separate interface (most likely with a different name) to support that alternative usage pattern.</p>
<p>Even if you end up creating ISomething, ISomething2 and ISomething3, the consumers of your interfaces will have a hard time figuring out what the differences are between the interfaces. When should they use ISomething2 and when should they use ISomething3? Then you have to go about the process of obsoleting ISomething and ISomething2.</p>
|
<p>The purpose of an interface is to define an abstract pattern that at type must implement.</p>
<p>It would be better implement as:</p>
<pre><code>public interface ISomething
public class Something1 : ISomething
public class Something2 : ISomething
</code></pre>
<p>You do not gain anything in the form of code reusability or scalable design by creating multiple versions of the same interface.</p>
| 6,692
|
<p>What would you recommend for OS X development of a graphical application like those possible in WPF?</p>
<p>My specific background is in Smalltalk & Java, but I currently work mostly in DHTML/.NET (ASP.NET/C#).</p>
|
<p>Cocoa. Considered by many to be the best application framework ever. The language is Objective-C, SmallTalk-like language that inspired the creators of Java.</p>
<p>Really, there is no reasonable alternative to Cocoa for OS X development, unless you have specific needs like wanting to be cross-platform.</p>
|
<p>To put it a different way than previous posters: if you are not designing your interface in InterfaceBuilder and manipulating it with Objective-C, then you are going to end up with an application that does not look, feel, act, or work the way a Macintosh application should, and it will stick out like a sore thumb to users. It will be an unpleasant experience for the user compared to other apps, and they will likely desire a different application because of it.</p>
<p>Toolkits like QT are acceptable if your application already uses QT and you want to port it fast, but if you're writing a new application (or a separate GUI) then write it in Cocoa using ObjC or ObjC++.</p>
| 3,982
|
<p>I need to be able to retrieve a CREATE TABLE script to recreate a specific table in a SQL Server (2000) database, programmatically (I'm using C#). Obviously you can do this with Enterprise Manager but I would like to automate it. </p>
<p>I've been playing around with SQLDMO which offers a Backup command, but I'm not sure if this will give a SQL CREATE TABLE script and seems to require the creation of a SQL Service device, and I would prefer to avoid modifying the database.</p>
|
<p>Take a look at <a href="http://www.stackoverflow.com/questions/21547/in-mssql-how-do-i-generate-a-create-table-statement-for-a-given-table">my solution</a>. It's a sql script which uses the INFORMATION_SCHEMA tables to get the necessary information. It's basic, but might work for you.</p>
|
<p>You can use SMO to generate the scripts. For more info see: <a href="http://www.sqlteam.com/article/scripting-database-objects-using-smo-updated" rel="nofollow noreferrer">http://www.sqlteam.com/article/scripting-database-objects-using-smo-updated</a></p>
| 7,144
|
<p>Most people, articles, videos, etc. refer to printing speed by linear speed (mm/s), but a lot of YouTubers prefer to talk about volumetric flow (mm<sup>3</sup>/s) (mm cubed per second). I suspect that at some point in the past year or three, some of the more engineer-y types switched to this new measurement standard, but I'm not entirely sure what happened. What is the practical difference between using linear speed vs flow rate to determine print speed?</p>
<p>For a follow-up, how can you go about changing your print speed as a flow rate in a slicer? It's easy to find the linear speed, but I have not found the flow rate speed. I use Cura and will start using Prusa Slic3r soon.</p>
|
<p>Linear print speed is widely written in marketing material and in filament manufacturers' official print setting recommendations, and is the value talked about by naive users, including a number of popular YouTube personalities. <strong>However, in most contexts it's at best the wrong number, and more often, meaingless.</strong></p>
<p>For example, you will see printer manufacturers bragging that they can print at "250 mm/s", and it turns out what they mean is that, when you set the print speed in the slicer to "250 mm/s", it works. However, their profile has the acceleration set to 500 mm/s², and you need a straight line all the way across the bed to accelerate up to that speed momentarily before starting to slow down again, and overall average prints come out 5% faster than when you set it to "90 mm/s".</p>
<p>If you set this kind of lying (or incompetence, if you accept Hanlon's Razor) aside, and only talk about the actual <em>velocity achieved</em> under an acceleration profile, linear speed becomes meaningful, but probably not the right number, because it's missing any information about the actual limiting factors. Provided the speed isn't beyond the max RPM of your stepper motors (around 650 RPM for typical motors on 24V printers), <strong>any printer</strong> can print at that speed as long as your layer height is thin enough or your lines are narrow enough. In fact if you go look at a few of the top "1000 mm/s" YouTube videos, they're using 0.1 mm layer height or thinner - which is easy to do, but not interesting to most people. It's not helping you print <em>faster</em> because now you have twice as many (or more) layers to print.</p>
<p>Volumetric flow rate takes all of that into account. If you print at 20 mm³/s and I print at 10 mm³/s (and if these are actual average flow over the whole print, not just a speed limit that's rarely achieved due to acceleration profile limits), your print will finish in half the time of mine. That is a meaningful speed - one that can't be used to lie/mislead by printing thin layers or whatever. Moreover, it's the limit you need to know, for your particular hotend, extruder, and filament type, in order to be able to decide what speed to print at (whether you control this via volumetric flow limits or computing the corresponding linear speed limits yourself). If you're reading the filament manufacturer's recommendations, they didn't say it but they probably wrote those for 0.4 mm line width and 0.2 mm layer height, so you should multiply by 0.08 mm² to get the volumetric rate they intended.</p>
<p>This gets more important with slicers, particularly the upcoming Cura 5, which use varying line width (and thus varying relationship between the linear speed and volumetric speed) to extrude your layers. Now a single linear speed doesn't suffice to give you max performance while also staying within the physical limits of what you can extrude. Cura 5 has "Flow Equalization" to speed up or slow down to keep the volumetric rate matching what it would be at the nominal line width and speed.</p>
<p>Now, linear speed in mm/s is meaningful <em>sometimes</em> - particularly, if you're showcasing the printer's motion system. High voltage steppers, larger pulleys, servo motors, etc. all can achieve some very high linear speeds (over 1000 mm/s) that ordinary 24V steppers (much less 12V ones on older printers) with normal size pulleys simply cannot do. Even if these speeds are not usable for print moves (because the volumetric flow rate becomes the limiting factor for what you can do), they're always usable for travel moves, which can easily be 25% or more of the time spent in complex prints.</p>
|
<p>Flow rate adds a dimension to the regularly used printing speed. Note that maximum volumetric flow is determined by the hotend (unless your extruder is under dimensioned or highly geared) as it cannot supply more molten filament than it can melt in a certain time.</p>
<p>So, instead of specifying the print speed, you should include the amount of material it can process. Volumetric flow includes nozzle diameter, layer thickness and hotend type.</p>
<p>E.g. a 60 mm/s of a 0.4 mm nozzle at a 0.2 mm layer height has a very different volumetric flow (4.8 mm³/s) from a 60 mm/s 0.8 mm nozzle at a 0.4 mm layer height (19.2 mm³/s). The latter may require a different hotend to get that flow, but usually it is advised to print slower with a larger nozzle.</p>
<p>Most practical is to use the linear printing speed. This is the value you find in the slicers. But, for a given hotend design it is good to keep the maximum volumetric flow into account to determine whether you are within the specifications of the hotend when you change certain printing/slicing parameters.</p>
| 2,070
|
<p>I need to replace the lid of my water kettle and am searching for a filament, that is suitable for this purpose. The requirements are:</p>
<ol>
<li>Stable at 100°C (212°F)</li>
<li>Resistant to steam/moisture</li>
<li>Food-safe</li>
</ol>
<p>Has anyone experimented with this or similar purposes?</p>
|
<p>Referring to the table provided in 0scar's answer, the key challenge with high temperature materials is the gap between the glass transition temperature (bed temperature) and the extruder temperature.</p>
<p>Polycarbonate for example is listed as usable up to 121°C, printing on a bed at 80-120°C, but requiring an extruder temperature of 260-310°C. This extruder temperature is potentially going to challenge the mechanical, thermal and measurement properties of a printer.</p>
<p>In this application, you don't strictly require 100°C operation, so Nylon (80-95°C) and ABS (98°C) might be worth trying. Even if one side of the part is at this temperature, immersed in steam, the opposite side is exposed to air and convection cooling. Providing there is sufficient thermal insulation and internal rigidity, the upper shell of the part is likely to support it. However, if the inner face does start to flow it may take some time before a problem is apparent.</p>
<p>So long as the material is not <em>soluble</em>, absorbing moisture may not be a major issue.</p>
<p>When it comes to being food-safe, this is a huge can of worms, and you're really looking to investigate 'how much of a risk' rather than get a go/no-go answer.</p>
|
<p>There are few materials that go up to that temperature and beyond.</p>
<p>A very nice generic overview is given by <a href="https://www.simplify3d.com/support/materials-guide/properties-table/" rel="nofollow noreferrer">Simplify3d</a>:</p>
<p><em>This figure shows an overview of many of the used materials in 3D printing</em>
<a href="https://i.stack.imgur.com/em4Xd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/em4Xd.jpg" alt="enter image description here"></a></p>
<p>When looking closely, and without pointing to specific brands (to avoid a commercial posting), your best chances for appropriate filaments for your application is to look at Nylon, Polycarbonate (do not consider Polypropylene; that is very difficult to print) or (not mentioned in the overview as they are more recent filaments) Co-Polyester polymers.</p>
| 976
|
<p>In the case of languages that support single decision and action without brackets, such as the following example:</p>
<pre><code>if (var == true)
doSomething();
</code></pre>
<p>What is the preferred way of writing this? Should brackets always be used, or should their usage be left as a preference of the individual developer? Additionally, does this practice depend on the size of the code block, such as in the following example:</p>
<pre><code>if (var == 1)
doSomething(1);
else if (var > 1 && var < 10)
doSomething(2);
else
{
validate(var);
doSomething(var);
}
</code></pre>
|
<p>There isn't really a right answer. This is what coding standards within the company are for. If you can keep it consistent across the whole company then it will be easy to read. I personally like</p>
<pre><code>if ( a == b) {
doSomething();
}
else {
doSomething();
}
</code></pre>
<p>but this is a holy war. </p>
|
<p>Our boss makes us put { } after a decision statement no matter what, even if it's a single statement. It's really annoying to add two extra lines. The only exception is ternary operators.</p>
<p>I guess it's a good thing I have my code monitor in portrait orientation at 1200x1600.</p>
| 3,228
|
<p>If possible one that supports at least spell checking:</p>
<ul>
<li>C# string literals</li>
<li>HTML content</li>
<li>Comments</li>
</ul>
|
<p>The <a href="http://blogs.msdn.com/webdevtools/archive/2008/11/29/spell-checker-update-2-2-full-support-for-vs-2008-sp1-simpler-setup-and-a-few-bug-fixes.aspx" rel="nofollow noreferrer">plugin from Microsoft's Mikhail Arkhipov</a> does HTML and Comments, I don't believe it does C# strings, though. I use the <a href="http://www.agentsmithplugin.com/" rel="nofollow noreferrer">Agent Smith</a> plugin for <a href="http://www.jetbrains.com/resharper/" rel="nofollow noreferrer">ReSharper</a> for that.</p>
|
<p>I was running an obsolete version on Visual Studio 08, as of April last year this is the apparent update: <a href="http://visualstudiogallery.msdn.microsoft.com/2f3d691d-8838-4d84-ad64-44a02db37e30/" rel="nofollow">http://visualstudiogallery.msdn.microsoft.com/2f3d691d-8838-4d84-ad64-44a02db37e30/</a></p>
<p>Unfortunately for me, it only works on commented code and not strings.</p>
| 5,080
|
<p>I'm having issues getting PETG to print nicely. I have encountered pretty much every issue because when I fix one thing another issue pops up. I see people saying that you should "just copy your PLA settings", but that <em>definitely</em> did not work for me, with issues from bed adhesion, stringing, globbing, and especially issues with the top layers. At the moment I am getting very decent quality prints from PETG, however the one issue that remains is the top of the print.</p>
<p>Infill looks fine, it is printing fast, so that is where I would expect the filament to glob to the extruder. But that happens on the very first top layer. The printer goes over the honeycomb, and the filament gets oozy and starts forming in globs on the edge of each inner wall. This takes a few layers to print over, and even after 5 layers at 0.25 mm layer height it has holes.</p>
<p><img src="https://i.imgur.com/u55Q6Vg.jpg" alt="Picture" /></p>
<p><strong>Software:</strong> I am using Slic3r PE 1.41.2, on Repetier Host 2.1.3.</p>
<p><strong>Printer:</strong> Wanhao DI3 or Monoprice Maker Select Plus.</p>
<p><strong>Filament:</strong> Amazon Basics branded Navy Blue PETG.</p>
<p><strong>Settings:</strong></p>
<ul>
<li>40 mm/s print speed,</li>
<li>0.2 mm layer height,</li>
<li>70 °C heat bed,</li>
<li>235 °C hot end,</li>
<li>15 % honeycomb infill,</li>
<li>20 % - 50 % automatic fan speed.</li>
</ul>
<p>I would like to solve this without increasing infill percentage because the parts are already quite dense with 15 % honeycomb and I don't want to waste material and time.</p>
|
<p>Five top layers should normally be more than enough to create a seamless top layer.</p>
<p>Indeed, PETG prints a little differently than PLA. It requires a higher hot end temperature, less part cooling (to improve sticking to previous layers), a higher build plate temperature and usually care in choosing the right initial layer height. Once the printer needs to create the top surface layers, too much temperature, too less cooling and too low of an infill percentage can cause the top bridging over the infill to fail. Your settings seem to be fine except for the low percentage of infill, 15% is very low.</p>
<p>Other possible causes could be under-extrusion and too fast printing, but in this case the low infill percentage is probably the main reason. To get a better top layer you could first try to increase the infill percentage. If you go to 20 or 30 % infill, you would only marginally "waste" filament. More filament and time is wasted when whole prints fail as of a bad top layer.</p>
|
<p>I have been having the same issue with PETG when printing but I have found that if I slow the printer down to 50% speed that left me with a perfect top layer. I have a 20% infill with 4 top layers and at 50% speed I am printing at roughly 32mm/m. I am sure that will help give you better top layers.</p>
| 1,120
|
<p>I broke one of the blades of the fan and that's making the x-box vibrate. Other than that it works fine and I can still print at a very low flow rate and a lot of noise. Will replacing the blades, not the whole fan work?</p>
<p>Found this and how to replace on thingyverse:</p>
<p><a href="https://www.thingiverse.com/thing:186979" rel="nofollow noreferrer">https://www.thingiverse.com/thing:186979</a></p>
|
<p>It will work, but likely with reduced performances: designing blades is not an easy task and the ones you can print will not be as good as the ones designed for that specific fan.</p>
<p>Overall, do it for fun before you replace the fan anyway.</p>
<p>IF your fan has symmetrical blades (unlikely), another option is to break the opposite blade to balance the fan.</p>
|
<p>If you want to <strong>play</strong> then print new blades; if you want to <strong>print</strong> then swap the fan - but pay attention to: Voltage, current draw, rpm, fan thickness, etc. </p>
<p>Note: most fans are built to be disposable/replaceable. They are never built to be repaired, and as yet, nobody has succeeded in replicating the efficiency/balance/effectiveness of commercially available blades via 3D printing - and many in the Drone world have tried and died!</p>
<p>If you decide to replace, ideally you want EXACTLY the same fan as a replacement - even if it costs more than something similar. When you get seasoned, you can upgrade and improve, but until then, similar is not good enough...</p>
| 1,682
|
<p>I'm curious about keeping source code around reliably and securely for several years. From my research/experience:</p>
<ol>
<li><p>Optical media, such as burned DVD-R's lose bits of data over time. After a couple years, I don't get all the files off that I put on them. Read errors, etc.</p></li>
<li><p>Hard drives are mechanical and subject to failure/obsolescence with expensive data recovery fees, that hardly keep your data private (you send it away to some company).</p></li>
<li><p>Magnetic tape storage: see #2.</p></li>
<li><p>Online storage is subject to the whim of some data storage center, the security or lack of security there, and the possibility that the company folds, etc. Plus it's expensive, and you can't guarantee that they aren't peeking in.</p></li>
</ol>
<p>I've found over time that I've lost source code to old projects I've done due to these problems. Are there any other solutions?</p>
<p><em>Summary of answers:</em><br>
1. Use multiple methods for redundancy.<br>
2. Print out your source code either as text or barcode.<br>
3. RAID arrays are better for local storage.<br>
4. Open sourcing your project will make it last forever.<br>
5. Encryption is the answer to security.<br>
6. Magnetic tape storage is durable.<br>
7. Distributed/guaranteed online storage is cheap and reliable.<br>
8. Use source control to maintain history, and backup the repo.</p>
|
<p>The best answer is "in multiple places". If I were concerned about keeping my source code for as long as possible I would do: </p>
<p>1) Backup to some optical media on a regular basis, say burn it to DVD once a month and archive it offsite. </p>
<p>2) Back it up to multiple hard drives on my local machines </p>
<p>3) Back it up to Amazon's S3 service. They have guarantees, it's a distributed system so no single points of failure and you can easily encrypt your data so they can't "peek" at it. </p>
<p>With those three steps your chances of losing data are effectively zero. There is no such thing as too many backups for VERY important data. </p>
|
<p>One way would be to periodically recycle your storage media, i.e. read data off the decaying medium and write it to a fresh one. There exist programs to assist you with this, e.g. <a href="http://www.dvdisaster.com/" rel="nofollow noreferrer">dvdisaster</a>. In the end, nothing lasts forever. Just pick the least annoying solution.</p>
<p>As for #2: you can store data in encrypted form to prevent data recovery experts from making sense of it.</p>
| 9,945
|
<p>Suppose the following:</p>
<pre><code>>>> s = set([1, 2, 3])
</code></pre>
<p>How do I get a value (any value) out of <code>s</code> without doing <code>s.pop()</code>? I want to leave the item in the set until I am sure I can remove it - something I can only be sure of after an asynchronous call to another host.</p>
<p>Quick and dirty:</p>
<pre><code>>>> elem = s.pop()
>>> s.add(elem)
</code></pre>
<p>But do you know of a better way? Ideally in constant time.</p>
|
<p>Two options that don't require copying the whole set:</p>
<pre><code>for e in s:
break
# e is now an element from s
</code></pre>
<p>Or...</p>
<pre><code>e = next(iter(s))
</code></pre>
<p>But in general, sets don't support indexing or slicing.</p>
|
<p>Another option is to use a dictionary with values you don't care about. E.g.,</p>
<pre><code>
poor_man_set = {}
poor_man_set[1] = None
poor_man_set[2] = None
poor_man_set[3] = None
...
</code></pre>
<p>You can treat the keys as a set except that they're just an array:</p>
<pre><code>
keys = poor_man_set.keys()
print "Some key = %s" % keys[0]
</code></pre>
<p>A side effect of this choice is that your code will be backwards compatible with older, pre-<code>set</code> versions of Python. It's maybe not the best answer but it's another option.</p>
<p>Edit: You can even do something like this to hide the fact that you used a dict instead of an array or set:</p>
<pre><code>
poor_man_set = {}
poor_man_set[1] = None
poor_man_set[2] = None
poor_man_set[3] = None
poor_man_set = poor_man_set.keys()
</code></pre>
| 8,455
|
<p>I am getting the following error:</p>
<blockquote>
<p>Access denied for user 'apache'@'localhost' (using password: NO)</p>
</blockquote>
<p>When using the following code:</p>
<pre><code><?php
include("../includes/connect.php");
$query = "SELECT * from story";
$result = mysql_query($query) or die(mysql_error());
echo "<h1>Delete Story</h1>";
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_row($result)){
echo '<b>'.$row[1].'</b><span align="right"><a href="../process/delete_story.php?id='.$row[0].'">Delete</a></span>';
echo '<br /><i>'.$row[2].'</i>';
}
}
else {
echo "No stories available.";
}
?>
</code></pre>
<p>The <code>connect.php</code> file contains my MySQL connect calls that are working fine with my <code>INSERT</code> queries in another portion of the software. If I comment out the <code>$result = mysql_query</code> line, then it goes through to the else statement. So, it is that line or the content in the if.</p>
<p>I have been searching the net for any solutions, and most seem to be related to too many MySQL connections or that the user I am logging into MySQL as does not have permission. I have checked both. I can still perform my other queries elsewhere in the software, and I have verified that the account has the correct permissions.</p>
|
<blockquote>
<p>And if it matters at all, apache@localhost is not the name of the user account that I use to get into the database. I don't have any user accounts with the name apache in them at all for that matter.</p>
</blockquote>
<p>If it is saying 'apache@localhost' the username is not getting passed correctly to the MySQL connection. 'apache' is normally the user that runs the httpd process (at least on Redhat-based systems) and if no username is passed during the connection MySQL uses whomever is calling for the connection.</p>
<p>If you do the connection right in your script, not in a called file, do you get the same error?</p>
|
<p>Just to check, if you use <strong>just</strong> this part you get an error?</p>
<pre><code><?php
include("../includes/connect.php");
$query = "SELECT * from story";
$result = mysql_query($query) or die(mysql_error());
</code></pre>
<p>If so, do you still get an error if you copy and paste one of those Inserts into this page, I am trying to see if it's local to the page or that actual line.</p>
<p>Also, can you post a copy of the connection calls (minus passwords), unless the inserts use exactly the same syntax as this example.</p>
| 2,505
|
<p>Can any one help me out that how to start a cycle by just using a push button.</p>
<p>Note: Using Marlin firmware, Arduino Mega, Ramps 1.4</p>
<p>I haven't tried altering the Marlin code (as I am new to coding), I was just thinking of adopting this feature as it will be very easy for CNC DIY maker using Marlin code to run a cycle in a loop.</p>
|
<p>I ended up using Saman brand water-based wood stain, also from Rona hardware (a brand of Lowe's Canada). The selection of colours for Saman stains was greater than the Varathane stains. </p>
<p>I applied a single coat of colour #117 "Chamois" to the stem portion of the wand, and two coats of colour #120 "Dark Walnut" to the handle. I did not apply a varnish or sealer. The results seem acceptable, given that I Am Not A Carpenter, and this is my first go at printing and finishing wood PLA! Overall, I'm quite happy with the result. I left the PLA mostly unsanded to take advantage of the layers' wood-grain appearance.</p>
<p><a href="https://i.stack.imgur.com/j8OTj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j8OTj.jpg" alt="Close up of wand"></a><a href="https://i.stack.imgur.com/jSl8B.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jSl8B.jpg" alt="Another close up, showing the Dark Walnut stained handle at left, the Chamois stained stem at left, with a section of unstained wood PLA at the joint"></a></p>
|
<p>Wood stains (as opposed to dyes, paints, etc.) work by having large particles that become lodged in the grain of the wood, yielding a result that varies in intensity with the grain of the wood and thereby brings out its beauty. It's unlikely that they will do what you want, or anything reasonable, on PLA that has wood particles mixed into it. You might be able to find some types of dyes that will work. I've used wood dyes on woods that don't take stain well and have had good results, and if the PLA+wood material consists of a significant amount of wood, it seems plausible that wood dyes might work well on it.</p>
| 1,310
|
<p>It's my first time printing in vase mode, and I noticed my printer underextruding badly. The settings have not been changed from default vase mode settings in slicer, and earlier I was printing non-vase mode and the prints came out fine. Layer height is 0.2 mm and perimeter width is 0.3 mm. </p>
<p><a href="https://i.stack.imgur.com/rXiKt.jpg" rel="nofollow noreferrer" title="Under extrusion #1"><img src="https://i.stack.imgur.com/rXiKt.jpg" alt="Under extrusion #1" title="Under extrusion #1"></a></p>
<p><a href="https://i.stack.imgur.com/KCy5X.jpg" rel="nofollow noreferrer" title="Under extrusion #2"><img src="https://i.stack.imgur.com/KCy5X.jpg" alt="Under extrusion #2" title="Under extrusion #2"></a></p>
|
<p>Finding the cause of under-extrusion is very hard as a lot of parameters of the print process can influence this. There are some nice websites that describe these problems in detail. From your question it is unclear what you have done to solve the problem, or if you have printed products after the vase mode and shown us a picture of that (this eliminates a lot of possible problems). </p>
<p>A nice overview is given by <a href="https://ultimaker.com/en/resources/21477-how-to-fix-under-extrusion" rel="nofollow noreferrer">Ultimaker</a>, but other sources may help you to find the root cause, e.g. <a href="https://www.simplify3d.com/support/print-quality-troubleshooting/" rel="nofollow noreferrer">Simplify3D</a>. If the issue is related to the filament and hot-end, <a href="https://printrbot.zendesk.com/hc/en-us/articles/202100554-Unclogging-the-Hot-End-Using-the-Cold-Pull-Method" rel="nofollow noreferrer">Printrbot</a>, <a href="https://www.trideus.be/en/blogs/stories/tips-tricks-do-the-cold-pull" rel="nofollow noreferrer">Trideus</a> and <a href="https://rigid.ink/blogs/news/under-extrusion-problems-or-clicking-sounds-heres-why-and-how-to-fix-it" rel="nofollow noreferrer">Rigid.ink</a> may help you solve the problem.</p>
<p>Important is to isolate your problem! Not knowing what printer you have, your printer has (or potentially has) the folowing modules/elements that may be causing the underextrusion:</p>
<ul>
<li>the slicer (highly suspicious),</li>
<li>the material/filament and the spool holder (suspicious),</li>
<li>the extruder or feeder (suspicious),</li>
<li>the hot-end (suspicious),</li>
<li>the Bowden tube (suspicious if you have one).</li>
</ul>
<p>Note that to find the root cause you should tackle this by elimination, this way you make sure that certain modules are not causing the problem. Also keep in mind that the vase mode prints a single outline/perimeter shell and won't make any retracts (so the Z axis will continuously rise), in which defects are shown instantly. Please, take a close look at your normal multi perimeter print.</p>
<h1>How to fix under extrusion!</h1>
<p>Under extrusion is probably one of the hardest to find the direct cause as there are so many variables to consider. Please find below some of the variables that can affect your printing quality marked in bold face.</p>
<ul>
<li><p><strong>Material and material settings</strong>
<br>
The material you use needs to be resembled correctly, so it is important and easiest thing to check first if your print is suffering from under-extrusion due to incorrect material settings. The material settings in your slicer (or the material profile on your printer for the more fancy printers) should match the material you are printing. So please check the <strong>filament diameter</strong> with a caliper and measure the diameter at various points; take the mean diameter of at least 3 to 5 measurements. Furthermore, <strong>temperature</strong> is also an important factor; <strong>too low temperatures</strong> will cause that the extruder has to push harder as the material is less viscous due to the fact it is not heated properly. Note that this can also happen if the flow of the filament is too high and the heater cannot keep up. It is these high pressures that cause the under extrusion as it may not flow fluidly. In contrast to too low temperatures, <strong>too high temperatures</strong>, can also cause problems. Very high temperatures can change the structure of the material, this is often referred to as carbonization causing <strong>deposits</strong> (clogs) in the nozzle. A word of advice, <em>Please check your filament spool/box (or sometimes a paper in the box or bag) for the proper temperatures</em>.
<br><br>
Next to the temperature, other important material settings are the <strong>print speed</strong>, the <strong>layer height</strong> and the <strong>nozzle size</strong> as these properties further define the rate at which the <strong>filament volume</strong> is deposited. For instance, a <strong>too high of a volume flow</strong> not only can lead to the previously mentioned cooling of the nozzle, but also is limited by the diameter of the nozzle, you just cannot push more through the nozzle is capable of as the friction will increase (the smallest opening in the system determines the maximum rate of volume flow). If you do, this will lead to under-extrusion. To <strong>find the optimum between speed and temperature</strong>, a good balance between these needs to be found. A typical way to do that is by the use of printing calibration temperature towers, preferably at various speeds. To print faster, you need a higher temperature, but printing at lower temperatures because of overhangs, you might need to decrease the speed to get a proper extrusion (and maybe also part cooling).
<br><br>
Don't just focus on the hot end part, also take a closer look at the filament spool itself, or better, how the spool unrolls. Is the <strong>spool of filament unrolling correctly/freely</strong> without a lot of friction (does it make <strong>sharp bends</strong>, or does it go <strong>through a tube</strong> having friction from its container to the extruder), or is the <strong>filament not correctly wound causing tangled filament</strong> (which create a lot of friction preventing enough material to be transported to the hot end) which could stress the extruder.
<br><br>
For some materials that are hydrophilic (they attract water and trap it in the filament, this happens e.g. with PLA, PVA, Nylon and maybe even more) printing the <strong>filament with contained water, the water will turn into steam causing bubbles</strong> in the deposited filament and interfere with the flow deposition. This effect sometimes makes a distinct sound like popping bubbles. Always store your filament in a sealed container or bag and use desiccants bags. Moisture can cause damage to the printer as the <strong>filament swells when taking up moisture</strong>; this could lead to various jams. Last but not least, filament with moisture in it has less mechanical properties after printing than dry filament (up to 33% less).</p></li>
<li><p><strong>The extruder/feeder and Bowden tube</strong>
<br>
The extruder/feeder pushes or feeds material into the hot end, or into a tube (called Bowden tube). Under-extrusion caused by the extruder is typically characterized by the fact that filament is not properly fed to the hot end as a result of <strong>too much friction in the tube or hot end</strong>, <strong>too less grip on the filament</strong> or <strong>filament grinding</strong> (the extruder gear 'eating away' the filament). <strong>Too much friction could even cause your stepper to tick or click</strong>, basically turning back as the pressure on the filament exerts so much pressure that the stepper is rotated back; <strong>increasing the feeder tension</strong> on the filament (by <strong>adjusting the screw on the extruder/feeder</strong> would fix that). Grinding is easily spotted when removing the filament; it will clearly show that the gear has worn away circle shapes. Furthermore, <strong>filament taken out of the printer should show visible marks on the material</strong> as imprints of the extruder gear, <strong>if completely smooth, the feeder tension is too less</strong>. On the other hand, <strong>too much tension on the feeder could flatten the filament, which leads the previously mentioned grinding effect</strong>. If you encounter grinding, please assure that you <strong>clean the extruder by removing the filament powder and chunks</strong> the grinding produced and recheck the extruder/feeder tension before continuing printing again. Be sure that the <strong>grinding particles have not entered the Bowden tube as it causes friction</strong>. Cleaning them regularly or replacing them once a year is advisable depending on the usage (or once every x kilometers of filament). Furthermore, <strong>larger diameter filament (2.85 or 3 mm) can cause additional friction (in the Bowden tube or the extruder/feeder) as towards the end of the spool</strong>, the filament is wound tight along a small diameter spool center causing strongly bend filament that exerts pressure as it acts like a spring creating friction at the walls of the tubes.</p></li>
<li><p><strong>The hot-end</strong>
<br>
The hot end can also be a culprit for under-extrusion. <strong>Partial blockage of the nozzle as a result of carbonization</strong> (buildup of carbon or carbonized material in the nozzle). Even <strong>left over material from previous prints inside the nozzle</strong> (<em>unflushed residue</em>) may change the volume of the nozzle when the material you printed before needed a higher temperature than the current you're printing. Also try to get <strong>good quality filament</strong>, it might be that the <strong>quality is just not constant for the whole spool</strong>. Too clean the inside of the nozzle, a few techniques exist to remove blockage. By <strong>performing a "cold pull" or using the <code>atomic method</code></strong>. Both techniques rely on the mechanism to insert the (cleaning) filament when it's hot and remove it quickly at a lower temperature. E.g. see <a href="https://printrbot.zendesk.com/hc/en-us/articles/202100554-Unclogging-the-Hot-End-Using-the-Cold-Pull-Method" rel="nofollow noreferrer">here</a> or <a href="https://rigid.ink/blogs/news/under-extrusion-problems-or-clicking-sounds-heres-why-and-how-to-fix-it" rel="nofollow noreferrer">here</a>.</p></li>
</ul>
|
<p>Finding the cause of under-extrusion is very hard as a lot of parameters of the print process can influence this. There are some nice websites that describe these problems in detail. From your question it is unclear what you have done to solve the problem, or if you have printed products after the vase mode and shown us a picture of that (this eliminates a lot of possible problems). </p>
<p>A nice overview is given by <a href="https://ultimaker.com/en/resources/21477-how-to-fix-under-extrusion" rel="nofollow noreferrer">Ultimaker</a>, but other sources may help you to find the root cause, e.g. <a href="https://www.simplify3d.com/support/print-quality-troubleshooting/" rel="nofollow noreferrer">Simplify3D</a>. If the issue is related to the filament and hot-end, <a href="https://printrbot.zendesk.com/hc/en-us/articles/202100554-Unclogging-the-Hot-End-Using-the-Cold-Pull-Method" rel="nofollow noreferrer">Printrbot</a>, <a href="https://www.trideus.be/en/blogs/stories/tips-tricks-do-the-cold-pull" rel="nofollow noreferrer">Trideus</a> and <a href="https://rigid.ink/blogs/news/under-extrusion-problems-or-clicking-sounds-heres-why-and-how-to-fix-it" rel="nofollow noreferrer">Rigid.ink</a> may help you solve the problem.</p>
<p>Important is to isolate your problem! Not knowing what printer you have, your printer has (or potentially has) the folowing modules/elements that may be causing the underextrusion:</p>
<ul>
<li>the slicer (highly suspicious),</li>
<li>the material/filament and the spool holder (suspicious),</li>
<li>the extruder or feeder (suspicious),</li>
<li>the hot-end (suspicious),</li>
<li>the Bowden tube (suspicious if you have one).</li>
</ul>
<p>Note that to find the root cause you should tackle this by elimination, this way you make sure that certain modules are not causing the problem. Also keep in mind that the vase mode prints a single outline/perimeter shell and won't make any retracts (so the Z axis will continuously rise), in which defects are shown instantly. Please, take a close look at your normal multi perimeter print.</p>
<h1>How to fix under extrusion!</h1>
<p>Under extrusion is probably one of the hardest to find the direct cause as there are so many variables to consider. Please find below some of the variables that can affect your printing quality marked in bold face.</p>
<ul>
<li><p><strong>Material and material settings</strong>
<br>
The material you use needs to be resembled correctly, so it is important and easiest thing to check first if your print is suffering from under-extrusion due to incorrect material settings. The material settings in your slicer (or the material profile on your printer for the more fancy printers) should match the material you are printing. So please check the <strong>filament diameter</strong> with a caliper and measure the diameter at various points; take the mean diameter of at least 3 to 5 measurements. Furthermore, <strong>temperature</strong> is also an important factor; <strong>too low temperatures</strong> will cause that the extruder has to push harder as the material is less viscous due to the fact it is not heated properly. Note that this can also happen if the flow of the filament is too high and the heater cannot keep up. It is these high pressures that cause the under extrusion as it may not flow fluidly. In contrast to too low temperatures, <strong>too high temperatures</strong>, can also cause problems. Very high temperatures can change the structure of the material, this is often referred to as carbonization causing <strong>deposits</strong> (clogs) in the nozzle. A word of advice, <em>Please check your filament spool/box (or sometimes a paper in the box or bag) for the proper temperatures</em>.
<br><br>
Next to the temperature, other important material settings are the <strong>print speed</strong>, the <strong>layer height</strong> and the <strong>nozzle size</strong> as these properties further define the rate at which the <strong>filament volume</strong> is deposited. For instance, a <strong>too high of a volume flow</strong> not only can lead to the previously mentioned cooling of the nozzle, but also is limited by the diameter of the nozzle, you just cannot push more through the nozzle is capable of as the friction will increase (the smallest opening in the system determines the maximum rate of volume flow). If you do, this will lead to under-extrusion. To <strong>find the optimum between speed and temperature</strong>, a good balance between these needs to be found. A typical way to do that is by the use of printing calibration temperature towers, preferably at various speeds. To print faster, you need a higher temperature, but printing at lower temperatures because of overhangs, you might need to decrease the speed to get a proper extrusion (and maybe also part cooling).
<br><br>
Don't just focus on the hot end part, also take a closer look at the filament spool itself, or better, how the spool unrolls. Is the <strong>spool of filament unrolling correctly/freely</strong> without a lot of friction (does it make <strong>sharp bends</strong>, or does it go <strong>through a tube</strong> having friction from its container to the extruder), or is the <strong>filament not correctly wound causing tangled filament</strong> (which create a lot of friction preventing enough material to be transported to the hot end) which could stress the extruder.
<br><br>
For some materials that are hydrophilic (they attract water and trap it in the filament, this happens e.g. with PLA, PVA, Nylon and maybe even more) printing the <strong>filament with contained water, the water will turn into steam causing bubbles</strong> in the deposited filament and interfere with the flow deposition. This effect sometimes makes a distinct sound like popping bubbles. Always store your filament in a sealed container or bag and use desiccants bags. Moisture can cause damage to the printer as the <strong>filament swells when taking up moisture</strong>; this could lead to various jams. Last but not least, filament with moisture in it has less mechanical properties after printing than dry filament (up to 33% less).</p></li>
<li><p><strong>The extruder/feeder and Bowden tube</strong>
<br>
The extruder/feeder pushes or feeds material into the hot end, or into a tube (called Bowden tube). Under-extrusion caused by the extruder is typically characterized by the fact that filament is not properly fed to the hot end as a result of <strong>too much friction in the tube or hot end</strong>, <strong>too less grip on the filament</strong> or <strong>filament grinding</strong> (the extruder gear 'eating away' the filament). <strong>Too much friction could even cause your stepper to tick or click</strong>, basically turning back as the pressure on the filament exerts so much pressure that the stepper is rotated back; <strong>increasing the feeder tension</strong> on the filament (by <strong>adjusting the screw on the extruder/feeder</strong> would fix that). Grinding is easily spotted when removing the filament; it will clearly show that the gear has worn away circle shapes. Furthermore, <strong>filament taken out of the printer should show visible marks on the material</strong> as imprints of the extruder gear, <strong>if completely smooth, the feeder tension is too less</strong>. On the other hand, <strong>too much tension on the feeder could flatten the filament, which leads the previously mentioned grinding effect</strong>. If you encounter grinding, please assure that you <strong>clean the extruder by removing the filament powder and chunks</strong> the grinding produced and recheck the extruder/feeder tension before continuing printing again. Be sure that the <strong>grinding particles have not entered the Bowden tube as it causes friction</strong>. Cleaning them regularly or replacing them once a year is advisable depending on the usage (or once every x kilometers of filament). Furthermore, <strong>larger diameter filament (2.85 or 3 mm) can cause additional friction (in the Bowden tube or the extruder/feeder) as towards the end of the spool</strong>, the filament is wound tight along a small diameter spool center causing strongly bend filament that exerts pressure as it acts like a spring creating friction at the walls of the tubes.</p></li>
<li><p><strong>The hot-end</strong>
<br>
The hot end can also be a culprit for under-extrusion. <strong>Partial blockage of the nozzle as a result of carbonization</strong> (buildup of carbon or carbonized material in the nozzle). Even <strong>left over material from previous prints inside the nozzle</strong> (<em>unflushed residue</em>) may change the volume of the nozzle when the material you printed before needed a higher temperature than the current you're printing. Also try to get <strong>good quality filament</strong>, it might be that the <strong>quality is just not constant for the whole spool</strong>. Too clean the inside of the nozzle, a few techniques exist to remove blockage. By <strong>performing a "cold pull" or using the <code>atomic method</code></strong>. Both techniques rely on the mechanism to insert the (cleaning) filament when it's hot and remove it quickly at a lower temperature. E.g. see <a href="https://printrbot.zendesk.com/hc/en-us/articles/202100554-Unclogging-the-Hot-End-Using-the-Cold-Pull-Method" rel="nofollow noreferrer">here</a> or <a href="https://rigid.ink/blogs/news/under-extrusion-problems-or-clicking-sounds-heres-why-and-how-to-fix-it" rel="nofollow noreferrer">here</a>.</p></li>
</ul>
| 858
|
<p>In all the Git tutorials I've read they say that you can do:</p>
<pre><code>git init
git add .
git commit
</code></pre>
<p>When I do that I get a big text file opened up. None of the tutorials seem to address this, so I don't know what to do with the file or what to put in it if anything.</p>
|
<p>You're meant to put the commit message in this text file, then save and quit.</p>
<p>You can change the default text editor that git uses with this command:</p>
<pre><code>git config --global core.editor "nano"
</code></pre>
<p>You have to change nano to whatever command would normally open your text editor.</p>
|
<p>The following is probably the easiest way to commit all changes:</p>
<pre><code>git commit -a -m "Type your commit message here..."
</code></pre>
<p>Of course there are much more detailed ways of committing, but that should get you started.</p>
| 8,514
|
<p>I was reading <em><a href="https://rads.stackoverflow.com/amzn/click/com/1430209879" rel="noreferrer" rel="nofollow noreferrer">More Joel on Software</a></em> when I came across <a href="http://en.wikipedia.org/wiki/Joel_Spolsky" rel="noreferrer">Joel Spolsky</a> saying something about a particular type of programmer knowing the difference between an <code>int</code> and an <code>Integer</code> in Java/C# (Object-Oriented Programming Languages).</p>
<p>So, what is the difference?</p>
|
<p><strong>In Java,</strong> the 'int' type is a primitive, whereas the 'Integer' type is an object.</p>
<p><strong>In C#,</strong> the 'int' type is the same as <code>System.Int32</code> and is <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/value-types" rel="noreferrer">a value type</a> (ie more like the java 'int'). An integer (just like any other value types) can be <a href="https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/boxing-and-unboxing" rel="noreferrer">boxed</a> ("wrapped") into an object. </p>
<hr>
<p>The differences between objects and primitives are somewhat beyond the scope of this question, but to summarize: </p>
<p><strong>Objects</strong> provide facilities for polymorphism, are passed by reference (or more accurately have references passed by value), and are allocated from the <a href="http://en.wikipedia.org/wiki/Dynamic_memory_allocation" rel="noreferrer">heap</a>. Conversely, <strong>primitives</strong> are immutable types that are passed by value and are often allocated from the <a href="https://en.wikipedia.org/wiki/Stack-based_memory_allocation" rel="noreferrer">stack</a>.</p>
|
<p>In java as per my knowledge if you learner then, when you write int a; then in java generic it will compile code like <code>Integer a = new Integer()</code>.
So,as per generics <code>Integer</code> is not used but <code>int</code> is used.
so there is so such difference there.</p>
| 2,298
|
<p>I'm using Eclipse 3.4 (Ganymede) with CDT 5 on Windows.</p>
<p>When the integrated spell checker doesn't know some word, it proposes (among others) the option to add the word to a user dictionary.</p>
<p>If the user dictionary doesn't exist yet, the spell checker offers then to help configuring it and shows the "General/Editors/Text Editors/Spelling" preference pane. This preference pane however states that <strong>"The selected spelling engine does not exist"</strong>, but has no control to add or install an engine.</p>
<p>How can I put a spelling engine in existence?</p>
<p>Update: What solved my problem was to install also the JDT. This solution was brought up on 2008-09-07 and was accepted, but is now missing.</p>
|
<p>The CDT version of Ganymede apparently shipped improperly configured. After playing around for a while, I have come up with the following steps that fix the problem.</p>
<ol>
<li>Export your Eclipse preferences (File > Export > General > Preferences).</li>
<li>Open the exported file in a text editor.</li>
<li><p>Find the line that says</p>
<pre>/instance/org.eclipse.ui.editors/spellingEngine=org.eclipse.jdt.internal.ui.text.spelling.DefaultSpellingEngine</pre></li>
<li><p>Change it to</p>
<p><pre>/instance/org.eclipse.ui.editors/spellingEngine=org.eclipse.cdt.internal.ui.text.spelling.CSpellingEngine</pre></p></li>
<li><p>Save the preferences file.</p></li>
<li>Import the preferences back into Eclipse (File > Import > General > Preferences).</li>
</ol>
<p>You should now be able to access the Spelling configuration page as seen above.</p>
<p>Note: if you want to add a custom dictionary, Eclipse must be able to access and open the file (i.e. it must exist - an empty file will work)</p>
|
<p>Just a word of warning: If you follow the advice to replace the preference as above, it will affect spell checking if you also use Java. I think all I needed to do was change the "Select spelling engine to use" to the C++ engine (near the top of the preference setting on the preference page General->Editors->Text Editors->Spelling).</p>
| 7,081
|
<p>In Javascript:
How does one find the coordinates (x, y, height, width) of every link in a webpage?</p>
|
<p>Using jQuery, it's as simple as:</p>
<pre><code>$("a").each(function() {
var link = $(this);
var top = link.offset().top;
var left = link.offset().left;
var width = link.offset.width();
var height = link.offset.height();
});
</code></pre>
|
<p>With jQuery:</p>
<pre><code>$j('a').each( findOffset );
function findOffset()
{
alert
( 'x=' + $j(this).offset().left
+ ' y=' + $j(this).offset().top
+ ' width=' + $j(this).width()
+ ' height=' + $j(this).height()
);
}
</code></pre>
| 9,314
|
<p>When running a vim instance in gnu screen hitting shift enter in insert mode adds an 'M' and then a newline, rather than just a newline.</p>
<p>Does anybody know what the problem might be, or where to look?</p>
<p>Relevant system info:</p>
<blockquote>
<p>Ubuntu 8.04.1</p>
<p>Screen version 4.00.03 (FAU) 23-Oct-06</p>
<p>VIM - Vi IMproved 7.1 (2007 May 12, compiled Jan 31 2008 12:20:21)
Included patches: 1-138</p>
<p>Konsole 1.6.6 (Using KDE 3.5.10)</p>
</blockquote>
<p>Thanks to the comments. When checking the value of <code>$TERM</code> I noticed that it was <code>xterm</code> (as expected), but within screen <code>$TERM</code> was set to <code>screen-bce</code>. Setting <code>TERM=xterm</code> after launching screen resolves this issue.</p>
<p>Adding the following to <code>~/.screenrc</code> solved the problem without having to do anything manually:</p>
<blockquote>
<p>term xterm</p>
</blockquote>
|
<p>Missing info from your question:</p>
<ol>
<li>Where do you run screen and see this issue? Some terminal app (KTerminal, Gnome terminal, virtual console etc) or remote session (eg putty, ssh from another computer)</li>
<li>do a “echo $TERM” and tell us its output</li>
<li>do a “cat -v”, press Shift-Enter, then Enter, then <kbd>Ctrl</kbd>-<kbd>D</kbd> and then tell us what is output.</li>
</ol>
|
<p>First, you could fix your $TERM for within konsole. Install "ncurses-term" and configure konsole to set $TERM=konsole-256color. Then configure screen with "term screen-256color". Or 'konsole' and 'screen', respectively, if that's your preference. Konsole and screen are <em>not</em> xterm and doesn't support everything xterm does, so using incorrect $TERM can lead to bad things.</p>
| 8,884
|
<p>Ok, so I've been refactoring my code in my little Rails app in an effort to remove duplication, and in general make my life easier (as I like an easy life). Part of this refactoring, has been to move code that's common to two of my models to a module that I can include where I need it.</p>
<p>So far, so good. Looks like it's going to work out, but I've just hit a problem that I'm not sure how to get around. The module (which I've called sendable), is just going to be the code that handles faxing, e-mailing, or printing a PDF of the document. So, for example, I have a purchase order, and I have Internal Sales Orders (imaginatively abbreviated to ISO).</p>
<p>The problem I've struck, is that I want some variables initialised (initialized for people who don't spell correctly :P ) after the object is loaded, so I've been using the <strong>after_initialize</strong> hook. No problem... until I start adding some more mixins.</p>
<p>The problem I have, is that I can have an <strong><code>after_initialize</code></strong> in any one of my mixins, so I need to include a <strong>super</strong> call at the start to make sure the other mixin <strong><code>after_initialize</code></strong> calls get called. Which is great, until I end up calling super and I get an error because there is no super to call.</p>
<p>Here's a little example, in case I haven't been confusing enough:</p>
<pre><code>class Iso < ActiveRecord::Base
include Shared::TracksSerialNumberExtension
include Shared::OrderLines
extend Shared::Filtered
include Sendable::Model
validates_presence_of :customer
validates_associated :lines
owned_by :customer
order_lines :despatched # Mixin
tracks_serial_numbers :items # Mixin
sendable :customer # Mixin
attr_accessor :address
def initialize( params = nil )
super
self.created_at ||= Time.now.to_date
end
end
</code></pre>
<p>So, if each one of the mixins have an after_initialize call, with a <strong>super</strong> call, how can I stop that last <strong>super</strong> call from raising the error? How can I test that the super method exists before I call it?</p>
|
<p>You can use this:</p>
<pre><code>super if defined?(super)
</code></pre>
<p>Here is an example:</p>
<pre><code>class A
end
class B < A
def t
super if defined?(super)
puts "Hi from B"
end
end
B.new.t
</code></pre>
|
<p>Rather than checking if the super method exists, you can just define it</p>
<pre><code>class ActiveRecord::Base
def after_initialize
end
end
</code></pre>
<p>This works in my testing, and shouldn't break any of your existing code, because all your other classes which define it will just be silently overriding this method anyway</p>
| 3,196
|
<p>I'd like to have a link in my ASP.NET web site that authenticated users click to download a windows app that is already pre-configured with their client ID and some site config data. My goal is no typing required for the user during the client app install, both for the user friendliness, and to avoid config errors from mis-typed technical bits. Ideally I'd like the web server-side code to run as part of the ASP.NET app. </p>
<p>FogBugz seems to do something like this. There is a menu option within the web app to download a screenshot tool, and when you download and run the installer, it knows your particular FogBugz web address so it can send screenshots there. (Hey Joel, looking for a question to answer? <em>hint—hint</em>)</p>
|
<p>The way the FogBugz screenshot setup tool does this is that it appends a 256 byte block at the end of the setup program at the moment it is downloaded. In other words, the download script spits out all the bytes from setup.exe and then an extra 256 with the url for the FogBugz server, plus any padding.</p>
<p>Windows ignores these extra bytes when the .exe is run (provided you turned off the CRC check for your setup installer - we're using <a href="http://www.innosetup.com" rel="nofollow noreferrer">InnoSetup</a>).</p>
<p>After installation, we run the Screenshot program with a command line switch that tells it where the setup installer is. It looks at the end of the setup.exe and finds it's info, and then writes that to the registry so the user doesn't have to know it.</p>
|
<p>If it helps RegexBuddy does this also.</p>
| 5,634
|
<p>I am trying to print a fairly simple object yet I keep getting the same issue.</p>
<p>As you can see in the picture the print quality is bad with all the blobs on the vertical part of the print.</p>
<p>I have leveled the bed many times and I keep getting this issue. I have also calibrated the E-steps. I have replaced the PTFE tube as well.</p>
<p>I am printing with Sunlu PLA+. I was printing at 220 °C but now that I set it at 200 °C the result is a little bit better but it has not gone away.</p>
<p>Please advise on how to fix this.</p>
<p>Note: I have 2 Ender 3 V2's and the other printer is printing the same files pretty much perfect.</p>
<p><a href="https://i.stack.imgur.com/Ku8fN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ku8fN.jpg" alt="enter image description here" /></a></p>
|
<ol>
<li><p>Print the same file, with the same settings, on both machines.</p>
</li>
<li><p>If the problem persists, try swapping the filament between the two printers. If the problem now occurs on the other printer, that suggests that the filament is the issue. Label the bad one "For lumpy prints" and put it away.</p>
</li>
<li><p>If the problem persists on the printer where it first occurred, despite swapping filament reels, the issue probably has something to do with the printer. Remove and examine the nozzle, and consider replacing it even if it looks OK. Nozzles are cheap and easy to replace, so this is an easy early step.</p>
</li>
<li><p>If a new nozzle doesn't fix it, other parts related to the extruder like the hot end thermistor, fans, heater block, etc. could be to blame. If the thermistor is just positioned a little differently than on the "good" printer, for example, it might be reading a little low and causing the nozzle to heat up more to get to the target reading. That doesn't necessarily mean that you have to replace those parts; you just need to recognize the difference and compensate for it when you use that printer. Just as a baker might think "the recipe says 400 °F, but I know my oven runs hot, so I'll use 375 °F instead," you may need to adjust the nozzle temperature to compensate for the hardware differences when you use this printer.</p>
</li>
</ol>
|
<p>Maybe it's only about the slicer settings, it's over extruding problem. I recommend lowering the extrusion multiplier.</p>
| 1,898
|
<p>We need to optimize the text rendering for a C# <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="noreferrer">Windows Forms</a> application displaying a large number of small strings in an irregular grid. At any time there can be well over 5000 cells visible that update 4 times per second. The font family and size is consistent across the cells, though the color may vary from cell to cell, as will bold/italic/plain.</p>
<p>I've seen conflicting information on the web about <code>TextRenderer.DrawText</code> vs. <code>Graphics.DrawString</code> being the fastest/best, which reduces to a <a href="http://en.wikipedia.org/wiki/Graphics_Device_Interface" rel="noreferrer">GDI</a> vs. <a href="http://en.wikipedia.org/wiki/Graphics_Device_Interface#GDI.2B" rel="noreferrer">GDI+</a> comparison at the <a href="http://en.wikipedia.org/wiki/Windows_API" rel="noreferrer">Win32</a> level. </p>
<p>I've also seen radically different results on Windows XP vs. Windows Vista, but my main target is Windows XP. Articles promising great advances
under <a href="http://en.wikipedia.org/wiki/.NET_Framework_3.0#.NET_Framework_3.0" rel="noreferrer">WinFX</a> and <a href="http://en.wikipedia.org/wiki/DirectX#DirectX_10" rel="noreferrer">DirectX 10</a> aren't helpful here :-)</p>
<p>What's the best approach here? I'm not afraid of introducing a small C++/CLI layer and optimizing device context handling to squeeze out more performance, but I'd like some definitive advice about which direction to take.</p>
<p>EDIT:
Thanks for the initial responses. I'll be trying a combination of background bitmap rendering and sticking with the GDI equivalent calls.</p>
|
<p>A Microsoft developer has posted a <a href="http://blogs.msdn.com/cjacks/archive/2006/05/19/602021.aspx" rel="noreferrer">GDI vs. GDI+ Text Rendering Performance</a> article on his blog which answers the raw speed question: on his system, GDI DrawText was about 6 times faster than GDI+ DrawString.</p>
<p>If you need to be a real speed demon, TextOut is faster than DrawText, but you'll have to take care of clipping and word-wrapping yourself. ExtTextOut supports clipping.</p>
<p>GDI rendering (TextRenderer) will be more consistent with other parts of Windows using GDI; GDI+ tries to be device-independent and so <a href="http://windowsclient.net/articles/gdiptext.aspx" rel="noreferrer">some spacing and emboldening are inconsistent</a>. See the SQL Server 2005 Surface Area Configuration tool for an example of inconsistent rendering.</p>
|
<p>From recent experience, fastest text output is achieved via <code>ExtTextOut</code> with <code>ETO_GLYPH_INDEX</code> flag. This comes at a price, and it’s that you aren’t printing characters anymore, but font glyphs directly. This means that you need to translate your regular character strings to glyph indexes strings prior calling <code>ExtTextOut</code>, either by calling <code>GetCharacterPlacement</code> everytime, or calling this function just once to build your own translation table, that will be valid until a new font is selected in the DC. Remember that glyph indexes are 16bit, so you can store them in a Unicode string and call <code>ExtTextOutW</code> version regardless of original string character size.</p>
| 9,686
|
<p>When using a <code>Zend_Form</code>, the only way to validate that an input is not left blank is to do</p>
<pre><code>$element->setRequired(true);
</code></pre>
<p>If this is not set and the element is blank, it appears to me that validation is not run on the element.</p>
<p>If I do use <code>setRequired()</code>, the element is automatically given the standard NotEmpty validator. The thing is that the error message with this validator sucks, "Value is empty, but a non-empty value is required". I want to change this message. At the moment I have done this by changing the <code>Zend_Validate_NotEmpty</code> class, but this is a bit hacky.</p>
<p>I would ideally like to be able to use my own class (derived from <code>Zend_Validate_NotEmpty</code>) to perform the not empty check.</p>
|
<p>I did it this way (ZF 1.5):</p>
<pre><code>$name = new Zend_Form_Element_Text('name');
$name->setLabel('Full Name: ')
->setRequired(true)
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator($MyNotEmpty);
</code></pre>
<p>so, the addValidator() is the interesting part. The Message is set in an "Errormessage File" (to bundle all custom messages in one file):</p>
<pre><code>$MyNotEmpty = new Zend_Validate_NotEmpty();
$MyNotEmpty->setMessage($trans->translate('err.IS_EMPTY'),Zend_Validate_NotEmpty::IS_EMPTY);
</code></pre>
<p>hope this helps...</p>
|
<p>As far as I can see <a href="http://framework.zend.com/manual/en/zend.form.forms.html#zend.form.forms.validation.errors/" rel="nofollow noreferrer">Changing the error message</a> has no way of changing the message of a specific error. Plus the manual makes it look like like this is a function belonging to Zend_Form, but I get method not found when using it on an instance of Zend_Form.</p>
<p>And example of the useage would be really great.</p>
| 5,521
|
<p>My little site should be pooling list of items from a table using the active user's location as a filter. Think <a href="http://craigslist.org" rel="nofollow noreferrer">Craigslist</a>, where you search for "dvd' but the results are not from all the DB, they are filtered by a location you select. My question has 2 levels:</p>
<ol>
<li>should I go a-la-craigslist, and ask users to use a city level location? My problem with this is that you need to generate what seems to me a hard coded, hand made list of locations. </li>
<li>should I go a-la-zipCode. The idea of just asking the user to type his zipcode, and then pool all items that are in the same or in a certain distance from his zip code.</li>
</ol>
<p>I seem to prefer the zip code way as it seems more elegant solution, but how on earth do one goes about creating a DB of all zip codes and implement the function that given zip code 12345, gets all zipcodes in 1 mile distance?</p>
<p>this should be fairly common "task" as many sites have a need similar to mine, so I am hoping not to re-invent the wheel here.</p>
|
<p>Getting a Zip Code database is no problem. You can try this free one:
<a href="http://zips.sourceforge.net/" rel="nofollow noreferrer">http://zips.sourceforge.net/</a></p>
<p>Although I don't know how current it is, or you can use one of many providers. We have an annual subscription to <a href="http://www.ZipCodeDownload.com" rel="nofollow noreferrer">ZipCodeDownload.com</a>, and for maybe $100 we get monthly updates with the latest Zip Code data complete with Lat/Longs of the centroid of the zip code. </p>
<p>As for querying for all zips within a certain radius, you are going to need a spatial library of some sort. If you just have a table of zips with lats/longs, you will need a database-oriented mechanism. SQL Server 2008 has the capability built in, and there are <a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=MsSqlSpatial" rel="nofollow noreferrer">open source libraries</a> and <a href="http://www.spatialdb.com/default.aspx?AspxAutoDetectCookieSupport=1" rel="nofollow noreferrer">commercial libraries</a> that will add such capabilities to SQL Server 2005. The open source database PostgreSQL has a project, PostGIS that adds this capability to that database. It is here: <a href="http://postgis.refractions.net/" rel="nofollow noreferrer">http://postgis.refractions.net/</a></p>
<p>Other database platforms probably have similar projects, but those are the ones I am aware of. With one of these DB based libraries you should be able to directly query for any zip codes (or any rows of any kind that have lat/long columns) within a given radius.</p>
<p>If you want to go a different route you can use spatial tools with a mapping library. There are open source options here as well, such as <a href="http://www.codeplex.com/SharpMap" rel="nofollow noreferrer">SharpMap</a> and <a href="http://opensourcegis.org/" rel="nofollow noreferrer">many others</a> (<a href="http://www.google.com/search?q=Open+Source+GIS+tools" rel="nofollow noreferrer">Google can help out</a>) that can use the free Tiger maps for the united states as the data source. However, this route is somewhat more complicated and possibly less performant if all you need is a radius search.</p>
<p>Finally, you may want to look into a web service. This, as you say, is a common need, and I imagine there are any number ob web services that you can subscribe to that can provide all zip codes in a given radius from a provided zip code. A quick Google search turned up this:
<a href="http://www.zip-codes.com/free-zip-code-tools.asp#radius" rel="nofollow noreferrer">http://www.zip-codes.com/free-zip-code-tools.asp#radius</a>
But there are <a href="http://www.google.com/search?q=all+zip+codes+in+radius" rel="nofollow noreferrer">MANY resources to be had for the searching</a> on this subject.</p>
|
<blockquote>
<p>how on earth do one [...] implement the function that given zip code 12345, gets all zipcodes in 1 mile distance?</p>
</blockquote>
<p>Here is a sample on how to do that:</p>
<p><a href="http://www.codeproject.com/KB/cs/zipcodeutil.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/zipcodeutil.aspx</a></p>
| 3,389
|
<p>I want to fabricate a sample holder and shadow masks to use in vacuum chambers. The type of printing material is not important to me PLA/ABS/PC-ABS/nylon).</p>
<p>I'm worried that 3d printed objects (FDM) would degas under high vacuum. Is that an actual concern?</p>
|
<p>Almost all of the FDM materials outgas even at normal atmospheric pressure, and, in fact, most plastics outgas. Further, FDM and many other printing processes do not guarantee no internal voids - meaning that putting a 3D printed object into a vacuum may result in breakage, cracking, and possible explosion hazards.</p>
<p>For this reason I would focus only on SLA, as the model is printed within the liquid resin pool and should have a reduced possibility of internal voids.</p>
<p>Finding a resin that has a low out-gas rate after curing, though, is still going to be difficult. </p>
<p>For this to be answered more completely, you need to specify your tolerable outgassing rate, and the processes used inside the vacuum chamber. For instance the answer would be completely different if you are discussing an electron microscope vs a sputtering chamber. As a start you might consider companies that specialize in <a href="http://www.boedeker.com/outgas.htm">engineered materials intended for vacuum use</a>. They may be able to provide guidance as to which of their materials might be 3D printed and usable in your setup.</p>
|
<p>At work, I put a 3d ABS part printed via 3d hubs (5*20*30), in the chamber at 1 mbar. No signs of breakage what so ever. No signs of sudden leaks.</p>
<p>Going anywhere below 1mbar, i.e., to 10^-infinity mbar, I think should theoretically still not cause any breakage or sudden leaks, as the expected mechanism of failure depends on the pressure difference; i.e., [1atm-1mbar] ~=[1atm-10^-infinity mbar].</p>
<p>Based on the above I have made some more parts to be put in a chamber at 1E-5 mbar.</p>
| 108
|
<p>I recently burnt out one of the MOSFETS on my RAMPS 1.4 board on my Sintron Kossel clone so have upgraded it to a RAMPS 1.6.
Now my printer seems to only print 50 % of the intended size.</p>
<p>After the machine homes it only comes down about 50 % of the distance and so starts printing in mid air.</p>
<p>I thought it might have been the driver steps? The DRV 8825 drivers are 32 steps instead of 16. I changed this value in the firmware but it didn't make any difference.</p>
<p>Any suggestions?</p>
|
<p>Data from Firmware is not written into EEPROM on its own after updating your firmware. You need to send a <code>M502</code> to "seed" the firmware numbers as that is restoring the "default" settings in it. If you are unsure what is currently the EEPROM setting, use <code>M503</code> first.</p>
|
<p>If you changed you stepper drivers here's a list to check:</p>
<ol>
<li>Microstepping Jumpers</li>
<li>In Marlin Configuration.h:</li>
</ol>
<ul>
<li><code>X_DRIVER_TYPE</code>, <code>Y_DRIVER_TYPE</code>, <code>Z_DRIVER_TYPE</code> and<br />
<code>E0_DRIVER_TYPE</code></li>
<li><code>DEFAULT_AXIS_STEPS_PER_UNIT</code></li>
<li><code>INVERT_X_DIR</code>, <code>INVERT_Y_DIR</code>, <code>INVERT_Z_DIR</code> and <code>INVERT_E0_DIR</code></li>
</ul>
<ol start="3">
<li>In Marlin Configuration_adv.h:</li>
</ol>
<ul>
<li><code>MINIMUM_STEPPER_POST_DIR_DELAY</code>, <code>MINIMUM_STEPPER_PRE_DIR_DELAY</code>, <code>MINIMUM_STEPPER_PULSE</code>, <code>MAXIMUM_STEPPER_RATE</code></li>
<li>Other driver-specific constants</li>
</ul>
<ol start="4">
<li>EEPROM settings stored on the control board (use <code>M503</code> to read current settings).</li>
</ol>
| 2,164
|
<p>I want to import an oracle dump into a different tablespace.</p>
<p>I have a tablespace A used by User A. I've revoked DBA on this user and given him the grants connect and resource. Then I've dumped everything with the command</p>
<blockquote>
<p>exp a/*** owner=a file=oracledump.DMP log=log.log compress=y</p>
</blockquote>
<p>Now I want to import the dump into the tablespace B used by User B. So I've given him the grants on connect and resource (no DBA). Then I've executed the following import:</p>
<blockquote>
<p>imp b/*** file=oracledump.DMP log=import.log fromuser=a touser=b</p>
</blockquote>
<p>The result is a log with lots of errors:</p>
<blockquote>
<p>IMP-00017: following statement failed with ORACLE error 20001: "BEGIN DBMS_STATS.SET_TABLE_STATS
IMP-00003: ORACLE error 20001 encountered
ORA-20001: Invalid or inconsistent input values</p>
</blockquote>
<p>After that, I've tried the same import command but with the option statistics=none. This resulted in the following errors:</p>
<blockquote>
<p>ORA-00959: tablespace 'A_TBLSPACE' does not exist</p>
</blockquote>
<p>How should this be done?</p>
<p>Note: a lot of columns are of type CLOB. It looks like the problems have something to do with that.</p>
<p>Note2: The oracle versions are a mixture of 9.2, 10.1, and 10.1 XE. But I don't think it has to do with versions.</p>
|
<p>You've got a couple of issues here.</p>
<p><strong>Firstly</strong>, the different versions of Oracle you're using is the reason for the table statistics error - I had the same issue when some of our Oracle 10g Databases got upgraded to Release 2, and some were still on Release 1 and I was swapping .DMP files between them.</p>
<p>The solution that worked for me was to use the same version of <code>exp</code> and <code>imp</code> tools to do the exporting and importing on the different Database instances. This was easiest to do by using the same PC (or Oracle Server) to issue all of the exporting and importing commands.</p>
<p><strong>Secondly</strong>, I suspect you're getting the <code>ORA-00959: tablespace 'A_TBLSPACE' does not exist</code> because you're trying to import a .DMP file from a full-blown Oracle Database into the 10g Express Edition (XE) Database, which, by default, creates a single, predefined tablespace called <code>USERS</code> for you.</p>
<p>If that's the case, then you'll need to do the following..</p>
<ol>
<li><p>With your .DMP file, create a SQL file containing the structure (Tables):</p>
<p><code>imp <xe_username>/<password>@XE file=<filename.dmp> indexfile=index.sql full=y</code></p></li>
<li><p>Open the indexfile (index.sql) in a text editor that can do find and replace over an entire file, and issue the following find and replace statements IN ORDER (ignore the single quotes.. '):</p>
<p><code>Find: 'REM<space>' Replace: <nothing></code></p>
<p><code>Find: '"<source_tablespace>"' Replace: '"USERS"'</code></p>
<p><code>Find: '...' Replace: 'REM ...'</code></p>
<p><code>Find: 'CONNECT' Replace: 'REM CONNECT'</code></p></li>
<li><p>Save the indexfile, then run it against your Oracle Express Edition account (I find it's best to create a new, blank XE user account - or drop and recreate if I'm refreshing):</p>
<p><code>sqlplus <xe_username>/<password>@XE @index.sql</code></p></li>
<li><p>Finally run the same .DMP file you created the indexfile with against the same account to import the data, stored procedures, views etc:</p>
<p><code>imp <xe_username>/<password>@XE file=<filename.dmp> fromuser=<original_username> touser=<xe_username> ignore=y</code></p></li>
</ol>
<p>You may get pages of Oracle errors when trying to create certain objects such as Database Jobs as Oracle will try to use the same Database Identifier, which will most likely fail as you're on a different Database.</p>
|
<p>---Create new tablespace:</p>
<p>CREATE TABLESPACE TABLESPACENAME DATAFILE
'D:\ORACL\ORADATA\XE\TABLESPACEFILENAME.DBF' SIZE 350M AUTOEXTEND ON NEXT 2500M MAXSIZE UNLIMITED
LOGGING
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT MANUAL
FLASHBACK ON;</p>
<p>---and then import with below command</p>
<p>CREATE USER BVUSER IDENTIFIED BY VALUES 'bvuser' DEFAULT TABLESPACE TABLESPACENAME</p>
<p>-- where D:\ORACL is path of oracle installation</p>
| 8,730
|
<p>I am developing a web site and need to see how it will look at different resolutions. The catch is that it must work on our Intranet.</p>
<p>Is there a free solution?</p>
|
<p>For Firefox, Web Developer Toolbar (<a href="https://addons.mozilla.org/en-US/firefox/addon/60" rel="noreferrer">https://addons.mozilla.org/en-US/firefox/addon/60</a>)</p>
|
<p>Also on Internet Explorer 7 is <a href="http://www.ie7pro.com/" rel="nofollow noreferrer">IE7Pro</a>. It also provides some gadgets that aren't in the Developer Toolbar. I have both installed, and use both quite often.</p>
| 8,760
|
<p>I have a <a href="https://www.alunar.net/m508-self-assembly-3d-printer.html" rel="nofollow noreferrer">Alunar M508 machine</a> that I am trying to get new firmware on. The firmware that was loaded on the machine wasn't very good. The x axis was mirrored and the home point was way off. I was looking into Marlin to put on the machine, but don't have any experience on what to edit in the code to make it work for this machine. </p>
<p>Does anyone have any experience with this machine? Uploading new firmware that works or editing the code to make it work for this machine. I appreciate any help!</p>
<p>Here is a link to <a href="https://github.com/camalot/alunar-prusa-i3-marlin-i3-firmware" rel="nofollow noreferrer">the firmware I am currently using</a>. I'm on MacOS Sierra 10.12.5 using the 1.6.8 Arduino IDE.</p>
|
<p>The Alunar firmware you linked is a fork from the main Marlin firmware. If the bed Y direction is reversed, usually the stepper is incorrectly placed (mirrored) this is seen frequently for the Anet A8 printer which is very similar to your printer. In your case the X direction is wrong, this is usually related to the wiring of the stepper, reversing the connector by 180 degrees should do the trick (hardware solution). As a software solution, changing direction is not difficult in Marlin based firmware; you just want to invert the stepper direction; the following section in the configuration.h file does that for you:</p>
<pre><code>// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
#define INVERT_X_DIR false
#define INVERT_Y_DIR false
#define INVERT_Z_DIR true
</code></pre>
<p>Just change <code>INVERT_X_DIR</code> to <code>true</code>.</p>
<p>If your home position is still not working for you, you should look into this section of the same configuration file:</p>
<pre><code>// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS -33
#define Y_MIN_POS -10
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE
#define Z_MAX_POS 240
</code></pre>
<p>Change the <code>MIN_POS</code> positions as such that it starts at the corner of the bed. A more in depth bed center calibration tutorial can be found <a href="https://www.thingiverse.com/thing:2280529" rel="nofollow noreferrer">here</a>.</p>
<hr>
<p>P.S. Please <strong>do not print</strong> <code>anti-wobble caps for the Z-axis rods</code> (as mentioned in another answer), these are <strong>not reducing the wobble</strong>, in fact they cause problems. What happens if you constrain the top is that you get a <a href="https://en.wikipedia.org/wiki/Statically_indeterminate" rel="nofollow noreferrer">statically indeterminate construction</a>; forces and displacements are not predictable! Better solutions to eliminate Z-wobble are lifting devices that decouple X/Y movement from the threaded rod (eccentricity of the threaded rod) from the Z movement. Also fixate the threaded rod above the springy stepper-to-threaded-rod coupler.</p>
|
<p><em>disclaimer</em>: I am the maintainer of the firmware that <a href="https://github.com/camalot/alunar-prusa-i3-marlin-i3-firmware" rel="nofollow noreferrer">you linked</a>. </p>
<hr>
<p>The firmware will not improve your print quality. well, it may to some extent, but for the most part, it wont. </p>
<p>There is fine tuning involved that may be set for MY printer, but the values may need to be changed for you. Not to mention the physical tuning that I have done with my printer. Software is not the place to initially look for print quality improvements.</p>
<p>Some examples:</p>
<p>I printed anti-wobble caps for the Z-axis rods. Which improved the print drastically for me. As the print got higher, the quality got worse.</p>
<p>I printed Z-stop improvements, so I could fine tune the Z-stop.</p>
<p>I printed X & Y belt tensioners. Loose belts cause skipped steps which causes poor quality prints. </p>
| 690
|
<p>I know that <code>M73 P19</code> means "Set completion progress to 19%", and I suspect that <code>M73 R42</code> means "Set remaining time to 42 minutes", but what is <code>M73 Q17 S43</code>? I can't find description of such syntax.</p>
<p>The command is seen in <code>.gcode</code> files produced by PrusaSlicer.</p>
|
<p>The <a href="https://reprap.org/wiki/G-code#M73:_Set.2FGet_build_percentage" rel="nofollow noreferrer"><code>M73</code> Set/Get build percentage G-code</a> is only defined for a selected few printer firmwares.</p>
<p>As you suspected, next to <code>M73 P19</code> (tell the firmware at what completage percentage the print is) the <code>M73 R42</code> tells the firmware the left time to completion.</p>
<p>If you look at the description of the <a href="https://reprap.org/wiki/G-code#M73:_Set.2FGet_build_percentage" rel="nofollow noreferrer"><code>M73</code> G-code</a>, the following parameters may be used:</p>
<ul>
<li><code>P</code>: Percent in normal mode</li>
<li><code>R</code>: Time remaining in normal mode</li>
<li><code>Q</code>: Percent in silent mode</li>
<li><code>S</code>: Time remaining in silent mode</li>
</ul>
<p>So, running the <code>Q</code> and <code>S</code> parameters, is similar to the <code>P</code> and <code>R</code> parameters with the exception for referring to the printer percentage/time when in stealth (quiet) mode.</p>
<p>These modes, normal and stealth, <a href="https://help.prusa3d.com/article/8LLgVlD01q-loud-printer" rel="nofollow noreferrer">refer to power modes of Prusa printers</a>:</p>
<blockquote>
<p><strong>Normal vs. Stealth mode</strong><br>
MK3 printers offer two print modes. Normal mode is required for the detection of lost steps (shifted layers), while still being quieter than the silent mode on MK2/S. There is also the Stealth mode, which utilizes Trinamic StealthChop technology, making the printer almost inaudible with the print cooling fan being the noisiest part of the printer. However, Stealth mode does not provide lost step detection.</p>
</blockquote>
<p>Stealth mode times can be a bit higher than normal mode estimation times. Estimation is done by the slicer. As Prusa maintains this feature, their times are accurate for their printers, but that does not have to be the case for custom printers. </p>
<p>To get the current progress, the <code>M73</code> command is called without parameters:</p>
<blockquote>
<p>Use "M73" by itself to get a report of the current print progress.</p>
</blockquote>
|
<p>The tooltip for "Supports remaining times" under <code>Printer Settings -> General -> Firmware</code>in PrusaSlicer quotes:</p>
<pre><code>Emit M73 P[percent printed] R[remaining time in minutes] at 1 minute intervals
into the G-code to let the firmware show accurate remaining time.
As of now only the Prusa i3 MK3 firmware recognizes M73.
Also the i3 MK3 firmware supports M73 Qxx Sxx for the silent mode.
</code></pre>
<p>Therefore:</p>
<ul>
<li>P = Percentage printed, normal mode</li>
<li>R = Remaining time, normal mode</li>
<li>Q = Percentage printed, silent mode</li>
<li>S = Remaining time, silent mode</li>
</ul>
| 1,509
|
<p>I just purchased this Ender 3 Pro about 1 week ago and since then I've been having nightmares with leveling/tramming the printer bed. From having to tram it again after every print to not being able to level it at all.
Since then I've been reading and watching a lot of problem-related content to try and find a solution.</p>
<p>The two most recommended upgrades were a glass bed and stiffer springs for the bed so that's what I bought. I purchased the original Creality glass bed and the yellow springs and for a day or so I got it to work in an acceptable way but I still had to tram the bed every couple of prints.
Today for some unknown reason, I woke up and I can't seem to get my bed leveled in the middle. I've tried every possible solution that crossed my mind but the middle of the bed is still too far from the nozzle and the filament won't stick.</p>
|
<p>This is an old hotend type, it is called a <a href="https://www.google.com/search?q=j+head+nozzle" rel="noreferrer">J-Head</a> (see e.g. the <a href="https://reprap.org/wiki/J_Head_Nozzle#Mk_V" rel="noreferrer">J-Head Nozzle Mk V</a>, I'm unsure which exact version you have). The hotend is serviceable, you can buy separate "nozzles" (with integrated heater block) for it in <a href="https://www.123-3d.nl/3D-printer-onderdelen/Extruder/J-Head-p388.html" rel="noreferrer">some e-shops</a>. You should be able to unscrew the "nozzle" from the PEEK nozzle holder. The milled flat surfaces indicate that you can use a 13 mm or 1/2" open-end wrench to disassemble the PEEK nozzle holder.</p>
<p>The "nozzle":</p>
<p><a href="https://i.stack.imgur.com/a3MXz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/a3MXz.png" alt="enter image description here" /></a></p>
<p>The instruction to assemble such a hotend are:</p>
<blockquote>
<p><strong>Mk V</strong></p>
<ol>
<li>Secure the brass nozzle in a vise by the heater section.</li>
<li>Wrap a couple of turns of PTFE tape (plumbing tape) around the brass threads.</li>
<li>Screw the nozzle holder down onto the nozzle. If no flats are milled, use a pair of pliers to tighten the nozzle. The nozzle holder can be protected from the pliers by first wrapping it with a rag or paper towel. If there are flats milled, a 13 mm (1/2") open-end wrench can be used to tighten the nozzle.</li>
<li>Remove the brass nozzle from the vise.</li>
<li>Slide the PTFE liner down into the nozzle holder. The PTFE liner needs to be inserted such that the flat end is making contact with the brass and the internally tapered end is towards the top.
Install the washer.</li>
<li>Screw in the hollow-lock socket set screw. Ensure that the washer stays centered while tightening this set screw. Use a piece of filament to ensure that the set screw is not too tight as the liner can become compressed and obstruct the passage. If this happens, slightly loosen the set screw.</li>
</ol>
</blockquote>
<p>To disassemble you need to reverse the order.</p>
<p>You need to ask yourself it you want to change to a newer type of hotend, but generally, these are higher, e.g. compared to a V6:</p>
<p><a href="https://i.stack.imgur.com/2XnBm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2XnBm.png" alt="enter image description here" /></a></p>
|
<p>Not exactly the type of answer you probably want, but this hotend does not look servicable. The nozzle is usually considered a consumable part unless it's made of something like tungsten carbide, or at least steel. The nozzle is almost surely long past its useful life unless the printer was barely used, and the entire hotend has lots of design flaws like very small thermal mass and heat sink butting up against the heater block, which defeats the purpose of having a heat sink.</p>
<p>The right solution here is to figure out what kind of attachment it's supposed to use (dimensions of that groove mount) and buy or put together a replacement hotend.</p>
| 2,210
|
<p>I have a large database and would like to select table names that have a certain column name. I have done something like this in MySQL, but can't find any info on SQL Server.</p>
<p>I want to do something like:</p>
<pre><code>select [table]
from [db]
where table [has column 'classtypeid']
</code></pre>
<p>How can I do something like this?</p>
|
<p>Use the ANSI information_schema views, this will also work in MySQL</p>
<pre><code>select table_name
from information_schema.columns
where column_name = 'classtypeid'
</code></pre>
|
<p>Here you go:</p>
<pre><code>SELECT C.TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS AS C
INNER JOIN INFORMATION_SCHEMA.TABLES AS T ON C.TABLE_NAME = T.TABLE_NAME
AND C.TABLE_SCHEMA = T.TABLE_SCHEMA
WHERE C.COLUMN_NAME = 'classtypeid'
AND T.TABLE_TYPE = 'BASE TABLE'
</code></pre>
<hr>
<p><strong>Edit</strong>: Note that this will not list views based on any tables with that column. If you only query INFORMATION_SCHEMA.COLUMNS you will also get back views.</p>
| 4,768
|
<p>In a drop down list, I need to add spaces in front of the options in the list. I am trying</p>
<pre><code><select>
<option>&#32;&#32;Sample</option>
</select>
</code></pre>
<p>for adding two spaces but it displays no spaces. How can I add spaces before option texts?</p>
|
<p>Isn't <code>&#160</code> the entity for space?</p>
<pre><code><select>
<option>&#160;option 1</option>
<option> option 2</option>
</select>
</code></pre>
<p>Works for me...</p>
<h3>EDIT:</h3>
<p>Just checked this out, there <em>may</em> be compatibility issues with this in older browsers, but all seems to work fine for me here. Just thought I should let you know as you may want to replace with <code>&nbsp;</code></p>
|
<p>I tried several of these examples, but the only thing that worked was using javascript, much like dabobert's, but not jQuery, just plain old vanilla javascript and spaces:</p>
<pre><code>for(var x = 0; x < dd.options.length; x++)
{
item = dd.options[x];
//if a line that needs indenting
item.text = ' ' + item.text; //indent
}
</code></pre>
<p>This is IE only. IE11 in fact. Ugh.</p>
| 4,534
|
<p>I printed a model and now I can't remove it.</p>
<p>I have been chiselling away with a putty knife and made little or no progress. I even heated the bed up to 70 °C. That really didn't seem to help.</p>
<p>Last time, I put it in vice, and tried to free it that way, but instead I broke the glass.</p>
<p>Suggestion?</p>
|
<p>It's useful to know what material you used for the print. Also, you've referenced the glass that broke in the vise, which implies a glass bed, but did you use any adhesive spray or other application?</p>
<p>Allowing for all of this unknown information, there may be a solution for your release. Our library makerspace has a small bottle of 50-50 water/denatured alcohol, although isopropyl alcohol should also work if your glass is not coated with a special film such as PEI. Heat up the surface of the glass to your usual temperature (50-60°C) and apply a few drops of the mixture to the edge of the print.</p>
<p>It will evaporate pretty quickly, but some of it will work under the glass/model interface. Apply a bit more while the glass is still warm. Continue to apply until the the evaporation is no longer accelerated.</p>
<p>Considering the difficulty you are experiencing, it may be necessary to repeat the heating sequence multiple times in order to get enough wicking of the liquid to effect a release.</p>
|
<p>I don't have a glass bed, but I've had a lot of luck with using dental floss to get stuck prints loose. </p>
<p>If you can get the floss under the edge of the print, then you just pull it through to the other side. </p>
<p>This technique takes some practice but works really well once you get the hang of it. </p>
| 1,539
|
<p>Details:</p>
<ul>
<li>Only disable after user clicks the submit button, but before the posting back to the server</li>
<li>ASP.NET Webforms (.NET 1.1)</li>
<li>Prefer jQuery (if any library at all)</li>
<li>Must be enabled if form reloads (i.e. credit card failed)</li>
</ul>
<p>This isn't a necessity that I do this, but if there is a simple way to do it without having to change too much, I'll do it. (i.e. if there isn't a simple solution, I probably won't do it, so don't worry about digging too deep)</p>
|
<p>For all submit buttons, via JQuery, it'd be:</p>
<pre><code>$('input[type=submit]').click(function() { this.disabled = true; });
</code></pre>
<p>Or it might be more useful to do so on form submission:</p>
<pre><code>$('form').submit(function() {
$('input[type=submit]', this).attr("disabled","disabled");
});
</code></pre>
<p>But I think we could give a better answer to your question if we knew a bit more about the context.</p>
<p>If this is an ajax request, then you'll need to make sure you enable submit buttons again on either success or failure.</p>
<p>If this is a standard HTTP form submission (aside from disabling the button with javascript) and you're doing this to safe guard from multiple submissions of the same form, then you ought to have some sort of control in the code that deals with the submitted data, because disabling a button with javascript might not prevent multiple submissions.</p>
|
<p>There are three ways to submit a form that should be covered. Use both David McLaughlin's and Jimmy's suggestions. One will disable the submit button form element while the other disables the basic HTML form submit.</p>
<p>For the third, these won't disable Javascript from doing a form.submit(). The <code>OnSubmit="return false"</code> method only applies when a user clicks the submit button or presses Enter in a input form element. Client side scripting will need to be handled as well.</p>
| 6,810
|
<p>Can you please tell me how much is <code>(-2) % 5</code>?
According to my Python interpreter is 3, but do you have a wise explanation for this?</p>
<p>I've read that in some languages the result can be machine-dependent, but I'm not sure though.</p>
|
<p>By the way: most programming languages would disagree with Python and give the result <code>-2</code>. Depending on the interpretation of modulus this is correct. However, the most agreed-upon mathematical definition states that the modulus of <em>a</em> and <em>b</em> is the (strictly positive) rest <em>r</em> of the division of <em>a</em> / <em>b</em>. More precisely, 0 <= <em>r</em> < <em>b</em> by definition.</p>
|
<p>Well, -2 divided by 5 would be 0 with a remainder of 3. I don't believe that should be very platform dependent, but I've seen stranger things.</p>
| 6,535
|
<p>In Hibernate we have two classes with the following classes with JPA mapping:</p>
<pre><code>package com.example.hibernate
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
@Entity
public class Foo {
private long id;
private Bar bar;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
public Bar getBar() {
return bar;
}
public void setBar(Bar bar) {
this.bar = bar;
}
}
package com.example.hibernate
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
public class Bar {
private long id;
private String title;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
</code></pre>
<p>Now when we load from the database an object from class Foo using session get e.g:</p>
<p>Foo foo = (Foo)session.get(Foo.class, 1 /* or some other id that exists in the DB*/);
the Bar member of foo is a proxy object (in our case javassist proxy but it can be cglib one depending on the bytecode provider you use), that is not initialized.
If you then use session.get to fetch the Bar object that is the member of the Foo class just loaded (we are in the same session), Hibernate does not issue another DB query and fetches the object from the session (first level) cache. The problem is this is a proxy to Bar class which is not initialized and trying to call this object getId() will return 0, and getTitle() will return null.
Our current solution is pretty ugly and checks if the object returned from get is a proxy here is the code (form a generic DAO implementation):</p>
<pre><code>@SuppressWarnings("unchecked")
@Override
@Transactional(readOnly = true)
public <T extends IEntity> T get(Class<T> clazz, Serializable primaryKey) throws DataAccessException {
T entity = (T) currentSession().get(clazz, primaryKey);
if (entity != null) {
if (LOG.isWarnEnabled()) {
LOG.warn("Object not found for class " + clazz.getName() + " with primary key " + primaryKey);
}
} else if (entity instanceof HibernateProxy){ // TODO: force initialization due to Hibernate bug
HibernateProxy proxy = (HibernateProxy)entity;
if (!Hibernate.isInitialized(proxy)) {
Hibernate.initialize(proxy);
}
entity = (T)proxy.getHibernateLazyInitializer().getImplementation();
}
return entity;
}
</code></pre>
<p>Is there a better way to do this, couldn't find a solution in the Hibernate forum, and didn't find the issue in Hibernate's JIRA.</p>
<p>Note: we cannot just use foo.getBar() (which will initialize the proxy properly) to get the Bar class object, because the session.get operation to fetch the Bar object does not know (or care for that matter) that the Bar class is also a lazy member of a Foo object that was just fetched.</p>
|
<p>I had a similar problem:</p>
<ul>
<li>I did Session.save(nastyItem) to save an object into the Session.
However, I did not fill in the property buyer which is mapped as update="false" insert="false" (this happens a lot when you have a composed primary key, then you map the many-to-one's as insert="false" update="false")</li>
<li>I a query to load a list of items, and the item which I just saved, happens to be part of the result set</li>
<li>now what goes wrong? Hibernate sees that the item was already in the cache, and Hibernate does not replace (probably not to break my earlier reference nastyItem) it with the newly loaded value, but uses MY nastyItem I have put into the Session cache myself. Even worse, now the lazy loading of the buyer is broken: it contains null.</li>
</ul>
<p>To avoid these Session issues, I always do a flush and a clear after a save, merge, update or delete. Having to solve these nasty problems takes too much of my time.</p>
|
<p>Not really seen this problem, although we do get intermittent Lazy Load errors - so perhaps we have the same problem, anyway, is it an option to use a different session for the loading of the Bar object - that should load it from scratch, I would expect...</p>
| 8,724
|
<p>I have a large tree of Java Objects in my Desktop Application and am trying to decide on the best way of persisting them as a file to the file system.</p>
<p>Some thoughts I've had were:</p>
<ul>
<li><p><strong>Roll my own serializer using DataOutputStream</strong>: This would give me the greatest control of what was in the file, but at the cost of micromanaging it.</p></li>
<li><p><strong>Straight old Serialization using ObjectOutputStream and its various related classes</strong>: I'm not sold on it though since I find the data brittle. Changing any object's structure breaks the serialized instances of it. So I'm locked in to what seems to be a horrible versioning nightmare.</p></li>
<li><p><strong>XML Serialization</strong>: It's not as brittle, but it's significantly slower that straight out serialization. It can be transformed outside of my program. </p></li>
<li><p><strong>JavaDB</strong>: I'd considered this since I'm comfortable writing JDBC applications. The difference here is that the database instance would only persist while the file was being opened or saved. It's not pretty but... it does lend itself to migrating to a central server architecture if the need arises later and it introduces the possibility of quering the datamodel in a simpler way.</p></li>
</ul>
<p>I'm curious to see what other people think. And I'm hoping that I've missed some obvious, and simpler approach than the ones above.</p>
<hr>
<p>Here are some more options culled from the answers below:</p>
<ul>
<li><strong>An Object Database</strong> - Has significantly less infrastructure than ORM approaches and performs faster than an XML approach. thanks aku</li>
</ul>
|
<p>I would go for the your final option JavaDB (Sun's distribution of <a href="http://db.apache.org/derby" rel="nofollow noreferrer">Derby</a>) and use an object relational layer like <a href="http://hibernate.org" rel="nofollow noreferrer">Hibernate</a> or <a href="http://ibatis.apache.org" rel="nofollow noreferrer">iBatis</a>. Using the first three aproaches means you are going to spend more time building a database engine than developing application features.</p>
|
<p>I think it depends on what you need. Let's see the options:</p>
<p>1) Descarded imediatelly! I'll not even justify. :)</p>
<p>2) If you need a simple, quick, one-method persistence, stick with it. It will persist the complete data graph as it is! Beware of how long you'll be maintaning the persisted objects. As yourself pointed out, versioning can be a problem.</p>
<p>3) Slower than (2), need extra code and can be edited by the user. I would only use it the data is supposed to be used by a client in another language.</p>
<p>4) If you need to query your data in anyway, stick with the DB solution.</p>
<p>Well, I think you had already answered your question :)</p>
| 5,792
|
<p>Does anyone know how to write to an excel file (.xls) via OLEDB in C#? I'm doing the following:</p>
<pre><code> OleDbCommand dbCmd = new OleDbCommand("CREATE TABLE [test$] (...)", connection);
dbCmd.CommandTimeout = mTimeout;
results = dbCmd.ExecuteNonQuery();
</code></pre>
<p>But I get an OleDbException thrown with message:</p>
<blockquote>
<p>"Cannot modify the design of table
'test$'. It is in a read-only
database."</p>
</blockquote>
<p>My connection seems fine and I can select data fine but I can't seem to insert data into the excel file, does anyone know how I get read/write access to the excel file via OLEDB?</p>
|
<p>You need to add <code>ReadOnly=False;</code> to your connection string</p>
<pre><code>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=fifa_ng_db.xls;Mode=ReadWrite;ReadOnly=false;Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\";
</code></pre>
|
<ul>
<li>How do I check the permissions for writing to an excel file for my application (I'm using excel 2007)?</li>
<li>The file is not read only, or protected (to my knowledge).</li>
<li>My connection String is: </li>
</ul>
<blockquote>
<p>"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=fifa_ng_db.xls;Mode=ReadWrite;Extended
Properties=\"Excel
8.0;HDR=Yes;IMEX=1\""</p>
</blockquote>
| 8,242
|
<p>I'm a PHP developer, and I use the MVC pattern and object-oriented code. I really want to write applications for the iPhone, but to do that I need to know Cocoa, but to do that I need to know Objective-C 2.0, but to do that I need to know C, and to do that I need to know about compiled languages (versus interpreted). </p>
<p>Where should I begin?
Do I really need to begin with plain old "C", as Joel would recommend?</p>
<p>Caveat: I like to produce working widgets, not elegant theories.</p>
|
<p>Yes, you're really best off learning C and then Objective-C. There are some resources that will get you over the C and Objective-C language learning curve:</p>
<ul>
<li>Uli Kusterer's online book <a href="http://www.zathras.de/angelweb/masters-of-the-void.htm" rel="noreferrer">Masters of the Void</a></li>
<li>Stephen Kochan's book <a href="https://rads.stackoverflow.com/amzn/click/com/0672325861" rel="noreferrer" rel="nofollow noreferrer">Programming in Objective-C</a></li>
</ul>
<p>And there are some resources that will get you over the framework learning curve:</p>
<ul>
<li>CocoaLab's online book <a href="http://www.cocoalab.com/" rel="noreferrer">Become an Xcoder</a></li>
<li>Aaron Hillegass' book <a href="https://rads.stackoverflow.com/amzn/click/com/0321503619" rel="noreferrer" rel="nofollow noreferrer">Cocoa Programming for Mac OS X</a></li>
</ul>
<p>Despite what Jeff might say, learning C is important for professional software developers for just this reason. It's sort of a baseline low-level <em>lingua franca</em> that other innovation happens atop. The reason Jeff has been able to get away with not learning C is not because you don't need to know C, but because he learned Pascal which is in many ways isomorphic to C. (It has all the same concepts, including pointers and manual memory management.)</p>
|
<p>I think starting with C would be a smart thing to do. After all, Objective-C is C language with some extensions.</p>
<p>To develop in Cocoa you are required to know well how pointers and memory allocation work (there's no garbage collection on the iPhone), plus you will have to use some standard C libraries, <b>because a lot of the frameworks that are used to develop for the iPhone are C libraries</b> not Cocoa libraries. Take for example CoreGraphics, the library you have to use to draw on the screen on the iPhone. That's a C framework, meaning that it is not written in Objective-C.</p>
<p>Of course after learning C to a modest level, you could start reading about Objective-C and Cocoa, and in that case I would start with the <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ObjC.pdf" rel="nofollow noreferrer">Objective-C language specification</a> <b>(link to PDF)</b> and the Aaron Hillegas book on Cocoa.</p>
| 5,375
|
<p>Using the <code>zip</code> function, Python allows for loops to traverse multiple sequences in parallel. </p>
<p><code>for (x,y) in zip(List1, List2):</code></p>
<p>Does MATLAB have an equivalent syntax? If not, what is the best way to iterate over two parallel arrays at the same time using MATLAB?</p>
|
<p>If x and y are column vectors, you can do:</p>
<pre><code>for i=[x';y']
# do stuff with i(1) and i(2)
end
</code></pre>
<p>(with row vectors, just use <code>x</code> and <code>y</code>).</p>
<p>Here is an example run:</p>
<pre class="lang-matlab prettyprint-override"><code>>> x=[1 ; 2; 3;]
x =
1
2
3
>> y=[10 ; 20; 30;]
y =
10
20
30
>> for i=[x';y']
disp(['size of i = ' num2str(size(i)) ', i(1) = ' num2str(i(1)) ', i(2) = ' num2str(i(2))])
end
size of i = 2 1, i(1) = 1, i(2) = 10
size of i = 2 1, i(1) = 2, i(2) = 20
size of i = 2 1, i(1) = 3, i(2) = 30
>>
</code></pre>
|
<p><code>for</code> loops in MATLAB used to be slow, but this is not true anymore.</p>
<p>So vectorizing is not always the miracle solution. Just use the profiler, and <code>tic</code> and <code>toc</code> functions to help you identify possible bottlenecks.</p>
| 7,183
|
<p>I'm pretty sure the answer to this question is no, but in case there's some PHP guru</p>
<p>is it possible to write a function in a way where invalid arguments or non existent variables can be passed in and php will not error without the use of <code>'@'</code></p>
<p>Much like empty and isset do. You can pass in a variable you just made up and it won't error.</p>
<pre><code>ex:
empty($someBogusVar); // no error
myHappyFunction($someBogusVar); // Php warning / notice
</code></pre>
|
<p>Summing up, the proper answer is <strong>no, you shouldn't</strong> (see caveat below). </p>
<p>There are workarounds already mentioned by many people in this thread, like using reference variables or isset() or empty() in conditions and suppressing notices in PHP configuration. That in addition to the obvious workaround, using @, which you don't want.</p>
<p>Summarizing an interesting comment discussion with <a href="https://stackoverflow.com/users/109561/gerry">Gerry</a>: Passing the variable by reference is indeed valid if you <strong>check for the value of the variable inside the function</strong> and handle undefined or null cases properly. Just don't use reference passing as a way of shutting PHP up (this is where my original shouldn't points to).</p>
|
<p>And going further up the abstraction tree, what are you using this for?</p>
<p>You could either initialize those values in each class as appropriate or create a specific class containing all the default values and attributes, like:</p>
<pre><code>class Configuration {
private var $configValues = array( 'cool' => 'Defaultcoolval' ,
'uncool' => 'Defuncoolval' );
public setCool($val) {
$this->configValues['cool'] = $val;
}
public getCool() {
return $this->configValues['cool'];
}
}
</code></pre>
<p>The idea being that, when using defaultValue function everywhere up and down in your code, it will become a maintenance nightmare whenever you have to change a value, looking for all the places where you've put a defaultValue call. And it'll also probably lead you to repeat yourself, violating DRY.</p>
<p>Whereas this is a single place to store all those default values. You might be tempted to avoid creating those setters and getters, but they also help in maintenance, in case it becomse pertinent to do some modification of outputs or validation of inputs.</p>
| 7,877
|
<p>I've been trying to learn Blender as an additional tool for 3D printing (to prepare more organic or freeform models that don't lend themselves to a CAD style workflow I'm more used to), and one point of confusion I've hit is that Blender's default unit is <em>meters</em>, not millimeters. Apparently in older versions its default was an abstract unspecified "units" with metric-like base-10 grid, but no inherent association to physical scale, but now the default is "metric" with meters as the unit. I've found some tutorials <a href="https://www.youtube.com/watch?v=ZI49VIcISaw" rel="nofollow noreferrer">such as this one</a> for switching to millimeters, but it requires making a number of changes that I'm not sure are in line with what folks consider "best practices" for "modeling for 3D printing with Blender".</p>
<p>Is there any consensus on the right way to do this? Are there reasons I should prefer to switch back to the abstract "units", and just treat them as millimeters, versus using "metric" but switching the base unit to "0.0001" (maybe numerical precision reasons?).</p>
<p>I know this question is only borderline on-topic, but I think it is relevant as I'm looking for what the prevailing practice <em>in communities using Blender as a tool for 3D printing</em>, not for opinions of a larger Blender community.</p>
|
<h2>Make sure to set the scale properly for your use case!</h2>
<p>In CAD, you define your measurement space in either Inch or in Millimeter units, and that is your grid. In blender, the native unit is the meter.</p>
<p>This can be easily converted in exporting (remember to set it to scale!), but it is best to just set the measurement scale to actually match what you design: if you want to design a 5 mm hole, set your scale to Millimeters and make sure you export in millimeters. If you want to design in meters (maybe you design a building), then work in meters, and set your export scale in the end so that 1 meter actually is represented as 1 meter - or rather as 1000 millimeters.</p>
<p><a href="https://3dprinting.stackexchange.com/a/7561/8884">The STL in the end will not know the difference</a>: it all is defined in scales of <em>unitary units</em>, and it doesn't even know if it was originally designed in meters, inch or angström. The typical slicer expects the unit to be either millimeters or inch, so any scaling of the exported model that does not result in units equivalent to 1 mm or 24.5 mm is bad procedure - converting between these two types is just scaling the model by 2450%.</p>
<h2>Make sure to design closed manifolds made up of triangles!</h2>
<p>When working with blender, it is very easy to leave the item in a shape that contains multiple intersecting, non-manifold surfaces and areas of inverted surfaces. While <em>interecting shells</em> is not a problem (the slicers can handle those by unionizing the item), the intersection usually covers up the non-manifold areas, making them hard to spot.</p>
<p>As a result, before finalizing your project, I suggest follow this procedure:</p>
<ul>
<li>In Blender, turn on the visual for the normals of surfaces. If an area does not look like a hedgehog after that, the normals in that area are reversed and you need to flip the surfaces there or re-mesh it.</li>
<li>Triangulate the surface using the triangulate modifier. This is to spot artifacts from conversion to STL early and be able to fix them: STL only knows triangles, while blender knows <em>bent</em> n-gons.</li>
<li>Add a new object. A cube with side length 1.</li>
<li>Do a test export to STL with scale 1, which also contains the 1-unit cube as an extra shell.</li>
<li>Import the model into a software such as meshmixer, that has a command to separate shells.</li>
<li>Separate the item to all shells. In Meshmixer this is in analyze, separate shells.</li>
<li>After separating the shells, measure your 1-unit cube. If it is not 1 mm, calculate your scaling factor. It should be a multiple of 10.</li>
<li>Next, you should check each shell for gaps or other errors. In meshmixer, the automatic analyze feature points to these areas with red, blue and magenta lines.</li>
<li>Fix the marked errors in blender, then return to the test export. This time use the proper scaling factor. Repeat until no errors remain.</li>
</ul>
|
<p>It doesn't matter, you scale it in the slicer or elsewhere. You're not going to slice the STL file in Blender. You'll probably need to do more work to get things print ready outside blender anyway.</p>
<p>So when I use blender I don't even bother checking what units it's using. I don't use it for parts design or tech drawing.</p>
| 2,121
|
<p>A friend and I were discussing C++ templates. He asked me what this should do:</p>
<pre><code>#include <iostream>
template <bool>
struct A {
A(bool) { std::cout << "bool\n"; }
A(void*) { std::cout << "void*\n"; }
};
int main() {
A<true> *d = 0;
const int b = 2;
const int c = 1;
new A< b > (c) > (d);
}
</code></pre>
<p>The last line in main has two reasonable parses. Is 'b' the template argument or is <code>b > (c)</code> the template argument? </p>
<p>Although, it is trivial to compile this, and see what we get, we were wondering what resolves the ambiguity?</p>
|
<p>AFAIK it would be compiled as <code>new A<b>(c) > d</code>. This is the only reasonable way to parse it IMHO. If the parser can't assume under normal circumstances a > end a template argument, that would result it much more ambiguity. If you want it the other way, you should have written:</p>
<pre><code>new A<(b > c)>(d);
</code></pre>
|
<p>The greediness of the lexer is probably the determining factor in the absence of parentheses to make it explicit. I'd guess that the lexer isn't greedy.</p>
| 7,575
|
<p>For years, I've been investigating how to create music streams from my computer. I've seen programs, but anything useful I've seen is Windows only (I use a Mac).</p>
<p>Eventually, I got interested in <em>how</em> streams work. Is there any way I could create my <em>own</em> stream, possibly using socket functions in <code>PHP</code>? Is there a <code>PHP</code> library for this?</p>
|
<p>Take a look at <a href="http://ampache.org/" rel="nofollow noreferrer">Ampache</a>. It is a Web-based Open Source Audio file manager. It is implemented with MySQL, and PHP. It allows you to view, edit, and play your audio files via the web.</p>
|
<p>In the end it all boils down to the protocol you'd want to use. Shoutcast IMHO is plain HTTP, so to <em>make</em> your own stream, you just output the streams content.</p>
<p>To make an ogg based webradio work with my Sonos system, I have created a little transcoding wrapper around sox which is is actually written in PHP, so it may be helpful to you to serve as an example.</p>
<p>You'll find it here: <a href="http://www.gnegg.ch/ogg2mp3/" rel="nofollow noreferrer">http://www.gnegg.ch/ogg2mp3/</a></p>
<p>If you are after implementing your very own streaming protocol - maybe even UDP based, then, I'm afraid, PHP may not be the right solution for the problem - at least not as long as it has its share of problems when used for long running processes (which 5.3 may bring some help for with its integrated garbage collection)</p>
| 6,697
|
<p>I'm considering dumping boost as a dependency... atm the only thing that I really need is <code>shared_ptr<></code>, and I can get that from <code>std::tr1</code>, available in gcc suite 4.*</p>
|
<p>It's available on Fedora, installable via "yum" if you didn't pick "Development System" as your default install set. "yum search gcc" to get the package to install.</p>
|
<p>No, on my debian systems I have to install it. But any half-decent system admin should be able to figure out how to install it.</p>
<p>Edit: to be specific it is not always installed by default, but it should be available for most every distro.</p>
| 8,811
|
<p>Given a small set of entities (say, 10 or fewer) to insert, delete, or update in an application, what is the best way to perform the necessary database operations? Should multiple queries be issued, one for each entity to be affected? Or should some sort of XML construct that can be parsed by the database engine be used, so that only one command needs to be issued?</p>
<p>I ask this because a common pattern at my current shop seems to be to format up an XML document containing all the changes, then send that string to the database to be processed by the database engine's XML functionality. However, using XML in this way seems rather cumbersome given the simple nature of the task to be performed.</p>
|
<p>It depends on how many you need to do, and how fast the operations need to run. If it's only a few, then doing them one at a time with whatever mechanism you have for doing single operations will work fine.</p>
<p>If you need to do thousands or more, and it needs to run quickly, you should re-use the connection and command, changing the arguments for the parameters to the query during each iteration. This will minimize resource usage. You don't want to re-create the connection and command for each operation.</p>
|
<p>Most databases support BULK UPDATE or BULK DELETE operations. </p>
| 6,622
|
<p>I've got a web application that I'm trying to optimize. Some of the controls are hidden in dialog-style <code>DIVs</code>. So, I'd like to have them load in via AJAX only when the user wants to see them. This is fine for controls that are mostly literal-based (various menus and widgets), but when I have what I call "dirty" controls - ones that write extensive information to the <code>ViewState</code>, put tons of CSS or script on the page, require lots of references, etc - these are seemingly impossible to move "out of page", especially considering how ASP.NET will react on postback.</p>
<p>I was considering some kind of step where I override Render, find markers for the bits I want to move out and put AJAX placeholders in there, but not only does the server overhead seem extreme, it also feels like a complete hack. Besides, the key element here is the dialog boxes that contain forms with validation controls on them, and I can't imagine how I would move the controls <em>and</em> their required scripts.</p>
<p><strong>In my fevered imagination, I want to do this:</strong></p>
<pre><code>AJAXifier.AJAXify(ctlEditForm);
</code></pre>
<p>Sadly, I know this is a dream. </p>
<p>How close can I really get to a quick-and-easy AJAXification without causing too much load on the server?</p>
|
<p>Check out the <a href="http://www.telerik.com/products/aspnet-ajax/controls/ajax/overview.aspx" rel="noreferrer">RadAjax</a> control from Telerik - it allows you to avoid using UpdatePanels, and limit the amount of info passed back and forth between server and client by declaring direct relationships between calling controls, and controls that should be "Ajaxified" when the calling controls submit postbacks. </p>
|
<p>Step one is to make your "dirty" pieces self contained user controls</p>
<p>Step two is to embed those controls on your consuming page</p>
<p>Step three is to wrap each user control tag in their own Asp:UpdatePanel</p>
<p>Step four is to ensure your control gets the data it needs by having it read from properties which check against the viewstate for pre-existing values. I know this makes your code rely on ugly global variables but it's a fast way to get this done.</p>
<p>Your mileage may vary.</p>
| 2,437
|
<p>What are the main differences when using ABS over PLA and vice versa?</p>
|
<p>Paraphrasing <a href="http://www.protoparadigm.com/news-updates/the-difference-between-abs-and-pla-for-3d-printing/">this</a> site. Feel free to add suggestions in the form of comments and I will try to incorporate them.</p>
<p>Summary</p>
<ul>
<li>ABS: Stronger, machinable, more flexible, and more temperature
resistant than PLA. Typically printed on a heated bed. Warping is a common problem when printing ABS.</li>
<li>PLA: Wider range of filaments available, easier and in some cases faster to print. Not as strong as ABS and the fact that its biodegradable could be seen as both a benefit and a drawback.</li>
</ul>
<p>Material Properties:</p>
<ul>
<li>ABS: Strong plastic with mild flexibility. Naturally beige in color. Can be filled and sanded. Higher temperature. Easy to recycle.</li>
<li>PLA: Not as strong as ABS but more rigid. Naturally transparent. More difficult to fill and sand. Can sag in hot temperatures. Sourced from organic matter so it can be broken down in commercial compost facilities.</li>
</ul>
<p>Part Accuracy:</p>
<ul>
<li>ABS: Part warping is a significant issue. Sharp corners will often be rounded.</li>
<li>PLA: Less heat required contributes to less warping. Becomes more liquid at common extruder temperatures so finer details can be printed.</li>
</ul>
<p>Safety and Handling:</p>
<ul>
<li>ABS: Strong burning/melting plastic smell is present when printing ABS. Health concerns have been raised regarding airborne ultrafine particles generated while printing with ABS (<a href="https://dx.doi.org/10.1016%2Fj.atmosenv.2013.06.050">ref</a>). ABS will absorb moisture causing popping when the moisture enters the hot end. This leads to discontinuities in the print job.</li>
<li>PLA: Doesn't smell as strongly when printing due to its organic nature. Moisture can also be absorbed into PLA and can irreversibly damage it.</li>
</ul>
|
<p>PLA (polylactic acid) melts at a lower temp and does not warp AS BADLY when cooled. It is non-toxic (in USA it comes from cornstarch, beets in some countries, or tapioca root)
It is less flexible than ABS, could rip or crumble.</p>
<p>ABS (Acrylonitrile Butadiene Styrene) is a harder and more sturdy plastic. (What Legos are made of). A heated bed is used to keep it from cooling too fast, as warping can be a problem is you cool it too fast (being close to an exterior door or an air vent) An enclosed printer helps regulate temp and avoids SOME of this problem. Some people get headaches from the smell of molten ABS over a prolonged time. It flexes better than PLA. Can be sanded or cut easily and maintain integrity.</p>
<p>Beware of CHEAP ABS as it may contain a higher amount of HCN (Hydrogen Cyanide)
that can be released when used (but usually around 1 part per million, about one fourth the dangerous limit.)</p>
<p>"GOOD" ABS CAN contain HCN as well, but it is not released by "normal" printing temperatures. (avoid burning ABS or Nylon)</p>
<p>so, all in all:
PLA is safe/non-toxic, biodegradable, uses less energy to print, less flexible.</p>
<p>ABS is harder, sturdier, will last nearly forever (if not bent or stressed or frozen). Somewhat flexible and will snap back. </p>
| 86
|
<p>Why would you do an automatic HTML post rather than a simple redirect?</p>
<p>Is this so developers can automatically generate a login form that posts directory to the remote server when the OpenID is known?</p>
<p>eg.</p>
<ol>
<li>User is not logged in and visits your login page.</li>
<li>You detect the user's openID from a cookie.</li>
<li>Form is generated that directly posts to remote OpenID server.</li>
<li>Remote server redirects user back to website.</li>
<li>Website logs in the user.</li>
</ol>
<p>If this is the case I can see the benefit. However this assumes that you keep the user's openID in a cookie when they log out.</p>
<p>I can find very little information on how this spec should be best implemented.</p>
<p>See HTML FORM Redirection in the official specs:</p>
<p><a href="http://openid.net/specs/openid-authentication-2_0.html#indirect_comm" rel="noreferrer">http://openid.net/specs/openid-authentication-2_0.html#indirect_comm</a></p>
<p>I found this out from looking at the <a href="http://openidenabled.com/php-openid/" rel="noreferrer">PHP OpenID Library</a> (version 2.1.1).</p>
<pre><code>// Redirect the user to the OpenID server for authentication.
// Store the token for this authentication so we can verify the
// response.
// For OpenID 1, send a redirect. For OpenID 2, use a Javascript
// form to send a POST request to the server.
if ($auth_request->shouldSendRedirect()) {
$redirect_url = $auth_request->redirectURL(getTrustRoot(),
getReturnTo());
// If the redirect URL can't be built, display an error
// message.
if (Auth_OpenID::isFailure($redirect_url)) {
displayError("Could not redirect to server: " . $redirect_url->message);
} else {
// Send redirect.
header("Location: ".$redirect_url);
}
} else {
// Generate form markup and render it.
$form_id = 'openid_message';
$form_html = $auth_request->htmlMarkup(getTrustRoot(), getReturnTo(),
false, array('id' => $form_id));
// Display an error if the form markup couldn't be generated;
// otherwise, render the HTML.
if (Auth_OpenID::isFailure($form_html)) {
displayError("Could not redirect to server: " . $form_html->message);
} else {
print $form_html;
}
}
</code></pre>
|
<p>The primary motivation was, as Mark Brackett says, the limits on payload size imposed by using redirects and GET. Some implementations are smart enough to only use POST when the message goes over a certain size, as there are certainly disadvantages to the POST technique. (Chief among them being the fact that your Back button doesn't work.) Other implementations, like the example code you cited, go for simplicity and consistency and leave out that conditional.</p>
|
<p>The same approach is used for the SAML Web Browser SSO profile. The primary motivations of using HTML Post redirection are :</p>
<ul>
<li><p>Virtually unlimited length of the payload : in SAML the payload is a XML document signed with XMLDSig and base64 encoded. It is larger than the usual 1024 characters limitation of URL (a best practice to support not only any browsers but intermediary network devices like Firewall, Reverse Proxy, Load Balancer as well).</p></li>
<li><p>W3C HTTP standard says that GET is idempotent (the same URL GET executed multiple times should always result in same response) and consequently can be cached along the way while POST is not and must reach the URL target. Response of an OpenID HTML Form POST or SAML HTML Form POST should not be cached. It must reach the target in order to initiate the authenticated session.</p></li>
</ul>
<p>You could argue that using a HTTP GET redirection would work as well since the URL query always change and you would be right is practice. However, this would be a workaround of the W3C standard, and therefore, should not be a standard but an alternate implementation whenever both end agree with it.</p>
| 5,493
|
<p>Is there something special about Safari for Windows and AJAX?<br>
In other words: Are there some common pitfalls I should keep in mind?</p>
|
<p>Safari is really standards compliant. Unless you're using some really esoteric browser features, in general if something works in Firefox, I've found it works without modification in Windows Safari.</p>
<p>Apple has <a href="http://developer.apple.com/internet/safari/" rel="nofollow noreferrer">a developer center for web developers</a>, but I didn't find anything too useful there.</p>
|
<p>One word of warning: Safari on Windows does not support XSLT.</p>
| 8,258
|
<p>I'm using the d programing language to write a program, and I'm trying to use ddbg to debug it. When there is an exception, I want to have the program break whenever there is an exception thrown so that I can inspect the stack.</p>
<p>Alternatively, is there another debugger that works with d? Is there another way to get a stack trace when there is an exception?</p>
|
<p>You want to break when there's any exception thrown or just uncaught exceptions? Because I think the latter is already the default behavior.</p>
<p>You probably know this, but you get the stack trace by typing 'us' (unwind stack) at the prompt. Just trying to eliminate the obvious.</p>
<p>Anyway, I've never had to use onex. Never even heard of it. Another thing you could try is forcing execution to stop by putting in asserts.</p>
|
<p>Haven't used ddbg yet, but according to the documentation at <a href="http://ddbg.mainia.de/doc.html" rel="nofollow noreferrer">http://ddbg.mainia.de/doc.html</a> there is the</p>
<blockquote>
<p>onex <cmd; cmd; ...> on exception execute list of commands</p>
</blockquote>
<p>command.</p>
| 6,965
|
<p>I started to write an application that calculates the estimated total print time from the G-code file for an already sliced model.</p>
<p>The program works and it's pretty accurate.</p>
<p>It works as follows: </p>
<ol>
<li>It scans the entire G-code file to identify all of the movements</li>
<li>It calculates the time for each move by dividing segment distance by the speed in mm/s.</li>
</ol>
<p>Let's assume this is the G-code:</p>
<pre><code>G28 ; home all axes
G1 Z0.200 F5400.000
G1 X158.878 Y27.769 E6.65594 F900.000
</code></pre>
<p>This is the calculation it does:</p>
<pre><code>totalTime = 0
# G28 ; home all axes
currentX = 0 mm
currentY = 0 mm
currentZ = 0 mm
# G1 Z0.200 F5400.000
newZ = 0.2 mm
mmPerSecond = 5400 / 60 = 90 mm/s
deltaZ = newZ - currentZ = 0.2 - 0 = 0.2 mm
segmentLength = deltaZ = 0.2 mm
moveTime = segmentLength / mmPerSecond = 0.2 / 90 = 0.002 s
totalTime = totalTime + moveTime = 0 + 0.002 = 0.002 s
# G1 X158.878 Y27.769 E6.65594 F900.000
newX = 158.878 mm
newY = 27.769 mm
mmPerSecond = 900 / 60 = 15 mm/s
deltaX = newX - currentX = 158.878 - 0 = 158.878 mm
deltaY = newY - currentY = 27.769 - 0 = 27.769 mm
segmentLength = square_root(deltaX² + deltaY²) = 161.287 mm
moveTime = deltaZ / mmPerSecond = 161.287 / 15 = 10.755 s
totalTime = totalTime + moveTime = 0.002 + 10.755 = 10.757 s
</code></pre>
<p>In this example, the print will take approximately 10.7 seconds.</p>
<p>More generally, the formula used is, for each movement:</p>
<pre><code>moveTime = segmentLength / mmPerSecond
</code></pre>
<p>By summing up all the move times, we have the total estimated print time.</p>
<p>I've seen that some forums state that the 3D print time also depends on some settings on the 3D printer, especially Acceleration X, Acceleration Y, Acceleration Z, Jerk, and Z-Jerk.</p>
<p>I'd like to make it possible to use those values to more accurately calculate print time; however, I don't understand how those values affect the move time:</p>
<ol>
<li>How should Acceleration and Jerk be considered; and, how do they speed up or slow down the print time? </li>
<li>How should I edit my formula in order to include Acceleration and Jerk in the print time calculation?</li>
</ol>
|
<p>I have tried looking into the printer firmware to see how the <em>Acceleration</em> setting affects the machine movement. From what I could tell, <em>Acceleration</em> seemed to be implemented differently depending on what firmware I looked at and was also affected by what the settings used on the printer were. I didn't look any further because writing different rules for every different firmware seemed like too much trouble. Maybe someone that knows more about this would know if most firmware uses the same calculations. </p>
<p>I suspect that the acceleration setting will not make a lot of difference to the time that the print takes. They haven't seemed to make a difference on the small prints that I have done printing with slow speeds. If you were printing larger prints at faster speeds that had long paths where the nozzle had time to accelerate and decelerate then I suspect you would notice a bigger difference with the time.</p>
<p>I have found that the biggest error between the predicted time and the actual time has been the time the machine spends processing the instructions. When printing a model that has a lot of short movements that need to be sent to the printer and they need to be processed and calculated by the printer, I have noticed the printer will pause for a fraction of a second. It is not long enough to see a difference in the printers movements, but it is noticeable enough to hear. I suspect that on cheaper printers this would cause a bigger error than the acceleration. </p>
<p>If someone can find out how the acceleration settings are calculated by the printer and what G-code command can be used to get the acceleration settings out of the printer, I would be really interested in knowing more about this.</p>
|
<p>I have tried looking into the printer firmware to see how the <em>Acceleration</em> setting affects the machine movement. From what I could tell, <em>Acceleration</em> seemed to be implemented differently depending on what firmware I looked at and was also affected by what the settings used on the printer were. I didn't look any further because writing different rules for every different firmware seemed like too much trouble. Maybe someone that knows more about this would know if most firmware uses the same calculations. </p>
<p>I suspect that the acceleration setting will not make a lot of difference to the time that the print takes. They haven't seemed to make a difference on the small prints that I have done printing with slow speeds. If you were printing larger prints at faster speeds that had long paths where the nozzle had time to accelerate and decelerate then I suspect you would notice a bigger difference with the time.</p>
<p>I have found that the biggest error between the predicted time and the actual time has been the time the machine spends processing the instructions. When printing a model that has a lot of short movements that need to be sent to the printer and they need to be processed and calculated by the printer, I have noticed the printer will pause for a fraction of a second. It is not long enough to see a difference in the printers movements, but it is noticeable enough to hear. I suspect that on cheaper printers this would cause a bigger error than the acceleration. </p>
<p>If someone can find out how the acceleration settings are calculated by the printer and what G-code command can be used to get the acceleration settings out of the printer, I would be really interested in knowing more about this.</p>
| 459
|
<p>I was wondering if there is an open source library or algorithm that can expand a non-numeric range. For example, if you have <code>1A</code> to <code>9A</code> you should get </p>
<pre><code>1A, 2A, 3A, 4A, 5A, 6A, 7A, 8A, 9A.
</code></pre>
<p>I've tried Googling for this and the best I could come up with were Regex that would expand numerics with dashes (1-3 becoming 1,2,3).</p>
|
<p>As noted by others, it would be useful to be more specific. I don't think you can expect there to be a library that will generate ranges according to any arbitrary order on string you can come up with.</p>
<p>If you can simply define what the successor of any given string is, then the solutions is quite easy. That is, if you have a successor function <code>S</code> on strings (e.g. with <code>S('3A') = '4A'</code>), then something like the following can be used:</p>
<pre><code>s = initial_string
while s != final_string do
output s
s = S(s)
output s
</code></pre>
<p>Something I have used in the past to generate all strings of a given length <code>l</code> and with given range <code>b</code> to <code>e</code> of characters, is the following piece of (pseudo-)code. It can be easily adapted to a wide range of variations.</p>
<pre><code>// initialise s with b at every position
for i in [0..l) do
s[i] = b
done = false
while not done do
output s
j = 0
// if s[j] is e, reset it to b and "add carry"
while j < l and s[j] == e do
s[j] = b
j = j + 1
if j == l then
done = true
if not done then
s[j] = s[j] + 1
</code></pre>
<p>For example, to start at a specific string you need only the change the initialisation. To set the end you only need to change the behaviour for the inner while to separately handle position <code>l</code> (limiting to the character in the end string on that position and if reached decrementing <code>l</code>).</p>
|
<p>I was trying to leave it somewhat open because the number of possibilities is staggering. I believe this one of those questions that could not be answered 100% here without going through a lot of technical detail about is considered a "good" or "bad" range. I'm just trying to find a jumping point for ideas on how other people have tackled this problem. I was hoping that someone wrote a blog post explaining how they went about it solving this problem or created a whole library to handle this.</p>
| 6,762
|
<p>Just started doing some design. First project was a replacement handle for my angle grinder, so basically a hollow cylinder. I want to reduce the amount of material used in the print. I could sit here and punch holes through the handle with a smaller cylinder, or some other shape etc., but is there an easier way to do this?</p>
<p>It must be a pretty common requirement, just like in the movies where the spies look at a photo and tell the tech to 'enhance ... enhance'. Ideally you could select a surface and overlay some sort of pattern to remove material.</p>
|
<p>Updated to match the improved question format.</p>
<p>There are a few ways to reduce material usage. First is what you have touched on. Which is to reduce the design by punching out holes, and removing all material that does not add anything to the structure. Even better is what you touched on, reducing it to the point where your print is more like a suspension bridge, where it is a the bare minimum scaffolding in a geometric pattern. </p>
<p>Most tools you will find for reduction are like <a href="http://www.shapeways.com/tutorials/polygon_reduction_with_meshlab" rel="nofollow noreferrer">this tutorial from Shapeways on Meshlab</a> where you reduce the surface detail. It might be worth exploring these a bet, however probably not what you really need.</p>
<p>Next the more hard core cad tools such as solid works will allow you to preform <a href="http://feaforall.com/reduce-cad-design-cost-using-simulation/#" rel="nofollow noreferrer">Parametric optimizations and Topology Optimization.</a>
Topology Optimization. seems to be your real winner</p>
<p><a href="https://i.stack.imgur.com/8Vmod.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8Vmod.png" alt="Topology Optimization example"></a></p>
<p>Now from the 3d printer standpoint we just simply tweak our slicer settings. There are entries for Infill. I usually print with 7% infill. AKA my print is 93% hollow inside. I then set a few solid shell layers. Think of solid shells as the skin. Usually that is enough to reduce my plastic usage. The only reason I don't make a part 100% hollow and a few solid skin / shell layers is that I need something to print on top of or if I need the part to be strong . Even low percent infill can be very strong if the correct geometric pattern is used (I.E. triangles).</p>
<p>Generally the reduced infill will be enough, unless you are making thousands of this item, though in that case you are probably not going to 3d print it anyways.</p>
<p><a href="https://i.stack.imgur.com/SHLTZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SHLTZ.jpg" alt="enter image description here"></a></p>
<p><a href="http://3dprintingforbeginners.com/infill-strength/" rel="nofollow noreferrer">3dprintingforbeginners</a> has a nice article on the relationship between infill, number of shells and part strength. A bit more information about the terminology (infill/shells/etc...) can be found on <a href="http://3dprinting-blog.com/tag/what-is-infill/" rel="nofollow noreferrer">3D printing blog</a>.</p>
|
<p>"<em>Just like the movies</em>"-type tech typically means <strong><em>$$$</em></strong>. </p>
<p>For those who do not own (legally or otherwise) expensive CAD software, it may be difficult to find an out-of-the-box solution. That's not to say that it can't be done.</p>
<p>A close, readily available, solution would be to use a series of common CAD tools such as Shell and Scale. Between these functions, you should be able to scale a copy of your main solid object, then shell the new inner object. When sliced, the object should have a smaller "inner wall" and a hollow center. I would recommend this over 0% infill as a shell will not provide enough strength for the intended use you mentioned.</p>
<p>There is a <a href="http://my3dmatter.com/influence-infill-layer-height-pattern/" rel="noreferrer">great article on My3DMatter.com</a> that provides details and a very interesting set of charts, outlining cost, speed, strength, and quality distributions at varying layer heights and infills.</p>
<p><strong><em>Please Note:</em></strong> These results are going to <strong><em>differ</em> between different material types, vendors, part shape, and infill pattern</strong>. These results were found printing from a MakerBot Replicator and presumably MakerBot-branded filament.</p>
<p><a href="https://i.stack.imgur.com/zpBXa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zpBXa.png" alt="Infill vs. Layer Height Comparisons"></a></p>
| 454
|
<p>I am displaying a list of items using a SAP ABAP column tree model, basically a tree of folder and files, with columns.</p>
<p>I want to load the sub-nodes of folders dynamically, so I'm using the EXPAND_NO_CHILDREN event which is firing correctly.</p>
<p>Unfortunately, after I add the new nodes and items to the tree, the folder is automatically collapsing again, requiring a second click to view the sub-nodes.
Do I need to call a method when handling the event so that the folder stays open, or am I doing something else wrong?</p>
<pre><code>* Set up event handling.
LS_EVENT-EVENTID = CL_ITEM_TREE_CONTROL=>EVENTID_EXPAND_NO_CHILDREN.
LS_EVENT-APPL_EVENT = GC_X.
APPEND LS_EVENT TO LT_EVENTS.
CALL METHOD GO_MODEL->SET_REGISTERED_EVENTS
EXPORTING
EVENTS = LT_EVENTS
EXCEPTIONS
ILLEGAL_EVENT_COMBINATION = 1
UNKNOWN_EVENT = 2.
SET HANDLER GO_APPLICATION->HANDLE_EXPAND_NO_CHILDREN
FOR GO_MODEL.
...
* Add new data to tree.
CALL METHOD GO_MODEL->ADD_NODES
EXPORTING
NODE_TABLE = PTI_NODES[]
EXCEPTIONS
ERROR_IN_NODE_TABLE = 1.
CALL METHOD GO_MODEL->ADD_ITEMS
EXPORTING
ITEM_TABLE = PTI_ITEMS[]
EXCEPTIONS
NODE_NOT_FOUND = 1
ERROR_IN_ITEM_TABLE = 2.
</code></pre>
|
<p>It's been a while since I've played with SAP, but I always found the SAP Library to be particularly helpful when I got stuck...</p>
<p>I managed to come up with this one for you:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/47/aa7a18c80a11d3a6f90000e83dd863/frameset.htm" rel="nofollow noreferrer">http://help.sap.com/saphelp_nw04/helpdata/en/47/aa7a18c80a11d3a6f90000e83dd863/frameset.htm</a>, specifically: </p>
<blockquote>
<p><em>When you add new nodes to the tree model, set the flag ITEMSINCOM to 'X'.<br />
This informs the tree model that you want to load the items for that node on demand.</em></p>
</blockquote>
<p>Hope it helps?</p>
|
<p>Your code looks fine,</p>
<p>I would use the method <code>ADD_NODES_AND_ITEMS</code> myself if I were to add nodes and items ;)</p>
<p>Beyond that, try to call <code>EXPAND_NODE</code> after you added the items/nodes and see if that helps.</p>
| 2,911
|
<p>I want to print a object that looks like a flat board with a set of matchbox-like lumps on top of it.</p>
<p>I have written a script that outputs an STL file. To keep the script simple, it creates an object that includes non-manifold edges. To be precise, the board and the boxes are a single model, but each has 6 faces made from 2 triangles. The underside of each matchbox rests on the top of the larger flat board.</p>
<p>If I understand correctly, the top face of the board should be broken up into many smaller triangles to take into account the position of the matchboxes, but coding this by hand (although it might be an interesting Exercise For The Reader) would not be a good use of time. Well-written code that already does this is built into FOSS applications like Blender.</p>
<p>However, Blender cannot merge or fuse shapes that are part of the same object. My current understanding is that I will need to:</p>
<ol>
<li>Provide Blender with multiple objects</li>
<li>Select all the objects</li>
<li>Use Ctrl-J to merge them</li>
<li>Export the world in STL format</li>
</ol>
<p>Is this a valid approach?</p>
<p>If so, my key question is: how do I format the STL file so that Blender will recognize that it contains multiple separate objects?</p>
<p>(I have found references to STL files containing multiple objects, but I have seen nothing in any of the STL files that I have examined that tells me: here is the end of one object and the beginning of another.)</p>
<p>Or should I just be clunky and export two STL files — one for the board and one for all the matchboxes — and then import both into Blender?</p>
<hr>
<p>NOTE: I know that there are free services like <a href="https://service.netfabb.com/login.php" rel="noreferrer">Netfabb</a> that will correct my simple files for me, but I would prefer not to include that in my workflow if possible.</p>
|
<p>Blender imports all STL files as if they are a single object. If you have multiple meshes in the object that you want to be separated, you can press tab to enter edit mode, select the parts that need to be separated, then hit P and separate by selected.</p>
<p>If you want to print those pieces as one part you have to get rid of any internal faces. The easiest way to do that is to select an object and then use the boolean modifier in union mode. Once you have the object that you want to fuse selected and in place, apply the modifier, that should leave you with an object without internal faces.</p>
|
<p>I think there's an easier way to do this - <em>if</em> you're not committed to using Blender, and it sounds as if you're not.</p>
<p>Take a look at <a href="http://www.openscad.org/" rel="nofollow noreferrer">http://www.openscad.org/</a> (which should run anywhere that Blender does). It's very easy to write code to produce your desired shape (in this case it would be a union of cuboids) in OpenSCAD's description language, and then you can use OpenSCAD itself to render that to STL. (It's even possible to automate this from the command line.)</p>
| 736
|
<p>I am attempting to copy a custom struct from kernel space to user space. inside user space errno returns 'bad address'. What is the usual cause of a bad address error?</p>
<pre><code>if(copy_to_user(info, &kernel_info, sizeof(struct prinfo)))
</code></pre>
|
<p>Bad Address error means that the address location that you have given is invalid. With the case you have above I would guess it is because you are passing a copy of <code>info</code> instead of a pointer to <code>info</code>'s memory location.</p>
<p>Looking at the docs, <code>copy_to_user</code> is defined as</p>
<pre><code>copy_to_user(void __user * to, const void * from, unsigned long n);
</code></pre>
<p>So unless your <code>info</code> variable is a pointer I would update your code to be:</p>
<pre><code>if(copy_to_user(&info, &kernel_info, sizeof(struct prinfo)) ) {
//some stuff here i guess
}
</code></pre>
|
<p>I had a same problem while writing a small char driver. All I was doing wrong was the function copy_to_user returns non-zero on failure, so you have to do this..</p>
<pre><code>if(copy_to_user(void *userbuf, void *kernelbuf, long len))
return -EFAULT;
// Continue with code..
</code></pre>
| 8,721
|
<p>I'm new to 3D printing, but I've solved all of my problems except for this rough surface shown in the image of a Benchy print:</p>
<p><a href="https://i.stack.imgur.com/rhJhL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rhJhL.jpg" alt="Benchy showing printing defects"></a></p>
<p>Any suggestions are appreciated.</p>
<ul>
<li>Printer (new): Raptor 2 (400x400x700 mm)</li>
<li>Bed Temp: 65 °C</li>
<li>Extruder Temp: 210 °C</li>
<li>Filament: PLA (1.75 mm) right out of the package (came with printer from
Formbot)</li>
<li>200 degrees extruder; 60-degree hotbed - print success, bow issue
persists. speed: 100</li>
<li>fade height: 0</li>
<li>nozzle: 200</li>
<li>bed: 60</li>
<li>fan speed: 255</li>
<li>flow: 100 probe offset: -1.4</li>
</ul>
<p><a href="https://i.stack.imgur.com/hxVrS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hxVrS.jpg" alt="Best results so far: 200°, 60° hotbed, 50 speed. Best yet settings still need to be tweaked. Not sure where to go?"></a></p>
<p><a href="https://i.stack.imgur.com/5oLV6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5oLV6.jpg" alt="Best results so far: 200°, 60° hotbed, 50 speed. Best yet settings still need to be tweaked. Not sure where to go?"></a></p>
|
<p>You print too hot and probably with not enough cooling. These typical defects are caused by too much heat input into your model. You see this best at the overhang of the bow of Benchy, it should be smooth like the bottom part of the side of your Benchy. It clearly shows heat induced defects. Lower the temperature at least 10 °C. Know that PLA usually is printable at about 190 °C, also 65 °C for the hotbed is quite high, Depending on the surface you could aim for a temperature between 50 - 60 °C,</p>
|
<p>Try to re-compile the gcode, sometimes the slicer "freaks out" whilst writing the file. Which slicer are you using? (Cura, Slic3r, Repetier, etc.)</p>
<p>I sometimes have that errors, and giving that they do seem quite consistent in shape in the pics I would say that's the issue.</p>
| 1,188
|
<p>If I have an XElement that has child elements, and if I remove a child element from the parent, removing all references between the two, will the child XElement have the same namespaces as the parent?</p>
<p>In other words, if I have the following XML:</p>
<pre><code><parent xmlns:foo="abc">
<foo:child />
</parent>
</code></pre>
<p>and I remove the child element, will the child element's xml look like</p>
<pre><code><child xmlns="abc" />
</code></pre>
<p>or like </p>
<pre><code><child />
</code></pre>
|
<p>Sure. Ultimately the image comes from a URL of some sort. Do a view-source on the web page and see what that URL looks like. With a certain amount of reverse-engineering, usage of System.Web.UI.HtmlTextWriter, perhaps an HttpHandler, etc. you should be able to get what you want.</p>
|
<p>Use the ExportToImage method of the ChartControl object .. This is WinForm code, but the same concept should hold true for WebChartControl:</p>
<pre><code> Dim chart As ChartControl = ChartControl1.Clone()
chart.Size = New Size(800, 600)
chart.ExportToImage("file.png", System.Drawing.Imaging.ImageFormat.Png)
</code></pre>
| 6,868
|
<p>On an 8-bit micro controller I would like to do the following:</p>
<pre><code>16bit_integer = another_16bit_integer * 0.997;</code></pre>
<p>with the least possible number of instructions.</p>
|
<p>How about integer arithmetic in 32 bits?</p>
<pre><code>16bit_integer = (int16_t) (another_16bit_integer * (int32_t) 997 / 1000);
</code></pre>
<p>32 bits will be enough to store (INT16_MAX × 997), do the sum on values 1000 times larger then divide back to your 16 bit scale.</p>
|
<p>Precomputed lookup table:</p>
<pre><code>16bit_integer = products[another_16bit_integer];
</code></pre>
| 4,701
|
<p>I'm looking for a strong filament that can handle a large tension load and no bending deformation when a perpendicular force is applied to it. Any suggestions?</p>
|
<p>Carbon or glass fiber reinforced PLA likely has the strongest without deformation. PLA will snap before deforming.</p>
<p>Fiber reinforced ABS is also an option. ABS is stronger but will bend before breaking. </p>
<p>Both are hard on nozzles and may require a stainless steel nozzle.</p>
|
<p>As far as I know, Nylon filaments are among the strongest. I'd look at the technical specs of <a href="http://taulman3d.com/index.html" rel="nofollow">Taulman3D's Filament</a>. They're the only nylon I've ever tried, and I know they have in-depth specs of how their filament holds up. I'm sure you can find other providers, though.</p>
| 381
|
<p>What experience can you share about using multiple AJAX libraries?</p>
<p>There are useful features in Prototype, some in jQuery, the Yahoo library, etc. Is it possible to include all libraries and use what you want from each, do they generally all play nicely together with name spaces, etc. For the sake of speed is there a practical limit to the size/number of libraries to include or is this negligible? Are there pairs that work particularly well together (e.g. Prototype/Scriptaculous) or pairs that don't?</p>
|
<p>You could use all those libraries, but I highly recommend against it. Downloading and executing that much JavaScript will most likely choke the browser and slow down your user's experience. It would be much better from a user's perspective and a developer's to pick one. Less context/architecture switching and less code to maintain.</p>
<p>Like other answers have said, most don't conflict. </p>
<p>See Yahoo!'s <a href="http://developer.yahoo.com/performance/" rel="noreferrer">Exceptional Performance</a> site for more info. </p>
|
<p>Ruby on Rails uses both prototype and Scriptaculous by default, as there is little overlap between the two. I've also used yui snippets in addition to that and have never had a problem. Load times are an issue, but the libraries are usually cached, so it's only on the first page loaded.</p>
| 8,522
|
<p>I'm generating ICalendar (.ics) files.</p>
<p>Using the UID and SEQUENCE fields I can update existing events in Google Calendar and in Windows Calendar <strong><em>BUT NOT</em></strong> in MS Outlook 2007 - it just creates a second event</p>
<p>How do I get them to work for Outlook ?</p>
<p>Thanks</p>
<p>Tom</p>
|
<p>I've continued to do some testing and have now managed to get Outlook to update and cancel events based on the .cs file.</p>
<p>Outlook in fact seems to respond to the rules defined in <a href="https://www.rfc-editor.org/rfc/rfc2446#page-19" rel="nofollow noreferrer">RFC 2446</a></p>
<p>In summary you have to specify</p>
<p><code>METHOD:REQUEST</code> and <code>ORGANIZER:xxxxxxxx</code></p>
<p>in addition to <code>UID</code>: and <code>SEQUENCE:</code></p>
<p>For a cancellation you have to specify <code>METHOD:CANCEL</code></p>
<p>Request/Update Example</p>
<pre><code>BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//SYFADIS//PORTAIL FORMATION//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:TS_229377_MS_262145@syfadis.com
SEQUENCE:5
DTSTAMP:20081106T154911Z
ORGANIZER:catalog@syfadis.com
DTSTART:20081113T164907
DTEND:20081115T170000
SUMMARY:TestTraining
STATUS:CONFIRMED
END:VEVENT
END:VCALENDAR
</code></pre>
<p>Cancel Example;</p>
<pre><code>BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//SYFADIS//PORTAIL FORMATION//FR
METHOD:CANCEL
BEGIN:VEVENT
UID:TS_229377_MS_262145@syfadis.com
SEQUENCE:7
DTSTAMP:20081106T154916Z
ORGANIZER:catalog@syfadis.com
DTSTART:20081113T164907
SUMMARY:TestTraining
STATUS:CANCELLED
END:VEVENT
END:VCALENDAR
</code></pre>
|
<p>I'm using Entourage, so this may not match up exactly with the behavior you're seeing, but I hope it helps.</p>
<p>Using the iCalendar from your reply, Entourage wouldn't even import the data. Using a known-good file, I got it to import, then successfully update. Comparing the two files, the only structural differences are as follows:</p>
<ul>
<li>My known-good doesn't have a <code>VERSION</code> element</li>
<li>My known-good doesn't have a <code>PRODID</code> element</li>
<li>My known-good doesn't have a <code>STATUS</code> element</li>
<li>My known-good doesn't have a <code>SEQUENCE</code> element</li>
</ul>
<p>Since Microsoft's support for open standards tends to lag, I'd suggest trying without the <code>VERSION</code> info.</p>
| 6,733
|
<p>I've run into a strange syntax in <a href="http://boo.codehaus.org/Closures" rel="nofollow noreferrer">Boo Language Guide</a> :</p>
<pre><code>setter = { value | a = value }
</code></pre>
<p>What does the | operator mean?</p>
|
<p>The documentation of Boo seems to be lacking in this area -- it seems that </p>
<pre><code>setter = { value | a = value }
</code></pre>
<p>is shorthand for</p>
<pre><code>setter = def(value):
a = value
</code></pre>
|
<p>That syntax for specifying code blocks (anonymous functions) has been borrowed from <a href="http://blog.codahale.com/2005/11/24/a-ruby-howto-writing-a-method-that-uses-code-blocks/" rel="nofollow noreferrer">Ruby</a> and <a href="http://web.cecs.pdx.edu/~harry/musings/SmalltalkOverview.html#Blocks" rel="nofollow noreferrer">Smalltalk</a></p>
| 5,744
|
<p>Why does the following code not work as I was expecting?</p>
<pre><code><?php
$data = array(
array('Area1', null, null),
array(null, 'Section1', null),
array(null, null, 'Location1'),
array('Area2', null, null),
array(null, 'Section2', null),
array(null, null, 'Location2')
);
$root = array();
foreach ($data as $row) {
if ($row[0]) {
$area = array();
$root[$row[0]] =& $area;
} elseif ($row[1]) {
$section = array();
$area[$row[1]] =& $section;
} elseif ($row[2]) {
$section[] = $row[2];
}
}
print_r($root);
</code></pre>
<p>Expected result:</p>
<pre><code>Array(
[Area1] => Array(
[Section1] => Array(
[0] => Location1
)
)
[Area2] => Array(
[Section2] => Array(
[0] => Location2
)
)
)
</code></pre>
<p>Actual result:</p>
<pre><code>Array(
[Area1] => Array(
[Section2] => Array(
[0] => Location2
)
)
[Area2] => Array(
[Section2] => Array(
[0] => Location2
)
)
)
</code></pre>
|
<p>If you modify your code on two lines as follows:</p>
<pre><code>$area = array();
$section = array();
</code></pre>
<p>to this:</p>
<pre><code>unset($area);
$area = array();
unset($section);
$section = array();
</code></pre>
<p>it will work as expected.</p>
<p>In the first version, <code>$area</code> and <code>$section</code> are acting as "pointers" to the value inside the <code>$root</code> array. If you reset the values first, those variables can then be used to create brand new arrays instead of overwriting the previous arrays.</p>
|
<p>This will also works:</p>
<pre><code>$root[$row[0]] = array();
$area =& $root[$row[0]];
</code></pre>
| 6,448
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.