instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>I was <a href="https://3dprinting.stackexchange.com/questions/1536/what-does-uses-mains-voltage-mean-on-this-200200mm-square-silicone-heater-pad">advised</a> that it would be possible to use an AC SSR to wire up a Mains Based heat bed. Any idea how one would do this with a RAMPs 1.4 board; Also, what do I hook a heated bed of this sort into?</p>
<p>If you take a kettle lead with a wall plug and cut off the other end, it will expose 3 wires: earth, live and neutral. These are <a href="https://en.wikipedia.org/wiki/Electrical_wiring" rel="nofollow">color coded</a> depending on your country, usually earth is green (possibly with yellow stripes), neutral is blue, black, grey or white and live is brown, red or black.</p> <p>The SSR should have 4 terminals: 2 terminals for the switched load (which are interchangeable) and 2 terminals that connect to your electronics, which should be marked negative and positive. These terminals should connect to the negative/positive heated bed output of your electronics. The terminals of the SSR should be clearly marked, and you can verify which terminal is what from the SSR's datasheet.</p> <p>Typically, your heated bed will have two wires for power (which are interchangeable). One of the wires should be connected to neutral. The other wire should go to one of the load terminals of the SSR, while the other load terminal of the SSR should connect to the live wire. It is also acceptable to do it the other way around (neutral to the SSR and live directly to the bed) but this is slightly less neat.</p> <p>Finally, and this step is <em>extremely important</em>, the earth wire of the plug has a protective function: should something fail, metal parts of your printer may become electrified, and shock you when you touch them. To prevent it, you should electrically connect exposed metal parts of your printer (such as the frame, heated bed plate, power supply case, etc...) to earth. This provides a path for the current to flow (and trip the protective RCD breaker) should something go wrong.</p> <p>I would further recommend that you protect your heated bed (particularly if it is a high power model) with a bimetallic thermal switch. These are available in a variety of ratings, and will switch the power to your heated bed off when it goes over a certain temperature. This switch should be wired between the relay and the heated bed, and be mounted on the heated bed so it makes good thermal contact. If you plan to print with the heated bed at 110C, you might get a 120C or 130C thermal switch.</p> <p>As mains voltage can be deadly, you should take appropriate precautions: <em>never</em> work on the printer while it is plugged in, cover any connections (in particular, make sure you buy or print a cover for the SSR's terminals and wrap solder joints in heat shrink or electrical tape) and always treat wires coming out of the SSR as live (even if it is switched off, some current can still flow).</p>
<p>A link to the bed you have/are buying would be very helpful. AC heated beds exist but are fairly uncommon.</p> <p>As <a href="https://3dprinting.stackexchange.com/a/1548/1404">one of the answers</a> in the question you linked notes, the heat bed is probably not actually intended to use the 110 VAC/220 VAC directly from the wall and instead needs either 12 VDC or 24 VDC. If the current it needs is less than 11 A, then it can be connected directly to port D8 on the RAMPS 1.4, where it will take power from a suitably powerful 12/24 VDC supply connected to the 11 A input on the board. A more powerful heater will need an external relay/MOSFET/etc. to control.</p> <p>If you do, in fact, have an AC bed, you can connect a SSR like <a href="http://rads.stackoverflow.com/amzn/click/B0087ZTN08" rel="nofollow noreferrer">this</a> to either D8 or D9 on the RAMPS (D10 could be used, but it would need a supply connected to the 11 A input) making sure the polarity is correct, as long as your RAMPS DC supply voltage is within the input range of the SSR. The linked one is 3–32 VDC, so almost any supply voltage compatible with the RAMPS will work. The AC outputs of the SSR should be connected in series between one side of the bed and the AC hot wire, with the AC neutral wire connected to the other side of the bed so most of the circuit isn't carrying high voltage when off. <a href="https://www.youtube.com/watch?v=TiEwNf1H_Tc" rel="nofollow noreferrer">This</a> video has some useful hints.</p> <p>However, while an AC bed can get you faster heating, will let you use thinner wires, and avoids the need for having a big DC power supply, I would recommend against using a mains voltage bed if you don't know what you're doing—a great deal more care must be taken and there is a serious possibility of injury.</p>
354
<p>My C code snippet takes the address of an argument and stores it in a volatile memory location (preprocessed code):</p> <pre><code>void foo(unsigned int x) { *(volatile unsigned int*)(0x4000000 + 0xd4) = (unsigned int)(&amp;x); } int main() { foo(1); while(1); } </code></pre> <p>I used an SVN version of GCC for compiling this code. At the end of function <code>foo</code> I would expect to have the value <code>1</code> stored in the stack and, at <code>0x40000d4</code>, an address pointing to that value. When I compile without optimizations using the flag <code>-O0</code>, I get the expected ARM7TMDI assembly output (commented for your convenience):</p> <pre><code> .align 2 .global foo .type foo, %function foo: @ Function supports interworking. @ args = 0, pretend = 0, frame = 8 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. sub sp, sp, #8 str r0, [sp, #4] @ 3. Store the argument on the stack mov r3, #67108864 add r3, r3, #212 add r2, sp, #4 @ 4. Address of the stack variable str r2, [r3, #0] @ 5. Store the address at 0x40000d4 add sp, sp, #8 bx lr .size foo, .-foo .align 2 .global main .type main, %function main: @ Function supports interworking. @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 stmfd sp!, {r4, lr} mov r0, #1 @ 1. Pass the argument in register 0 bl foo @ 2. Call function foo .L4: b .L4 .size main, .-main .ident "GCC: (GNU) 4.4.0 20080820 (experimental)" </code></pre> <p>It clearly stores the argument first on the stack and from there stores it at <code>0x40000d4</code>. When I compile with optimizations using <code>-O1</code>, I get something unexpected:</p> <pre><code> .align 2 .global foo .type foo, %function foo: @ Function supports interworking. @ args = 0, pretend = 0, frame = 8 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. sub sp, sp, #8 mov r2, #67108864 add r3, sp, #4 @ 3. Address of *something* on the stack str r3, [r2, #212] @ 4. Store the address at 0x40000d4 add sp, sp, #8 bx lr .size foo, .-foo .align 2 .global main .type main, %function main: @ Function supports interworking. @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 stmfd sp!, {r4, lr} mov r0, #1 @ 1. Pass the argument in register 0 bl foo @ 2. Call function foo .L4: b .L4 .size main, .-main .ident "GCC: (GNU) 4.4.0 20080820 (experimental)" </code></pre> <p>This time the argument is never stored on the stack even though <em>something</em> from the stack is still stored at <code>0x40000d4</code>.</p> <p>Is this just expected/undefined behaviour? Have I done something wrong or have I in fact found a Compiler Bug&trade;?</p>
<p>Once you return from <code>foo()</code>, <code>x</code> is gone, and any pointers to it are invalid. Subsequently using such a pointer results in what the C standard likes to call "undefined behavior," which means the compiler is absolutely allowed to assume you won't dereference it, or (if you insist on doing it anyway) need not produce code that does anything remotely like what you might expect. If you want the pointer to <code>x</code> to remain valid after <code>foo()</code> returns, you must not allocate <code>x</code> on foo's stack, period -- even if you <em>know</em> that in principle, nothing has any reason to clobber it -- because that just isn't allowed in C, no matter how often it happens to do what you expect.</p> <p>The simplest solution might be to make <code>x</code> a local variable in <code>main()</code> (or in whatever other function has a sufficiently long-lived scope) and to pass the address in to foo. You could also make <code>x</code> a global variable, or allocate it on the heap using <code>malloc()</code>, or set aside memory for it in some more exotic way. You can even try to figure out where the top of the stack is in some (hopefully) more portable way and explicitly store your data in some part of the stack, if you're sure you won't be needing for anything else and you're convinced that's what you really need to do. But the method you've been using to do that isn't sufficiently reliable, as you've discovered.</p>
<blockquote> <p>Is this just expected/undefined behaviour? Have I done something wrong or have I in fact found a Compiler Bug™?</p> </blockquote> <p>No bug just the defined behaviour that optimisation options can produce odd code which might not work :)</p> <p>EDIT:</p> <p>If you think you have found a bug in GCC the mailing lists will be glad you dropped by but generally they find some hole in your knowledge is to blame and mock mercilessly :(</p> <p>In this case I think it's probably the -O options attempting shortcuts that break your code that need working around.</p>
4,816
<p>I've build a WCF Service to accept a file and write it to disk. The front-end consists of a page with SWFUpload which is handling the upload on the client side. Apparently, SWFUpload posts the data with a Content Type of: multipart/form-data.</p> <p>I would think this ok but on the Service side I get an error. The error is "ProtocolException" expecting text/xml. I've tried different message encodings in the bindings but nothing seems to work.</p> <p>How can I get this file uploaded using multipart/form-data? </p>
<p>@jdiaz,</p> <p>@JasonS is right, to upload file you need to transfer it as a byte stream. You need to use <a href="http://msdn2.microsoft.com/en-us/library/ms733742.aspx" rel="noreferrer">WCF streaming</a>. For example on how to upload file via WCF see <a href="http://kjellsj.blogspot.com/2007/02/wcf-streaming-upload-files-over-http.html" rel="noreferrer">an article</a> from <a href="http://kjellsj.blogspot.com" rel="noreferrer">http://kjellsj.blogspot.com</a></p>
<p>I believe you are going to have to tranfer the file as a byte array to WCF. You will need to handle the post from SWFUpload and convert to a byte array before sending to your service.</p>
7,425
<p>I would like to write a small program in C# which goes through my jpeg photos and, for example, sorts them into dated folders (using MY dating conventions, dammit...). </p> <p>Does anyone know a relatively easy way to get at the EXIF data such as Date And Time or Exposure programatically? Thanks!</p>
<p>Check out this <a href="https://www.drewnoakes.com/code/exif/" rel="noreferrer">metadata extractor</a>. <strike>It is written in Java but has also been ported to C#.</strike> I have used the Java version to write a small utility to rename my jpeg files based on the date and model tags. Very easy to use.</p> <hr> <p><strong>EDIT</strong> <em>metadata-extractor</em> supports .NET too. It's a very fast and simple library for accessing metadata from images and videos.</p> <p>It fully supports Exif, as well as IPTC, XMP and many other types of metadata from file types including JPEG, PNG, GIF, PNG, ICO, WebP, PSD, ...</p> <pre><code>var directories = ImageMetadataReader.ReadMetadata(imagePath); // print out all metadata foreach (var directory in directories) foreach (var tag in directory.Tags) Console.WriteLine($"{directory.Name} - {tag.Name} = {tag.Description}"); // access the date time var subIfdDirectory = directories.OfType&lt;ExifSubIfdDirectory&gt;().FirstOrDefault(); var dateTime = subIfdDirectory?.GetDateTime(ExifDirectoryBase.TagDateTime); </code></pre> <p>It's available via <a href="https://www.nuget.org/packages/MetadataExtractor/" rel="noreferrer">NuGet</a> and the <a href="https://github.com/drewnoakes/metadata-extractor-dotnet" rel="noreferrer">code's on GitHub</a>.</p>
<p>Recently, I used this <a href="https://products.groupdocs.com/metadata/net" rel="nofollow noreferrer">.NET Metadata API</a>. I have also written a <a href="https://blog.groupdocs.com/2020/05/13/manage-exif-data-in-csharp-net-for-jpeg-png-tiff-webp-images/" rel="nofollow noreferrer">blog post</a> about it, that shows reading, updating, and removing the EXIF data from images using C#.</p> <pre><code>using (Metadata metadata = new Metadata(&quot;image.jpg&quot;)) { IExif root = metadata.GetRootPackage() as IExif; if (root != null &amp;&amp; root.ExifPackage != null) { Console.WriteLine(root.ExifPackage.DateTime); } } </code></pre>
8,307
<p>I understand that there are several ways to blend XNA and WPF within the same application. I find it enticing to use WPF for all GUI and HUD stuff in my XNA games. Does anyone have any practical experience on how well this approach works in real life using .NET 3.5 SP1 ? Any pitfalls (such as the <a href="http://blogs.msdn.com/nickkramer/archive/2005/07/14/438640.aspx" rel="nofollow noreferrer">"airspace problem"</a>)? Any hint on what appoach works best?</p>
<p>There is an addition in 3.5 SP1 that allows better interaction between DirectX and WPF (D3DImage), and one way to get to that is through XNA.</p> <p>Here are some details:</p> <p><a href="http://jmorrill.hjtcentral.com/Default.aspx?tabid=428&amp;EntryID=259" rel="nofollow noreferrer">http://jmorrill.hjtcentral.com/Default.aspx?tabid=428&amp;EntryID=259</a></p>
<p>I personally would advise against trying to do this integration. I know what you're going for ... the ease of defining GUI/HUD elements in WPF greatly outweighs trying to do the same in just plain old XNA. However, think realistically of the time you'll spend trying to enable this scenario vs. how much you'd save if you just did everything "natively" in XNA. Also (and this may not be an issue for you), WPF isn't supported on the xbox or zune ... so you'd be limiting yourself :-)</p>
6,521
<p>My team is developing a new service oriented product with a web front-end. In discussions about what technologies we will use we have settled on running a JBoss application server, and Flex frontend (with possible desktop deployment using Adobe AIR), and web services to interface the client and server.</p> <p>We've reached an impasse when it comes to which server technology to use for our business logic. The big argument is between EJB3 and Spring, with our biggest concerns being scalability and performance, and also maintainability of the code base.</p> <p>Here are my questions:</p> <ol> <li>What are the arguments for or against EJB3 vs Spring? <ul> <li>What pitfalls can I expect with each?</li> <li>Where can I find good benchmark information?</li> </ul></li> </ol>
<p>There won't be much difference between EJB3 and Spring based on Performance. We chose Spring for the following reasons (not mentioned in the question):</p> <ul> <li>Spring drives the architecture in a direction that more readily supports unit testing. For example, inject a mock DAO object to unit test your business layer, or utilize Spring's MockHttpRequest object to unit test a servlet. We maintain a separate Spring config for unit tests that allows us to isolate tests to the specific layers.</li> <li>An overriding driver was compatibility. If you need to support more than one App Server (or eventually want the option to move from JBoss to Glassfish, etc.), you will essentially be carrying your container (Spring) with you, rather than relying on compatibility between different implementations of the EJB3 specification.</li> <li>Spring allows for technology choices for Persistence, object remoting, etc. For example, we are also using a Flex front end, and are using the Hessian protocol for communications between Flex and Spring.</li> </ul>
<p>I think EJB is a good component technology but not a good framework.Spring is the best framework available as of today.So i should consider Spring as the best implementation of JEE in the sense of a framework and my recommendation is to use spring in every project which gives us the flexibility to integrate with any component technology easily .</p>
9,400
<p>I am doing a quad-copter now.</p> <p>I am not sure what color is the best to use for outdoor durability, especially in sunlight.</p> <p>They say PETg is the most durable material amongst cheap ones.</p> <p>But what color to choose: white or transparent? Or it does not matter?</p>
<p>Unless you plan to use your copter outside Earth atmosphere or expected lifetime is more than tenths of years, UV degradation should not be a problem for PETG. Some of the net sources indicate the <strong>possibility</strong> of degradation after significant time of <strong>constant</strong> exposure to outdoor conditions (mostly color change), which sounds mostly like absence of practical experience.</p> <p>Yet if there are any concerns about losing mechanical properties from the sunlight, any opaque lacquer car paint can help to absorb unwanted radiation and add some nicer view to the model. Acrylic paint will also work (tried this once myself) but it may not be suitable for outdoor.</p>
<p>PETG might not be the best for long term UV exposure.</p> <p>According to Midland Plastics, PETG doesn't hold up well in outdoor applications, and is susceptible to UV degradation. Unless you have an outdoor or UV rated PETG product which will have additional chemicals added to it, it may breakdown more quickly than you would expect. (the link I used was : <a href="http://www.midlandplastics.com/srtd_petg.htm" rel="nofollow noreferrer">http://www.midlandplastics.com/srtd_petg.htm</a>)</p> <p>Polycarbonate on the other hand does hold up better in outdoor applications and is better suited for long term exposure to UV light. Most quads and RC products you see that have a nice slick looking shell on them, are made from Polycarbonate. That stuff is usually vacuum formed sheets. It does still breakdown but it is a much stronger material. The downside is that PC requires a higher nozzle temperature, than PETG. (The reprap wiki has more info: <a href="http://reprap.org/wiki/Polycarbonate" rel="nofollow noreferrer">http://reprap.org/wiki/Polycarbonate</a>)</p> <p>That being said PETG is not going to dissolve in sunlight. It will likely last upto a year if not longer depending on usage. If this is your first quad you're making, then odds are you'll have a crash due to hardware failure before excessive UV degradation (at least thats been my experience with prototype aircraft).</p> <p>Good luck!</p>
536
<p>Using <a href="http://www.oracle.com/technology/products/jdev" rel="noreferrer">JDeveloper</a>, I started developing a set of web pages for a project at work. Since I didn't know much about JDev at the time, I ran over to Oracle to follow some tutorials. The JDev tutorials recommended doing <a href="http://www.fileinfo.net/extension/jspx" rel="noreferrer">JSPX</a> instead of <a href="https://java.sun.com/products/jsp" rel="noreferrer">JSP</a>, but didn't really explain why. Are you developing JSPX pages? Why did you decide to do so? What are the pros/cons of going the JSPX route? </p>
<p>The main difference is that a JSPX file (officially called a 'JSP document') may be easier to work with because the requirement for well-formed XML may allow your editor to identify more typos and syntax errors as you type.</p> <p>However, there are also disadvantages. For example, well-formed XML must escape things like less-than signs, so your file could end up with content like:</p> <pre><code>&lt;script type="text/javascript"&gt; if (number &amp;lt; 0) { </code></pre> <p>The XML syntax may also be more verbose.</p>
<p>Also, another problem I have found with JSPX is when you want to use scriptlets. I agree that clean code is generally good and Java logic in the JSP is generally bad but there are certain instances where you want to use a utility function to return a string value or something where a TagLib or the model (request attributes) would be overkill.</p> <p>What are everyone's thoughts regarding scriptlets in JSP?</p>
4,789
<p>Below I have a very simple example of what I'm trying to do. I want to be able to use HTMLDecorator with any other class. Ignore the fact it's called decorator, it's just a name.</p> <pre><code>import cgi class ClassX(object): pass # ... with own __repr__ class ClassY(object): pass # ... with own __repr__ inst_x=ClassX() inst_y=ClassY() inst_z=[ i*i for i in range(25) ] inst_b=True class HTMLDecorator(object): def html(self): # an "enhanced" version of __repr__ return cgi.escape(self.__repr__()).join(("&lt;H1&gt;","&lt;/H1&gt;")) print HTMLDecorator(inst_x).html() print HTMLDecorator(inst_y).html() wrapped_z = HTMLDecorator(inst_z) inst_z[0] += 70 wrapped_z[0] += 71 print wrapped_z.html() print HTMLDecorator(inst_b).html() </code></pre> <p>Output:</p> <pre>Traceback (most recent call last): File "html.py", line 21, in print HTMLDecorator(inst_x).html() TypeError: default __new__ takes no parameters</pre> <p>Is what I'm trying to do possible? If so, what am I doing wrong?</p>
<blockquote> <p>Very close, but then I lose everything from ClassX. Below is something a collegue gave me that does do the trick, but it's hideous. There has to be a better way.</p> </blockquote> <p>Looks like you're trying to set up some sort of proxy object scheme. That's doable, and there are better solutions than your colleague's, but first consider whether it would be easier to just patch in some extra methods. This won't work for built-in classes like <code>bool</code>, but it will for your user-defined classes:</p> <pre><code>def HTMLDecorator (obj): def html (): sep = cgi.escape (repr (obj)) return sep.join (("&lt;H1&gt;", "&lt;/H1&gt;")) obj.html = html return obj </code></pre> <p>And here is the proxy version:</p> <pre><code>class HTMLDecorator(object): def __init__ (self, wrapped): self.__wrapped = wrapped def html (self): sep = cgi.escape (repr (self.__wrapped)) return sep.join (("&lt;H1&gt;", "&lt;/H1&gt;")) def __getattr__ (self, name): return getattr (self.__wrapped, name) def __setattr__ (self, name, value): if not name.startswith ('_HTMLDecorator__'): setattr (self.__wrapped, name, value) return super (HTMLDecorator, self).__setattr__ (name, value) def __delattr__ (self, name): delattr (self.__wraped, name) </code></pre>
<blockquote> <p>Is what I'm trying to do possible? If so, what am I doing wrong?</p> </blockquote> <p>It's certainly possible. What's wrong is that <code>HTMLDecorator.__init__()</code> doesn't accept parameters.</p> <p>Here's a simple example:</p> <pre><code>def decorator (func): def new_func (): return "new_func %s" % func () return new_func @decorator def a (): return "a" def b (): return "b" print a() # new_func a print decorator (b)() # new_func b </code></pre>
5,817
<p>While I grew up using MSWindows, I transitioned to my much-loved Mac years ago. I don't want to start a flame war here on operating systems. I do, however, want a terminal a litle closer to what I'm used to.</p> <p>I'm not asking for full POSIX support - I don't have the patience to install Cygwin - but I miss tabbed terminals, being able to easily cut and paste, and my good friends <code>ls</code>, <code>mkdir</code>, <code>rm</code>, et al. (For these last ones, I could always put .bat files on my path, but that's going to get old fast.)</p> <p>Anybody have a terminal application for MSWindows XP ?</p>
<p>Some more options:</p> <p><a href="http://www.mingw.org" rel="nofollow noreferrer">MSYS</a>: a Minimal SYStem providing a POSIX compatible Bourne shell environment, with a small collection of UNIX command line tools. Primarily developed as a means to execute the configure scripts and Makefiles used to build Open Source software, but also useful as a general purpose command line interface to replace Windows cmd.exe.</p> <p><a href="http://unxutils.sourceforge.net" rel="nofollow noreferrer">GNU utilities for Win32</a>: ports of common GNU utilities to native Win32. In this context, native means the executables do only depend on the Microsoft C-runtime (msvcrt.dll) and not an emulation layer like that provided by Cygwin tools.</p>
<p><a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" rel="nofollow noreferrer">PowerShell</a> is worth looking into. </p>
3,136
<p>How many ServiceContracts can a WCF service have?</p> <p>Specifically, since a ServiceContract is an attribute to an interface, how many interfaces can I code into one WCF web service? Is it a one-to-one?</p> <p>Does it make sense to separate the contracts across multiple web services?</p>
<p>WCF services can have multiple endpoints, each of which can implement a different service contract.</p> <p>For example, you could have a service declared as follows:</p> <pre><code>[ServiceBehavior(Namespace = "DemoService")] public class DemoService : IDemoService, IDoNothingService </code></pre> <p>Which would have configuration along these lines:</p> <pre><code>&lt;service name="DemoService" behaviorConfiguration="Debugging"&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress = "http://localhost/DemoService.svc" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;endpoint address ="" binding="customBinding" bindingConfiguration="InsecureCustom" bindingNamespace="http://schemas.com/Demo" contract="IDemoService"/&gt; &lt;endpoint address ="" binding="customBinding" bindingConfiguration="InsecureCustom" bindingNamespace="http://schemas.com/Demo" contract="IDoNothingService"/&gt; &lt;/service&gt; </code></pre> <p>Hope that helps, but if you were after the theoretical maximum interfaces you can have for a service I suspect it's some crazily large multiple of 2.</p>
<p>A service can theoretically have any number of Endpoints, and each Endpoint is bound to a particular contract, or interface, so it is possible for a single conceptual (and configured) service to host multiple interfaces via multiple endpoints or alternatively for several endpoints to host the same interface.</p> <p>If you are using the ServiceHost class to host your service, though, instead of IIS, you can only associate a single interface per ServiceHost. I'm not sure why this is the case, but it is.</p>
5,166
<p>I just noticed that there is a large amount of tag wiki excerpts edits in the review queue, all of which are of the form:</p> <blockquote> <p>X is for questions about X</p> </blockquote> <p>A tag wiki excerpt should define what a term means <em>to our community</em> specifically and give <em>usage advice</em>. In particular, Stack Exchange offers the following default reason for rejecting an excerpt:</p> <blockquote> <p>Tag excerpts amounting to, "[tag] is for questions about [tag]" are pointless and usually rejected. Excerpts should describe why and when a tag would be used.</p> </blockquote> <p>See the <a href="https://cs.stackexchange.com/help/tag-excerpts">help center</a> for more details on what a tag excerpt should be.</p> <p>While obviously well-intended, I believe such tag wiki excerpts should not be suggested (and/or approved). This post is to serve as a gentle reminder of that.</p>
<p>Tag excerpts should at least try and give a concise definition as to the subject, and provided any usage guidance <em>if necessary.</em></p> <p>Therefore, you need to make sure to address a set of key points:</p> <ul> <li>Is the tag name ambiguous? Will an amateur be able to understand the subject without having to research it? For example, what on earth is <a href="https://3dprinting.stackexchange.com/questions/tagged/abs" class="post-tag" title="show questions tagged &#39;abs&#39;" rel="tag">abs</a>?</li> <li>Can the word have multiple meanings? If yes, you need to be specific as to which meaning you want. For example, <a href="https://3dprinting.stackexchange.com/questions/tagged/health" class="post-tag" title="show questions tagged &#39;health&#39;" rel="tag">health</a> vs <a href="https://3dprinting.stackexchange.com/questions/tagged/safety" class="post-tag" title="show questions tagged &#39;safety&#39;" rel="tag">safety</a></li> <li>Are their cases when the tag should not be used?</li> <li>Likewise, are their cases when the tag should be used?</li> <li>Is the existing excerpt empty? Something is usually better than nothing.</li> </ul> <p>In general, excerpts should provide at least some guidance, even if it may appear to be ridiculously basic. Therefore, interpretation of the rejection reason is critical:</p> <blockquote> <p>Tag excerpts amounting to, "[tag] is for questions about [tag]" are pointless and usually rejected. Excerpts should describe why and when a tag would be used.</p> </blockquote> <p>That's like saying, <em>[abs]: For questions about [abs] filaments.</em> That should probably be rejected.</p> <p>This is better: <em>[abs]: For questions about [abs] filaments - filaments that are used with blah blah printers, and are not toxic for use.</em></p> <p>Or even better: <em>[abs]: For questions about [abs] filaments - filaments that are used with blah blah printers, and are not toxic for use. Not to be confused with [pla] filaments. Do not use this tag if your question does not concern this filament specifically.</em></p> <p>Obviously, I have no idea if abs is even a thing. Anyways, I hope this helps :)</p>
<p>For reference, I would like to propose a copy-paste solution for tags.</p> <p><strong>Usage Guidance</strong></p> <p><code>For questions regarding {insert list of applicable topics} of {Tag Name}.</code></p> <p><strong>Details</strong></p> <pre><code>{Tag name, unabbreviated}: {Definition} Examples: - What is {blah blah blah}? - Where can I find {blah blah blah}? - Why does {blah blah blah}? - How do I {blah blah blah}? </code></pre>
22
<p>I'm attempting to make a DTS package to transfer data between two databases on the same server and I'm getting the following errors. Iv read that the Multiple-step OLE DB operation generated error can occur when you are transferring between different database types and there is loss of precision, but this is not that case here. How do I examine the column meta data?</p> <blockquote> <p>Error: 0xC0202009 at Data Flow Task, piTech [183]: An OLE DB error has occurred. Error code: 0x80040E21. An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".</p> <p>Error: 0xC0202025 at Data Flow Task, piTech [183]: Cannot create an OLE DB accessor. Verify that the column metadata is valid.</p> <p>Error: 0xC004701A at Data Flow Task, DTS.Pipeline: component "piTech" (183) failed the pre-execute phase and returned error code 0xC0202025.</p> </blockquote>
<p>Take a look at the fields's proprieties (type, length, default value, etc.), they should be the same.</p> <p>I had this problem with SQL Server 2008 R2 because the fields's length are not equal.</p>
<p>This error will also occur when trying to do an insert and a field is coded not null and nulls are trying to be inserted.</p>
7,474
<p>How do you reference a bitmap on the stage in flash using actionscript 3?</p> <p>I have a bitmap on the stage in flash and at the end of the movie I would like to swap it out for the next in the sequence before the movie loops. in my library i have 3 images, exported for actionscript, with the class name img1/img2/img3. here is how my layers in flash are set out.</p> <pre><code>layer 5 : mask2:MovieClip layer 4 : img2:Bitmap layer 3 : mask1:MovieClip layer 2 : img1:Bitmap layer 1 : background:Bitmap </code></pre> <p>at the end of the movie I would like to swap img1 with img2, so the movie loops seamlessly, then ideally swap img2 (on layer 4) with img3 and so on until I get to the end of my images.</p> <p>but I can not find out how to reference the images that have already been put on the stage (in design time), any one have any idea of how to do this?</p> <p>The end movie will hopefully load images dynamically from the web server (I have the code for this bit) and display them as well as img1/img2/img3.</p> <p>Any help would be appreciated.</p> <p><strong>EDIT:</strong></p> <p>@<a href="https://stackoverflow.com/questions/43354/how-do-you-reference-a-bitmap-on-the-stage-in-actionscript#43735">81bronco</a> , I tried this but the instance name is greyed out for graphics, it will only allow me to do it with movieclips and buttons. I half got it to work by turning them into moveclips, and clearing the images in the moveclip out before adding a new one (using something simpler to what <a href="https://stackoverflow.com/questions/43354/how-do-you-reference-a-bitmap-on-the-stage-in-actionscript#44347">vanhornRF</a> suggested), but for some odd reason when the mask kicks in the images I cleared out come back for the mask animation.</p>
<p>To reference something on the stage, you need to give the stage instance a name - not give the symbol in the library a class name.</p> <p>Click on the item on the stage and look at the properties panel. There should be a text entry box just above the entry boxes for the item's dimensions. Enter a name there.</p> <p>Elsewhere in your code, you can then refer to that item on stage by it's instance name.</p>
<p>I would probably do something like this in your document class</p> <pre><code>for(var i:int=0; i&lt;numChildren; i++){ trace(getChildAt(i),"This is the child at position "+i); } </code></pre> <p>I do this because I still code in the flash IDE and its debugger is so very painful to get working most of the time it's easier to just trace variables out, so you can either use that for loop to print the object names of the items currently on your stage, or use a debugger program to find the objects as well.</p> <p>Now that you have the children and at what index they actually are at within the stage, you can reference them by calling getChildAt(int), you can removeChildAt(int), you can addChildAt(displayObject, int) and swapChildrenAt(int, int). The int in these arguments would represent the index position that was returned by your trace statement and the displayObject would obviously just represent anything you wanted to add to the stage or parent DisplayObject.</p> <p>Using those 4 commands you should be able to freely re-arrange any movieclips you have on stage so that they will appear to transition seamlessly.</p> <p>@81bronco One should definitely name your assets on stage if you want to uniquely reference them specifically to avoid any confusion if there ends up being a lot of items on stage</p>
6,497
<p>How can I go about generating a Friendly URL in C#? Currently I simple replace spaces with an underscore, but how would I go about generating URL's like Stack Overflow?</p> <p>For example how can I convert:</p> <blockquote> <p>How do I generate a Friendly URL in C#?</p> </blockquote> <p>Into</p> <blockquote> <p>how-do-i-generate-a-friendly-url-in-C</p> </blockquote>
<p>There are several things that could be improved in Jeff's solution, though.</p> <pre><code>if (String.IsNullOrEmpty(title)) return ""; </code></pre> <p>IMHO, not the place to test this. If the function gets passed an empty string, something went seriously wrong anyway. Throw an error or don't react at all.</p> <pre><code>// remove any leading or trailing spaces left over … muuuch later: // remove trailing dash, if there is one </code></pre> <p>Twice the work. Considering that each operation creates a whole new string, this is bad, even if performance is not an issue.</p> <pre><code>// replace spaces with single dash title = Regex.Replace(title, @"\s+", "-"); // if we end up with multiple dashes, collapse to single dash title = Regex.Replace(title, @"\-{2,}", "-"); </code></pre> <p>Again, basically twice the work: First, use regex to replace multiple spaces at once. Then, use regex again to replace multiple dashes at once. Two expressions to parse, two automata to construct in memory, iterate twice over the string, create two strings: All these operations can be collapsed to a single one.</p> <p>Off the top of my head, without any testing whatsoever, this would be an equivalent solution:</p> <pre><code>// make it all lower case title = title.ToLower(); // remove entities title = Regex.Replace(title, @"&amp;\w+;", ""); // remove anything that is not letters, numbers, dash, or space title = Regex.Replace(title, @"[^a-z0-9\-\s]", ""); // replace spaces title = title.Replace(' ', '-'); // collapse dashes title = Regex.Replace(title, @"-{2,}", "-"); // trim excessive dashes at the beginning title = title.TrimStart(new [] {'-'}); // if it's too long, clip it if (title.Length &gt; 80) title = title.Substring(0, 79); // remove trailing dashes title = title.TrimEnd(new [] {'-'}); return title; </code></pre> <p>Notice that this method uses string functions instead of regex functions and char functions instead of string functions whenever possible.</p>
<p>here is a simple function which can convert your string to Url, you just need to pass title or string it will convert it to user friendly Url.</p> <pre><code> public static string GenerateUrl(string Url) { string UrlPeplaceSpecialWords = Regex.Replace(Url, @"&amp;quot;|['"",&amp;?%\.!()@$^_+=*:#/\\-]", " ").Trim(); string RemoveMutipleSpaces = Regex.Replace(UrlPeplaceSpecialWords, @"\s+", " "); string ReplaceDashes = RemoveMutipleSpaces.Replace(" ", "-"); string DuplicateDashesRemove = ReplaceDashes.Replace("--", "-"); return DuplicateDashesRemove.ToLower(); } </code></pre>
5,863
<p>I've been playing around with PETG for the first time, and everything seemingly worked right just from the start - clean prints, no stringing, no bed adhesion problems, no warping or dimensional accuracy problems, etc. As expected it prints a lot like PLA, and as expected, it's less brittle/stands up much better to crushing/impact, <strong>except</strong> that it's really brittle when it comes to inter-layer adhesion. Vertical cylinders that were fairly strong in PLA just snap with no effort as PETG.</p> <p>My particular PETG filament is Sunlu, with recommended print temperature 230-250 °C. I started out with 235 and am now using 250, which does somewhat better. I've used layer heights 0.125 - 0.2 mm.</p> <p>Are these kind of results normal? Is there anything I should be doing to get better adhesion between layers?</p>
<p>What you describe is usually the result of using a too high of a part cooling fan rotational speed. Like ABS, PETG doesn't require much cooling (if needed at all that is). If you do cool too much, layers and perimeters do not bond optimally (you can get string cheese like printed parts on failure). </p> <p><strong>Why should you use cooling for PETG?</strong> Cooling helps cool the deposited filament on small cross sectional parts. If un-cooled, the printed part picks up too much heat and will deform or sag out.</p> <p>In such cases, reduce cooling to 40 % to start with (another option is to print more parts or increase minimal layer time). Note that there are so many print cooling fan constructions, some more effective than others, so you need to tune the print cooling fan speed to your setup. E.g. for an Ultimaker 3E I get good results at 50 % fan speed, for other self-build printers with effective part cooling solutions, 40 % works best (printed several kilometers of 2.85 mm PETG). First few layers don't need any cooling at all.</p>
<p>PETG doesn't bond well if the layers aren't both at a fairly high temperature, as noted by the other answers. As mentioned, try reducing or simply turning off layer cooling. Additionally, try printing at a smaller layer height, or increased line width, to force the layers to bond more effectively. A final solution would possibly be to print a wall around the part, as many people without enclosures do for ABS prints, to keep the part nice and hot until the nozzle can deposit another layer on top. Works best when paired with higher bed temps. I personally had to print PETG around 25 degrees above the "max" recommended temperature to get good layer adhesion on my fleabay i3 clone.</p>
1,325
<p>I'm obviously not talking about a full solution, but just a good starting point for common applications for software architects. It could be for a CMS, e-commerce storefront, address book, etc. A UML diagram is not essential, but a table schema with data types in the least. Thanks!</p>
<p>Check out the <a href="http://databaseanswers.org/data_models/" rel="noreferrer">Library of Free Data Models</a> from DatabaseAnswers.org -- might be a good starting point. I can't vouch for the quality, but there is a lot here...</p>
<p>Open source?</p> <p><a href="https://sourceforge.net/projects/dbuml#item3rd-1" rel="nofollow noreferrer">DB-UML might work for you</a>.</p> <p>EDIT:</p> <p>Oh! The <a href="http://dev.mysql.com/workbench/" rel="nofollow noreferrer">MySQL Workbench</a> is good. </p>
8,257
<p>In a design that I need to prototype, I have a coaxial, rotational joint between 2 cylinders connected to another coaxial rotational joint between 2 cylinders by a hinge. I have attached the individual part files as well as their assembly where you can use your mouse cursor to check how they move. <a href="https://drive.google.com/folderview?id=0B8GACx5kXowlcEwxOWI4REV6OFk&amp;usp=sharing" rel="nofollow noreferrer" title="Click here for the SolidWorks parts and assembly files">Click here for the SolidWorks parts and assembly files</a></p> <p>Initially when I 3d printed them by splitting them in half, the outer tube did not close, even after filing the inner tube sufficiently. <a href="https://i.stack.imgur.com/OjlVJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OjlVJ.jpg" alt="enter image description here"></a></p> <p>Could you tell me an alternative method to get this complicated joint working? I need to 3D print them. I plan to use ABS for the 3D printing.</p> <p>Thanks for your patience :)</p> <p>EDIT: Lubrication: I plan to use grease to lubricate the sliding surfaces.</p> <p>Clearances: I printed them without clearances initially (this is my first ever 3D print and I wanted to know how accurate it would be). I then used Dremel and filing tools to file away about 0.5 mm of both the surfaces. It should have been enough for mating the parts. The gap between the edges of the outer shell while trying to close it around is 3-4 mm which doesn't suggest 3D printing inaccuracy. I suspect that the outer tube isn't circular enough in cross section. It meets the inner tube at the the two ends of the semicircle and not inside its belly (you can see it in the picture). I have already tried the obvious, which is removing material from the surfaces wherever the parts touch. The model seems to be too warped for any success. The parts were printed upwards from the bottom, so it is not the warping due to gravity.</p>
<h3>Consider ball bearings</h3> <p>Depending on the requirements for your joint, I would consider making a design that utilizes <em>ball bearings</em>. With ball bearings, your join will not wear down as quickly, and also move smoothly.</p> <h3>Handling dimensional inaccuracy</h3> <p>The topic of how to achieve dimensional accuracy of FDM printers has already been discussed in <a href="https://3dprinting.stackexchange.com/questions/322/how-to-achieve-dimensional-accuracy-of-printed-parts/">this question</a>. You might want have a look at <a href="https://3dprinting.stackexchange.com/a/357/115">Ryan Carlyle's answer</a> for a specific routine on how to calibrate a Cartesian printer.</p> <p>From the question linked, a summarized approach for handling dimensional inaccuracy could be:</p> <ol> <li>Add any desired tolerances into the joint in your CAD model, without regarding the inaccuracy of the actual printer you will use.</li> <li>Tune your printer and slicer to reproduce those dimensions set by your CAD program.</li> </ol> <p>Generally speaking, the printer settings should handle filament independent dimensional accuracy, while the slicer should be used to account for different characteristics in each filament type. Correcting size through your CAD model is ill-advised, since you should be able to use the same model for multiple printers.</p>
<p>Have you considered to use a service to have the part printed? You can print almost anything in one "pass" using selective laser sintering, typically done in nylon. I am currently un-boxing an SLS printer, so I cannot currently offer to print it, but the capabilities of SLS are substantial for parts of this nature. I've read of entire planetary gearboxes being printed, fully assembled, with appropriate clearances for operation, once removed and "dusted," or cleaned of residual powder.</p> <p>The printer I hope to be assembling soon has 80 micron powder, so the resolution is quite high, although I forget at the moment the x/y/z figures.</p> <p>Do you think such a method would suit your purposes?</p> <p>Edit (add):</p> <p>because FDM printing by nature causes "oozing" especially in the x/y directions, I would not be surprised to learn that your outer piece has a smaller inside diameter than your design has specified. You may have to make adjustments to the design to compensate. Those adjustments would be specific to a particular printer/filament combination as well. Calibration prints would make the task slightly easier.</p>
211
<p>For .net 3.5 SP1, Microsoft have the new client profile which installs only a subset of .net 3.5 SP1 on to Windows XP user's machines.</p> <p>I'm aware of how to make my assemblies client-profile ready. And I've read the articles on how to implement an installer for <a href="http://msdn.microsoft.com/en-us/library/cc656916.aspx" rel="nofollow noreferrer">ClickOnce</a> or <a href="http://msdn.microsoft.com/en-us/library/cc656819.aspx" rel="nofollow noreferrer">MSI</a>.</p> <p>But I've been using Inno Setup for my project so far and I'd like to continue to use it (as an Express user, I can't easily make MSIs), I need to know how to use the client-profile installer in a custom environment.</p> <p>There is <a href="http://msdn.microsoft.com/en-us/library/cc656920.aspx" rel="nofollow noreferrer">an article</a> on a Deployment.xml schema, but no indication of how to write one, package it or anything else. Can someone explain this process? Finding the articles I linked to alone was a painful search experience.</p>
<p>Microsoft has now shipped the Client Profile Configuration Designer (Beta).</p> <p>This designer lets you edit the XML files with some limitations, this isn't a 'Google beta' by any means.</p> <p><a href="http://windowsclient.net/wpf/wpf35/wpf-35sp1-client-profile-config-overview.aspx" rel="nofollow noreferrer">Information and download</a></p>
<p>Can you clarify: Are you trying to write an installer for your app, which depends on the Client-Profile, or are you trying to write a custom installer <em>for</em> the client-profile?</p> <p>I haven't used it personally, but if it's anything like the dotnetfx 1 and 2 msi's, you basically have to just invoke it's executable yourself from your own .exe file, or from an Msi BEFORE the InstallExecuteSequence starts up - you can't "embed" those in your own app, MS go out of their way to tell you not to do that due to suckage of MSI.</p>
3,482
<p>Using C#, I need a class called <code>User</code> that has a username, password, active flag, first name, last name, full name, etc. </p> <p>There should be methods to <em>authenticate</em> and <em>save</em> a user. Do I just write a test for the methods? And do I even need to worry about testing the properties since they are .Net's getter and setters?</p>
<p>Many great responses to this are also on my question: "<a href="https://stackoverflow.com/questions/24965/beginning-tdd-challenges-solutions-recommendations">Beginning TDD - Challenges? Solutions? Recommendations?</a>"</p> <p>May I also recommend taking a look at my <a href="http://cantgrokwontgrok.blogspot.com/2008/09/tdd-getting-started-with-test-driven.html" rel="noreferrer">blog post</a> (which was partly inspired by my question), I have got some good feedback on that. Namely:</p> <blockquote> <p><strong>I Don’t Know Where to Start?</strong></p> <ul> <li>Start afresh. Only think about writing tests when you are writing new code. This can be re-working of old code, or a completely new feature.</li> <li>Start simple. Don’t go running off and trying to get your head round a testing framework as well as being TDD-esque. Debug.Assert works fine. Use it as a starting point. It doesn’t mess with your project or create dependencies.</li> <li>Start positive. You are trying to improve your craft, feel good about it. I have seen plenty of developers out there that are happy to stagnate and not try new things to better themselves. You are doing the right thing, remember this and it will help stop you from giving up.</li> <li>Start ready for a challenge. It is quite hard to start getting into testing. Expect a challenge, but remember – challenges can be overcome.</li> </ul> <p><strong>Only Test For What You Expect</strong></p> <p>I had real problems when I first started because I was constantly sat there trying to figure out every possible problem that could occur and then trying to test for it and fix. This is a quick way to a headache. Testing should be a real YAGNI process. If you know there is a problem, then write a test for it. Otherwise, don’t bother.</p> <p><strong>Only Test One Thing</strong></p> <p>Each test case should only ever test one thing. If you ever find yourself putting “and” in the test case name, you’re doing something wrong.</p> </blockquote> <p>I hope this means we can move on from "getters and setters" :)</p>
<p>I can't speak for C# specificly, but when I write unit tests I test EVERY input, even those the user does not do, that way I know how to prevent my own mistakes.</p>
8,812
<p>PL/SQL is not my native tongue. Oracle supports writing stored procedures in Java. What are the advantages of doing this over writing the stored procedures in PL/SQL</p>
<p>In the Oracle world the general order of development should be:</p> <p>Wherever possible do it purely with SQL. If you need more than SQL do it with PL/SQL. If you need something that PL/SQL can't do, then use Java. If all else fails use C. If you can't do it with C, back slowly away from the problem....</p> <p>PL/SQL stored procedures are an excellent way of moving your business logic to a layer that will be accessible by any integration technology. Business Logic in a Package (don't write stand alone Functions and Procedures - they'll grow over time in an unmanageable way) can be executed by Java, C#, PL/SQL, ODBC and so on.</p> <p>PL/SQL is the fastest way to throw around huge chunks of data outside of pure SQL. The "Bulk Binding" features means it works very well with the SQL engine.</p> <p>Java stored procedures are best for creating functionality that interacts with network or operating system. Examples would be, sending emails, FTP'ing data, outputting to text files and zipping it up, executing host command lines in general.</p> <p>I've never had to code up any C when working with Oracle, but presumably it could be used for integrating with legacy apps.</p>
<p>The answer is <em>NEVER</em>. If you need to write programs to load or process data you need to do it outside of your data tier from another computer on the network.</p> <p>Running external applications directly on your data tier or god forbid in-process with your data tier or the misapplication of external languages when native query languages are a better fit for the job at hand are fine and perfectly acceptable for a small scale custom in-house application. They simply have no place outside of that arena.</p>
9,546
<p>I need to be able to create basic MS Project items (tasks, projects, resources, etc.) programmatically from my app to my Project Server 2003 install, and haven't found any good examples. Can anyone point me to some good references or have some sample code of connecting to the server and creating these items?</p>
<p>Developing against Project Server 2003 isn't the friendliest experience around, but I have worked a little bit with the PDS (Project Data Services) which is SOAP based</p> <p><A HRef="http://msdn.microsoft.com/en-us/library/aa204408(office.11).aspx" rel="nofollow noreferrer"><a href="http://msdn.microsoft.com/en-us/library/aa204408(office.11).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa204408(office.11).aspx</a></A></p> <p>It contains .NET samples there</p>
<p>As far as I know, the only programatic access to PS 2003 is through PWS. </p> <p>I don't know if it would work, but you could try writing a managed extension for Microsoft Project 2003 (The client application) .There <A href="http://msdn.microsoft.com/en-us/library/aa209377(office.11).aspx" rel="nofollow noreferrer">is a managed API for MS Project 2003</a>, and you might be able to leverage that to communicate with the server, get a project and update it all in code.</p> <p>Good luck!</p>
3,925
<p>How do I turn the following 2 queries into 1 query</p> <pre><code>$sql = "SELECT level FROM skills WHERE id = $id LIMIT 1;"; $result = $db-&gt;sql_query($sql); $level = (int) $db-&gt;sql_fetchfield('level'); $db-&gt;sql_freeresult($result); ++$level; $sql = "UPDATE skills SET level = $level WHERE id = $id;"; $result = $db-&gt;sql_query($sql); $db-&gt;sql_freeresult($result); </code></pre> <p>I'm using it in a phpBB mod but the gist is that I grab the level, add one to it then update, it seems that it'd be much easier and faster if I could do it as one query.</p> <p>Edit: <code>$id</code> has already been forced to be an integer, thus no escaping is needed this time.</p>
<p>I get downmodded for this?</p> <pre><code>$sql = "UPDATE skills SET level = level+1 WHERE id = $id"; $result = $db-&gt;sql_query($sql); $db-&gt;sql_freeresult($result); </code></pre> <p>In Teifion's specific case, the phpBB DDL lists that particular field as NOT NULL, so there's no danger of incrementing NULL.</p> <p>In the general case, you should not use NULL to represent zero. Incrementing NULL <em>should</em> give an answer of NULL. If you're the kind of misguided developer who thinks NULL=0, step away from keyboard and find another pastime, you're just making life hard for the rest of us. Of course, this is the computer industry and who are we to say you're wrong? If you're not wrong, use</p> <pre><code>$sql = "UPDATE skills SET level = COALESCE(level,0)+1 WHERE id = $id"; </code></pre> <p>...but let's face it: you're wrong. If everyone starts at level 0, then your DDL should include</p> <pre><code>level INT DEFAULT '0' NOT NULL </code></pre> <p>in case the programmers forget to set it when they create a record. If not everyone starts on level 0, then skip the DEFAULT and force the programmer to supply a value on creation. If some people are beyond levels, for whom having a level is a meaningless thing, then adding one to their level equally has no meaning. In that case, drop the NOT NULL from the DDL.</p>
<p>Mat: That's what pasted in from the question. It hasn't been edited, so I attribute that to a bug in Markdown. But, oddly enough, I have noticed.</p> <p>Also: yes, <code>mysql_escape_string()</code>!</p>
2,768
<p>I get an <code>error: printer halted. (kill() called!</code> Any time I home my machine's X or Y axis. I have just installed a 3D touch auto bed level sensor, ironically it works fine. I was using Sprinter firmware but it doesn't support auto bed level, so thus I'm using Marlin. I am using the latest version of Marlin and it gave me nothing but issues, printer wouldn't move or home at all. I used the latest Marlin 1.1.x bug fix edition (1.1.9) and now everything is working correctly except X and Y homing, the machine throws the <code>error: printer halted. (kill() called!</code> on Repetier-Host.</p> <p>When I use the <code>M119</code> command all endstops (optical, not mechanical) show as open unless triggered, the endstops are working correctly. When I home the X and or Y it will do as it should and stop when it hits the endstop but that is when the errors pop up and the printer freezes/no longer to gives commands without disconnecting and reconnecting to the printer again.</p> <p>If I home my Z axis it will deploy the probe and come down and touch the bed 2x and no error code and I can still manually move the printer around with the program movements after homing Z axis. I'm not sure what would cause this to happen only on X and Y but any help would be appreciated.</p> <p>I use Repetier-Host but I downloaded Printrun just to see what would happen and it shows the exact same effect/errors. I also tried the Marlin bugfix 2.0 and it gave the same errors too.</p>
<p><a href="https://i.stack.imgur.com/gMDDx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gMDDx.png" alt="enter image description here"></a></p> <p>That's a filament cleaner/oiler combo. The black bottle is a variety of machine oil. </p> <p>The effect of oilers on prints is heavily disputed in the community. The suggestion of plant oils is a very bad one as they can create residue that stays in the hotend and create clogs.</p>
<p>For really long Bowden tubes, some people use Teflon lubricant in a cleaner bead.</p> <p>Never used it myself, since I use a small tube my printer with the stepper on top of one of the Z axis steel rod mounting plates (Anet A8).</p> <p>Off topic, but by cooking and being a vaper, I vouch that organic compounds leave gunky residues on hot surfaces/parts.</p>
1,171
<p>I have a project where a .master page was created without a code behind page. Now I want to add a code behind page for this .master page and move the "in page" code to the code behind file. What is the best/easiest way to go about doing this? I'm using Visual Studio 2008.</p>
<p>Create new class file, name it yourmaster.master.cs (Visual Studio will automaticly group it with the .master) and move the code to it, reference it in your masterpage.</p> <p>Then rightclick on your project and click "Convert to Web Application" and Visual Studio will create the designer file.</p>
<p>One way to do it, is to create a new empty masterpage/aspx-file and then copy-paste the code you allready have into that page. That will take care of all the wire-up and creating of code-files.</p>
6,914
<p>I'm looking for a good server/client protocol supported in Python for making data requests/file transfers between one server and many clients. Security is also an issue - so secure login would be a plus. I've been looking into XML-RPC, but it looks to be a pretty old (and possibly unused these days?) protocol.</p>
<p><a href="http://pyro.sf.net" rel="noreferrer">Pyro</a> (Python Remote Objects) is fairly clever if all your server/clients are going to be in Python. I use <a href="http://www.xmpp.org" rel="noreferrer">XMPP</a> alot though since I'm communicating with hosts that are not always Python. XMPP lends itself to being extended fairly easily too.</p> <p>There is an excellent XMPP library for python called <a href="http://pyxmpp.jajcus.net" rel="noreferrer">PyXMPP</a> which is reasonably up to date and has no dependancy on Twisted.</p>
<p>In the RPC field, Json-RPC will bring a big performance improvement over xml-rpc: <a href="http://json-rpc.org/wiki/python-json-rpc" rel="nofollow noreferrer">http://json-rpc.org/wiki/python-json-rpc</a></p>
8,996
<p>Is it possible in C# to have a Struct with a member variable which is a Class type? If so, where does the information get stored, on the Stack, the Heap, or both?</p>
<p>Yes, you can. The pointer to the class member variable is stored <strike>on the stack</strike> with the rest of the struct's values, and the class instance's data is stored on the heap.</p> <p>Structs can also contain class definitions as members (inner classes).</p> <p>Here's some really useless code that at least compiles and runs to show that it's possible:</p> <pre><code>using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { MyStr m = new MyStr(); m.Foo(); MyStr.MyStrInner mi = new MyStr.MyStrInner(); mi.Bar(); Console.ReadLine(); } } public class Myclass { public int a; } struct MyStr { Myclass mc; public void Foo() { mc = new Myclass(); mc.a = 1; } public class MyStrInner { string x = "abc"; public string Bar() { return x; } } } } </code></pre>
<p>It's probably not a recommended practice to do so: see <a href="http://msdn.microsoft.com/en-us/library/ms229017(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms229017(VS.85).aspx</a></p> <blockquote> <p>Reference types are allocated on the heap, and memory management is handled by the garbage collector. </p> <p>Value types are allocated on the stack or inline and are deallocated when they go out of scope. </p> <p>In general, value types are cheaper to allocate and deallocate. However, if they are used in scenarios that require a significant amount of boxing and unboxing, they perform poorly as compared to reference types.</p> </blockquote>
9,419
<p>I am trying to populate a string with a double value using a <code>sprintf</code> like this:</p> <pre><code>sprintf(S, "%f", val); </code></pre> <p>But the precision is being cut off to six decimal places. I need about 10 decimal places for the precision.</p> <p>How can that be achieved?</p>
<p>%[width].[precision]</p> <p>Width should include the decimal point.</p> <p>%8.2 means 8 characters wide; 5 digits before the point and 2 after. One character is reserved for the point.</p> <p>5 + 1 + 2 = 8</p>
<p>For a more complete reference, see the <a href="http://en.wikipedia.org/wiki/Printf#printf_format_placeholders" rel="nofollow noreferrer">Wikipedia <em>printf</em> article, section "printf format placeholders"</a> and <a href="http://en.wikipedia.org/wiki/Printf#1970s:_C.2C_Lisp" rel="nofollow noreferrer">a good example on the same page</a>.</p>
9,513
<p>There are two weird operators in C#:</p> <ul> <li>the <a href="http://msdn.microsoft.com/en-us/library/6x6y6z4d.aspx" rel="noreferrer">true operator</a></li> <li>the <a href="http://msdn.microsoft.com/en-us/library/6292hy1k.aspx" rel="noreferrer">false operator</a></li> </ul> <p>If I understand this right these operators can be used in types which I want to use instead of a boolean expression and where I don't want to provide an implicit conversion to bool.</p> <p>Let's say I have a following class:</p> <pre><code> public class MyType { public readonly int Value; public MyType(int value) { Value = value; } public static bool operator true (MyType mt) { return mt.Value &gt; 0; } public static bool operator false (MyType mt) { return mt.Value &lt; 0; } } </code></pre> <p>So I can write the following code:</p> <pre><code> MyType mTrue = new MyType(100); MyType mFalse = new MyType(-100); MyType mDontKnow = new MyType(0); if (mTrue) { // Do something. } while (mFalse) { // Do something else. } do { // Another code comes here. } while (mDontKnow) </code></pre> <p>However for all the examples above only the true operator is executed. So what's the false operator in C# good for?</p> <p><em>Note: More examples can be found <a href="http://www.java2s.com/Tutorial/CSharp/0160__Operator-Overload/truefalseoperatorforComplex.htm" rel="noreferrer">here</a>, <a href="http://www.java2s.com/Tutorial/CSharp/0160__Operator-Overload/OverloadtrueandfalseforTwoDimension.htm" rel="noreferrer">here</a> and <a href="http://www.java2s.com/Tutorial/CSharp/0160__Operator-Overload/trueandfalseoperator.htm" rel="noreferrer">here</a>.</em></p>
<p>You can use it to override the <code>&amp;&amp;</code> and <code>||</code> operators.</p> <p>The <code>&amp;&amp;</code> and <code>||</code> operators can't be overridden, but if you override <code>|</code>, <code>&amp;</code>, <code>true</code> and <code>false</code> in exactly the right way the compiler will call <code>|</code> and <code>&amp;</code> when you write <code>||</code> and <code>&amp;&amp;</code>.</p> <p>For example, look at this code (from <a href="http://ayende.com/blog/1574/nhibernate-criteria-api-operator-overloading" rel="noreferrer">http://ayende.com/blog/1574/nhibernate-criteria-api-operator-overloading</a> - where I found out about this trick; <a href="http://web.archive.org/web/20080613013350/http://www.ayende.com/Blog/archive/2006/08/04/7381.aspx" rel="noreferrer">archived version</a> by @BiggsTRC):</p> <pre><code>public static AbstractCriterion operator &amp;(AbstractCriterion lhs, AbstractCriterion rhs) { return new AndExpression(lhs, rhs); } public static AbstractCriterion operator |(AbstractCriterion lhs, AbstractCriterion rhs) { return new OrExpression(lhs, rhs); } public static bool operator false(AbstractCriterion criteria) { return false; } public static bool operator true(AbstractCriterion criteria) { return false; } </code></pre> <p>This is obviously a side effect and not the way it's intended to be used, but it is useful.</p>
<p>It appears from the MSDN article you linked to it was provided to allow for nullable boolean types prior to the Nullable (i.e. int?, bool?, etc.) type being introducted into the language in C#2. Thus you would store an internal value indicating whether the value is true or false or null, i.e. in your example >0 for true, &lt;0 for false and ==0 for null, and then you'd get SQL-style null semantics. You would also have to implement a .IsNull method or property in order that nullity could be checked explicitly. </p> <p>Comparing to SQL, imagine a table Table with 3 rows with value Foo set to true, 3 rows with value Foo set to false and 3 rows with value Foo set to null.</p> <pre><code>SELECT COUNT(*) FROM Table WHERE Foo = TRUE OR Foo = FALSE 6 </code></pre> <p>In order to count all rows you'd have to do the following:-</p> <pre><code>SELECT COUNT(*) FROM Table WHERE Foo = TRUE OR Foo = FALSE OR Foo IS NULL 9 </code></pre> <p>This 'IS NULL' syntax would have equivilent code in your class as .IsNull().</p> <p>LINQ makes the comparison to C# even clearer:-</p> <pre><code>int totalCount = (from s in MyTypeEnumerable where s || !s select s).Count(); </code></pre> <p>Imagining that MyTypeEnumberable has exactly the same contents of the database, i.e. 3 values equal to true, 3 values equal to false and 3 values equal to null. In this case totalCount would evaluate to 6 in this case. However, if we re-wrote the code as:-</p> <pre><code>int totalCount = (from s in MyTypeEnumerable where s || !s || s.IsNull() select s).Count(); </code></pre> <p>Then totalCount would evaluate to 9.</p> <p>The DBNull example given in the linked MSDN article on the false operator demonstrates a class in the BCL which has this exact behaviour.</p> <p>In effect the conclusion is you shouldn't use this unless you're completely sure you want this type of behaviour, it's better to just use the far simpler nullable syntax!!</p> <p><strong>Update:</strong> I just noticed you need to manually override the logic operators !, || and &amp;&amp; to make this work properly. I believe the false operator feeds into these logical operators, i.e. indicating truth, falsity or 'otherwise'. As noted in another comment !x won't work off the bat; you have to overload !. Weirdness!</p>
5,331
<p>If I <em>accidentally</em> reverse the polarity of my power supply to the RAMPS board, what <em>exactly</em> will be damaged?</p> <p>Will it harm my:</p> <ul> <li>RAMPS;</li> <li>Arduino Mega;</li> <li>Stepper motor and/or drivers, or; </li> <li>Any other electronic part(s)?</li> </ul> <p>Will all or some of them be permanently damaged?</p>
<h3>Polyfuses on the RAMPS</h3> <p>Fire appears to be the immediate issue, in the poly fuses.</p> <p>From <a href="https://www.reddit.com/r/Reprap/comments/2gpih3/reversed_polarity_ramps_on_fire/" rel="nofollow noreferrer">Reddit: reversed polarity, RAMPS on fire</a></p> <blockquote> <p>Sooo I made the dumb mistake of reversing the polarity from my psu into the RAMPS 1.4. As warned the ramps did not like this and smoke began to rise from the board. I am pretty sure I saw smoke only coming from the two ptc fuses (big flat yellow ones).</p> </blockquote> <h3>Replacing poly fuses</h3> <p>Note: Older RAMPS 1.4 have easily replaceable large poly fuses, whereas the RAMPS 1.5/1.6 use SMD poly fuses, see 0scar's answer to <a href="https://3dprinting.stackexchange.com/questions/5623/ramps-1-4-1-5-or-1-6">RAMPS 1.4, 1.5 or 1.6?</a></p> <hr /> <h3>Arduino</h3> <p>According to <a href="https://www.reddit.com/r/Reprap/comments/2gpih3/reversed_polarity_ramps_on_fire/ckln3ix/" rel="nofollow noreferrer">this user</a>, the MOSFETs <em>and</em> the Arduino Mega's regulator can be fried as well:</p> <blockquote> <p>it most likely fried the mosfets next to the fuses and probably the voltage regulator on your arduino.</p> </blockquote> <p>However, the fried regulator would only affect the Arduino's operation if powered through the power socket, or VIN (which the RAMPS board uses to power the Arduino Mega). However, via the USB it should still work. See <a href="https://www.reddit.com/r/Reprap/comments/2gpih3/reversed_polarity_ramps_on_fire/ckm2rlc/" rel="nofollow noreferrer">this post</a>, on the same thread:</p> <blockquote> <p>The voltage regulator is only needed if you supply power to the arduino via the Vin pin or with a separate power adapter. The RAMPS board does supply the Vin pin with 12V.</p> </blockquote> <p>So, you would probably have to rely on powering the Arduino via the USB and not the RAMPS</p> <p>Regarding the Arduino, on Arduino.SE there are a number of users who have fried their Arduino in this manner, and many of them suffer slightly different failures, although most are centered around the regulator. One case I remember was that of a capacitor burnout, see <a href="https://arduino.stackexchange.com/questions/54006/is-my-arduino-dead">Is my Arduino dead?</a> - although the use case was different. There are many other cases on the Arduino.SE.</p> <hr /> <h3>Protection Diode</h3> <p>According to <a href="https://reprap.org/forum/read.php?13,600886,600893#msg-600893" rel="nofollow noreferrer">this post</a> on <a href="https://reprap.org/forum/read.php?13,600886,600893" rel="nofollow noreferrer">RepRap - Reverse Polarity</a>, there <em>should</em> be a <strong>reverse polarity protection diode</strong> (although it appears not to have work in the above example):</p> <blockquote> <p>If it was a ramps, those have a reverse protection diode across the input that normally needs replaced after such an incident</p> </blockquote> <hr /> <h3>Stepper drivers/motors</h3> <p>The stepper motors themselves should survive, as should the stepper drivers.</p> <p><em><strong>However</strong></em>, each case can be different and it would depend upon the quality of the board (is it a cheap clone or branded?), and the quality/tolerance of the components used - these factors would determine where in the chain of modules the failure occurs. Obviously, the earlier the failure's location in the chain the better.</p> <hr /> <h3>MKS Base v1.2</h3> <p>As an aside, this user fried their regulator (the fuses were fine) on a MKS Base v1.2 (not RAMPS), by reversing the polarity, which caused the stepper drivers to fail. However, replacing the regulator fixed it, see <a href="https://reprap.org/forum/read.php?13,600886,602910#msg-602910" rel="nofollow noreferrer">this post</a>:</p> <blockquote> <p>Replacing the regulator chip did fix the board.</p> </blockquote> <p>Rather helpfully the self same user has posted an Instructables of the repair: <a href="https://www.instructables.com/id/MKS-Base-Reverse-Polarity-Repair/" rel="nofollow noreferrer">MKS Base reverse polarity repair</a>.</p> <hr /> <h3>RAMPSXB</h3> <p>There is no protection diode on the RAMPXB. From <a href="https://reprap.org/wiki/RAMPSXB" rel="nofollow noreferrer">RAMPSXB</a>:</p> <blockquote> <p>Do NOT reverse polarity on the input pins, as there is NO PROTECTION DIODE. Reversing polarity will not only fry your steppers and FETs, but may even damage your Arduino and possibly even your computer. Triple check to make sure the polarity on your power input is 100% correct!</p> </blockquote> <hr /> <h3>See also</h3> <ul> <li><a href="http://forum.arduino.cc/index.php?topic=265478.0" rel="nofollow noreferrer">Arduino Forum: Checking the RAMPS 1.4</a> for some handy troubleshooting tips for the Arduino and the Stepper.</li> </ul> <p>This user on <a href="http://forum.arduino.cc/index.php?topic=265478.msg1872694#msg1872694" rel="nofollow noreferrer">post #5</a> of <a href="http://forum.arduino.cc/index.php?topic=265478.0" rel="nofollow noreferrer">Arduino Forum: Checking the RAMPS 1.4</a> did manage to fry their stepper drivers, but not due to reverse polarity, by from a loose wire:</p> <blockquote> <p>I didnt connect the power backwards, but either I had a defective Mega2560 clone, or some stray bit of wire somehow shorted something out, and the Mega2560 literally went up in smoke (almost caught on fire !)</p> <p>Every stepper driver was destroyed, but the power FET's and other components survived</p> </blockquote>
<h3>Polyfuses on the RAMPS</h3> <p>Fire appears to be the immediate issue, in the poly fuses.</p> <p>From <a href="https://www.reddit.com/r/Reprap/comments/2gpih3/reversed_polarity_ramps_on_fire/" rel="nofollow noreferrer">Reddit: reversed polarity, RAMPS on fire</a></p> <blockquote> <p>Sooo I made the dumb mistake of reversing the polarity from my psu into the RAMPS 1.4. As warned the ramps did not like this and smoke began to rise from the board. I am pretty sure I saw smoke only coming from the two ptc fuses (big flat yellow ones).</p> </blockquote> <h3>Replacing poly fuses</h3> <p>Note: Older RAMPS 1.4 have easily replaceable large poly fuses, whereas the RAMPS 1.5/1.6 use SMD poly fuses, see 0scar's answer to <a href="https://3dprinting.stackexchange.com/questions/5623/ramps-1-4-1-5-or-1-6">RAMPS 1.4, 1.5 or 1.6?</a></p> <hr /> <h3>Arduino</h3> <p>According to <a href="https://www.reddit.com/r/Reprap/comments/2gpih3/reversed_polarity_ramps_on_fire/ckln3ix/" rel="nofollow noreferrer">this user</a>, the MOSFETs <em>and</em> the Arduino Mega's regulator can be fried as well:</p> <blockquote> <p>it most likely fried the mosfets next to the fuses and probably the voltage regulator on your arduino.</p> </blockquote> <p>However, the fried regulator would only affect the Arduino's operation if powered through the power socket, or VIN (which the RAMPS board uses to power the Arduino Mega). However, via the USB it should still work. See <a href="https://www.reddit.com/r/Reprap/comments/2gpih3/reversed_polarity_ramps_on_fire/ckm2rlc/" rel="nofollow noreferrer">this post</a>, on the same thread:</p> <blockquote> <p>The voltage regulator is only needed if you supply power to the arduino via the Vin pin or with a separate power adapter. The RAMPS board does supply the Vin pin with 12V.</p> </blockquote> <p>So, you would probably have to rely on powering the Arduino via the USB and not the RAMPS</p> <p>Regarding the Arduino, on Arduino.SE there are a number of users who have fried their Arduino in this manner, and many of them suffer slightly different failures, although most are centered around the regulator. One case I remember was that of a capacitor burnout, see <a href="https://arduino.stackexchange.com/questions/54006/is-my-arduino-dead">Is my Arduino dead?</a> - although the use case was different. There are many other cases on the Arduino.SE.</p> <hr /> <h3>Protection Diode</h3> <p>According to <a href="https://reprap.org/forum/read.php?13,600886,600893#msg-600893" rel="nofollow noreferrer">this post</a> on <a href="https://reprap.org/forum/read.php?13,600886,600893" rel="nofollow noreferrer">RepRap - Reverse Polarity</a>, there <em>should</em> be a <strong>reverse polarity protection diode</strong> (although it appears not to have work in the above example):</p> <blockquote> <p>If it was a ramps, those have a reverse protection diode across the input that normally needs replaced after such an incident</p> </blockquote> <hr /> <h3>Stepper drivers/motors</h3> <p>The stepper motors themselves should survive, as should the stepper drivers.</p> <p><em><strong>However</strong></em>, each case can be different and it would depend upon the quality of the board (is it a cheap clone or branded?), and the quality/tolerance of the components used - these factors would determine where in the chain of modules the failure occurs. Obviously, the earlier the failure's location in the chain the better.</p> <hr /> <h3>MKS Base v1.2</h3> <p>As an aside, this user fried their regulator (the fuses were fine) on a MKS Base v1.2 (not RAMPS), by reversing the polarity, which caused the stepper drivers to fail. However, replacing the regulator fixed it, see <a href="https://reprap.org/forum/read.php?13,600886,602910#msg-602910" rel="nofollow noreferrer">this post</a>:</p> <blockquote> <p>Replacing the regulator chip did fix the board.</p> </blockquote> <p>Rather helpfully the self same user has posted an Instructables of the repair: <a href="https://www.instructables.com/id/MKS-Base-Reverse-Polarity-Repair/" rel="nofollow noreferrer">MKS Base reverse polarity repair</a>.</p> <hr /> <h3>RAMPSXB</h3> <p>There is no protection diode on the RAMPXB. From <a href="https://reprap.org/wiki/RAMPSXB" rel="nofollow noreferrer">RAMPSXB</a>:</p> <blockquote> <p>Do NOT reverse polarity on the input pins, as there is NO PROTECTION DIODE. Reversing polarity will not only fry your steppers and FETs, but may even damage your Arduino and possibly even your computer. Triple check to make sure the polarity on your power input is 100% correct!</p> </blockquote> <hr /> <h3>See also</h3> <ul> <li><a href="http://forum.arduino.cc/index.php?topic=265478.0" rel="nofollow noreferrer">Arduino Forum: Checking the RAMPS 1.4</a> for some handy troubleshooting tips for the Arduino and the Stepper.</li> </ul> <p>This user on <a href="http://forum.arduino.cc/index.php?topic=265478.msg1872694#msg1872694" rel="nofollow noreferrer">post #5</a> of <a href="http://forum.arduino.cc/index.php?topic=265478.0" rel="nofollow noreferrer">Arduino Forum: Checking the RAMPS 1.4</a> did manage to fry their stepper drivers, but not due to reverse polarity, by from a loose wire:</p> <blockquote> <p>I didnt connect the power backwards, but either I had a defective Mega2560 clone, or some stray bit of wire somehow shorted something out, and the Mega2560 literally went up in smoke (almost caught on fire !)</p> <p>Every stepper driver was destroyed, but the power FET's and other components survived</p> </blockquote>
492
<p>All the blower fans for part cooling I've seen rotate counter-clockwise when viewed from the intake side. I'm looking to replace mine on an Ender 3 with something stronger, and one of the worst parts of the stock design is that it's offset by about 20 mm versus the nozzle position, requiring awkward duct paths that reduce the flow to get uniform coverage around the newly extruded material. A fan that rotates in the opposite direction, with air exiting on the right-hand size when viewed from the intake side, would be exactly right. Are there such models available, and if so, what is the right terminology to search for them by? Or is there a simple way to modify a fan to reverse its direction?</p>
<p>I see that you have a minimum support angle of 60 degrees -- that may mean Cura Slicer isn't generating supports for that chin. Try changing this minimum to a lower figure -- 51 degrees or lower. From what I've read, most filaments and settings will allow 60 degrees with PLA, but this is the easy first thing to try to get that chin supported.</p> <p>On looking at the photo again, I also wonder if what looks like a bad overhang print is actually supports that didn't separate as they should -- perhaps you only need to adjust your Z skip for supports to get them to come off the actual part better.</p> <p>Following up, I saw a likely cause for this on one of my own prints yesterday -- coincidentally on the chin of a sculpture part. What I observed is that supports for this region, which trailed up the body (as would those for your dragon's chin), likely due to their slenderness, repeatedly got knocked over. The support structure &quot;healed&quot; over several layers after each such incident, but in a very fragile condition that would again get knocked off by a nozzle brush. The solution to this is either to enable Z-hop on retraction (so travel doesn't brush the nozzle across supports printed in the same layer), or to reorient the part so the problem support is shorter and doesn't run right alongside the actual body wall. Z-hop has less effect on other areas of the print.</p>
<p>You need to zoom in on the layers where the support is being generated and check if there is actually support being generated under that area.</p> <p>Additionally, I noticed your support generation setting is &quot;Touching build plate only&quot;. You should change this setting to 'everywhere' because it could be that build plate support cannot directly reach the area in question (so a portion of it is residing over an already printed surface). With this setting changed though, double check the rest of your print is not generating unecesssary supports, and if it is, use support blocker feature to get rid of them.</p> <p>And as a last thought, after changing the setting i mentioned above, also play around with overhang angle and carefully observe how the rendering of the support structures changes (like, really zoom in those gaps and check).</p>
1,958
<p>I would like to add the following MIME type to a site run by <code>Apache</code>:</p> <pre><code>&lt;mime-mapping&gt; &lt;extension&gt;jnlp&lt;/extension&gt; &lt;mime-type&gt;application/x-java-jnlp-file&lt;/mime-type&gt; &lt;/mime-mapping&gt; </code></pre> <p><strong>That is the Tomcat format.</strong></p> <p>I'm on a shared host, so I can only create an <code>.htaccess</code> file. Would someone please specify the complete contents of such a file?</p>
<pre><code>AddType application/x-java-jnlp-file .jnlp </code></pre> <p>Note that you might not actually be allowed to do that.</p> <p>See also the <a href="http://HTTPd.Apache.Org/docs/trunk/mod/mod_mime.html#addtype" rel="noreferrer" title="mod_mime - AddType">documentation of the AddType directive</a> and the <a href="http://HTTPd.Apache.Org/docs/trunk/howto/htaccess.html" rel="noreferrer" title=".htaccess howto">.htaccess howto</a>.</p>
<p>You should be able to just add this line:</p> <pre><code>AddType application/x-java-jnlp-file .jnlp </code></pre>
5,384
<p>How do I declare "as any" in VB.NET, or what is the equivalent?</p>
<p>The closest you can get is:</p> <p><code>Dim var as Object</code></p> <p>It's not exactly the same as VB6's as Any (which stores values in a Variant) but you can store variables of any type as Object, albeit boxed.</p>
<p><a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET" rel="nofollow noreferrer">VB.NET</a> doesn't support the "As Any" keyword. You'll need to explicitly specify the type.</p>
9,559
<p>I know that <code>.NET</code> is <code>JIT</code> compiled to the architecture you are running on just before the app runs, but does the JIT compiler optimize for 64bit architecture at all? </p> <p>Is there anything that needs to be done or considered when programming an app that will run on a <code>64bit system</code>? (i.e. Will using Int64 improve performance and will the JIT compiler automatically make Int64 work on 32bit systems?)</p>
<p>The <a href="http://blogs.msdn.com/davbr/pages/tail-call-jit-conditions.aspx" rel="nofollow noreferrer">64bit JIT is different</a> from the one for 32bit, so I would expect some differences in the output - but I wouldn't switch to 64bit just for that, and I wouldn't expect to gain much speed (if any) in CPU time by switching to 64bit. </p> <p>You will notice a big performance improvement if your app uses a lot of memory and the PC has enough RAM to keep up with it. I've found that 32bit .NET apps tend to start throwing out of memory exceptions when you get to around 1.6gb in use, but they start to thrash the disk due to <a href="http://en.wikipedia.org/wiki/Paging" rel="nofollow noreferrer">paging</a> long before that - so you end being I/O bound.</p> <p>Basically, if you're bottleneck is CPU then 64bit is unlikely to help. If your bottleneck is is memory then you should see a big improvement. </p> <blockquote> <p>Will using Int64 improve performance and will the JIT compiler automatically make Int64 work on 32bit systems</p> </blockquote> <p>Int64 already works on both 32bit and 64bit systems, but it'll be faster running on 64bit. So if you're mostly number crunching with Int64, running on a 64bit system should help. </p> <p>The most important thing is to <a href="http://channel9vip.orcsweb.com/shows/Behind+The+Code/Rico-Mariani-Writing-better-faster-code/?CommentID=290154" rel="nofollow noreferrer">measure</a> your performance.</p>
<p>Performance bottlenecks will be the same regardless of whether the architecture is 32- or 64-bit. Performance problems tend to be the result of sub-optimal algorithms &mdash; the choice between 32- and 64-bit types won't significantly affect performance.</p> <p>Most importantly, don't try to improve the performance of something before you've measured it. In particular you should profile the code to determine where your performance bottlenecks are.</p>
3,525
<p>I've found some examples using the Win32 api or simulating the ^+ button combination (<kbd>ctrl</kbd>-<kbd>+</kbd>) <a href="http://www.codeproject.com/KB/list/AutoResize.aspx" rel="nofollow noreferrer">using SendKeys</a>, but at least with the SendKeys method the listview grabs the cursor and sets it to an hourglass until I hit the start button on my keyboard. What is the cleanest way to do this?</p>
<p>Looks like a call to <code>myListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent)</code> will do what you want. I would think, just call it after adding an item.</p> <p>More info <a href="https://msdn.microsoft.com/en-us/library/system.windows.forms.listview.autoresizecolumns(v=vs.110).aspx" rel="noreferrer">here</a></p>
<p>loop through all columns and set width to -1 after adding content.</p>
8,190
<p>How is it possible to make prototype methods in C#.Net?</p> <p>In JavaScript, I can do the following to create a trim method for the string object:</p> <pre><code>String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); } </code></pre> <p>How can I go about doing this in C#.Net?</p>
<p>You can't dynamically add methods to existing objects or classes in .NET, except by changing the source for that class.</p> <p>You can, however, in C# 3.0, use extension methods, which <em>look</em> like new methods, but are compile-time magic.</p> <p>To do this for your code:</p> <pre><code>public static class StringExtensions { public static String trim(this String s) { return s.Trim(); } } </code></pre> <p>To use it:</p> <pre><code>String s = " Test "; s = s.trim(); </code></pre> <p>This looks like a new method, but will compile the exact same way as this code:</p> <pre><code>String s = " Test "; s = StringExtensions.trim(s); </code></pre> <p>What exactly are you trying to accomplish? Perhaps there are better ways of doing what you want?</p>
<p>You need to create an extension method, which requires .NET 3.5. The method needs to be static, in a static class. The first parameter of the method needs to be prefixed with "this" in the signature.</p> <pre><code>public static string MyMethod(this string input) { // do things } </code></pre> <p>You can then call it like</p> <pre><code>"asdfas".MyMethod(); </code></pre>
2,658
<p>Why are SQL distributions so non-standard despite an ANSI standard existing for SQL? Are there really that many meaningful differences in the way SQL databases work or is it just the two databases with which I have been working: MS-SQL and PostgreSQL? Why do these differences arise?</p>
<p>It's a form of "Stealth lock-in". Joel goes into great detail here:</p> <ul> <li><a href="http://www.joelonsoftware.com/articles/fog0000000056.html" rel="nofollow noreferrer">http://www.joelonsoftware.com/articles/fog0000000056.html</a></li> <li><a href="http://www.joelonsoftware.com/articles/fog0000000052.html" rel="nofollow noreferrer">http://www.joelonsoftware.com/articles/fog0000000052.html</a></li> </ul> <p>Companies end up tying their business functionality to non-standard or weird unsupported functionality in their implementation, this restricts their ability to move away from their vendor to a competitor.</p> <p>On the other hand, it's pretty short-sighted because anyone with half a brain will tend to abstract away the proprietary pieces, or avoid the lock-in altogether, if it gets too egregious.</p>
<p>It's certainly effective lock-in, as 1800 says. But in fairness to the database vendors, the SQL standard is always playing catch-up to current databases' feature sets. Most databases we have today are of pretty ancient lineages. If you trace Microsoft SQL Server back to its roots, I think you'll find Ingres - one of the very first relational databases written in the '70s. And Postgres was originally written by some of the same people in the '80s as a successor to Ingres. Oracle goes way back, and I'm not sure where MySQL came in.</p> <p>Database non-portability does suck, but it could be a lot worse.</p>
5,811
<p>As far as I know resin trays have a Teflon coat that allows prints to stick to the build plate easier than the resin tray but this Teflon coat wears over time. </p> <p>I am new to the SLA scene and am currently troubleshooting a Draken Facture and trying to hone in my setting but my print keep sticking to the bottom of the resin vat. </p> <p>How often should these trays be swapped out to allow for smooth printing?</p>
<p>It depends on tray and resin type you are using.</p> <p><strong>PDMS</strong></p> <p>If you are using PDMS (eg. sylgard 184) coating for your tray. (B9 and similar printers using this type of tray). </p> <p>Life of tray PDMS coating depends mainly on:</p> <ul> <li>How long you print without breathing floor.</li> <li>How reactive is your resin.</li> </ul> <p>You could get 2 3 prints up to 15 20 prints.</p> <p>It is suitable for printing delicate pieces.</p> <p><strong>FEP</strong></p> <p>Large number of manufacturers using FEP.</p> <p>Life of tray largely depends on.</p> <ul> <li>Thickness of FEP</li> <li>Piece sizes and movement speed during early layers.</li> </ul> <p>Usually you could use same tray for couple of hundreds of prints. Optical quality is not comparable to other alternatives but without human error factor you could get almost unlimited prints. Delicate pieces require tough resin.</p> <p><strong>Teflon</strong></p> <p>It is halfway between PDMS and FEP.</p> <p>There are other tray alternatives:</p> <ul> <li>Envision uses special glass you could print on average 50 prints.</li> <li>Carbon 3D uses super expensive oxygen-permeable window.</li> </ul>
<p>I did some research and the life of the resin and resin tray appears to be dependent on how you use it. For example, regarding the resin, 3dfacture states <a href="http://3dfacture.com/faq/" rel="nofollow noreferrer">"We see almost unlimited shelf life of the resin as long as it is kept out of light"</a>.</p> <p>I know you asked about the tray and not the resin; but, the two are inter-coupled to the same fundamental issue. Their lifespan is highly operational dependent. If your printer operates in an environment that have very low ambient UV, the tray will have to be cleaned less because of less resin buildup and replacement and thus less wear. Other factors come into play as well regarding cleaning procedures, usage amount, etc.</p> <p>I think if you want a number you are going to have to run your own experiment in your own environment.</p>
640
<p>I have to setup team foundation server for a company, something that I don't have any experience in.</p> <p>The company will have about 5 or so developers that will be using it.</p> <p>Is this a big task or something that is fairly easy to do (with instructions)?<br> Any helpful tutorials that you can recommend?</p> <p>Any recommendations on server specs for a team of 5-10?</p>
<p>Your first step should be to download the latest TFS Installation Guide (TFSInstall.chm) from here: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=FF12844F-398C-4FE9-8B0D-9E84181D9923&amp;displaylang=en" rel="noreferrer">http://www.microsoft.com/downloads/details.aspx?FamilyID=FF12844F-398C-4FE9-8B0D-9E84181D9923&amp;displaylang=en</a></p> <p>You should use TFS 2008 SP1, since it is the latest release and includes many new features and performance improvements.</p> <p>If you are planning on installing with Windows 2008 &amp; SQL 2008, you will need to "integrate" the TFS 2008 SP1 into the installation disc. Instructions are included in the TFSInstall.chm, but Martin Woodward also has a walkthrough on his blog: <a href="http://www.woodwardweb.com/vsts/creating_a_tfs.html" rel="noreferrer">http://www.woodwardweb.com/vsts/creating_a_tfs.html</a> (This isn't required for SQL 2005 SP2 + Windows 2003)</p> <p>The install guide also has hardware recommendations.</p> <p>For a team of your size, you should also consider running your TFS instance as a Virtual Machine. This will allow you to up-size and move your installation around more easily at a later date. TFS is supported on the Hyper-V virtualization platform: <a href="http://blogs.msdn.com/granth/archive/2008/06/27/team-foundation-server-and-hyper-v-virtualization.aspx" rel="noreferrer">http://blogs.msdn.com/granth/archive/2008/06/27/team-foundation-server-and-hyper-v-virtualization.aspx</a></p> <p>And if you need help along the way, you have three options:</p> <ol> <li><p>Call up MS product support ($$, but you will get an answer)</p></li> <li><p>Post on the official Team Foundation Server - Setup forums: <a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=68&amp;SiteID=1" rel="noreferrer">http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=68&amp;SiteID=1</a></p></li> <li><p>Sign up to the <a href="http://OzTFS.com/" rel="noreferrer">http://OzTFS.com/</a> mailing list. The people on this list are pretty good at responding to questions almost instantaneously. It's also a great list to join if you just want to "watch" what's happening.</p></li> </ol>
<p>See the link below for a condensed walkthrough:</p> <p><a href="http://blogs.vertigosoftware.com/teamsystem/archive/2006/04/04/2512.aspx" rel="nofollow noreferrer">Cliff's Notes for a Team System Install</a></p>
8,212
<p>I have just bought a Creality CR-10 Smart 3D printer, and - as part of the rite of passage of newbies - I am struggling with getting a usable initial layer. Whilst trying to make sense of what I was seeing in the net and correlating it with what I was experiencing with my printer, I thought to check the printer's credentials (I had assumed it was a recent model). However, looking at the information on the LED screen, I see:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th></th> <th></th> </tr> </thead> <tbody> <tr> <td>Machine type</td> <td>CR-10 Smart</td> </tr> <tr> <td>Firmware version</td> <td>HW 1.0.6</td> </tr> <tr> <td>Screen version</td> <td>T18</td> </tr> <tr> <td>Hardware version</td> <td>DWIN 4.3</td> </tr> </tbody> </table> </div> <p>Can anyone comment on whether this is recent or ancient? Is it a V1 or a V2?</p> <p>As a software engineer of several decades standing, but a complete newbie to 3D printing, I'm suffering from culture shock, and I'm struggling to understand why my printer doesn't just work &quot;out of the box&quot; like my line printers do.</p> <p>I find it particularly difficult sorting out the information about Creality's various CR-10* models, partly because of the naming conventions, but chiefly because my CR-10 Smart doesn't look like any that I have seen referred to anywhere in the net. I was told that the CR-10 Smart had auto bed levelling (ABL) built in, but when I search for <code>CR-10S ABL</code> I only find stuff about add-ons like BLTouch, and nothing about the CR-10 Smart with built-in ABL.</p> <p>Add into the mix the now traditional Internet problem that the date of web pages and whether they are still relevant is often unclear.</p> <p>Then I found a Youtube video by <a href="https://www.youtube.com/watch?v=l4I8b5-71rk" rel="nofollow noreferrer">WillCaddy</a>, which suggested that CR-10S printers with Creality firmware do not have ABL enabled, and that to get functioning ABL you had to install TH3D.</p> <p>Is this true?</p> <p>If anyone can help me with any of this, I would be very grateful. I am working my way slowly through Michael Laws' excellent <a href="https://teachingtechyt.github.io/" rel="nofollow noreferrer">&quot;Teaching Tech&quot; channel</a>, but I'm impatient...</p>
<p>I don't think it's because of Cura. You can try if it still works with the older version.</p> <p>Otherwise, clean your print bed with isopropanol before printing to remove residues or level again. Without pictures of the condition of the print bed or the first layer, it is difficult to help.</p>
<p>Have tried all the possible answers and found the older version of Cura works better with the Chiron. The printer is 3 months old, bed is cleaned after each print.</p> <p>I then tried the new Cura version again but with glue for adhesion, that works. It seems that it is changing the bed temperature, and using a lower default. Have tried changing the bed temperature in the software before slicing, but found I have to manually set the temperature on the printer, I have been using the generic settings for the PLA, as the ones I have (E-DA) are not in the selection or in the market place. TPU and PETG are printing fine.</p> <p>Will have to determine the optimum set-up and create my own defaults.</p>
2,100
<p>Is it possible to obtain raw logs from Google Analytic? Is there any tool that can generate the raw logs from GA?</p>
<p>No you can't get the raw logs, but there's nothing stopping you from getting the exact same data logged to your own web server logs. Have a look at the <a href="https://ssl.google-analytics.com/urchin.js" rel="noreferrer">Urchin code</a> and borrow that, changing the following two lines to point to your web server instead.</p> <pre><code>var _ugifpath2="http://www.google-analytics.com/__utm.gif"; if (_udl.protocol=="https:") _ugifpath2="https://ssl.google-analytics.com/__utm.gif"; </code></pre> <p>You'll want to create a <code>__utm.gif</code> file so that they don't show up in the logs as 404s.</p> <p>Obviously you'll need to parse the variables out of the hits into your web server logs. The log line in Apache looks something like this. You'll have lots of "fun" parsing out all the various stuff you want from that, but everything Google Analytics gets from the basic JavaScript tagging comes in like this.</p> <pre><code>127.0.0.1 - - [02/Oct/2008:10:17:18 +1000] "GET /__utm.gif?utmwv=1.3&amp;utmn=172543292&amp;utmcs=ISO-8859-1&amp;utmsr=1280x1024&amp;utmsc=32-bit&amp;utmul=en-us&amp;utmje=1&amp;utmfl=9.0%20%20r124&amp;utmdt=My%20Web%20Page&amp;utmhn=www.mydomain.com&amp;utmhid=979599568&amp;utmr=-&amp;utmp=/urlgoeshere/&amp;utmac=UA-1715941-2&amp;utmcc=__utma%3D113887236.511203954.1220404968.1222846275.1222906638.33%3B%2B__utmz%3D113887236.1222393496.27.2.utmccn%3D(organic)%7Cutmcsr%3Dgoogle%7Cutmctr%3Dsapphire%2Btechnologies%2Bsite%253Arumble.net%7Cutmcmd%3Dorganic%3B%2B HTTP/1.0" 200 35 "http://www.mydomain.com/urlgoeshere/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.2.153.1 Safari/525.19" </code></pre>
<p>No, but there are other paid services like <a href="https://mixpanel.com/docs/api-documentation/data-export-api" rel="nofollow" title="Mixpanel Data Export API">Mixpanel</a> and <a href="http://support.kissmetrics.com/apis/data/data-export-setup" rel="nofollow" title="KISSmetrics Data Export">KISSmetrics</a> that have data export APIs. Much easier than trying to build your own analytics service, but costs money.</p>
8,319
<p>As someone who has spent around 10 years programming web applications with Adobe's ColdFusion, I have decided to add ASP.NET as a string to my bow.</p> <p>For someone who has spent so long with CF and the underlying Java, ASP.NET seems a little alien to me. How should I go about getting up to speed with ASP.NET so that I can be truly dangerous with it? Do I need to know C# at any great amount of detail?</p> <p>I want to be in a position where I can build basic web apps fairly quickly so I can learn more doing the tricky stuff.</p>
<p>I'm only maybe six months down the same path, but here are some thoughts from my experience so far:</p> <p>The C# language shouldn't give you much problem if you have very much experience with Java at all (or even CFScript). As a reference, though, when I was starting, I found <a href="http://www.csharp-station.com/" rel="nofollow noreferrer">csharp-station</a> a good primer for language basics. It won't help you much as far as the ASP.NET side goes; but it is good for syntax. More you'll be familiarizing yourself with the .NET libraries. The IDE actually can be an enormous help here.</p> <p>Here are the three biggest differences I found making the transition:</p> <ol> <li><strong>ASP.NET Server Controls</strong> - In ColdFusion, you really have pretty direct control over the HTML; you work very closely with the page. This isn't so much the case in ASP.NET. The server controls are meant to relieve you of a lot of the tedium, but at a cost of maybe some direct control. As a CF programmer, I'm very particular about what gets actually output to the browser; and at first ASP.NET frustrated me because it spits out a lot of extra code. Still, the controls are really powerful, and it pays to familiarize yourself with them. Form and validation controls, especially, save you from a lot of the tedium in CF of handling post back and validation. W3Schools actually has a decent <a href="https://web.archive.org/web/20080829141718/https://www.w3schools.com/ASPNET/aspnet_refwebcontrols.asp" rel="nofollow noreferrer">list of web server controls</a>.</li> <li><strong>The page model</strong> - ColdFusion is pretty agnostic in terms of page flow. ASP.NET is very much geared towards using post backs, and is very event driven. If you're not using a framework with CF (e.g. Model Glue), this may be foreign to you. .NET takes care of handling a lot of the post back behavior for you. Also, not to say that ColdFusion can't be object and function driven by good use of CFC's, but ASP.NET really tries to push you down the OO path compared to CF in my experience.</li> <li><strong>Database access</strong> - Using ASP.NET really made me appreciate how powerful cfquery really is. The csharp-station site also has a good tutorial on working with the native .NET db tools. I haven't worked on enough projects yet to start looking around for DB access extensions; I'm pretty sure Jeff recommended something that they used for building this site, so you might check that out. Otherwise, I really suggest you familiarize yourself with the DataSet object. It's somewhat similar to a query object in CF, and lets you run query of queries, etc... Looping over queries in CF is very common, but it doesn't happen nearly as much in ASP.NET because of data binding.</li> </ol>
<p>Microsoft has a video called <a href="http://www.asp.net/Learn/videos/video-27.aspx" rel="nofollow noreferrer">ASP.NET for ColdFusion developers</a> you may be interested in.</p> <p>Edit, <a href="http://www.asp.net/learn/videos/video-28.aspx" rel="nofollow noreferrer">here's another</a> </p>
8,217
<p>I have two unrelated processes that use .NET assemblies as plugins. However, either process can be started/stopped at any time. I can't rely on a particular process being the server. In fact, there may be multiple copies running of one of the processes, but only one of the other.</p> <p>I initially implemented a solution based off of <a href="http://www.developer.com/net/net/article.php/3520891" rel="nofollow noreferrer">this article</a>. However, this requires the one implementing the server to be running before the client.</p> <p>Whats the best way to implement some kind of notification to the server when the client(s) were running first?</p>
<p>Using shared memory is tougher because you'll have to manage the size of the shared memory buffer (or just pre-allocate enough). You'll also have to manually manage the data structures that you put in there. Once you have it tested and working though, it will be easier to use and test because of its simplicity.</p> <p>If you go the remoting route, you can use the IpcChannel instead of the TCP or HTTP channels for a single system communication using Named Pipes. <a href="http://msdn.microsoft.com/en-us/library/4b3scst2.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/4b3scst2.aspx</a>. The problem with this solution is that you'll need to come up with a registry type solution (either in shared memory or some other persistent store) that processes can register their endpoints with. That way, when you're looking for them, you can find a way to query for all the endpoints that are running on the system and you can find what you're looking for. The benefits of going with Remoting are that the serialization and method calling are all pretty straightforward. Also, if you decide to move to multiple machines on a network, you could just flip the switch to use the networking channels instead. The cons are that Remoting can get frustrating unless you clearly separate what are "Remote" calls from what are "Local" calls.</p> <p>I don't know much about WCF, but that also might be worth looking into. Spider sense says that it probably has a more elegant solution to this problem... maybe.</p> <p>Alternatively, you can create a "server" process that is separate from all the other processes and that gets launched (use a system Mutex to make sure more than one isn't launched) to act as a go-between and registration hub for all the other processes.</p> <p>One more thing to look into the Publish-Subscribe model for events (Pub/Sub). This technique helps when you have a listener that is launched before the event source is available, but you don't want to wait to register for the event. The "server" process will handle the event registry to link up the publishers and subscribers.</p>
<p>Why not host the server and the client on both sides, and whoever comes up first gets to be the server? And if the server drops out, the client that is still active switches roles.</p>
6,461
<p>I've recently purchased an Elegoo Mars Pro 3d printer, and I was wondering when printing large pieces that need to be printed in different steps: is there some kind of post-processing to make it more suitable for gluing them?</p> <p>I know of joints and so on, but sometimes pieces are big but not thick enough to be able to put a joint somewhere, so I guess the only solution would be to glue them.</p> <p>Should I use some kind of specific glue to get better results with resins? Is there any process (post-processing, reducing layer height when printing, leave the resin being curated more time...) to improve the sticking of the different parts? Or can we go with any kind of &quot;strong multisurface glue&quot; without any further post-processing steps, and the results should be the same in matters of quality?</p> <p>Thank you!</p>
<p>You can definitely use glue - however you can also brush some of the liquid resin along the edges of the two pieces, push them together and cure them, this will fuse them together.</p> <p>You don't need much, and you need to watch for drip out while curing (don't your fingers in it)</p>
<p>You can definitely use glue - however you can also brush some of the liquid resin along the edges of the two pieces, push them together and cure them, this will fuse them together.</p> <p>You don't need much, and you need to watch for drip out while curing (don't your fingers in it)</p>
1,729
<p>I have Prusa i3 derivative with MK8 extruder and Marlin 1.1RC8 as firmware. I already reduced the default speeds as well as the accelerations. But sometimes when trying to print with BQ PLA filament (220°C), mostly during filling areas, my extruder clicks. The below screenshot of Slic3rs Layers view shows the clicking "lines".</p> <p><a href="https://i.stack.imgur.com/Rzmxn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Rzmxn.png" alt="enter image description here"></a></p> <p>What settings I need to change to avoid the overextrusion in this case?</p>
<p>I've tried to reduce the "Extrusion multiplier" from 1 to 0.95, but that caused gaps. Now I've minimized the clicking by setting the Slic3r option "Infill before perimeters" on the "Print Settings > Infill" page.</p>
<p>I had this issue and it turned out to be the extruder cog rubbing on the inside of the hole in the heatsink, causing the stepper to slip. </p>
452
<p>I've encountered the following problem pattern frequently over the years:</p> <ul> <li><p>I'm writing complex code for a package comprised of a standalone application and also a library version of the core that people can use from inside other apps.</p></li> <li><p>Both our own app and presumably ones that users create with the core library are likely to be run both in batch mode (off-line, scripted, remote, and/or from command line), as well as interactively.</p></li> <li><p>The library/app takes complex and large runtime input and there may be a variety of error-like outputs including severe error messages, input syntax warnings, status messages, and run statistics. Note that these are all <em>incidental</em> outputs, not the primary purpose of the application which would be displayed or saved elsewhere and using different methods.</p></li> <li><p>Some of these (probably only the very severe ones) might require a dialog box if run interactively; but it needs to log without stalling for user input if run in batch mode; and if run as a library the client program obviously wants to intercept and/or examine the errors as they occur.</p></li> <li><p>It all needs to be cross-platform: Linux, Windows, OSX. And we want the solution to not be weird on any platform. For example, output to stderr is fine for Linux, but won't work on Windows when linked to a GUI app.</p></li> <li><p>Client programs of the library may create multiple instances of the main class, and it would be nice if the client app could distinguish a separate error stream with each instance.</p></li> <li><p>Let's assume everybody agrees it's good enough for the library methods to log errors via a simple call (error code and/or severity, then printf-like arguments giving an error message). The contentious part is how this is recorded or retrieved by the client app.</p></li> </ul> <p>I've done this many times over the years, and am never fully satisfied with the solution. Furthermore, it's the kind of subproblem that's actually not very important to users (they want to see the error log if something goes wrong, but they don't really care about our technique for implementing it), but the topic gets the programmers fired up and they invariably waste inordinate time on this detail and are never quite happy.</p> <p>Anybody have any wisdom for how to integrate this functionality into a C++ API, or is there an accepted paradigm or a good open source solution (not GPL, please, I'd like a solution I can use in commercial closed apps as well as OSS projects)?</p>
<p>"isn't that [text manipulation] more of something that should be programmed into the application?"</p> <p>Usually, yes. The generally accepted "<a href="http://en.wikipedia.org/wiki/Multitier_architecture" rel="nofollow noreferrer">three-tier</a>" application design for databases says that your logic should be in the middle tier, between the client and the database. However, sometimes you need some logic in a trigger or need to index on a function, requiring that some code be placed into the database. In that case all the usual "which language should I use?" questions come up.</p> <p>If you only need a little logic, the most-portable language should probably be used (pl/pgSQL). If you need to do some serious programming though, you might be better off using a more expressive language (maybe pl/ruby). This will always be a judgment call.</p> <p>"is there any valid reason to use an untrusted language?"</p> <p>As above, yes. Again, putting direct file access (for example) into your middle tier is best when possible, but if you need to fire things off based on triggers (that might need access to data not available directly to your middle tier), then you need untrusted languages. It's not ideal, and should generally be avoided. And you definitely need to guard access to it.</p>
<p>I think most additional languages are offered so that if you develop in that language on a regular basis, you can feel comfortable writing db functions, triggers, etc. The usefulness of these features is to provide a control over data as close to the data as possible.</p>
6,060
<p>Cura is slicing my object (a gear with text) with a partial top layer, and I believe it has to do with layer height and rounding issues. I have been able to solve this at specific heights 10-14mm using a layer height of 0.25 mm, however other heights will cause this issue to arise again. There must be a solution to this that doesn't require the user to constantly be adjusting layer height and object height in order to resolve what I perceive to be a rounding issue. </p> <p>Here is the model: <a href="https://filebin.ca/3f2g2s0dklzR/hackEly_v1.0_joined_text_2.stl" rel="nofollow noreferrer">https://filebin.ca/3f2g2s0dklzR/hackEly_v1.0_joined_text_2.stl</a></p> <p>Here are my settings: <a href="https://i.stack.imgur.com/EBRnV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EBRnV.png" alt="Settings 1"></a> <a href="https://i.stack.imgur.com/7oZZY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7oZZY.png" alt="Settings 2"></a></p> <p>Here is the model at a height of 10 mm: Note the diagonal line, this is the line between two layers. <a href="https://i.stack.imgur.com/hz3gz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hz3gz.png" alt="Object 10mm"></a></p> <p>Here is the model at a height of 13 mm: Note the diagonal line again, and how it is farther to the right than the 10mm height view. <a href="https://i.stack.imgur.com/8SLTX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8SLTX.jpg" alt="enter image description here"></a></p> <p>I don't believe that this is not a non-manifold issue. I have also tested this using a gear without text.</p> <p>Like I mentioned, I can get rid of that layer division at certain layer heights and object heights (e.g. 0.25mm layer height), but I would like to find out how to get rid of this issue <em>regardless of object/layer height</em>. Thank you for your help.</p>
<p>Your model isn't perfect. I took it into Windows 10 3D Builder for simplicity. I kept clicking the "Mirror" function and noticed as it basically flipped there is some slight movement. I measured some points from bottom to top and noticed some differences. </p> <p>Try to take your model into some software to fix/flatten it. Or recreate it making sure its perfectly flat on both sides. It is definitely not your Cura software.</p>
<p>Even though you've selected an answer, here's another viewpoint. Ignoring the brim that I've added by default via my slicer, you can see the first few layers are not complete. This indicates a model that's a fraction of a degree off-plane. </p> <p><a href="https://i.stack.imgur.com/2VRCT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2VRCT.jpg" alt="slanted model image"></a></p> <p>Any number of methods can be used to correct this. Meshmixer has a great "align" function in the edit menu which will drop it on the bed. My slicer, S3D will work in that respect with "Place surface on bed" or some such terms.</p> <p>The image below represents the result of using Align in Meshmixer, Inspector (repair all) and export. The STL file imported to S3D presented exactly the same image on the first layer as in the image above. When I used "Place surface on bed and selected the horizontal cross-member as the reference surface, the first layer result is this:</p> <p><a href="https://i.stack.imgur.com/goSvf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/goSvf.png" alt="first layer after repair"></a></p> <p>The slicer completed the imaging with this result, clearly with no diagonal artifacts:</p> <p><a href="https://i.stack.imgur.com/kAlU3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kAlU3.png" alt="last layer"></a></p>
711
<p>When should I include PDB files for a production release? Should I use the <code>Optimize code</code> flag and how would that affect the information I get from an exception?</p> <p>If there is a noticeable performance benefit I would want to use the optimizations but if not I'd rather have accurate debugging info. What is typically done for a production app?</p>
<p>When you want to see source filenames and line numbers in your stacktraces, generate PDBs using the pdb-only option. Optimization is separate from PDB generation, i.e. you can optimize <em>and</em> generate PDBs without a performance hit.</p> <p>From <a href="http://msdn.microsoft.com/en-us/library/8cw0bt21(VS.80).aspx" rel="noreferrer">the C# Language Reference</a></p> <blockquote> <p>If you use /debug:full, be aware that there is some impact on the speed and size of JIT optimized code and a small impact on code quality with /debug:full. We recommend /debug:pdbonly or no PDB for generating release code.</p> </blockquote>
<p>There is no need to include them in your distribution, but you should definitely be building them and keeping them. Otherwise debugging a crash dump is practically impossible.</p> <p>I would also turn on optimizations. Whilst it does make debugging more difficult the performance gains are usually very non-trivial depending on the nature of the application. We easily see over 10x performance on release vs debug builds for some algorithms.</p>
6,325
<p>Is it possible to delete a middle node in the single linked list when the only information available we have is the pointer to the node to be deleted and not the pointer to the previous node?After deletion the previous node should point to the node next to deleted node. </p>
<p>It's definitely more a quiz rather than a real problem. However, if we are allowed to make some assumption, it can be solved in O(1) time. To do it, the strictures the list points to must be copyable. The algorithm is as the following:</p> <p>We have a list looking like: ... -> Node(i-1) -> Node(i) -> Node(i+1) -> ... and we need to delete Node(i).</p> <ol> <li>Copy data (not pointer, the data itself) from Node(i+1) to Node(i), the list will look like: ... -> Node(i-1) -> Node(i+1) -> Node(i+1) -> ...</li> <li>Copy the NEXT of second Node(i+1) into a temporary variable.</li> <li>Now Delete the second Node(i+1), it doesn't require pointer to the previous node.</li> </ol> <p>Pseudocode:</p> <pre><code>void delete_node(Node* pNode) { pNode-&gt;Data = pNode-&gt;Next-&gt;Data; // Assume that SData::operator=(SData&amp;) exists. Node* pTemp = pNode-&gt;Next-&gt;Next; delete(pNode-&gt;Next); pNode-&gt;Next = pTemp; } </code></pre> <p>Mike.</p>
<pre><code>Void deleteMidddle(Node* head) { Node* slow_ptr = head; Node* fast_ptr = head; Node* tmp = head; while(slow_ptr-&gt;next != NULL &amp;&amp; fast_ptr-&gt;next != NULL) { tmp = slow_ptr; slow_ptr = slow_ptr-&gt;next; fast_ptr = fast_ptr-&gt;next-&gt;next; } tmp-&gt;next = slow_ptr-&gt;next; free(slow_ptr); enter code here } </code></pre>
9,464
<p>For the past 10 years or so there have been a smattering of articles and papers referencing Christopher Alexander's newer work "The Nature of Order" and how it can be applied to software.</p> <p>Unfortunately, the only works I can find are from James Coplien and Richard Gabriel; there is nothing beyond that, at least from my attempts to find such things through google.</p> <p>Is this kind of discussion happening anywhere?</p> <p>MSN</p> <hr> <p>@Georgia</p> <p>My question isn't about design patterns or pattern languages; it's about trying to see if more of Christopher Alexander's work can be applied to software (which it probably can, since it has even less physical constraints than architecture and building).</p> <p>Design patterns and pattern languages seem to have embraced the structure of Alexander's design patterns, but not many capture the essence. The essence being something beyond solving a problem in a particular context.</p> <p>It's difficult to explain without using some of Alexander's later works as a reference point.</p> <p>Edit: No, I take that back.</p> <p>For example, there's an architectural design pattern that is called Alcoves. The pattern has a context that isn't just rooted in the circumstances of the situation but also rooted in fundamentals about the purpose of buildings: that they are structures to be lived in and must promote living in them. In the case of the Alcove pattern, the context is that you want an area that allows for multiple people to be in the same area doing different things, because it is important for family members to be physically together as well as to be able to do things that tend to distract other family members.</p> <p>Most software design patterns describe a problem in a context, but they make no deeper statement about why the problem is important, or why the problem is something that is fundamental to software. It makes it very easy to apply design patterns inappropriately or blithely, which is the exact opposite of the intent of design patterns to began with.</p> <p>MSN ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>
<p>For the sake of completeness I'll repeat the discussion on Reto's post over at the <a href="http://groups.google.com/group/android-developers/browse_thread/thread/36fe0648dabfe745#" rel="noreferrer">Android Groups here</a>.</p> <p>It seems that if you set the bounds on your drawable it does the trick:</p> <pre><code>Drawable defaultMarker = r.getDrawable(R.drawable.icon); // You HAVE to specify the bounds! It seems like the markers are drawn // through Drawable.draw(Canvas) and therefore must have its bounds set // before drawing. defaultMarker.setBounds(0, 0, defaultMarker.getIntrinsicWidth(), defaultMarker.getIntrinsicHeight()); MyItemizedOverlay markers = new MyItemizedOverlay(defaultMarker); overlays.add(markers); </code></pre> <p>By the way, the above is shamelessly ripped from <a href="http://www.marcelp.info/2008/09/01/android-itemizedoverlay-demo/" rel="noreferrer">the demo at MarcelP.info</a>. Also, here is a <a href="http://androidguys.com/?p=1413" rel="noreferrer">good howto</a>.</p>
<p>try :</p> <pre><code>Drawable defaultMarker = r.getDrawable(R.drawable.icon); defaultMarker.setBounds(0, 0, defaultMarker.getIntrinsicWidth(), defaultMarker.getIntrinsicHeight()); MyItemizedOverlay markers = new MyItemizedOverlay(defaultMarker); overlays.add(markers); </code></pre>
4,593
<p>The product we are working on allows the user to easily set it up to run automatically whenever the computer is started. This is helpful because the product is part of the basic work environment of most of our users.<br> This feature was implemented not so long ago and for a while all was well, but when we started testing this feature on Vista the product started behaving really weird on startup. Specifically, our product makes use of another product (lets call it X) that it launches whenever it needs its services. The actual problem is that whenever X is launched immediately after log-on, it crashes or reports critical errors related to disk access (this happens even when X is launched directly - not through our product).</p> <p>This happens whenever we run our product by registering it in the "Run" key in the registry or place a shortcut to it in the "<em>Startup</em>" folder inside the "<em>Start Menu</em>", even when we put a delay of ~20 seconds before actually starting to run. When we changed the delay to 70 seconds, all is well.</p> <p>We tried to reproduce the problem by launching our product manually immediately after logon (by double-clicking on a shortcut placed on the desktop) but to no avail.</p> <p>Now how is it possible that applications that run normally a minute after logon report such hard errors when starting immediately after logon?</p>
<p>This is the effect of a new feature in Vista called "Boxing": Windows has several mechanisms that allow the user/admin to set up applications to automatically run when windows starts. This feature is mostly used for one of these purposes: 1. Programs that are part of the basic work environment of the user, such that the first action the user would usually take when starting the computer is to start them. 2. All sorts of background "agents" - skype, messenger, winamp etc.</p> <p>When too many (or too heavy) programs are registered to run on startup the end result is that the user can't actually do anything for the first few seconds/minutes after login, which can be really annoying. In comes Vista's "Boxing" feature:</p> <p>Briefly, Vista forces all programs invoked through the Run key to operate at low priority for the first 60 seconds after login. This affects both <strong>I/O priority (which is set to Very Low) and CPU priority</strong>. Very Low priority I/O requests do not pass through the file cache, but go directly to disk. Thus, they are much slower than regular I/O. The length of the boxing period is set by the registry value: "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\DelayedApps\Delay_Sec". </p> <p>For a more detailed explanation see <a href="http://blogs.technet.com/askperf/archive/2008/03/28/startup-programs-on-windows-vista-inside-the-box.aspx" rel="nofollow noreferrer">here</a> and <a href="http://myitforum.com/cs2/blogs/scassells/archive/2008/02/05/boxing-and-the-case-of-the-slow-or-hanging-logon-script-in-vista.aspx" rel="nofollow noreferrer">here</a></p>
<p>The program probably needs some more info put into its properties. It needs to "Run As", instead of just running.</p> <p>Maybe this application should be developed as a service, instead of a program to be launched, or you could have service that launches the program when its determined the best window of opportunity. </p>
3,662
<p>Does anyone know of any good tutorials on ADO.NET Entity Framework?</p> <p>There are a few useful links here at <a href="https://stackoverflow.com/questions/42826/where-to-start-with-entity-framework">Stack OverFlow</a>, and I've found one tutorial at <a href="http://dotnet-architecture-jdo.blogspot.com/2008/08/adonet-entity-framework-part.html" rel="nofollow noreferrer">Jason's DotNet Architecture Blog</a>, but can anyone recommend any other good tutorials? Any tutorials available from Microsoft, either online or as part of any conference/course material?</p>
<p>Microsoft offers <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=355c80e9-fde0-4812-98b5-8a03f5874e96&amp;displaylang=en" rel="noreferrer">.NET 3.5 Enhancements Training Kit</a> it contains documentation and sample code for ADO.NET EF</p>
<p>Sample application from <a href="http://msdn.microsoft.com/en-us/library/bb399296.aspx" rel="nofollow noreferrer">MSDN</a></p> <p>And some inside information from <a href="http://blogs.msdn.com/adonet/" rel="nofollow noreferrer">ADO.NET Team Blog</a></p>
8,747
<p>I have a console program written in C# that I am using to send faxes. When I step through the program in Visual Studio it works fine. When I double click on the program in Windows Explorer it works fine. When I setup a Windows scheduled task to run the program it fails with this in the event log.</p> <pre><code>EventType clr20r3, P1 consolefaxtest.exe, P2 1.0.0.0, P3 48bb146b, P4 consolefaxtest, P5 1.0.0.0, P6 48bb146b, P7 1, P8 80, P9 system.io.filenotfoundexception, P10 NIL. </code></pre> <p>I wrote a batch file to run the fax program and it fails with this message.</p> <pre><code>Unhandled Exception: System.IO.FileNotFoundException: Operation failed. at FAXCOMEXLib.FaxDocumentClass.ConnectedSubmit(FaxServer pFaxServer) </code></pre> <p>Can anyone explain this behavior to me?</p>
<p>I can't explain it - but I have a few ideas.</p> <p>Most of the times, when a program works fine testing it, and doesn't when scheduling it - security is the case. In the context of which user is your program scheduled? Maybe that user isn't granted enough access.</p> <p>Is the resource your programm is trying to access a network drive, that the user running the scheduled task simply haven't got?</p>
<p>Check that you set correct working directory for your task</p>
5,787
<p>My Prusa Mk3 has been making this sort of rough surface on prints, and I'm not sure what caused this. I am printing with PLA Prusament with 0.2&nbsp;mm layer height at the preset for PLA. What is this, and how can I fix it?</p> <p><a href="https://i.stack.imgur.com/qRzOM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qRzOM.jpg" alt="Print with rough surface finish"></a></p> <p><strike>Edit: Changed absolutely nothing, tried again and problem solved!</strike></p>
<p>The OP was not able to reproduce the problem as can be taken from an edit to his question:</p> <blockquote> <p>Changed absolutely nothing, tried again and problem solved!</p> </blockquote> <p><em>To honor the Q/A approach used on SE sites, this comment has been converted to a community answer, that once voted for will not make this question pop up once in a while.</em></p>
<p>To me this looks like your nozzle is too hot. Try turning the temp down by 5 degrees at a time and see if the issue goes away.</p>
1,208
<p>It's <a href="http://www.codeproject.com/KB/cs/csharpcasts.aspx" rel="noreferrer">shown</a> that 'as' casting is much faster than prefix casting, but what about 'is' reflection? How bad is it? As you can imagine, searching for 'is' on Google isn't terribly effective.</p>
<p>There are a few options:</p> <ol> <li>The <strong>classic cast</strong>: <code>Foo foo = (Foo)bar</code></li> <li>The <strong><code>as</code> cast operator</strong>: <code>Foo foo = bar as Foo</code></li> <li>The <strong><code>is</code> test</strong>: <code>bool is = bar is Foo</code></li> </ol> <hr> <ol> <li>The <strong>classic cast</strong> needs to check if <code>bar</code> can be safely cast to <code>Foo</code> (quick), and then actually do it (slower), or throw an exception (really slow).</li> <li>The <strong><code>as</code> operator</strong> needs to check if <code>bar</code> can be cast, then do the cast, or if it cannot be safely cast, then it just returns <code>null</code>.</li> <li>The <strong><code>is</code> operator</strong> just checks if <code>bar</code> can be cast to Foo, and return a <code>boolean</code>.</li> </ol> <p>The <strong><code>is</code></strong> test is quick, because it only does the first part of a full casting operation. The <strong><code>as</code></strong> operator is quicker than a classic cast because doesn't throw an exception if the cast fails (which makes it good for situations where you legitimately expect that the cast might fail).</p> <p>If you just need to know if the variable <code>bar</code>is a <code>Foo</code> then use the <strong><code>is</code></strong> operator, <strong>BUT</strong>, if you're going to test if <code>bar</code> is a <code>Foo</code>, and if so, <strong>then cast it</strong>, then you should use the <strong><code>as</code></strong> operator.</p> <p>Essentially every cast needs to do the equivalent of an <code>is</code> check internally to begin with, in order to ensure that the cast is valid. So if you do an <code>is</code> check followed by a full cast (either an <code>as</code> cast, or with the classic cast operator) you are effectively doing the <code>is</code> check twice, which is a slight extra overhead.</p>
<p>It should be quick enough to not matter. If you are checking the type of an object enough for it to make a noticeable impact on performance you need to rethink your design</p>
8,204
<p>I bought a set of 5 <a href="https://a.aliexpress.com/_mL7Tt7b" rel="nofollow noreferrer">stepper motors</a> from Trianglelab's official Aliexpress shop.</p> <p><a href="https://i.stack.imgur.com/XZDW8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XZDW8.jpg" alt="enter image description here" /></a></p> <p>Only one of these motors was given any kind of protective bubble wrap for shipping. The contents of the package shifted in transit and several of the motors got banged up with two of them suffering visible damage to their wire insulation.</p> <p>I contacted Trianglelabs and was told to fix it myself for \$0.03 with a wire or to add some tape. This repair advice was accompanied with the weightiest assumptions of my personal expertise that I have ever received.</p> <p>At this point I'm not planning to keep them if this is how the company does business; shaving pennies on shipping and telling the buyer to fix it themselves.</p> <p>But all of this brought up an interesting question. How can I reliably test my stepper motors for basic functionality and measured compliance with the rated specifications?</p>
<p>For the AliExpress part, open a dispute and attach pictures to the dispute and ask for a partial, reasonable discount. It always worked for me.</p> <p>As for how to test the motors themselves, it depends on what other hardware you have.</p> <p>For example, you could wire the motors to your printer board, and try to issue a <a href="https://marlinfw.org/docs/gcode/G006.html" rel="nofollow noreferrer">G6</a> command to that motor.</p> <p>If you find issues while testing the motors, that could be evidence for an even bigger discount, or even full refund if the motor doesn't work.</p>
<p>I would be far more worried about damage to the wire insulation (i.e. are they nicked/cut at all or just scuffed up?) as that could potentially lead to a short circuit situation against your frame etc. Assuming no serious cable damage, motors can take a fair amount of mechanical abuse so I'd just put them through their paces with short (a few seconds) forward/backward movements at various speeds listening for any scraping/grinding/other unusual noises indicating any interior damage. Assuming no issues found, then you could run them for a more extended period of time (5-10 minutes or so periodically changing direction/speed) and if that didn't reveal anything, I wouldn't worry about it. If it helps, you're probably going to inadvertently abuse them electrically/thermally far more than the shipment did over their service life.</p> <p>Unfortunately, when shipping things overseas sometimes the packaging is insufficient (somewhat surprising for Trianglelab as that's one area I generally see people give them high marks for) and bad things can happen during shipment. I've received all sorts of mangled packages and, aside from the irritation of knowing it was probably avoidable but for the bad packaging, I usually try to be reasonable when tallying up any damage when asking for a refund (partial or otherwise). If you really feel like a seller fell short, then your best recourse is generally to ding them on their rating if it's really warranted. Yes, it's irritating, but it will happen from time to time.</p>
1,788
<p>I've found a few resources on the subject, but they all require a deep understanding of <a href="http://en.wikipedia.org/wiki/Smalltalk" rel="noreferrer">SmallTalk</a> or <a href="http://en.wikipedia.org/wiki/Haskell_%28programming_language%29" rel="noreferrer">Haskell</a>, neither of which I know.</p>
<p>Here are some parser combinator libraries in more mainstream languages:</p> <ul> <li><a href="http://spirit.sourceforge.net/documentation.html" rel="noreferrer">Spirit</a> (C++)</li> <li><a href="http://jparsec.codehaus.org/" rel="noreferrer">Jparsec</a> (Java)</li> </ul>
<p><s>Cay Horstmann has <a href="http://horstmann.com/sjsu/cs152/schedule.html" rel="nofollow noreferrer">4 combinator parser lectures in Scala</a>, with exercises.</s> There is an example of parsing external DSLs in Scala <a href="http://debasishg.blogspot.com/2008/04/external-dsls-made-easy-with-scala.html" rel="nofollow noreferrer">here</a>.</p>
3,843
<p>I'm getting seemingly random lines scattered across the top surface of my prints:</p> <p><img src="https://i.stack.imgur.com/UdXPx.jpg" alt="lines1"> <img src="https://i.stack.imgur.com/gf0OH.jpg" alt="lines2"></p> <p>Printer: Anycubic i3 mega<br> Slicer: Cura 3.2.1<br> Printer chosen in Cura: Prusa i3, <em>Gcode flavor</em> changed to <em>RepRap</em><br> Cura Profile: <em>Fine</em>, "Outer before inner walls" enabled</p> <p>What might be the reason?</p>
<p>Our local library has a genuine Prusa i3 Mk2.5 that recently had this problem. Because of the number of fingers engaging such a system, it was not immediately discovered that a different profile had been selected in which the Z-hop was turned off.</p> <p>Z-hop is a feature in which the nozzle lifts slightly (and is height-adjustable) as it moves from one portion of the print to another.</p> <p>According to my brief research, Cura supports z-hop in the settings. Either it has to be activated or perhaps slightly increased. The aforementioned Prusa works great with 0.5 mm lift.</p>
<p>It seems like the issue may only be that your nozzle has developed a bit of oozing. The g code likes to repeat the same patterns for at least a few layers every time it changes patterns and if it does the same pattern on the top 3-4 layers than by the time it reaches the last layer on the top that pattern will actually be the slightest bit raised above the rest of the layers because of the ooze building up along the same pattern for how many ever layers it followed the same pattern. Your nozzle is than rubbing on that raised pattern when it completes the last layer. This explains the randomness like OP said because the g code may not repeat the same pattern for 3 or more layers at the surface but without reading the gcode it would seemingly be random when and where they occurred. And truthfully if its a small oozing you could reprint this and it could be gone if you changed almost any setting in cura because the g code would be recalculated differently and new patterns would be chosen but so long as the new gcode did not have the same pattern repeat itself on the top 3 or so layers you would not have these raised patterns for the nozzle to rub on when finishing the top last layer. </p>
840
<p>I'm cleaning up some old Maildir folders, and finding messages with names like:</p> <p>1095812260.M625118P61205V0300FF04I002DC537_0.redoak.cise.ufl.edu,S=2576:2,ST</p> <p>They don't show up in my IMAP client, so I presume there's some semaphore indicating the message already got moved somewhere else. Is that the case, and can the files be deleted without remorse?</p>
<p>The 'M' is just part of the unique filename and has nothing to do with the fact that the mail doesn't show up in mail clients. </p> <p>The 'T' at the end of the filename, after the ':' sign, however tells the IMAP server that this message is Trashed.</p> <p>See <a href="http://cr.yp.to/proto/maildir.html" rel="noreferrer">http://cr.yp.to/proto/maildir.html</a></p>
<p>IMAP, is a protocol for communicating to a message storage, the actual storage is standardised in other ways. The filename looks like a <a href="http://en.wikipedia.org/wiki/Maildir" rel="nofollow noreferrer">Maildir</a> filename where I think does not put any meaning into the first part of the filename, but you have to check with your software manual.</p>
9,553
<p>I've created some MbUnit Test Fixtures that have SetUp methods marked with the SetUp attribute. These methods run before the tests just fine using the MbUnit GUI, the console runner, and the ReSharper MbUnit plugin. However, when I run the tests with TestDriven.NET it does not run the SetUp methods at all. </p> <p>Does anyone know if this is a bug with TestDriven.NET or if I have something setup wrong?</p>
<p>No longer an issue with recent versions of Gallio since v3.0.4. Just make sure to use the 64-bit installer.</p>
<p>I came across a similar issue with NUnit and TestDriven.NET that took me hours to figure out. I installed the Visual Studio Extension below and it hit breakpoint in the Tests but skipped the one in the one in the [TestFixtureSetUp].</p> <p><a href="https://i.stack.imgur.com/sl5xw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sl5xw.png" alt="enter image description here"></a></p> <p>It turned out that I also needed the actual TestDriven.NET software to be installed at C:\Program Files (x86)\TestDriven.NET 4</p> <p>This is available from <a href="https://www.testdriven.net/download.aspx" rel="nofollow noreferrer">https://www.testdriven.net/download.aspx</a></p>
2,601
<ol> <li>Is it possible to capture Python interpreter's output from a Python script?</li> <li>Is it possible to capture Windows CMD's output from a Python script?</li> </ol> <p>If so, which librar(y|ies) should I look into?</p>
<p>If you are talking about the python interpreter or CMD.exe that is the 'parent' of your script then no, it isn't possible. In every POSIX-like system (now you're running Windows, it seems, and that might have some quirk I don't know about, YMMV) each process has three streams, standard input, standard output and standard error. Bu default (when running in a console) these are directed to the console, but redirection is possible using the pipe notation:</p> <pre><code>python script_a.py | python script_b.py </code></pre> <p>This ties the standard output stream of script a to the standard input stream of script B. Standard error still goes to the console in this example. See the article on <a href="http://en.wikipedia.org/wiki/Standard_streams" rel="nofollow noreferrer">standard streams</a> on Wikipedia.</p> <p>If you're talking about a child process, you can launch it from python like so (stdin is also an option if you want two way communication):</p> <pre><code>import subprocess # Of course you can open things other than python here :) process = subprocess.Popen(["python", "main.py"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) x = process.stderr.readline() y = process.stdout.readline() process.wait() </code></pre> <p>See the Python <a href="http://docs.python.org/lib/module-subprocess.html" rel="nofollow noreferrer">subprocess</a> module for information on managing the process. For communication, the process.stdin and process.stdout pipes are considered standard <a href="http://docs.python.org/lib/bltin-file-objects.html" rel="nofollow noreferrer">file objects</a>.</p> <p>For use with pipes, reading from standard input as <a href="https://stackoverflow.com/questions/24931/how-to-capture-python-interpreters-andor-cmdexes-output-from-a-python-script#24939">lassevk</a> suggested you'd do something like this:</p> <pre><code>import sys x = sys.stderr.readline() y = sys.stdin.readline() </code></pre> <p>sys.stdin and sys.stdout are standard file objects as noted above, defined in the <a href="http://docs.python.org/lib/module-sys.html" rel="nofollow noreferrer">sys</a> module. You might also want to take a look at the <a href="http://docs.python.org/lib/module-pipes.html" rel="nofollow noreferrer">pipes</a> module.</p> <p>Reading data with readline() as in my example is a pretty naïve way of getting data though. If the output is not line-oriented or indeterministic you probably want to look into <a href="http://docs.python.org/lib/poll-objects.html" rel="nofollow noreferrer">polling</a> which unfortunately does not work in windows, but I'm sure there's some alternative out there.</p>
<p>In which context are you asking?</p> <p>Are you trying to capture the output from a program you start on the command line?</p> <p>if so, then this is how to execute it:</p> <pre><code>somescript.py | your-capture-program-here </code></pre> <p>and to read the output, just read from standard input.</p> <p>If, on the other hand, you're executing that script or cmd.exe or similar from within your program, and want to wait until the script/program has finished, and capture all its output, then you need to look at the library calls you use to start that external program, most likely there is a way to ask it to give you some way to read the output and wait for completion.</p>
4,457
<p>I'm having a really hard time printing on my aluminum heated bed... Cleaning it just results in it being scratched (trying to scrape dried hairspray/glue/etc off) and I don't think it is particularly flat either.</p> <p>I was thinking of stopping by the dollar store on my way home and getting several picture frames and using the glass from them as interchangeable glass beds - this would also make it easier to take them off the printer to clean without needing to re-level the bed every time as the aluminum base would stay-put.</p> <p>Do you guys think the quality of it would be okay to print on? (withstand the heat, be flat enough, etc) I'm planning to coat it in purple-glue-stick as I have heard that works well for adhesion purposes.</p> <p>For reference: Printing PLA, Prusia i3 printer.</p>
<p>Picture frame glass (generally float glass) will work well enough, but count on it eventually cracking/getting chipped. It's always very flat (due to the way the production process works).</p> <p>Taking it up to 100-110C for printing ABS should not be a problem, but you'll want to avoid sharp changes in temperature, and should be careful that your prints don't adhere too well: I've had PLA/PETG prints take out pieces of glass with them due to the force required to remove them from the build plate. You might want to try without any (or very little) adhesive first, and make sure your nozzle isn't too close to the build plate.</p>
<p>I was driving down the street the other day and saw a very nice OLD and LARGE mirror on a lawn at a garage sale. It was about 36" x 28". </p> <p>Sale price? $5.00</p> <p>I'm going to be using it for my MPCNC machine to allow me to print large prints on glass. The reason I like the OLD mirrors is that they are much thicker than the new ones and therefore more durable and solid.</p> <p>If you're trying to stay economical, you can probably find an old mirror at a garage sale somewhere. </p> <p>That being said, I currently print on glass with a heated bed and spray it with Aquanet Hair Spray. I have discovered that with PLA, if I heat the bed to 60 Celsius before printing and then allow it to cool down to room temperature before removing the print job, I am able to very easily remove items from the glass. Very little effort.</p> <p>So, in summary, I'd recommend using Glass or a Mirror as your surface, heating it to 60 celsius before you print, spray it with aquanet hair spray, and you'll be glad you did.</p> <p>Good luck.</p>
360
<p>I have a perl variable <code>$results</code> that gets returned from a service. The value is supposed to be an array, and <code>$results</code> should be an array reference. However, when the array has only one item in it, <code>$results</code> will be set to that value, and not a referenced array that contains that one item.</p> <p>I want to do a <code>foreach</code> loop on the expected array. Without checking <code>ref($results) eq 'ARRAY'</code>, is there any way to have something equivalent to the following:</p> <pre><code>foreach my $result (@$results) { # Process $result } </code></pre> <p>That particular code sample will work for the reference, but will complain for the simple scalar.</p> <p>EDIT: I should clarify that there is no way for me to change what is returned from the service. The problem is that the value will be a scalar when there is only one value and it will be an array reference when there is more than one value.</p>
<p>im not sure there's any other way than:</p> <blockquote> <pre><code>$result = [ $result ] if ref($result) ne 'ARRAY'; foreach ..... </code></pre> </blockquote>
<p>I've just tested this with:</p> <blockquote> <pre><code>#!/usr/bin/perl -w use strict; sub testit { my @ret = (); if (shift){ push @ret,1; push @ret,2; push @ret,3; }else{ push @ret,"oneonly"; } return \@ret; } foreach my $r (@{testit(1)}){ print $r." test1\n"; } foreach my $r (@{testit()}){ print $r." test2\n"; } </code></pre> </blockquote> <p>And it seems to work ok, so I'm thinking it has something to do with the result getting returned from the service? If you have no control over the returning service this might be hard one to crack</p>
2,527
<p>This should be fine seeing as the CLR hasn't actually changed?</p> <p>The boxes running the C# 2.0 code <strong>have</strong> had .NET 3.5 rolled out.</p> <p>The background is that we have a windows service (.NET 2.0 exe built with VS2005, deployed to ~150 servers) that dynamically loads assemblies (almost like plug-ins) to complete various work items asked of it. Whenever we roll out a new version of the bus logic, we just drop the assemblies on an FTP server and the windows service knows how to check for, grab and store the latest versions. New assemblies are now built using VS2008 and targetting .NET 2.0, we know that works ok. However we'd like to start taking advantage of C# 3.0 language features such as LINQ and targetting the assemblies against .NET 3.5 without having to build and deploy a new version of the windows service.</p>
<p>C#3 and .Net 3.5 adds new assemblies, but the IL is unchanged.</p> <p>This means that with .Net 2 assemblies you can compile and use C#3, as long as you don't use Linq or anything else that references System.Linq or System.Core</p> <p><code>yield</code>, <code>var</code>, lambda syntax, anon types and initialisers are all compiler cleverness. The IL they produce is cross-compatible.</p> <p>If you can reference the new assemblies for 3.5 it should all just work.</p> <p>There is no new version of ASP.Net - it should still be 2.0.50727 - but you should still compile for 3.5</p>
<p>This is interesting stuff. I was looking at <a href="http://www.albahari.com/nutshell/linqbridge.html" rel="nofollow noreferrer">LinqBridge</a> yesterday after someone on this forum suggested it to me and they are doing a similar thing.</p> <p>I find it strange that Microsoft named the frameworks 2.0, 3.0 and 3.5 when they all compile down to produce the same IL required by the 2.0 CLR. I would have thought adding versions onto 2.0 would have made more sense altho I suppose it also is hard to get people to get their head around the fact that there are different versions of runtimes, compilers and languages.</p>
3,092
<p>I'm almost certain I know the answer to this question, but I'm hoping there's something I've overlooked.</p> <p>Certain applications seem to have the Vista Aero look and feel to their caption bars and buttons even when running on Windows XP. (Google Chrome and Windows Live Photo Gallery come to mind as examples.) I know that one way to accomplish this from WinForms would be to create a borderless form and draw the caption bar/buttons yourself, then overriding <code>WndProc</code> to make sure moving, resizing, and button clicks do what they're supposed to do (I'm not clear on the specifics but could probably pull it off given a day to read documentation.) I'm curious if there's a different, easier way that I'm overlooking. Perhaps some API calls or window styles I've overlooked?</p> <p>I believe Google has answered it for me by using the roll-your-own-window approach with Chrome. I will leave the question open for another day in case someone has new information, but I believe I have answered the question myself.</p>
<p>Here's an article with full code sample on how to use your own custom &quot;chrome&quot; for an application:</p> <p><a href="https://web.archive.org/web/20200718062913/http://geekswithblogs.net:80/kobush/articles/CustomBorderForms3.aspx" rel="nofollow noreferrer">http://geekswithblogs.net/kobush/articles/CustomBorderForms3.aspx</a></p> <p>This looks like some really good stuff. There are a total of 3 articles in it's series, and it runs great, and on Vista too!</p>
<p>Nope, I am afraid, there is no other easy way of doing this. </p> <p>You are on the right track. You will need to create a custom Winform and then proceed as illustrated in this <a href="http://codemaverick.blogspot.com/2007/02/creating-custom-winforms-in-net-20-yes.html" rel="nofollow noreferrer">example</a>.</p>
6,394
<p>I made a torus that was 1 on the x and y axes, and 3 on the z axis in Blender. It is supposed to be a bead for a beaded necklace. It was exported to Cura as an .stl, then printed on a Lulzbot Mini. It worked fine in plastic, but when we tried it with bronze filament the nozzle clogged and it didn't start printing.<br> Is there something I need to add to the model that will provide instructions for the printer? The person who operates the printer says that most, but not all, of the models he prints in bronze have a border around them when they print, and this one didn't. I don't know if that makes a difference.</p>
<p>We print a lot of stuff in a variety of materials, and I think it is likely what you are experiencing is a problem caused by some combination of the following: Object size overall, object detail size, wall thickness, or span width/thickness.</p> <p>Blender gives pretty clean stls, but the last-mile needed to get output is primarily a materials engineering problem.... (and saying thias, I am assuming you got a valid stl that the printer was able to read and rip...)</p> <p>A first thought: Try loading your stl into one of the services that price online. Shapeways does, and Cubify does or did... and you can download the driver software for the Form2 even if you don't own the printer.</p> <p>Bring your stl into these apps and look for error messages. The Shapeways ordering app does a nice job of showing issues, particularly ones like wall thickness and manifold faces/vertices (another possibility I did not mention above) very quickly.</p> <p>I'd offer to look at your stl if it is something you can share... and/or you can ask your output guy for a sample stl he has printed with some success before. Bring that stl file into Blender beside your model and compare.</p> <p>I do not recognize a "border" around stls, but all of the printers have preferences for the support sprues that support the model as it is built.... possible that he means these?</p> <p>In any case, shout if I can help. We have used a lot of materials, but some of them take tweaking -- most often with detail size (how small of a detail you can recreate on the rpinted surface) and step size (how small the steps are inbetween printed layers in additive rinting systems.</p> <p>Or... just chuck it onto a CNC with a big ole' block of bronze and machine it down! That's pretty old school, but it works, too... just by removing material rather than adding. </p> <p>Here's a torus at Shapeways I uploaded....</p> <p><a href="https://i.stack.imgur.com/7gMY6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7gMY6.jpg" alt="enter image description here"></a></p>
<p>We print a lot of stuff in a variety of materials, and I think it is likely what you are experiencing is a problem caused by some combination of the following: Object size overall, object detail size, wall thickness, or span width/thickness.</p> <p>Blender gives pretty clean stls, but the last-mile needed to get output is primarily a materials engineering problem.... (and saying thias, I am assuming you got a valid stl that the printer was able to read and rip...)</p> <p>A first thought: Try loading your stl into one of the services that price online. Shapeways does, and Cubify does or did... and you can download the driver software for the Form2 even if you don't own the printer.</p> <p>Bring your stl into these apps and look for error messages. The Shapeways ordering app does a nice job of showing issues, particularly ones like wall thickness and manifold faces/vertices (another possibility I did not mention above) very quickly.</p> <p>I'd offer to look at your stl if it is something you can share... and/or you can ask your output guy for a sample stl he has printed with some success before. Bring that stl file into Blender beside your model and compare.</p> <p>I do not recognize a "border" around stls, but all of the printers have preferences for the support sprues that support the model as it is built.... possible that he means these?</p> <p>In any case, shout if I can help. We have used a lot of materials, but some of them take tweaking -- most often with detail size (how small of a detail you can recreate on the rpinted surface) and step size (how small the steps are inbetween printed layers in additive rinting systems.</p> <p>Or... just chuck it onto a CNC with a big ole' block of bronze and machine it down! That's pretty old school, but it works, too... just by removing material rather than adding. </p> <p>Here's a torus at Shapeways I uploaded....</p> <p><a href="https://i.stack.imgur.com/7gMY6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7gMY6.jpg" alt="enter image description here"></a></p>
260
<p>How do you determine when to use <a href="http://www.iselfschooling.com/mc4articles/mc4cluster.htm" rel="noreferrer">table clusters</a>? There are two types, index and hash, to use for different cases. In your experience, have the introduction and use of table clusters paid off?</p> <p>If none of your tables are set up this way, modifying them to use table clusters would add to the complexity of the set up. But would the expected performance benefits outweight the cost of increased complexity in future maintenance work? </p> <p>Do you have any favorite online references or books that describe table clustering well and give good implementation examples? </p> <p>//Oracle tips greatly appreciated. </p>
<p>The killer feature of table clusters is that you can store <strong>related rows of different tables</strong> at the same physical location.</p> <p>That can improve join performance by an order of magnitude. However, it doesn't pay of so often as it sounds.</p> <p>The only time I used it was a three-table join, executed by two hash joins. It took too long ;). However, the join was on the same column, so it was possible to use a hash table cluster keyed by the join column. That caused all related rows to be stored alongside (ideally, in the same database block). Knowing that, Oracle can execute the join with a special optimization ("cluster join").</p> <p>It's more or less pre-joined, but still feeling like normal tables (for INSERT/SELECT/UPDATE/DELETE).</p> <p>On the other hand, there are "single table clusters" that are mostly used to control the "clustering factor" -- A similar idea like clustered indexes (called Index-Organized-Table in Oracle) but not adding high cost if using a secondary index.</p>
<p>I haven't used Oracle's table clusters myself, but I understand that its index table clusters are very much like MS SQL Server's clustered indexes. That is, the row data is physically organized by the clustered index's key.</p> <p>That makes one ideal for a heavily-accessed column that has a reasonably small number of possible values (compared to the total number of rows), where most queries want to retrieve all rows with a particular value. Because all such rows are physically stored together, disk I/O, particularly seek time, is reduced.</p> <p>"Reasonably small" is not easily defined, but postal or zip codes in an address table seems reasonable if you're often querying for all addresses in a single code's region. Province/state/territory codes are likely too small a selection for a country-wide address table.</p> <p>So, you don't want to use them on columns with few possible values (e.g., M/F for gender) because then the clustering doesn't buy you anything and likely costs you for insertions. You also never want to use clustering on "autonumber" surrogate key columns (from sequences in Oracle) because that will create a "hot spot" in the last extent of the table as all insertions must physically happen there. You also don't want to apply clustering to a column value that will be updated because the RDBMS will have to physically move the record to maintain the clustered ordering.</p>
4,769
<p>I'd like to create a progress bar to indicate the status of an a batch job in <code>Ruby</code>. </p> <p>I've read some <a href="http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/" rel="noreferrer" title="NCURSES Programming HOWTO">tutorials</a> / <a href="http://ncurses-ruby.berlios.de/" rel="noreferrer" title="ncurses-ruby">libraries</a> on using <em>(n)curses</em>, none of which were particularly helpful in explaining how to create an <em>"animated"</em> progress bar in the terminal or using curses with <code>Ruby</code>. </p> <p>I'm already aware of using a separate thread to monitor the progress of a given job, I'm just not sure how to proceed with drawing a progress bar. </p> <hr> <p><strong>Update</strong> </p> <p><a href="http://0xcc.net/ruby-progressbar/" rel="noreferrer" title="ruby-progressbar">ProgressBar</a> class was incredibly straight-forward, perfectly solved my problem.</p>
<p>You might be able to get some implementation ideas from the <a href="http://0xcc.net/ruby-progressbar/" rel="noreferrer" title="Ruby/ProgressBar">Ruby/ProgressBar library</a>, which generates text progress bars. I stumbled across it a couple of months back but haven't made any use of it.</p>
<p>On windows, curses works out of the box, ncurses doesn't, and for a progress bar curses should be sufficient. So, use curses instead of ncurses.</p> <p>Also, both curses and ncurses are wafer-thin wrappers around the c library - that means you don't really need Ruby-specific tutorials.</p> <p>However, on the <a href="http://www.pragprog.com/titles/ruby/source_code" rel="nofollow noreferrer">site for the PickAxe</a> you can download all the code examples for the book. The file "ex1423.rb" contains a curses demo which plays Pong - that should give you plenty of material to get you going.</p>
2,371
<p>I am slicing with Cura and Slic3r and one important thing that I recently took my attention is that cura positions head in start point of the new layer and then lifts the nozzle. That caused my few printouts to fall as they collided with the nozzle. </p> <p>Slic3r behavior is different: it raises the nozzle in last printed point and then moves to a new layer starting point (which for me is more obvious)</p> <p><strong>Is there a way to instruct Cura to lift nozzle before it goes to the starting point of a new layer?</strong> excluding Z-hops.</p>
<p>To lift the head to prevent the nozzle to tip over your print you could use an option called <code>Z hop</code> in Cura. Just enter `hop' in the search box on the right side to make those options magically appear (in a recent version of Cura, e.g. version 3.x.x).</p> <p>Other than <code>Z hop</code> there is no default action, or series of commands, per layer to be specified before the start of the layer. There are 2 other ways to circumvent this:</p> <ol> <li>The first is saving you G-code to file and open the file in an advanced text editor (e.g. Notepad++). With a (recorded) macro you can find the words <code>;LAYER:</code>, which are inserted by Cura before each layer starts, and insert a pre-copied list of commands that set the movement in relative mode, move Z up 2 mm, set into absolute mode again. When the next layer starts the extruder goes to the layer start from a 2 mm rise.</li> <li>Write a plugin for Cura to post-process (<code>C:\Program Files\Ultimaker Cura x.x\plugins\PostProcessingPlugin\scripts</code>) the G-code file to inject the code to Z hop before the start of every layer, or a plugin that adds a new option and/or category to the slicer settings sidebar of the GUI.</li> </ol>
<p>OK, after going via all the options I found that CURA has a combing mode which reduces retraction and offers another option which is <code>Avoid Printed Parts When Traveling</code>.</p> <p>That solves my problem.</p>
954
<p>We are using SourceForge Enterprise Edition 4.4 in one of our project.</p> <p>My question is, in CollabNet SFEE (SourceForge Enterprise Edition 4.4), how will we get attachments associated with an Artifacts Using SFEE SOAP API?</p> <p>We have made our own .net 2.0 client. We are not using .net SDK provided by Collabnet,</p>
<p>If you commit with a message you can add "[artf1000]" (where artf1000 is your artifact number) to the beginning or end of your commit message. Then it will associate to that artifact you can also do this with documents using doc1000, to get the id of the item you can use the URL it is what is after the <a href="http://sfeeserver/sf/go/" rel="nofollow noreferrer">http://sfeeserver/sf/go/</a>.</p> <p>Documents and artifacts are the only item I have used this for so I am not sure about other types of links, but I would imagine anything that has a /go/ID could be referenced by the ID.</p> <p>ie:</p> <ul> <li><a href="http://sfeeserver/sf/go/artf1000" rel="nofollow noreferrer">http://sfeeserver/sf/go/artf1000</a> </li> <li><a href="http://sfeeserver/sf/go/doc1000" rel="nofollow noreferrer">http://sfeeserver/sf/go/doc1000</a></li> </ul> <p>Edited to add: I have seemingly successfully tried this with releases, tasks, and discussions as well.</p>
<p>You can cheat a little bit and have a look at the scripts from SFEE. Log into your SFEE via SSH and take a look at the following script: </p> <pre><code>/usr/local/sourceforge/sourceforge_home/integration/post-commit.py </code></pre> <p>Maybe it helps...</p>
5,885
<p>How can I format Floats in Java so that the float component is displayed only if it's not zero? For example:</p> <pre> 123.45 -> 123.45 99.0 -> 99 23.2 -> 23.2 45.0 -> 45 </pre> <p>Edit: I forgot to mention - I'm still on Java 1.4 - sorry!</p>
<p>If you use <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html" rel="nofollow noreferrer">DecimalFormat</a> and specify # in the pattern it only displays the value if it is not zero.</p> <p>See my question <a href="https://stackoverflow.com/questions/50532/how-do-i-format-a-number-in-java">How do I format a number in java?</a></p> <p>Sample Code</p> <pre><code> DecimalFormat format = new DecimalFormat("###.##"); double[] doubles = {123.45, 99.0, 23.2, 45.0}; for(int i=0;i&lt;doubles.length;i++){ System.out.println(format.format(doubles[i])); } </code></pre>
<pre><code>new Formatter().format( "%f", myFloat ) </code></pre>
7,809
<p>I decided to finally purchase an Ender 3 v2. It arrived today and after a few hours of making sure everything is straight, I tried to power it and do a test print...</p> <p>I was disappointed to see that the screen stays black after more than 10 seconds from power on.</p> <p>I did not insert any SD card in the printer or anything that could interfere with the presumably stock firmware on it.</p> <p>Because of this, I opened up the power source and the motherboard case and checked the voltages/checked LEDs. The motherboard blue led is on, the power source green led is on as well. I did a few measurements - I get 24 V to the motherboard with a small spike of 35 V when it starts.</p> <p>The hotend fan is always on.</p> <p>I checked the display connection and I am sure it is placed correctly.</p> <p>I tried to upload firmware onto the mainboard first by clearing the SD card (8 GB given by Creality) using <code>diskpart</code>. I wrote the 4.2.2 (same as motherboard version) firmware version (stock) onto the SD attempting to upload on the mainboard. I tried renaming it, unplugging the power cable, unplugging the screen cable, etc and nothing would work.</p> <p>I tried rewriting the <code>DWIN_SET</code> files but the screen would not turn to black/blue/orange colors. I tried <a href="https://www.reddit.com/r/ender3/comments/j04s40/how_to_fix_the_ender_3_v2_firmware_upgrade_black/" rel="nofollow noreferrer">more or less everything suggested here</a>.</p> <p>Is there anything I didn't do? What do you suggest? I already contacted the company where I bought it from, but I don't want to go through the assembly process twice - maybe I can make it work?</p> <hr /> <ul> <li>The correct voltage for the power supply is set at 230 V (Europe) and was set to this all the time. I tried switching it back and forth without power too. No result.</li> <li>I've contacted the supplier yesterday.</li> </ul>
<p>What seems to be a difficulty is the stabilizers for plastic absorb UV. So if added to UV resin, they probably greatly increase the exposure time needed.</p> <p>The following show characteristics of some plastics, taken from <a href="https://www.coleparmer.com/tech-article/uv-properties-of-plastics" rel="nofollow noreferrer">https://www.coleparmer.com/tech-article/uv-properties-of-plastics</a></p> <blockquote> <p>Unmodified types of plastics that are regarded as having unacceptable resistance to UV are POM (Acetal), PC, ABS and PA6/6. Other plastics such as PET, PP, HDPE, PA12, PA11, PA6, PES, PPO, PBT and PPO are regarded as fair. Note that a PC/ABS alloy is also graded as fair. Good resistance to ultraviolet rays can be achieved from polymers extruded by Zeus such as PTFE, PVDF, FEP, and PEEKTM. The only plastics found with excellent resistance are the imides, Polyimide (PI) as used in the Hubble Space Telescope and Polyetherimide (PEI).</p> </blockquote> <blockquote> <p>PTFE has particularly good UV resistance because of its very strong carbon- fluorine (C-F) bond [almost 30% higher than the carbon-hydrogen (C-H) bond], which is the common side bond that surrounds the carbon (C-C) backbone in a helix and protects it. Most fluoropolymers also do not have the light absorbing chromophore impurities in their structure that can act as an initiator for photo-oxidation.</p> </blockquote>
<p>Sunlight contains the full spectrum of electromagnetic radiation, including the wavelength to photoinitiate your resin. Most UV-curable materials are kept in opaque containers for this reason. The extent to which your material is crosslinked will depend on your material and how much sunlight it receives.</p>
1,880
<p>Several questions are related to first layer calibration or issues: I found 43 of them with "first layer" in the title alone, 150 with "first layer" anywhere (no duplicates).</p> <p>I propose adding a "first-layer" tag to more easily retrieve said questions.</p> <p>I already applied it to my latest question without thinking about it, but I can remove it if desired.</p>
<p>I think the <a href="https://3dprinting.stackexchange.com/questions/tagged/adhesion" class="post-tag" title="show questions tagged &#39;adhesion&#39;" rel="tag">adhesion</a> tag should be used instead.</p>
<p>Yes, I support this idea. A <a href="https://3dprinting.stackexchange.com/questions/tagged/first-layer" class="post-tag" title="show questions tagged &#39;first-layer&#39;" rel="tag">first-layer</a> tag would be useful.</p>
76
<p>I've heard that unit testing is "totally awesome", "really cool" and "all manner of good things" but 70% or more of my files involve database access (some read and some write) and I'm not sure how to write a unit test for these files.</p> <p>I'm using PHP and Python but I think it's a question that applies to most/all languages that use database access.</p>
<p>I would suggest mocking out your calls to the database. Mocks are basically objects that look like the object you are trying to call a method on, in the sense that they have the same properties, methods, etc. available to caller. But instead of performing whatever action they are programmed to do when a particular method is called, it skips that altogether, and just returns a result. That result is typically defined by you ahead of time. </p> <p>In order to set up your objects for mocking, you probably need to use some sort of inversion of control/ dependency injection pattern, as in the following pseudo-code:</p> <pre class="lang-php prettyprint-override"><code>class Bar { private FooDataProvider _dataProvider; public instantiate(FooDataProvider dataProvider) { _dataProvider = dataProvider; } public getAllFoos() { // instead of calling Foo.GetAll() here, we are introducing an extra layer of abstraction return _dataProvider.GetAllFoos(); } } class FooDataProvider { public Foo[] GetAllFoos() { return Foo.GetAll(); } } </code></pre> <p>Now in your unit test, you create a mock of FooDataProvider, which allows you to call the method GetAllFoos without having to actually hit the database.</p> <pre class="lang-php prettyprint-override"><code>class BarTests { public TestGetAllFoos() { // here we set up our mock FooDataProvider mockRepository = MockingFramework.new() mockFooDataProvider = mockRepository.CreateMockOfType(FooDataProvider); // create a new array of Foo objects testFooArray = new Foo[] {Foo.new(), Foo.new(), Foo.new()} // the next statement will cause testFooArray to be returned every time we call FooDAtaProvider.GetAllFoos, // instead of calling to the database and returning whatever is in there // ExpectCallTo and Returns are methods provided by our imaginary mocking framework ExpectCallTo(mockFooDataProvider.GetAllFoos).Returns(testFooArray) // now begins our actual unit test testBar = new Bar(mockFooDataProvider) baz = testBar.GetAllFoos() // baz should now equal the testFooArray object we created earlier Assert.AreEqual(3, baz.length) } } </code></pre> <p>A common mocking scenario, in a nutshell. Of course you will still probably want to unit test your actual database calls too, for which you will need to hit the database.</p>
<p>You could use <strong>mocking frameworks</strong> to abstract out the database engine. I don't know if PHP/Python got some but for typed languages (C#, Java etc.) there are plenty of choices</p> <p>It also depends on how you designed those database access code, because some design are easier to unit test than other like the earlier posts have mentioned.</p>
5,058
<p>How do you insert invisible watermarks in images for copyright purposes? I'm looking for a python library.</p> <p>What algorithm do you use? What about performance and efficiency?</p>
<p>You might want to look into Steganography; that is hiding data inside of images. There are forms that won't get lost if you convert to a lossier format or even crop parts of the image out.</p>
<p>I was going to post an answer similar to Ugh. I would suggest putting a small TXT file describing the image source (and perhaps a small copyright statement, if one applies) into the image in a manner that is difficult to detect and break.</p>
6,575
<p>Are there any free tools available to view the contents of the solution user options file (the .suo file that accompanies solution files)?</p> <p>I know it's basically formatted as a file system within the file, but I'd like to be able to view the contents so that I can figure out which aspects of my solution and customizations are causing it grow very large over time.</p>
<p>The .SUO file is effectively disposable. If it's getting too large, just delete it. Visual Studio will create a fresh one.</p> <p>If you <em>do</em> want to go poking around in it, it looks like an OLE Compound Document File. You should be able to use the StgOpenStorage function to get hold of an IStorage pointer.</p>
<p>I don't know any tool, but you can try to access user settings via <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivspersistsolutionopts_members%28VS.80%29.aspx" rel="nofollow noreferrer">IVsPersistSolutionOpts</a> interface</p>
7,766
<p>Is it possible in a large GWT project, load some portion of JavaScript lazy, on the fly? Like overlays. </p> <p>PS: Iframes is not a solution.</p>
<p>Check out <code>GWT.runAsync</code> as well as the Google I/O talk below, which goes into lazy loading of <code>JavaScript</code> in <code>GWT</code> projects.</p> <ul> <li><a href="http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting" rel="nofollow noreferrer">http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting</a></li> <li><a href="http://code.google.com/events/io/sessions/GoogleWavePoweredByGWT.html" rel="nofollow noreferrer">http://code.google.com/events/io/sessions/GoogleWavePoweredByGWT.html</a> (around time 25:30)</li> </ul>
<p>I think this is what you are looking for.</p> <pre><code>&lt;body onload="onloadHandler();"&gt; &lt;script type="text/javascript"&gt; function onloadHandler() { if (document.createElement &amp;&amp; document.getElementsByTagName) { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = './test.js'; var heads = document.getElementsByTagName('head'); if (heads &amp;&amp; heads[0]) { heads[0].appendChild(script); } } } function iAmReady(theName) { if ('undefined' != typeof window[theName]) { window[theName](); } } function test() { // stuff to do when test.js loads } &lt;/script&gt; </code></pre> <p>-- test.js</p> <pre><code>iAmReady('test'); </code></pre> <p>Tested and working in Firefox 2, Safari 3.1.2 for Windows, IE 6 and Opera 9.52. I assume up-level versions of those should work as well.</p> <p>Note that the loading is asynchronous. If you attempt to use a function or variable in the loaded file immediately after calling <code>appendChild()</code> it will most likely fail, that is why I have included a call-back in the loaded script file that forces an initialization function to run when the script is done loading.</p> <p>You could also just call an internal function at the bottom of the loaded script to do something once it has loaded.</p>
9,809
<p>Is there a way to detect if a flash movie contains any sound or is playing any music?<br> It would be nice if this could be done inside a webbrowser (actionscript <strong>from another flash object</strong>, javascript,..) and could be done <em>before</em> the flash movie starts playing.</p> <p>However, I have my doubts this will be possible altogether, so any other (programmable) solution is also appreciated</p>
<p>Yes, on the server side for sure. Client side? I don't know. (I'm a serverside kind of guy.) </p> <p>On the server side, one would have to parse the file, read the header and/or look for audio frames. (I've ported a haskel FLV parser to Java for indexing purposes myself, and there are other parsing utilities out there. It is possible.)</p> <p><a href="http://osflash.org/flv" rel="nofollow noreferrer">osflash.org's FLV page</a> has the gory details. Check out the FLV Format sections's FLV Header table. </p> <pre><code>FIELD DATA TYPE EXAMPLE DESCRIPTION Signature byte[3] “FLV” Always “FLV” Version uint8 “\x01” (1) Currently 1 for known FLV files Flags uint8 bitmask “\x05” (5, audio+video) Bitmask: 4 is audio, 1 is video Offset uint32-be “\x00\x00\x00\x09” (9) Total size of header (always 9 for known FLV files) </code></pre> <hr> <p>EDIT: My client side coding with Flash is non-existent, but I believe there is an onMetaDataLoad event that your code could catch. That might be happening a bit late for you, but maybe it is good enough?</p>
<p>With the <a href="https://web.archive.org/web/20080917191415/http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/utils/ByteArray.html" rel="nofollow noreferrer">ByteArray</a> you can do pretty much what you want. Before starting playback you can analyze the bytes of the FLV header (use byteArray.readByte() and refer to the specs) to determine to check if the audio flag is on. Since the FLV header is loaded almost instantly this shouldn't cause any inconvenient delay for the user.</p> <p>With SWF's it's a lot tricker -- i'm pretty sure there's no easy way to determine in advance if a swf plays audio somewhere. A way to do it could be to look at what assets the SWF has defined in the library but also then the swf could just load an external audio file (or even generate it with some hacks or the new apis in Flash player 10). If the swf's are user submitted (or something similar that's out of your immediate control) I think this is a risky road.. </p>
6,508
<p>For part of my application I have a need to create an image of a certain view and all of its subviews.</p> <p>To do this I'm creating a context that wraps a bitmap with the same-size as the view, but I'm unsure how to draw the view hierarchy into it. I can draw a single view just be setting the context and explicitly calling drawRect, but this does not deal with all of the subviews.</p> <p>I can't see anything in the NSView interface that could help with this so I suspect the solution may lie at a higher level.</p>
<p>I found that writing the drawing code myself was the best way to:</p> <ul> <li>deal with potential transparency issues (some of the other options do add a white background to the whole image)</li> <li>performance was much better</li> </ul> <p>The code below is not perfect, because it does not deal with scaling issues when going from bounds to frames, but it does take into account the isFlipped state, and works very well for what I used it for. Note that it only draws the subviews (and the subsubviews,... recursively), but getting it to also draw itself is very easy, just add a <code>[self drawRect:[self bounds]]</code> in the implementation of <code>imageWithSubviews</code>.</p> <pre><code>- (void)drawSubviews { BOOL flipped = [self isFlipped]; for ( NSView *subview in [self subviews] ) { // changes the coordinate system so that the local coordinates of the subview (bounds) become the coordinates of the superview (frame) // the transform assumes bounds and frame have the same size, and bounds origin is (0,0) // handling of 'isFlipped' also probably unreliable NSAffineTransform *transform = [NSAffineTransform transform]; if ( flipped ) { [transform translateXBy:subview.frame.origin.x yBy:NSMaxY(subview.frame)]; [transform scaleXBy:+1.0 yBy:-1.0]; } else [transform translateXBy:subview.frame.origin.x yBy:subview.frame.origin.y]; [transform concat]; // recursively draw the subview and sub-subviews [subview drawRect:[subview bounds]]; [subview drawSubviews]; // reset the transform to get back a clean graphic contexts for the rest of the drawing [transform invert]; [transform concat]; } } - (NSImage *)imageWithSubviews { NSImage *image = [[[NSImage alloc] initWithSize:[self bounds].size] autorelease]; [image lockFocus]; // it seems NSImage cannot use flipped coordinates the way NSView does (the method 'setFlipped:' does not seem to help) // Use instead an NSAffineTransform if ( [self isFlipped] ) { NSAffineTransform *transform = [NSAffineTransform transform]; [transform translateXBy:0 yBy:NSMaxY(self.bounds)]; [transform scaleXBy:+1.0 yBy:-1.0]; [transform concat]; } [self drawSubviews]; [image unlockFocus]; return image; } </code></pre>
<p>You can use <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSBitmapImageRep_Class/Reference/Reference.html#//apple_ref/occ/instm/NSBitmapImageRep/initWithFocusedViewRect:" rel="nofollow noreferrer" title="-[NSBitmapImageRep initWithFocusedViewRect:]"><code>-[NSBitmapImageRep initWithFocusedViewRect:]</code></a> after locking focus on a view to have the view render itself (and its subviews) into the given rectangle.</p>
3,566
<p>I have developed a high speed transactional server for transfering data over the internet so I do not need to rely upon a database implementation like MySQL to provide this. That opens up the question of which SQL version to use?</p> <p>I really like SQLite, but I am not convinced it is industrial strength yet What I do like is how lightweight it is on resources.</p> <p>I loathed MySQL 8 years ago, but now it obviously IS industrial strength and my partners use it, so it is the obvious choice on the server side. If I use it I will just be connecting through "localhost" to the installed server (windows service). My concern is about the memory usage.</p> <p>I DO NOT load the result set into memory, but I notice about 6Mb for the first connection. I am hoping subsequent connections are not an additional 6MB!</p> <p>If I use the libmysqld.dll embedded libarary then does each new connection load a new instance of the embedded client/server code into memory? We assume so since each process will have its own in process memory...</p> <p>Regardless, the manual states that When using the libmysqld embedded server, the memory benefits are essentially lost when retrieving results row by row because "memory usage incrementally increases with each row retrieved until mysql_free_result() is called." <a href="http://dev.mysql.com/doc/refman/5.1/en/mysql-use-result.html" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.1/en/mysql-use-result.html</a></p> <p>This means I must use the installed service. But is this as fast as the embedded server?</p> <p>Are there any other low cost flavors that have high reliability?</p>
<p>SQLite is used in more applications than any other DB. (Citation required).</p> <p>There are some issues with MySQL, like that it doesn't respect foreign integrity constraints.</p> <p>I'm currently a fan of PostgreSQL, which is also freely available (and, I think if you read the licensing of MySQL, actually turns out to have a more amenable license for commercial use). It seems to be higher performance than SQLite, which probably has more to do with it being run on an SMP machine, and making use to different threads. It also seems to be quite solid.</p>
<p>Sorry to be pedantic, but the title should really be "Which RDBMS?" - the way it's phrased makes about as much sense as "Which Java?" or "<a href="http://thedailywtf.com/Articles/Which-Internet.aspx" rel="nofollow noreferrer">Which Internet?</a>"...</p>
3,993
<p>I have a 200+ case statement in Classic ASP which is getting out of control. It sets 5 variables, based on which case is selected. Address, Phone, Name etc. Just sets the variables and nothing else in each case.</p> <p>Databases or files are not an option for this application.</p> <p>Coming from the Perl world I would use a hash to store this info. </p>
<p>Brian, the classic ASP equivalent of a Perl hash is the <a href="http://www.microsoft.com/technet/scriptcenter/guide/sas_scr_ildk.mspx?mfr=true" rel="nofollow noreferrer">Scripting.Dictionary</a> object.</p>
<p>This should be done with a database, but since you said that is not an option, nothing you will write will be any less complex than a switch statement, since it's all required to live in your code (according to your terms of no db and no files).</p> <p>I mean, you could use an Excel Spreadsheet if the idea of a <strong>database</strong> is too <strong>complicated</strong> but technically that would be a file as well!</p>
7,279
<p>I'm interested in looking at Erlang and want to follow the path of least resistance in getting up and running.</p> <p>At present, I'm planning on installing <a href="http://www.erlang.org/download.html" rel="noreferrer">Erlang R12B-3</a> and <a href="http://erlide.sourceforge.net/" rel="noreferrer">Erlide</a> (<a href="http://www.eclipse.org/" rel="noreferrer">Eclipse</a> plugin). This is largely a Google-result-based decision. Initially this will be on a Windows XP system, though I am likely to reproduce the environment on Ubuntu shortly after.</p> <p>Is there a significantly better choice? Even if it is tied to one platform.</p> <p>Please share your experiences.</p>
<p>I've only done a small bit of coding in Erlang but I found the most useful method was just to write the code in a text editor and have a terminal open ready to build my code as I need to (this was in Linux, but a similar idea would work in Windows, I'm sure).</p> <p>Your question didn't mention it, but if you're looking for a good book on Erlang, try <a href="http://oreilly.com/catalog/9780596518189/" rel="noreferrer">this one</a> by O'Reilly.</p>
<p>From what i've tried (and are still up to do), a good addition to an erlang dev. environment would be a virtual machine running ubuntu/yaws/erlang. Perhaps <a href="http://feeds.feedburner.com/10xSoftwareDevelopment?format=xml" rel="nofollow noreferrer">Erlyweb</a> (erlang/yaws framework) would be nice checking out too.</p> <p><a href="http://blog.ciarang.com/posts/compiling-erlang-on-ubuntu" rel="nofollow noreferrer">Ciaran</a>'s posts (this would be the first of his "series") about his erlang install is nice, as he details the steps in setting up the server (and other stuff like xmpp with jabberlang).</p>
2,484
<p>In C#, (and feel free to answer for other languages), what order does the runtime evaluate a logic statement?</p> <p>Example:</p> <pre><code>DataTable myDt = new DataTable(); if (myDt != null &amp;&amp; myDt.Rows.Count &gt; 0) { //do some stuff with myDt } </code></pre> <p>Which statement does the runtime evaluate first - </p> <pre><code>myDt != null </code></pre> <p>or:</p> <pre><code>myDt.Rows.Count &gt; 0 </code></pre> <p>?</p> <p>Is there a time when the compiler would ever evaluate the statement backwards? Perhaps when an "OR" operator is involved?</p> <hr> <blockquote> <p>&amp; is known as a logical bitwise operator and will always evaluate all the sub-expressions</p> </blockquote> <p>What is a good example of when to use the bitwise operator instead of the "short-circuited boolean"?</p>
<p>C# : Left to right, and processing stops if a non-match (evaluates to false) is found.</p>
<p>I have heard somewhere that compilers work backwards, but I am unsure how true this is.</p>
2,725
<p>I'm not a math guy in the least but I'm interested in learning about rigid body physics (for the purpose of implementing a basic 3d physics engine). In school I only took Maths through Algebra II, but I've done 3d dev for years so I have a fairly decent understanding of vectors, quaternions, matrices, etc. My real problem is reading complex formulas and such, so I'm looking for some decent rigid body dynamics references that will make some sense.</p> <p>Anyone have any good references?</p>
<p><a href="https://rads.stackoverflow.com/amzn/click/com/159059472X" rel="nofollow noreferrer" rel="nofollow noreferrer">Physics for Game Programmers</a> I think is better than <a href="https://rads.stackoverflow.com/amzn/click/com/0596000065" rel="nofollow noreferrer" rel="nofollow noreferrer">Physics for Game Developers</a>.</p> <p>If you want something thick in your bookshelf (like I do), Eberly's <a href="https://rads.stackoverflow.com/amzn/click/com/0122290631" rel="nofollow noreferrer" rel="nofollow noreferrer">3D Game Engine Design</a> and Erleben's <a href="https://rads.stackoverflow.com/amzn/click/com/1584503807" rel="nofollow noreferrer" rel="nofollow noreferrer">Physics-Based Animation</a> can accompany the above.</p>
<p>Trying not to get you to rip off your hair with frustration (well, Baraff's/Witkin great math articles with the multi-dimensional matrices would do that sometimes), you can look at the easier online articles such as the ones published in Gamasutra. Here are two of them:</p> <ol> <li><a href="http://www.gamasutra.com/resource_guide/20030121/kennedy_pfv.htm" rel="nofollow noreferrer">http://www.gamasutra.com/resource_guide/20030121/kennedy_pfv.htm</a></li> <li><a href="http://www.gamasutra.com/features/19990702/data_structures_01.htm" rel="nofollow noreferrer">http://www.gamasutra.com/features/19990702/data_structures_01.htm</a></li> <li><a href="http://www.gamasutra.com/resource_guide/20030121/jacobson_pfv.htm" rel="nofollow noreferrer">http://www.gamasutra.com/resource_guide/20030121/jacobson_pfv.htm</a></li> </ol> <p>You'd notice that they point at the mentioned resources as part of their references. I would add that unless you need to solve equations system for multiple particles, articulated characters, or non-rigid complex object, this might be enough to start with.</p> <p>If however, you do look for more advanced physics and mathematics which involves matrices and equations systems look up Witkin and Baraff's home pages (I think they are both in Pixar if I'm not mistaken), or start with Hecker (that tried more than several practical methods and documented his results).</p>
8,513
<p>Is there an easy way to convert a string from csv format into a string[] or list? </p> <p>I can guarantee that there are no commas in the data.</p>
<p>String.Split is just not going to cut it, but a Regex.Split may - Try this one:</p> <pre><code>using System.Text.RegularExpressions; string[] line; line = Regex.Split( input, ",(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))"); </code></pre> <p>Where 'input' is the csv line. This will handle quoted delimiters, and should give you back an array of strings representing each field in the line.</p>
<pre><code>CsvString.split(','); </code></pre>
9,906
<p>Is there anything which can help with msmq monitoring? I'd like to get some event/monit when a message appears in queue and the same on leave.</p>
<p>Check out the Windows Management Performance counters.</p> <p>If you look in your Administrative Tools and find "Performance Counters", you will be able to dig through there and find detailed metrics on what is happening on each message queue. This can also work for remote servers.</p> <p>Should you wish to create some sort of automation around the monitoring, check out the .NET libraries for reading these performance counters. There is a very rich and comprehensive API which should give you everything you need!</p>
<p>You can achieve this by using <a href="https://msdn.microsoft.com/en-us/library/ms703197%28v=vs.85%29.aspx" rel="nofollow"><strong>MSMQ</strong> triggers</a></p>
5,864
<p>I am the web guy for a large TV station. Our site is cached by Akamai. Pages render perfectly in our testing environment (not cached) and on our "origin" page (again, not cached), but when they are viewed on our live environment (the cached site), they do not render exactly the same as how I coded them. Maybe it's a tiny bit of spacing, maybe it's a CSS element (backgrounds especially) not displaying, and worst of all, forget all about floating DIVs. It's insane how much table design I have to do because of the failure to float.</p> <p>Does anyone else have experience with caching like this? Is there a tool I can use to see the changes in rendering?</p> <p>There is no one I can go to for support, because the company doesn't believe the problem exists. Please assist if you can.</p> <p>The site is built on a VB.Net backend that I do not have access to. I only have access to the front end.</p>
<p>I've been working on sites behind Akamai and can honestly say they don't mess with your code, so that's not the issue. It's more than likely one of the following:</p> <p><strong>You have a cache latency issue</strong> - You updated your html and css, and one of the two updated while the other is still cached by Akamai or using timestamps to increment dependent files. There are several solutions here including making sure to clear cache via Akamai's control panel as well as more programmatic ways of coding. Headers can also be used though not really a preferred way.</p> <p><strong>Absolute URL's</strong> - Relative url's are best when testing on multiple environments to ensure your pointing everything to the same environment.</p> <p>This is definitely an environment issue not an Akamai issue.</p>
<p>Perhaps Akamaia isn't seeing the updated versions of your CSS files that are &lt;link /&gt;'d in your HTML code? It might be a good idea to embed a version number in the URL so that when you release an updated version of the HTML, it's always going to ask Akamai for a new version of the CSS as well (this applies to images as well I suppose).</p> <p>Theoretically, Akamai should recognize updated caching headers that your web server sends but I've never worked at a job where we didn't have to have some counter-measures in place to make sure that we could force Akamai to refresh its cached version.</p>
9,069
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/9/how-do-i-calculate-someones-age-in-c">How do I calculate someone&#39;s age in C#?</a> </p> </blockquote> <p>Maybe this could be silly but and I don't have issues with my age but sometimes it is good to calculate the exact age of someone, I have introduced my birthdate in my profile (01/12/1975) "dd/mm/yyyy" and it calculated 33 and I'm 32 actually still, isn't it better to calculate the exact age? </p> <p>Maybe</p> <pre><code>DateTime dt1 = DateTime.Now; TimeSpan dt2; dt2 = dt1.Subtract(new DateTime(1975, 12, 01)); double year = dt2.TotalDays / 365; </code></pre> <p>The result of year is 32.77405678074</p> <p>Could this code be OK?</p>
<blockquote> <p>Maybe this could be silly but and I don't have issues with my age but sometimes it is good to calculate the exact age of someone, I have introduced my birthdate in my profile (01/12/1975) "dd/mm/yyyy" and it calculated 33 and I'm 32 actually still, doesn't it better to calculate the exact age? </p> </blockquote> <p>My guess would be that this is a localization issue, though I don't know how it would happen, since (at least for me) the profile has you fill out your age in the format "YYYY/MM/DD". But your birthday is one that reads as a valid date (January 12th) in traditional U.S. settings, so this is the area I'd look into. I was born in 1975, also, and my birthday is next month, and it's got my age right.</p>
<p>Actually, because of leap years, your code would be off. Since the timespan object has no TotalYears property the best way to get it would be this</p> <p>Pardon the VB.Net</p> <pre><code>Dim myAge AS Integer = DateTime.Now.year - BirthDate.year If Birthdate.month &lt; DateTime.Now.Month _ OrElse BirthDate.Month = DateTime.Now.Month AndAlso Birthdate.Day &lt; DateTime.Now.Day Then MyAge -= 1 END IF </code></pre>
3,911
<p>I was recently tasked with coming up with an offsite backup strategy. We have about 2TB of data that would need to be backed up so our needs are a little out of the norm. </p> <p>I looked into Iron Mountain and they wanted $12,000 a month! </p> <p>Does anyone have any suggestions on how best to handle backing up this much data on a budget (like a tenth of Iron Mountain)? How do other companies afford to do this?</p> <p>Thanks!</p> <p>UPDATE :: UPDATE </p> <p>Ironically enough, I just had the sort of devastating failure we're all talking about. I had my BES server fail and than 2 days later 2 drives in my Exchange server's RAID5 died (2!!!??!). I'm currently in the process of rebuilding my network and the backup integrity is an definitely an issue.</p> <p>At least now my bosses are paying attention :)</p>
<p>You can buy external eSATA RAID boxes in the 8TB capacity range <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822101110" rel="nofollow noreferrer">for $2600</a>. I'm not saying that particular product is the right choice, but that's the kind of box that will do 6TB in RAID5 and still be portable enough to buy a couple of them and rotate them through the bank, like Stu says. </p> <p>Obviously if you have to have to keep 7 individual days worth, a 14 day, 30 and 90 day snapshot, etc. then things are going to be much more expensive, but it's certainly doable if what you're after is just disaster recovery.</p> <p>The biggest thing to make sure is part of your plan is actually testing the restoration from the backup. That seems to get overlooked WAY too often and turns out to be the weakest link in nearly all of the strategies.</p> <p>You should plan for scheduled restorations as often as is reasonable where you actually dump the real data and restore from the backup. Without that, you don't know that it will work when you NEED it too. </p> <p>I've lost track of the number of times I've been in a company where there's a big rack full of backup tapes/drives, all dutifully made according to the schedule only to find out that NONE of them have valid data when the server gets wiped out.</p> <p>The more ways you can verify the integrity of the backups the better, but nothing substitutes for doing an actual dump/load from one of your backups to really test the setup.</p>
<p>I've used <a href="http://bqbackup.com" rel="nofollow noreferrer">bqbackup.com</a> for 1-2 years no problem. You can do a sync using rsync nightly. Wanted to add that their prices are dirt cheap, and I now have close to 1TB with them.</p>
3,064
<p>My Rails-app has a sign in box with a "remember me" checkbox. Users who check that box should remain logged in even after closing their browser. I'm keeping track of whether users are logged in by storing their id in the user's session. </p> <p>But sessions are implemented in Rails as session cookies, which are not persistent. I can <em>make</em> them persistent:</p> <pre><code>class ApplicationController &lt; ActionController::Base before_filter :update_session_expiration_date private def update_session_expiration_date options = ActionController::Base.session_options unless options[:session_expires] options[:session_expires] = 1.year.from_now end end end </code></pre> <p>But that seems like a hack, which is surprising for such common functionality. Is there any better way?</p> <p><strong>Edit</strong></p> <p>Gareth's answer is pretty good, but I would still like an answer from someone familiar with Rails 2 (because of it's unique <code>CookieSessionStore</code>).</p>
<p>You should almost certainly not be extending the session cookie to be long lived.</p> <p>Although not dealing specifically with rails <a href="http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice" rel="noreferrer">this article</a> goes to some length to explain 'remember me' best practices.</p> <p>In summary though you should:</p> <ul> <li>Add an extra column to the user table to accept a large random value</li> <li>Set a long lived cookie on the client which combines the user id and the random value</li> <li>When a new session starts, check for the existence of the id/value cookie and authenticate the new user if they match.</li> </ul> <p>The author also recommends invalidating the random value and resetting the cookie at every login. Personally I don't like that as you then can't stay logged into a site on two computers. I would tend to make sure my password changing function also reset the random value thus locking out sessions on other machines. </p> <p>As a final note, the advice he gives on making certain functions (password change/email change etc) unavailable to auto authenticated sessions is well worth following but rarely seen in the real world.</p>
<p>This worked like a charm for me:</p> <p><a href="http://squarewheel.wordpress.com/2007/11/03/session-cookie-expiration-time-in-rails/" rel="nofollow noreferrer">http://squarewheel.wordpress.com/2007/11/03/session-cookie-expiration-time-in-rails/</a></p> <p>Now my CookieStore sessions expire after two weeks, whereby the user must submit their login credentials again in order to be persistently logged-in for another two weeks.</p> <p>Bascially, it's as simple as:</p> <ol> <li>including one file in vendor/plugins directory</li> <li>set session expiry value in application controller using just one line</li> </ol>
2,290
<p>I acquired an Anycubic Chiron yesterday. I went through the leveling procedure and I think the level test print came out okay so I printed a 20&nbsp;mm calibration cube and a benchy. Both of these came out with a sort of spongy consistency.</p> <p>I have no idea what could be causing this so some advice would be appreciated.</p> <p>I'm using Ultimaker Cura 4.0.0 and printing in PLA.</p> <p><a href="https://i.stack.imgur.com/s3Gs0.jpg" rel="nofollow noreferrer" title="Spongy Print"><img src="https://i.stack.imgur.com/s3Gs0.jpg" alt="Spongy Print" title="Spongy Print"></a></p>
<p>It turned out I had the wrong filament size set in Ultimaker Cura. Fixing this resolved the issue. </p> <p><a href="https://i.stack.imgur.com/3KFlw.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/3KFlw.jpg" alt="under extruded calibration cube"></a></p>
<p>I would lay odds on it being your filament is moisture saturated. You don't state what type of filament you're using, but to my understanding this is what happens when it is saturated. The water evaporates as it goes through the nozzle, which causes the filament to puff up, which leaves voids in your print. </p> <p>The print itself looks like it came out rather well. I mean, the edges of the print are solid and everything is clearly defined. This would state to me the slicer and the printer itself are doing their jobs well. You didn't measure it (or leave any hint you did), so I'll assume the overall dimensions are good.</p> <p>Try a different filament and see if you get better results.</p>
1,287
<p>What are some macros that you have found useful in Visual Studio for code manipulation and automation? </p>
<p>This is one of the handy ones I use on HTML and XML files:</p> <pre><code>''''replaceunicodechars.vb Option Strict Off Option Explicit Off Imports EnvDTE Imports System.Diagnostics Public Module ReplaceUnicodeChars Sub ReplaceUnicodeChars() DTE.ExecuteCommand("Edit.Find") ReplaceAllChar(ChrW(8230), "&amp;#8230;") ' ellipses ReplaceAllChar(ChrW(8220), "&amp;#8220;") ' left double quote ReplaceAllChar(ChrW(8221), "&amp;#8221;") ' right double quote ReplaceAllChar(ChrW(8216), "&amp;#8216;") ' left single quote ReplaceAllChar(ChrW(8217), "&amp;#8217;") ' right single quote ReplaceAllChar(ChrW(8211), "&amp;#8211;") ' en dash ReplaceAllChar(ChrW(8212), "&amp;#8212;") ' em dash ReplaceAllChar(ChrW(176), "&amp;#176;") ' ° ReplaceAllChar(ChrW(188), "&amp;#188;") ' ¼ ReplaceAllChar(ChrW(189), "&amp;#189;") ' ½ ReplaceAllChar(ChrW(169), "&amp;#169;") ' © ReplaceAllChar(ChrW(174), "&amp;#174;") ' ® ReplaceAllChar(ChrW(8224), "&amp;#8224;") ' dagger ReplaceAllChar(ChrW(8225), "&amp;#8225;") ' double-dagger ReplaceAllChar(ChrW(185), "&amp;#185;") ' ¹ ReplaceAllChar(ChrW(178), "&amp;#178;") ' ² ReplaceAllChar(ChrW(179), "&amp;#179;") ' ³ ReplaceAllChar(ChrW(153), "&amp;#8482;") ' ™ ''ReplaceAllChar(ChrW(0), "&amp;#0;") DTE.Windows.Item(Constants.vsWindowKindFindReplace).Close() End Sub Sub ReplaceAllChar(ByVal findWhat, ByVal replaceWith) DTE.Find.FindWhat = findWhat DTE.Find.ReplaceWith = replaceWith DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase = False DTE.Find.MatchWholeWord = False DTE.Find.MatchInHiddenText = True DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone DTE.Find.Action = vsFindAction.vsFindActionReplaceAll DTE.Find.Execute() End Sub End Module </code></pre> <p>It's useful when you have to do any kind of data entry and want to escape everything at once.</p>
<p>You might want to add in code snippets as well, they help to speed up the development time and increase productivity.</p> <p>The standard VB code snippets come with the default installation. The C# code snippets must be downloaded and added seperately. (Link below for those)</p> <p>As far as macros go, I generally have not used any but the working with Visual studio 2005 book has some pretty good ones in there.</p> <p>C# Code snippets Link: <a href="http://www.codinghorror.com/blog/files/ms-csharp-snippets.7z.zip" rel="nofollow noreferrer">http://www.codinghorror.com/blog/files/ms-csharp-snippets.7z.zip</a> (Jeff Atwood provided the link) HIH</p>
3,584
<p>I'm using a Flashforge Pro and attempting to print a wheel about 6mm thick to serve as a platform. In other words, the wheel doesn't have to be solid, but spokes won't do the job. I've experimented with different temperatures, but, because of ABS' thermal expansion, I don't think that will solve the problem. Also tried putting lots of 2mm holes in the wheel. I've considered other designs for the interior, but doubt that would be a solution. Has anyone tried using different print paths, i.e. actually altering the path that the slicer suggests? (grasping at straws) Thanks for your suggestions.</p>
<p>If you can, set your slicer to do honeycomb fill. Depending on the weight requirement choose maybe 10% - 20% fill. That ought to do the trick. It won't be solid, but it should be strong enough.</p> <p>What are you going to put on the platform?</p>
<p>So you just want a short, wide cylinder? Just print that, with low density infill (20-30%) and 6-8 solid top layers, three bottom, and three perimeters, and you'll be fine. For bed adhesion with something this wide, use a 10mm brim, one layer thick. And a heated chamber will help a lot.</p>
484
<p>In the <a href="http://herdingcode.com/" rel="nofollow noreferrer">herding code</a> podcast 14 someone mentions that stackoverflow displayed the queries that were executed during a request at the bottom of the page. </p> <p>It sounds like an excellent idea to me. Every time a page loads I want to know what sql statements are executed and also a count of the total number of DB round trips. Does anyone have a neat solution to this problem? </p> <p>What do you think is an acceptable number of queries? I was thinking that during development I might have my application throw an exception if more than 30 queries are required to render a page.</p> <p>EDIT: I think I must not have explained my question clearly. During a HTTP request a web application might execute a dozen or more sql statements. I want to have those statements appended to the bottom of the page, along with a count of the number of statements.</p> <p>HERE IS MY SOLUTION:</p> <p>I created a TextWriter class that the DataContext can write to:</p> <pre><code>public class Logger : StreamWriter { public string Buffer { get; private set; } public int QueryCounter { get; private set; } public Logger() : base(new MemoryStream()) {} public override void Write(string value) { Buffer += value + "&lt;br/&gt;&lt;br/&gt;"; if (!value.StartsWith("--")) QueryCounter++; } public override void WriteLine(string value) { Buffer += value + "&lt;br/&gt;&lt;br/&gt;"; if (!value.StartsWith("--")) QueryCounter++; } } </code></pre> <p>In the DataContext's constructor I setup the logger:</p> <pre><code>public HeraldDBDataContext() : base(ConfigurationManager.ConnectionStrings["Herald"].ConnectionString, mappingSource) { Log = new Logger(); } </code></pre> <p>Finally, I use the <code>Application_OnEndRequest</code> event to add the results to the bottom of the page:</p> <pre><code>protected void Application_OnEndRequest(Object sender, EventArgs e) { Logger logger = DataContextFactory.Context.Log as Logger; Response.Write("Query count : " + logger.QueryCounter); Response.Write("&lt;br/&gt;&lt;br/&gt;"); Response.Write(logger.Buffer); } </code></pre>
<p>If you put .ToString() to a var query variable you get the sql. You can laso use this in Debug en VS2008. <a href="http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx" rel="nofollow noreferrer">Debug Visualizer</a></p> <p>ex:</p> <pre><code>var query = from p in db.Table select p; MessageBox.SHow(query.ToString()); </code></pre>
<p>From Linq in Action</p> <blockquote> <p>Microsoft has a Query Visualizer tool that can be downloaded separetly from VS 2008. it is at <a href="http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx</a></p> </blockquote>
4,895
<p>I've been asked to create a Delphi compatible dll in C++ to do simple 64bit memory management.</p> <p>The background is that the system in Delphi needs to allocate a lots of chunks of memory that would go well outside 32bit addressable space. The Delphi developer explained to me that he could not allocate memory with the Delphi commands available to him. He says that he can hold a 64bit address, so he just wants to call a function I provide to allocate the memory and return a 64bit pointer to him. Then another function to free up the memory later.</p> <p>Now, I only have VS 2008 at my disposal so firstly I'm not even sure I can create a Delphi compatible dll in the first place.</p> <p>Any Delphi experts care to help me out. Maybe there is a way to achieve what he requires without re-inventing the wheel. Other developers must have come across this before in Delphi.</p> <p>All comments appreciated.</p>
<p>Only 64 bit processes can address 64 bit memory. A 64 bit process can only load 64 bit dlls and 32 bits processes can only load 32 bits dlls. Delphi's compiler can only make 32 bits binaries.</p> <p>So a 32 bits Delphi exe can not load your 64 bit c++ dll. It could load a 32 bit c++ dll, but then that dll wouldn't be able to address the 64 bit memory space. You are kind of stuck with this solution.</p> <p>Delphi could, with the right compiler options and Windows switches address 3GB of memory without problems. Even more memory could be accessed by a 32 bits process if it uses <a href="http://en.wikipedia.org/wiki/Physical_Address_Extension" rel="nofollow noreferrer">Physical Address Extension</a>. It then needs to swap memory pages in and out of the 32 bits memory through the use of <a href="http://msdn.microsoft.com/en-us/library/aa366527(VS.85).aspx" rel="nofollow noreferrer">Address Windowing Extensions</a>.</p>
<p>You might also want to add a way to pin and unpin that 64-bit pointer to a 32-bit memory address. Since this is Delphi, I'm pretty sure it's Windows specific, so you might as well use <a href="http://msdn.microsoft.com/en-us/library/aa366527(VS.85).aspx" rel="nofollow noreferrer">Address Windowing Extensions</a>. That way, you can support allocating, freeing, and pinning and unpinning memory to a 32-bit address range and still take advantage of a 64-bit memory allocation space. Assuming that the user will actually commit the memory such that it fits in the 32-bit virtual address space.</p>
5,448
<p>If someone creates a 3D model of a character for 3D printing can I import that model into Unreal engine or Unity 3D for use in a video game? Also is the inverse true? Can I get 3D model of Mario and send that to a 3D printer?</p> <p>Specifically, it’s more important to know if I can pull a 3D printer model into an unreal game project</p>
<p>The only time I've seen lifting, away from the edges of the part like this, is when the bed is contaminated with something which will stop the print sticking, like fingerprints and such.</p> <p>A thorough wipe-down with IPA on the heated bed is usually enough to stop it.</p>
<p>I haven't seen lifts that aren't on the edge of the print, such as warping, or the entire printed surface lifts. When I get something like in your photograph, it's because the print surface isn't flat and the first layer matches the surface topology. If the second image shows the print surface, it looks like blobs on the surface that may be keeping it from being flat.</p> <p>The first layer thickness greatly depends on how high the nozzle is above the print surface. If this distance varies, the first layer thickness will vary. Also make sure your print surface is free of any substances that the hot extruded material might cause to boil.</p> <p>Any chance you are removing the print from the bed before it cools down. This can distort the print if the material is still soft.</p>
1,875
<p>I have a ASP.net 2.0 app and I have made some changes the the source file ( cs files ). I uploaded the changes with the belief that it would auto-recompile. I also have the compiled dll in MY_APP/bin. I checked it and noticed that it did not recompile. Please understand I am new to this.</p>
<p>my #1 way to do this, add white space to the top of the web config file, after the xml declaration tag.</p> <p>It forces the node to re-cache and recompile. We even have a page deep in the admin called Flush.aspx that does it for us.</p>
<p>In VS menu you have Build -&gt; Rebuild Solution</p>
7,508
<p>I'm accessing an Ubuntu machine using PuTTY, and using gcc.</p> <p>The default <code>LANG</code> environment variable on this machine is set to <code>en_NZ.UTF-8</code>, which causes GCC to think PuTTY is capable of displaying UTF-8 text, which it doesn't seem to be. Maybe it's my font, I don't know - it does this:</p> <pre><code>foo.c:1: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â at end of input </code></pre> <p>If I set it with <code>export LANG=en_NZ</code>, then this causes GCC to behave correctly, I get:</p> <pre><code>foo.c:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input </code></pre> <p>but this then causes everything else to go wrong. For example</p> <pre><code>man foo man: can't set the locale; make sure $LC_* and $LANG are correct </code></pre> <p>I've trawled Google and I can't for the life of me find out what I have to put in there for it to just use ASCII. <code>en_NZ.ASCII</code> doesn't work, nor do any of the other things I can find.</p> <p>Thanks</p>
<p><code>LANG=en_NZ</code> is correct. However, you must make locale files for <code>en_NZ</code>.</p> <p>For Ubuntu, edit <code>/var/lib/locales/supported.d/local</code> and add <code>en_NZ ISO-8859-1</code> to the file. If your system is another distribution (including Debian), the location will be different. Look at <code>/usr/sbin/locale-gen</code> and see where it stores this info.</p> <p>Afterwards, run <code>locale-gen</code> to create the <code>en_NZ</code> locale file. Hope this helps!</p>
<p>For Debian 5.0 Lenny:</p> <pre><code>aptitude install locales </code></pre> <p>If that's already installed:</p> <pre><code>dpkg-reconfigure locales </code></pre>
4,669
<p>Is there any way to launch IE Mobile's "Favorites" screen directly by specifying any command line parameter?</p>
<p>How about running IE with the HTML favorites file as a parameter?</p> <blockquote> <p>IExplore file://\windows\fav.htm</p> </blockquote>
<p>I think this is going to be quite difficult without code. </p> <p>Two options come to mind:</p> <ul> <li>Find out what Windows messages IE sends to open the favorites screen and replay these in your application. You would first need to see if IE is running and if it is bring it to the foreground. If not then start the process. Maybe you can use Windows CE Remote Spy to find the right Window and information about the Favorites button?</li> <li>Other option is to work against the place where IE stores it's favorites information. You would have to write your own UI to parse the favorites etc.</li> </ul>
2,289
<p>I broke up my electronics and now the output for X is not working. The stepper is OK. </p> <p>There is any simple solution to remap the output pins? I want the E1 output to act as the X output.</p>
<p>When using <a href="http://marlinfw.org/" rel="noreferrer">Marlin firmware</a> you could easily change the pin layout of the extra extruder (E1) with the broken X stepper pins by changing the <a href="https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/pins_RAMPS.h" rel="noreferrer">pins_RAMPS.h</a> file.</p> <p><a href="http://marlinfw.org/meta/download/" rel="noreferrer">Download</a> the firmware and open the firmware project in <a href="https://www.arduino.cc/en/Main/Software" rel="noreferrer">Arduino IDE</a>. Navigate to the "Steppers" section of the <a href="https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/pins_RAMPS.h" rel="noreferrer">pins_RAMPS.h</a> file and replace:</p> <pre><code>#define X_STEP_PIN 54 #define X_DIR_PIN 55 #define X_ENABLE_PIN 38 #define X_CS_PIN 53 </code></pre> <p>for:</p> <pre><code>#define X_STEP_PIN 36 #define X_DIR_PIN 34 #define X_ENABLE_PIN 30 #define X_CS_PIN 44 </code></pre> <p>and also change:</p> <pre><code>#define E1_STEP_PIN 36 #define E1_DIR_PIN 34 #define E1_ENABLE_PIN 30 #define E1_CS_PIN 44 </code></pre> <p>to:</p> <pre><code>#define E1_STEP_PIN 54 #define E1_DIR_PIN 55 #define E1_ENABLE_PIN 38 #define E1_CS_PIN 53 </code></pre> <p>When the file is changed an saved, <a href="http://marlinfw.org/docs/basics/install.html" rel="noreferrer">build and upload</a> code to your board and plug the connector of the X stepper into the E1 header.</p>
<p>you can find pin.h in marlin directory and in pin.h file change # define pinout of z motor and extruder motor</p>
581