instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>I recently installed a SKR 1.3 Board with a 3DTouch-Probe on my Creality Ender 3 Pro.
The probe works, <code>G29</code> does its magic, but:</p>
<p>If i issue a plain <code>G28</code>, the hotend first homes X and Y like before the Z-probe.
The probe is now next to, not above, the bed.
As the next step, the print... | <p>You need to enable the constant <code>Z_SAFE_HOMING</code> (like: <code>#define Z_SAFE_HOMING</code>) in your <a href="https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/Configuration.h" rel="nofollow noreferrer">printer configuration file</a> (if you're using Marlin firmware that is). This will move the noz... | <p>Use <code>Z Safe Homing</code> to avoid homing with a Z probe outside the bed area</p>
<p>According to Marlin firmware with this feature enabled:</p>
<ul>
<li>Allow Z homing only after X and Y homing AND stepper drivers still
enabled.</li>
<li>If stepper drivers time out, it will need X and Y homing again before Z... | 1,479 |
<p>I'm looking for a clear, concise and accurate answer. </p>
<p>Ideally as the actual answer, although links to good explanations welcome.</p>
| <p>Boxed values are <a href="http://en.wikipedia.org/wiki/Data_structure" rel="noreferrer">data structures</a> that are minimal wrappers around <a href="http://en.wikipedia.org/wiki/Primitive_type" rel="noreferrer">primitive types</a>*. Boxed values are typically stored as pointers to objects on <a href="http://en.wik... | <p>Like anything else, autoboxing can be problematic if not used carefully. The classic is to end up with a NullPointerException and not be able to track it down. Even with a debugger. Try this:</p>
<pre><code>public class TestAutoboxNPE
{
public static void main(String[] args)
{
Integer i = null;
... | 3,409 |
<p>I have a repeatable business process that I execute every week as part of my configuration management responsibilities. The process does not change: I download change details into Excel, open the spreadsheet and copy out details based on a macro, create a Word document from an agenda template, update the agenda with... | <p>Depending on the nature of your data and the parties that upload the excel files, you might want to consider having them save the data in .csv format. It will be much easier to parse on your end.</p>
<p>Assuming that isn't an option a quick google search turned up <a href="http://sourceforge.net/projects/phpexcelr... | <p>The open-source ETL tool Talend (<a href="http://wwww.talend.com" rel="nofollow noreferrer">http://wwww.talend.com</a>) will generate Java or Perl code and package such code with the necessary 3rd party libraries. </p>
<p>Talend should be able to handle all versions of Excel and output the result set in any format ... | 9,827 |
<p>We're currently using Lucene 2.1.0 for our site search and we've hit a difficult problem: one of our index fields is being ignored during a targeted search. Here is the code for adding the field to a document in our index:</p>
<pre><code>// Add market_local to index
contactDocument.add(
new Field(
"mark... | <p>For debugging Lucene, the best tool to use is <a href="http://www.getopt.org/luke/" rel="noreferrer">Luke</a>, which lets you poke around in the index itself to see what got indexed, carry out searches, etc. I recommend downloading it, pointing it at your index, and seeing what's in there.</p>
| <p>Another simple thing to do would be to use a debugger or logging statement to check the value of </p>
<blockquote>
<p>StringUtils.objectToString(currClip.get("market_local"))</p>
</blockquote>
<p>to make sure it is what you think it is.</p>
| 6,412 |
<p>I'm looking for a 3D printer for applications in the dental field, for printing digital dental models (not for itra-oral use parts).</p>
<p>Resolution and finish are the main requirements that we consider necessary.</p>
<p>Any suggestion?</p>
| <p>If resolution is your upmost concern then resin 3d printers are the way to go. They use a liquid resin that does not harden until a UV laser is shined through them. Apparently they get ultra high resolution and smooth finishes right out of the box. The downside is they are generally more expensive machines and the r... | <p>As mentionned by Andrew, resins should do the trick : most commons processes are SLA and DLP (DLP is faster but more expensive).</p>
<ul>
<li>If you aren't looking for precisions (or looking for low budget), FDM
machines should do the trick. </li>
<li>If you need metal, I think Solidscape or micro SLM should both w... | 372 |
<p>I'm currently printing 11 copies of the same model. I noticed as it's printing that it seems to work on one model at a time but doesn't travel to the nearest model next. I suspect it's traveling around the bed in the order that I put the models in the slicer. This is resulting in extra unnecessary travel and ther... | <p>It's well known in mathematical circles that the "salesman problem" is what mathematicians call "hard" -- in their usage, that means a lot of extremely smart people have worked on the problem for many years (more than a century?) and still not found a robust, works-every-time solution.</p>
<p>Wha... | <p><strong>Long story short:</strong> I only know the setting "Combing Mode OFF" that improves the travel paths. In my case it did not help. In your case I suggest you should give PrusaSlicer a try. I assume that the overall print duration will be improved because of a better calculation of the travel paths. ... | 1,991 |
<p>What is the best way to create redundant subversion repositories?</p>
<p>I have a subversion repository (linked through apache2 and WebDAV) and would like to create a mirror repository on a different server in the event of outages, but I am not certain of the best way to proceed.</p>
<p>I am thinking that post-com... | <p>Sounds like what you are looking for is basically federated (synced) servers...
I asked the same question recently...and while I didn't find the exact solution I was looking for it came close.
<a href="https://stackoverflow.com/questions/1790/federated-synced-subversion-servers">See here:</a></p>
| <p>If you only need read-only access to the mirrored repository, you can use <a href="https://svn.apache.org/repos/asf/subversion/trunk/notes/svnsync.txt" rel="nofollow noreferrer">svnsync</a> which was added in SVN 1.4 for mirroring.</p>
<p>We use a secondary repository on our build server to run CruiseControl.NET ag... | 2,975 |
<p>When considering enclosures able to reach higher chamber temperatures, insulation is essential to keep the heater power low.</p>
<p>Typical insulation materials are not transparent: cork (fire retardant, good for the inner hot side), rock wool, styrofoam panels, aluminium insulating panels (aluminium walls with foam... | <p>Unfortunately there are very little solutions for fully transparent and thermally insulating materials. You may be able to use panels commonly used for greenhouses and hydroponics if you can accept losing full transparency and only being translucent. Another option may be to have <strong>two layers of your transpare... | <p>How about using thermally insulating transparent silicone rubber sheets?</p>
| 1,982 |
<p>Html Textarea elements only wrap when they reach a space or tab character. This is fine, until the user types a looooooooooooooooooooooong enough word. I'm looking for a way to strictly enforce line breaks (eg.: even if it results in "loooooooooooo \n ooooooooooong").</p>
<p><img src="https://i.stack.imgur.com/sUmH... | <p>The CSS settings <code>word-wrap:break-word</code> and <code>text-wrap:unrestricted</code> appear to be CSS 3 features. Good luck finding a way to do this on current implementations.</p>
| <p>I tested the <strong><wbr></strong>, <strong>&#8203;</strong> and <strong>&shy;</strong> techniques. All three worked well in IE 7, Firefox 3 and Chrome. </p>
<p>The only one that did not break the copy/paste was the <strong><wbr></strong> tag.</p>
| 7,007 |
<p>Everyone I work with is obsessed with the data-centric approach to enterprise development and hates the idea of using custom collections/objects. What is the best way to convince them otherwise?</p>
| <p>Do it by example and tread lightly. Anything stronger will just alienate you from the rest of the team.</p>
<p>Remember to consider the possibility that they're onto something you've missed. Being part of a team means taking turns learning & teaching.</p>
<p>No single person has all the answers.</p>
| <p>There is already some very good advice here but you'll still have a job to convince your colleagues if all you have to back you up is a few supportive comments on stackoverflow.
And, if they are as sceptical as they sound, you are going to need more ammo.
First, get a copy of Martin Fowler's "Patterns of Enterprise ... | 5,804 |
<p>My application uses 2.0. At some point in the future I may want to start using newer features added in later framework versions. Should I wait until then? Or are there advantages to updating to the latest .NET 3.5 now?</p>
<p>I suppose by the time I am ready for next spring's release 4.0 will be out. Perhaps I ... | <p>In my opinion, you should ship with what your app needs. Otherwise you are making your install longer for no reason and as you noted using your customer's HD space again essentially for no reason.</p>
| <p>I appreciate the new language features in .NET 3.5 but until you're making use of them I would avoid upgrading to the latest runtime as it is a larger file / install that your users may have to deal with.</p>
| 8,143 |
<p>What Direct3D render states should be used to implement Java's Porter-Duff compositing rules (CLEAR, SRC, SRCOVER, etc.)?</p>
| <p>I'm haven't used Java too much, but based on the <a href="http://keithp.com/~keithp/porterduff/p253-porter.pdf" rel="nofollow noreferrer">white paper from 1984</a>, it should be a fairly straightforward mapping of render state blend modes.</p>
<p>There are of course more that you can do than just these, like normal... | <p>When I implement the render states for "A" (that is paint the source pixel color/alpha and ignore the destination pixel color/alpha), Direct3D doesn't seem to perform the operation correctly if the source has an alpha value of zero. Instead of filling the target area with transparency, I'm seeing the target area re... | 8,816 |
<p>I'm creating a reverse Bowden setup to guide my filament from spool to extruder, through a path which contains two <a href="http://amzn.eu/almYaNi" rel="nofollow noreferrer">couplers</a> in the middle as follows:</p>
<p><code>[spool] --- |#= --- =#| --- [extruder]</code></p>
<p>So I have to connect a tube to the <... | <p>The solution might be to countersink the opening at the threaded portion within the tube. There are various angles available for countersinks, although the more common angles are 82 degrees and 90 degrees.</p>
<p>Drive the countersink to the point where the wall thickness is zero, unlike the drawing below showing s... | <p>An alternative to chamfering the connector is buying a different type of connectors with a larger bore hole all the way through the connector and let the tube pass all the way through. These are used in my similar spool to extruder setup (reversed Bowden setup in OP's terminology).</p>
<p><a href="https://i.stack.i... | 490 |
<p>I have an SLA printed part I want to put a brass threaded insert in using a soldering iron. The insert is slightly larger than the hole so I would assume the edge will melt and re-freeze around the teeth. Are there any issues with melting SLA or this idea in general? </p>
| <p>The plastic used in SLA printing is what is known as a <em>thermoset</em> plastic, as opposed to the <em>thermoplastic</em> plastics used in FDM printing. What this means, is that it <em>can not be melted</em>. The reaction that hardens SLA materials is irreversible. If you heat up the plastic it won't melt, it will... | <p>Is it possible to make the hole larger, put the brass insert with a pre-installed screw inside the hole, fill the area with resin and cure with UV lamp?</p>
| 1,066 |
<p>I have to POST some parameters to a URL outside my network, and the developers on the other side asked me to not use HTTP Parameters: instead I have to post my key-values in <strong>HTTP Headers</strong>.</p>
<p>The fact is that I don't really understand what they mean: I tried to use a ajax-like post, with XmlHttp... | <p>Like @lassevk said, a redirect won't work.</p>
<p>You should use the WebRequest class to do an HTTP POST from your page or application. There's an example <a href="http://msdn.microsoft.com/en-us/library/debx8sh9.aspx" rel="nofollow noreferrer">here</a>.</p>
| <p>You should post more information.</p>
<p>For instance, is this C#? It looks like it, but I might be wrong.</p>
<p>Also, you say you get an exception, what is the exception type and message?</p>
<p>In any case, you can't redirect to a page for POST, you need to submit it from the browser, not from the server redir... | 6,167 |
<p>Heads up: I'm not good with electronics and only have a vague idea of it's inner workings.</p>
<p>I have a <a href="https://ru.aliexpress.com/item/3D-Printer-V6-Wade-Short-distance-J-head-Hotend-12V-for-1-75mm-3-0mm-Extruder/32810022530.html?spm=a2g0v.10010108.1000016.1.197a7c35uzmRpw&isOrigTitle=true" rel="nor... | <p>Electrical engineering can be quite complex, but in this case you can save yourself with same simple equations/relations. Using the following formulae:</p>
<ul>
<li><strong><em>Voltage (<span class="math-container">$\ U$</span>) equals current (<span class="math-container">$I$</span>) multiplied by the electrical r... | <p>It will take longer to heat up. However if you use a <a href="https://rads.stackoverflow.com/amzn/click/com/B06XWSV89D" rel="nofollow noreferrer" rel="nofollow noreferrer">boost converter</a> (like I did on my Anet A8 when I upgraded to a <a href="https://www.hot-end.com/" rel="nofollow noreferrer">Maxiwatt</a> 24&n... | 1,207 |
<p>I have a table which is full of arbitrarily formatted phone numbers, like this</p>
<pre><code>027 123 5644
021 393-5593
(07) 123 456
042123456
</code></pre>
<p>I need to search for a phone number in a similarly arbitrary format ( e.g. <code>07123456</code> should find the entry <code>(07) 123 456</code></p>
<p>The w... | <p>This looks like a problem from the start. Any kind of searching you do will require a table scan and we all know that's bad.</p>
<p>How about adding a column with a hash of the current phone numbers after stripping out all formatting characters. Then you can at least index the hash values and avoid a full blown t... | <blockquote>
<p>MySQL can search based on regular expressions.</p>
</blockquote>
<p>Sure, but given the arbitrary formatting, if my haystack contained <code>"(027) 123 456"</code> (bear in mind position of spaces can change, it could just as easily be <code>027 12 3456</code> and I wanted to match it with <code>0271... | 6,215 |
<p>I was looking out for a free plugin for developing/debugging JSP pages in eclipse.<br>
Any suggestions? </p>
| <p>The <a href="http://wiki.eclipse.org/Category:Eclipse_Web_Tools_Platform_Project" rel="noreferrer">Eclipse Web Tools Platform Project</a> includes a JSP debugger. I have only ever needed to use it with Tomcat so I cannot say how well it works with other servlet containers.</p>
| <p>The former BEA Workshop is now <a href="http://www.oracle.com/technology/software/products/ias/bea_main.html#devtools" rel="nofollow noreferrer">Oracle Workshop</a>. It is the best JSP editor with WYSIWYG support and it is free. It is not specific to WebLogic. Basic JSP editing is server neutral anyway. However, it ... | 7,064 |
<p>PHP has a great function called <a href="http://us2.php.net/manual/en/function.htmlspecialchars.php" rel="noreferrer">htmlspecialcharacters()</a> where you pass it a string and it replaces all of HTML's special characters with their safe equivalents, it's <em>almost</em> a one stop shop for sanitizing input. Very ni... | <p>Try this.</p>
<pre><code>var encodedHtml = HttpContext.Current.Server.HtmlEncode(...);
</code></pre>
| <p>In an addition to the given answers:
When using <a href="http://en.wikipedia.org/wiki/ASP.NET_Razor_view_engine" rel="nofollow">Razor view engine</a> (which is the default view engine in ASP.NET), using the '@' character to display values will automatically encode the displayed value. This means that you don't have ... | 3,747 |
<p>How do I set a property of a user control in <code>ListView</code>'s <code>LayoutTemplate</code> from the code-behind?</p>
<pre><code><asp:ListView ...>
<LayoutTemplate>
<myprefix:MyControl id="myControl" ... />
</LayoutTemplate>
...
</asp:ListView>
</code></pre>
<p>I want to do this:... | <p>To set a property of a control that is inside the LayoutTemplate, simply use the FindControl method on the ListView control.</p>
<pre><code>var control = (MyControl)myListView.FindControl("myControlId");
</code></pre>
| <p>The layout gets created, and fires a LayoutCreated event that says the layout has been created in the system.</p>
<p>Then, you can use listview.FindControl to get a reference to that control.</p>
| 7,109 |
<p>In order to merge independant HTML changes, I'm looking for recomendations for a 3-way comparison / merge library for HTML. The common 3-way text merge algorithms perform poorly because they do not understand the tree like structure of HTML and XML. Of course, such a library must understand the looser syntax of HT... | <p>You could also just go cheep: Run the files through <a href="http://tidy.sourceforge.net/" rel="nofollow noreferrer">tidy</a> and then compare. This will result in similar structures, where new / deleted children will show up with traditional diff tools. It breaks down on removal / addition of surrounding nodes - go... | <p>A simple google search offered up: <a href="http://www.codeproject.com/KB/cs/differ.aspx" rel="nofollow noreferrer">Differ</a>. I've never used it so I can't vouch for the quality of that :-)</p>
| 9,120 |
<p>I recently upgraded my Creality Ender 5 with an SKR Mini E3 V2.0 running Marlin 2.0.7.2. The printer has also been modified with an all-metal hotend and a direct drive conversion kit that uses the extruder stepper motor. In test prints of the XYZ calibration cube, I have found that the edges of the cube are round... | <p>Contrary to what's implied by its name, <em>junction deviation</em> does not produce rounded corners. It merely allows violations of the acceleration profile at corners that would be allowed <em>if the corner were rounded</em> by the deviation. So you should not expect changes to it to create or eliminate unwanted &... | <p>When a junction deviation is set too low it will mess up every other thing you have been trying to do to perfect your extrusion.</p>
<p>It messes up</p>
<ul>
<li>retraction,</li>
<li>linear advance,</li>
<li>s-curve,</li>
<li>the entire print.</li>
</ul>
<p>I had been messing around with my jerk and acceleration val... | 1,805 |
<p>I want to be able to get an estimate of how much code & static data is used by my C++ program?</p>
<p>Is there a way to find this out by looking at the executable or object files? Or perhaps something I can do at runtime?</p>
<p>Will otool help?</p>
| <ul>
<li>"size" is the traditional tool and works on all unix flavors. </li>
<li>"otool" has a bit finer grain control and has a lot of options.</li>
</ul>
<p>.</p>
<pre><code>$ size python
__TEXT __DATA __OBJC others dec hex
860160 159744 0 2453504 3473408 350000
</code></pre>
| <p>I think otool can help. Specifically, "otool -s {segment} {section}" should print out the details. I'm not sure if you can get information about __DATA or __TEXT without specifying a section. Maybe those sizes are reported in the mach header: "otool -h"?</p>
<pre><code>otool -s __DATA __data MyApp.bundle/Contents/... | 5,599 |
<p>Is it possible to 3D print a QR code? or to engrave it using a 3D printer? I tried to convert it to individual boxes but that takes too long and is very inaccurate. Is there a better way?</p>
| <p>From the excellent Thingiverse link, <a href="https://www.thingiverse.com/thing:4967931" rel="nofollow noreferrer">Customizable QR Keyring or Tag</a> by <a href="https://www.thingiverse.com/outwardb/designs" rel="nofollow noreferrer"><em>OutwardB</em></a> - which was provided in the (now deleted) <a href="https://3d... | <p>From the excellent Thingiverse link, <a href="https://www.thingiverse.com/thing:4967931" rel="nofollow noreferrer">Customizable QR Keyring or Tag</a> by <a href="https://www.thingiverse.com/outwardb/designs" rel="nofollow noreferrer"><em>OutwardB</em></a> - which was provided in the (now deleted) <a href="https://3d... | 2,044 |
<p>Here is an extreme example of notches caused by the printer. They go along all sides but are the strongest on the Y faces. They also happen quite randomly sometimes they are tiny sometimes they are strong. </p>
<p><a href="https://i.stack.imgur.com/VQ7Sr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgu... | <p>I see two problems with your printer: your filament seems to overheat in some areas, and you overextrude a little. My suspicion is, that your heating behavior is not well tuned and it overshoots the target temperature, leading to an overcooked filament, then the temperature drops below the temperature you need, lead... | <p>I noticed that thermistors provided with Chinese kits are not up to specs. Do yourself a favor and go to mouser or digikey and order a proper thermistor that is rated for the temperature range in question.</p>
| 1,229 |
<p>As a self-taught computer programmer, I'm often at a loss to estimate the O() value for a particular operation. Yeah, I know off the top of my head most of the important ones, like for the major sorts and searches, but I don't know how to calculate one when something new comes along, unless it's blindingly obvious.... | <p>It's called <a href="http://en.wikipedia.org/wiki/Big_O_notation" rel="nofollow noreferrer">Big O Notation</a>, and it's used in <a href="http://en.wikipedia.org/wiki/Computational_complexity_theory" rel="nofollow noreferrer">Computational Complexity Theory</a>.</p>
<p>The wikipedia articles are a pretty good start... | <blockquote>
<p><em>Your links takes me to a site in</em>
<em>Russian that seems to want a userid</em>
<em>and password. Legitimate mistake, or</em>
<em>troll? Paul Tomblin</em></p>
</blockquote>
<p>The site is in Bulgarian and you shouldn't need a password to access the list of files I linked to and download ... | 8,820 |
<p>What are the best methods for tracking and/or automating DB schema changes? Our team uses Subversion for version control and we've been able to automate some of our tasks this way (pushing builds up to a staging server, deploying tested code to a production server) but we're still doing database updates manually. ... | <p>In the Rails world, there's the concept of migrations, scripts in which changes to the database are made in Ruby rather than a database-specific flavour of SQL. Your Ruby migration code ends up being converted into the DDL specific to your current database; this makes switching database platforms very easy. </p>
<p... | <p>There is a command-line <a href="http://bitbucket.org/stepancheg/mysql-diff/" rel="nofollow noreferrer">mysql-diff</a> tool that compares database schemas, where schema can be a live database or SQL script on disk. It is good for the most schema migration tasks.</p>
| 2,393 |
<p>I'm trying to write a regex function that will identify and replace a single instance of a match within a string without affecting the other instances. For example, I have this string:</p>
<pre><code>12||34||56
</code></pre>
<p>I want to replace the second set of pipes with ampersands to get this string:</p>
<pr... | <p>here's something that works:</p>
<pre><code>"23||45||45||56||67".replace(/^((?:[0-9]+\|\|){n})([0-9]+)\|\|/,"$1$2&&")
</code></pre>
<p>where n is the one less than the nth pipe, (of course you don't need that first subexpression if n = 0)</p>
<p>And if you'd like a function to do this:</p>
<pre><code>fun... | <p>Thanks Binda, I have modified the code for generic uses:</p>
<pre><code>private replaceNthMatch(original, pattern, n, replace) {
let m = -1;
return original.replaceAll(pattern, x => {
m++;
if ( n == m ) {
return replace;
} else {
return x;
}
});
... | 5,687 |
<p>If you were running a news site that created a list of 10 top news stories, and you wanted to make tweaks to your algorithm and see if people liked the new top story mix better, how would you approach this? </p>
<p>Simple Click logging in the DB associated with the post entry? </p>
<p>A/B testing where you would s... | <p>Thirding <a href="https://github.com/mono/taglib-sharp" rel="noreferrer">TagLib Sharp</a>.</p>
<pre><code>TagLib.File f = TagLib.File.Create(path);
f.Tag.Album = "New Album Title";
f.Save();
</code></pre>
| <p>I wrapped mp3 decoder library and made it available for .net developers. You can find it here:</p>
<p><a href="http://sourceforge.net/projects/mpg123net/" rel="nofollow noreferrer">http://sourceforge.net/projects/mpg123net/</a></p>
<p>Included are the samples to convert mp3 file to PCM, and read ID3 tags.</p>
| 9,379 |
<p>Recently, I've been dealing with an error with accessing MAPI via the .NET framework (as described in <a href="http://blogs.msdn.com/mstehle/archive/2007/10/03/fyi-why-are-mapi-and-cdo-1-21-not-supported-in-managed-net-code.aspx" rel="nofollow noreferrer">this article</a>). I am now left with a series of memory acce... | <p>I'm not entirely sure what you're asking, but i'll give it a shot.</p>
<p>Visual C++ is a pure C/C++ compiler so has none of .NET's memory management, nor any of its runtime -- You have to manually call new and delete.</p>
<p>.NET also provides C++/CLI, which is a slightly modified version of C++ that targets the ... | <p>Unless you are using Managed C++ (which it doesn't sound like you are) then no, the memory is not managed by the CLR.</p>
<p>The recommended method of talking to Exchange in .Net is via WebDAV.</p>
| 4,005 |
<p>In my work I deal mostly with C# code nowadays, with a sprinkle of java from time to time. What I absolutely love about Eclipse (and I know people using it daily love it even more) is a sophisticated code formatter, able to mould code into any coding standard one might imagine. Is there such a tool for C#? Visual St... | <p>For Visual Studio, take a look at <a href="http://www.jetbrains.com/resharper" rel="nofollow noreferrer">ReSharper</a>. It's an awesome tool and a definite must-have. Versions after 4.0 have the code formatting and clean-up feature that you are looking for. There's also <a href="http://stylecopforresharper.codeplex.... | <p>Here is an open source code formatting tool which has amazing features</p>
<p><a href="http://www.codemaid.net/" rel="nofollow">CodeMaid</a></p>
| 4,998 |
<p>Which C#/.NET Dependency Injection frameworks are worth looking into?
And what can you say about their complexity and speed.</p>
| <p><strong>edit</strong> (not by the author): There is a comprehensive list of IoC frameworks available at <a href="https://github.com/quozd/awesome-dotnet/blob/master/README.md#ioc" rel="nofollow noreferrer">https://github.com/quozd/awesome-dotnet/blob/master/README.md#ioc</a>:</p>
<ul>
<li><a href="https://github.com... | <p>I've used <a href="http://www.springframework.net/" rel="nofollow noreferrer">Spring.NET</a> in the past and had great success with it. I never noticed any substantial overhead with it, though the project we used it on was fairly heavy on its own. It only took a little time reading through the <a href="http://www.sp... | 4,152 |
<p>Using CuraEngine with my Ender 3, I'm getting what I'd call inconsistent inner and outer dimensions - for example, a nominally 3 mm peg is significantly larger than a 3 mm hole, and it takes dimensions something like 2.9 mm for the peg and 3.1 mm for the hole to get them to fit. Is this level of ... | <p>Filament expands slightly as it is extruded. Also, the width of the extrusion depends on the volume of plastic extruded (not the nozzle size), as well as the amount that it is "squidged" down. Some slicers (e.g. Simplify3D) allow you to specify the width of the extrusion that you desire, but I'm not sure if Cura doe... | <p>Cura does correctly account for line extrusion widths wheen positioning the lines, and attempting to fix this with negative <code>xy_offset</code> was a mistake that led to lots of problems: in some cases, it completely eliminated tiny components of the model and left gaps in layers. At some point after asking this ... | 1,212 |
<p>In the <a href="https://stackoverflow.com/questions/39447/how-can-i-expose-only-a-fragment-of-ilist">How Can I Expose Only a Fragment of IList<></a> question one of the answers had the following code snippet:</p>
<pre><code>IEnumerable<object> FilteredList()
{
foreach(object item in FullList)
{
... | <p>The <code>yield</code> contextual keyword actually does quite a lot here.</p>
<p>The function returns an object that implements the <code>IEnumerable<object></code> interface. If a calling function starts <code>foreach</code>ing over this object, the function is called again until it "yields". This i... | <p>It's trying to bring in some Ruby Goodness :)<br>
<strong>Concept:</strong> This is some sample Ruby Code that prints out each element of the array </p>
<pre><code> rubyArray = [1,2,3,4,5,6,7,8,9,10]
rubyArray.each{|x|
puts x # do whatever with x
}
</code></pre>
<p>The Array's each method impl... | 6,056 |
<p>My CR-10 S5 has a feature, that stops the print, when the filament runs out.</p>
<p>However, when the printer pauses, the bed cools down and the print plops if the bed. Is there a way to tell the printer to keep the bed heated, when paused (by the runout detector)?</p>
| <p>This is varying underextrusion due to loss of material to oozing in the interior of the model.</p>
<p>When printing the infill pattern, the nozzle doesn't follow a single continuous extrusion path, but moves from the end of one path to the beginning of the next, and under Cura defaults, <em>does this without retract... | <p>If this matches the horizontal planes - like "solid floor" than I would advice to check overlap settings. My suspicion is slight overextrusion, which might be the reason of many small horizontal differences. Using 3 mm filament I often suffer of similar inconsistencies, until I find proper flowrate to avoi... | 1,835 |
<p>I'm trying to build a headrest for my Sayl office chair. For that, I'm designing a 3d-printed part that's going to fit on one of the existing rods of the chair.</p>
<p>Check out this picture:</p>
<p><a href="https://i.stack.imgur.com/PMzGy.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/PMzGy.jpg" alt=""... | <p>In an earlier comment you stated that you cannot take it apart. So without taking it apart, you could try to determine the profile the old-fashion way with a piece of cardboard and a short pencil, just cut the rough shape of the rod and place it onto the rod, then take the short pencil and draw the profile onto the ... | <p>You could pull it apart and have it 3d scanned if you want to know the exact dimensions. There are companies that can do that for you at a certain price. Our company has used such services in scanning various parts before we obtained our own laser scanning device. </p>
<p>The question is whether you want exactly th... | 907 |
<p>I've always felt that my graphic design skills have lacked, but I do have a desire to improve them. Even though I'm not the worlds worst artist, it's discouraging to see the results from a professional designer, who can do an amazing mockup from a simple spec in just a few hours. I always wonder how they came up w... | <p>Most of artistic talent comes from putting in the time. However, as in most skills, practicing bad habits doesn't help you progress.</p>
<p>You need to learn basic drawing skills (form, mainly) and practice doing them well and right (which means slowly). As you practice correctly, you'll improve much faster.</p>
... | <p>I, too was not born with a strong design skillset, in fact quite the opposite. When I started out, my philosophy was that if the page or form <em>just works</em> then my job was done! </p>
<p>Over the years though, I've improved. Although I believe I'll never be as good as someone who was born with the skills, site... | 5,242 |
<p>I load some XML from a servlet from my Flex application like this:</p>
<pre><code>_loader = new URLLoader();
_loader.load(new URLRequest(_servletURL+"?do=load&id="+_id));
</code></pre>
<p>As you can imagine <code>_servletURL</code> is something like <a href="http://foo.bar/path/to/servlet" rel="nofollow norefe... | <p>My friend Luis figured it out:</p>
<p>You should use encodeURI does the UTF8URL encoding
<a href="http://livedocs.adobe.com/flex/3/langref/package.html#encodeURI()" rel="noreferrer">http://livedocs.adobe.com/flex/3/langref/package.html#encodeURI()</a></p>
<p>but not unescape because it unescapes to ASCII see
<a hr... | <p>From the livedocs: <a href="http://livedocs.adobe.com/flex/3/langref/flash/net/URLRequest.html" rel="nofollow noreferrer">http://livedocs.adobe.com/flex/3/langref/flash/net/URLRequest.html</a></p>
<blockquote>
<p>Creates a URLRequest object. If System.useCodePage is true, the request is encoded using the system c... | 8,787 |
<p>I was wondering if adding (an) extra fan(s) (not connected to the printer, but blowing on the print area) could improve the quality of PLA based prints(printing at 210 C). The printer already has a built in fan with a fan shroud that directs air to the hotend, but is it beneficial to add an extra fan in order to get... | <blockquote>
<p>The printer already has a built in fan with a fan shroud that directs air to the hotend</p>
</blockquote>
<p><strong>Unless your printer is defective, it may look like so, but the airflow should really be directed towards the print, not the hot-end</strong>. Cooling the hot-end will at best just was... | <p>Fan blow at hot end is necessary because hotend needs cooling.</p>
<p>For PLA it will yield better result with a seperate controllable fan direct airflow across the print head, but just like everything with 3D printing, you will need to test out every possible configuration to get the best for your setup.</p>
| 819 |
<p>When looking at a SSI printenv dump I see a variable URI_REQUEST.</p>
<p>When reading the Apache mod_include docs I see DOCUMENT_URI which they define as "The (%-decoded) URL path of the document requested by the user."</p>
<p>Anyone know the difference between the two?</p>
<p>TIA.</p>
| <p>REQUEST_URI includes the Query String (?q=testing...) where DOCUMENT_URI does not.</p>
| <p>ok. seems like it is exactly the opposite according to Apache docs and RFC 2616.</p>
<p>REQUEST_URI does not contain the query string.
DOCUMENT_URI does contain the query string.</p>
<p>cheers,</p>
<p>Rob</p>
| 6,031 |
<p>My current project is in Rails. Coming from a Symfony (PHP) and Django (Python) background, they both have excellent admin generators. Seems like this is missing in Rails.</p>
<p>For those who aren't familiar with Symfony or Django, they both allow you to specify some metadata around your models to automatically ... | <p><strong>Active Admin</strong> (<a href="http://activeadmin.info/" rel="noreferrer">http://activeadmin.info/</a>) was released in May of 2011, and looks like it's going to become the best Rails 3 option.</p>
<p><img src="https://i.stack.imgur.com/mtjrr.png" alt="features"></p>
| <p>The most common way to create a CRUD interface is to use Scaffold. </p>
<pre><code>./script/generate scaffold_resource MyModel property:type property2:type2
</code></pre>
<p>This command would generate a CRUD interface for the model named MyModel (singular) with two properties. Properties is what's called columns ... | 8,657 |
<p><a href="http://www.stackoverflow.com/questions/61088/hidden-features-of-javascript#61118">Alan Storm's comments</a> in response to my answer regarding the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with" rel="noreferrer"><code>with</code> statement</a> got me thinking. I'v... | <p>Another use occurred to me today, so I searched the web excitedly and found an existing mention of it: <a href="http://web.archive.org/web/20090111183416/http://www.hedgerwow.com/360/dhtml/js_block_scope.html" rel="noreferrer">Defining Variables inside Block Scope</a>.</p>
<h3>Background</h3>
<p>JavaScript, in spite... | <p>Just wanted to add you can get "with()" functionality with pretty syntax and no ambiguity with your own clever method...</p>
<pre><code> //utility function
function _with(context){
var ctx=context;
this.set=function(obj){
for(x in obj){
//should add hasOwnPro... | 8,679 |
<p>Is there a standard library method that converts a string that has duration in the standard ISO 8601 Duration (also used in XSD for its <code>duration</code> type) format into the .NET TimeSpan object?</p>
<p>For example, P0DT1H0M0S which represents a duration of one hour, is converted into New TimeSpan(0,1,0,0,0).... | <p>This will convert from xs:duration to TimeSpan:</p>
<pre><code>System.Xml.XmlConvert.ToTimeSpan("P0DT1H0M0S")
</code></pre>
<p>See <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlconvert.totimespan.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.xml.xmlconvert.totimespan.aspx</... | <p>As @ima dirty troll said TimeSpan translates always years as 365 days and months as 30 days.</p>
<pre><code>TimeSpan ts = System.Xml.XmlConvert.ToTimeSpan("P5Y");
DateTime now = new DateTime(2008,2,29);
Console.WriteLine(now + ts); // 27/02/2013 0:00:00
</code></pre>
<p>To address it you should add each field indi... | 8,829 |
<p>I have an application that writes information to file. This information is used post-execution to determine pass/failure/correctness of the application. I'd like to be able to read the file as it is being written so that I can do these pass/failure/correctness checks in real time.</p>
<p>I assume it is possible to ... | <p>Could not get the example to work using <code>FileChannel.read(ByteBuffer)</code> because it isn't a blocking read. Did however get the code below to work:</p>
<pre><code>boolean running = true;
BufferedInputStream reader = new BufferedInputStream(new FileInputStream( "out.txt" ) );
public void run() {
while( ... | <p>I've never tried it, but you should write a test case to see if reading from a stream after you have hit the end will work, regardless of if there is more data written to the file.</p>
<p>Is there a reason you can't use a piped input/output stream? Is the data being written and read from the same application (if s... | 2,613 |
<p>How can I construct my ajaxSend call, this seems like the place to put it, to preview what is being passed back to the broker? also, can I stop the ajax call in ajaxSend?..so I can perfect my url string before dealing with errors from the broker?</p>
<p>This is the complete URL that, when passed to the broker, will... | <p>As far as I know, the only way to do that is to enter something (anything) on that line, then delete it. Or hit space and you'll never see it there until you return to that line.</p>
<p>Once VS determines that you've edited a line of text, it won't automatically modify it for you (at least, not in that way that yo... | <p>This is an annoyance to myself as well. Anytime the code is reformatted the blank lines are de-tabbed.
You might look at this: <a href="http://visualstudiogallery.msdn.microsoft.com/ac4d4d6b-b017-4a42-8f72-55f0ffe850d7" rel="nofollow">http://visualstudiogallery.msdn.microsoft.com/ac4d4d6b-b017-4a42-8f72-55f0ffe850d7... | 9,957 |
<p>I am a broke college student. I have built a small web app in PHP5 and MySQL, and I already have a domain. What is an affordable way to get it online? A few people have suggested amazon's cloud services, but that seems equivalent to slitting my wrists and watching money slowly trickle out. So suggestions? Hosting co... | <p>I say pay the 50-80 bucks for a real host. The classic "you get what you pay for" is <strong>very</strong> true for hosting. This will save you time, time you can spend getting those $80.</p>
| <p>I've been at HostingMatters for years. They're relatively cheap, and their service is awesome. <12 hours for any support ticket I've ever had.</p>
<p>Additionally, since I've been with them for about ten years, they bumped me to an unmetered plan for no cost (at the same $10/month I was paying.) .... </p>
| 3,738 |
<p>In Python you can use <a href="https://docs.python.org/library/struct.html" rel="noreferrer">StringIO</a> for a file-like buffer for character data. <a href="https://docs.python.org/library/mmap.html" rel="noreferrer">Memory-mapped file</a> basically does similar thing for binary data, but it requires a file that is... | <p>You are probably looking for <a href="http://docs.python.org/release/3.1.3/library/io.html#binary-i-o">io.BytesIO</a> class. It works exactly like StringIO except that it supports binary data:</p>
<pre><code>from io import BytesIO
bio = BytesIO(b"some initial binary data: \x00\x01")
</code></pre>
<p>StringIO will ... | <p>Look at the struct package: <a href="https://docs.python.org/library/struct.html" rel="nofollow noreferrer">https://docs.python.org/library/struct.html</a>, it allows you to interpret strings as packed binary data.</p>
<p>Not sure if this will completely answer your question but you can use struct.unpack() to conve... | 4,472 |
<p>In one of my applications, I am querying active directory to get a list of all users below a given user (using the "Direct Reports" thing). So basically, given the name of the person, it is looked up in AD, then the Direct Reports are read. But then for every direct report, the tool needs to check the direct reports... | <p>In order to take control over the properties that you want to be cached you can call 'RefreshCache()' passing the properties that you want to hang around:</p>
<pre class="lang-c# prettyprint-override"><code>System.DirectoryServices.DirectoryEntry entry = new System.DirectoryServices.DirectoryEntry(); ... | <p>Active Directory is pretty efficient at storing information and the retrieval shouldn't be that much of a performance hit. If you are really intent on storing the names, you'll probably want to store them in some sort of a tree stucture, so you can see the relationships of all the people. Depending on how the numb... | 5,327 |
<p>For a model that has raised text on it, how do go about painting the very top layer of text, to make it stand out from the background? Lets say I printed the whole model the same color, what type of paint would work well, and not get on the background too?</p>
<p>Here's an example of a model that has raised text: <... | <p>You don't provide any dimensions or sizes, but...</p>
<p>Assuming that the text is sufficiently elevated from the rest of the model, you could use a firm solid (as opposed to soft and spongey) roller, of an appropriate width.</p>
<p>This should enable you to paint just the text without getting paint on the rest of... | <p>The technique you look for is <em>drybrushing</em> and not dependant on a specific type of color, as long as it can be applied with a brush.</p>
<p>An alternative technique might be carefully applying glue and leaf metal.</p>
| 1,513 |
<p>I need to modify the MBR of Windows, and I would really like to do this from Windows.</p>
<p>Here are my questions. I know that I can get a handle on a physical device with a call to CreateFile. Will the MBR always be on \\.\PHYSICALDRIVE0? Also, I'm still learning the Windows API to read directly from the disk. Is... | <p>Once the OS is started the MBR is typically protected for virus reasons - this is one of the oldest virus tricks in the books - goes back to passing viruses from floppy to floppy.</p>
<p>Even if it wasn't restricted, you have to write low level code - it isn't part of the file system, but exists on a specific locat... | <p>Modifying the bootloader is bad, bad idea. Here are just a few of the possible gotcha's:</p>
<ul>
<li>it will potentially kill full disk encryption products (Truecrypt, PGP, Vista's BitLocker, etc)</li>
<li>it will potentially trip up AV products (scaring users)</li>
<li>it will potentially kill complicated booting... | 6,058 |
<p>Two users wanted to share the same database, originally written in MS Access, without conflicting with one another over a single MDB file.</p>
<p>I moved the tables from a simple MS Access database to MySQL using its <a href="http://www.mysql.com/products/tools/migration-toolkit/" rel="noreferrer">Migration Toolkit... | <p>I had an application that worked likewise: an MS Access frontend to a MySQL backend. It was such a huge pain that I ended up writing a Win32 frontend instead. From the top of my head, I encountered the following problems:</p>
<ul>
<li>Development of the ODBC link seems to have ceased long ago. There are various dif... | <p>If it's only two users, then Access should do just fine if you put the .mdb on a shared drive.</p>
<p>Have you tried it first rather than just assume it will be a problem. </p>
<p>I believe the recommended max concurrent users for Access is 5 but on occasion I've pushed it past this and never come unstuck.</p>
<p... | 2,767 |
<p>I'm trying to grasp the concept of continuations and I found several small teaching examples like this one from the <a href="http://en.wikipedia.org/wiki/Continuation" rel="noreferrer">Wikipedia article</a>:</p>
<pre><code>(define the-continuation #f)
(define (test)
(let ((i 0))
; call/cc calls its first fun... | <p>In Algo & Data II we used these all the times to "exit" or "return" from a (long) function</p>
<p>for example the BFS algorthm to traverse trees with was implemented like this:</p>
<pre><code>(define (BFS graph root-discovered node-discovered edge-discovered edge-bumped . nodes)
(define visited (make-vector ... | <p>Continuations can be used to implement exceptions, a debugger.</p>
| 5,434 |
<p>I am developing a Reporting Services solution for a DOD website. Frequently I'll have a report and want to have as a parameter the Service (in addition to other similar mundane, but repetitive parameters like Fiscal Year, Data Effective Date, etc). Basically everything I've seen of SSRS 2005 says it can't be done.... | <p>I am not clear if you need to share a dataset, since you have some SQL results that you need to use twice, and don't want to re-compute the same data twice, or you want to do something regarding parameters. So with this "I didn't really understand the question" preface... </p>
<ol>
<li>You cannot share a dataset. M... | <p>If you cannot use Stored Procedures, I hope you can use a view.</p>
<p>Else you could leave SQL Server and use CSV sheets as data storage.</p>
| 3,901 |
<p>I have a new Prusa i3 MK3 and I have noticed that my prints consistently turn out worse on 0.05 mm layer heights than on 0.10 mm. The edges of the 0.05 mm prints turn out rough and sometimes stringy.</p>
<p><a href="https://i.stack.imgur.com/KOLcv.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/KOLcv.jpg"... | <p>When printing at small layer heights (high resolution), you probably need to do some test prints first to see if your normal settings work for the lower layer height. You are most probably experiencing an increased pressure build-up in the nozzle due to the nozzle being closer to the bed. A test that might be useful... | <p>One thing that I have learned in my extensive youtubing is that sometimes the hot end can soften the previous layers. Though, take the following advice with a grain of salt as the following is just conceptual for me (I'm still waiting for my first printer to arrive to follow this advice).</p>
<p>Tomb of 3D Printed ... | 1,097 |
<p>The <a href="http://win32.perl.org/" rel="noreferrer">win32.perl.org</a> web site provides references to several Perl distributions for MS Windows.</p>
<p>For a long time I have been using ActivePerl from
<a href="http://www.activestate.com/" rel="noreferrer">ActiveState</a> but recently I switched to
<a href="ht... | <p><a href="http://strawberryperl.com/" rel="noreferrer">Strawberry Perl</a> is just getting better and better. One problem I've repeatedly had with ActiveState is that my modules sometimes fail to install because I need an upgrade to a core module, but they won't allow that. Thus, everybody who <em>doesn't</em> use ... | <p>The code I write lands in Fortune 500 companies so a "corporate" feeling is helpful. I've used ActivePerl so far, and it's worked fine for both internal tooling and for distribution to those large'ish customers.</p>
| 9,702 |
<p>Do you often see in API documentation (as in 'javadoc of public functions' for example) the description of "value limits" as well as the classic documentation ?</p>
<p><strong>Note:</strong> I am not talking about <a href="https://stackoverflow.com/questions/20922/do-you-comment-your-code">comments within the code<... | <p>I think they <strong>can</strong> belong together but don't necessarily <strong>have</strong> to belong together. In your scenario, it seems like it makes sense that the limits are documented in such a way that they appear in the generated API documentation and intellisense (if the language/IDE support it).</p>
<p>... | <p>I think they do, and have always placed comments in the header files (c++) arcordingly.</p>
<p>In addition to valid input/output/return comments, I also note which exceptions are likly to be thrown by the function (since I often want to use the return value for...well returning a value, I prefer exceptions over err... | 8,681 |
<p>What considerations do I need to make if I want my code to run correctly on both 32bit and 64bit platforms ?</p>
<p>EDIT: What kind of areas do I need to take care in, e.g. printing strings/characters or using structures ?</p>
| <p>Options:</p>
<p>Code it in some language with a <a href="http://en.wikipedia.org/wiki/Virtual_machine" rel="nofollow noreferrer">Virtual Machine</a> (such as Java)</p>
<p>Code it in .NET and don't target any specific architecture. The <a href="http://www.dotnet-guide.com/jit.html" rel="nofollow noreferrer">.NET JI... | <p>I assume you are still talking about <em>compiling</em> them separately for each individual platform? As running them on both is completely doable by just creating a 32bit binary.</p>
| 5,247 |
<p>Suppose your git history looks like this:</p>
<p>1
2
3
4
5</p>
<p>1–5 are separate revisions. You need to remove 3 while still keeping 1, 2, 4 and 5. How can this be done?</p>
<p>Is there an efficient method when there are hundreds of revisions after the one to be deleted?</p>
| <p>To combine revision 3 and 4 into a single revision, you can use git rebase. If you want to remove the changes in revision 3, you need to use the edit command in the interactive rebase mode. If you want to combine the changes into a single revision, use squash.</p>
<p>I have successfully used this squash technique, ... | <p>Answers of rado and kareem do nothing for me (only message "Current branch is up to date." appears). Possibly this happens because '^' symbol doesn't work in Windows console. However, according to <a href="https://stackoverflow.com/questions/37219/how-do-you-remove-a-specific-revision-in-the-git-history#comment7564... | 5,789 |
<p>I'm looking for a simple algorithm to 'serialize' a directed graph. In particular I've got a set of files with interdependencies on their execution order, and I want to find the correct order at compile time. I know it must be a fairly common thing to do - compilers do it all the time - but my google-fu has been wea... | <p><a href="http://en.wikipedia.org/wiki/Topological_sorting" rel="noreferrer">Topological Sort</a> (From Wikipedia):</p>
<blockquote>
<p>In graph theory, a topological sort or
topological ordering of a directed
acyclic graph (DAG) is a linear
ordering of its nodes in which each
node comes before all nodes t... | <p>I would expect tools that need this simply walk the tree in a depth-first manner and when they hit a leaf, just process it (e.g. compile) and remove it from the graph (or mark it as processed, and treat nodes with all leaves processed as leaves).</p>
<p>As long as it's a DAG, this simple stack-based walk should be ... | 2,617 |
<p>I often need to implement some sort of rule system that is user-editable -- the requirements are generally different enough that the same system isn't directly applicable, so I frequently run into the same problem--how do I design a rule system that</p>
<ol>
<li>is maintainable</li>
<li>properly balances expressive... | <p>We had an in-house demo of this tool by it's vendor:
<a href="http://www.rulearts.com/rulexpress.php" rel="nofollow noreferrer">http://www.rulearts.com/rulexpress.php</a></p>
<p>As a company, we have a lot of experience with rule engines (e.g. Cleverpath Aion), but mostly developer-oriented tools. This tool (rulexp... | <p>A Ruby implementation to consider is Ruleby (<a href="http://ruleby.org/wiki/Ruleby" rel="nofollow noreferrer">http://ruleby.org/wiki/Ruleby</a>)</p>
| 9,301 |
<p>Why does the Ultimaker 3D Printer has a Heater + Heater transfer plate (aluminium) + Glass?</p>
<p>I wonder why a glass plate, and if is possible to remove the glass and print directly in the aluminium plate adjusting the heating.</p>
<p><a href="https://ultimaker.com/en/products/ultimaker-3" rel="nofollow norefer... | <p>Printing directly onto aluminum is something I've never seen before, likely due to the fact that PLA (and other materials) do not adhere reliably to aluminum. Instead, many opt to use blue tape, kapton tape, PEI, buildtak/commercial build surface, or an additional build surface, such as glass. When heated, clean gla... | <p>Printing directly onto aluminum is something I've never seen before, likely due to the fact that PLA (and other materials) do not adhere reliably to aluminum. Instead, many opt to use blue tape, kapton tape, PEI, buildtak/commercial build surface, or an additional build surface, such as glass. When heated, clean gla... | 562 |
<p>I have an Anet A8, and recently updated the firmware to Marlin 1.1.8.
My only change was replacing the configuration files by the Anet A8 sample files built in with the firmware zip file.</p>
<p>Everything works fine but, sometimes, right after finishing a printing (while doing the "home all"), the LCD shows some w... | <p>This is a known problem of the Anet A8 display, it is caused by electrical interference. Pressing the middle button will refresh the display.</p>
<p>This is prone to happen when doing long prints. </p>
<p>There are some reported successes of people inserting ferrite beads or toroidal rings. </p>
<p>No, this is no... | <p>I have solved completely, I covered the flat cable, with copper tape, this shield should be connected to the 0V of the power supply.
All disorders will disappear.</p>
| 946 |
<p>Is it possible for UDP data to come to you corrupted? I know it is possible for it to be lost.</p>
| <p>UDP packets use a 16 bit checksum. It is not impossible for UDP packets to have corruption, but it's pretty unlikely. In any case it is not more susceptible to corruption than TCP.</p>
| <p>Short answer: YES.</p>
<p>Detailed answer:</p>
<p>About 7 years ago(maybe 2011?) We found that UDP datagrams are unintentionally changed when a UDP datagram is exchanged between a computer in China and another one in Korea. Of course, Checksum in UDP packet header is also reculculated regarding to the payload chan... | 7,023 |
<p>The Benchy looks good for the most part except for some boogers on the chimney</p>
<p><a href="https://i.stack.imgur.com/fV2oD.jpg" rel="nofollow noreferrer" title="Photo of a printed Benchy with zits on the chimney"><img src="https://i.stack.imgur.com/fV2oD.jpg" alt="Photo of a printed benchy with zits on the chimn... | <p>The application doesn't look to be demanding at all from a material point of view. Operation below 40 °C and 70-90% RH is not that special.</p>
<p>Once taken out PLA for creep, most rigid filaments would work. Nylon deform under constant stress, so screws may get loose over time.</p>
<p>PETG, ABS, ABS+ (TitanX/niceA... | <p>My first choice for this would be PET. Not PETG, which is a mess of blobbing, stringing, warping, creep under load, etc., but real PET, also known as BPET (bottle PET) or HTPET (high temperature PET, because it needs high temperatures to print and has high HDT)</p>
<p>Unlike ASA, PC, and nylon, PET is easy to print.... | 2,196 |
<p>I've followed the <a href="http://incubator.apache.org/couchdb/index.html" rel="noreferrer">CouchDB</a> project with interest over the last couple of years, and see it is now an Apache Incubator project. Prior to that, the CouchDB web site was full of <em>do not use for production code</em> type disclaimers, so I'd ... | <p>I use the CouchDB to power a Facebook application (over 35k monthly active users). For a while it was using MySQL but after porting the entire project over from Perl to Erlang, I decided to go for the gold and migrate all of the data into CouchDB and use that instead.</p>
<p>CouchDB has been a great data store to w... | <p>I used couchdb twice in production. First was the wiki likes project and I think that couchdb was perfect candidate for that role. Saving the version of all docs helps a lot.
The second project was quite query loaded and idea was dumping social data first, then query it with various filters. It was looked like stand... | 4,865 |
<p>Stack Overflow has a subversion version number at the bottom:</p>
<blockquote>
<p>svn revision: 679</p>
</blockquote>
<p>I want to use such automatic versioning with my <code>.NET Web Site/Application</code>, Windows Forms, WPD projects/solutions.</p>
<p>How do I implement this?</p>
| <p>Looks like Jeff is using <a href="https://web.archive.org/web/20090130045625/http://confluence.public.thoughtworks.org/display/CCNET/What+is+CruiseControl.NET" rel="nofollow noreferrer">CruiseControl.NET</a> based on some leafing through the podcast transcripts. This seems to have automated deployment capabilities f... | <p><code>$rev</code> and others like it are revisions for the individual files, so they won't change unless the file changes. The number on the webpage is (most likely, I'm assuming here) the svn revision number for the whole project. That is different than the file revisions, which others have been pointing to.</p>
<... | 2,262 |
<p>So I'm not quite convinced about OpenID yet, and here is why:</p>
<p>I already have an OpenID because I have a Blogger account. But I discovered that Blogger seems to be a poor provider when I tried to identify myself on the <a href="http://altdotnet.org" rel="nofollow noreferrer">altdotnet</a> page and recieved th... | <p>Ideally Stack Overflow would allow you to change your OpenID.</p>
<p>OTOH, ideally you would have set up <a href="http://wiki.openid.net/Delegation" rel="nofollow noreferrer">OpenID delegation</a> on your own site, and used that to identify yourself.</p>
<p>With delegation, you would need only change which service... | <p>This is a problem for me because I changed my email in the way of the new fad of firstName.lastName@gmail.com. After much scouring of this Web site, I am confirming that those of you in my situation are out of luck until further notice because of the issue described in the question.</p>
<p>Either hold on to that ol... | 3,471 |
<p>Ender3 v2, SIENOC PETG which advises temperature of 230-250 °C on the box. I'm printing on top of cleaned blue tape, using a temperature of 230 °C for the nozzle and 80 °C for the bed.</p>
<p>I've had all sorts of trouble getting first layer to stick but finally managed it. However the thin end of this hook has now ... | <p>There are many types of <a href="https://3dprinting.stackexchange.com/questions/10998/e3d-v6-original-vs-clone/11012#11012">heatbreak clones</a>. In cour case, your clone effectively turns your hotend into an e3d Lite6, not an all-metal e3d v6. To function properly, the PTFE liner needs to butt against the nozzle or... | <p>Long story short, you can print Nylon with a Teflon tube. I've done it. P.S. The nylon absorbs water like nothing you've ever seen. Even after the part is printed, it absorbs water, and expands!</p>
| 1,713 |
<p>I use a stream reader to import some data and at the moment I hardcode a small sample file in the test to do the job.</p>
<p>Is it sensible to use Mock Objects with this and how ?</p>
| <p>I don't see any points to mock StreamReader unless you're making StreamReader derived class. If you need to provide test input via StreamReader, just read some predefined data from any suitable source.</p>
| <p>When testing code that depends on streams, streamreaders and streamwriters I usually use the memorystream object for testing. No mocking framework needed here.</p>
| 8,753 |
<p>I am looking into game programming in Java to see if it is feasible. When googling for it I find several old references to Java2D, Project Darkstar (Sun's MMO-server) and some books on Java game programming. But alot of the information seems to be several years old.</p>
<p>So the question I am asking, is anyone cre... | <p>there is the excellent open source 3d engine called jMonkey (<a href="http://www.jmonkeyengine.com" rel="noreferrer">http://www.jmonkeyengine.com</a>) which is being used for a few commercial projects as well as hobby developers...
there is also at a lower level the lwjgl library which jmonkeyengine is built on whic... | <p>I've made a <a href="http://www.java-gaming.org/index.php/topic,23958.msg199708.html#msg199708" rel="nofollow noreferrer">list of a bunch of tutorials</a> that should be of help</p>
| 8,992 |
<p>I have a few internal .net web application here that require users to "log out" of them. I know this may seem moot on an Intranet application, but nonetheless it is there.</p>
<p>We are using Windows authentication for our Intranet apps, so we tie in to our Active Directory with Basic Authentication and the credent... | <p>I've come up with a fix that seems fairly consistent but is hacky and <a href="https://stackoverflow.com/questions/6277919">I'm still not happy with it</a>.</p>
<p>It does work though :-)</p>
<p>1) Redirect them to a Logoff page</p>
<p>2) On that page fire a script to ajax load another page with dummy credentials... | <p>Hopefully this will be useful until someone actually comes along with an explicit answer - <a href="http://forums.mozillazine.org/viewtopic.php?t=366028&" rel="nofollow noreferrer"><strong>this issue was discussed two years ago on a message board</strong></a>.</p>
<p>HTH</p>
| 5,126 |
<p>I recently read this Question about <a href="https://stackoverflow.com/questions/3630/sqlite-vs-mysql">SQLite vs MySQL</a> and the answer pointed out that SQLite doesn't scale well and the official website <a href="http://www.sqlite.org/whentouse.html" rel="noreferrer">sort-of confirms this</a>, however.</p>
<p>How... | <p>Yesterday I released a small site<sup>*</sup> to track your rep that used a shared SQLite database for all visitors. Unfortunately, even with the modest load that it put on my host it ran quite slowly. This is because the entire database was locked every time someone viewed the page because it contained updates/inse... | <p>SQLite's website (the part that you referenced) indicates that it can be used for a variety of multi-user situations.</p>
<p>I would say that it can handle quite a bit. In my experience it has always been very fast. Of course, you need to index your tables and when coding against it, you need to make sure you use... | 7,870 |
<p>What are the different approaches for creating scheduled tasks for web applications, with or without a separate web/desktop application?</p>
| <p>If we're talking Microsoft platform, then I'd always develop a separate Windows Service to handle such batch tasks.</p>
<p>You can always reference the same assemblies that are being used by your web application to avoid any nasty code duplication.</p>
| <p>I think there are easier ways than using cron (Linux) or Task Scheduler (Windows). You can build this into your web-app using:
(a) quartz scheduler, </p>
<p>or if you don't want to integrate another 3rd party library into your application:
(b) create a thread on startup which uses the standard Java 'java.util.Time... | 4,335 |
<p>In Python, given a module X and a class Y, how can I iterate or generate a list of all subclasses of Y that exist in module X?</p>
| <p>Here's one way to do it:</p>
<pre><code>import inspect
def get_subclasses(mod, cls):
"""Yield the classes in module ``mod`` that inherit from ``cls``"""
for name, obj in inspect.getmembers(mod):
if hasattr(obj, "__bases__") and cls in obj.__bases__:
yield obj
</code></pre>
| <p>Given the module foo.py</p>
<pre><code>class foo(object): pass
class bar(foo): pass
class baz(foo): pass
class grar(Exception): pass
def find_subclasses(module, clazz):
for name in dir(module):
o = getattr(module, name)
try:
if issubclass(o, clazz):
yield name, o
... | 6,609 |
<p>I was using Codeplex and tried connecting to their source control using Team Explorer, with no joy. </p>
<p>I also tried connecting with HTTPS or HTTP, using the server name and the project name. As I do not have a user account on Codeplex I could not login.</p>
<p>I am just trying to check out some code without c... | <p>I think you have to use the <a href="http://www.codeplex.com/CodePlexClient" rel="nofollow noreferrer">CodePlex Source Control Client</a>. In includes cpc.exe which supports the anonymous access features of CodePlex TFS servers for non-coordinator/developer access. But according to the site:</p>
<blockquote>
<p>T... | <p>I think it's not possible with Team Explorer. But you can with <a href="http://www.codeplex.com/CodePlexClient" rel="nofollow noreferrer">CodePlex Source Control Client</a> or <a href="http://www.codeplex.com/CodePlex/Wiki/View.aspx?title=Using%20TortoiseSVN%20with%20CodePlex&referringTitle=Source%20control%20cl... | 5,839 |
<p>At my work we are running a group of tests that consist of about 3,000 separate test cases. Previously we were running this entire test suite on one machine, which took about 24-72 hours to complete the entire test run. We now have created our own system for grouping and distributing the tests among about three sepa... | <p>I've seen some people having a play with <a href="http://216.93.179.140:8080/wiki/display/GG15UG/Distributed+JUnit+Overview" rel="nofollow noreferrer">distributed JUnit</a>. I can't particularly vouch for how effective it is, but the other teams I've seen seemed to think it was straight forward enough. Hope that hel... | <p>Our build people use Mozilla Tinderbox. It seems to have some hooks for distributed testing. I'm sorry not to know the details but I thought I would at least pass on the pointer to you.</p>
<p>It's also nice coz you can find out immediately when a build breaks, and what checkin might have been the culprit.</p>
<... | 2,968 |
<p>We're in the process of upgrading one of our SQL Server instances from 2000 to 2005. I installed the performance dashboard (<a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=1d3a4a0d-7e0c-4730-8204-e419218c1efc&displaylang=en" rel="noreferrer">http://www.microsoft.com/downloads/details.aspx?Famil... | <p>First thing to be aware of:</p>
<p>When you upgrade from 2000 to 2005 (by using detach and attach) make sure that you:</p>
<ol>
<li>Set compability to 90</li>
<li>Rebuild the indexes</li>
<li>Run update statistics with full scan</li>
</ol>
<p>If you don't do this you will get suboptimal plans.</p>
<p>IF the tabl... | <p>Your best researching the most common type of queries that happen on your database and creating indexes based on that research.</p>
<p>For example, if there is a table which stores website hits, which is written to very very often but hardly even read from. Then don't index the table in away.</p>
<p>If how ever yo... | 2,598 |
<p>If you have a site which sends out emails to the customer, and you want to save a copy of the mail, what is an effective strategy?</p>
<p>If you save it to a table in your database (e.g. create a table called Mail), it gets very large very quickly.</p>
<p>Some strategies I've seen are:</p>
<ol>
<li>Save it to the... | <p>I don't agree that gmail is an effective backup for business data.</p>
<p>Why trust your business information to a provider who makes no guarantees of service, or over who you have no control whatsoever?</p>
<p>Makes no sense to me.</p>
<p>Depending on how frequently you need to access this information, I'd say g... | <p>We save the email to a database table. It really doesn't get that big that quickly. We've a table with 32,000 emails in it (they're biggish emails too @ 50kb per email) and with compression, the file only uses 16MB. </p>
<p>If you're sending a shed load of email, then know that GMail(free) currently only allows 7GB... | 7,462 |
<p>When I use the default java locale on my linux machine it comes out with the US locale settings, where do I change this so that it comes out with the correct locale?</p>
| <p>With the <code>user.language</code>, <code>user.country</code> and <code>user.variant</code> properties.</p>
<p>Example:</p>
<p><code>java -Duser.language=th -Duser.country=TH -Duser.variant=TH SomeClass</code></p>
| <p>One way to control the locale settings is to set the java system properties user.language and user.region.</p>
| 8,953 |
<p>I recently bought an Anet A8 (<a href="https://pevly.com/anet-a8-3d-printer-review/" rel="noreferrer">https://pevly.com/anet-a8-3d-printer-review/</a>). I've managed to get everything up and running, leveled the board, but am now running into a problem.</p>
<p>At the start of the print, the printer moves to 0,0,0, ... | <p>I switched to different firmware (the latest Marlin), now the problem has been resolved. So it seems to me that those random movements are not in fact normal, but a flaw in the firmware.</p>
| <p>Formating SD card fixes issue for me.
I think that writing many times to the same block of SD card corrupt some block of flash SD card memory.</p>
| 757 |
<p>My employer was recently acquired by a much larger company. In the process of sorting out all the legal details around our licenses for our development software, we have learned that the vendor of our IDE charges a "nominal" fee of 25% of the cost of a new license to transfer our existing licenses to the new corpor... | <p>Unfriendly? Yes. Abnormal? No. Its actually very common for tools with a hefty per-seat license fee to charge for a transfer after acquisition. I believe they do it because they can: the cost of transferring license is either overlooked during the M&A due diligence or is considered inconsequential compared to th... | <p>I would have expected your new overlords to have been made aware of this as part of their takeover plans. Part of the process involves checking for exactly this kind of gotcha.</p>
<p>Sounds like they chose to ignore the information or did not check it out.</p>
| 7,278 |
<p>I'm working with an older MakerBot Replicator clone, actually a Flashforge Creator 1, with original Creator firmware.</p>
<ul>
<li>I'm able to design objects, using Solidworks, and exporting the file as xxx.stl (ascii)</li>
<li>Then I use Slic3r to generate tool paths with output as xxx.gcode</li>
<li>finally, I use... | <p>So it turns out there are elements from each of the previous answers that make sense here, but its not a clear picture. I've spent a whole lot of time trying to make sense of this. I also upgraded my firmware to <a href="https://www.thingiverse.com/thing:32084" rel="nofollow noreferrer">Sailfish.</a> </p>
<p>For ... | <p>It sounds like you have "Origin at center" checked in your slicer's printer definition. That is generally only used with delta printers. Most Cartesian printers have the origin at the front-left corner of the build plate. Uncheck "Origin at center" and re-slice.</p>
<p>Providing that you have set up your slicer wit... | 1,495 |
<p>If user input is inserted without modification into an SQL query, then the application becomes vulnerable to <a href="https://stackoverflow.com/a/332367/">SQL injection</a>, like in the following example:</p>
<pre class="lang-php prettyprint-override"><code>$unsafe_variable = $_POST['user_input'];
mysql_query("IN... | <p>The <em>correct</em> way to avoid SQL injection attacks, no matter which database you use, is to <strong>separate the data from SQL</strong>, so that data stays data and will <strong>never be interpreted</strong> as commands by the SQL parser. It is possible to create an SQL statement with correctly formatted data p... | <p>I've written this little function several years ago:</p>
<pre><code>function sqlvprintf($query, $args)
{
global $DB_LINK;
$ctr = 0;
ensureConnection(); // Connect to database if not connected already.
$values = array();
foreach ($args as $value)
{
if (is_string($value))
{
... | 8,501 |
<p>I'm new to 3D printing and I recently got my first 3D printer, an Ender 3 Pro by Creality.</p>
<p>I've tried to find information about the type of nozzles should I look for. I'm trying to find stainless steel nozzles but there are so many models (M7, M8, etc.) and I have no idea what nozzle type I should get.</p>
... | <p>The Ender 3 takes an M6 thread (metric 6 mm diameter). Measurement of stock nozzle shown. </p>
<p>Most sellers will list compatible printers Ender 2, Ender 3, Ender 4, CR-10, CR-10S, CR-10 Mini, CR-10-S4, CR-10-S5, CR-8, CR-7. Will Also Fit Any Other MK10 Heater Blocks. </p>
<p>I recently bought some titanium... | <p>There is no such thing as a single MK10 hotend design. The Chinese aftermarket has mingled the designations.</p>
<p>If it has a <a href="https://groups.google.com/forum/m/#!topic/wanhao-printer-3d/TEdslEknny4" rel="nofollow noreferrer">MK10 like Makerbot</a> hotend, then the nozzles you are looking for are M7 threa... | 1,082 |
<p>See here <a href="http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx" rel="nofollow noreferrer">http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx</a> - for want of a better description - the statement block highlighting - eg in the pi... | <p>I use the latest version of ReSharper that is currently available — ReSharper 4.5 — but unfortunately I don't believe there is any feature for drawing a vertical line between matching braces, as in the screen-shots you referenced.</p>
<p>The feature I find useful, which Ben mentioned, is the matching brace highligh... | <p>Notepad ++ has a nice brace matching feature, with vertical lines matching the braces. It's not VS, so I only use it when I am faced with some confusing JS, cut and paste, figure out the braces and go back to VS. It would be GREAT if this sort of feature existed in VS, or R#. </p>
| 7,394 |
<p>I have a list of more than 15 thousand latitude and longitude coordinates. Given any X,Y coordinates, what is the fastest way to find the closest coordinates on the list?</p>
| <p>You will want to use a geometric construction called a <a href="http://mathworld.wolfram.com/VoronoiDiagram.html" rel="nofollow noreferrer">Voronoi diagram</a>. This divides up the plane into a number of areas, one for each point, that encompass all the points that are closest to each of your given points.</p>
<p>T... | <p>Even if you create a voronoi diagram, that still means you need to compare your x, y coordinates to all 15 thousand created areas. To make that easier, the first thing that popped into my mind though was to create some sort of grid over the possible values, so that you can easily place and x/y coordinate into one of... | 5,645 |
<p>Just what the title says, I need to change the password for an existing sql server login and I want to do it via sql script.</p>
| <p>ALTER LOGIN</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms189828.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms189828.aspx</a></p>
| <pre><code>alter login mylogin with password = 'mylogin'
</code></pre>
| 8,106 |
<p>What is the least expensive 3D printer available today? I am looking for something suitable for general use in a home office.</p>
| <p><strong>Depends on your definition of "available" and your definition of "suitable for general use."</strong> </p>
<p>The cheapest 3D printers are mostly Kickstarter promises that take a year or more to ship, if they ever do. For example, the Peachy 3D printer Kickstarter just imploded and failed. There have been m... | <p>You can get an A8 3D printer on Gearbest at 149$, It's a version of an i3, with easy assemble and pre configured, and it have a suprising good quality.</p>
<p>I thinks is the best price/quality that you can find at the moment. It prints with a good quality by default and you can upgrade it if you need it without sp... | 295 |
<p>I've gotten comfy with SVN, and now I need a way to deploy my code to staging or live servers more easily. I'd also like some method for putting build info in the footer of this site to aid in testing. Site is PHP/MySQL.</p>
| <p>A script to svn update on an as needed basis. </p>
<p>SVN supports keywords. You can add which keywords you want to expand to the keywords property, and SVN will expand then. See $Id$ or $Rev$, or keywords described in the SVN book.</p>
| <p>A really simple way to manage this is to setup your app in the following way:</p>
<p>Simply make your deployment app a working copy of your trunk (<code>svn co</code> the project to your /www root) and you run an <code>svn up</code> through an ssh console (<code>ssh user@host.com svn up /path/to/project</code>) whe... | 9,218 |
<p>I'm leading a project where we'll be recording metrics data. I'd like to retain the data for years. However, I'd also like to keep the primary table from becoming bloated with data that, while necessary for long term trending, isn't required for short term reporting.</p>
<p>What is the best strategy for handling th... | <p>We use both methods at my work, but slightly different, we keep all sales data in the primary table for 30 days, then at night (part of the nightly jobs) the days sales are rolled up into summaries (n qty of x product sold today ect) in a separate table for reporting reasons, and sales over 30 days are archived into... | <p>Either of those options are excellent, but it really depends on the problem domain. For things like cash balances or statistical data, I think that rolling up records and consolidating them is the best way, you can then move the rolled up records into a parallel archive table, keying them in such a way that you can ... | 4,011 |
<p>I want to check out all files in all subdirectories of a specified folder.</p>
<p>(And it is painful to do this using the GUI, because there is no recursive checkout option).</p>
| <p>Beware: ClearCase is File-centric, not repository centric (like SVN or CVS).</p>
<p>That means it is rarely a good solution to checkout all files (and it can be fairly long with ClearCase ;) )</p>
<p>That being said, the question is perfectly legitimate and I would like to point out another way:</p>
<p>open a <co... | <pre><code>cleartool find somedir -exec "cleartool checkout -nc \"%CLEARCASE_PN%\""
</code></pre>
<p>Also an article "<a href="http://www.ibm.com/developerworks/rational/library/4687.html" rel="noreferrer">ClearCase: The ten best scripts</a>" might be helpful</p>
| 5,366 |
<p><strong><em>Background:</em></strong>
I'm running a full-time job and a part-time job in the weekends, and both my employers have supplied a laptop for me to work on. Of course I also have my powerful workstation at home to work from, and sometimes when I'm at the office at my weekend job (it's in another city) I'm... | <p>I am a consultant and tend to work in a variety of environments. I carry a Thinkpad running VMWare Server over Ubuntu64 with 4GB of RAM. I've got a 320GB secondary hard drive that I use just for VM's and have 25 or so different virtual machines that I boot up as the circumstances demand.</p>
<p>They're a mix of Lin... | <p>I guess you can live with Logmein Free. [Or Pro if u want those features]</p>
| 9,693 |
<p>The company I work for is wanting to add blog functionality to our website and they were looking to spend an awful amount of money to have some crap being built on top of a CMS they purchased (sitecore). I pointed them to Telligent's Community Server and we had a sales like meeting today to get the Marketing folks... | <p>I've done quite a few projects using Community Server. If you're okay with the out-of-the-box functionality, or you don't mind sticking to the version you start with, I think you'll be very happy.</p>
<p>The times I've run into headaches using CS is when the client wants functionality CS does not provide, but also ... | <p>Have you had a look at the <a href="http://trac.sitecore.net/Blog" rel="nofollow noreferrer">Shared Source blog module</a> for Sitecore?</p>
| 2,736 |
<p>Is there a way to have Linux read ahead when cloning a disk? I use the program named "dd" to clone disks. The last time I did this it seemed as though the OS was reading then writing but never at the same time. Ideally, the destination disk would be constantly writing without waiting that's of course if the sourc... | <p>Commodore Jaeger is right about:</p>
<pre><code>dd if=/dev/sda of=/dev/sdb bs=1M
</code></pre>
<p>Also, adjusting "readahead" on the drives usually improves performance. The default may be something like 256, and optimal 1024. Each setup is different, so you would have to run benchmarks to find the best value.</... | <p>Are you sure it isn't doing that at the same time? I would expect the disk caches to make sure it that happens. If not, non-blocking or even asynchronous reads/writes may help,</p>
| 7,823 |
<p>I have a rather large file (150 million lines of 10 chars). I need to split it in 150 files of 2 million lines, with each output line being alternatively the first 5 characters or the last 5 characters of the source line.
I could do this in Perl rather quickly, but I was wondering if there was an easy solution using... | <p>Homework? :-)</p>
<p>I would think that a simple pipe with sed (to split each line into two) and split (to split things up into multiple files) would be enough.</p>
<p>The man command is your friend.</p>
<hr>
<p>Added after confirmation that it is not homework:</p>
<p>How about</p>
<pre><code>sed 's/\(.....\)... | <p>I think that something like this could work:</p>
<pre><code>out_file=1
out_pairs=0
cat $in_file | while read line; do
if [ $out_pairs -gt 1000000 ]; then
out_file=$(($out_file + 1))
out_pairs=0
fi
echo "${line%?????}" >> out${out_file}
echo "${line#?????}" >> out${out_fil... | 8,928 |
<p>With <a href="/questions/tagged/fdm" class="post-tag" title="show questions tagged 'fdm'" rel="tag">fdm</a> printers, the 3D object that should be printed can be positioned anywhere in the build volume. But it's only practical to place it on the bottom, because otherwise support material would be necessary.<... | <p>There are several things you could try without spending much but even PLA will warp on an unheated bed. I had a Legacy Kossel that I switched to an acrylic bed and had many issues with warping and prints pulling off the bed. </p>
<p>Some cheap things to try would be...</p>
<ol>
<li>Adding a brim to the print.</l... | <p>Try a dilute solution of PVA glue (approx. 5:1 water:PVA) applied to the bed or the BuildTak like sheet and allowed to dry.
Keep the ambient temperature as high as possible (but not so high as to soften any plastic on the printer obviously).
Big brims help - consider adding them to the model rather than just apply... | 147 |
<p>I have a .NET 2.0 windows forms app, which makes heavy use of the <code>ListView</code> control.</p>
<p>I've subclassed the <code>ListView</code> class into a templated <code>SortableListView<T></code> class, so it can be a bit smarter about how it displays things, and sort itself.</p>
<p>Unfortunately this ... | <p>It happened to me because of x86 / x64 architecture.</p>
<p>Since Visual Studio (the development tool itself) has no x64 version, it's not possible to load x64 control into GUI designer.</p>
<p>The best approach for this might be tuning GUI under x86, and compile it for x64 when necessary.</p>
| <p>In my case the problem was the folder's name of my project! Why I think this:
I use SVN and in the 'trunk\SGIMovel' works perfectly. But in a branch folder named as 'OS#125\SGIMovel' I can't open the designer for a form that uses a custom control and works in the trunk folder.</p>
<p>Just get off the # and works nic... | 3,074 |
<p>I just came across the proposed <a href="http://web.archive.org/web/20171008232044/http://dancinghacker.com:80/code/dataflow/dataflow/introduction/dataflow.html" rel="nofollow noreferrer">Boost::Dataflow</a> library.
It seems like an interesting approach and I was wondering if there are other such alternative frame... | <p><strong>Wikipedia</strong></p>
<p>There are a couple of good articles in the Wikipedia about the theory of the dataflow programming:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Dataflow" rel="nofollow noreferrer">Dataflow</a></li>
<li><a href="http://en.wikipedia.org/wiki/Dataflow_programming" rel="nofollow... | <p>If your area is sound generation/processing, use <a href="http://www.synthedit.com/" rel="nofollow noreferrer">http://www.synthedit.com/</a> </p>
<p>It looks promising, I've found a good answers for a deep problem in the SDK docs (polyphony). Funny, but they don't mention the word <em>dataflow</em>.</p>
| 9,753 |
<p>Does anybody have any pointers on how to successfully draw a bitmap that has
an alpha channel using Graphics::DrawImage() when the Graphics context is
created based on a printer HDC? The printer drivers don't generally support alpha blending - so is there an alternative to rendering everything to an offscreen bitmap... | <p>What kind of printer is that? Regular printers don't print white. Create in-memory image and 'flatten' it (remove alpha channel) and then print the result.</p>
| <p>Have you tried drawing a white rectangle to initialize the image before you call the DrawImage method?</p>
| 8,817 |
<p>I have a text file on my local machine that is generated by a daily Python script run in cron. </p>
<p>I would like to add a bit of code to have that file sent securely to my server over SSH.</p>
| <p>You can call the <a href="https://en.wikipedia.org/wiki/Secure_copy" rel="noreferrer"><code>scp</code></a> bash command (it copies files over <a href="https://en.wikipedia.org/wiki/Secure_Shell" rel="noreferrer">SSH</a>) with <a href="https://docs.python.org/library/subprocess.html#subprocess.run" rel="noreferrer"><... | <p>Kind of hacky, but the following should work :)</p>
<pre><code>import os
filePath = "/foo/bar/baz.py"
serverPath = "/blah/boo/boom.py"
os.system("scp "+filePath+" user@myserver.com:"+serverPath)
</code></pre>
| 9,384 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.