instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>My company has developed a long standing product using MFC in Visual C++ as the defacto standard for UI development. Our codebase contains ALOT of legacy/archaic code which must be kept operational. Some of this code is older than me (originally written in the late 70s) and some members of our team are still on Visu... | <p>I'm a developer on an app that has a ton of legacy MFC code, and we have all of your same concerns. A big driver for our strategy was to eliminate as much risk and uncertainty as we could, which meant avoiding The Big Rewrite. As we all know, TBR fails most of the time. So we chose an incremental approach that allow... | <p>I concur with the WPF sentiment. Tag/XML based UI would seem to be a bit more portable than WinForms.</p>
<p>I guess too you have to consider your team, if there is not a lot of current C# skills, then that is a factor, but going forward the market for MFC developers is diminishing and C# is growing.</p>
<p>Maybe ... | 3,209 |
<p>I have inherited some legacy PHP code what was written back when it was standard practice to use <a href="http://php.net/register_globals" rel="nofollow noreferrer"><code>register_globals</code></a> (As of PHP 4.2.0, this directive defaults to off, released 22. Apr 2002).</p>
<p>We know now that it is bad for secur... | <p>If you set error reporting to E_ALL, it warns in the error log about undefined variables complete with filename and line number (assuming you are logging to a file). However, it will warn only if when it comes across an undefined variable, so I think you will have to test each code path. Running php from the command... | <p>I know that there's a way to set php.ini values for that script with a certain command, I thus went looking and found this too - <a href="http://forums.macosxhints.com/archive/index.php/t-8538.html" rel="nofollow noreferrer">Goto last post on page</a></p>
<p>I also found the following post which may be of use - <a ... | 2,836 |
<p>I'm looking for something that can copy (preferably only changed) files from a development machine to a staging machine and finally to a set of production machines.</p>
<p>A "what if" mode would be nice as would the capability to "rollback" the last deployment. Database migrations aren't a necessary feature.</p... | <p><strong>@Sean Carpenter</strong> can you tell us a little more about your environment? Should the solution be free? simple?</p>
<p>I find robocopy to be pretty slick for this sort of thing. Wrap in up in a batch file and you are good to go. It's a glorified xcopy, but deploying my website isn't really hard. Just co... | <p>We used <a href="http://www.eworldui.net/unleashit/" rel="nofollow noreferrer">UnleashIt</a> (unfortunate name I know) which was nicely customizable and allowed you to save profiles for deploying to different servers. It also has a "backup" feature which will backup your production files before deployment so rollbac... | 6,438 |
<p>This came up from <a href="https://stackoverflow.com/questions/55093/how-to-deal-with-arrays-declared-on-the-stack-in-c#55183">this answer to a previous question of mine</a>.
Is it guaranteed for the compiler to treat <code>array[4][4]</code> the same as <code>array[16]</code>?</p>
<p>For instance, would either of ... | <p>From the C++ standard, referring to the <code>sizeof</code> operator:</p>
<blockquote>
<p>When applied to an array, the result is the total number of bytes in the array. This implies that the size of an array of <code>n</code> elements is <code>n</code> times the size of an element.</p>
</blockquote>
<p>From thi... | <p>I would be worried about padding being added for things like Matrix[5][5] to make each row word aligned, but that could be simply my own superstition.</p>
| 7,934 |
<p>We are a small team of 3 developers (2 experienced but new to this particular business sector) developing a functionally complex product. We're using Scrum and have a demo at the end of each sprint. Its clear that the functional team have plenty of ideas but these are not well communicated to the development team... | <p>Have you tried working with your customer to define / formulate <strong>acceptance tests</strong>?<br>
Using something like Fit to come up with these tests - would result in better specs as well as force the customer to think about what is really required. The icing on the cake is instant-doc-executable specs at the... | <p>Are they participating in the stand-up meetings?</p>
<p>You could propose to have a representative at each (or some) of them, to ask them for input before the end of the sprint</p>
| 4,849 |
<p>We’ve found that the unit tests we’ve written for our C#/C++ code have really paid off.
But we still have thousands of lines of business logic in stored procedures, which only really get tested in anger when our product is rolled out to a large number of users. </p>
<p>What makes this worse is that some of these s... | <p>I ran into this same issue a while back and found that if I created a simple abstract base class for data access that allowed me to inject a connection and transaction, I could unit test my sprocs to see if they did the work in SQL that I asked them to do and then rollback so none of the test data is left in the db.... | <p>LINQ will simplify this only if you remove the logic from your stored procedures and reimplement it as linq queries. Which would be much more robust and easier to test, definitely. However, it sounds like your requirements would preclude this.</p>
<p>TL;DR: Your design has issues. </p>
| 3,343 |
<p>I'm not sure I'm using all the correct terminology here so be forgiving.</p>
<p>I just put up a site with a contact form that sends an email using the PHP mail() function. Simple enough. However the live site doesn't actually send the email, the test site does. So it's not my code. </p>
<p>It's a shared host and w... | <p>Hey guys thanks for the answers, it is really appreciated.</p>
<p>After ignoring the issue for a few months it has come up again, I did however find the answer to my problems.</p>
<p>Firstly, as you answers suggested, PHP and the mail() function were working as expected. The mail was getting sent.</p>
<p>The prob... | <p>Yes, you could put in what ever you want in the 'from' field and it would still work.</p>
| 5,960 |
<p>I am in need of a way to mute a specific application in Vista.</p>
<p>Example: Mute just Firefox, but not all of the other application. Much similar to muting a specific program from within the volume mixer in vista. </p>
<p>If there is a program that will do this, i would appreciate that. Otherwise if there is ... | <p>I suggest using the built in Mixer in Vista...</p>
<p>Why do you want to use an 3rd party program?</p>
| <p>Using AutoHotkey, this works even better than expected! Just a fast window flash and BOOM, done.
Src: <a href="http://feebdack.com/knob/how_to_mute_a_single_application" rel="nofollow">http://feebdack.com/knob/how_to_mute_a_single_application</a></p>
<pre><code>#NoEnv ;// Recommended for new scripts
#Persistent ;/... | 6,297 |
<p>I'm going to guess that the answer is "no" based on the below error message (and <a href="http://archives.postgresql.org/pgsql-sql/2004-08/msg00076.php" rel="noreferrer">this Google result</a>), but is there anyway to perform a cross-database query using PostgreSQL?</p>
<pre><code>databaseA=# select * from database... | <p><em>Note: As the original asker implied, if you are setting up two databases on the same machine you probably want to make two <a href="https://www.postgresql.org/docs/current/static/ddl-schemas.html" rel="noreferrer">schemas</a> instead - in that case you don't need anything special to query across them.</em></p>
... | <p>In case someone needs a more involved example on how to do cross-database queries, here's an example that cleans up the <code>databasechangeloglock</code> table on every database that has it:</p>
<pre><code>CREATE EXTENSION IF NOT EXISTS dblink;
DO
$$
DECLARE database_name TEXT;
DECLARE conn_template TEXT;
DECLAR... | 6,840 |
<p>Does emacs have something like vi's “set number”, so that each line starts with its line number?</p>
| <p>Take a look at this article. It explains various ways to add line numbers to emacs:</p>
<p><a href="http://www.emacswiki.org/cgi-bin/wiki/LineNumbers" rel="nofollow noreferrer">http://www.emacswiki.org/cgi-bin/wiki/LineNumbers</a></p>
| <p>Try adding <a href="http://www.emacswiki.org/cgi-bin/wiki/LineNumbers" rel="nofollow noreferrer">linum.el</a> to your emacs dir / .emacs file.</p>
| 8,983 |
<p><code>Checkboxes</code> in <code>HTML</code> forms don't have implicit <em>labels</em> with them. Adding an explicit label (some text) next to it doesn't toggle the <code>checkbox</code>.</p>
<p><strong>How do I make a checkbox toggle from clicking on the text label as well?</strong></p>
| <p>If you correctly markup your HTML code, there is no need for javascript. The following code will allow the user to click on the label text to tick the checkbox.</p>
<pre><code><label for="surname">Surname</label>
<input type="checkbox" name="surname" id="surname" />
</code></pre>
<p>The <em>for</... | <p>Wrapping with the label still doesn't allow clicking 'anywhere in the box' - still just on the text!
This does the job for me:</p>
<pre><code><div onclick="dob.checked=!dob.checked" class="checkbox"><input onclick="checked=!checked" id="dob" type="checkbox"/>Date of birth entry must be completed</div... | 2,431 |
<p>I've had an Ender 5 Plus for a few weeks now. It's printing great and I've got my tuning pretty good at the moment. I've noticed some horizontal inconsistencies matching feature/geometry changes. It seems to be associated with maybe layer time(?) I only have a picture from two models, but the problem will appear in ... | <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,834 |
<p>I've got a problem where incoming SOAP messages from one particular client are being marked as invalid and rejected by our XML firewall device. It appears extra payload data is being inserted by Visual Studio; we're thinking the extra data may be causing a problem b/c we're seeing "VsDebuggerCausalityData" in these ... | <p>A quick google reveals that this should get rid of it, get them to add it to the web.config or app.config for their application. </p>
<pre><code><configuration>
<system.diagnostics>
<switches>
<add name="Remote.Disable" value="1" />
</switches>
</system.diagnostic... | <p>Or use "Start without debugging" in Visual Studio.</p>
| 5,288 |
<p>I am writing a batch script in order to beautify JavaScript code. It needs to work on both <strong>Windows</strong> and <strong>Linux</strong>. </p>
<p>How can I beautify JavaScript code using the command line tools? </p>
| <p>First, pick your favorite Javascript based Pretty Print/Beautifier. I prefer the one at <a href="http://jsbeautifier.org/" rel="noreferrer"><a href="http://jsbeautifier.org/" rel="noreferrer">http://jsbeautifier.org/</a></a>, because it's what I found first. Downloads its file <a href="https://github.com/beautify-... | <p>I've written an article explaining how to build a <a href="http://blog.shonzilla.com/post/1448821411/command-line-javascript-beautifier" rel="nofollow">command-line JavaScript beautifier implemented in JavaScript</a> in under 5 minutes. YMMV.</p>
<blockquote>
<ol>
<li>Download the latest stable Rhino and unpack... | 3,950 |
<p>I made a print that involves joining two halves together to create the full model. I decided to use hot glue to bond the halves and on one model, the parts came together slightly skewed. Is there any way to ‘unbond’ the hot glue without ruining the model so I can realign the pieces? Touching the glue gun tip to the ... | <p>it seems like retraction issue</p>
<p>i would say you should experiment with </p>
<ul>
<li>retraction length - so it would retract more</li>
<li>extra extrusion after retraction - so the printer could put some material before it will start your next hole :)</li>
</ul>
<p>unfortunately there is no good guide how m... | <p>Set <code>retraction_min_travel</code> to 0. The default value is 1.5 and skips retraction when moving less than 1.5 mm. This leads to serious oozing whenever your print has small travel, which seems likely between the hole walls and the supports inside the holes.</p>
<p>Also, the "custom start gcode" in Cura's End... | 1,292 |
<p>I'd like to keep a "compile-counter" for one of my projects. I figured a quick and dirty way to do this would be to keep a text file with a plain number in it, and then simply call upon a small script to increment this each time I compile.</p>
<p>How would I go about doing this using the regular Windows command lin... | <p>You can try a plain old batchfile.</p>
<pre><code>@echo off
for /f " delims==" %%i in (counter.txt) do set /A temp_counter= %%i+1
echo %temp_counter% > counter.txt
</code></pre>
<p>assuming the count.bat and counter.txt are located in the same directory.</p>
| <p>If you don't mind running a Microscoft Windows Based Script then this jscript will work OK. just save it as a .js file and run it from dos with "wscript c:/script.js".</p>
<pre><code>var fso, f, fileCount;
var ForReading = 1, ForWriting = 2;
var filename = "c:\\testfile.txt";
fso = new ActiveXObject("Scripting.F... | 6,207 |
<p>I've been tasked (by my wife) with creating a program to allow her to track the family trees on both sides of our family.</p>
<p>Does anyone know of a cost-effective (free) control to represent this type of information?</p>
<p>What I'm looking for is a modified org-chart type chart/tree. The modification is that ... | <p><a href="http://www.geni.com/" rel="noreferrer">Geni</a> is probably what your looking for.</p>
| <p>I haven't thought too hard about this, but I reckon you could get a Custom Treeview in WPF to do what you want. I was reading an <a href="http://www.codeproject.com/KB/WPF/CustomTreeViewLayout.aspx" rel="nofollow noreferrer">article on code project a while back that implemented an org chart</a> this way...</p>
| 2,776 |
<p>When I goto view the property page for my CSharp test application I get the following error.</p>
<p>"An error occurred trying to load the page. COM object that has been seperated from its underlying RCW cannot be used."</p>
<p>The only thing that seems to fix it is rebooting my PC!</p>
| <p>This is usually caused by a 'rogue' add-in.</p>
<p>Try disabling them all, and then re-enabling them checking for the error - so that you can narrow down the culprit.</p>
| <p>It seems Microsoft Style Cop was causing the issue.</p>
<p>It was not registered as an Add-in, but was integrated into VS2005 on some deeper level.</p>
| 3,749 |
<p>Are 3D printed gears applicable for industrial use? </p>
<p>I want to print some gears with ABS. </p>
<ul>
<li>What will their lifespan be? How long will they last if I use them, for example, every day? </li>
</ul>
| <p>Well, to determine the time life of the gears you will need to do a test called ALT (Accelerated Life Time) but the parts should be last for a long time (not years) however this can be determined by thickness. </p>
<p>The torque required is not than much like a tuning up the radio volume, so if you are going to cre... | <p>Well, to determine the time life of the gears you will need to do a test called ALT (Accelerated Life Time) but the parts should be last for a long time (not years) however this can be determined by thickness. </p>
<p>The torque required is not than much like a tuning up the radio volume, so if you are going to cre... | 766 |
<p>I need to programmatically determine out how many sectors, heads, and cylinders are on a physical disk from Windows XP. Does anyone know the API for determining this? Where might Windows expose this information?</p>
| <p>Use <a href="http://msdn.microsoft.com/en-us/library/aa363216%28VS.85%29.aspx" rel="noreferrer">DeviceIoControl</a> with control code <a href="http://msdn.microsoft.com/en-us/library/aa365169%28VS.85%29.aspx" rel="noreferrer">IOCTL_DISK_GET_DRIVE_GEOMETRY</a> or <a href="http://msdn.microsoft.com/en-us/library/aa365... | <p>There's a control code you can pass to <a href="http://msdn.microsoft.com/en-us/library/aa365171(VS.85).aspx" rel="nofollow noreferrer">DeviceIoControl</a> to get the physical disk geometry.</p>
| 7,353 |
<p>Is there any way to Write files to App_Data under medium trust hack?</p>
<p>Im sure I've heard about some hack, is that true?</p>
| <p>I don't think you are able to create new files, but you should be able to write to existing files in the App_Data folder. But I have honestly never experienced any problems with Medium Trust and writing to the App_Data folder. Are you sure it has the necessary permissions needed for writing files to the hard drive... | <p>I don't think you are able to create new files, but you should be able to write to existing files in the App_Data folder. But I have honestly never experienced any problems with Medium Trust and writing to the App_Data folder. Are you sure it has the necessary permissions needed for writing files to the hard drive... | 5,245 |
<p>I see a similar question <a href="https://stackoverflow.com/questions/28588/how-do-you-set-up-an-openid-provider-server-in-ubuntu">for Ubuntu</a>, but I'm interested in hosting my own OpenID provider through my Rails-based site that already has an identity and authentication system in place.</p>
<p>Note that I'm no... | <p>This "<a href="http://www.danwebb.net/2007/2/27/the-no-shit-guide-to-supporting-openid-in-your-applications" rel="nofollow noreferrer">No Shit Guide To Supporting OpenID In Your Applications</a>"
seems to be a step-by-step tutorial for what you want to do.</p>
| <p>This reminds me that <a href="http://trac.openidenabled.com/trac/ticket/267" rel="nofollow noreferrer">the overview docs for ruby-openid server are still missing</a>. But you can see <a href="http://openidenabled.com/files/ruby-openid/repos/2.x.x/examples/rails_openid/app/controllers/server_controller.rb" rel="nofo... | 6,712 |
<p>Is there a better windows command line shell other than <code>cmd</code> which has better copy paste between Windows' windows and console windows?</p>
| <p>Enable <strong>QuickEdit mode</strong>, under the <em>Options</em> tab of your shortcut to the command shell. Mark with the mouse, right-click to copy, right-click again to paste. </p>
<p>While you're there, enable a hotkey (like <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>C</kbd>) for lightning fast access to the she... | <p>@Chirs<br>
I think you need to clarify shell vs host(emulator). To me it sounds like you need another interface to your existing shell that better supports copy and paste, not another shell that supports more/different features.</p>
<p>I second Pat's suggestion of Console2, it is a very good application and OSS to... | 2,757 |
<p>I have a collection of STL files, each containing a separate moving part of an object I want to print. (Imagine a set of gears, or similar, that prints as a single object with multiple moving parts.)</p>
<p>My plan was to import them all into Cura, then hit print, then take my fully assembled object off the build p... | <p>What you try to do is called "Print in Place". However, it is not done by importing several STLs one after another as cura does remove the origin and recenters each imported object upon importing. However, an STL file can contain more than one body.</p>
<p>To generate a PiP model, you need to export your whole proj... | <p>Import them to Tinkercad and then output your combined file from there. You can go into Tinkercad and on the top right side you will see "import", click that to import your file (you can repeat the process as desired) and it will put the files on the workspace .. on the screen. When you have your workspace all set t... | 1,485 |
<p>I have a core dump file from a process that has probably a file descriptor leak (it opens files and sockets but apparently sometimes forgets to close some of them). Is there a way to find out which files and sockets the process had opened before crashing? I can't easily reproduce the crash, so analyzing the core fil... | <p>If you have a core file and you have compiled the program with debugging options (-g), you can see where the core was dumped:</p>
<pre><code>$ gcc -g -o something something.c
$ ./something
Segmentation fault (core dumped)
$ gdb something core
</code></pre>
<p>You can use this to do some post-morten debugging. A few ... | <p>Another way to find out what files a process has opened - again, only during runtime - is looking into /proc/PID/fd/ , which contains symlinks to open files.</p>
| 8,297 |
<p>We have a Windows Server Web Edition 2003 Web Farm. </p>
<p>What can we use that handles replication across the servers for:</p>
<p>Content & IIS Configuration (App Pools, Virtual Directories, etc...)</p>
<p>We will be moving to Windows 2008 in the near future, so I guess what options are there on Windows 200... | <p>A short list might be:</p>
<ul>
<li>Avoid memory leaks through use shared pointers to manage memory allocation and cleanup</li>
<li>Use the <a href="https://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization" rel="noreferrer">Resource Acquisition Is Initialization</a> (RAII) idiom to manage resource clean... | <pre><code>#include <boost/shared_ptr.hpp>
class A {
public:
void nuke() {
boost::shared_ptr<A> (this);
}
};
int main(int argc, char** argv) {
A a;
a.nuke();
return(0);
}
</code></pre>
| 5,030 |
<p>If I have a stl file is there a good way to estimate how long it will take to print on a given printer? I know there are a lot of things that go into print speed, such as the speed of the printer, the size of the print, etc. I was wondering if anyone knows of perhaps an application that you could enter your printer'... | <p>All commonly used slicers (e.g., Cura, Slic3r, Simplify3D,...) give an estimation of the print time.</p>
<p><a href="https://i.stack.imgur.com/cPaM6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cPaM6.png" alt="Example of print time estimation in Cura"></a></p>
<p><a href="https://i.stack.imgu... | <p>I use Repetier software with the Cura slicer and the print time estimate tends to be about 10 % longer than the actual print.</p>
| 889 |
<p>This is something that I think would be very useful. Basically, I'd like there to be a way to edit Python source programmatically without requiring human intervention. There are a couple of things I would like to do with this:</p>
<ol>
<li><p>Edit the configuration of Python apps that use source modules for confi... | <p>Python's standard library provides pretty good facilities for working with Python source; note the <a href="https://docs.python.org/2/library/tokenize.html" rel="nofollow noreferrer">tokenize</a> and <a href="https://docs.python.org/2/library/parser.html" rel="nofollow noreferrer">parser</a> modules.</p>
| <p>I had the same issue and I simply opened the file and did some replace: then reload the file in the Python interpreter. This works fine and is easy to do. </p>
<p>Otherwise AFAIK you have to use some conf objects.</p>
| 5,231 |
<p>In simple terms, what are the reasons for, and what are the differences between the GPL v2 and GPL v3 open source licenses? Explanations and references to legal terms and further descriptions would be appreciated.</p>
| <p>The page linked to in another answer is a good source, but a lot to read. Here is a short list of some the major differences:</p>
<ul>
<li><p>internationalization: they used new terminology, rather than using language tied to US legal concepts</p>
</li>
<li><p>patents: they specifically address patents (including t... | <p>In (not entirely) cynical terms, the reason for the v3 license was Microsoft's patent deal with Novell.</p>
<p>In reality, you should always consult a lawyer when dealing with legal issues.</p>
| 6,276 |
<p>I have a string that is like below.</p>
<pre><code>,liger, unicorn, snipe
</code></pre>
<p>in other languages I'm familiar with I can just do a string.trim(",") but how can I do that in c#?</p>
<p>Thanks.</p>
<hr>
<p><em>There's been a lot of back and forth about the StartTrim function. As several have pointed... | <pre><code>string sample = ",liger, unicorn, snipe";
sample = sample.TrimStart(','); // to remove just the first comma
</code></pre>
<p>Or perhaps:</p>
<pre><code>sample = sample.Trim().TrimStart(','); // to remove any whitespace and then the first comma
</code></pre>
| <pre><code>if (s.StartsWith(",")) {
s = s.Substring(1, s.Length - 1);
}
</code></pre>
| 9,935 |
<p>Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows?</p>
<p>The only other way I can think of doing this is to run a Mac VM image on a <strong>VMWare</strong> server running on Windows, although I'm not too sure how legal this is.</p>
| <p>It's certainly possible to develop on a Windows machine, in fact, my first application was exclusively developed on the old Dell Precision I had at the time :)</p>
<p>There are three routes;</p>
<ol>
<li>Install <a href="http://en.wikipedia.org/wiki/OSx86" rel="nofollow noreferrer">OSx86</a> (aka iATKOS / Kalyway) o... | <p>Just make a web app.
iOS web apps are:</p>
<ol>
<li>Reliable. The amount of time it takes to make an update is far shorter than with XCode.</li>
<li>Fast. JavaScript on iOS is, by nature, far faster than native apps.</li>
<li>Free. You never have to pay Apple a cent, as Apple doesn't have any control over you.</li>
... | 4,239 |
<p>I want to write a function in Python that returns different fixed values based on the value of an input index. </p>
<p>In other languages I would use a <code>switch</code> or <code>case</code> statement, but Python does not appear to have a <code>switch</code> statement. What are the recommended Python solutions ... | <p>The original answer below was written in 2008. Since then, Python 3.10 (2021) introduced the <a href="https://www.python.org/dev/peps/pep-0634/" rel="noreferrer"><code>match</code>-<code>case</code></a> statement which provides a first-class implementation of a "switch" for Python. For example:</p>
<pre><c... | <p>A switch statement is just syntactic sugar for if/elif/else.
What any control statement is doing is delegating the job based on certain condition is being fulfilled - decision path. For wrapping that into a module and being able to call a job based on its unique id, one can use inheritance and the fact that any meth... | 8,504 |
<p>I have a binary file that I have to parse and I'm using Python. Is there a way to take 4 bytes and convert it to a single precision floating point number?</p>
| <pre><code>>>> import struct
>>> struct.pack('f', 3.141592654)
b'\xdb\x0fI@'
>>> struct.unpack('f', b'\xdb\x0fI@')
(3.1415927410125732,)
>>> struct.pack('4f', 1.0, 2.0, 3.0, 4.0)
'\x00\x00\x80?\x00\x00\x00@\x00\x00@@\x00\x00\x80@'
</code></pre>
| <p>I would add a comment but I don't have enough reputation.</p>
<p>Just to add some info. If you have a byte buffer containing X amount of floats, the syntax for unpacking would be:</p>
<pre><code>struct.unpack('Xf', ...)
</code></pre>
<p>If the values are doubles the unpacking would be:</p>
<pre><code>struct.unpack('... | 2,731 |
<p>Is it possible to prevent an asp.net Hyperlink control from linking, i.e. so that it appears as a label, without actually having to replace the control with a label? Maybe using CSS or setting an attribute?</p>
<p>I know that marking it as disabled works but then it gets displayed differently (greyed out).</p>
<p>... | <p>This sounds like a job for JQuery. Just give a specific class name to all of the HyperLink controls that you want the URLs removed and then apply the following JQuery snippet to the bottom of your page:</p>
<pre><code>$(document).ready(function() {
$('a.NoLink').removeAttr('href')
});
</code></pre>
<p>All of ... | <p>If you are using databind in asp.net handle the databinding event and just don't set the NavigateUrl if that users is disabled.</p>
| 7,186 |
<p>I'm not new to web publishing, BUT I am new to publishing against a web site that is frequently used. Previously, the apps on this server were not hit very often, but we're rolling out a high demand application. So, what is the best practice for publishing to a live web server?</p>
<ol>
<li>Is it best to wait unt... | <blockquote>
<p><strong>@Nick DeVore wrote:</strong></p>
<p>If 2 is true, then that seems bad if
someone is using that specific page or
DLL and it gets overwritten.</p>
</blockquote>
<p>It's not really an issue if you're using ASP.NET stack (Webforms, MVC or rolling your own) because all your aspx files get compiled an... | <p>We do most of our updates in the wee small hours.</p>
<p>Handy hint, if this is an ASP.NET site, whatever time of the day you roll out, drop in an App_Offline.htm file with a message explaining to users that the site is down for maintenance. </p>
<p>Scott Guthrie has more info here:</p>
<p><a href="http://weblogs... | 3,286 |
<p>I have a Visual Studio Setup Project that I use to install a fairly simple WinForms application. At the end of the install I have a custom user interface page that shows a single check box which asks the user if they want to run the application. I've seen other installers do this quite often. But I cannot find a way... | <p>I believe this is one of the real limitations of the Visual Studio installation project. You need to be able to modify the last page of the installation UI but VS.NET does not give you a way to do this. You could modify the tables in the .MSI after it has been built but VS.NET would probably overwrite these changes ... | <p>I managed it by doing invoking the Main method the assembly using the following line:</p>
<pre><code>(typeof(ClassWithinAssemblyToExecute)).Assembly.EntryPoint.Invoke(null, new Object[] {} )
</code></pre>
| 8,546 |
<p>I am using the AJAX Control Toolkit Popup Calendar Control in a datagrid. When it is in the footer it looks fine. When it is in the edit side of the datagrid it is inheriting the style from the datagrid and looks completely different (i.e. too big). </p>
<p>Is there a way to alter the CSS so that it does not inheri... | <p>Open the page in firefox. However, first, download the firebug extension. Then, right click on the offending version and go down to inspect element.</p>
<p>Firebug is awesome because it let's you navigate the css of any element. You have two options here:</p>
<p>1) Assign the topmost element an css class and work ... | <p>It uses the style from the grid, because it's in it. If you want to change it's style, change the style of the control. What do you want it to do?</p>
| 8,967 |
<p>I just bought an Ender 3 Max and from the start I knew something was wrong. I figured out the problem: it is with the first few millimeters of the Z axis movement.</p>
<p>I turn on my 3D printer, go to prepare, move axis, move Z, move 1 mm.</p>
<p>Then I tell the printer to move up 1 mm. But in reality it only moves... | <p>Your printer probably has an issue with binding in the lower region (binding means extra friction possibly causing the Z stepper to skip steps). Disconnect the lead screw an manually move the X gantry up and down. If there is binding, you need to find why this happens, with the unfortunate design of the Ender, many ... | <p>The problem turned out to be that the two extruded pieces of aluminium on the z axis were too close together - I tightened the screws too tight. This made the gap between the z axis bars smaller than desired and the z movement only lifted one side of the bar in the beginning.</p>
<p>After I loosed those screws holdi... | 1,833 |
<p>I assume that you can't use a JavaScript code snippet to validate if the browser user has turned off JavaScript. So what can I use instead? Can someone offer a code sample?</p>
<p>I'm looking to wrap an if/then statement around it.</p>
<p>I often code in CFML, if that helps.</p>
| <p>Use the <noscript> HTML tags.</p>
| <p>You might have javascript execute some AJAX query and check to see if it has. Those that download the page and don't execute the query either have JS disabled or they're robots.</p>
| 6,691 |
<p><strong>Note:</strong> I <em>am</em> using SQL's Full-text search capabilities, CONTAINS clauses and all - the * is the wildcard in full-text, % is for LIKE clauses only.</p>
<p>I've read in several places now that "leading wildcard" searches (e.g. using "*overflow" to match "stackoverflow") is not supported in MS ... | <p>Workaround only for leading wildcard:</p>
<ul>
<li>store the text reversed in a different field (or in materialised view)</li>
<li>create a full text index on this column</li>
<li><p>find the reversed text with an *</p>
<pre><code>SELECT *
FROM TABLENAME
WHERE CONTAINS(TextColumnREV, '"mrethcraes*"');
</code></p... | <p>% Matches any number of characters
_ Matches a single character</p>
<p>I've never used Full-Text indexing but you can accomplish rather complex and fast search queries with simply using the build in T-SQL string functions.</p>
| 2,552 |
<p>I have this <a href="http://www.thingiverse.com/thing:1381474" rel="noreferrer">GoPro mount for a quadcopter as STL file</a>. It looks as follows.</p>
<p><a href="https://i.stack.imgur.com/qcZOR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qcZOR.png" alt="enter image description here"></a></p>
<p>How ... | <p>Many resources are available for modification using 3D CAD (including learning a tool such as sketchup, which is VERY beginner friendly). The easiest and fastest solution to your particular problem may be the <a href="https://www.reddit.com/r/3Dprintmything/" rel="nofollow">reddit community "3D Print My Thing"</a> w... | <p>Well. I would cut it into two STLs, using netfabb slice / split tool.</p>
<p>in 123d I would fill in the hole with the merge union (with a cylinder object), scale it, and either keep it unfilled and drill it, or do a subtraction union on where you want the holes. (again with a cylinder)</p>
<p>Scaling otherwise yo... | 315 |
<p>Recently got an Anycubic I3 Mega Printer and I've been playing with what it can do, but after a model is done it leaves residue on the build plate behind that is bugging me. Do I NEED to remove it? If so, how? Thanks! (I'm using PLA if that matters)</p>
<p>My Problem: </p>
<p><a href="https://i.stack.imgur.com/pup... | <p>You should remove it because it can and will affect the quality of future prints. Residue can mix up with new filament and create a ugly of colors and also prevent adhesion in places, thus potentially ruining your next print.</p>
<p>You have several solutions to clean up the bed:</p>
<ul>
<li>Scrape it off: usuall... | <p>I have had moderate success with a product called <a href="https://googone.com" rel="nofollow noreferrer">Goo Gone</a> (don't laugh). It quite remarkably lifts off any number of "sticky" items from various surfaces.</p>
<p>I work with PLA filament that is very hard and stubborn to remove from any surface.</p>
<p>I... | 1,157 |
<p>I'm setting up a web application with a FreeBSD PostgreSQL back-end. I'm looking for some database performance optimization tool/technique.</p>
| <p><a href="http://pgfouine.projects.postgresql.org/" rel="noreferrer">pgfouine</a> works fairly well for me. And it looks like there's a <a href="http://portsmon.freebsd.org/portoverview.py?category=databases&portname=pgfouine" rel="noreferrer">FreeBSD port</a> for it.</p>
| <p>DBTuna <a href="http://www.dbtuna.com/postgresql_monitor.php" rel="nofollow">http://www.dbtuna.com/postgresql_monitor.php</a> has recently started supporting PostgreSQL monitoring. We use it extensively for MySQL monitoring, so if it provides the same for Postgres then it should be a good fit for you too.</p>
| 5,771 |
<p>Right now, I keep all of my projects on my laptop. I'm thinking that I shouldn't do this, but instead use a version control system and check them in/out from an external hosting repository (Google Code, SourceForge, etc). I see several benefits here - first, I don't have to worry about losing my code if my computer ... | <p><strong><a href="http://www.assembla.com/" rel="nofollow noreferrer">Assembla</a></strong> is <em>awesome.</em></p>
<hr>
<p>EDIT: Yes, this is a good idea - I used to use a personal copy of <a href="http://www.sourcegear.com/vault/" rel="nofollow noreferrer">Vault</a> and found it was more than I cared to manage (... | <p>Online backup is cheap and easy. Why would you not?</p>
| 5,361 |
<p>I 3d-printed a key.
<a href="https://i.stack.imgur.com/8sfuT.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/8sfuT.jpg" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/XoGY3.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/XoGY3.jpg" alt="enter image description here"></... | <p>I must admit, I've never printed a key...but I think I can help anyway:</p>
<p><strong>Print method:</strong>
Consider printing on side, solid concentric infill. Or, if you can't manipulate your infill pattern, just increase the perimeter so you get the same effect, several continuous perimeter layers around the o... | <p>Which direction are the layers being printed? If the layers are printing top to bottom (in relation to your picture) there isn't a lot of sheer force required to break the key when turning. If you make the layers print from left to right you might have better luck.</p>
| 395 |
<p>I like to use static functions in C++ as a way to categorize them, like C# does.</p>
<pre><code>Console::WriteLine("hello")
</code></pre>
<p>Is this good or bad? If the functions are used often I guess it doesn't matter, but if not do they put pressure on memory?</p>
<p>What about <code>static const</code>?</p>
| <blockquote>
<p>but is it good or bad </p>
</blockquote>
<p>The first adjective that comes to mind is "unnecessary". C++ has free functions and namespaces, so why would you need to make them static functions in a class?</p>
<p>The use of static methods in uninstantiable classes in C# and Java <em>is a workaround</... | <p>For organization, use namespaces as already stated. </p>
<p>For global data I like to use the <a href="http://en.wikipedia.org/wiki/Singleton_pattern" rel="nofollow noreferrer">singleton</a> pattern because it helps with the problem of the unknown initialization order of static objects. In other words, if you use... | 5,086 |
<p>I have a Monoprice MP10 Mini, a cut-down Creality CR-10 with lobotomized firmware. Heated bed.</p>
<p>I'm trying to do PLA prints, but have been unable to find a usable temperature.</p>
<p>If I set the temperatures (either nozzle or bed) too low, the initial raft layers don't stick, the print shrivels up, and the ... | <p>Try bed at 50°C and hotend at 215°C, these are safe values.</p>
<p>Enable retraction in the slicer, to avoid/reduce oozing during long moves, but with Bowden setups finding a good value is trickier. Try with 6 mm.</p>
<p>Set the first layer height properly, but do it AFTER the bed has been heated for 5-10 minutes.... | <p>As @Fernando Balthazar had suggested, the z-offset was wrong. I needed to bring the nozzle and the bed closer together. The printer's default is -0.50 mm, I had to change to -0.78 mm or so to get it to stick. But then I need to reduce set it back to -0.50 or -0.40 during the print to avoid the nozzle banging into th... | 1,656 |
<p>It seems that it is impossible to capture the keyboard event normally used for copy when running a Flex application in the browser or as an AIR app, presumably because the browser or OS is intercepting it first.</p>
<p>Is there a way to tell the browser or OS to let the event through?</p>
<p>For example, on an Adv... | <p>I did a test where I listened for key up events on the stage and noticed that (on my Mac) I could capture control-c, control-v, etc. just fine, but anything involving command (the key) wasn't captured until I released the command key, and then ctrlKey was false (even though the docs says that ctrlKey should be tru... | <p>Another incredibly annoying thing that I just realized is that ctrl-c can't be captured by <code>event.ctrlKey && event.keyCode = Keyboard.C</code> (or ...<code>event.charCode == 67</code>), instead you have to test for <code>charCode</code> or <code>keyCode</code> being <code>3</code>. It kind of makes sens... | 5,175 |
<p>I just added a fan to my printer because very small layers seem to come out very badly. For example, the 5mm PLA cube that's the top level of the test shape shown below. Watching closely, I can see that the newly-extruded fiber is pushing the previous layer(s?) around pretty freely. And when the object is finished, ... | <h2>Layer Times</h2>
<p>See my answer to <a href="https://3dprinting.stackexchange.com/questions/516/what-parameters-affect-cylinder-regularity">this question</a> and pay particular attention to my suggestion about a minimum layer print time. I'm not sure if all slicing engines provide this option, but I know MakerWar... | <p>I believe you might be having an issue with insufficient cooling. Remember the suggestion to have wait times per layer to let the previous layer cool? Well, I think with your setup and print not only do individual layers overheat, but individual parts of each layer. You either need to try more direct or dual fan coo... | 191 |
<p>Let's say I woke up today and wanted to create a clone of StackOverflow.com, and reap the financial windfall of millions $0.02 ad clicks. Where do I start?</p>
<p>My understanding of web technologies are:</p>
<ul>
<li>HTML is what is ultimately displayed</li>
<li>CSS is a mechanism for making HTML look pleasing </... | <p>While I have built my knowledge largely based on using the internet to search out what I want to know (w3schools.com helped a lot, as did A List Apart), a few good books have helped me along the way, though they have been platform/language-specific, so I'll avoid mentioning them unless someone is curious. For me, at... | <p>I would recommend this book:<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0735623341" rel="nofollow noreferrer" rel="nofollow noreferrer">http://www.amazon.com/MCTS-Self-Paced-Training-Exam-70-528/dp/0735623341/ref=sr_1_1?ie=UTF8&s=books&qid=1218830714&sr=8-1</a></p>
<p>I have just read it... | 3,377 |
<p>Is there a good external merge tool for tortoisesvn (I don't particularly like the built in Merge tool). I use WinMerge for diffs, but it doesn't work with the three way merge (maybe a better question would be is there a way to force tortoisesvn to merge like tortoisecvs?)</p>
<p>[Edit]</p>
<p>After trying all of... | <p><a href="https://www.perforce.com/product/components/perforce-visual-merge-and-diff-tools" rel="noreferrer">Perforce Merge Tool</a> </p>
<p>Even though Perforce is obviously not free the merge tool is. It's 100x better than the default TortoiseSvn one. To integrate with TortoiseSvn set the merge tool to:</p>
<bloc... | <p>I like this one <a href="http://www.syntevo.com/smartsynchronize/index.html" rel="nofollow">SmartSynchronize</a> which is free for non-commercial use</p>
| 7,313 |
<p>If I pass PHP variables with <code>.</code> in their names via $_GET PHP auto-replaces them with <code>_</code> characters. For example:</p>
<pre><code><?php
echo "url is ".$_SERVER['REQUEST_URI']."<p>";
echo "x.y is ".$_GET['x.y'].".<p>";
echo "x_y is ".$_GET['x_y'].".<p>";
</code></pre>
<p>.... | <p>Here's PHP.net's explanation of why it does it:</p>
<blockquote>
<h3>Dots in incoming variable names</h3>
<p>Typically, PHP does not alter the
names of variables when they are
passed into a script. However, it
should be noted that the dot (period,
full stop) is not a valid character in
a PHP variable name. For the r... | <p>Well, the function I include below, "getRealPostArray()", isn't a pretty solution, but it handles arrays and supports both names: "alpha_beta" and "alpha.beta":</p>
<pre><code> <input type='text' value='First-.' name='alpha.beta[a.b][]' /><br>
<input type='text' value='Second-.' name='alpha.beta[a... | 9,421 |
<p>As per <a href="https://stackoverflow.com/questions/41970/lightweight-fuzzy-search-library#41975">this</a> comment in a related thread, I'd like to know why Levenshtein distance based methods are better than Soundex.</p>
| <p>Soundex is rather primitive - it was originally developed to be hand calculated. It results in a key that can be compared.</p>
<p>Soundex works well with western names, as it was originally developed for US census data. It's intended for phonetic comparison.</p>
<p>Levenshtein distance looks at two values and prod... | <p><a href="https://stackoverflow.com/questions/42013/levenshtein-distance-based-methods-vs-soundex#42025">@Keith</a>:</p>
<p>As I posted on the other question, Daitch-Mokotoff is better for us Europeans (and I'd argue the US).</p>
<p>I've also read the Wiki on Levenshtein. But I don't see why (in real life) it's <em... | 6,341 |
<p>With all the fuss about opensource projects, how come there is still not a strong standard that enables you to make portable code (I mean in <code>C/C++</code> not <code>Java</code> or <code>C#</code>)
Everyone is kind of making it's own soup.<br><br>
There are even some third party libs like <code>Apache Portable R... | <p>Yes, there is no standard but libraries like <strong>Qt</strong> and <strong>boost</strong> can make your life much easier when you do cross-platform development.</p>
| <p>If you make sure it compiles cleanly with both GCC and MS VC++, it will be little extra effort to port to somewhere else.</p>
| 8,674 |
<p>When opening Adobe Acrobat Pro, whether it be through <strong>Applescript</strong> or finder, the introductory dialog is shown. Is there a way to not show this dialog without already having checked the "Don't Show Again" option when opening a document using <strong>Applescript</strong>? </p>
<p>Photoshop and Illu... | <p>Copy any applicable preferences files in ~/Library/Preferences from a machine that you have checked "Don't show again" on.</p>
| <p>If it's not in the dictionary, probably not.</p>
| 3,031 |
<p><strong>Disclaimer:</strong> I am not a professional 3D printer, so I'm not really familiar with how 3D printing works.</p>
<p>I was thinking about trying to make a real life model of the atomic orbitals, to clearly see how the orbitals are really shaped. I thought about trying to 3D print a block, made up of color... | <p><strong>problem definition</strong></p>
<p>I'm not quite sure if it's really question for this group. Looks like the problem itself is more for programming or physics group. Having requested calculations (electron cloud shape) resolved, there will be something to print but...</p>
<p><strong>printing probability cl... | <p>I suggest you look into Polysher: <a href="http://www.polymaker.com/shop/polysmoothpolysher/" rel="nofollow noreferrer">http://www.polymaker.com/shop/polysmoothpolysher/</a> and e3D cyclops extruder <a href="https://e3d-online.com/Cyclops" rel="nofollow noreferrer">https://e3d-online.com/Cyclops</a> you can make gra... | 723 |
<blockquote>
<h4>Moderator note:</h4>
<p>This question is not a good fit for our question and answer format with the <a href="/help/on-topic">topicality rules</a> which currently apply for Stack Overflow. We normally use a "historical lock" for such questions where the content still has value. However, the an... | <h2>PART I: How To Log In</h2>
<p>We'll assume you already know how to build a login+password HTML form which POSTs the values to a script on the server side for authentication. The sections below will deal with patterns for sound practical auth, and how to avoid the most common security pitfalls.</p>
<p><strong>To HTT... | <p>Use <a href="http://openid.net/connect/" rel="noreferrer">OpenID Connect</a> or <a href="https://kantarainitiative.org/confluence/display/uma/Home" rel="noreferrer">User-Managed Access</a>.</p>
<p>As nothing is more efficient than not doing it at all.</p>
| 2,296 |
<p>We have a situation in our product where for a long time some data has been stored in the application's database as SQL string (choice of MS SQL server or sybase SQL anywhere) which was encrypted via the Windows API function <a href="http://msdn.microsoft.com/en-us/library/aa379924.aspx" rel="nofollow noreferrer">Cr... | <p>Any semi-decent algorithm will end up with a strong chance of generating a NULL value somewhere in the resulting ciphertext.</p>
<p>Why not do something like <a href="http://en.wikipedia.org/wiki/Base64" rel="nofollow noreferrer">base-64 encode</a> your resulting binary blob before persisting to the DB? (<a href="h... | <p>That's an interesting route OJ.
We're looking at the feasability of a non-reversable method (still making sure we don't explicitly retrieve the data to decrypt) e.g. just store a Hash to compare on a submission</p>
| 3,825 |
<p>Is there any <strong>simple algorithm</strong> to determine the likeliness of 2 names representing the same person? </p>
<p>I'm not asking for something of the level that Custom department might be using. Just a simple algorithm that would tell me if 'James T. Clark' is most likely the same name as 'J. Thomas Clark... | <p>I've faced similar problem and tried to use Levenstein distance first, but it did not work well for me. I came up with an algorithm that gives you "similarity" value between two strings (higher value means more similar strings, "1" for identical strings). This value is not very meaningful by itself (if not "1", alwa... | <p>I doubt there is, considering even the <a href="http://www.upgradetravelbetter.com/2008/09/14/tired-of-secondary-screenings-change-your-name/" rel="nofollow noreferrer">Customs Department doesn't seem to have a satisfactory answer</a>...</p>
| 9,390 |
<p>Is there an equivalent of svn's blame for Perforce on the command line? <code>p4 annotate</code> doesn't display usernames -- only changeset numbers (without ancestor history!).</p>
<p>I currently have to track code back through ancestors and compare against the filelog, and there just has to be an easier way -- ma... | <p>I'm not overly familiar with the blame command, but I assume that you are looking for who changes a particular line of code. The easiest way is to use Perforce's 'time lapse view' available from both p4win and p4v.</p>
<p>This tool uses annotate and some other commands to give you a view of the code line over time... | <p>@alanw123: p4pr is close to what I'm looking for, but it doesn't cross branch boundaries:</p>
<pre><code>last if $type eq 'branch';
</code></pre>
<p>That was the main problem I had when I tried writing my own utility -- you can't (easily) tell how the lines map back to the file that was branched from.</p>
| 8,169 |
<p>I'm currently working on a parser for our internal log files (generated by log4php, log4net and log4j). So far I have a nice regular expression to parse the logs, except for one annoying bit: Some log messages span multiple lines, which I can't get to match properly. The regex I have now is this:</p>
<pre><code>(?&... | <p>This will only work if the log message doesn't contain a date at the beginning of the line, but you could try adding a negative look-ahead assertion for a date in the "message" group:</p>
<pre><code>(?<date>\d{2}/\d{2}/\d{2})\s(?<time>\d{2}:\d{2}:\d{2},\d{3})\s(?<message>(.(?!^\d{2}/\d{2}/
\d{2}))... | <p>You need to pass the <code>RegexOptions</code>. Singleline flag in to the regular expression, so that "." matches all characters, not just all characters except new lines (which is the default).</p>
| 6,270 |
<p>Python frameworks always provide ways to handle URLs that convey the data of the request in an elegant way, like for example <a href="http://somewhere.overtherainbow.com/userid/123424/" rel="noreferrer">http://somewhere.overtherainbow.com/userid/123424/</a></p>
<p>I want you to notice the ending path <strong>/useri... | <p>This example uses ASP.NET Routing to implement friendly URLs. </p>
<p>Examples of the mappings that the application handles are: </p>
<p><a href="http://samplesite/userid/1234" rel="noreferrer">http://samplesite/userid/1234</a> - <a href="http://samplesite/users.aspx?userid=1234" rel="noreferrer">http://samplesi... | <p>Also, check out ASP.NET MVC or if you're set on webforms, the new System.Web.Routing namespace in ASP.NET 3.5 SP1</p>
| 6,720 |
<p>What is the best solution for maintaining backup and revision control on live websites?</p>
<p>As part of my job I work with several live websites. We need an efficient means of maintaining backups of the live folders over time. Additionally, updating these sites can be a pain, especially if a change happens to br... | <p>You can still use SVN, but instead of doing a checkout on your live environment, do an export, that way no .svn directories will be created. The downside, of course, is that no code changes on your live environment can take place. This is a good thing.</p>
<p>As a general rule, code changes on production systems sh... | <p>Any source control solution you pick is going to have problems if people are moving, deleting, or adding files and not telling the source control system about it. I'm not aware of any source control item that could solve this problem. </p>
<p>In the case where you just can't educate the people working on the proj... | 4,695 |
<p>Google is not being my friend - it's been a long time since my stats class in college...I need to calculate the start and end points for a trendline on a graph - is there an easy way to do this? (working in C# but whatever language works for you)</p>
| <p>OK, here's my best pseudo math:</p>
<p>The equation for your line is:</p>
<p>Y = a + bX</p>
<p>Where:</p>
<p>b = (sum(x*y) - sum(x)sum(y)/n) / (sum(x^2) - sum(x)^2/n)</p>
<p>a = sum(y)/n - b(sum(x)/n)</p>
<p>Where sum(xy) is the sum of all x*y etc. Not particularly clear I concede, but it's the best I can do w... | <p>Thank You so much for the solution, I was scratching my head.<br>
Here's how I applied the solution in Excel.<br>
I successfully used the two functions given by MUHD in Excel:<br>
a = (sum(x*y) - sum(x)sum(y)/n) / (sum(x^2) - sum(x)^2/n)<br>
b = sum(y)/n - b(sum(x)/n)<br>
(careful my a and b are the b and a in MUHD'... | 6,483 |
<p>I have some code that gives a user id to a utility that then send email to that user.</p>
<pre><code>emailUtil.sendEmail(userId, "foo");
public void sendEmail(String userId, String message) throws MailException {
/* ... logic that could throw a MailException */
}
</code></pre>
<p><code>MailException</code> co... | <p>I usually start with a general exception and subclass it as needed. I always can catch the general exception (and with it all subclassed exceptions) if needed, but also the specific.</p>
<p>An example from the Java-API is IOException, that has subclasses like FileNotFoundException or EOFException (and much more).</... | <p>I would just go by</p>
<pre><code>throw new exception("WhatCausedIt")
</code></pre>
<p>if you want to handle your exceptions, you could pass a code instead of "WhatCausedIt" an then react to the different answers with a switch statement. </p>
| 4,179 |
<p>This most be the second most simple rollover effect, still I don't find any simple solution.</p>
<p><strong>Wanted:</strong> I have a list of items and a corresponding list of slides (DIVs). After loading, the first list item should be selected (bold) and the first slide should be visible. When the user hovers over... | <p>Rather than displaying all slides when JS is off (which would likely break the page layout) I would place inside the switch LIs real A links to server-side code which returns the page with the "active" class pre-set on the proper switch/slide.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-consol... | <p>The only thing that's wrong with this code (at least to me) is that you're not using a loop to process all elements. Other than that, why not to it like that?</p>
<p>And with loop, I mean grabbing the container element via a JQuery and iterating over all child elements – basically a one-liner.</p>
| 5,484 |
<p>I'm trying to get only the list of id of object bob for example instead of the list of bob. It's ok with a HQL request, but I would know if it's possible using criteria ?</p>
<p>An example :</p>
<pre><code>final StringBuilder hql = new StringBuilder();
hql.append( "select bob.id from " )
.append( bob.class.get... | <p>I think you could do that with Projections, something like</p>
<pre><code>Criteria.forClass(bob.class.getName())
.add(Restrictions.gt("id", 10))
.setProjection(Projections.property("id"))
);
</code></pre>
| <p>You can do that like this</p>
<pre><code> bob bb=null;
Criteria criteria = session.createCriteria(bob.class);
criteria.add(Restrictions.eq("id",id));
bb = (bob) criteria.uniqueResult();
</code></pre>
<p>as Restrictions you can add your condition</p>
| 8,296 |
<p>How do I set, clear, and toggle a bit?</p>
| <h1>Setting a bit</h1>
<p>Use the bitwise OR operator (<code>|</code>) to set a bit.</p>
<pre><code>number |= 1UL << n;
</code></pre>
<p>That will set the <code>n</code>th bit of <code>number</code>. <code>n</code> should be zero, if you want to set the <code>1</code>st bit and so on upto <code>n-1</code>, if you... | <p>Try one of these functions in the C language to change n bit:</p>
<pre><code>char bitfield;
// Start at 0th position
void chang_n_bit(int n, int value)
{
bitfield = (bitfield | (1 << n)) & (~( (1 << n) ^ (value << n) ));
}
</code></pre>
<p>Or</p>
<pre><code>void chang_n_bit(int n, int ... | 7,034 |
<p>Extreme Programming, Scrum and Test Driven Development definitely seem to be the most popular Agile methods at the moment. But someone recently suggested that I take a look at Feature Driven Development.</p>
<p>Have you ever used this method with any success? What are the advantages of using it?</p>
| <p>FDD is what I like to think of as a wrapper methodology, in that it allows you to apply a method to manage projects at a very high level, but it still allows you to use other methodologies at a lower level. </p>
<p>FDD's focus is on being able to set estimates and schedules and to report on the status of a project... | <p>FDD is an older methodology. It has lot's of the ideas of other agile methodologies and misses some of them. Like Scrum it's a bit management-focussed and I think you need some elements from XP for practical implementations.</p>
<p>FDD is certainly interesting to look into. But just like Scrum and XP I think you ha... | 6,176 |
<p>I am printing minis and other very detailes stuff and I find that 0.04 mm layer height gives the best looking (smoothest) result. However it takes a long time, so I am looking for ways to speed it up. Is there any slicer which offers different layer heights for the outer perimiter? So you can print your model at 0.1... | <p>In Ultimaker Cura, unless you print a single perimeter outline and add extra wall infill support you are not going to have different outer perimeter layer heights.</p>
<p>However, Cura is able to reduce the printing time, E.g. you can have fine layers for the wall (all perimeters), and coarse layers for the infill.... | <p>In Ultimaker Cura, unless you print a single perimeter outline and add extra wall infill support you are not going to have different outer perimeter layer heights.</p>
<p>However, Cura is able to reduce the printing time, E.g. you can have fine layers for the wall (all perimeters), and coarse layers for the infill.... | 1,528 |
<p>I upgraded my Ender 3 with a new Mobo, the 4.2.7 version.</p>
<p>My current setup is:</p>
<p>Printer Specifications:</p>
<ul>
<li>Ender 3</li>
<li>Upgraded Motherboard 4.2.7 (Silent Stepper Drivers)</li>
<li>Marlin FW Upgrade to Version 2.1.x</li>
<li>New metal extruder handle</li>
<li>Replacement bed springs</li>
<... | <p>There are different versions of the 4.2.7 main board. This is an excellent video made by <a href="https://www.youmaketech.com/how-to-adjust-stepper-motor-currents-on-ender-3-pro-v2/" rel="nofollow noreferrer">YouMakeTech</a>: <div class="youtube-embed"><div>
<iframe width="640px" height="395px" src=... | <p>I would try to reinstall the old board and see if the extruder still skips.</p>
<p>If the extruder is not having an issue with the old board installed, you'll need to visit <a href="https://www.creality.com/pages/download-ender-3?spm=..page_1934481.products_display_1.1" rel="nofollow noreferrer">Creality's Updates p... | 2,226 |
<p>I bought an Ender 3 v2 in January 2021 for my second printer. I have had an Ender 3 for two years and love the quality it prints. This new printer has been plagued with issues since day one. Creality sent me a new mainboard and fan due to issues. Even since then my printer will still not print consistently. I checke... | <p>First, check that your belts are tight, on the X-axis and the bed. If not, tighten them.</p>
<p>Second, grab the hot end and wiggle the gantry, and make sure it is not loose. If there is any play at all, tighten the eccentric nuts.</p>
<p>If this doesn't fix your problems, check out this playlist I put together for ... | <p>If you have a 4.2.2 board, it may be a stepper driver problem. If this is the case, the only solution is to replace the board.</p>
| 1,916 |
<p>I'm not clear on the differences between the "current" version of Ruby (1.8) and the "new" version (1.9). Is there an "easy" or a "simple" explanation of the differences and why it is so different?</p>
| <p>Sam Ruby has a <a href="http://slideshow.rubyforge.org/ruby19.html" rel="noreferrer">cool slideshow that outline the differences</a>.</p>
<p>In the interest of bringing this information inline for easier reference, and in case the link goes dead in the abstract future, here's an overview of Sam's slides. The slides... | <p>Some more changes:</p>
<p><strong>Returning a splat singleton array:</strong></p>
<pre><code>def function
return *[1]
end
a=function
</code></pre>
<ul>
<li>ruby 1.9 : [1]</li>
<li>ruby 1.8 : 1</li>
</ul>
<p><strong>array arguments</strong></p>
<pre><code>def function(array)
array.each { |v| p v }
end
funct... | 4,171 |
<p>I have a simple WPF application which I am trying to start. I am following the Microsoft Patterns and Practices "Composite Application Guidance for WPF". I've followed their instructions however my WPF application fails immediately with a "TypeInitializationException".</p>
<p>The InnerException property reveals t... | <p>Thanks @ima, your answer pointed me in the right direction. I was using an app.config file and it contained this:</p>
<pre><code><configuration>
<startup>
<supportedRuntime version="v2.0.50727" sku="Client"/>
</startup>
<configSections>
<section name="modules" type="M... | <p>You have two sections named "modules". Place both module definitions in one section named "modules".</p>
| 8,276 |
<p>Does anybody know of a way to list up the "loaded plugins" in <strong>Vim</strong>?
I know I should be keeping track of this kind of stuff myself but
it would always be nice to be able to check the current status.</p>
| <p>Not a VIM user myself, so forgive me if this is totally offbase. But according to what I gather from the following <a href="http://rayninfo.co.uk/vimtips.html" rel="noreferrer">VIM Tips</a> site: </p>
<pre><code>" where was an option set
:scriptnames : list all plugins, _vimrcs loaded (super)
:verbos... | <p>If you use <a href="https://github.com/junegunn/vim-plug" rel="noreferrer">vim-plug</a> (Plug), "
A minimalist Vim plugin manager.":</p>
<pre><code>:PlugStatus
</code></pre>
<p>That will not only list your plugins but check their status.</p>
| 7,136 |
<p>I'm printing 6 separate parts in one go, after 4 hours of printing one part failed, but the other 5 are printing nicely.</p>
<p>Is there a way to prevent the print from printing the failed part and continue printing the other 5 parts.</p>
<p>I'm using Cura and an Ender 3 printer.</p>
| <p>If you use the <a href="https://octoprint.org/" rel="noreferrer">OctoPrint</a> print manager, you can exclude regions to be printed using the <a href="https://plugins.octoprint.org/plugins/excluderegion/" rel="noreferrer">Exclude Region</a> plugin. The description states that it can be used to rescue partially-faile... | <p>No, once you sliced the 6 parts on the build plate in your slicer, the G-code is fixed and the printer will print as the sliced instructions. During printing it cannot skip the code of a part that failed along the way; there is no way to interfere with the printing other than stopping the print. For that reason, man... | 1,708 |
<p>I'm sick and tired of manually tracking my branches and merges across my repository! It's too error prone. In a world where everyone seems to get the idea of reducing duplication and automating everything, subversion branching/merging feels like it's left over from the 80's. What is a good alternative to subversion ... | <p>Have you upgraded to Subversion 1.5? It includes automated merge tracking. This may address your issue. It sounds like you're already familiar with the tool itself and it's free. So, if you upgrade your current solution to 1.5 you'll have almost no learning curve and zero cost - plus you won't have to go through... | <p>git - <a href="http://git.or.cz/" rel="nofollow noreferrer">http://git.or.cz/</a> ( i am quite fond of git, great @ branching and distributed development) - <a href="http://github.com/" rel="nofollow noreferrer">http://github.com/</a> is a great working example.</p>
| 9,489 |
<p>I've heard of the idea of bootstrapping a language, that is, writing a compiler/interpreter for the language in itself. I was wondering how this could be accomplished and looked around a bit, and saw someone say that it could only be done by either</p>
<ul>
<li>writing an initial compiler in a different language.<... | <blockquote>
<p>Is there a way to actually write a compiler in its own language?</p>
</blockquote>
<p>You <em>have</em> to have some existing language to write your new compiler in. If you were writing a new, say, C++ compiler, you would just write it in C++ and compile it with an existing compiler first. On the o... | <p>Some bootstrapped compilers or systems keep both the source form and the object form in their repository:</p>
<ul>
<li><p><a href="http://ocaml.org/" rel="nofollow">ocaml</a> is a language which has both a bytecode interpreter (i.e. a compiler to Ocaml bytecode) and a native compiler (to x86-64 or ARM, etc... assem... | 3,445 |
<p>In C++, can member function pointers be used to point to derived (or even base) class members? </p>
<p>EDIT:
Perhaps an example will help. Suppose we have a hierarchy of three classes <code>X</code>, <code>Y</code>, <code>Z</code> in order of inheritance.
<code>Y</code> therefore has a base class <code>X</code> a... | <p>C++03 std, <a href="http://www.open-std.org/jtc1/sc22/WG21/docs/wp/html/nov97-2/conv.html#conv.mem" rel="noreferrer">§4.11 2 Pointer to member conversions</a>:</p>
<blockquote>
<p>An rvalue of type “pointer to member of B of type <i>cv</i> T,” where B is a class type, can be converted to an rvalue of type “pointe... | <p>Here is an example of what works.
You can override a method in derived class, and another method of base class that uses pointer to this overridden method indeed calls the derived class's method.</p>
<pre><code>#include <iostream>
#include <string>
using namespace std;
class A {
public:
virtual vo... | 8,477 |
<p>exact code will be helpful. I assume the DirectoryServices namespace does it but I can't find the method that does it.</p>
<hr>
<p>I need actual C# code. All the samples I found so far are VB or VBScript. The C# examples I found are for reading/setting ADSI properties. A command like backup seems to have a certain... | <p>You'll need to use ADSI objects. The <a href="http://msdn.microsoft.com/en-us/library/ms525753.aspx" rel="nofollow noreferrer">IIsComputer.Backup</a> method is what you want.</p>
<p>As far as how to access ADSI objects from C#, check out this <a href="http://support.microsoft.com/kb/315716" rel="nofollow noreferrer... | <p>I found it:</p>
<p>DirectoryEntry de = new DirectoryEntry("IIS://localhost");
de.Invoke("Backup", new object[0] );</p>
<p>new object needs to be set to hold proper arguments like overwriting current backup</p>
| 7,270 |
<p>Can Repetier host run a multi-material printer such as the Prusa i3 MK2S?</p>
| <p>Yes, it can. I have configured it for as many as four extruders. The problem may be in the slicing, as the slicer is responsible for generating the tool change commands.</p>
<p>One problem with the Repetier multi-extruder support is that, although the temperature of each extruder is reported by the RepRap firmwar... | <p>Yes, you can add a second extruder to it.</p>
| 760 |
<p>I have a ASP.NET 1.1 application, and I'm trying to find out why when I change a ComboBox which value is used to fill another one (parent-child relation), two postbacks are produced.</p>
<p>I have checked and checked the code, and I can't find the cause.</p>
<p>Here are both call stacks which end in a page_load</p... | <p>It's a very specific problem with this code, I doubt it will be useful for someone else, but here it goes:</p>
<p>A check was added to the combo's <code>onchange</code> with an if, if the condition was met, an explicit call to the postback function was made.
If the combo was set to <code>AutoPostback</code>, asp.ne... | <p>First thing I would look for is that you don't have the second ComboBox's AutoPostBack property set to true. If you change the value in the second combo with that property set true, I believe it will generate a postback on that control.</p>
| 4,070 |
<p>How can I present a control to the user that allows him/her to select a directory?</p>
<p>There doesn't seem to be any native .net controls which do this?</p>
| <p>The <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialog.aspx" rel="noreferrer">FolderBrowserDialog class</a> is the best option.</p>
| <p>or even more better, you can put this code in a class file</p>
<pre><code>using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows.Forms;
internal class OpenFolderDialog : IDisposable {
/// <summary>
/// Gets/sets folder in whic... | 3,287 |
<p>I've been wondering, what is the point of clog? As near as I can tell, clog is the same as cerr but with buffering so it is more efficient. Usually stderr is the same as stdout, so clog is the same as cout. This seems pretty lame to me, so I figure I must be misunderstanding it. If I have log messages going out to t... | <blockquote>
<p>Is it possible to redirect clog, cerr, cout, stdin, stdout, and/or stderr?</p>
</blockquote>
<p>Yes. You want the <a href="http://www.cplusplus.com/reference/iostream/ios/rdbuf.html" rel="noreferrer"><code>rdbuf</code></a> function.</p>
<pre><code>ofstream ofs("logfile");
cout.rdbuf(ofs.rdbuf());
co... | <h2>Basic Logger</h2>
<pre><code>#define myerr(e) {CriticalSectionLocker crit; std::cerr << e << std::endl;}
</code></pre>
<p>Used as <code>myerr("ERR: " << message);</code> or <code>myerr("WARN: " << message << code << etc);</code></p>
<p>Is very effective.</p>
<p>Then do:</p>
... | 7,562 |
<p>Semantically speaking, is there an appropriate place in today's websites (late 2008+) where using the bold <code><b></code> and italic <code><i></code> tags are more useful than the more widely used <code><strong></code> and <code><em></code> tags?</p>
| <p>Never. They are removed in XHTML 2.0 as they are presentational tags. CSS should be used to bold/italicise content.</p>
<p><strong>edit:</strong> If you're looking for a purely presentational tag, that's what the <code>SPAN</code> tag with a class and a little CSS is for.</p>
| <p><strong>When writing websites for mobile devices</strong>. They don't always support the 'latest and greatest' standards, are depreciated but not deleted from all modern browsers, and simply take up less space and bandwidth (though in theory the streams are compressed by either the websites or the wireless browser,... | 8,916 |
<p>Say you have a shipment. It needs to go from point A to point B, point B to point C and finally point C to point D. You need it to get there in five days for the least amount of money possible. There are three possible shippers for each leg, each with their own different time and cost for each leg:</p>
<pre><code>A... | <p>Could alter some of the <a href="http://en.wikipedia.org/wiki/Shortest_path_problem" rel="noreferrer">shortest path algorithms</a>, like Dijkstra's, to weight each path by cost but also keep track of time and stop going along a certain path if the time exceeds your threshold. Should find the cheapest that gets you ... | <p>I think that Dijkstra's algorithm is for finding a shortest path. </p>
<p><strong>cmcculloh</strong> is looking for the minimal cost subject to the constraint that he gets it there in 5 days. </p>
<p>So, merely finding the quickest way won't get him there cheapest, and getting there for the cheapest, won't get it ... | 3,567 |
<p>I've read that Lambda Expressions are an incredibly powerful addition to C#, yet I find myself mystified by them. How can they improve my life or make my code better? Can anyone point to a good resource for learning such expressions?</p>
<p>They seem cool as hell, but how do they relate to my day-to-day life as an ... | <blockquote>
<p>: are lambda expressions useful for anything other than querying</p>
</blockquote>
<p>Lamba expressions are nothing much other than a convenient way of writing a function 'in-line'.</p>
<p>So they're useful any place you wanted a bit of code which can be called as though it's a separate function but... | <p>Lambdas bring functional programing to C#.
They are anonymous functions that can be passed as values to certain other functions. Used most in LINQ.</p>
<p>Here is a contrived example:</p>
<pre><code>List<int> myInts = GetAll();
IEnumerable<int> evenNumbers = myInts.Where(x => x % 2 == 0);
</code></... | 4,503 |
<p>Trying to setup an SSH server on Windows Server 2003. What are some good ones? Preferably open source. I plan on using WinSCP as a client so a server which supports the advanced features implemented by that client would be great.</p>
| <p>I've been using <a href="http://www.bitvise.com/winsshd" rel="nofollow noreferrer">Bitvise SSH Server</a> and it's really great. From install to administration it does it all through a GUI so you won't be putting together a sshd_config file. Plus if you use their client, <a href="http://www.bitvise.com/tunnelier" ... | <p>You can run OpenSSH on Cygwin, and even install it as a Windows service.</p>
<p>I once used it this way to easily add backups of a Unix system - it would rsync a bunch of files onto the Windows server, and the Windows server had full tape backups.</p>
| 3,891 |
<p>Is there a definitive scalable 3D printer? </p>
<p>I've seen examples of Chinese companies printing entire houses, and I'm curious as to printers / filaments that are intended (or at least able) be scaled up for (very) large print jobs. </p>
<p>Since most hobby printers can take hundreds of hours for something tha... | <p>One big challenge with scaling anything up (or down), is that not all properties or characteristics scale linearly.</p>
<p>Consider a trivial case: a small cube. If you double the size, you've quadrupled the surface area and octupled the weight.</p>
<p>If you take a desktop-sized 3d printer design, and just double... | <p>As far as I know, right now, all the "3D printers" that can print houses, bridges, etc. are experimental models (and sometimes, vey elaborate art projects) - they just don't exist except as one-off creations designed as a proof-of-concept showing this can be done.</p>
<p>Maybe some of those project published their ... | 200 |
<p>I had this idea for bulky parts for just printing the shell (PLA) then pouring in some kind of filler in to make up the bulk/strength.</p>
<p>Printing bulk .2mm at a time line by line is slow and subject to warping!</p>
<p>So I though precision print a shell and fill it with 'something' - has this been done by any... | <p>I've looked into doing something similar to this before and love the idea, never had the chance to follow through on it yet. This is sort of a hybrid method between cast molding and 3D printing. </p>
<p>The accepted answer to a question I had a while back had some very good points by fred_dot_u</p>
<p><a href="ht... | <p>Not exactly the same, but MakerBot Industries is making improvements to their programs by allowing users to do away with standard infill practices (patterned infill). Their approach is to treat infill similarly to how they treat outer support structures, the "infill" only exists in the interest of supporting roofs.<... | 573 |
<p>Currently I know of only two ways to cache data (I use PHP but I assume that the same will apply to most languages).</p>
<ol>
<li>Save the cache to a file</li>
<li>Save the cache to a large DB field</li>
</ol>
<p>Are there any other (perhaps better) ways of caching or is it really just this simple?</p>
| <p>Maybe you want to explicit more precisely what you want to cache. You have all this opportunities to cache: </p>
<ul>
<li><b>Accessing the Data Base</b> where you cache the data first correctly tuning your RDBMS, then using a layer to delegate the decision to detect multiple queries for the same data (with <a href=... | <p>Seconding memcached, does the simple stuff well and can go distributive and all that jazz if you need it too</p>
| 2,608 |
<p>Why prefer composition over inheritance? What trade-offs are there for each approach? When should you choose inheritance over composition?</p>
| <p><em>Prefer composition over inheritance as it is more malleable / easy to modify later, but do not use a compose-always approach.</em> With composition, it's easy to change behavior on the fly with Dependency Injection / Setters. Inheritance is more rigid as most languages do not allow you to derive from more than o... | <p>What do you want to force yourself (or another programmer) to adhere to and when do you want to allow yourself (or another programmer) more freedom. It has been argued that inheritance is helpful when you want to force someone into a way of dealing with/solving a particular problem so they can't head off in the wron... | 7,143 |
<p>Here is one trivial question, that I am not sure how to handle.
I need to display list of categories on every page, and to be able to choose items from a specific category to be displayed. I use asp.net MVC, and have chosen to create a user control that will display categories. My question is: what is the best appro... | <p>I'm using mvc components, which replaced ascx user controls in preview 4.<br>
Example:
<a href="http://blog.wekeroad.com/blog/asp-net-mvc-preview-4-componentcontroller-is-now-renderaction/" rel="nofollow noreferrer">http://blog.wekeroad.com/blog/asp-net-mvc-preview-4-componentcontroller-is-now-renderaction/</a><br>
... | <p>it is the mvc futures project. i will probably try this
<a href="http://forums.asp.net/t/1303328.aspx" rel="nofollow noreferrer">http://forums.asp.net/t/1303328.aspx</a>. I need to render menu with categories.</p>
| 3,449 |
<p>Help! I have an Axis web service that is being consumed by a C# application. Everything works great, except that arrays of long values always come across as [0,0,0,0] - the right length, but the values aren't deserialized. I have tried with other primitives (ints, doubles) and the same thing happens. What do I d... | <p>Here's what I ended up with. I have never found another solution out there for this, so if you have something better, by all means, contribute.</p>
<p>First, the long array definition in the wsdl:types area:</p>
<pre><code> <xsd:complexType name="ArrayOf_xsd_long">
<xsd:complexContent mixed="false"&... | <p>Found this link that may offer a better alternative: <a href="http://www.tomergabel.com/GettingWCFAndApacheAxisToBeFriendly.aspx" rel="nofollow noreferrer">http://www.tomergabel.com/GettingWCFAndApacheAxisToBeFriendly.aspx</a></p>
| 5,005 |
<p>I have a bunch of latitude/longitude pairs that map to known x/y coordinates on a (geographically distorted) map.</p>
<p>Then I have one more latitude/longitude pair. I want to plot it on the map as best is possible. How do I go about doing this?</p>
<p>At first I decided to create a system of linear equations for... | <p>Are there any more specific details on the kind of distortion? If, for example, your latitudes and longitudes are "distorted" onto your 2D map using a Mercator projection, the conversion math is <a href="http://www.wikipedia.org/wiki/Mercator_projection" rel="noreferrer">readily available</a>.</p>
<p>If the map is... | <p>the problem is that the sphere can be distorted a number of ways, and having all those points known on the equator, lets say, wont help you map points further away.</p>
<p>You need better 'close' points, then you can assume these three points are on a plane with the fourth and do the interpolation --knowing that th... | 2,415 |
<p>Whenever it start printing the extruder starts clicking, I tried adjusting the voltage with no luck, it's still clicking. And it doesn't extrude a lot of plastic sometimes it even stops extruding but the extruder is still turning. Can someone help?</p>
| <p>The clicking you are hearing is either the stepper motor skipping steps or the hobbed gear losing grip on the filament.</p>
<p>Either way, it means that the filament opposes an unusually high resistence to be pushed forward.</p>
<p>A key information to be able to diagnose your problem is whether the clicking is on... | <p>I have an X5S and quite frankly, I never got it print properly because of these persistent issues. Thank you for the most excellent comments and suggestions. Lots to investigate.</p>
<p>I added an anycubic glass table but that takes longer to heat up. But i am unable to get adhesion on the first layers and the clic... | 857 |
<p>I already tried a lot settings in Cura and try to search for a solution but without success. Maybe someone got this issue and solved it.</p>
<p>I want to prevent Cura from printing such gaps at the wings to make it in one run. With ironing one run would (hopefully) bring better results. See the animation for what I ... | <p>That depends very much on what your goal is with the box. If it needs to be hollow and you don't need any access to the inside (and also prefer it to be printed in one piece) than the answer provided by user77232 would probably be the best.</p>
<p>Alternatively, if you need access to the inside of the box you would ... | <ol>
<li>Print it as a whole object</li>
<li>Use 20% infill.</li>
<li>Profit!</li>
</ol>
| 1,740 |
<p>I've been using PHP & MySQL for ages and am about to start using PostgreSQL instead.</p>
<p>What's the preferred method? </p>
<p>Is it via the PDO objects or is there something better?</p>
| <p>PDO objects are the new hotness. I'd recommend that as long as you can ensure that your target platform will always be running PHP 5.2+.</p>
<p>There are many other database abstraction layers that support PostgreSQL that are compatible with older versions of PHP; I'd recommend <a href="http://adodb.sourceforge.ne... | <p>I would also suggest creating an inherited PDO class or a wrapper class if you decide not to use PDO. This would provide you with a lot more flexibility in the future. ie. Calculating query execution time.</p>
| 3,173 |
<p>We are trying to create a web-service that we plan to pass a variable amount of variables to it.</p>
<p>Can this be done?</p>
<p>Basically instead of pass all possible parameters we wish to pass only the set values and use the defaults set in the web-service.</p>
<p>Here is an example of the XML we are looking to... | <p>I would pass in an xml document instead of doing concreate functions for this. </p>
<p>The webservice in your example is leaky - the consumer needs to know too much about this interface and the implementation of the webservice internally. </p>
<p>XML Document and then tie that with an XSD. That way you can preva... | <p>You can simply pass a variable-length array as a parameter.</p>
| 5,431 |
<p>I made a few successful prints since I got my CR-10 two weeks ago and I didn't run into any major trouble. The printer is new.</p>
<p>Today I set it to "preheat" mode while I was preparing the SD card with the settings being 210°C for the nozzle and 60°C for the bed. When I wanted to start the print I noticed that ... | <p>This is not an easy one to solve, the firmware of the printer should be keeping the printer at a certain temperature depending on the temperature setting and the current value. If the firmware is not able to keep the temperature at the requested level, but goes beyond that level, that could be considered "strange". ... | <p>A similar condition occurred in my 3D printer. I solved the same. I checked all my connection and I came to know that I connected the thermistor of the extruder in the wrong port. So just check the connection of your thermistor.</p>
<hr>
<p>Actually my 3D printer circuit board frequently failed because of over cur... | 968 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.