instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>Server Management Studio tends to be a bit un-intuitive when it comes to managing Extended Properties, so can anyone recommend a decent tool that improves the situation.</p> <p>One thing I would like to do is to have templates that I can apply objects, thus standardising the nomenclature and content of the properti...
<p>Take a look at Data Dictionary Creator, an open source tool I wrote to make it easier to edit extended properties. It includes the ability to export the information in a variety of formats, as well.</p> <p><a href="http://www.codeplex.com/datadictionary" rel="nofollow noreferrer">http://www.codeplex.com/datadiction...
<p>You might also think about having a nice re-runnable script that lets you maintain the extended properties. The system stored procedures for doing this work well, but they are a pain, so I wrap them with my own stored procedure so I can more easily deal with them.</p> <p>For example, below is a stored procedure tar...
3,887
<p>I'm a beginner at rails programming, attempting to show many images on a page. Some images are to lay on top of others. To make it simple, say I want a blue square, with a red square in the upper right corner of the blue square (but not tight in the corner). I am trying to avoid compositing (with ImageMagick and ...
<p>Ok, after some time, here's what I landed on:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.parent { position: relative; top: 0; left: 0; } .image1 { position...
<p>@buti-oxa: Not to be pedantic, but your code is invalid. The HTML <code>width</code> and <code>height</code> attributes do not allow for units; you're likely thinking of the CSS <code>width:</code> and <code>height:</code> properties. You should also provide a content-type (<code>text/css</code>; see Espo's code) wi...
7,091
<p>ReSharper Code cleanup feature (with "<a href="http://www.jetbrains.com/resharper/features/code_formatting.html#Reordering_Type_Members_C#_only" rel="noreferrer">reorder members</a>" and "<a href="http://www.jetbrains.com/resharper/features/code_formatting.html#Code_Style_Configuration_and_Sharing" rel="noreferrer">...
<p>Yes, it will definitely cause problems. In addition to creating conflicts that have to be manually resolved, when you check in a file that has been reformatted, the VCS will note almost every line as having been changed. This will make it hard for you or a teammate to look back at the history and see what changed ...
<p>It definitely could cause conflicts.</p> <p>If you want to use this in a multi-user environment then the configuration of Resharper needs to format your code to a set of standards which are enforced in your organization regardless of whether users make use of Resharper or not.</p> <p>That way you are using the too...
8,019
<p>I have a ARM11 based hardware board which runs a Linux kernel ver. 2.6.21.5-cfs-v19. I have my application running on this ARM-LINUX board. To do source level debugging, of my application I used to use gdb from command prompt of the linux board, that was with some earlier version of the board linux version. </p> <p...
<p>Sometime ago I published an <a href="http://www.linux.com/feature/121735" rel="nofollow noreferrer">article</a> about cross-target debugging with GDB and GDBServer. The target processor there is PPC7450, but it's rather detailed, so maybe you'll find it useful.</p>
<p>You might have some luck using <a href="http://wiki.openembedded.net/index.php/Main_Page" rel="nofollow noreferrer">OpenEmbedded</a>. If there's no precompiled version you can use right away, setting up an OE-cross compile environment is not that hard. </p> <p>Another option could be to install gdb-server on the bo...
7,457
<p>I have a QIDI Tech 1. It has a heated bed, and a cooling fan attachment. Whenever I print without a raft, the first inch or two of material laid down does not adhere to the bed, but the rest of the first layer is flawless.</p> <p>I have tried speeding up and slowing down the first layer walls, but the problem remai...
<p>I've had this problem in the past with a Flux Delta printer. The first attempt to resolve it was to always use a brim along with a raft. The brim will often have settings to allow number of passes as well as number of layers. If you are not using the brim to provide adhesion, you still can use it to prime the nozzle...
<p><strong>I'd recommend using the "skirt" function</strong> if you're not already. </p> <p>The idea is to print a few perimeter layers around where your part will be, but not actually touching your part. </p> <p>Most slicers support this and you can choose how much skirt you want to print. This addresses the issu...
401
<p>3D printer use stepper motors for moving print head and extruding filament. They need to have good torque and resolution.</p> <p>Microstepping improves resolution as much as 32 fold (I think) but reduces torque the higher you microstep.</p> <p>So...</p> <ol> <li><p>Why not rotate the motor with microstepping at high...
<p>To answer each point:</p> <ul> <li><em>Microstepping improves resolution as much as 32 fold (I think) but reduces torque the higher you micro-step.</em></li> </ul> <p>Torque is not reduced by micro-stepping. Torque reduction only occurs when you are moving at high RPMs. The motor's phase resistance has to be conduci...
<p>There's an old rule that says &quot;If the question starts with 'Why don't they,' the answer is most likely 'money.'&quot;</p> <p>In this case, the issue is the cost of worm gears. Properly mating worm gears are much more expensive to make than common spur gears. That probably accounts for most of it -- not to men...
1,963
<p>So I have some files I want to ignore in a subversion repository, but I don't want my ignore patterns for this to be propagated to the repository.</p> <p>In other words, I added some private files in my checkout that I want to keep, but they only exist for me and wouldn't make sense to be ignored for everyone, so i...
<p>Subversion <strong>does</strong> have a <a href="http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.advanced.props.special.ignore" rel="nofollow noreferrer">per-user, global ignore setting</a>, which sounds like what you want. Look in your <code>.subversion</code> directory (found in your <em>home</em> directory) ...
<p>I'm confused about 2 things:</p> <ul> <li>why do you have files that you don't want to check in that other people <em>might</em> want to check in? seems like you'd get a conflict if that happened anyway</li> <li>does just "ignoring" in the human sense not work for you?</li> </ul> <p>I'm just having trouble seeing...
7,565
<p>A reliable coder friend told me that Python's current multi-threading implementation is seriously buggy - enough to avoid using altogether. What can said about this rumor?</p>
<p>Python threads are good for <strong>concurrent I/O programming</strong>. Threads are swapped out of the CPU as soon as they block waiting for input from file, network, etc. This allows other Python threads to use the CPU while others wait. This would allow you to write a multi-threaded web server or web crawler, for...
<p>I've used it in several applications and have never had nor heard of threading being anything other than 100% reliable, as long as you know its limits. You can't spawn 1000 threads at the same time and expect your program to run properly on Windows, however you can easily write a worker pool and just feed it 1000 o...
5,419
<p>I'm writing a C# POS (point of sale) system that takes input from a keyboard wedge magcard reader. This means that any data it reads off of a mag stripe is entered as if it were typed on the keyboard very quickly. Currently I'm handling this by attaching to the KeyPress event and looking for a series of very fast ke...
<p>One thing you can do is that you should be able to configure your wedge reader so that it presents one or many escape characters before or after the string. You would use these escape characters to know that you are about to have (or just had) a magcard input.</p> <p>This same technique is used by barcode reader d...
<p>I second <a href="https://stackoverflow.com/questions/42437/best-way-to-handle-input-from-a-keyboard-wedge#42448">@jttraino's idea</a>. </p> <p>It is the way to go for bar scan/code readers and other such devices that are plug and play (PnP). I have used the same technique to configure a couple of 1D and 2D bar cod...
6,390
<p>I'm a bit newbieish when it comes to the deeper parts of OSX configuration and am having to put up with a fairly irritating niggle which while I can put up with it, I know under Windows I could have sorted in minutes.</p> <p>Basically, I have an external disk with two volumes: </p> <p>One is an HFS+ volume which I...
<p>The following entry in <code>/etc/fstab</code> will do what you want, even on 10.5 (Leopard):</p> <pre><code>LABEL=VolumeName none ntfs noauto </code></pre> <p>If the file is not already there, just create it. Do not use <code>/etc/fstab.hd</code>! No reloading of <code>diskarbitrationd</code> needed.</p> ...
<p>This is not directly an answer, but</p> <blockquote> <p>The thing is that to remove the disk you have to eject the volume and in this case do it for both volumes</p> </blockquote> <p>I have a similar situation.</p> <p>OSX remembers where you put your icons on the desktop - I've moved the icons for both of my re...
4,121
<p>We have a Prusa i3 MK2 and we've changed for a print with another colour material but when I pressed "load filament", it didn't make anything. </p> <p>Often after five times doing that the printer works. I don't have any pictures but the filament is in the hole and the printer holds it. However, it doesn't push it ...
<p>My 0.02c:</p> <ol> <li>Cut the tip of the new filament at an angle so that it is pointed enough. This will ensure that it easily enters the hole leading into the hot end beneath the extruder drive gear. A lot of times the curl in the filament (from being wound on a spool) will cause misalignment and lead to it not ...
<p>First make sure that the hotend is hot enough. Second you need to check your extruder if it is clean. Third try to push the filament by hand and look if it comes out. If yes than the problem should be in the motor. The motor connection wire could be loose.</p>
847
<p>While creating a file synchronization program in C# I tried to make a method <code>copy</code> in <code>LocalFileItem</code> class that uses <code>System.IO.File.Copy(destination.Path, Path, true)</code> method where <code>Path</code> is a <code>string</code>.<br> After executing this code with destination. <code>Pa...
<p>It seems you have misplaced the parameters in File.Copy(), it should be File.Copy(string source, string destination).</p> <p>Also is "C:\Test2" a directory? You can't copy file to a directory. Use something like that instead: <pre> File.Copy( sourceFile, Path.Combine(destinationDir,Path.GetFileName(sourc...
<p>I'm kinda guessing here, but could it be because:</p> <ul> <li>You are trying to perform file operations in C: root? (there may be protection on this by Vista if you are using it - not sure?)</li> <li>You are trying to copy to a non-existant directory?</li> <li>The file already exists and may be locked? (i.e you ha...
4,399
<p>So I know that unit testing is a must. I get the idea that TDD is the way to go when adding new modules. Even if, in practice, I don't actually do it. A bit like commenting code, really. </p> <p>The real thing is, I'm struggling to get my head around how to unit-test the UI and more generally objects that generate ...
<p>the thing to remember is that unit testing is about testing the units of code you write. Your unit tests shouldn't test that clicking a button raises an event, but that the code being executed by that click event does as it's supposed to.</p> <p>What you're really wanting to do is test the underlying code does what...
<p>You should separate logic and presentation. Using MVP(Model-View-Presenter)/MVC (Model-View-Controller) patterns you can unit test you logic without relying on UI events. Also you can use <a href="http://www.codeplex.com/white" rel="nofollow noreferrer">White framework</a> to simulate user input. I would highly reco...
5,869
<p>I'm trying to make a water insulated 1&nbsp;cm<sup>3</sup> (1&nbsp;ml) transparent container and I bought some plexiglass, I cut and glued some pieces together but it looks really crappy and barely holds the water in. I was wondering, is there a transparent material (similar to plexiglass) that can order to 3D print...
<p>Yes. You'll probably want to use SLA or Polyjet printers with transparent resin. For example, here's <a href="https://www.shapeways.com/materials/sla-accura-60" rel="nofollow noreferrer">Shapeways' page on transparent SLA</a> and <a href="https://www.shapeways.com/materials/multi-color-polyjet" rel="nofollow norefer...
<p>You could order an sla or dlp printed part(which would probably be more expensive, but also quite durable and a little more transparent). Or you could order an fdm printed T-glase print, which would come out pretty clear and not be quite as strong as sla, but still pretty good for holding water.</p>
1,446
<p>Regarding the same program as <a href="https://stackoverflow.com/questions/20061/store-data-from-a-c-application">my question a few minutes ago</a>... I added a setup project and built an MSI for the program (just to see if I could figure it out) and it works great except for one thing. When I tried to install it o...
<p>Indeed, boot from a clean CD (use a known good machine to build <a href="http://nu2.nu/pebuilder/" rel="nofollow noreferrer">BartPE</a> or something similar) and scan your machine thoroughly. Another good thing to check, though, would be exactly which virus Avast! thinks your program is. Once you know that, you sh...
<p>The very first thing to do would be to scan your build PC for viruses.</p>
4,051
<p>I create a new Button object but did not specify the <code>command</code> option upon creation. Is there a way in Tkinter to change the command (onclick) function after the object has been created?</p>
<p>Though <a href="https://stackoverflow.com/questions/68327/change-command-method-for-tkinter-button-in-python#68455">Eli Courtwright's</a> program will work fine¹, what you really seem to want though is just a way to reconfigure after instantiation any attribute which you could have set when you instantiated². How y...
<p>Sure; just use the <code>bind</code> method to specify the callback after the button has been created. I've just written and tested the example below. You can find a nice tutorial on doing this at <a href="http://www.pythonware.com/library/tkinter/introduction/events-and-bindings.htm" rel="nofollow noreferrer">htt...
9,383
<p>My printed parts consist rafts, supports and other extraneous filament when printing with ABS or PLA.</p> <p>What are efficient general techniques of removing them?</p>
<p>The best way to get rid of them is to change the design of the printed object to make them unnecessary.</p> <p>Instead of printing the one part with support material, the piece can be split into two or more parts which can be printed without support material and assembled after the printing.</p> <hr> <p>Given tha...
<p>I usually use a chisel or a flat-head screwdriver to easily remove the bottom plate that the printer auto-generates. I would also suggest using something like wire cutters or some mini pliers to pull them off.</p>
93
<p>What is the difference between Introspection and Reflection in .NET</p>
<p>They're two parts of the same whole.</p> <p>Introspection refers to the ability of a class to look 'inside' itself and see, for example, what parameters a method takes, what the names of its members are, etc.</p> <p>Reflection is the specific name for how .NET implements introspection. Other languages may call it...
<p>They're two parts of the same whole.</p> <p>Introspection refers to the ability of a class to look 'inside' itself and see, for example, what parameters a method takes, what the names of its members are, etc.</p> <p>Reflection is the specific name for how .NET implements introspection. Other languages may call it...
9,903
<p>So, I have willfully kept myself a Java n00b until recently, and my first real exposure brought about a minor shock: Java does not have C# style properties!</p> <p>Ok, I can live with that. However, I can also swear that I have seen property getter/setter code in Java in one codebase, but I cannot remember where. H...
<p>There is a &quot;standard&quot; pattern for getters and setters in Java, called <a href="http://docs.oracle.com/javase/tutorial/javabeans/writing/properties.html" rel="nofollow noreferrer">Bean properties</a>. Basically any method starting with <code>get</code>, taking no arguments and returning a value, is a proper...
<p>As previously mentioned for eclipse, integrated development environment (IDE) often can create accessor methods automatically.</p> <p>You can also do it using NetBeans. </p> <p>To create accessor methods for your class, open a class file, then Right-click anywhere in the source code editor and choose the menu comm...
9,587
<p>I'm looking for a way to configure a DB connection at runtime; specifically using the Enterprise Library. I see that there's a *.Data.Configuration (or something close to this ... don't recall off the top of my head) assembly but am finding not much on the interwebs. Complicating matters is the fact that the API h...
<p>If you're using a winforms app you could try using <a href="http://msdn.microsoft.com/en-us/library/aa221771(office.11).aspx" rel="nofollow noreferrer">UserProperties</a> to store this info. Another possible solution could be <a href="http://msdn.microsoft.com/en-us/library/2tw134k3.aspx" rel="nofollow noreferrer">c...
<p>If you don't want it saved, you do not need to execute the cfg.Save command. </p> <p>The Configuration object will store your changes until it isn't needed anymore.</p>
3,650
<p>I am writing a C# control that wraps DirectX 9 and provides a simplified interface to perform 2D pixel level drawing. .NET requires that I wrap this code in an unsafe code block and compile with the allow unsafe code option.</p> <p>I'm locking the entire surface which then returns a pointer to the locked area of me...
<p>Using unsafe pointers is the fastest way to do direct memory manipulation in C# (definitely faster than using the Marshal wrapper functions).</p> <p>Just out of curiosity, what sort of 2D drawing operations are you trying to perform?</p> <p>I ask because locking a DirectX surface to do pixel level manipulations wi...
<p>I recently was tasked with creating a simple histogram control for one of our thin client apps (C#). The images that I was analyzing were about 1200x1200 and I had to go the same route. I could make the thing draw itself once with no problem, but the control needed to be re-sizable. I tried to avoid it, but I had...
7,982
<p>Where should I start learning about version control systems? I've used SVN, Team Foundation, and Sourcesafe in the past but I don't really feel like I grasp it completely, and my team doesn't seem to grasp it either.</p> <p>Which points are the most important to master? I realise this differs from VCS to VCS, but f...
<p>The wikipedia article on Revision Control is a great place to start </p> <p><a href="http://en.wikipedia.org/wiki/Revision_control" rel="nofollow noreferrer">Revision control</a></p> <p>When trying to teach my colleagues, I found getting him to understand the vocabulary at the end was a great way to start to intro...
<p><a href="http://ericsink.com/vcbe/" rel="nofollow">Version control by example by Eric Sink</a> is good and easy to follow</p>
3,024
<p>I'm using BlogEngine.NET (a fine, fine tool) and I was playing with the TinyMCE editor and noticed that there's a place for me to create a list of external links, but it has to be a javascript file:</p> <p><code>external_link_list_url : "example_link_list.js"</code></p> <p>this is great, of course, but the list of...
<p>I would create an HTTPHandler that responds with the desired data read from the db. Just associate the HTTPHandler with the particular filename 'example_link_list.js' in your web-config. Make sure you set </p> <pre><code>context.Response.ContentType = "text/javascript"; </code></pre> <p>then just context.Response....
<p>If you can't change the file extension (and just return plain text, the caller shouldn't care about the file extension, js is plain text) then you can set up a handler on IIS (assuming it's IIS) to handle javascript files.</p> <p>See this link - <a href="http://msdn.microsoft.com/en-us/library/bb515343.aspx" rel="n...
9,357
<p>For example:</p> <blockquote> <p>This is main body of my content. I have a footnote link for this line [1]. Then, I have some more content. Some of it is interesting and it has some footnotes as well [2].</p> <p>[1] Here is my first footnote.</p> <p>[2] Another footnote.</p> </blockquote> <p>So, ...
<p>Give a container an id, then use <code>#</code> to refer to that Id.</p> <p>e.g.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p&gt;This is main body of my con...
<p>anchor tags using named anchors</p> <p><a href="http://www.w3schools.com/HTML/html_links.asp" rel="nofollow noreferrer">http://www.w3schools.com/HTML/html_links.asp</a></p>
9,254
<p>Fairly long winded, but hopefully makes sense;</p> <p>I understand that G-code is executed line-by-line, and in the main printing phase each instruction is effectively go to location XY (assuming staying within the layer) at a set speed with a set extrusion amount (not rate, as far as I can tell). </p> <p>Imagine...
<p>My understanding is that the printer firmware will define the maximum acceleration and speeds for each axis (X, Y, Z, and E). When executing a line of g-code that involves more than one axis, the acceleration for each will be limited such that they all begin and end, including acceleration together.</p> <p>During t...
<h1>No</h1> <p>G-code is written line separated, starting with one command what to do, then who does it with what factors. For example <code>G1 X10 F100 E10</code> says this:</p> <ul> <li><code>G1</code> Move...</li> <li><code>X10</code> The X axis by 10</li> <li><code>F100</code> Use the factor to 100 units</li> <li><...
1,218
<p>I am trying to import an STL file, I created in FreeCAD. It has a hole in the hull of the object and behind that hole there are two pins inside the object (see attached FreeCAD screenshot).</p> <p>When I import the STL in Cura, there are no walls around the whole object where there is the hole in the hull (see atta...
<p>This is clearly overextrusion relative to the volume the material is being deposited into, but that doesn't necessarily mean your extrusion rate is wrong. It could be:</p> <ul> <li>Nozzle smashed down into the bed (bed way too high) but somehow still extruding</li> <li>Problem in Z axis movement preventing the head...
<p>Bad filament is my answer. I bought PRLine and both print terrible like your picture. Suspect 2 factors, one is that the line is less than 1.75, so they underextrude and so you see those lines and in some cases gaps, second is the material itself is slippery suggesting to me that it has florinated additives.</p>
1,622
<p>I was going to Ask a Question earlier today when I was presented to a surprising functionality in Stackoverflow. When I wrote my question title stackoverflow suggested me several related questions and I found out that there was already two similar questions. That was stunning! </p> <p>Then I started thinking how I ...
<p>One such way to implement such an algorithm would involve ranking the questions as per a heuristic function which assigns a 'relevance' weight factor using the following steps:</p> <ol> <li>Apply a noise filter to the 'New' question to remove words that are common across a large number of objects such as: 'the', 'a...
<p>Isn't StackOverflow going to be open sourced at some point? If so, you can always find out how they did it there.</p> <p>Update: It appears that they say they <em>might</em> open source it. I hope they do.</p>
6,399
<p>I've been 3D printing for a while and I've noticed that, when printing small parts, my colored plastics (PLA, PLA+ and ABS) have better layer adhesion than black ones.</p> <p>Did you notice this?</p> <p>What could be the cause?</p>
<p>Not inherently.</p> <p>There are two things at work that might cause one color to test weaker than others even as its properties otherwise are functionally identical:</p> <ol> <li>A bad print among good ones.</li> <li>A bad roll among good ones.</li> </ol> <p>Let's take a look at both, then do a little excursus into...
<p>Not inherently.</p> <p>There are two things at work that might cause one color to test weaker than others even as its properties otherwise are functionally identical:</p> <ol> <li>A bad print among good ones.</li> <li>A bad roll among good ones.</li> </ol> <p>Let's take a look at both, then do a little excursus into...
1,184
<p>I have been hearing a lot of good things about DVCS systems, in particular about bazaar. Apart from the concept of distributed repository, I see two main advantages being touted: the merge is better automated, and the rename is handled right.</p> <p>Could someone please point me at some text explaining how exactly ...
<p>Merge is not intrinsically better in DVCS, it is just that they would be practically very difficult to use if the branch/merge did not work correctly (svn arguably does not implement branching/merging correctly), because instead of making a checkout, you are making a new branch everytime you start working on a proje...
<p>I'm not familiar with bazaar, but git doesn't track file renames. To git, this looks like a delete and an add. However, git is smart enough to see that the contents of the file already exist in its repository and will track their position in the system. If you split files up or merge them it's smart enough to keep t...
6,834
<p>This seemed like an easy thing to do. I just wanted to pop up a text window and display two columns of data -- a description on the left side and a corresponding value displayed on the right side. I haven't worked with Forms much so I just grabbed the first control that seemed appropriate, a TextBox. I thought using...
<p>If you want, you can translate this VB.Net code to C#. The theory here is that you change the size of a tab in the control.</p> <pre><code>Private Declare Function SendMessage _ Lib "user32" Alias "SendMessageA" _ (ByVal handle As IntPtr, ByVal wMsg As Integer, _ ByVal wParam As Integer, ByRef lParam As Inte...
<p>Don't the text boxes allow HTML usage? If that is the case, just use HTML to format the text into a table. Otherwise, try adding the text to a datagrid and then adding that to the form.</p>
9,781
<p>I want to implement search functionality for a website (assume it is similar to SO). I don't want to use Google search of stuff like that.</p> <p>My question is:</p> <p>How do I implement this?</p> <p>There are two methods I am aware of:</p> <ol> <li>Search all the databases in the application when the user give...
<p>Use lucene,<br> <a href="http://lucene.apache.org/java/docs/" rel="noreferrer">http://lucene.apache.org/java/docs/</a></p> <blockquote> <p>Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires fu...
<p>If you application uses the Java EE stack and you are using <a href="http://hibernate.org" rel="nofollow noreferrer">Hibernate</a> you can use the <a href="http://www.compass-project.org" rel="nofollow noreferrer">Compass Framework</a> maintain a searchable index of your database. The Compass Framework uses <a href=...
5,453
<p>In my browsings amongst the Internet, I came across <a href="http://www.reddit.com/r/programming/comments/6y6lr/ask_proggit_which_is_more_useful_to_know_c_or_java/" rel="nofollow noreferrer">this post</a>, which includes this</p> <blockquote> <p>"(Well written) C++ goes to great lengths to make stack automatic ...
<p>Stack objects are handled automatically by the compiler.</p> <p>When the scope is left, it is deleted.</p> <pre><code>{ obj a; } // a is destroyed here </code></pre> <p>When you do the same with a 'newed' object you get a memory leak :</p> <pre><code>{ obj* b = new obj; } </code></pre> <p>b is not destro...
<p>Variables in C++ can either be declared on the stack or the heap. When you declare a variable in C++, it automatically goes onto the stack, unless you explicitly use the new operator (it goes onto the heap).</p> <pre><code>MyObject x = MyObject(params); // onto the stack MyObject * y = new MyObject(params); // ont...
4,997
<p>I'm working on a utility which needs to resolve hex addresses to a symbolic function name and source code line number within a binary. The utility will run on Linux on x86, though the binaries it analyzes will be for a MIPS-based embedded system. The MIPS binaries are in ELF format, using DWARF for the symbolic debu...
<p>Please check <a href="https://github.com/eliben/pyelftools" rel="nofollow">pyelftools</a> - a new pure Python library meant to do this.</p>
<p>I don't know of any, but if all else fails you could use <a href="http://docs.python.org/lib/module-ctypes.html" rel="nofollow noreferrer">ctypes</a> to directly use libdwarf, libelf or libbfd.</p>
6,798
<p>Is there a way to shutdown a computer using a built-in Java method?</p>
<p>Create your own function to execute an OS command through the <a href="http://www.computerhope.com/shutdown.htm" rel="nofollow noreferrer">command line</a>?</p> <p>For the sake of an example. But know where and why you'd want to use this as others note.</p> <pre><code>public static void main(String arg[]) throws IOE...
<p>On Windows Embedded by default there is no shutdown command in cmd. In such case you need add this command manually or use function ExitWindowsEx from win32 (user32.lib) by using JNA (if you want more Java) or JNI (if easier for you will be to set priviliges in C code).</p>
4,522
<p>I received a Monoprice Maker Select v2 (I3 V2 clone) from my wife for Christmas. The sample .gcode files that came with the printer generally print great with no noticeable defects.</p> <p>However, when I try to print miniatures for use with table-top gaming (D&amp;D, primarily), I tend to get a lot of oozing and ...
<p>I've not done much miniatures printing, but I have the same printer and I happen to have the exact same filament loaded. Also, I've been doing a lot of tuning lately, including <a href="https://www.thingiverse.com/thing:921948" rel="nofollow noreferrer">this z-brace mod</a> which has improved my overall print quali...
<p>I have an Alunar(Anet) Prusa i3 printer I bought from amazon 7 months ago. I have not done much for ultra high detail prints, but it does seem to print everything I've thrown at it quite well. It took sometime for me to get it dialed in. I've found that <strong>Bed Level, Z-axis height,</strong> and <strong>Print Sp...
499
<p>I'm just getting into creating some WCF services, but I have a requirement to make them backward compatible for legacy (.NET 1.1 and 2.0) client applications. </p> <p>I've managed to get the services to run correctly for 3.0 and greater clients, but when I publish the services using a basicHttpBinding endpoint (wh...
<p>OK, we needed to resolve this issue in the short term, and so we came up with the idea of a "interop", or compatibility layer.</p> <p>Baiscally, all we did was added a traditional ASMX web service to the project, and called the WCF service from that using native WCF calls. We were then able to return the appropria...
<p>You do have to use the XmlSerializer. For example:</p> <pre><code>[ServiceContract(Namespace="CentreServiceNamespace")] [XmlSerializerFormat(Style=OperationFormatStyle.Document, SupportFaults=true, Use=OperationFormatUse.Literal)] public interface ICentreService { [OperationContract(Action="CentreServiceNamespa...
2,770
<h2><strong>NEW UPDATE BELOW</strong></h2> <hr /> <p>I am having trouble finding the cause for this under-extrusion at start/end of each layer. Something changes halfway into the print creating a visible seam at some specific layer height.</p> <p>This also creates dimensional inaccuracy making my parts unusable.<br /> ...
<h1>That's not under extrusion</h1> <p>That is the seam, and technically it is over extruding around it. You will find that if you turn the item, you have such a spot on every layer, actually with an inner and outer perimeter, you'll have two visible seams. The seam is where the extrusion line meets itself, and thus th...
<h1>That's not under extrusion</h1> <p>That is the seam, and technically it is over extruding around it. You will find that if you turn the item, you have such a spot on every layer, actually with an inner and outer perimeter, you'll have two visible seams. The seam is where the extrusion line meets itself, and thus th...
2,147
<p>I'm sending mail from my C# Application, using the SmtpClient. Works great, but I have to decide if I want to send the mail as Plain Text or HTML. I wonder, is there a way to send both? I think that's called multipart.</p> <p>I googled a bit, but most examples essentially did not use SmtpClient but composed the who...
<p>What you want to do is use the AlternateViews property on the MailMessage</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.alternateviews.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.alternateviews.aspx</a></p>
<p>For anyone who bumped into this issue you might want to check if you have preheader tags in your html.</p> <p>In my html I've added a tag with a phrase of &quot;Activate your client admin account by clicking the link.&quot;.</p> <p>It seems like gmail is flagging the phrase &quot;clicking the link&quot; after remov...
6,652
<p>Hello I have the following error by git-fsck, which cannot be cleaned by git-gc even in --aggressive mode. What can I do next to fix this repository error? </p> <pre><code>$ git-fsck bad sha1 file: .git/objects/55/tmp_obj_a07724 </code></pre>
<p>It's not a simple answer, sadly. But this might help:</p> <p><a href="http://schacon.github.com/git/user-manual.html#recovering-from-repository-corruption" rel="noreferrer">Recovering from repository corruption</a> (from the Git's user manual).</p>
<p>From <code>man git-fsck</code>:</p> <pre><code>Any corrupt objects you will have to find in backups or other archives (i.e., you can just remove them and do an rsync with some other site in the hopes that somebody else has the object you have corrupted). </code></pre>
6,055
<p>Is there anything similar to rails' scaffolding for pylons? I've been poking around google, but only found this thing called dbsprockets, which is fine, although probably way too much for my needs. What I really need is a basic CRUD that is based on the SQLAlchemy model.</p>
<p>The question is super old, but hell: <a href="http://code.google.com/p/formalchemy/" rel="noreferrer">http://code.google.com/p/formalchemy/</a></p> <p>Gives you basic crud out of the box, customizable to do even relatively complex things easily, and gives you a drop-in Pylons admin app too (written and customizable...
<p>Just updating an old question. DBSprockets has been replaced by <a href="http://sprox.org/" rel="nofollow noreferrer">sprox</a> which learns a lot of lessons from it and is pretty cool.</p> <p>It isn't quite the throwaway 'scaffolding' that Rails provides, it is more like an agile form generation tool that is highl...
5,529
<p>After cleaning a folder full of HTML files with TIDY, how can the tables content be extracted for further processing?</p>
<p>I've used BeautifulSoup for such things in the past with great success.</p>
<p>In .NET you could use <a href="http://www.codeplex.com/htmlagilitypack" rel="nofollow noreferrer">HTMLAgilityPack</a>.</p> <p>See this <a href="https://stackoverflow.com/questions/2861/options-for-html-scraping">previous question</a> on StackOverflow for more information.</p>
9,426
<p>My professor did an informal benchmark on a little program and the Java times were: 1.7 seconds for the first run, and 0.8 seconds for the runs thereafter. </p> <ul> <li><p>Is this due entirely to the loading of the runtime environment into the operating environment ?</p> <p>OR </p></li> <li><p>Is it influenced b...
<p>Okay, I found where I read that. This is all from &quot;Learning Java&quot; (O'Reilly 2005):</p> <blockquote> <p>The problem with a traditional JIT compilation is that optimizing code takes time. So a JIT compiler can produce decent results but may suffer a significant latency when the application starts up. This i...
<p>Java JVM (actually might change from different implementations of the JVM) when first started out will interpret the byte code. Once it detects that the code will be running enough number of times JITs it to native machine language so it runs faster. </p>
9,361
<p>How can I connect to a remote SQL server using Mac OS X? I don't really need a GUI, but it would be nice to have for the color coding and resultset grid. I'd rather not have to use a VM.</p> <p>Is there a SQL client for Mac OS X that works with MS SQL Server?</p>
<p>Let's work together on a canonical answer.</p> <h3>Native Apps</h3> <ul> <li><a href="http://www.macsqlclient.com/" rel="noreferrer">SQLPro for MSSQL</a></li> <li><a href="http://www.navicat.com/products/navicat-for-sqlserver" rel="noreferrer">Navicat</a></li> <li><a href="http://www.valentina-db.com/en/valentina-...
<p>Since there currently isn't a MS SQL client for Mac&nbsp;OS&nbsp;X, I would, as <a href="https://stackoverflow.com/questions/3452/sql-server-client-for-osx#3455">Modesty</a> has suggested, use <a href="http://www.microsoft.com/mac/products/remote-desktop/default.mspx" rel="nofollow noreferrer">Remote Desktop</a> for...
2,558
<p>I've got several examples like the image below where the perimeter either doesn't bond to, or doesn't reach the infill. I tried adjusting the <code>infill overlap</code> parameter in Slic3r from its default of 25 % to 30 %, but it doesn't seem to have made a difference. This is on a new Tevo Tornado that's all stock...
<p>This has nothing to do with the infill overlap, the image you've added looks as if the issue is related to non-bonding perimeters (it looks as if it is in between the 2<sup>nd</sup> and the 3<sup>rd</sup> perimeter), hence infill overlap doesn't apply here. If that is the case look into <a href="/q/6067">this questi...
<p>I had absolutely the same issue. And after some research I finally found that this is because of wrong pressure advance setting (In case of Marlin - linear advance) in the firmware. Without pressure advance (linear advance) will be more plastic at the end of the travel rather than at the start. As result the fast fu...
1,276
<p>I had my 3D printer powered by dual 24 V PSUs wired in parallel and my heatbed was wired into the main using a SSR to help power it. I replaced the two PSUs with a single Corsair 750 W ATX. My printer runs smoother and there's much less wiring clutter to deal with but now no matter what the heatbed will not heat up....
<p>You indicated that you were using 24 volts, implying you have a 24 volt bed. ATX power supplies do not have 24 volt outputs. The highest is 12 volts which would heat up the bed, but not fast or probably to full temperature.</p>
<p>voltage = current x resistance</p> <p>An ATX PSU is designed to only allow approximately 16 amps per pair of YELLOW and BLACK wires. The yellow is 12 V and the black is GND. If your bed were rated at 24 V then its resistance would be higher than that of the 12 V bed. The best solution for you would be to get a 12 V ...
1,747
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/16991/what-ruby-ide-do-you-prefer">What Ruby IDE do you prefer?</a> </p> </blockquote> <p>I've generally been doing stuff on Microsoft .NET out of college almost 2 years ago. I just started looking at Ruby on R...
<p>Try both NetBeans and RadRails for maybe a week each, then you can find which works best for you. The best advice is to learn your tool. If you are not checking out something new about your editor, something that could potentially save you time (regexp, etc) then you are doing yourself a huge disservice.</p> <p>I...
<p>I mainly code ColdFusion or PHP (and JS/CSS/xHTML), but have dabbled in a bit of RoR. RadRails/Apatana has been great for me, because it's built on Eclipse, which I was already using for my other work. It also integrates with Subversion via the Subclipse plugin. </p> <p>The Eclipse platform is so extensible that it...
3,677
<p>I have a Monoprice Maker Select v2. It is the kind where the moving plate (heat bed) provides the Y-axis and the moving extruder provides the X-axis. It has a fairly rigid sheet metal frame. In addition, I added steel rods has Z-braces.</p> <p>I see some pretty obvious ghosting. This happens for an inch or so right...
<p>Ghosting is caused by differential movement between the bed and the head when the head undergoes acceleration. The forces add energy to a resonance in that differential vibration mode.</p> <p>By changing how you mount the base, you will change the mode and probably change the frequency. </p> <p>With the soft moun...
<p>I'm missing something here. How about damping the movement of table and head by placing a tuned mass damper on table and head? Something like a mass that is mounted in the top of a skyscraper...</p>
933
<p>I have a gridview that is within an updatepanel for a modal popup I have on a page.<br> The issue is that the entire page refreshes every time I click an imagebutton that is within my gridview. This causes my entire page to load and since I have grayed out the rest of the page so that the user cannot click on it thi...
<p>do you have ChildrenAsTriggers="false" on the UpdatePanel?</p> <p>Are there any javascript errors on the page?</p>
<p>Is the Modal Window popped up using the IE Modal window? Or is it a DIV that you are showing?</p> <p>If it is an IE Modal Pop up you need to ensure you have </p> <pre><code> &lt;base target="_self" /&gt; </code></pre> <p>To make sure the post back are to the modal page.</p> <p>If it is a DIV make sure you ha...
5,516
<p>I'm looking for a pattern for performing a dynamic search on multiple tables.</p> <p>I have no control over the legacy (and poorly designed) database table structure.</p> <p>Consider a scenario similar to a resume search where a user may want to perform a search against any of the data in the resume and get back a...
<p>As far as I understand (and I'm also someone who has written against a horrible legacy database), there is no such thing as dynamic WHERE clauses. It has NOT been solved. </p> <p>Personally, I prefer to generate my dynamic searches in code. Makes testing convenient. Note, when you create your sql queries in cod...
<p>Search and normalization can be at odds with each other. So probably first thing would be to get some kind of "view" that shows all the fields that can be searched as a single row with a single key getting you the resume. then you can throw something like <a href="http://lucene.apache.org/java/docs/" rel="nofollow n...
3,108
<p>I'm at a location where I don't have easy access to toothed belts for my printer (a <a href="https://reprap.org/wiki/Wallace" rel="nofollow noreferrer">RepRap Wallace</a>). While trying to look for some solution, I saw some talk of using fishing line as a belt, along with a log of admonitions of <code>Don't</code>.<...
<p>I’m going to recommend not using a fishing line with knots. Probably the biggest problem you’ll have using the fishing line with knots is if the knots are not perfectly spaced, movement along the X or Y axis is not going to be consistent. This could result in weird deformations in your print.</p> <p>Depending on ...
<p>If you are using fishing line, it would perhaps work to wrap the line around the pully and fastening it to the pully (both ends), so that the line wraps around the pully. One side would play out from the pully while the other was wrapping around it.</p> <p>By attaching the ends of the line to the pully, there will...
1,071
<p>I am new to all the anonymous features and need some help. I have gotten the following to work:</p> <pre><code>public void FakeSaveWithMessage(Transaction t) { t.Message = "I drink goats blood"; } public delegate void FakeSave(Transaction t); public void SampleTestFunction() { Expect.Call(delegate { _dao...
<p>That's a well known error message. Check the link below for a more detailed discussion.</p> <p><a href="http://staceyw1.wordpress.com/2007/12/22/they-are-anonymous-methods-not-anonymous-delegates/" rel="noreferrer">http://staceyw1.wordpress.com/2007/12/22/they-are-anonymous-methods-not-anonymous-delegates/</a> </p>...
<p>Try something like:</p> <pre><code>Expect.Call(delegate { _dao.Save(t); }).Do(new EventHandler(delegate(Transaction t2) { t2.CheckInInfo.CheckInMessage = "I drink goats blood"; })); </code></pre> <p>Note the added EventHandler around the delegate.</p> <p>EDIT: might not work since the function signatures of Event...
8,413
<p>We have a WinForms application written in C# that uses the AxAcroPDFLib.AxAcroPDF component to load and print a PDF file. Has been working without any problems in Windows XP. I have moved my development environment to Vista 64 bit and now the application will not run (on Vista 64) unless I remove the AxAcroPDF compo...
<p>You can't convert Adobe's ActiveX control to 64bit yourself, but you can force your application to run in 32bit mode by setting the platform target to x86.</p> <p>For instructions for your version of Visual Studio, see section 1.44 of <a href="http://msdn.microsoft.com/en-gb/vstudio/aa718685.aspx" rel="noreferrer">...
<p>Use DLL isolation, works with every 32bit COM+ application. See more at: <a href="http://support.microsoft.com/kb/281335" rel="nofollow noreferrer">http://support.microsoft.com/kb/281335</a></p> <p>With this solution you can isolate your 32 bit COM+ application into a separate 32bit process.</p> <p>64bit applicati...
9,275
<p>I'd like to start experimenting with Cocoa and programming for Mac OSX. I'm not terribly concerned with Objective C syntax/constructs/bheaviors at this point, but more curious as to an efficient setup on in terms of an editor and/or IDE that will get me going quickly. Is there any IDE even remotely similar to Visu...
<p>I'd suggest you pick a fun little product and dive in. If you're looking for a book I'd suggest <a href="https://rads.stackoverflow.com/amzn/click/com/0321503619" rel="noreferrer" rel="nofollow noreferrer">Cocoa Programming for Max OSX</a> which is a very good introduction both to Objective-C and Cocoa.</p> <p>XCod...
<p>AFAIK, pretty much every OS X developer uses Xcode.</p> <p>That, and Interface Builder for creating the GUIs.</p> <p>FWIW, try to get hold of a copy of Hillegas's book, as it's a great introductory tutorial, and the reference Docs Apple provides really aren't. (They are generally very good reference docs, however...
3,645
<p>Can a (||any) proxy server cache content that is requested by a client over https? As the proxy server can't see the querystring, or the http headers, I reckon they can't.</p> <p>I'm considering a desktop application, run by a number of people behind their companies proxy. This application may access services acros...
<p>No, it's not possible to cache https directly. The whole communication between the client and the server is encrypted. A proxy sits between the server and the client, in order to cache it, you need to be able to read it, ie decrypt the encryption.</p> <p>You can do something to cache it. You basically do the SSL on...
<p>How about setting up a server cache on the application server behind the component that encrypts https responses? This can be useful if you have a reverse-proxy setup.</p> <p>I am thinking of something like this:</p> <pre><code>application server &lt;---&gt; Squid or Varnish (cache) &lt;---&gt; Apache (performs S...
3,546
<p>What are the pros/cons of doing either way. Is there One Right Way(tm) ?</p>
<p>If you want to use exceptions instead of errors for your entire application, you can do it with <a href="http://php.net/ErrorException" rel="noreferrer">ErrorException</a> and a custom error handler (see the ErrorException page for a sample error handler). The only downside to this method is that non-fatal errors wi...
<p><em><strong>Using exceptions are not a good idea in the era of 3rd party application integration</em></strong>. </p> <p>Because, the moment you try to integrate your app with something else, or someone else's app with yours, your entire application will come to a halt the moment a class in some 3rd party plugin thr...
8,552
<p>I'm looking to use SQL to format a number with commas in the thousands, but no decimal (so can't use Money) - any suggestions?</p> <p>I'm using SQL Server 2005, but feel free to answer for others as well (like MySQL)</p>
<p>In MySQL, the <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_format" rel="nofollow noreferrer"><code>FORMAT()</code></a> function will do the trick.</p>
<p>For SQL Server, you could format the number as money and then delete the right-most three characters.</p> <pre><code>replace(convert (varchar, convert (money, 109999), 1), '.00','') </code></pre>
6,363
<p>Yes, Podcasts, those nice little Audiobooks I can listen to on the way to work. With the current amount of Podcasts, it's like searching a needle in a haystack, except that the haystack happens to be the Internet and is filled with too many of these &quot;Hot new Gadgets&quot; stuff :(</p> <p>Now, even though <stron...
<p>I like</p> <p><strong>General Software</strong></p> <ul> <li><a href="https://blog.stackoverflow.com/category/podcasts/">Stackoverflow</a> (perhaps too obvious)</li> <li><a href="http://deepfriedbytes.com/" rel="nofollow noreferrer">Deep Fried Bytes</a></li> <li><a href="http://www.hanselminutes.com/" rel="nofollow ...
<p>Suggest someone with the reputation to do it revise this question to say, "What good technology podcasts are out there?"</p> <p>I've got all kinds of audio fiction I could recommend, but then this question really runs off into the weeds.</p>
2,398
<p>I know RIM has their own IDE (<a href="http://na.blackberry.com/eng/developers/downloads/jde.jsp" rel="nofollow noreferrer">BlackBerry JDE</a>) for building BlackBerry apps, but does anyone know how to configure <a href="http://www.jetbrains.com/idea/index.html" rel="nofollow noreferrer">IntelliJ IDEA</a> to build/d...
<p>RE: Chris' question about what is different... Blackberry applications can be standard MIDP apps or CLDC apps that make use of the Blackberry specific APIs. Most developers tend to take the latter approach, and then using Blackberry's tools is required - especially if you are using some of their secured APIs and ha...
<p>Not sure if this will help but here are instructions for <a href="http://www.blackberryforums.com/developer-forum/138210-setup-up-eclipse-blackberry-development.html" rel="nofollow noreferrer">setting up Eclipse</a> for blackberry development.</p> <p>Maybe you can use that information to figure out what changes to ...
7,594
<p>This past summer I was developing a basic ASP.NET/SQL Server CRUD app, and unit testing was one of the requirements. I ran into some trouble when I tried to test against the database. To my understanding, unit tests should be:</p> <ul> <li>stateless</li> <li>independent from each other</li> <li>repeatable with th...
<p>There's no real way to unit test a database other than asserting that the tables exist, contain the expected columns, and have the appropriate constraints. But that's usually not really worth doing.</p> <p>You don't typically <strong>unit</strong> test the database. You usually involve the database in <strong>integ...
<p>If you're using LINQ to SQL as the ORM then you can generate the database on-the-fly (provided that you have enough access from the account used for the unit testing). See <a href="http://www.aaron-powell.com/blog.aspx?id=1125" rel="nofollow noreferrer">http://www.aaron-powell.com/blog.aspx?id=1125</a></p>
4,172
<p>I played with one of the early beta versions of PowerShell V1, but haven't used it since it went "gold". What is the best way to get started using PowerShell?</p> <p>Which version of PowerShell should I be using (V1.0 vs 2.0 CTP's)? What are you using PowerShell for? Are there any tools that make using PowerShell e...
<p>For learning PowerShell, there are a number of great resources</p> <ol> <li>Technet Virtual Labs (<a href="https://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&amp;EventID=1032314395&amp;EventCategory=3" rel="noreferrer">Introduction to Windows PowerShell</a>)</li> <li>PowerShellCommunity.org - ...
<p>There are <a href="http://www.dnrtv.com" rel="nofollow noreferrer">DNRtv</a>s on PowerShell and PowerGUI. There are also <a href="http://www.dotnetrocks.com" rel="nofollow noreferrer">.NET Rocks!</a> episodes about these tools.</p>
5,365
<p>Silverlight v2.0 is getting closer and closer to RTM but I have yet to hear any stats as to how many browsers are running Silverlight. If I ask Adobe (by googling "Flash install base") they're <a href="http://www.adobe.com/products/player_census/flashplayer/version_penetration.html" rel="nofollow noreferrer">only to...
<p>Quick Answer: <a href="http://www.riastats.com" rel="nofollow noreferrer">www.riastats.com</a></p> <p>This site compares the different RIA plugins using graphical charts and graphs.</p> <p>It gets its data from small snippets of javascripts running on sites accross the web (approx 400,000 last time I looked)</p> ...
<p>The larger question is how many users will your site lose if implemented in Silverlight. And, it very much depends on your audience.</p> <p>If you're running a site about the joys of Linux kernel hacking or the virtues of Internet security, you'll probably lose a significant chunk of your audience. If you're runnin...
8,494
<p>I have recently started using Vim as my text editor and am currently working on my own customizations.</p> <p>I suppose keyboard mappings can do pretty much anything, but for the time being I'm using them as a sort of snippets facility almost exclusively.</p> <p>So, for example, if I type <code>def{TAB}</code> (<c...
<p>Snipmate - like texmate :) <a href="http://www.vim.org/scripts/script.php?script_id=2540" rel="noreferrer">http://www.vim.org/scripts/script.php?script_id=2540</a></p> <p>video: <a href="http://vimeo.com/3535418" rel="noreferrer">http://vimeo.com/3535418</a></p> <pre><code>snippet def """ ${1:docstring} """ ...
<p>As noted by MDCore, <a href="http://www.vim.org/scripts/script.php?script_id=1318" rel="nofollow noreferrer">SnippetsEmu</a> is a popular Vim script that does just that and more. If you need only expanding (without moving back the caret), you can use the standard <code>:ab[breviate]</code> command.</p> <pre><code>:...
3,615
<p>I have built a couple of 3d printers now and I'm having a little trouble with one I'm currently on. I frankensteined this one with two of my other printers that I had built. I took the Arduino mega and ramps 1.4 out of the older one and wired it up to the newer one. When I plug the printer in and try to move the ste...
<p>From an electrical standpoint, a two-phase stepper motors (what most 3D printers use) works the same backwards and forwards, the phase just reverses. If you are stalling on only one direction, I would look to see if you have a mechanical bind in that direction. Generally a wiring issue will cause the motor to eith...
<p>Sounds like you are configured for NC switches but are using NO switches, causing them to invert their reported state. Issue a <strong>M119</strong> command and see if the endstop statuses are correct when none are triggered.</p>
772
<p>I curious to how different people solve integration of systems. I have a feeling that the last years more and more work has gone into integrating systems and that this kind of work need will increase as well.</p> <p>I wondering if you solve it developing your own small services that are then connected or if you use...
<p>wow - Ok - will get a post on this but will be big.</p> <p>Intergration needs to be backed up with a big understanding by the business on the benefits - Get an opertating model sorted out - as the business may acutally need to standardise instead of intergrate, as this can be costly - its why most SOA fail! <a href...
<p>In my experience it depends on what kind of problem you are tacking.</p> <p>In my experience it's difficult to beat BizTalk 2006 R2 for bang for the buck but it does imply the use of a Microsoft technology stack.</p> <p>Websphere MQ seems to be an easier sell to larger corporates and it probably seen greater use a...
3,311
<p>We recently lost a database and I want to recover the data from de Production.log.</p> <p>Every request is logged like this:</p> <p>Processing ChamadosController#create (for XXX.XXX.XXX.40 at 2008-07-30 11:07:30) [POST] Session ID: 74c865cefa0fdd96b4e4422497b828f9 Parameters: {"commit"=>"Gravar", "action"=>"cr...
<p>Have you tried using <a href="http://corelib.rubyonrails.org/classes/Marshal.html" rel="nofollow noreferrer">Marshal#load</a>? I'm not sure how you're generating those session files, but it's quite possible Rails just uses Marshal.</p>
<p>Have you tried using <a href="http://corelib.rubyonrails.org/classes/Marshal.html" rel="nofollow noreferrer">Marshal#load</a>? I'm not sure how you're generating those session files, but it's quite possible Rails just uses Marshal.</p>
6,280
<p>I need to get the number of digits containing the number 1. I know in java I can take the input as a <code>String</code> and use <code>charAt</code>, but I understand there is no implicit String function in C. How can I accomplish this?</p>
<p>Division and modulus are your friends.</p> <pre><code>#include "stdio.h" int main(){ int digits[] = {0,0,0,0,0,0,0,0,0,0}; int i = 11031; while(i &gt; 0){ digits[i % 10]++; i = i / 10; } printf("There are %d ones.\n", digits[1]); } </code></pre>
<p>Something along the lines of:</p> <pre><code>int val=11031; int count=0; int i=0; char buf[100]; sprint(buf, "%d", val); for(i=0; (i &lt; sizeof(buf)) &amp;&amp; (buf[i]); i++) { if(buf[i] == '1') count++; } </code></pre>
9,177
<p>I have an images folder with a png in it. I would like to set a MenuItem's icon to that png. How do I write this in procedural code?</p>
<pre><code>menutItem.Icon = new System.Windows.Controls.Image { Source = new BitmapImage(new Uri("images/sample.png", UriKind.Relative)) }; </code></pre>
<p>You can also use your Visual Studio to insert a icon. This is the easiest way</p> <ul> <li>Right click at you project in the solution explorer</li> <li>chose Properties</li> <li>Make sure you're in the application page.</li> <li>@ recources you see: Icon and Manifest</li> <li>@ Icon: Click browse and pick your icon...
5,012
<p>OK. This is a bit of a vanity app, but I had a situation today at work where I was in a training class and the machine was set to lock every 10 minutes. Well, if the trainers got excited about talking - as opposed to changing slides - the machine would lock up.</p> <p>I'd like to write a teeny app that has nothing...
<p><strong>for C# 3.5</strong></p> <p>without notifyicon therefore you will need to terminate this application in task manager manually</p> <pre><code>using System; using System.Drawing; using System.Windows.Forms; static class Program { static void Main() { Timer timer = new Timer(); // time...
<p>(Windows 10 / .Net 5 / C# 9.0)</p> <p>Instead of faking activity, you could</p> <blockquote> <p>inform the system that it is in use, thereby preventing the system from entering sleep or turning off the display while the application is running</p> </blockquote> <p>using <a href="https://learn.microsoft.com/fr-fr/wind...
2,410
<p>I printed out this calibration shape from <a href="https://www.thingiverse.com/thing:2656594" rel="nofollow noreferrer">Thingiverse</a> with an unexpectedly catastrophic failure. It looks like there are <em>a lot</em> of things wrong here.</p> <p><img src="https://i.stack.imgur.com/V7QlZ.jpg" alt="Front View"> <im...
<p>The oozing is due to hot-end getting hot before the bed leveling procedure: if you move the hot-end warm up command <strong>after</strong> the <code>G29</code> line you avoid that oozing</p> <pre><code>; Ender 3 Custom Start G-code M104 S{material_print_temperature_layer_0} ; Set Extruder temperature M140 S{materia...
<p>The best solution would be to heat the bed, but not the nozzle at startup. If you level with a cold bed, your ABL mesh is going to be off, since the aluminum heated bed plate expands considerably once the heat is applied. </p> <p>You could also issue a retract command before leveling, and then add a counteracting...
1,143
<p>I'm looking for a "safe" eval function, to implement spreadsheet-like calculations (using numpy/scipy).</p> <p>The functionality to do this (the <a href="http://docs.python.org/lib/module-rexec.html" rel="nofollow noreferrer">rexec module</a>) has been removed from Python since 2.3 due to apparently unfixable secur...
<p>Depends on your definition of safe I suppose. A lot of the security depends on what you pass in and what you are allowed to pass in the context. For instance, if a file is passed in, I can open arbitrary files:</p> <pre><code>&gt;&gt;&gt; names['f'] = open('foo', 'w+') &gt;&gt;&gt; safe_eval.safe_eval("baz = type(f...
<p>Daniel, <a href="http://jinja.pocoo.org/2/documentation/intro" rel="nofollow noreferrer">Jinja</a> implements a sandboxe environment that may or may not be useful to you. From what I remember, it doesn't yet "comprehend" list comprehensions. </p> <p><a href="http://jinja.pocoo.org/2/documentation/sandbox" rel="nofo...
4,802
<p>What's the best way to import a CSV file into a strongly-typed data structure?</p>
<p>Microsoft's <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.fileio.textfieldparser.aspx" rel="nofollow noreferrer">TextFieldParser</a> is stable and follows <a href="https://www.rfc-editor.org/rfc/rfc4180" rel="nofollow noreferrer">RFC 4180</a> for CSV files. Don't be put off by the <code>Mic...
<p>If you can guarantee that there are no commas in the data, then the simplest way would probably be to use <a href="http://msdn.microsoft.com/en-us/library/system.string.split(VS.71).aspx" rel="nofollow noreferrer">String.split</a>.</p> <p>For example:</p> <pre><code>String[] values = myString.Split(','); myObject....
2,414
<p>I have a few kg of 3&nbsp;mm filament when I only have use for 1.75&nbsp;mm.</p> <p>How can I make 1.75&nbsp;mm from 3&nbsp;mm filament?</p>
<p>In theory, making filament is easy. You take a 3&nbsp;mm hotend with a 1.75&nbsp;mm hole, and extrude the 3&nbsp;mm (sometimes actually 2.85&nbsp;mm) filament, let it cool, and then reel it up.</p> <p>In reality there are a lot of pitfalls to making filament - if the pressure isn't even, the hole not perfect, the ...
<p>You could build a machine that has a nozzle with 3 mm input hole and 1.75 mm output hole, based on some designs for filament making machines. Or you could just cut the filament into little peaces and use them instead of the granulate in an original filament making machines.</p> <p>There are some open designs for su...
98
<p>After reading the Head First Design Patterns book and using a number of other design patterns, I'm trying to understand the Observer pattern. Isn't this already implemented using Events in the .NET Framework?</p>
<p>Yes, it is. The observer pattern is also called the publish/subscribe pattern, which is exactly what events allow you to do.</p>
<p>No, they achieve the same intent, however they are different. I would say that the Observer pattern is quite a hack of over design to achieve something you could have achieved easily with functional programming, and that .NET events uses functional programming to achieve the same goal.</p>
5,198
<p>While creating classes in Java I often find myself creating instance-level collections that I know ahead of time will be very small - less than 10 items in the collection. But I don't know the number of items ahead of time so I typically opt for a dynamic collection (ArrayList, Vector, etc).</p> <pre><code>class Fo...
<p>The <code>ArrayList</code> class in Java has only two data members, a reference to an <code>Object[]</code> array and a size—which you need anyway if you don't use an <code>ArrayList</code>. So the only advantage to not using an <code>ArrayList</code> is saving one object allocation, which is unlikely ever to be a b...
<p>The overhead is very small. It is possible to write a hybrid array list that has fields for the first few items, and then falls back to using an array for longer list.</p> <p>You can avoid the overhead of the list object entirely by using an array. To go even further hardcore, you can declare the field as Object, a...
8,134
<p>I need debug some old code that uses a Hashtable to store response from various threads.</p> <p>I need a way to go through the entire Hashtable and print out both keys and the data in the Hastable.</p> <p>How can this be done?</p>
<pre><code>foreach(string key in hashTable.Keys) { Console.WriteLine(String.Format("{0}: {1}", key, hashTable[key])); } </code></pre>
<p>This should work for pretty much every version of the framework...</p> <pre><code>foreach (string HashKey in TargetHash.Keys) { Console.WriteLine("Key: " + HashKey + " Value: " + TargetHash[HashKey]); } </code></pre> <p>The trick is that you can get a list/collection of the keys (or the values) of a given hash ...
5,525
<p>Most of our Eclipse projects have multiple source folders, for example:</p> <ul> <li>src/main/java</li> <li>src/test/java</li> </ul> <p>When you right-click on a class and choose New JUnit Test, the default source folder for the new test is "src/main/java" (presumably the first source folder listed in the project ...
<p>I use <a href="http://moreunit.sourceforge.net/" rel="noreferrer">moreUnit</a>, an Eclipse plugin to assist writing unit tests. Among other features, it lets you configure the default source folder of tests.</p>
<p>Now you can use my fast code eclipse plug-in. With this plug-in you can configure the test path to be <code>src/test/java</code> only once. It also has a jump to the unit test feature. It is available at : <a href="http://fast-code.sourceforge.net/" rel="nofollow">http://fast-code.sourceforge.net/</a>.</p>
9,451
<p>How does the <strong>open-source/free software community</strong> develop drivers for products that offer no documentation?</p>
<p>How do you reverse engineer something?</p> <ul> <li>You observe the input and output, and develop a set of rules or models that describe the operation of the object.</li> </ul> <p>Example:</p> <p>Let's say you want to develop a USB camera driver. The "black box" is the software driver.</p> <ol> <li>Develop hook...
<p>This is a pretty vague question, but I would say <a href="http://en.wikipedia.org/wiki/Reverse_engineering" rel="nofollow noreferrer">reverse engineering</a>. How they go about that is dependent on what kind of device it is and what is available for it. In many cases the device may have a similar core chipset to ano...
8,372
<p>The following will cause infinite recursion on the == operator overload method</p> <pre><code> Foo foo1 = null; Foo foo2 = new Foo(); Assert.IsFalse(foo1 == foo2); public static bool operator ==(Foo foo1, Foo foo2) { if (foo1 == null) return foo2 == null; return foo1.Equals(foo2); ...
<p>Use <code>ReferenceEquals</code>:</p> <pre><code>Foo foo1 = null; Foo foo2 = new Foo(); Assert.IsFalse(foo1 == foo2); public static bool operator ==(Foo foo1, Foo foo2) { if (object.ReferenceEquals(null, foo1)) return object.ReferenceEquals(null, foo2); return foo1.Equals(foo2); } </code></pre>
<p>You can try to use an object property and catch the resulting NullReferenceException. If the property you try is inherited or overridden from Object, then this works for any class.</p> <pre><code>public static bool operator ==(Foo foo1, Foo foo2) { // check if the left parameter is null bool LeftNull = fal...
9,943
<p>What does the following Guile scheme code do?</p> <pre><code>(eq? y '.) (cons x '.) </code></pre> <p>The code is not valid in MzScheme, is there a portable equivalent across scheme implementations?</p> <p>I am trying to port this code written by someone else. Guile seems to respond to '. with #{.}#, but I'm not s...
<p>Okay, it seems that '. is valid syntax for (string->symbol ".") in Guile, whereas MzScheme at least requires |.| for the period as a symbol.</p>
<p>I'm surprised any Scheme system will accept a dot symbol at all. My advice is to use another symbol as (I'm sure you're aware) the dot is a shorthand to represent a pair, and even if you can find a Scheme that will take your code you will likely confuse anyone that has the unfortunate task of actually reading your ...
9,007
<p>Can anyone point me to a good introduction to coding against the paypal API?</p>
<p>Found this article by Rick Strahl recently <a href="http://www.west-wind.com/presentations/PayPalIntegration/PayPalIntegration.asp" rel="noreferrer">http://www.west-wind.com/presentations/PayPalIntegration/PayPalIntegration.asp</a>. </p> <p>Have not implemeted anything from it yet, Rick has quite a few articles ar...
<p>I don't know what your needs are, but you might want to consider <a href="http://code.google.com/apis/checkout/samples/Google_Checkout_Sample_Code_NET.html" rel="nofollow noreferrer">Google Checkout</a>. <a href="http://www.joeaudette.com/paypal-sandbox-doesnt-work.aspx" rel="nofollow noreferrer">Joe Audette</a> wa...
7,649
<p>I know Windows Vista (and XP) cache recently loaded DLL's in memory...</p> <p>How can this be disabled via the command prompt?</p>
<p>The only thing you can do is disable SuperFetch, which can be done from the command prompt with this command (there has to be a space between the = sign and disabled).</p> <pre><code>sc config Superfetch start= disabled </code></pre> <p>There is a myth out there that you can disable DLL caching, but that only work...
<p>Perhaps it would be helpful to know why you want to do this and then try to help solve the original problem...</p>
5,709
<p>Where can I find the redistributable version of the IBM DB2 Type 4 driver? I suppose this is the driver I would use to connect from a Java app (on windows) to DB2 on the mainframe?</p>
<p><a href="http://www-01.ibm.com/support/docview.wss?rs=71&amp;uid=swg21288110" rel="noreferrer">IBM's Fix pack site</a> has the "IBM Data Server Driver for JDBC and SQLJ" which is nothing but the JDBC type 4 driver. Though the page I pointed to above happens to be the windows page, it's the same type 4 driver for al...
<p>If I need any IBM JARs for DB2 or MQ, I usually just add it to the instructions that DB2 or MQ needs to be installed as a prerequisite along with a URL to download it.</p> <p>The same goes for Java and many other not easily redistributable products as well.</p> <p>This eliminates the need to worry about licensing ...
6,883
<ol> <li><p>Is it possible to 3D print multiple 0.1 mm high layers with a 0.4 mm diameter nozzle in FDM while ensuring fidelity to the set layer height? The raster width is set at 0.4 mm and I am not touching that. The part thickness is 3 mm, so 30 layers of 0.1 mm have to be deposited for the completion of the print j...
<ol> <li><p>Yes, absolutely. I believe the original sample file that came with the Ender 3 (0.4 mm nozzle) was sliced for 0.1 mm layer height. As long as your printer can get decently precise Z positioning at 0.1 mm increments, it should be able to do it.</p> </li> <li><p>I've never used smaller nozzles but they pose c...
<p>The <a href="https://blog.prusaprinters.org/everything-about-nozzles-with-a-different-diameter_8344/" rel="nofollow noreferrer">general consensus for nozzle diameter versus layer height</a> is to limit the layer thickness to eighty percent of the nozzle diameter. For a 0.4 mm nozzle, one usually limits the layer to ...
2,118
<p>Is there a way to use <code>JQuery</code> to cloak or encrypt email addresses on an <code>HTML</code> page without changing the syntax in the <code>href</code>?</p>
<p>Using JQuery may not be the route you want to take since this would be on the client side... Is there a reason you're not encrypting on server side?</p>
<p>Semantic nazis would say "encoding", not "encrypting". Encrypting implies a secret is required to decode. Converting to <a href="http://www.asciitable.com/" rel="nofollow noreferrer">HTML entity syntax</a> would be a decent <em>encoding</em> process to keep out prying humans, but bots could easily decode it.</p>
6,861
<p>Anybody have a good example how to deep clone a WPF object, preserving databindings?</p> <hr> <p>The marked answer is the first part.</p> <p>The second part is that you have to create an ExpressionConverter and inject it into the serialization process. Details for this are here:<br> <a href="http://www.codeproje...
<p>The simplest way that I've done it is to use a XamlWriter to save the WPF object as a string. The Save method will serialize the object and all of its children in the logical tree. Now you can create a new object and load it with a XamlReader.</p> <p>ex: Write the object to xaml (let's say the object was a Grid con...
<p>How about:</p> <pre><code> public static T DeepClone&lt;T&gt;(T from) { using (MemoryStream s = new MemoryStream()) { BinaryFormatter f = new BinaryFormatter(); f.Serialize(s, from); s.Position = 0; object clone = f.Deserialize(s); ...
5,250
<p>Occasionally, I've come across a webpage that tries to pop open a new window (for user input, or something important), but the popup blocker prevents this from happening.</p> <p>What methods can the calling window use to make sure the new window launched properly?</p>
<p>If you use JavaScript to open the popup, you can use something like this:</p> <pre><code>var newWin = window.open(url); if(!newWin || newWin.closed || typeof newWin.closed=='undefined') { //POPUP BLOCKED } </code></pre>
<p>By using onbeforeunload event we can check as follows</p> <pre><code> function popup() { var chk=false; var win1=window.open(); win1.onbeforeunload=()=&gt;{ var win2=window.open(); win2.onbeforeunload=()=&gt;{ chk=true; }; wi...
2,507
<p>How can I show a web page in a transparent window and have the white part of the web page also transparent.</p>
<p>The solution is as follows.</p> <p>Use Python module <a href="https://docs.python.org/3/library/zipfile.html" rel="noreferrer">zipfile</a> to create zip archive, but as the file specify <a href="https://docs.python.org/3/library/io.html#io.StringIO" rel="noreferrer">StringIO</a> object (ZipFile constructor requires...
<p>Can't you just write a link to a "zip server" or whatnot? Why does the zip archive itself need to be served from Django? A 90's era CGI script to generate a zip and spit it to stdout is really all that's required here, at least as far as I can see.</p>
9,300
<p>Has someone experiment RDF storage solution like <a href="http://www.openrdf.org/" rel="nofollow noreferrer">Sesame</a>? I'm looking for performance review of this kind of solution compared to the traditional database solution.</p>
<p>There are plenny scalabity reports and benchmarks on the web about various triple-stores. </p> <p>Here is a fine <a href="http://simile.mit.edu/reports/stores/" rel="noreferrer">scalability report</a>.</p> <p>W3C itself maintain a wiki with lots of information about <a href="http://esw.w3.org/topic/LargeTripleStor...
<p>One intuition is that if you have a very large number of entities, tuple stores can save yourself the trouble of having your indexes routinely knocked out of memory as you switch between tables, and instead always have the first couple levels of the tuple index in RAM.</p>
3,844
<p>Does anyone know how I can, in platform-independent C++ code prevent an object from being created on the heap? That is, for a class "Foo", I want to prevent users from doing this:</p> <pre><code>Foo *ptr = new Foo; </code></pre> <p>and only allow them to do this:</p> <pre><code>Foo myfooObject; </code></pre> <p>...
<p><a href="https://stackoverflow.com/questions/10985/how-to-prevent-an-object-being-created-on-the-heap#11003">Nick's answer</a> is a good starting point, but incomplete, as you actually need to overload:</p> <pre><code>private: void* operator new(size_t); // standard new void* operator new(size_t, v...
<p>Not sure if this offers any compile-time opportunities, but have you looked at overloading the 'new' operator for your class?</p>
3,218
<p>I have make a little test with 4 dots aligned with A tower, B and C tower. Distance W and S are the same in the stl but not in the print. I have tried diferent values of diagonal root but S always is smaller than W, and all S are equal (more or less 38.20mm) and all W are equal (more or less 40.80). I expect that W ...
<p>I bet your towers are not standing straight (vertical) or your bed is not clearly horizontal</p> <p>I've recreated your picture with some assumptions (for example that your SW calculates properly and your steppers and motors act well).</p> <p>Take a look here: <a href="https://i.stack.imgur.com/O4lKx.png" rel="nofol...
<p>Well, you have two main issues:</p> <p><strong>1.-</strong> Your calculation for stepping is a little wrong, for example your firmware indicates 2315.84 when you need 2321.70 (REMEMBER this is an example and is not accurate), So you will see a diference about 2.0mm along your printing. If your printing is bigger mo...
687
<p>I seem to be missing something about LINQ. To me, it looks like it's taking some of the elements of SQL that I like the least and moving them into the C# language and using them for other things.</p> <p>I mean, I could see the benefit of using SQL-like statements on things other than databases. But if I wanted to...
<p>LINQ is not about SQL. LINQ is about being apply functional programming paradigmns on objects.</p> <p>LINQ to SQL is an ORM built ontop of the LINQ foundation, but LINQ is much more. I don't use LINQ to SQL, yet I use LINQ all the time.</p> <p>Take the task of finding the intersection of two lists:</p> <p>Before ...
<p>The point is that LINQ integrates your queries into your primary programming language, allowing your IDE to provide you with some facilities (Intellisense and debug support, for example) that you otherwise would not have, and to allow the compiler to type-check your SQL code (which is impossible with a normal string...
4,151
<p>I am trying to read a single file from a <code>java.util.zip.ZipInputStream</code>, and copy it into a <code>java.io.ByteArrayOutputStream</code> (so that I can then create a <code>java.io.ByteArrayInputStream</code> and hand that to a 3rd party library that will end up closing the stream, and I don't want my <code>...
<p>Your loop looks valid - what does the following code (just on it's own) return?</p> <pre><code>zipStream.read(tempBuffer) </code></pre> <p>if it's returning -1, then the zipStream is closed before you get it, and all bets are off. It's time to use your debugger and make sure what's being passed to you is actually...
<p>Check if the input stream is positioned in the begging.</p> <p>Otherwise, as implementation: I do not think that you need to write to the result stream while you are reading, unless you process this exact stream in another thread.</p> <p>Just create a byte array, read the input stream, then create the output strea...
9,285
<p>Can anyone recommend a good (preferably open source) tool for creating WSDL files for some soap web services?</p> <p>I've tried playing around with some of the eclipse plug ins available and was less than impressed with what I found.</p>
<p>As mentioned above, probably the easiest thing to do is use Apache CXF or Apache Axis2 to automatically generate your WSDL for you.</p> <p>If you have downloaded the Java EE version of Eclipse, you should be able to create a Dynamic Web Project with the Axis2 facets. If you create a simple Java class in the projec...
<p>Depends on which language you're working in, but if you're active in Java then I'd recommend looking at <a href="http://cxf.apache.org/" rel="nofollow noreferrer">Apache CXF</a>. It's a pretty solid framework for publishing java code as a SOAP web service. It also includes a tool for directly generating WSDL files: ...
9,842
<p>I'm printing on an Ender 5 with the default flex/magnetic build surface. I read that PLA and PETG may sometimes be printed without any bed heating at all and also that bed heating is the main contributor to the power consumption of a printer.</p> <p>As I do see that bed heating definitely helps with the first layer...
<p>There are three reasons (I can think of):</p> <ol> <li><p>A large problem you'd face with allowing the bed to cool after first layer is you stand the chance of losing adhesion after it cools. When you heat the bed, it expands somewhat. When it cools it contracts. It has been known for parts to actually pop off the ...
<p>A way to save energy would be use a pretty tight enclosure around the printer, I think a pretty thin layer of insulation would be enough to reduce power usage by a large factor. I've not build one myself yet but there seems to be so many benefits.</p>
1,426
<p>How do you convert decimal values to their hexadecimal equivalent in JavaScript?</p>
<p>Convert a number to a hexadecimal string with:</p> <pre><code>hexString = yourNumber.toString(16); </code></pre> <p>And reverse the process with:</p> <pre><code>yourNumber = parseInt(hexString, 16); </code></pre>
<p>Here's my solution:</p> <pre><code>hex = function(number) { return '0x' + Math.abs(number).toString(16); } </code></pre> <p>The question says: <em>"How to convert decimal to hexadecimal in JavaScript"</em>. While, the question does not specify that the hexadecimal string should begin with a 0x prefix, anybody wh...
8,221
<p>I have a string that contains the representation of a date. It looks like: </p> <p><strong>Thu Nov 30 19:00:00 EST 2006</strong></p> <p>I'm trying to create a Date object using SimpleDateFormat and have 2 problems. </p> <p>1.) I can't figure out the pattern to hard-code the solution into the SimpleDateFormat cons...
<p>The format to pass to SimpleDateFormat could be looked up at <a href="http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html" rel="noreferrer">http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html</a></p> <pre><code>new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy") </code></pre> <...
<p>Are you just asking for the pattern for that given date? If so, I think this should do it:</p> <pre><code>"EEE MMM d HH:mm:ss z yyyy" </code></pre> <p>Or are you trying to take any formatted date, and infer the format, and parse it?</p>
6,547
<p>Is it possible to determine which property of an ActiveX control is the default property? For example, what is the default property of the VB6 control CommandButton and how would I found out any other controls default!</p> <p><strong>/EDIT:</strong> Without having source to the object itself</p>
<p>Use OLE/Com Object Viewer, which is distributed with Microsoft Visual Studio. </p> <p>Go to type libraries and find the library the control is housed in, for example CommandButton is stored in <strong><em>Microsoft Forms 2.0 Object Library</em></strong>. Right click the library and select view. Find the coclass rep...
<blockquote> <p>you have access to the code, look for</p> </blockquote> <p>Unfortunetly I don't have access to the code for most of the controls. However the link is useful for the Microsoft Controls, but I still would like a way to know for other controls.</p>
6,279
<p>I own an Ender 3, it's about 3 years old and the issues I have with extrusion, leaking and filament blockage are monstrous.</p> <p>Examples of problems like this are filament flow issues, filament blockage, and filament leaking out of the sides.</p> <p>Problems like this take all day to fix, and in the end, they are...
<p>No not at all. The only way to eliminate issues is to practice and break things and learning how to fix it. I have 2 CR-10s, 1 CR-10S5, 1 CR-10 MINI, and 2 Anycubic Photons. They are all heavily modified, and the one thing i learned is that modifications only add to the problems</p>
<p>I use a German RepRap printer, which is very expensive compared to many of the printers in the questions on this list. I still see similar printing issues on a RepRap to other printers. The settings often control the issues. The RepRap however has a much larger print area that most of the printers referred to on thi...
2,052
<p>Moving through the maze forward is pretty easy, but I can't seem to figure out how to back up through the maze to try a new route once you hit a dead end without going back too far?</p>
<p>Use <a href="http://www.cs.bu.edu/teaching/alg/maze/" rel="nofollow noreferrer">backtracking</a> by keeping a stack of previous direction decisions.</p>
<p>Eric Lippert did a series of articles on creating a <a href="http://blogs.msdn.com/ericlippert/archive/tags/AStar/default.aspx" rel="nofollow noreferrer">C# implemention of A*</a>, which might be more efficient.</p>
6,164
<p>I'm wondering how to make a release build that includes all necessary dll files into the .exe so the program can be run on a non-development machine without it having to install the microsoft redistributable on the target machine.</p> <p>Without doing this you get the error message that the application configuratio...
<ol> <li>Choose Project -> Properties</li> <li>Select Configuration -> General</li> <li>In the box for how you should link MFC, choose to statically link it.</li> <li>Choose Linker -> Input. Under <strong>Additional Dependencies</strong>, add any libraries you need your app to statically link in.</li> </ol>
<p>You'd be looking to static link (as opposed to dynamically link)</p> <p>I'm not sure how many of the MS redistributables statically link in.</p>
2,540