instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>This issue just started recently; I am not sure if it is because of the specific part I am printing or whether something on the printer is going bad. Up until now, I have been printing all kinds of parts with no problems whatsoever.</p> <p>I am printing a hollow sphere whose walls have fill paths that require the X ...
<p>PLA is a forgiving filament, you can even print such filament without a heated bed. Although there are differences in quality between brands, PLA shouldn't need a raft to be printed. Hatchbox filament is not considered as a low quality type of filament; it is economical and has been around since 2013. A raft is a st...
<p>Please try one (or more) of the following:</p> <ol> <li><p>Change the temperature of your heated bed (50 - 60 °C)</p> </li> <li><p>Check your nozzle height (0.15 - 0.25 mm is what I use)</p> </li> <li><p>Make sure your bed is level (Maybe use a leaving stick (or whatever those bubble things are called))</p> </li> <l...
1,934
<p>If I have an HTML helper like so:</p> <pre><code>Name:&lt;br /&gt; &lt;%=Html.TextBox("txtName",20) %&gt;&lt;br /&gt; </code></pre> <p>How do I apply a CSS class to it? Do I have to wrap it in a span? Or do I need to somehow utilize the HtmlAttributes property of the helper?</p>
<p>You can pass it into the TextBox call as a parameter.</p> <pre><code>Name:&lt;br/&gt; &lt;%= Html.TextBox("txtName", "20", new { @class = "hello" }) %&gt; </code></pre> <p>This line will create a text box with the value 20 and assign the class attribute with the value hello. I put the @ character in front of ...
<p></p> <p>Is it that much more work? </p>
6,209
<p>I want to loop over the contents of a text file and do a search and replace on some lines and write the result back to the file. I could first load the whole file in memory and then write it back, but that probably is not the best way to do it.</p> <p>What is the best way to do this, within the following code?</p> ...
<p>I guess something like this should do it. It basically writes the content to a new file and replaces the old file with the new file:</p> <pre><code>from tempfile import mkstemp from shutil import move, copymode from os import fdopen, remove def replace(file_path, pattern, subst): #Create temp file fh, abs_...
<p>if you remove the indent at the like below, it will search and replace in multiple line. See below for example.</p> <pre><code>def replace(file, pattern, subst): #Create temp file fh, abs_path = mkstemp() print fh, abs_path new_file = open(abs_path,'w') old_file = open(file) for line in old_...
6,013
<p>I am trying to get my first layer calibrating done but no matter what I do, I can not get the lines sticking to the bed.</p> <p>My first question is the distance of the P.I.N.D.A. What I did was what Prusa recommends on <a href="https://d17kynu4zpq5hy.cloudfront.net/igi/prusa3d/KtMljQEIWfs5QXJV.medium" rel="nofollo...
<p>Calibrating the first layer height involves two steps:</p> <p>The first step, as illustrated in that picture, is to adjust the PINDA probe to be roughly the right distance above the nozzle. The PINDA only has a sensing range of about a millimeter, so if it's too high, it can't detect the printbed; if it's too low,...
<p>Your problem is that you need to define the sensor to nozzle level offset and store it in the printers memory.</p> <p>When you have homed the printer, you should end up with the nozzle at a certain level where the sensor trigger point is now defined in relation to the bed. Next step is to relate the trigger point t...
1,129
<p>Is there a keyboard shortcut in Access 2003 that will run a query while in design or sql mode?</p>
<p>It's not built-in. I would try a macro - AutoKeys? You should be able to make almost any keyboard short you want that way.</p>
<p>Does Alt Q Alt R (ie menu item selection) not suit?</p>
8,083
<p>This code is from <em>Prototype.js</em>. I've looked at probably 20 different tutorials, and I can't figure out why this is not working. The response I get is null.</p> <pre><code>new Ajax.Request(/path/to / xml / file.xml, { method: "get", contentType: "application/xml", onSuccess: function(transport) { ...
<p>If transport.responseXML is null but you have a value for transport.responseText then I believe it's because it's not a valid XML file.</p> <p><strong>Edit:</strong> I just noticed that in our code here whenever we request an XML file we set the content type to 'text/xml'. I have no idea if that makes a differenc...
<p>Just want to share my afternoon working on the issue with a NULL result for <strong>responseXML</strong> responses. My results were exactly as described in the question: responseText was filled with the XML file, responseXML was NULL. As i was totally sure my file is in valid XML format, the error must be somewhere ...
7,824
<p>How do you find a memory leak in Java (using, for example, JHat)? I have tried to load the heap dump up in JHat to take a basic look. However, I do not understand how I am supposed to be able to find the root reference (<a href="https://stackoverflow.com/questions/104/anatomy-of-a-memory-leak">ref</a>) or whatever i...
<p>I use following approach to finding memory leaks in Java. I've used jProfiler with great success, but I believe that any specialized tool with graphing capabilities (diffs are easier to analyze in graphical form) will work.</p> <ol> <li>Start the application and wait until it get to "stable" state, when all the ini...
<p>You really need to use a memory profiler that tracks allocations. Take a look at <a href="http://www.ej-technologies.com/products/jprofiler/overview.html" rel="nofollow noreferrer">JProfiler</a> - their "heap walker" feature is great, and they have integration with all of the major Java IDEs. It's not free, but it i...
6,132
<p>This has inspired some discussion and I may be just splitting hairs, but I've always been confused by this strategy. The specific example I'm referring to is here: <a href="https://3dprinting.stackexchange.com/a/29/60">https://3dprinting.stackexchange.com/a/29/60</a></p> <p>In many cases on SE, I see people post "...
<p>Sometimes, "don't try to do what you're trying to do" is the only valid answer, see e.g. <a href="https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem">XY problem</a>.</p>
<p>If it tries to answer the question, it's still an answer... </p> <p>But it doesn't mean it's always a good one.</p> <p>Generally, in these cases, you would be able to flag such an answer as Very Low Quality, especially if they would fit better in the comment space. The reason why you can't here however, is because...
8
<p>Attempting to insert an escape character into a table results in a warning. </p> <p>For example:</p> <pre><code>create table EscapeTest (text varchar(50)); insert into EscapeTest (text) values ('This is the first part \n And this is the second'); </code></pre> <p>Produces the warning:</p> <pre><code>WARNING: n...
<p>Partially. The text is inserted, but the warning is still generated.</p> <p>I found a discussion that indicated the text needed to be preceded with 'E', as such:</p> <pre><code>insert into EscapeTest (text) values (E'This is the first part \n And this is the second'); </code></pre> <p>This suppressed the warning,...
<p>Really stupid question: Are you sure the string is being truncated, and not just broken at the linebreak you specify (and possibly not showing in your interface)? Ie, do you expect the field to show as</p> <blockquote> <p>This will be inserted \n This will not be</p> </blockquote> <p>or</p> <blockquote> <p>This will...
2,336
<p>What is the best way to generate a Unique ID from two (or more) short ints in C++? I am trying to uniquely identify vertices in a graph. The vertices contain two to four short ints as data, and ideally the ID would be some kind of a hash of them. Prefer portability and uniqueness over speed or ease. </p> <p>The...
<p>A simple solution is to use a 64 bit integer where the lower 16 bits is the first vertex coordinate, next 16 bits is the second, and so on. This will be unique for all your vertices, though not very compact.</p> <p>So here's some half-assed code to do this. Hopefully I got the casts right.</p> <pre><code>uint64_t ...
<p>off the cuff I'd say use prime numbers,</p> <pre><code>id = 3 * value1 + 5 * value2 + .... + somePrime * valueN </code></pre> <p>Make sure you don't overflow your id space (long? long long?). Since you've got a fixed number of values just crap some random primes. Don't bother generating them, there are enough avai...
9,127
<p>On a budget, I'm water-cooling a 3D printer. I'm using a 5&nbsp;V aquarium pump (\$3). Originally I tried to only use about as much water in a can of chickpeas but then found out i needed a lot more. I have a deliberate need to water cool stepper motors in the first printer, so that I can print with a high temperatu...
<p>Cooling any single face of the motor is fine. The motor case conducts heat <em>very</em> well. Many 3d printers effectively cool the motors merely by having the output drive face of the motor bolted to a metal bracket which is bolted to the aluminum extrusion frame. That's it. That contact alone cools the motor, whi...
<p>Your solution will not cool all sides effectively. Firstly don't use zip ties; get thermal tape.</p> <p><a href="https://i.stack.imgur.com/uC6tD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uC6tD.jpg" alt="Thermal Tape"></a> (<a href="https://rads.stackoverflow.com/amzn/click/com/B00QSHPH8E" r...
1,451
<p>I need to know about Epoll On linux System.</p> <p>Could you recommend manual or guides about epoll library?</p> <p>need more detailed guides. it's better to have some examples.</p> <p>help me. and Thank you for reading.</p>
<p>Here's an introduction to Epoll, a pretty basic tutorial: <a href="https://kovyrin.net/2006/04/13/epoll-asynchronous-network-programming/" rel="nofollow noreferrer">http://blog.kovyrin.net/2006/04/13/epoll-asynchronous-network-programming/</a></p> <p>A more complete example can be found here: <a href="https://web.a...
<pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;unistd.h&gt; #include &lt;sys/types.h&gt; #include &lt;sys/socket.h&gt; #include &lt;netinet/in.h&gt; #include &lt;arpa/inet.h&gt; #include &lt;sys/epoll.h&gt; #define PORT 1500 #define MAX_CON (1200) static struct ...
4,689
<p>I know that it's said the PLA becomes brittle when kept in a humid environment, but my case is slightly weirder:</p> <p>I have rolls of 1.75 mm PLA that I bought years ago and they are fine. But if I leave my spool fed inside the PTFE (Teflon) tube of my 3D printer, that part that is inside the PTFE tube, and only t...
<p>I have this exact problem as well. I am feeding filament from the dry box through the tube into the top of the hot end. After approximately 2 days I would notice that the filament is broken somewhere close to the hot end. I don't believe that it's just humidity.</p> <p>I suspect that the filament being brittle and b...
<p>I'm having the exact same problem - it is enough to leave the filament inside the PTFE tube for an overnight and the next day the filament inside the tube is so brittle that I'm not even able to eject the filament without disconnecting the tube and getting out all small pieces of filament manually... but from my exp...
1,990
<p>Is there any way to save an object using Hibernate if there is already an object using that identifier loaded into the session?</p> <ul> <li>Doing <code>session.contains(obj)</code> seems to only return true if the session contains that exact object, not another object with the same ID.</li> <li>Using <code>merge(o...
<p>Have you tried calling .SaveOrUpdateCopy()? It should work in all instances, if there is an entity by the same id in the session or if there is no entity at all. This is basically the catch-all method, as it converts a transient object into a persistent one (Save), updates the object if it is existing (Update) or e...
<p>How about:</p> <pre><code>session.replicate(entity, ReplicationMode.OVERWRITE); </code></pre> <p>?</p>
4,599
<p>I'm looking for some "Best Practices" for automating the deployment of Stored Procedures/Views/Functions/Table changes from source control. I'm using StarTeam &amp; ANT so the labeling is taken care of; what I am looking for is how some of you have approached automating the pull of these objects from source - not ne...
<p>We use SQL Compare from redgate (<a href="http://www.red-gate.com/" rel="nofollow noreferrer">http://www.red-gate.com/</a>).</p> <p>We have a production database, a development database and each developer has their own database.</p> <p>The development database is synchronised with the changes a developer has made ...
<p>I prefer to separate views, procedures, and triggers (objects that can be re-created at will) from tables. For views, procedures, and triggers, just write a job that will check them out and re-create the latest.</p> <p>For tables, I prefer to have a database version table with one row. Use that table to determine...
7,586
<p>I'm building an excel template (*.xlt) for a user here, and one of the things I want to do is have it insert the current date when a new document is created (ie, when they double-click the file in windows explorer). How do I do this?</p> <p><strong>Update:</strong> I should have added that I would prefer not to us...
<p>You could use the worksheet function =TODAY(), but obviously this would be updated to the current date whenever the workbook is recalculated.</p> <p>The only other method I can think of is, as 1729 said, to code the Workbook_Open event:</p> <pre><code>Private Sub Workbook_Open() ThisWorkbook.Worksheets("Sheet1...
<p>To avoid VBA, and if you think your users might follow instructions, you could ask them to copy the date and then paste special->values to set the date so that it won't change in future.</p>
6,187
<p>I've recently taken up learning some C# and wrote a Yahtzee clone. My next step (now that the game logic is in place and functioning correctly) is to integrate some method of keeping stats across all the games played.</p> <p>My question is this, how should I go about storing this information? My first thought wou...
<p>Here is one idea: use Xml Serialization. Design your GameStats data structure and optionally use Xml attributes to influence the schema as you like. I like to use this method for small data sets because its quick and easy and all I need to do is design and manipulate the data structure.</p> <pre><code> using (Fil...
<p>You can either use the <code>System::Xml</code> namespace or the <code>System::Data</code> namespace. The first gives you raw XML, the latter gives you a handy wrapper to the XML.</p>
4,041
<p>What would be the best way to draw a simple animation just before showing a modal <a href="https://docs.oracle.com/javase/9/docs/api/javax/swing/JDialog.html" rel="nofollow noreferrer">JDialog</a>? (i.e. expanding borders from the mouse click point to the dialog location). I thought it would be possible to draw on t...
<p>Are you trying to show the JDialog indepentently of the annimation? In order to get the order set properly, you may need to bundle those actions in a runnable that is passed to the EDT at once.</p> <p>eg:</p> <pre><code>SwingUtilities.invokeLater(new Runnable(){ public void run(){ doAnnimation(); sh...
<p>You may be able to take @rcreswick's answer and expand on it a little to make it work.</p> <pre><code>void myShowDialog() { new Thread(new Runnable() {public void run() { SwingUtilities.invokeAndWait(new Runnable() { public void run() { doAnimation(); } } ); // Delay to wait for the animation to...
6,017
<p>I know how to use tags in subversion. I create a tag every time I get to a release milestone.</p> <p>What I don't quite understand is how they work. </p> <p>Is a tag just a copy, made from what ever revision I specify? Or is a tag more like a reference, where internally subversion just says <code>GO TO /trunk/proj...
<p>Yes, a svn copy (whether you are thinking of it as a tag, a branch, or copying a file in trunk) is all the same. SVN will internally create a pointer to the source location at that revision. If you then make changes to the copy (which you are likely to do if it is a branch or a copied file in trunk, but shouldn't ...
<p>an example:</p> <pre><code>$ svn copy https://jorgesysgr.com/svn/AndNews/branches \ https://jorgesysgr.com/svn/AndNews/tags/release-1.1 \ -m "release 1.1 Android News." </code></pre> <p>More info:: <a href="http://svnbook.red-bean.com/nightly/en/svn.branchmerge.tags.html" rel="nofollow">Creat...
6,116
<p>At the moment the outside surface temperature is around 30 °C. Can I put my PETG spools outside with a fan in order to dry them cheaply?</p>
<p>The answer to this specific instance appeared in the comments:</p> <blockquote> <p>Also, <a href="https://3dprinting.stackexchange.com/a/6092/">a thorough cleaning of the nozzle/hotend</a> might also be a good idea to get rid of all the stuck ABS residue inside. – 0scar Mar 26 at 8:44</p> <p>The problem solv...
<p>That looks pretty bad for a number of reasons. If you've got an all-metal hotend, you can be pretty sure that your PLA issues are probably at least partially cooling-related. I'd recommend you try and find a better fan duct design for your hotend, if possible, and possibly upgrade to a better fan.</p> <p>You can te...
1,260
<p>I'd like to do the following and can't find an elegant way:</p> <ol> <li>Read an XML template into a <code>System.Xml.XmlDocument</code> </li> <li>Populate it with data from my UI </li> <li>Transform it with an <code>XSLT</code> I've written </li> <li>Apply a <code>CSS</code> Stylesheet </li> <li>Render it to a...
<p>Quick question. Why do you need an Xml template? If you already know the schema before hand, then simply generate the complete Xml in your code. There shouldn't be a need for loading a template file.</p>
<p>Check out <a href="http://www.hookedonlinq.com/LINQtoXML5MinuteOverview.ashx" rel="nofollow noreferrer">Linq to XML</a> - it's really good way to write and read Xml based data. Easier than the System.Xml.XmlDocument mechanisms.</p> <p>Given that you are supplying the XSLT and the CSS, why not build the page in XHTM...
5,878
<p>Is there a good method or tool to level the bed of 3D printers? I find myself making small adjustments a lot and it's mostly just trial-and-error. A normal bubble level is of limited help and trying to figure out if the head is the thickness of a sheet of paper from the bed in all corners is beyond the capability of...
<p>There are several ways.</p> <p>1) Simplest is the business card/paper method.</p> <p>This video shows how simple it is: <a href="https://www.youtube.com/watch?v=5bzAE5-QgUY" rel="noreferrer">Leveling the platform</a></p> <p>You should feel the same amount of resistance between the hotend and the bed on all sides....
<p>If you don't have an auto-leveling build plate or a depth gauge attachment for your X-Axis, you're pretty much stuck with the "piece of paper" method. To perform this easier, try shifting the paper as you adjust the bed. As soon as the paper becomes difficult to move (the nozzle is touching now), back off the build ...
183
<p>I'm trying to fix some JavaScript bugs. Firebug makes debugging these issues a lot easier when working in Firefox, but what do you do when the code works fine on Firefox but IE is complaining?</p>
<p>you can also check out the <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=95e06cbe-4940-4218-b75d-b8856fced535" rel="noreferrer">IE Developer Toolbar</a> which isn't a debugger but will help you analyze the contents of your code.</p> <p><a href="http://weblogs.asp.net/scottgu/archive/2007/07/1...
<p>The IE8 beta comes with what I think is the IE Developer toolbar, but it seems to be a lot more powerful than the last time I tried the toolbar on IE7</p>
2,978
<p>When you data bind in C#, the thread that changes the data causes the control to change too. But if this thread is not the one on which the control was created, you'll get an Illegal Cross Thread Operation exception.</p> <p>Is there anyway to prevent this?</p>
<p>You should be able to do something like:</p> <pre><code>if (control.InvokeRequired) { control.Invoke(delegateWithMyCode); } else { delegateWithMyCode(); } </code></pre> <p>InvokeRequired is a property on Controls to see if you are on the correct thread, then Invoke will invoke the delegate on the correct t...
<p>If the thread call is "illegal" (i.e. the DataBind call affects controls that were not created in the thread it is being called from) then you need to create a delegate so that even if the decision / preparation for the DataBind is not done in the control-creating thread, any resultant modification of them (i.e. Dat...
2,421
<p>Recently I have been investigating the possibilities of caching in ASP.NET.</p> <p>I rolled my own "Cache", because I didn't know any better, it looked a bit like this:</p> <pre><code>public class DataManager { private static DataManager s_instance; public static DataManager GetInstance() { ...
<p>I think the maxim "let the computer do it; it's smarter than you" applies here. Just like memory management and other complicated things, the computer is a lot more informed about what it's doing than your are; consequently, able to get more performance than you are.</p> <p>Microsoft has had a team of engineers wor...
<p>Caching in ASP.NET is feature rich and you can configure caching in quite a granular way. </p> <p>In your case (data caching) one of the features you're missing out on is the ability to invalidate and refresh the cache if data on the SQL server is updated in some way (SQL Cache Dependency).</p> <p><a href="http://...
3,232
<p>I saw an extruder mod on Amazon <em>"EAONE 2 Pcs PTFE Teflon Tube (2 Meters) with 4 Pcs PC4-M6 Fittings for 3D Printer 1.75mm Filament (2.0mm ID/4.0mm OD)"</em> Anybody know how this is fitted? Is it simply tapping the feed hole on the top?</p>
<p>Is <a href="https://www.amazon.co.uk/EAONE-Teflon-Fittings-Printer-Filament/dp/B077X6FW97" rel="nofollow noreferrer">this</a> what you are referring to?</p> <p>If yes, the cold end of the extruder is nomally already tapped and you simply have to screw the new fitting in it. The PTFE tube itself needs just to be fe...
<p>that item is for a bowden setup. (the a8 does not come with a bowden setup, but can be modded to have one.) when installing the bowden setup on a a8, the first thing you will need to do is move the motor to somewhere else, there are tons of choices on thingiverse. then the PC4-M6 fitting will screw into the black al...
809
<p>I'm using Eclipse as my IDE for a C++ project, and I would love for it to tell me where a given symbol is defined and what the parameters are for a function.</p> <p>However, there's a catch: I also use <a href="http://www.lazycplusplus.com/" rel="nofollow noreferrer">Lazy C++</a>, a tool that takes a single source ...
<p>I'd imagine its one of:</p> <ul> <li><p>Eclipse doesn't want to display non-C++ resources in the tree (I've had problems with this)</p></li> <li><p>You don't have "Preferences > C/C++ > Indexer > Index All Files" enabled.</p></li> <li><p>You want to use the "Full C/C++ Indexer" rather than the "Fast C/C++ Indexer"<...
<p>The CDT parser/indexer won't recognize weird extensions like that. The only thing you can do is to define macros on the Paths and Symbols property page to trick the parser. Try creating macros for <code>$hdr</code>, <code>$end</code> and <code>$src</code> that have empty bodies. That way the preprocessor will remove...
8,294
<p>What's the most efficient way to concatenate strings?</p>
<p>The <code>StringBuilder.Append()</code> method is much better than using the <code>+</code> operator. But I've found that, when executing 1000 concatenations or less, <code>String.Join()</code> is even more efficient than <code>StringBuilder</code>.</p> <pre><code>StringBuilder sb = new StringBuilder(); sb.Append(...
<p>It would depend on the code. StringBuilder is more efficient generally, but if you're only concatenating a few strings and doing it all in one line, code optimizations will likely take care of it for you. It's important to think about how the code looks too: for larger sets StringBuilder will make it easier to read...
4,140
<p>This is what I've got. It works. But, is there a simpler or better way?</p> <p>ASPX Page&hellip;</p> <pre><code>&lt;asp:Repeater ID="RepeaterBooks" runat="server"&gt; &lt;HeaderTemplate&gt; &lt;table class="report"&gt; &lt;tr&gt; &lt;th&gt;Published&lt;/th&gt; ...
<p>@Geoff</p> <p>That sort of Eval statement was actually added in 2.0, but if performance is important Eval should be avoided since it uses Reflection.</p> <p>The repeater is a pretty good way of doing it, although it might be faster to generate the table in code:</p> <p>ASPX Page:</p> <pre><code>&lt;table class="...
<blockquote> <p><strong><a href="https://stackoverflow.com/users/1249/alassek">ALassek</a></strong> wrote:</p> <p>&hellip;generate the table in code&hellip;</p> </blockquote> <p>I like the look of that! It seems MUCH less likely to produce a run-time exception due to a typo or field name change.</p>
6,539
<p>Consider the need to develop a lightweight desktop DB application on the Microsoft platforms.</p> <p>It could be done fairly easily with MS Access but I'd like to be able to distribute it to others and I don't want to pay for a runtime license. </p> <p>Requirements:</p> <ul> <li>easy distribution to others</li> ...
<p>One thing to keep in mind here is the MS Access product is much more than just the raw database engine. It provides a full application development platform, including form and menu designer, client application language and environment (VBA), and report designer. When you take all those things together, MS Access rea...
<p>VistaDB is the only alternative if you going to run your website at shared hosting (almost all of them won't let you run your websites under Full Trust mode) and also if you need simple x-copy deployment enabled website.</p>
4,871
<p>I'm missing the boat on something here, kids. This keeps rearing its head and I don't know what's going on with it, so I hope my homeys here can help.</p> <p>When working in Silverlight, when I create bindings in my c# code, they never hold up when the application is running. The declarative bindings from my xaml...
<p>I've just tried the exact code you just posted and it worked fine, with some changes. I believe the problem is the element you are using for the SetBinding call is not the textblock you want to bind. It should be:</p> <pre><code>TextBlock tb = new TextBlock(); Binding b = new Binding("FontSize"); b.Source = this; t...
<p>I've just tried the exact code you just posted and it worked fine, with some changes. I believe the problem is the element you are using for the SetBinding call is not the textblock you want to bind. It should be:</p> <pre><code>TextBlock tb = new TextBlock(); Binding b = new Binding("FontSize"); b.Source = this; t...
9,748
<p>When using the Net.Sockets.TcpListener, what is the best way to handle incoming connections (.AcceptSocket) in seperate threads?</p> <p>The idea is to start a new thread when a new incoming connection is accepted, while the tcplistener then stays available for further incoming connections (and for every new incomin...
<p>The code that I've been using looks like this:</p> <pre><code>class Server { private AutoResetEvent connectionWaitHandle = new AutoResetEvent(false); public void Start() { TcpListener listener = new TcpListener(IPAddress.Any, 5555); listener.Start(); while(true) { IAsyncResult result =...
<p>I would use a threadpool, this way you won't have to start a new thread every time (since this is kinda expensive). I would also not wait indefinetely for furhter connections, since clients may not close their connections. How do you plan to route the client to the same thread each time?</p> <p>Sorry, don't have sa...
8,789
<p>Anyone know of a way to use SVK with perforce? The docs <a href="http://svk.bestpractical.com/view/MirrorVCP" rel="nofollow noreferrer">seem to imply</a> it used to be possible, but some <a href="http://lists.bestpractical.com/pipermail/svk-devel/2007-February/000604.html" rel="nofollow noreferrer">mailing list mes...
<p>For a private repository, you should try <a href="http://www.releng.com/p5layer.html" rel="nofollow noreferrer">P5</a></p>
<p>Why use SVK to mirror Perforce? Surely using a <a href="http://www.perforce.com/perforce/products/p4p.html" rel="nofollow noreferrer">Perforce Proxy</a> is the best way to make your repository distributed?</p>
7,602
<p>Resharper, RefactorPro, etc?</p>
<p>I have tried using Resharper for some while and also CodeRush with Refactor later on. </p> <p>I have stayed with CodeRush/Refactor. There is one major difference - the discoverability of the commands. Their learning videos are quite nice and show you a lot.</p> <p>Most importantly Coderush has one key/shortcut for...
<p>I think ReSharper is great. I've been using it for 3 years now and I just love it more and more.</p>
6,970
<p>Does anybody use the Class Designer much in Visual Studio?</p> <p>I have downloaded the Modeling Power Toys for 2005 and have been impressed with what I've seen so far. The MSDN Class Designer Blog doesn't seem to have been updated for a while but it still looks quite useful.</p> <p>Is the Class Designer a quick w...
<p>As a visualization tool, or for exploratory purposes (drawing up multiple options to see what they look like) it's not bad, but generally I find the object browser does fine for most stuff I care about.</p> <p>As a code generation tool, it's a terrible idea.</p> <p>The whole idea that we will design all our code s...
<p>I have tried it out couple of times, mainly for viewing existing classes. If it would show all the relationships, it would be more usefull. Now it only shows inheritation.</p>
3,520
<p>I'm playing with the routing.rb code in Rails 2.1, and trying to to get it to the point where I can do something useful with the RoutingError exception that is thrown when it can't find the appropriate path.</p> <p>This is a somewhat tricky problem, because there are some class of URLs which are just plain BAD: the...
<p>Nooooo!!! Don't implement method_missing on your controller! And please try to avoid action_missing as well.</p> <p>The frequently touted pattern is to add a route:</p> <pre><code>map.connect '*', :controller =&gt; 'error', :action =&gt; 'not_found' </code></pre> <p>Where you can show an appropriate error.</p> <...
<p>There's the method_missing method. You could implement that in your Application Controller and catch all missing actions, maybe logging those and redirecting to the index action of the relevant controller. This approach would ignore everything that can't be routed to a controller, which is pretty close to what you w...
7,419
<p>How do I implement a draggable tab using Java Swing? Instead of the static JTabbedPane I would like to drag-and-drop a tab to different position to rearrange the tabs.</p> <p><strong>EDIT</strong>: <a href="http://java.sun.com/docs/books/tutorial/uiswing/dnd/index.html" rel="noreferrer">The Java Tutorials - Drag an...
<p>Curses! Beaten to the punch by a Google search. Unfortunately it's true there is no easy way to create draggable tab panes (or any other components) in Swing. So whilst the example above is complete this one I've just written is a bit simpler. So it will hopefully demonstrate the more advanced techniques involved ...
<p>Add this to isDragAcceptable to avoid Exceptions:</p> <pre><code>boolean transferDataFlavorFound = false; for (DataFlavor transferDataFlavor : t.getTransferDataFlavors()) { if (FLAVOR.equals(transferDataFlavor)) { transferDataFlavorFound = true; break; } } if (transferDataFlavorFound == fals...
8,511
<p>I've got some sliced models that represent the <strong>right</strong>-side arms and legs of a robot. I'm really happy with how they printed, so now I'd like to print the <strong>left</strong>-side arms and legs.</p> <p>I was thinking it would be pretty trivial to parse the G-code file using Python and change the val...
<p>If your slicer does not have a mirror operation or a scale that allows negative values then mirroring in the G-code should be straightforward.</p> <p>As long as your printer doesn't have certain specific tool change or homing or purge positions that are done in the G-code you can just transform it, otherwise you wou...
<p>Usage: python3 [filename.gcode] [bed-width]</p> <pre><code>#!/usr/bin/env python3 import re from sys import argv #first arg is the file, second arg is the bed x width ifilename = argv[1]; ofilename = ifilename.replace('.gcode', '-reversed.gcode'); new_data =[] BEDX = float(argv[2]) h = BEDX # Absolute Positioning...
1,979
<p>I'm in dire need to reprint a small chunk of a print that got messed up during print because the support for it broke which I cannot explain whatsoever.</p> <p>Anyway. I need to edit the STL file and I don't know what tool to use since Blender is definitely not user friendly for just a simple cut and past.</p> <p>...
<p>Alright so I asked in my facebook group and a friendly fellow game me the tip to use Meshmixer from AutoCAD and then check a video on Plane cut. I only needed 3 simple cuts and the piece I needed was all ready to print. :) 40 Minutes to print and only 3g of PLA to spend :)</p>
<p>You could import the STL file in a 3D CAD modelling program and edit it there.</p> <p>To not give an opinionated answer, there are many free or paid alternatives available. Loading the STL generally requires it to be scaled down to one tenth of the imported size and transform the surface model into a solid. Once yo...
1,146
<p>I have been working with our SLA printer (Facture Draken) for a couple weeks now printing in makerjuice waxcast. . I have had some successful prints, but the majority (80%) end up as pancakes stuck to the bottom of the resin tray. Some others break in half mid print. </p> <p>I have experimented with laying my m...
<p>Prints could end up on tray for couple of reasons. </p> <ul> <li>Vacuum force on early layers - Usually you should lose pieces on the center of platform <ul> <li>Put holes or channels on platform</li> <li>Very slow speed on early layers</li> <li>Use smaller platform</li> <li>Use tilt mechanism</li> <li>Use larger ...
<p>I also had issues with the first layer sticking to the build plate and I did not want to sand the plate. As most people will mention you need to make sure that your plate is perfectly level and the z height is right (lots of friction on the paper). You also need the correct exposure times for your resin and the firs...
646
<p>When trying to enter a SQL query with parameters using the Oracle OLE DB provider I get the following error:</p> <blockquote> <p>Parameters cannot be extracted from the SQL command. The provider might not help to parse parameter information from the command. In that case, use the "SQL command from variable" acces...
<p>To expand on the link given in the question:</p> <ol> <li>Create a package variable</li> <li>Double click on the package variable name. (This allows you to access the properties of the variable)</li> <li>Set the property 'EvaluateAsExpression' to true</li> <li>Enter the query in the expression builder.</li> <li>Set...
<p>If You use Data Flow Task and use OLE DB Source, and you need parameterize your Query : </p> <ol> <li>Create Variable to save "Full" of Query statement : Right Click on blank area outside the package - and Click Variables : </li> </ol> <p><a href="https://i.stack.imgur.com/yLvNJ.jpg" rel="nofollow noreferrer"><img...
8,290
<p>Is it possible to send an email from my Java application using a GMail account? I have configured my company mail server with Java app to send email, but that's not going to cut it when I distribute the application. Answers with any of using Hotmail, Yahoo or GMail are acceptable.</p>
<p>First download the <a href="https://java.net/projects/javamail/pages/Home" rel="noreferrer">JavaMail API</a> and make sure the relevant jar files are in your classpath.</p> <p>Here's a full working example using GMail.</p> <pre><code>import java.util.*; import javax.mail.*; import javax.mail.internet.*; public cl...
<p>An easy route would be to have the gmail account configured/enabled for POP3 access. This would allow you to send out via normal SMTP through the gmail servers. </p> <p>Then you'd just send through smtp.gmail.com (on port 587)</p>
6,882
<p>I have created a custom dialog for Visual Studio Setup Project using the steps described <a href="http://www.codeproject.com/KB/install/vsSetupCustomDialogs.aspx?fid=419622&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=2640482&amp;fr=26" rel="nofollow noreferrer">here</a></p> <p>Now I...
<p>I've always found the custom dialogs in visual studio setup projects to be woefully limited and barely functional.</p> <p>By contrast, I normally create custom actions that display winforms gui's for any remotely difficult tasks during setup. Works really well and you can do just about anything you want by creatin...
<p>I guess you'll have to go beyond the out-of-the-box setup and deployment package and try a third party app.</p> <p>You may want to look at:</p> <ul> <li><a href="http://wix.sourceforge.net/" rel="nofollow noreferrer">Wix</a></li> <li><a href="http://nsis.sourceforge.net/Main_Page" rel="nofollow noreferrer">Nullsof...
3,256
<p>I'm building an automatic warehouse system using three NEMA 17 stepper motor. </p> <p>My problem is to move the motors with precision, since I do not have any kind of encoder on the motor and so I cannot know the position of the axes. I thought that the system could be similar to a 3D printer, since neither 3d prin...
<p>[For now] most of the open source 3d printer firmware written for Arduino-based hardware. This means you can just download the source and look through the relevant pieces of code.</p> <p><a href="https://github.com/MarlinFirmware/Marlin" rel="nofollow noreferrer">Marlin</a> is the most obvious example.</p>
<p>A stepper motor is different from a typical electric motor. Instead of being "on" or "off", or running a some approximate variable speed, the controller sends a series of pulses to drive the motor one step at a time. This can be driven forward or backwards.</p> <p>Based on how the motor and machine is designed, the...
540
<p>I'm a new Windows programmer and I'm not sure where I should store user configurable application settings. I understand the need to provide a user friendly means for the user to change application settings, like an Edit | Settings form or similar. But where should I store the values after the user hits the Apply b...
<p><strong>Pros of config file:</strong> </p> <ol> <li>Easy to do. Don't need to know any Windows API calls. You just need to know the file I/O interface of your programming language. </li> <li>Portable. If you port your application to another OS, you don't need to change your settings format. </li> <li>User-editab...
<p>There is one drawback to ini or config files and that is locating them if the user has the option to select where the program is installed.</p>
2,831
<p>I'd like to implement a way of recording the version of a project within code, so that it can be used when testing and to help track bugs. It seems the best version number to use would just be the current revision number from Subversion. Is there an easy way to hook this number into a (C++ in my case) header file o...
<p>Two ways:</p> <p>Embed <em>$Id$</em> or <em>$Revision$</em> within the code. Then set <em>svn:keywords="Id Revision"</em> property on the file. This will give you the last modified revision of that source file. Good for smaller projects and scripts.</p> <p>Alternatively, use a Makefile driven process and the comma...
<p>A good up-to-date solution:</p> <p>Create a <code>Makefile</code> containing the following line (in the same folder as <code>YourFile.dox</code>):</p> <pre><code>sed "s~RevNumber~$(shell svnversion ../)~g" YourFile.dox &gt; YourFileDummy.dox; doxygen YourFileDummy.dox </code></pre> <p>And <code>YourFile.dox</code...
3,697
<p>I just purchased an <a href="https://www.anycubic.com/products/anycubic-photon-3d-printer" rel="nofollow noreferrer">Anycubic Photon 3S</a> LCD-based SLA 3D printer. I understand the need for cleaning and curing parts after printing. While the device is in transit, I'm looking to set up a workstation to use it with....
<h1>Safety Gear</h1> <p>Gloves, you want to wear them whenever handling any resin. Single-use gloves are best - dispose of them after use. Consider them contaminated after touching anything in contact with resin and toss them before handling anything that shall not get in contact with resin. That includes door handles....
<p>I would recommend a tub for cleaning the print, some funnels to get leftover resin back into the bottel, gloves, since you really don't want to get any uncured resin on your skin and a strong UV light for finishing the curing process after the cleaning</p>
1,474
<p>I wrote a simple Windows Forms program in C#. I want to be able to input a windows user name and password and when I click a login button to run code run as the user I've entered as input.</p>
<p>You can use the WindowsIdentity.Impersonate method to achieve this. This method allows code to impersonate a different Windows user. Here is a link for more information on this method with a good sample:</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.security.principal.windowsidentity.impersonate....
<p>Impersonate will change the Thread context. If you want to change the identity and launch a separate process, you will have to use runas command.</p> <p>The .NET Developer's Guide to Windows Security by Keith Brown is an excellent read which describes all the security scenarios. <a href="http://alt.pluralsight.com/...
7,104
<p>I have an Ender 3 and I'm experiencing an issue where it won't print on the edges. Near the outside of the bed plastic just peels away. Bed is level - verified multiple times.</p> <p>The nozzle appears to be dragging the freshly extruded filament away before it has a chance to cool. Straight lines and wide curves pr...
<p>I used to have the same problem. Put masking or scotch tape on the bed, it should help with adhesion. I think the problem is that the bed is very dirty with finger grease and other things.</p>
<p>It sounds like it may be due to uneven heating. Check with an IR thermometer to make sure. If you're sure the bed is clean and has even heating, you may want to try a different surface. G10 is cheap and almost always perfectly flat.</p>
2,038
<p>How can I calculate the value of PI using C#?</p> <p>I was thinking it would be through a recursive function, if so, what would it look like and are there any math equations to back it up?</p> <p>I'm not too fussy about performance, mainly how to go about it from a learning point of view.</p>
<p>If you want recursion:</p> <pre><code>PI = 2 * (1 + 1/3 * (1 + 2/5 * (1 + 3/7 * (...)))) </code></pre> <p>This would become, after some rewriting:</p> <pre><code>PI = 2 * F(1); </code></pre> <p>with F(i):</p> <pre><code>double F (int i) { return 1 + i / (2.0 * i + 1) * F(i + 1); } </code></pre> <p>Isaac Ne...
<pre><code>public double PI = 22.0 / 7.0; </code></pre>
6,044
<p>This is a very specific question regarding <strong>MySQL</strong> as implemented in <strong>WordPress</strong>.</p> <p>I'm trying to develop a plugin that will show (select) posts that have specific '<strong>tags</strong>' and belong to specific '<strong>categories</strong>' (both multiple)</p> <p>I was told it's im...
<p>I misunderstood you. I thought you wanted Nuclear or Deals. The below should give you only Nuclear and Deals.</p> <pre><code>select p.* from wp_posts p, wp_terms t, wp_term_taxonomy tt, wp_term_relationship tr, wp_terms t2, wp_term_taxonomy tt2, wp_term_relationship tr2 wp_terms t2, wp_term_taxonomy tt2, wp_term_...
<p>Thanks @Eric it works! Just a few code corrections for future reference:</p> <ul> <li>the first select statements misses a coma after wp_term_relationship tr2</li> <li>In the same select statemt the following must be change:</li> </ul> <pre><code>wp_terms t2, wp_term_taxonomy tt2, wp_term_relationship tr2</code>...
4,783
<p>I work a lot with network and serial communications software, so it is often necessary for me to have code to display or log hex dumps of data packets.</p> <p>Every time I do this, I write yet another hex-dump routine from scratch. I'm about to do so again, but figured I'd ask here: Is there any good free hex dum...
<p>I often use this little snippet I've written long time ago. It's short and easy to add anywhere when debugging etc...</p> <pre><code>#include &lt;ctype.h&gt; #include &lt;stdio.h&gt; void hexdump(void *ptr, int buflen) { unsigned char *buf = (unsigned char*)ptr; int i, j; for (i=0; i&lt;buflen; i+=16) { ...
<p><a href="http://gd.tuwien.ac.at/linuxcommand.org/man_pages/xxd1.html" rel="nofollow noreferrer">xxd</a> is the 'standard' hex dump util and looks like it should solve your problems</p>
4,889
<p>I am using Windows, and I have two monitors.</p> <p>Some applications will <em>always</em> start on my primary monitor, no matter where they were when I closed them.</p> <p>Others will always start on the <em>secondary</em> monitor, no matter where they were when I closed them.</p> <p>Is there a registry setting ...
<p>Correctly written Windows apps that want to save their location from run to run will save the results of <a href="http://msdn.microsoft.com/ru-ru/library/windows/desktop/ms633518%28v=vs.85%29.aspx" rel="noreferrer"><code>GetWindowPlacement()</code></a> before shutting down, then use <code>SetWindowPlacement()</code>...
<p>Right click the shortcut and select properties. Make sure you are on the "Shortcut" Tab. Select the RUN drop down box and change it to Maximized. </p> <p>This may assist in launching the program in full screen on the primary monitor. </p>
7,606
<p>While I don't think this is easily possible I am wondering if it can be done. So my spool of filament had a tangle and got pulled into the printer head. Some got melted together and after cutting I have a few strands. Would it be possible to mend the ends together to make one continuous strand instead of many small ...
<p>Sure, but you need to be careful not to have wide or narrow spots. A fixture for this is probably better than freehand welding.</p> <p>See some ideas for a homemade fuser at <a href="https://rigid.ink/blogs/news/how-to-join-or-fuse-filament-together" rel="nofollow noreferrer">https://rigid.ink/blogs/news/how-to-joi...
<p>As @davo says in his answer, this can be done rather easily, but the main problem with this kind of approach is reliability of the joint: sure, it must last only a short time, but during that time it will have to survive bending through your bowden tube (if applicable) and withstanding the grinding of the hobbed gea...
825
<p>I've heard that <code>SELECT *</code> is generally bad practice to use when writing SQL commands because it is more efficient to <code>SELECT</code> columns you specifically need.</p> <p>If I need to <code>SELECT</code> every column in a table, should I use </p> <pre><code>SELECT * FROM TABLE </code></pre> <p>or ...
<p>One reason that selecting specific columns is better is that it raises the probability that SQL Server can access the data from indexes rather than querying the table data. </p> <p>Here's a post I wrote about it: <a href="http://weblogs.asp.net/jgalloway/archive/2007/07/18/the-real-reason-select-queries-are-bad-in...
<p>There can be a huge performance gain by limiting what columns are returned if the records are traversing the internet.</p>
9,125
<p>I've been using PHP for too long, but I'm new to JavaScript integration in some places. </p> <p>I'm trying to find the fastest way to pass database information into a page where it can be modified and displayed dynamically in JavaScript. </p> <p>Right now, I'm looking at loading a <em>JSON with PHP</em> echo state...
<p>Use the library. If you try to generate it manually, I predict with 99% certainty that the resulting text will be invalid in some way. Especially with more esoteric features like Unicode strings or exponential notation.</p>
<p>Library has worked great for me. FWIW I needed to do this on a project with earlier version of PHP lacking JSON support. Function below worked as a granted risky version of "json_encode" for arrays of strings.</p> <pre><code>function my_json_encode($row) { $json = "{"; $keys = array_keys($row); ...
6,184
<p>Using the Apple OS X Cocoa framework, how can I post a <em>sheet</em> (slide-down modal dialog) on the window of another process? </p> <p><strong>Edit:</strong> Clarified a bit:</p> <p>My application is a Finder extension to do Subversion version control (<a href="http://scplugin.tigris.org/" rel="nofollow norefer...
<p>Really, it sounds like you're trying to have your inter-process communication happen at the view level, which isn't really how Cocoa generally works. Things will be much easier if you separate your layers a bit more than that.</p> <p>Why don't you want to put the sheet code into the other process? It's view code, a...
<p>Please don't do this. Make the interaction nonmodal if at all possible. Especially in something like a commit, it's much nicer to be able to browse around your files while you're writing commit comments.</p> <p>OS X does have window groups, but I don't think they can (easily) span applications.</p>
9,108
<p>I have a structure in C#:</p> <pre><code>public struct UserInfo { public string str1 { get; set; } public string str2 { get; set; } } </code></pre> <p>The only rule is that <code>UserInfo(str1="AA", str2="BB").Equals(UserInfo(str1="BB", str2="AA"))</code></p> <p>How to o...
<p><a href="http://msdn.microsoft.com/en-us/library/system.object.gethashcode.aspx" rel="noreferrer">MSDN</a>:</p> <p>A hash function must have the following properties:</p> <blockquote> <ul> <li>If two objects compare as equal, the <code>GetHashCode</code> method for each object must return the same value. Howev...
<p>Too complicated, and forgets nulls, etc. This is used for things like bucketing, so you can get away with something like</p> <pre><code>if (null != str1) { return str1.GetHashCode(); } if (null != str2) { return str2.GetHashCode(); } //Not sure what you would put here, some constant value will do return 0;...
9,566
<p>I wondered if anyone uses virtualized desktop PCs (running WinXP Pro or older) to have some old applications that are seldom used available for some ongoing tasks.</p> <p>Say you have a really old project that every once in a while needs a document update in a database system or something like that. The database ap...
<p>I use virtualized desktops for:</p> <ul> <li>Support that requires VPN software I do not want on my own desktop. This also lets a whole team share the support computer for a specific customer. </li> <li>A legacy system which we use several different versions of (depending on customer's version) and they're not real...
<p>We use virtualisation to test on a variety of Operating Systems - the server application runs under linux, and we have a production (real) server, and a couple of test servers, which are all VMs.</p> <p>The client runs under Windows, which, being an OS X user I have to run in a VM, and the other developer I work wi...
4,000
<p>How do I find duplicate addresses in a database, or better stop people already when filling in the form ? I guess the earlier the better?</p> <p>Is there any good way of abstracting street, postal code etc so that typos and simple attempts to get 2 registrations can be detected? like: </p> <pre><code>Quellenstrass...
<p>The earlier you can stop people, the easier it'll be in the long run! </p> <p>Not being too familiar with your db schema or data entry form, I'd suggest a route something like the following:</p> <ul> <li><p>have distinct fields in your db for each address "part", e.g. street, city, postal code, Länder, etc.</p></l...
<p>In my opinion, assuming that you already had a lot of dirty data in your DB, </p> <p>You have to do build your "handmade" dirty filter which may detect a maximum of german abreviation ... </p> <p>But If you treat a lot of data, you will take the risk to find some false-positive and true-negative sample...</p> <p>...
5,831
<p>Say I have a linked list of numbers of length <code>N</code>. <code>N</code> is very large and I don’t know in advance the exact value of <code>N</code>. </p> <p>How can I most efficiently write a function that will return <code>k</code> completely <em>random numbers</em> from the list?</p>
<p>There's a very nice and efficient algorithm for this using a method called <strong>reservoir sampling</strong>.</p> <p>Let me start by giving you its <strong>history</strong>:</p> <p><strong>Knuth</strong> calls this Algorithm R on p. 144 of his 1997 edition of Seminumerical Algorithms (volume 2 of The Art of Comp...
<p>Well, you do need to know what N is at runtime at least, even if this involves doing an extra pass over the list to count them. The simplest algorithm to do this is to just pick a random number in N and remove that item, repeated k times. Or, if it is permissible to return repeat numbers, don't remove the item.</p> ...
7,767
<p>Being relatively new to the .net game, I was wondering, has anyone had any experience of the pros / cons between the use of LINQ and what could be considered more traditional methods working with lists / collections? </p> <p>For a specific example of a project I'm working on : a list of unique id / name pairs are ...
<p>i dont think the linq you wrote would compile, it'd have to be</p> <pre><code>public string branchName (string branchId) { //branchList populated in the constructor branch_summary bs = (from b in branchList where b.id == branchId select b).FirstOrDefault(); return branch_summary == null ? null : branch...
<p>I'm not sure a singleton class is absolutely necessary, do you absolutely need global access at all times? Is the list large? </p> <p>I assume you will have a refresh method on the singleton class for when the properties need to change and also that you have some way of notifying the singleton to update when the li...
7,085
<p>Another thing I'm seeing with my new build. Late in a small print, the unit appears to perform operations "out of order" occasionally. Here's a picture where it's running a layer across the model.<br> <a href="https://i.stack.imgur.com/hGIJk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hGIJk.j...
<p>This is just your slicer doing this. If you inspect the G-code file, you will see that the printer is faithfully doing what the slicer told it to. Most slicers use a fairly simple heuristic for determining the order in which lines are processed, which sometimes comes up with sub-optimal solutions like these.</p>
<p>I have seen this in Cura 2.5 when selecting different printers, then altering the specifications to suit. Changing the printer seems to change the slicing behavior. As yet there is no specific printer set up in Cura for the MEGA so you will probably have to find something that fits your needs, unless someone has the...
475
<p>I have the following code:</p> <pre><code>Dim obj As New Access.Application obj.OpenCurrentDatabase (CurrentProject.Path &amp; "\Working.mdb") obj.Run "Routine" obj.CloseCurrentDatabase Set obj = Nothing </code></pre> <p>The problem I'm experimenting is a pop-up that tells me Access can't set the focus on the othe...
<p>You could use <a href="http://msdn.microsoft.com/en-us/library/system.string.split.aspx" rel="noreferrer" title="String.Split method msdn reference">String.Split method</a>.</p> <pre><code>class ExampleClass { public ExampleClass() { string exampleString = "there is a cat"; // Split string o...
<p>If you are using C# 3.5 you could write an extension method to System.String that does the splitting you need. You then can then use syntax:</p> <pre><code>string.SplitByMyTokens(); </code></pre> <p>More info and a useful example from MS here <a href="http://msdn.microsoft.com/en-us/library/bb383977.aspx" rel="nof...
9,581
<p>I have a very frustrating problem, my extruder clogs up pretty much immediately after cleaning it from the previous clog and I cannot figure out what the hell is going wrong.</p> <p>I use a genuine E3D V6 in direct drive configuration (dual drive) and I print only PLA. I have tried many nozzle offsets from the bed ...
<p>I have had one roll of filament that did this. I'd get a jam, clean it out, and immediately jam again.</p> <p>I got the filament from a friend who had reported problems using it, but I thought, "I have a Prusa3D i3m3-mmu2, I can print with anything." Unfortunately, I could not.</p> <p>I threw away the filament (...
<p>It turned out that the stepper driver on my duet 2 wifi board is defective which resulted in the extruder motor being poorly controlled which in turn caused the clogs, using a different stepper driver fixed the issue.</p> <p>I am a bit bummed out that one of my drivers turned out to be defective since the board has...
1,658
<p>My development shop has put together a fairly useful Python-based test suite, and we'd like to test some Linux-based C++ code with it. We've gotten the test project they ship with Boost to compile (type 'bjam' in the directory and it works), but we're having issues with our actual project.</p> <p>Building the boost...
<p>"Google Maps Hacks" has a hack, <a href="http://safari.oreilly.com/0596101619/googlemapshks-CHP-4-SECT-3" rel="nofollow noreferrer">"Hack 30. Stay Out of Traffic Jams"</a>, on that.</p> <p>You can also find out how to get U.S. traffic info from John Resig's <a href="http://ejohn.org/blog/traffic-conditions-data/" r...
<p>Google is mum on what source they use for their traffic data. You might contact them directly to see if they want to implement something for you, but my guess is that they'd simply refer you to their provider if they really wanted your data.</p> <p>Keep in mind that traffic data is available for more than just the...
9,259
<p>What are the best settings for Ultimaker Cura to have support material that's easy to remove for my Anet A8. I have printed an object with two different spools of PLA (same manufacturer just different color). The black print was printed with 200&nbsp;°C, the grey one with 210&nbsp;°C both a flow of 100&nbsp;%. Thee ...
<p>Cura has some settings for the support structure which may help. Somewhere in the full Preferences menu is a setting for "gap at top" or equivalent wording. If you increase that gap slightly, the support material will be less strongly bonded to the part. Be careful, since a huge gap could lead to bridging proble...
<p>From the picture, I suggest printing with 200 °C, as the grey print lost its cohesion at a higher temperature.</p> <h2>Why higher = worse</h2> <p>A filament is a solid that turns into a highly viscous fluid under heating and the more you heat it, the less viscous it gets. However, it also has a very high surface t...
1,225
<p>I have the following Java 6 code:</p> <pre><code> Query q = em.createNativeQuery( "select T.* " + "from Trip T join Itinerary I on (T.itinerary_id=I.id) " + "where I.launchDate between :start and :end " + "or ADDDATE(I.launchDate, I.equipmentPullDayOfTrip) between :start and :end...
<p>The Hibernate annotations docs (<a href="http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/" rel="nofollow noreferrer">http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/</a>) suggest that this should be a class-level annotation rather than occurring inline within your code. ...
<p>Your example comes straight out of the API docs which are unfortunately poorly presented.</p> <p>Your annotation should be placed on some class, probably the one in which you will be creating the query to use the result set mapping. However, it actually doesn't matter where this annotation is placed. Your JPA provi...
9,205
<p>I’ve been trying to install Ms SQL Server 2005 for over two weeks now, and I’ve finally gotten to the point where the prerequisites all seem to be in place. Unfortunately, every time I try to install SQL Server itself, I get the following message:</p> <p>“The SQL Server service failed to start. For more information...
<p>I had similar problem while installing SQL Server 2005 on Windows 7 Professional and got error <code>SQL server failed to start</code>. I logged in as a Administrator (my user id is administrator) in windows.</p> <p>SOLUTION</p> <ol> <li><p>Go to services, from control panel -> Administrative Tools</p></li> <li><p...
<p>While that error message is on the screen (before the rollback begins) go to Control Panel -> Administrative Tools -> Services and see if the service is actually installed. Also check what account it is using to run as. If it's not using Local System, then double and triple check that the account it's using has ri...
8,853
<p>I seem to remember reading something about how it is bad for structs to implement interfaces in CLR via C#, but I can't seem to find anything about it. Is it bad? Are there unintended consequences of doing so?</p> <pre><code>public interface Foo { Bar GetBar(); } public struct Fubar : Foo { public Bar GetBar() { ...
<p>Since no one else explicitly provided this answer I will add the following:</p> <p><strong>Implementing</strong> an interface on a struct has no negative consequences whatsoever.</p> <p>Any <em>variable</em> of the interface type used to hold a struct will result in a boxed value of that struct being used. If the ...
<p>Structs are just like classes that live in the stack. I see no reason why they should be "unsafe".</p>
8,906
<p>This is a 3 part question regarding embedded RegEx into SQL statements. </p> <ol> <li><p>How do you embed a RegEx expression into an Oracle PL/SQL select statement that will parse out the “DELINQUENT” string in the text string shown below?</p></li> <li><p>What is the performance impact if used within a mission crit...
<p>Why would you need regular expressions here? INSTR and SUBSTR will do the job perfectly.</p> <p>But if you convinced you need Regex'es you can use:</p> <p><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions129.htm#i1239887" rel="nofollow noreferrer">REGEXP_INSTR</a><br> <a href="http:...
<p>Why not just use INSTR (for Oracle) or CHARINDEX (for SQL Server) combined with SUBSTRING? Seems a bit more straightforward (and portable, since it's supported in older versions).</p> <p><a href="http://www.techonthenet.com/oracle/functions/instr.php" rel="nofollow noreferrer">http://www.techonthenet.com/oracle/fun...
9,868
<p>Service Oriented Architecture seems to be more and more of a hot quote these days, but after asking around the office I have found that I seem to get many different definitions for it. How would you guys define SOA? What would you consider the official definition?</p>
<p>As Martin Fowler says, it means different things to different people. His article on the topic is pretty good although it isn't quite a definition.</p> <p><a href="http://martinfowler.com/bliki/ServiceOrientedAmbiguity.html" rel="noreferrer">http://martinfowler.com/bliki/ServiceOrientedAmbiguity.html</a></p> <p>It...
<p>I attempted to define SOA in <a href="http://vincentfazio.blogspot.com/2008/07/something-old-something-new.html" rel="nofollow noreferrer">one of my blog posts</a>. Here's an excerpt...</p> <blockquote> <p>For years it's been standard practice to separate functionality into functions, classes, and modules. The idea...
8,416
<p>I need to replace all WinAPI calls of the</p> <ul> <li>CreateFile, </li> <li>ReadFile, </li> <li>SetFilePointer,</li> <li>CloseHandle </li> </ul> <p>with my own implementation (which use low-level file reading via Bluetooth). The code, where functions will be replaced, is Video File Player and it already works wit...
<p>I suggest that you follow these steps:</p> <ol> <li>Write a set of wrapper functions, e.g MyCreateFile, MyReadFile, etc, that initially just call the corresponding API and pass the same arguments along, unmodified.</li> <li>Use your text editor to search for all calls to the original APIs, and replace these with ca...
<p>I don't think this is best practice but it should work if you put it in an include file that's included everywhere the function you want to change is called:</p> <pre><code>#define CreateFile MyCreateFile HRESULT MyCreateFile(whatever the params are); </code></pre> <p>Implementation of MyCreateFile looks somethin...
8,555
<p>What is a good free library for editing MP3s/FLACs. </p> <p>By editing I mean:</p> <ul> <li>Cutting audio file into multiple parts</li> <li>Joining multiple audio files together</li> <li>Increase playback speed of file without affecting the pitch (eg. podcasts up to 1.3x)</li> <li>Re-encoding audio file from Flac ...
<p>Just about every language has bindings to C, so you'll probably want to get the applicable C libraries for encoding/decoding mp3's and FLAC files. This list might include</p> <p>libFLAC <a href="http://flac.sourceforge.net/api/index.html" rel="nofollow noreferrer">http://flac.sourceforge.net/api/index.html</a> FLA...
<p>I use <a href="http://audacity.sourceforge.net/" rel="nofollow noreferrer">Audacity</a> for all my editing needs</p> <blockquote> <p>Audacity is a free, easy-to-use audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. You can use Audacity to:</p> <pre><code>* Record live ...
3,986
<p>I was writing some <strong>ASP.NET</strong> control when I came to the scenario where I needed to remove items from a list, only when they matched a certain condition.</p> <p>The <code>RemoveAll</code> method of the generic <code>List</code> class does a good job, but removes <em>all</em> items that match the condi...
<p>If you want to specify both a limit for number of items to remove and a condition to select the items to remove, you can use this approach:</p> <pre><code>int limit = 30; // Suppose you want to remove 30 items at most list.RemoveAll(item =&gt; ShouldIRemoveThis(item) &amp;&amp; limit-- &gt; 0); </code></pre>
<p>Can you use LINQ? If so, you can just use the .Take() method and specify how many records you want (maybe as total - N).</p>
3,719
<p>I recently asked a question about <a href="https://stackoverflow.com/questions/28377/iif-vs-if">IIf vs. If</a> and found out that there is another function in VB called <strong>If</strong> which basically does the same thing as <strong>IIf</strong> but is a short-circuit.</p> <p>Does this <strong>If</strong> functi...
<p>Damn, I really thought you were talking about the operator all along. ;-) Anyway …</p> <blockquote> <p>Does this If function perform better than the IIf function?</p> </blockquote> <p>Definitely. Remember, it's built into the language. Only one of the two conditional arguments has to be evaluated, potentially sa...
<p>One very important distinct between <code>IIf()</code> and <code>If()</code> is that with <code>Option Infer On</code> the later will implicitly cast the results to the same data type in certain cases, as where <code>IIf</code> will return <code>Object</code>. </p> <p>Example: </p> <pre><code> Dim val As Integ...
4,810
<p>As a lot of people pointed out in <a href="https://stackoverflow.com/questions/4724/learning-lisp-why">this question</a>, Lisp is mostly used as a learning experience. Nevertheless, it would be great if I could somehow use my Lisp algorithms and combine them with my C# programs. In college my profs never could tell...
<p>Try these .Net implementations of Lisp:</p> <ul> <li><a href="https://github.com/leppie/IronScheme" rel="nofollow noreferrer">IronScheme</a></li> </ul> <blockquote> <p>IronScheme will aim to be a R6RS conforming Scheme implementation based on the Microsoft DLR.</p> </blockquote> <ul> <li><a href="https://gi...
<p>If it's merely the routines you want to use you might try LSharp, which lets you have Lisp expressions in .NET:</p> <p><a href="http://www.lsharp.org/" rel="nofollow noreferrer">http://www.lsharp.org/</a></p> <p>The other way around (using .NET from Lisp) would be RDNZL:</p> <p><a href="http://www.weitz.de/rdnzl/...
9,543
<p>I´ve been using my Ender 3 Pro for almost 1 year now. Always using the provided SD card. For a couple of days, the printed does not read any new file that I load to the SD card, but it does with the older files (and it then prints correctly as well).</p> <p>I tried deleting some old files that I don't need, I tried ...
<p>I think I found the problem. I think there was some crosstalk between the BLTouch wires and the other wires it was tied together leading to the hotend. When I moved the BLTouch wires away from the others the problem went away.</p> <p>I will be added a sheild to the cable in the future like in this <a href="https://w...
<p>The OP already found the problem and <a href="/a/16632/">answered</a> the question hinting to shielding of the cable. If this is the actual problem, of fiddling with the cables might have caused this, an alternative solution is presented as I've experienced similar behavior.</p> <p>If one side of the bed is higher t...
1,969
<p>When I use Emacs I want to be able to easily display and navigate through a list of files I worked on from not just the current session but from previous sessions. (BTW, running Emacs 22.2 on Windows)</p>
<p>From <a href="http://www.joegrossberg.com/archives/000182.html" rel="noreferrer">Joe Grossberg</a>'s blog (no longer available):</p> <blockquote> <p>But if you're using GNU Emacs 21.2 (the latest version, which includes this as part of the standard distro), you can just put the following lines into your ....
<p>Even if you don't have recentf turned on, Emacs is saving a list of files entered via the minibuffer in the variable <code>file-name-history</code>. Also, executing <code>(savehist-mode 1)</code> in your <code>.emacs</code> file makes that variable persist across invocations of Emacs.</p> <p>So here's a little funct...
7,321
<p>I'm just learning how to use a 3D printer, I have an Anycubic Mega Zero 2.0.</p> <p>When I start printing the PLA filament doesn't want to adhere very well. I have leveled it out and all of my corners on my test print adhere well. However, when I go to print anything besides the test print I get basically a small be...
<p>If you look at the multiple lines of the skirt, you see that none of the printed lines are touching the other laid down lines. This is an indication for under extrusion or a too large of a gap between the nozzle and the bed (or both). Considering you are talking about a bead/drop/blob of hot filament not adhering to...
<p>If the print bed is contaminated with oil or fat, print bed adhesion may be too low. Cleaning with alcohol might help.</p>
2,001
<p>My first magnetic bed mat for my Ender 3 Pro is cracking underneath. On the top side there is a bubble in the middle which prevents any viable print. The layers are probably separating.</p> <p>I am new to printing but have read many articles on hiccups to expect, fixes etc. I do understand these magnetic mats can b...
<p>My personal technique for removing prints (particularly larger prints) is not to flex the mat at all. Instead, I wait until it's cool and then work the spatula under an edge and move it under the model to basically peel it from the mat.</p> <p>Smaller prints usually pop right off if I start with this technique from...
<p>My personal technique for removing prints (particularly larger prints) is not to flex the mat at all. Instead, I wait until it's cool and then work the spatula under an edge and move it under the model to basically peel it from the mat.</p> <p>Smaller prints usually pop right off if I start with this technique from...
1,534
<p>I'm not entirely sure if this is possible in Ruby, but hopefully there's an easy way to do this. I want to declare a variable and later find out the name of the variable. That is, for this simple snippet:</p> <pre><code>foo = ["goo", "baz"] </code></pre> <p>How can I get the name of the array (here, "foo") back? I...
<p>What if you turn your problem around? Instead of trying to get names from variables, get the variables from the names:</p> <pre><code>["foo", "goo", "bar"].each { |param_name| param = eval(param_name) if param.class != Array puts "#{param_name} wasn't an Array. It was a/an #{param.class}" return "Error:...
<p>You can't, you need to go back to the drawing board and re-engineer your solution.</p>
8,282
<p>I know that the actual printing time is longer than the time estimated by Cura, due to acceleration and jerk factor.</p> <p>However, I have printed a small pyramid for which Cura estimates 4.0 minutes, while the measured printing time is 2 minutes and 40 seconds. What reasons could produce this difference?</p> <p...
<p>If you properly define your own machine with a <code>delta_wasp.def.json</code> file you can fill in the acceleration and jerk settings of your printer, so that Cura will use the correct values for print time estimation.</p> <p>For example, take a look at <a href="https://github.com/Ultimaker/Cura/blob/master/resou...
<p>Estimating time for any CNC based machines are measured in this formula:</p> <p><em>The length of pulses that machine travels x The feedrate of the pulse itself</em></p> <p>It gives you the time for whole movements. If you're familiar with NC codes, information of any movement is listed in a single line, having it...
599
<p>I'm struggling to get my printer up and running for a few days now. The problem is as follows. I got a test model of a cube (40x40&nbsp;mm) and everytime I try to print it, the nozzle creates these 'lines' on the print which is caused by over extrusion I think? See image:</p> <p><a href="https://i.stack.imgur.com/W...
<p>Your images look as if your initial nozzle to heat bed offset is too large. This causes the filament not to be squished. Try re-levelling and have a piece of plain printing paper have a little drag when pulled.</p>
<p>I think You need to re-calibrate Z steps. Sometimes Marlin default z-steps/mm won't fit for 3D printer, because it depends on the hardware(z-axis threaded rod) that used to build the 3D printer. Check whether the Z-axis moves the distance that you command it to move. (ex: command to move x distance and check whether...
1,326
<p>Some 3&nbsp;mm filaments seem to actually be 3&nbsp;mm - is there any way to shave off the excess and use it as 2.85&nbsp;mm? </p>
<p>I would not recommend you to try and somehow re-size the filament, since even the smallest of irregularities and error in diameter occurring from such a process would ruin your prints with sporadic over and under extrusion. Rather, if you have the tools available, you could grind the filament into pellets, and use a...
<p>you could put a 3 mm extruder on you're printer. or (if you're r brave) put route filament in the oven for 10 minutes and unroll it than stretch it out. if you do this outside you can attach one ent to a stride licht or something an pul on the other end, if it is hot anoth it should hold its new position. but don't ...
263
<p>As someone with some winforms and client applications experience - is it worth going back and learning the way traditional ASP .NET pages work, or is it okay with moving straight into ASP .NET MVC?</p> <p>I'm kind of looking for pitfalls or traps in my knowledge of general C#, that I won't know from the screencast ...
<p>Here is the great thing about MVC. It works closer to the base of the framework than normal ASP.NET Web Forms. So by using MVC and understanding it, you will have a better understanding of how WebForms work. The problem with WebForms is there is a lot of magic and about 6 years of trying to make the Web work like Wi...
<p>IMO, there are more pitfalls in normal web forms scenarios than with just MVC. Viewstate and databinding can be tricky at times.</p> <p>But for MVC, it's just plain simple form post/render things old-school way. Not that it is bad, it is just different, and cleaner too.</p>
6,309
<p>I'm wanting extra security for a particular point in my web app. So I want to lock the database (SQL Server 2005). Any suggestions or is this even necessary with SQL Server?</p> <p><strong>Edit on question:</strong></p> <p>The query is failing silently with no errors messages logged, and does not occur inside of a...
<p>I suppose you have three options.</p> <ol> <li><p>Set user permissions so that user x can only read from the database.</p></li> <li><p>Set the database into single user mode so only one connection can access it</p> <p>sp_dboption 'myDataBaseName', single, true</p></li> <li><p>Set the database to readonly</p> <p>s...
<p>I never was able to solve the problem, however what I wound up doing was switching to MySQL and using a transactional level query here. This was not the main or even a primary reason to switch. I had been having problems with MSSQL and it allowed me to have our CMS and various other tools all running on the same dat...
2,701
<p>Is there a way to unfilter an NSPasteboard for what the source application specifically declared it would provide?</p> <p>I'm attempting to serialize pasteboard data in my application. When another application places an RTF file on a pasteboard and then I ask for the available types, I get eleven different flavors...
<p><code>-[NSPasteboard types]</code> will return all the available types for the data on the clipboard, but it should return them <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPasteboard_Class/Reference/Reference.html#//apple_ref/occ/instm/NSPasteboard/types" rel="nofollow ...
<p>You may be able to get some use out of <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPasteboard_Class/Reference/Reference.html#//apple_ref/occ/clm/NSPasteboard/typesFilterableTo:" rel="nofollow noreferrer"><code>+[NSPasteboard typesFilterableTo:]</code></a>. I'm picturing...
7,837
<p>I have a .NET web app that uses CR 2008 for reports. The server it's deployed on is saddled with McAfee, and we want to tell CR to use a temp directory other than the Windows temp dir.</p> <p>Google found me the following registry key:</p> <p>SOFTWARE\Business Objects\Suite 12.0\Report Application Server\InprocSe...
<p>The other temp directory than C:/windows/temp should be located in your web site's virtual directory. Just add that temp folder in your web site's directory and when you make its virtual path to host it on IIS , it automatically gets included. If you want to make it at some other place like at D:/CrystalTEmp, you ne...
<p>“Operation not yet implemented” change "Font" type from - right click on text area. - format setting. - change font </p>
8,107
<p>The question sort of says it all.</p> <p>Whether it's for code testing purposes, or you're modeling a real-world process, or you're trying to impress a loved one, what are some algorithms that folks use to generate interesting time series data? Are there any good resources out there with a consolidated list? No con...
<p>I believe the following will work:</p> <pre><code>Dim b As CommandButton Set b = ocx.GetButton("btnPrint") b = True </code></pre> <p><code>CommandButton</code>s actually have two functions. One is the usual click button and the other is a toggle button that acts similar to a <code>CheckBox</code>. The default prop...
<p>Do you have access to the OCX code? You shouldn't really be directly invoking the click of a button. You should refactor the code so that the OCX button click code calls a function, e.g.</p> <pre><code>CMyWindow::OnLButtonDown() { this-&gt;FooBar(); } </code></pre> <p>Then from your VB6 app, directly call the Fo...
6,238
<p>I'm creating a <a href="http://msdn.microsoft.com/en-us/library/bb760250&#40;VS.85&#41;.aspx" rel="noreferrer">ToolTip</a> window and adding tools to it using the flags TTF_IDISHWND | TTF_SUBCLASS. (c++, win32)</p> <p>I have a manifest file such that my program uses the new WindowsXP themes (comctrl32 version 6).</...
<p>You're not the only one who has hit compatablity issues with tooltips between these DLLS. </p> <p>I too have had <strong>nothing but trouble</strong> with the new tooltips in the themable common controls. We have already been monkeying with mouse messages and active/deactivating the tips before adding the manifest ...
<p>I don't know, but this sounds like a really "hard" problem (in the sense that all real-world) problems are really hard. I bet the underlying problem is something to do with the setting of the focus. Windows that manually do that are evil and generally suffer from all manner of bugs.</p>
7,408
<p>According to <a href="http://groups.google.com/group/v8-users/browse_thread/thread/3f57f8d1c31806a5" rel="nofollow noreferrer">this discussion</a>, the iphone agreement says that it doesn't allow "loading of plugins or running interpreted code that has been downloaded".</p> <p>Technically, I <strong>would</strong> ...
<p>I think your interpretation is correct - You would not be allowed to download and execute JavaScript code in v8.</p> <p>If there were some way to run the code in an interpreter already on the iPhone (i.e. the javascript engine in MobileSafari) then that would be permitted I think.</p>
<p>Well I embedded Lua into my application already and am programming most of the login in Lua and then downloading it to my iPhone for fast iteration, but this is only intended during development. Once I ship the scripts will be placed in the source and compiled into byte-code shipped along with the app just like any ...
7,075
<p>I have an application that reads a CSV file with piles of data rows. I give the user a summary of the number of rows based on types of data, but I want to make sure that I don't read in too many rows of data and cause <code>OutOfMemoryError</code>s. Each row translates into an object. Is there an easy way to find...
<p>You can use the <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/instrument/Instrumentation.html" rel="noreferrer"><code>java.lang.instrument</code> package</a>.</p> <p>Compile and put this class in a JAR:</p> <pre><code>import java.lang.instrument.Instrumentation; public class ObjectSizeFetcher { pr...
<p>I doubt you want to do it programmatically unless you just want to do it once and store it for future use. It's a costly thing to do. There's no sizeof() operator in Java, and even if there was, it would only count the cost of the references to other objects and the size of the primitives.</p> <p>One way you coul...
7,560
<p>I have .stl for the 3d printing. And I want to analysis wall thickness of this model before printing. I have no idea about any tools. Can I create any console or wpf app for calculating wall thickness and cost of the printing. Please help me. </p>
<p>If your talking about a hollow object, such as a cube with a hollow center. The wall thickness is determined by the model.</p> <p>If your talking about a solid object, the wall thickness is determined by your nozzle diameter multiplied by your # of walls. This is all adjusted by your splicing software. If you have ...
<p>If your concern is that the stl file may have walls that are too thin to print on your printer, <a href="https://www.meshmixer.com/" rel="nofollow noreferrer">MeshMixer</a> is a great tool from <a href="https://www.autodesk.com" rel="nofollow noreferrer">Autodesk</a> to help check and fix mesh issues (including wall...
730
<p>For my C# app, I don't want to always prompt for elevation on application start, but if they choose an output path that is UAC protected then I need to request elevation.</p> <p>So, how do I check if a path is UAC protected and then how do I request elevation mid-execution?</p>
<p>The best way to detect if they are unable to perform an action is to attempt it and catch the <code>UnauthorizedAccessException</code>.</p> <p>However as @<a href="https://stackoverflow.com/users/941/dannysmurf">DannySmurf</a> <a href="https://stackoverflow.com/questions/17533/request-vista-uac-elevation-if-path-is...
<p>If your secondary drive has it's own file permissions, like say you have an other copy of windows installed on it. It will prompt.</p> <p>It will also prompt if files are in use, which sometimes occurs if you have windows explorer open to the same directory and the file selected with a file previewer displaying the...
3,816
<p>I am looking for a robust way to copy files over a Windows network share that is tolerant of intermittent connectivity. The application is often used on wireless, mobile workstations in large hospitals, and I'm assuming connectivity can be lost either momentarily or for several minutes at a time. The files involved ...
<p>I've used <a href="http://en.wikipedia.org/wiki/Robocopy" rel="noreferrer">Robocopy</a> for this with excellent results. By default, it will retry every 30 seconds until the file gets across.</p>
<p>SMS if it's available works.</p>
3,878
<p>I work in a biological laboratory where we have been using the FABtotum personal fabricator for several months now. The machine is good, however not flawless, and has set us back from doing experiments.</p> <p>I have overcome many common 3D printing issues, which I find necessary to do when becoming proficient in t...
<p>I have only tried 2 different printers. I started with an Up plus printer and it was good to get started. After a few years you really want more control. I did a lot of research and ended up buying the Extrabot. It is based on the ultimaker however the guy that puts them together upgrades the motors and a few other ...
<p>I have only tried 2 different printers. I started with an Up plus printer and it was good to get started. After a few years you really want more control. I did a lot of research and ended up buying the Extrabot. It is based on the ultimaker however the guy that puts them together upgrades the motors and a few other ...
596
<p>What is the "purist" or "correct" way to access an object's properties from within an object method that is not a getter/setter method?</p> <p>I know that from outside of the object you should use a getter/setter, but from within would you just do:</p> <p>Java:</p> <pre><code>String property = this.property; </co...
<p>This has religious war potential, but it seems to me that if you're using a getter/setter, you should use it internally as well - using both will lead to maintenance problems down the road (e.g. somebody adds code to a setter that <em>needs</em> to run every time that property is set, and the property is being set i...
<p>Well, it seems with C# 3.0 properties' default implementation, the decision is taken for you; you HAVE to set the property using the (possibly private) property setter.</p> <p>I personally only use the private member-behind when not doing so would cause the object to fall in an less than desirable state, such as wh...
2,258
<p>Using an FDM printer and PLA or ABS, without adding support material. What modifications can I make to improve how steep an overhang my printer can print before it starts having problems?</p> <p>The obvious first answer is to add a cooling fan, increasing the airflow over the freshly-extruded material ensuring it s...
<p>The two most important things you can do are:</p> <ul> <li>Provide adequate cooling to solidify the plastic quickly</li> <li>Minimize layer height</li> </ul> <p>Cooling is really obvious. You need the plastic to solidify before it has a chance to sag. PLA in particular has to shed a lot of heat before it is fully ...
<p>There's an answer <a href="https://3dprinting.stackexchange.com/questions/519/how-to-improve-face-that-are-printed-on-support?answertab=oldest#tab-top">here</a> that holds some of the same concepts. Regarding your questions: </p> <ul> <li><strong>Does lowering the temperature help? Raising it?</strong> : Yes, lower...
209
<p>Has anybody out there used the <a href="http://www.swig.org/exec.html" rel="noreferrer">SWIG</a> library with C#? If you have, what pitfalls did you find and what is the best way to use the library? I am thinking about using it as a wrapper for a program that was written in C and I want to wrap the header files wh...
<p>I think the mistake the earlier posters did was read the docs and not look at the examples. </p> <p>A few hours ago I needed to interface some C++ classes to C#. I looked in my Swig dir (I already had it for other work), found the directory <code>Examples/csharp/class</code>, browsed the code, loaded the solution, ...
<p>I did attempt to use SWIG to wrap a project C++ for using in .NET a few years ago.</p> <p>I didn't get very far as it was a massive giant pain to produce the configuration that SWIG required. At the time I just wanted a solution, not to learn another language/api/etc. SWIG may be easier to use these days, I couldn'...
4,491