instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>One of the joys of working for a government healthcare agency is having to deal with all of the paranoia around dealing with PHI (Protected Health Information). Don't get me wrong, I'm all for doing everything possible to protect people's personal information (health, financial, surfing habits, etc.), but sometimes ... | <p>I'm not sure if it'll work in all browsers but you should try setting autocomplete="off" on the form.</p>
<pre><code><form id="loginForm" action="login.cgi" method="post" autocomplete="off">
</code></pre>
<blockquote>
<p>The easiest and simplest way to disable ... | <blockquote>
<p>Is there a way for a site to tell the browser not to offer to remember passwords?</p>
</blockquote>
<p>The website tells the browser that it is a password by using <code><input type="password"></code>. So if you <em>must</em> do this from a website perspective then you would have to change tha... | 5,229 |
<p>LINQ simplifies database programming no doubt, but does it have a downside? Inline SQL requires one to communicate with the database in a certain way that opens the database to injections. Inline SQL must also be syntax-checked, have a plan built, and then executed, which takes precious cycles. Stored procedures ... | <p>LINQ to SQL actually presents some alarming performance problems in the database. Basically, it creates multiple execution plans based on the length of the parameter you are using. I posted about it a while back on my blog <a href="http://facility9.com/2008/08/28/linq-to-sql-may-cause-performance-problems/" rel="n... | <p>It depends on what you're doing. LINQ is going to be less efficient at the actual data/set manipulation than a real database. But you'll save a lot in not having to connect to the database over a network.</p>
<p>If your database is on the same machine or is formally 'well-connected', you're probably better off us... | 9,778 |
<p>I am working on a project management web application. The user has a variety of ways to display a list of tasks. When viewing a list page, they click on task and are redirected to the task edit page. </p>
<p>Since they are coming from a variety of ways, I am just curious as to the <strong>best</strong> way to <s... | <p>I would store the referring URL using the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.control.viewstate.aspx" rel="noreferrer">ViewState</a>. Storing this outside the scope of the page (i.e. in the Session state or cookie) may cause problems if more than one browser window is open.</p>
<p>The exa... | <p>I personally would store the required redirection info in an object and handle globally. I would avoid using a QueryString param or the like since they could try bouncing themselves back to a page they are not supposed to (possible security issue?). You could then create a static method to handle the redirection obj... | 5,734 |
<p>I have lots of article store in MS SQL server 2005 database in a table called Articles-</p>
<pre><code>"Articles (ArticleID, ArticleTitle, ArticleContent)"
</code></pre>
<p>Now I want some SP or SQL query which could return me similar Article against any user's input (very much like "Similar Posts" in blogs OR "Re... | <p>Something like this might work, a kind of ranking system. You would probably have to split the string in your application to build a SQL string, but I have used similar to build an effective site search.</p>
<pre><code>Select
Top 10
ArticleID,
ArticleTitle,
ArticleContent
From
Articles
Order By
(Case When ArticleTi... | <p>First of all you need to define what article similarity means.<br>
For example you can associate some meta information with articles, like tags.<br>
To be able to find similar articles you need to extract some features from them, for example you can build full text index.</p>
<p>You can take advantage of full text ... | 6,029 |
<p>I'm trying to parse an INI file using C++. Any tips on what is the best way to achieve this? Should I use the Windows API tools for INI file processing (with which I am totally unfamiliar), an open-source solution or attempt to parse it manually?</p>
| <p>You can use the Windows API functions, such as <a href="https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getprivateprofilestring" rel="noreferrer">GetPrivateProfileString()</a> and <a href="https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getprivateprofileint" rel="norefer... | <p>Maybe a late answer..But, worth knowing options..If you need a cross-platform solution , definitely you can try GLIB,, its interesting.. (<a href="https://developer.gnome.org/glib/stable/glib-Key-value-file-parser.html" rel="nofollow">https://developer.gnome.org/glib/stable/glib-Key-value-file-parser.html</a>)</p>
| 3,370 |
<p>Is there a way to tell subversion "update/merge unless it would cause a conflict"?</p>
<p>I know you can use <code>--dry-run</code> / <code>status -u</code> to check before running the update, but I often have others running updates and getting broken webpages because they don't notice the "C index.php" line.</p>... | <p>You can use the --accept parameter to indicate what should happen when a conflict occurs:</p>
<pre><code>--accept ARG : specify automatic conflict resolution action
('postpone', 'base', 'mine-full', 'theirs-full',
'edit', 'launch')
</code></pre>
<p>Se... | <p>you could also use a pre-commit script to look for conflict markers in files and prevent commit when they are present.</p>
| 5,353 |
<p>I am performing a find and replace on the line feed character (<code>&#10;</code>) and replacing it with the paragraph close and paragraph open tags using the following code:</p>
<pre><code><xsl:template match="/STORIES/STORY">
<component>
<xsl:if test="boolean(ARTICLEBODY)">
... | <p><code>disable-output-escaping</code> isn't evil in itself, but there are only few cases where you should use it and this isn't one of them. In XSLT you work with trees, not markup string. Here's an XSTL 1.0 solution:</p>
<pre><code><xsl:template match="/STORIES/STORY">
<component>
<xsl:if test=... | <p>Given the XPath functions that you're calling which I don't remember having the luxury of in my MSXSL work, it looks like you're using an XPath 2-compatible processor. </p>
<p>If that's the case, doesn't XPath 2 have a replace(string, pattern, replacement) function that takes a regex as a second parameter? </p>
<... | 5,130 |
<p>How can I set the cookies in my <code>PHP apps</code> as <code>HttpOnly cookies</code>?</p>
| <ul>
<li>For <strong>your cookies</strong>, see this answer.</li>
<li>For <strong>PHP's own session cookie</strong> (<code>PHPSESSID</code>, by default), see <a href="https://stackoverflow.com/a/8726269/1820">@richie's answer</a></li>
</ul>
<p>The <a href="http://php.net/manual/en/function.setcookie.php" rel="noreferre... | <p>A more elegant solution since <strong>PHP >=7.0</strong> </p>
<pre><code>session_start(['cookie_lifetime' => 43200,'cookie_secure' => true,'cookie_httponly' => true]);
</code></pre>
<p><a href="https://www.php.net/manual/en/function.session-start.php" rel="nofollow noreferrer">session_start</a></p>
<p><a... | 5,747 |
<p>I assumed there were only bug fixes/(no new types) in .NET 2.0 SP1 until I came across <a href="http://davesbox.com/archive/2008/08/25/new-for-visual-studio-2008-sp1-and-fxcop-1-36-multi-targeting-rule.aspx" rel="nofollow noreferrer">few</a> posts which were mentioning <a href="http://msdn.microsoft.com/en-us/librar... | <p>Here's what you're looking for:</p>
<p><img src="https://i.stack.imgur.com/abAMI.gif" alt="alt text"></p>
<p>Full Article: <a href="http://www.hanselman.com/blog/CatchingRedBitsDifferencesInNET20AndNET20SP1.aspx" rel="nofollow noreferrer">http://www.hanselman.com/blog/CatchingRedBitsDifferencesInNET20AndNET20SP1.a... | <p>DateTimeOffset was added to 2.0 SP1 - I'm not aware of any other new types.</p>
<p>Given the coincidental timing, it's perhaps worth reminding people that 2.0 SP1 shipped with 3.5 RTM (i.e November 2007) and 2.0 SP2 shipped with 3.5 SP1.</p>
| 6,256 |
<p>When I'm initializing a dialog, I'd like to select one of the radio buttons on the form. I don't see a way to associate a Control variable using the Class Wizard, like you would typically do with CButtons, CComboBoxes, etc...</p>
<p>Further, it doesn't like a CRadioButton class even exists.</p>
<p>How can I selec... | <p>Radio buttons and check buttons are just buttons. Use a <code>CButton</code> control and use <code>GetCheck</code>/<code>SetCheck</code>.</p>
| <pre><code>void CMyDlg::DoDataExchange(CDataExchange* pDX)
{
...
DDX_Radio(pDX, IDC_RADIO1, m_Radio);
...
}
</code></pre>
<p>but it is the same thing Wizard generates</p>
| 9,919 |
<p>High performance polymers are becoming available for specific applications.</p>
<p>One of such materials is PEEK (<a href="https://en.wikipedia.org/wiki/Polyether_ether_ketone" rel="noreferrer">PolyEther Ether Ketone</a>), a thermoplastic polymer in the polyaryletherketone (PAEK) family. PEEK competes with certain ... | <p>My assumptions about PEEK filament price are:</p>
<ul>
<li>Raw material is more expensive. Compare price of <a href="https://www.alibaba.com/showroom/abs-pellet.html" rel="noreferrer">ABS</a> with <a href="https://www.alibaba.com/showroom/peek-pellet.html" rel="noreferrer">PEEK</a> pellets.</li>
<li>Demand is much ... | <p><strong>Patents</strong> still seem to play a role as well.</p>
<p>I was curious about this question and did a bit of research: If you filter the <a href="https://patents.google.com/?q=%22Polyether%20ether%20ketone%22&country=US&after=priority:20100101" rel="noreferrer">U.S. patents after 2010 mentioning PE... | 979 |
<p>Let's say the first N integers divisible by 3 starting with 9.</p>
<p>I'm sure there is some one line solution using lambdas, I just don't know it that area of the language well enough yet.</p>
| <p>Just to be different (and to avoid using a where statement) you could also do:</p>
<pre><code>var numbers = Enumerable.Range(0, n).Select(i => i * 3 + 9);
</code></pre>
<p><strong>Update</strong> This also has the benefit of not running out of numbers.</p>
| <p>I can't say this is any good, I'm not a C# expert and I just whacked it out, but I think it's probably a canonical example of the use of <code>yield</code>.</p>
<pre><code>internal IEnumerable Answer(N)
{
int n=0;
int i=9;
while (true)
{
if (i % 3 == 0)
{
n++;
yield return i;
}
... | 9,302 |
<p>I am using python 3.6 with pySerial library to connect to the Hyrel System 30M 3D Printer. I am able to read the data from the device but unable to write any commands to it</p>
<p>Here is the code:</p>
<pre><code> ser = serial.Serial()
ser.port = 'COM4'
ser.baudrate = 38400
out = ser.readline()
... | <p>If the one in your question is your <em>complete</em> code, a possibility is that your computer is just buffering the output for the serial port, withholding it in memory. Try to add</p>
<pre><code>ser.flush()
</code></pre>
<p>after your last line. This command will... well... <em>flush</em> anything into the bu... | <p>Sorry for the late answer, but with Repetrel v3 and later, we have the option for you to configure a secondary COM port, and relay G- or M-Code commands from your other source through the Repetrel software to the printer. Please contact us for assistance.</p>
<p>Note: I work for Hyrel 3D.</p>
| 801 |
<p>My question is...
Is there a SIMPLE/easy way to load TPU without tearing my printer apart to insert a hose that probably wont work anyways. It keeps curling up by the cog. I have read a few topics in other places but I didn't like the answers. Hoping you all might have a simple fix. </p>
| <p>Loading TPU/TPE can be particularly challenging because many printer loading scripts run too fast for the soft flexible filament to effectively purge whatever normal filament you were using before. A couple tips:</p>
<ul>
<li>Load with a slightly higher temp than either the TPU or previous filament require, so as t... | <p>I've noticed that the first layer seems more prone to wrapping flexible filament around the drive, particularly if the nozzle is a bit on the low side. The extra extrusion force required to push the filament against the resistance of the bed means that the filament can't sustain enough pressure without folding. </p>... | 347 |
<p>Have people been using 3D printing to genuinely create a number of needed objects in their homes, and if so, what? Or is 3D printing better for special niche interests like art projects, home engineering projects, etc?</p>
| <p>Both.</p>
<p>3D printing is especially useful for creating replacement parts for things for which it would otherwise be difficult, expensive, or impossible to obtain a conventionally manufactured one. You may have seen in the news recently the <a href="https://www.bbc.com/news/technology-51911070" rel="nofollow nor... | <p>Both.</p>
<p>3D printing is especially useful for creating replacement parts for things for which it would otherwise be difficult, expensive, or impossible to obtain a conventionally manufactured one. You may have seen in the news recently the <a href="https://www.bbc.com/news/technology-51911070" rel="nofollow nor... | 1,614 |
<p>I'm just looking for a simple, concise explanation of the difference between these two. MSDN doesn't go into a hell of a lot of detail here.</p>
| <ul>
<li><p><code>__declspec(dllexport)</code> tells the linker that you want this object to be made available for other DLL's to import. It is used when creating a DLL that others can link to.</p></li>
<li><p><code>__declspec(dllimport)</code> imports the implementation from a DLL so your application can use it.</p></... | <p>Dllexport is used to mark a function as exported. You implement the function in your DLL and export it so it becomes available to anyone using your DLL.</p>
<p>Dllimport is the opposite: it marks a function as being imported from a DLL. In this case you only declare the function's signature and link your code with ... | 8,244 |
<p>I've updated my Ender 3 with V4.2.7 mainboard, BLTouch and 400XL kit (extends the capabilities of your Creality Ender 3 3D Printer to a 400 mm X, 400 mm Y and a 500 mm Z printing platform). Now I need to update the firmware. YouTube did not provide any help: i.e.: out of date, so cryptic as to be unusable. Marlin &a... | <p>Without knowing exactly which Youtube videos you've looked at, I think where I would start is by downloading the latest Marlin Fimrware and configuration files for the Ender 3 with 4.2.7 board:</p>
<p><a href="https://github.com/MarlinFirmware/Marlin/archive/2.0.x.zip" rel="nofollow noreferrer">Latest Release of Mar... | <p>I've done the board upgrade on my Ender 3 Pro. As I've read the BLTouch is easy to install. I'd go over to the Creality <a href="https://forums.creality3dofficial.com/" rel="nofollow noreferrer">forum/help</a> site. You can open a support ticket. They actively have information on firmware in both "release"... | 1,901 |
<p>I know this is a broad question, but I've inherited several poor performers and need to optimize them badly. I was wondering what are the most common steps involved to optimize. So, what steps do some of you guys take when faced with the same situation?</p>
<blockquote>
<p>Related Question:<br>
<a href="https:/... | <ol>
<li>Look at the execution plan in query analyzer</li>
<li>See what step costs the most</li>
<li>Optimize the step!</li>
<li>Return to step 1 [thx to <strong>Vinko</strong>]</li>
</ol>
| <p>Look at the indexes on the tables that make the query. An indexes may be needed on particular fields that participate in the where clause. Also look at the fields used in the joins in the query (if joins exist). If indexes already exist, look at the type of index. </p>
<p>Failing that (because there are negativ... | 8,612 |
<p>A while ago bought a Bowden extruder to replace the old built-in one (It was malfunctioning or something that I cannot remember well). This one in particular has been acquired:</p>
<p><a href="https://i.stack.imgur.com/LF28s.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LF28s.jpg" alt="The extr... | <p>As long as there is no more information about the printer itself (I searched a bit and around half of buyers were severely unhappy with the result), I'd advise you to make a full check of all of the important parts that make up a 3D printer making ok prints:</p>
<ul>
<li>Are motors moving as they should?</li>
<li>I... | <p>If you converted a printer from direct to Bowden feed, it is possible that the cold side of the hot end is too hot, and you are suffering from heat creap. Simple, less expensive printers often use the extruder stepper and the extruder stepper mount as part of the cooling system.</p>
<p>If there is any sort of a he... | 1,119 |
<p>My <code>master</code> and <code>development</code> branches are tracked remotely on <a href="http://en.wikipedia.org/wiki/GitHub" rel="noreferrer">GitHub</a>. How do I clone both these branches?</p>
| <p>First, clone a remote <a href="http://en.wikipedia.org/wiki/Git_%28software%29" rel="noreferrer">Git</a> repository and <a href="http://en.wikipedia.org/wiki/Cd_%28command%29" rel="noreferrer"><code>cd</code></a> into it:</p>
<pre><code>$ git clone git://example.com/myproject
$ cd myproject
</code></pre>
<p>Next, lo... | <p>If you use Bitbucket, you can use <strong>import Repository</strong>. This will import all Git history (all the branches and commits).</p>
| 9,325 |
<p>I'm writing a web service, and I want to return the data as XHTML. Because it's data, not markup, I want to keep it very clean - no extra <code><div></code>s or <code><span></code>s. However, as a convenience to developers, I'd also like to make the returned data reasonably readable in a browser. To do s... | <p>It'd be best to wrap all of your elements in label elements, then apply css to the labels. The :before and :after pseudo classes are not completely supported in a consistent way.</p>
<p>Label tags have a lot of advantages including increased accessibility (on multiple levels) and more.</p>
<pre><code><label>... | <p>Use javascript. If you're using the jQuery library, try something like this:</p>
<pre><code>$("input.a").after("<br/>")
</code></pre>
<p>Or whatever you need.</p>
| 9,150 |
<p>What, if any, considerations (HTML, CSS, JavaScript) should you take when designing for Google Chrome? </p>
| <p>Chrome uses Webkit, the same engine as is used by Safari, OmniWeb, iCab and more. Just code everything based on the standards and verify in each browser.</p>
| <p>Are you designing specifically <em>for</em> Chrome, or do you want to make sure your pages work well with Chrome?</p>
<p>Assuming it's the latter, then just use the same design considerations you'd do for any browser. If applicable, keep in mind that many phones and video game consoles have web browsers now.</p>
<... | 6,785 |
<p>I'm looking for a Java profiler that works well with the JVM coming with WebSphere 6.0.2 (IBM JVM 1.4.2). I use yourkit for my usual profiling needs, but it specifically refuses to work with this old jvm (I'm sure the authors had their reasons...).</p>
<p>Can anybody point to a decent profiler that can do the job? ... | <p>Update: I found out that <a href="http://www.ej-technologies.com/products/jprofiler/overview.html" rel="nofollow noreferrer">JProfiler</a> integrates smoothly with WAS 6.0.2 (IBM JDK 1.4). </p>
| <p>What are you looking to profile? Is it stuff in the JVM or the App Server? If it's the latter, there's loads of stuff in WAS 6 GUI to help with this. Assuming you really want to see stuff like the heap etc, then the IBM <a href="http://alphaworks.ibm.com/tech/heapanalyzer" rel="nofollow noreferrer">HeapAnalyzer</a... | 8,711 |
<p>Sometimes I use a DIY 3D printer running Marlin firmware and I have a hard time to set my heat bed temperature. when I set it to 70 °C for PLA, after a few minutes it decreases to 67 °C and I see these error:</p>
<pre><code>READ: Error:Thermal Runaway, system stopped! Heater_ID: bed
READ: Error:Pr... | <p>I had a similar issue when printing with ABS, because my print cooling fan only activated once it got to a certain height above the bed. I'd say you need to do a PID tuning session, insulate the bottom of the bed better, and see if you can make sure your cooling fan doesn't blow air over the bed itself.</p>
| <p>I had a similar issue when printing with ABS, because my print cooling fan only activated once it got to a certain height above the bed. I'd say you need to do a PID tuning session, insulate the bottom of the bed better, and see if you can make sure your cooling fan doesn't blow air over the bed itself.</p>
| 1,305 |
<p>Does anyone know of an easy way to escape HTML from strings in <a href="http://jquery.com/" rel="noreferrer">jQuery</a>? I need to be able to pass an arbitrary string and have it properly escaped for display in an HTML page (preventing JavaScript/HTML injection attacks). I'm sure it's possible to extend jQuery to ... | <p>Since you're using <a href="https://jquery.com/" rel="noreferrer">jQuery</a>, you can just set the element's <a href="http://api.jquery.com/text/" rel="noreferrer"><code>text</code></a> property:</p>
<pre><code>// before:
// <div class="someClass">text</div>
var someHtmlString = "<script>alert('hi... | <p><a href="https://stackoverflow.com/a/10825766/819417">This answer</a> provides the jQuery and normal JS methods, but this is shortest without using the DOM:</p>
<pre><code>unescape(escape("It's > 20% less complicated this way."))
</code></pre>
<p>Escaped string: <code>It%27s%20%3E%2020%25%20less%20complicated%2... | 4,445 |
<p>For example; with the old command prompt it would be:</p>
<pre><code>cmd.exe /k mybatchfile.bat
</code></pre>
| <p>Drop into a cmd instance (or indeed PowerShell itself) and type this:</p>
<pre><code>powershell -?
</code></pre>
<p>You'll see that powershell.exe has a "-noexit" parameter which tells it not to exit after executing a "startup command".</p>
| <p>I am sure that you already figure this out but I just post it</p>
<pre><code>$CreateDate = (Get-Date -format 'yyyy-MM-dd hh-mm-ss')
$RemoteServerName ="server name"
$process = [WMICLASS]"\\$RemoteServerName\ROOT\CIMV2:win32_process"
$result = $process.Create("C:\path to a script\test.bat")
$result | out-file -f... | 3,507 |
<p>It's pretty manageable right now due to the low question rate, but I think maybe ~3% of all questions this site will get, forever, will be "what's the best printer" or "what printer should I buy" type questions. They're mostly coming from people who don't know enough about 3DP to articulate their requirements, so th... | <p>A good option would be to have several reference questions, such as "What to look for when comparing printers?" or "How to select a 3D printer?" to which we could redirect these users.</p>
| <p>I face this question very very frequently. On 3d printing and 3d printing hobbyists facebook group we can see this daily. </p>
<p>The ideas of giving people a catch all set of questions is nice.. That is exactly what I did 6 months ago. I put it in the group rules and did everything I could to get people to read it... | 31 |
<p>I'm working on a project with will be buried in soil. It's an enclosure for a sensor that will be potted inside the 3D printed part. What filament will give me the longest life in soil? </p>
<p>ETA: burial will be permanent, and I'd like it to last at least five years.</p>
<p>ETA: The printed part will provide mec... | <p>I would recommend PETG - only because it is structurally similar to the plastic used in the bottles that last forever, and most PETG is food grade - implying that its chemical stability should be reasonably good...</p>
| <p>If TPU ends up not being rigid enough for you:
I've had good enough luck with ABS coated in automotive RTV.</p>
<p>Thing with ABS though is that it's a special (not so)"solid" that gets softer as it gets hotter. My use had water in it when warm so wasn't too much of an issue, and it never experienced freezing temp... | 1,649 |
<p>Long story short, my wife and I are now the proud owners of an AnyCubic D, also known as the Predator. This is not our first 3D printer, but it is our first "delta" design, with the circular build plate and the extruder suspended by stepper-controlled tie rods (as opposed to the IMO more intuitive Cartesian designs ... | <p>I recently corrected a similar problem on a Robo3D R1+ printer. It is described as the z-offset setting.</p>
<p>An entry in the <a href="https://www.thingiverse.com/groups/anycubic-predator/forums/bigtreetech-skr-v13-tmc2280-swap/topic:41518" rel="nofollow noreferrer">Thingiverse forum</a> appears to reference this... | <p>The owners manual tells how to micro adjust the z while it is printing the 1st layer. See page 23. I did this and it works perfectly.</p>
| 1,553 |
<p>I know in JavaScript, <em>objects</em> double as hashes, but I have been unable to find a built-in function to get the keys:</p>
<pre><code>var h = {a:'b', c:'d'};
</code></pre>
<p>I want something like</p>
<pre><code>var k = h.keys() ; // k = ['a', 'c'];
</code></pre>
<p>It is simple to write a function myself to i... | <p>There is function in modern JavaScript (ECMAScript 5) called <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys" rel="noreferrer"><code>Object.keys</code></a> performing this operation:</p>
<pre><code>var obj = { "a" : 1, "b" : 2, "c" : 3};
alert(Object.keys(obj)); // will out... | <p>If you are trying to get the elements only, but not the functions then this code can help you:</p>
<pre><code>this.getKeys = function() {
var keys = new Array();
for (var key in this) {
if (typeof this[key] !== 'function') {
keys.push(key);
}
}
return keys;
}
</code></p... | 3,941 |
<p>Most of my C/C++ development involves monolithic module files and absolutely no classes whatsoever, so usually when I need to make a <strong>DLL</strong> with accessible functions I just export them using the standard <code>__declspec(dllexport)</code> directive. Then access them either dynamically via <code>LoadLi... | <blockquote>
<p>What about late-binding? As in loading
it with LoadLibrary() and
GetProcAddress() ? I'm used being able
to load the library at run time and it
would be great if you could do that
here.</p>
</blockquote>
<p>So there are two ways to load the DLL. The first is to reference one or more symbols ... | <p>If you're willing to put a vtable in the class you're exporting, you can export a function that returns an interface and implement the class in the .dll, then put that in the .def file. You might have to do some declaration trickery, but it shouldn't be too hard.</p>
<p>Just like COM. :)</p>
| 4,766 |
<p>I have an old Solidoodle 2 that I bought broken from a garage sale that I am converting to use RAMPS 1.4 with Marlin Firmware. All the motors work correctly, I am just having issues getting the endstops to work.<br><br> </p>
<p>I am using a regular limit switch with NC going to the signal pin and the other to groun... | <p>try uncommenting the following lines to enable endstop detection on all pins for troubleshooting.</p>
<pre><code>//#define USE_XMAX_PLUG false
//#define USE_YMAX_PLUG false
//#define USE_ZMAX_PLUG false
</code></pre>
<p>This way the M119 will show any changes.</p>
<p>The only thing I can think of is that either t... | <p>Yesterday I has same error with board MKS Robin Nano with Marlin 2.0.6.</p>
<p>Try to find and uncomment this definition:</p>
<pre><code>#define ENDSTOP_INTERRUPTS_FEATURE
</code></pre>
<p>Failure was in disabled endstop interrupts and broken part of code, which going to home and unchecks endstop status between step... | 418 |
<p>Using cyanoacrylate to glue PLA parts sometimes leaves a white residue or haze near the glue locations. Is there an easy way to remove it?</p>
<p>I've tried water and alcohol swabs but after drying the haze remains.</p>
<p><a href="https://i.stack.imgur.com/cw1pu.jpg" rel="nofollow noreferrer" title="Photo showing ... | <h2>Make sure to set the scale properly for your use case!</h2>
<p>In CAD, you define your measurement space in either Inch or in Millimeter units, and that is your grid. In blender, the native unit is the meter.</p>
<p>This can be easily converted in exporting (remember to set it to scale!), but it is best to just set... | <p>It doesn't matter, you scale it in the slicer or elsewhere. You're not going to slice the STL file in Blender. You'll probably need to do more work to get things print ready outside blender anyway.</p>
<p>So when I use blender I don't even bother checking what units it's using. I don't use it for parts design or tec... | 2,123 |
<p>I'm a firm believer of the heretic thought of tight coupling between the backend and frontend: I want existing, implied knowledge about a backend to be automatically made use of when generating user interfaces. E.g., if a VARCHAR column has a maximum with of 20 characters, there GUIs should automatically constrain t... | <p>web2py does most of what you ask:</p>
<p>Based on a field type and its validators it will render the field with the appropriate widget. You can override with</p>
<pre><code>db.table.field.widget=...
</code></pre>
<p>and use a third party widget.</p>
<p>web2py has js to blocks the user from entering a non-integer... | <p>I believe that Django models does not support composite primary keys (see <a href="http://docs.djangoproject.com/en/dev/topics/db/models/#automatic-primary-key-fields" rel="nofollow noreferrer">documentation</a>). But perhaps you can use SQLAlchemy in Django? A <a href="http://www.google.com/search?q=sqlalchemy+djan... | 6,498 |
<p><em><strong>TL;DR</strong> - Please help me rebuild my CR-6 SE so that I can move on</em></p>
<hr />
<p>Here's a link to the latest issue that I had to make proof of in a video: <a href="https://youtu.be/9vChL7Il_9Y" rel="nofollow noreferrer">CR6-SE failed</a></p>
<p>Basically, it's failing to reach/maintain tempera... | <p>70 °C is a specialty filament. It is well below the <code>MIN_TEMP</code> defined in any sane firmware. In Marlin, you <strong>can't</strong> turn on the extruder in any way, while this is online.</p>
<p>You do need to define your firmware to allow such a print - either by dropping the value in the firmware or disab... | <p>In Cura Machine Settings, add <code>M302 S70</code>.</p>
<p>Apparently, <code>M302 P1</code> and <code>M302 S0</code> do nothing, you need to define a non-zero minimum, and in my case, 70. Thanks to 0scar and Trish for your help.</p>
| 1,850 |
<p>How can I show a grey transparent overlay in C#?<br>
It should overlay other process which are not owned by the application doing the overlay.</p>
| <p>Ah. Found a comment on php.net that reminded me of the answer; you need to wildcard your value before the bindParam is evaluated, and not worry about quoting it. So for example this works fine:</p>
<pre><code>$str = "%$str%";
$query = $db->prepare("select * from comments where comment like :search");
$query->... | <p>5 years later, in case anyone else stumbles upon this, there is an alternative method I've discovered. The accepted solution wasn't really feasible for my situation, but this method seems to get the job done as well:</p>
<pre><code>$query = $db->prepare("select * FROM table WHERE field LIKE CONCAT('%',:search,'%... | 8,580 |
<p>Can ANTLR output C# using StringTemplate or any text I want it to like Yacc/Bison or does it only output to java? From the examples I've looked at it appears to be a very java centric tool.</p>
| <p>The ANTLR IDE has option by which you can switch between Java and C# code generation.</p>
<p>Better, consult this article (the Specifying Code Generation section):</p>
<p><a href="http://www.antlr2.org/doc/csharp-runtime.html" rel="nofollow noreferrer">http://www.antlr2.org/doc/csharp-runtime.html</a></p>
| <p>You can download the latest source code as a tar file from <a href="http://antlr.org/download/antlr-3.0.1.tar.gz" rel="nofollow noreferrer">here</a>. The C# runtime (binary) is also available directly, <a href="http://antlr.org/download/DOT-NET-runtime.zip" rel="nofollow noreferrer">here</a>.</p>
<p>Which solution... | 9,204 |
<p>I've been printing small quantities from a PLA filament spool on a Craftbot printer for about two months now. Recently the printed objects have been coming out very brittle. Some structures that printed fine two months ago are now difficult to re-print. The print head gets clogged easily, and when the object does... | <p>Increase nozzle temperature. When the filament is new it will print easier, requiring less heat to print well. So if you didn't store your filament properly to begin with, increasing print temperature will make it jam less and increase layer bonding. </p>
<p>The reason for this is because the moisture that accumula... | <p>PLA absorbs moisture, so keeping the filament dry is a key factor. Aside from that, PLA is naturally more brittle than other plastics like ABS and Nylon Sorry, tried to find a graph to prove it, but couldn't find one.</p>
<p>There's a good <a href="https://groups.google.com/forum/#!topic/makerbot/Rdx2ZnJeQzs">Googl... | 325 |
<p>Over at <a href="https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion">Can you modify text files when committing to subversion?</a> <a href="https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666">Grant</a> suggested that I... | <p><strong><a href="https://stackoverflow.com/questions/38746/how-to-detect-file-ends-in-newline#39185">@Konrad</a></strong>: tail does not return an empty line. I made a file that has some text that doesn't end in newline and a file that does. Here is the output from tail:</p>
<pre class="lang-none prettyprint-overrid... | <p>The <code>read</code> command can not read a line without newline.</p>
<pre class="lang-sh prettyprint-override"><code>if tail -c 1 "$1" | read -r line; then
echo "newline"
fi
</code></pre>
<p>Another answer.</p>
<pre class="lang-sh prettyprint-override"><code>if [ $(tail -c 1 "$1" | od -An -b) = 012 ]; then
... | 5,969 |
<p>I've read <a href="https://stackoverflow.com/questions/41354/is-the-stackoverflow-login-situation-bearable">https://stackoverflow.com/questions/41354/is-the-stackoverflow-login-situation-bearable</a> and must agree to a certain point that openid (for me) makes it more difficult to log in. Not a show stoper but I'm u... | <p>VeriSign (ick)'s SeatBelt plugin: <a href="https://pip.verisignlabs.com/seatbelt.do" rel="noreferrer">https://pip.verisignlabs.com/seatbelt.do</a></p>
<p>Ideally, the plugin would allow a higher-level of authentication. I know something like this was planned for the OLPC.</p>
| <p>You could try <a href="http://www.sxipper.com" rel="nofollow noreferrer">Sxipper</a>. It provides intelligent automatic form-fill, including auto-login. </p>
<p>From the Sxipper FAQ:</p>
<blockquote>
<p><em>How does Sxipper support OpenID?</em><br>
Sxipper remembers your OpenIDs and presents an overlay. You ch... | 7,077 |
<p>How do you specify that a foreign key constraint should be a 1:1 relationship in transact sql? Is declaring the column UNIQUE enough? Below is my existing code.!</p>
<pre><code>CREATE TABLE [dbo].MyTable(
[MyTablekey] INT IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
[OtherTableKey] INT NOT NULL UNIQUE
... | <p>A foreign key column with the UNIQUE and NOT NULL constraints that references a UNIQUE, NOT NULL column in another table creates a 1:(0|1) relationship, which is probably what you want.</p>
<p>If there was a true 1:1 relationship, every record in the first table would have a corresponding record in the second table... | <p>Based on your code above, the unique constraint would be enough given that the for every primary key you have in the table, the unique constrained column is also unique. Also, this assumes that in [OtherTable], the [OtherTableKey] column is the primary key of that table.</p>
| 5,227 |
<p>Best practices recommend not installing Sql Server to run as SYSTEM. What is the bare minumum you need to give the user account you create for it?</p>
| <p>By default, SQL Server 2005 installation will create a security group called SQLServer2005MSSQLUser$ComputerName$MSSQLSERVER with the correct rights. You just need to create a domain user or local user and make it a member of that group. </p>
<p>More details are available in the SQL Server Books Online: <a href="ht... | <p>Typically I create a Domain User with only the specific rights on the network which I will require the server to have (i.e. to write to the network backup drive), I then add the account to local power users or local administrators depending on what needs to be done on the machine, however this isn't required. I've ... | 8,220 |
<p>Typically when writing new code you discover that you are missing a #include because the file doesn't compile. Simple enough, you add the required #include. But later you refactor the code somehow and now a couple of #include directives are no longer needed. How do I discover which ones are no longer needed? </p>
<... | <p>You can use <a href="http://www.gimpel.com/" rel="nofollow noreferrer">PC-Lint/FlexeLint</a> to do that.</p>
<p>Unusually there isn't a free OS version of the tool available.</p>
<p>You can remove #includes by passing by reference instead of passing by value and forward declaring. This is because the compiler does... | <p>Here is 'brute force' VC6 macro which works on single <strong><em>.cpp</strong> or <strong></em>.h</strong> file opened in editor by commenting include by include and running compile:</p>
<pre><code>Sub RemoveNotUsedIncludes()
'Check if already processed; Exit if so
ActiveDocument.Selection.FindText "//INCLUDE NOT... | 7,467 |
<p>What is Lazy Loading?</p>
<p>[Edit after reading a few answers]
Why do people use this term so often? </p>
<p>Say you just use a ASP/ADO recordset and load it with data or ADO.NET Datasource for a gridview.</p>
<p>I guess I should have asked why people use the term Lazy Loading, what "other" types are their?</p>
| <p>It's called lazy loading because, like a lazy person, you are putting off doing something you don't want to. The opposite is Eager Loading, where you load something right away, long before you need it.</p>
<p>If you are curious why people might use lazy loading, consider an application that takes a LOOOOONG time t... | <p>According to geeksforgeeks, Lazy loading is a software design pattern where the initialization of an object occurs only when it is actually needed and not before to preserve the simplicity of usage and improve performance.</p>
<p><a href="https://www.geeksforgeeks.org/lazy-loading-design-pattern/" rel="nofollow no... | 5,693 |
<p>I'm writing an app to help facilitate some research, and part of this involves doing some statistical calculations. Right now, the researchers are using a program called <a href="http://en.wikipedia.org/wiki/Spss" rel="noreferrer">SPSS</a>. Part of the output that they care about looks like this:</p>
<p><img src="h... | <p><a href="http://people.richland.edu/james/lecture/m170/ch13-2wy.html" rel="nofollow noreferrer">This website</a> might help you out a bit more. Also <a href="http://www.unesco.org/webworld/idams/advguide/Chapt4_3.htm" rel="nofollow noreferrer">this one</a>.</p>
<p>I'm working from a fairly rusty memory of a statis... | <p>Can you explain more why SPSS itself isn't a fine solution to the problem? Is it that it generates pivot tables as output that are hard to manipulate? Is it the cost of the program? </p>
<p>F-statistics can arise from any number of particular tests. The F is just a distribution (loosely: a description of the "... | 2,400 |
<p>I have always been able to read and write basic text files in C++, but so far no one has discussed much more than that. </p>
<p>My question is this:</p>
<p>If developing a file type by myself for use by an application I also create, how would I go about writing the data to a file and preserve the layout, formattin... | <p>There are a number of standards of course. The likely one to use is some flavor of xml since there are libraries and tools that already exist to help you work with it, but nothing is stopping you from inventing your own.</p>
| <p>If you create a binary file , you can write any file to it . The only drawback is that you have to know exactly where it starts and where it ends .</p>
| 9,982 |
<p>I need to build me a small support wall 250x80 cm mounted on two metal supports approximately 200 cm apart.</p>
<p>I was looking into WPC (Wood Plastic Composite) boards and then it hit me that I may be able to make it functional AND pretty with my 3D printer (Prusa MK3S + MMU2).</p>
<p>However, I have zero idea on ... | <p>You could print a decorative layer that attaches to the WPC board.</p>
<p>It would be faster and cheaper, and there'd be no doubt about its strength.</p>
| <p>Here are some general issues with load bearing 3d prints for this type of usage:</p>
<ul>
<li>If this is to be used outside, plastic has issues with both water and UV exposure making it brittle. PETG does better on both of these areas than either PLA or ABS.</li>
<li>Plastic generally does better with compression t... | 2,215 |
<p>In Maven, dependencies are usually set up like this:</p>
<pre class="lang-xml prettyprint-override"><code><dependency>
<groupId>wonderful-inc</groupId>
<artifactId>dream-library</artifactId>
<version>1.2.3</version>
</dependency>
</code></pre>
<p>Now, if you ar... | <p><em><strong>NOTE:</strong></em></p>
<p><em>The mentioned <code>LATEST</code> and <code>RELEASE</code> metaversions <a href="https://cwiki.apache.org/confluence/display/MAVEN/Maven+3.x+Compatibility+Notes#Maven3.xCompatibilityNotes-PluginMetaversionResolution" rel="noreferrer">have been dropped <strong>for plugin dep... | <p>MY solution in maven 3.5.4 ,use nexus, in eclipse:</p>
<pre><code><dependency>
<groupId>yilin.sheng</groupId>
<artifactId>webspherecore</artifactId>
<version>LATEST</version>
</dependency>
</code></pre>
<p>then in eclipse: <code>atl + F5</code>, and choo... | 5,047 |
<p>I'm using <a href="http://jquery.com/" rel="noreferrer">jQuery</a> and <a href="http://www.ericmmartin.com/projects/simplemodal/" rel="noreferrer">SimpleModal</a> in an ASP.Net project to make some nice dialogs for a web app. Unfortunately, any buttons in a modal dialog can no longer execute their postbacks, which ... | <p>Both of you were on the right track. What I realized is that SimpleModal appends the dialog to the body, which is outside ASP.Net's <code><form></code>, which breaks the functionality, since it can't find the elements.</p>
<p>To fix it, I just modified the SimpleModal source to append eveything to <code>'for... | <p>if you don want modify the SimpleModal source.
try this..</p>
<p>After you call the modal() method add this:</p>
<pre><code>$("#simplemodal-overlay").appendTo('form');
$("#simplemodal-container").appendTo('form');
</code></pre>
<p>the SimpleModal plugin add two this to your markup. </p>
<ol>
<li>'simplemodal-ove... | 4,887 |
<p>How do I setup an Ant task to generate <a href="http://emma.sourceforge.net" rel="noreferrer">Emma</a> code coverage reports?</p>
| <p>To answer questions about where the source and instrumented directories are (these can be switched to whatever your standard directory structure is):</p>
<pre><code><property file="build.properties" />
<property name="source" location="src/main/java" />
<property name="test.source" location="src/test... | <p>Emma 2.1 introduces another way of obtaining runtime coverage information (.ec file). One can remotely request the data from the given port of the computer where an instrumented application is runnig. So there's no need to stop VM.</p>
<p>To get the file with runtime coverage data you need to insert the following s... | 7,635 |
<p>Some things look strange to me:</p>
<ul>
<li>What is the distinction between 0.0.0.0, 127.0.0.1, and [::]?</li>
<li>How should each part of the foreign address be read (part1:part2)?</li>
<li>What does a state Time_Wait, Close_Wait mean?</li>
<li>etc.</li>
</ul>
<p>Could someone give a quick overview of how to int... | <p>0.0.0.0 usually refers to stuff listening on all interfaces.
127.0.0.1 = localhost (only your local interface)
I'm not sure about [::]</p>
<p>TIME_WAIT means both sides have agreed to close and TCP
must now wait a prescribed time before taking the connection
down.</p>
<p>CLOSE_WAIT means the remote system has fini... | <p>For those seeing [::] in their netstat output, I'm betting your machine is running IPv6; that would be equivalent to 0.0.0.0, i.e. listen on any IPv6 address. </p>
| 4,126 |
<p>I'm a bit stuck on this. Basically I want to do something like the following SQL query in LINQ to SQL:</p>
<pre><code>SELECT f.*
FROM Foo f
WHERE f.FooId IN (
SELECT fb.FooId
FROM FooBar fb
WHERE fb.BarId = 1000
)
</code></pre>
<p>Any help would be gratefully received.</p>
| <p>Have a look at <a href="http://blog.wekeroad.com/2008/02/27/creating-in-queries-with-linq-to-sql" rel="noreferrer">this article</a>. Basically, if you want to get the equivalent of IN, you need to construct an inner query first, and then use the Contains() method. Here's my attempt at translating:</p>
<pre><code>va... | <p>Try this</p>
<pre><code>var fooids = from fb in foobar where fb.BarId=1000 select fb.fooID
var ff = from f in foo where f.FooID = fooids select f
</code></pre>
| 7,438 |
<p>Any ideas what the average user's download speed is? I'm working on a site that streams video and am trying to figure out what an average download speed as to determine quality.</p>
<p>I know i might be comparing apples with oranges but I'm just looking for something to get a basis for where to start.</p>
| <p><a href="http://speedtest.net/global.php" rel="noreferrer">Speedtest.net</a> has a lot of stats broken down by country, region, city and ISP. Not sure about accuracy, since it's only based on the people using their "bandwidth measurement" service.</p>
| <p>There are a lot of factors involved (server bandwidth, local ISP, network in between, etc) which make it difficult to give a hard answer. With my current ISP, I typically get 200-300 kB/sec. Although when the planets align I've gotten as much as 2 MB/sec (the "quoted" peak downlink speed). That was with parallel ... | 7,370 |
<p>Has anyone configured BLTouch with Marlin firmware?</p>
<p>I could only find videos about older firmware version. I followed <a href="https://docs.wixstatic.com/ugd/f5a1c8_77c6538efc934dbeab2f6e06e175ec35.pdf" rel="nofollow noreferrer">this document</a>. To avoid causing any damage to the printer, I removed all con... | <p>For security reasons, you cannot move Z until home position is applied to X, Y and Z.</p>
<p>With the level sensor attached, we need to home X and Y, and then Z will be homed in the middle of the bed (as configured). Execute <code>G28</code> to home all axis and then you shall be able to run 'Z'.</p>
<p>To test th... | <p><strong>Edit:</strong> <em>The answer below reflected the original question and upload of the configuration that was incorrectly configured. The value of this answer can be found in checking your configuration thoroughly before you post a question. It also answers the question whether pull-up resistors need to be se... | 924 |
<p>I have a table <code>story_category</code> in my database with corrupt entries. The next query returns the corrupt entries:</p>
<pre><code>SELECT *
FROM story_category
WHERE category_id NOT IN (
SELECT DISTINCT category.id
FROM category INNER JOIN
story_category ON category_id=category.id);
</co... | <p><em>Update: This answer covers the general error classification. For a more specific answer about how to best handle the OP's exact query, please see other answers to this question</em></p>
<p>In MySQL, you can't modify the same table which you use in the SELECT part.<br>
This behaviour is documented at:
<a href="h... | <p>If something does not work, when coming thru the front-door, then take the back-door:</p>
<pre><code>drop table if exists apples;
create table if not exists apples(variety char(10) primary key, price int);
insert into apples values('fuji', 5), ('gala', 6);
drop table if exists apples_new;
create table if not exis... | 6,738 |
<p>I've joined a team that works on a product. This product has been around for ~5 years or so, and uses ASP.NET WebForms. Its original architecture has faded over time, and things have become relatively disorganized throughout the solution. It's by no means terrible, but definitely can use some work; you all know what... | <p>Your PM's concerns are valid - make sure you get your system under test before making any major refactorings.</p>
<p>I would strongly recommend getting a copy of Michael Feather's book <a href="https://rads.stackoverflow.com/amzn/click/com/0131177052" rel="noreferrer" rel="nofollow noreferrer">Working Effectively W... | <p>Just tossing out a second recommendation for Working Effectively with Legacy Code, an excellent book that really opened my eyes to the fact that almost any old / crappy / untestable code can be wrangled!</p>
| 4,061 |
<p>I understand what <a href="http://msdn.microsoft.com/en-us/library/ms404247.aspx" rel="noreferrer">System.WeakReference</a> does, but what I can't seem to grasp is a practical example of what it might be useful for. The class itself seems to me to be, well, a hack. It seems to me that there are other, better means ... | <p>One useful example is the guys who run DB4O object oriented database. There, WeakReferences are used as a kind of light cache: it will keep your objects in memory only as long as your application does, allowing you to put a real cache on top.</p>
<p>Another use would be in the implementation of weak event handlers.... | <p>There are two reasons why you would use <code>WeakReference</code>. </p>
<ol>
<li><p><strong>Instead of global objects declared as static</strong>: Global objects are declared as static fields and static fields cannot be GC'ed (garbage-collected) until the <code>AppDomain</code> is GC'ed. So you risk out-of-memory ... | 3,637 |
<p>can you recommend some good ASP.NET tutorials or a good book?
Should I jump right to ASP.NET MVC/html/javascript or learn web forms first? </p>
<p>Thanks</p>
| <p>A great book if you're just beginning is Matthew MacDonald's <a href="https://rads.stackoverflow.com/amzn/click/com/1590598911" rel="nofollow noreferrer" rel="nofollow noreferrer">Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional</a>. Once you're done with that a great reference (also by MacDonald) is <a... | <p>MVC www.asp.net/mvc great videos
Asp.net www.asp.net </p>
| 4,264 |
<p>Better yet, how can I make My Computer always open in Explorer as well?</p>
<p>I usually make a shortcut to my programming directories on my quick launch bar, but I'd love for them to open in Explorer.</p>
| <p>explorer -d c:\path</p>
| <p>Have you considered the win+e hotkey? It isn't quite what you want, but might be close enough.</p>
| 7,676 |
<p>The <a href="http://developer.apple.com/documentation/AppleApplications/Reference/SafariWebContent/UsingiPhoneApplications/chapter_6_section_4.html" rel="nofollow noreferrer">Apple Developer Documentation</a> (link is dead now) explains that if you place a link in a web page and then click it whilst using Mobile Saf... | <p>For iOS 5.1.1 and lower, use the <code>openURL</code> method of <code>UIApplication</code>. It will perform the normal iPhone magical URL reinterpretation. so</p>
<pre><code>[someUIApplication openURL:[NSURL URLWithString:@"http://maps.google.com/maps?q=London"]]
</code></pre>
<p>should invoke the Google maps app.... | <p>If you need more flexibility than the Google URL format gives you or you would like to embed a map in your application instead of launching the map app <a href="https://sourceforge.net/projects/quickconnect" rel="nofollow noreferrer">here is an example</a>.</p>
<p>It will even supply you with the source code to do ... | 4,990 |
<p>In 3D printing firmware and slicers, jerk settings are expressed in units if mm/s. This is contrary the physical definition of jerk, which is in units of mm/s³, being the second derivative of speed with respect to time (or the third derivative of position). What is the reason for this discrepancy and how does one in... | <p>The jerk setting in 3D printing G-code and firmware represents a concept similar to, but distinct from, the physical definition of jerk. Rather, it's a [limit on] instantaneous change of speed.</p>
<p>Mathematically, one way to make sense of this is to think that, rather than being the second derivative of speed wit... | <p>The units for jerk should be meters per second cubed or m/s<sup>3</sup>. </p>
<p>Meters are the basic unit for <em>distance</em>. The first derivative is speed, or <em>velocity</em>, m/s. The second derivative is <em>acceleration</em>, m/s<sup>2</sup>. The third derivative is <em>jerk</em>, m/s<sup>3</sup>.</p>
<p... | 1,376 |
<p>I'm working on an editor for files that are used by an important internal testing tool we use. The tool itself is large, complicated, and refactoring or rewriting would take more resources than we are able to devote to it for the forseeable future, so my hands are tied when it comes to large modifications. I must ... | <p>If A, B, C and D have nothing in common then adding a base class won't really get you anything. It will just be an empty class and in effect will be the same as object.</p>
<p>I'd just create an ErrorItem class without the generics, make Item an object and do some casting when you want to use the objects referenced... | <p>If A, B, C and D have nothing in common then adding a base class won't really get you anything. It will just be an empty class and in effect will be the same as object.</p>
<p>I'd just create an ErrorItem class without the generics, make Item an object and do some casting when you want to use the objects referenced... | 7,784 |
<p>Is there any difference between</p>
<pre><code> int on_exit(void (*function)(int , void *), void *arg);
</code></pre>
<p>and</p>
<pre><code> int atexit(void (*function)(void));
</code></pre>
<p>other than the fact that the function used by on_exit gets the exit status?</p>
<p>That is, if I don't care about ... | <p>According to <a href="http://www.delorie.com/gnu/docs/glibc/libc_560.html" rel="noreferrer">this link</a> I found, it seems there are a few differences. <code>on_exit</code> will let you pass in an argument that is passed in to the <code>on_exit</code> function when it is called... which might let you set up some p... | <p>@Nathan</p>
<p>First, see if there is another API call to determine exit status... a quick glance and I don't see one, but I am not well versed in the standard C API.</p>
<p>An easy alternative is to have a global variable that stores the exit status... the default being an unknown error cause (for if the program ... | 3,189 |
<p>What do you use to capture webpages, diagram/pictures and code snippets for later reference?</p>
| <p>Evernote <a href="http://www.evernote.com" rel="nofollow noreferrer">http://www.evernote.com</a> and delicious <a href="http://www.delicious.com" rel="nofollow noreferrer">http://www.delicious.com</a></p>
| <p>I prefer to use the <a href="http://del.icio.us" rel="nofollow noreferrer">good old url</a> for delicious</p>
<p>Apart from that i use the <a href="http://amb.vis.ne.jp/mozilla/scrapbook/" rel="nofollow noreferrer">Scrapbook extension</a> in firefox when i want to save something on the disk. It's possible to tag th... | 7,658 |
<p>I have a very strange problem. Under some elusive circumstances I fail to apply any jQuery selector on my pages under IE. It's OK under Firefox though. The jQuery function simply returns empty array. </p>
<p>Any suggestions?</p>
<p>Page is too complex to post it here. Practically any selector, except <code>"#id"</... | <p>Try upgrading to jQuery 1.2.6, you should be on the latest release of jQuery if you are having problems first ensure you are on the latest and greatest.</p>
| <p>What version(s) of IE is it failing under? Is it failing for a specific complex selector? I think we need an example.</p>
<p>Edit: Does the problem go away if you upgrade to 1.2.6? 1.2.6 is primarily a bug-fix release according to <a href="http://docs.jquery.com/Release:jQuery_1.2.6" rel="nofollow noreferrer">this ... | 6,137 |
<p>The HTML standard defines a clear separation of concerns between CSS (presentation) and HTML (semantics or structure).</p>
<p>Does anyone use a coding standards document for CSS and XHTML that has clauses which help to maintain this separation? What would be good clauses to include in such a coding standards docume... | <p>We don't have a physical document we all adhere to where I work. There are a number of guidelines we try and keep in mind but there isn't really enough information to require a physcial document. <a href="http://www.louddog.com/bloggity/2008/03/css-best-practices.php" rel="nofollow noreferrer">This article</a> sums... | <p>The article referred to by @Lee Theobald is a good start.</p>
<p>Some basic ideas I try to keep in mind when marking up:</p>
<p><strong>Regarding html:</strong></p>
<p>Try to write for the next person - that is, think about how easy or difficult it might be for someone else to come and pick up your work and carry... | 5,102 |
<p>I'm thinking about buliding my own 3D printer from scratch. </p>
<p>Is it better to buy a starter DIY kit and try to build your printer around it, or to order separate parts for printer, and then to combine a printer?</p>
| <p>From a general point of view, there are a few things to consider.</p>
<p><strong>If you buy a kit</strong>:</p>
<p>Pros:</p>
<ul>
<li>You get some insurance that <em>you have all the parts that you need</em> to get a functional printer - all the electronics, structure, bolts, nuts, screws, washers, wires and so o... | <p>Three great answers have already been posted, and it has been extremely interesting to read them. I shall try not to repeated what has already been said.</p>
<p>I have sourced the parts <em>separately</em> for three different printers:</p>
<ul>
<li>P3Steel (the frame was a kit, mind: <a href="https://3dprinting.stac... | 172 |
<p>So I'm working on a project that will allow users to enter <strong>poker hand histories</strong> from sites like PokerStars and then display the hand to them.</p>
<p>It seems that regex would be a great tool for this, however I rank my regex knowledge at "slim to none".</p>
<p>So I'm using PHP and looping through ... | <p>Look at the PCRE section in the PHP Manual. Also, <a href="http://www.regular-expressions.info/" rel="nofollow noreferrer">http://www.regular-expressions.info/</a> is a great site for learning regex. Disclaimer: Regex is very addictive once you learn it.</p>
| <pre><code>Seat [number]: [letters&numbers&characters] ([number] in chips)
</code></pre>
<p>Your Regex should look something like this</p>
<pre><code>Seat (\d+): ([a-zA-Z0-9]+) \((\d+) in chips\)
</code></pre>
<p>The brackets will let you capture the seat number, name and number of chips in groups.</p>
| 3,729 |
<p>As it stands now, I'm a Java and C# developer. The more and more I look at Ruby on Rails, the more I really want to learn it. </p>
<p>What have you found to be the best route to learn RoR? Would it be easier to develop on Windows, or should I just run a virtual machine with Linux? </p>
<p>Is there an IDE that c... | <p>I've been moving from C# in my professional career to looking at Ruby and RoR in my personal life, and I've found linux to be slightly more appealing personally for development. Particularly now that I've started using git, the implementation is cleaner on linux.</p>
<p>Currently I'm dual booting and getting close... | <p>Ruby:
I used Learn to program (in a weekend), Ruby Visual QuickStart (believe it or not this QS
book was "off the hook" excellent). This took about a week.</p>
<p>Rails:
I just went through Learn Rails in one "aggressive" week. Definitely feel I have the nuts and bolts. It's 2009 which I deemed important!</p>
<p>... | 7,937 |
<p>We all know, that the best layer hight is, when you have multiples of full steps. If it is not, sometimes steps get skipped and end up bad layer-to-layer adhesion when one height step missed a tiny bit and then the next catches up, creating an extra-thick layer. For example, this was printed somewhat deliberately, a... | <blockquote>
<p>that the NEMA17 motor would be using 400 Steps per mm in Z. <code>configuration_adv.h</code> tells that the microsteps on the Z-axis motor are 16.</p>
</blockquote>
<p>Easy. There are 400 microsteps in a millimeter, and 16 microsteps in a full step. So, there are 400/16=25 full steps in a millimeter.... | <p>I see you've already accepted an answer, but based on your comments I think you have some misunderstandings of the topic which are worth clarifying as part of answering this question.</p>
<blockquote>
<p>0.2125 layer height (+1/4 microstep) and doing all the movements in absolute movements instead of relative for... | 1,464 |
<p>I've started working with ASP.net AJAX (finally ☺). and I've got an update panel together with a asp:UpdateProgress. My Problem: The UpdateProgress always forces a line-break, because it renders out as a div-tag.</p>
<p>Is there any way to force it being a span instead? I want to display it on the same line as some... | <p>I've had the same issue. There is no easy way to tell the updateProgress to render inline. You would be better off to roll your own updateProgress element. You can add a beginRequest listener and endRequest listener to show and hide the element you want to display inline. Here is simple page which shows how to do it... | <p>You can make a div inline like this:</p>
<pre><code><div style="display:inline">stuff</div>
</code></pre>
<p>I'm skeptical of it rendering the div for you though... I don't remember having this problem on my pages...</p>
| 6,401 |
<p>I have a windows laptop (thinkpad) and somewhat recently rediscovered emacs and the benefit that all those wacky shortcuts can be when the arrow keys are located somewhere near you right armpit.</p>
<p>I was discouraged after php-mode, css-mode, etc, under mmm-mode was inconsistent, buggy, and refused to properly i... | <p>Although I use emacs when I have to (ie. when I'm at the command line), I use <a href="http://www.eclipse.org/" rel="nofollow noreferrer">Eclipse</a> for all my real development work. If you get the <a href="http://www.eclipse.org/webtools/wst/main.php" rel="nofollow noreferrer">Web Standards Toolkit</a> plug-in fo... | <p>You could try mmm-mode and multi-mode. I haven't tried them: I'm happy with nxhtml for now. What sort of problems did you encounter?</p>
| 7,822 |
<p>Do you know any open source/free software C++ libraries to manipulate images in these formats:
.jpg .gif .png .bmp ? The more formats it supports, the better. I am implementing a free program in C++ which hides a text file into one or more images, using <a href="http://en.wikipedia.org/wiki/Steganography" rel="nofol... | <p><a href="http://www.imagemagick.org/" rel="noreferrer">ImageMagick</a> can manipulate about anything and has interfaces for a <a href="http://www.imagemagick.org/script/api.php" rel="noreferrer">dozen of languages</a>, including the <a href="http://www.imagemagick.org/Magick++/" rel="noreferrer">Magick++</a> API for... | <p>Have you considered <a href="http://www.codeproject.com/KB/GDI-plus/cgdiplusbitmap.aspx" rel="nofollow noreferrer">GDI</a>?</p>
<p>-- Kevin Fairchild</p>
| 6,301 |
<p>I'm setting up my team's source control + build/integration process from scratch. We were using VSS and a tool we created in-house to perform the build process. We decided to move on to a more modern environment. I have the SVN running, and I would like to set a continuous integration process with CruiseControl.NET.... | <p>Before leveraging CruiseControl to it's fullest extent, you need to create an automated build script that can be run by msbuild or nant. After you get your project building in one step, then you can start integrating CruiseControl into the mix. Here are some resources to help get you started:</p>
<ul>
<li><a href... | <p>Really, the <a href="http://confluence.public.thoughtworks.org/display/CCNET/Documentation" rel="nofollow noreferrer">documentation</a> is pretty solid</p>
| 3,781 |
<p>With hot plastic being laid down layer after layer, I am worried about fumes. Should I only print in a well ventilated work space? Should I add additional ventilation?</p>
| <p>The short answer is: <strong>yes, it is always a good idea to print in a well-ventilated area</strong>. The longer answer can be articulated as follows:</p>
<h3>Definition of "fumes"</h3>
<p>"Fumes" is a fuzzy word that from a chemical/physical perspective includes at least three different thing... | <p>There are some contradicting sources out there on whether plastics, especially ABS, have toxic fumes. It is well known that PLA is food safe, as it is an organic, biodegradable polymer being based on a particular cornstarch. This means that PLA <em>is</em> safe when printing, although it can produce foul smells from... | 873 |
<p>What do you think is the best set-up for RoR in a Win Vista environment? I've tried the radrails eclipse plug-in, and it just seemed too bulky for me, I've also started to just use Textpad and the command line, but I'm used to having somewhat of an IDE to work with.</p>
| <p>I don't know about "best", because that's a subjective question, but I can tell you what setup I use and recommend:</p>
<p><strong>Editor</strong>: <a href="http://e-texteditor.com" rel="noreferrer">E Text Editor</a><br>
TextMate seems to be the editor of choice for Rails on Mac. E Text Editor is essentially TextMa... | <p>You might want to take a look at this:</p>
<p><a href="http://www.sapphiresteel.com/" rel="nofollow noreferrer">http://www.sapphiresteel.com/</a></p>
<p>There's a free personal edition too</p>
<p>(Updated: Assuming that you already have Visual Studio Full Fat Edition)</p>
| 2,554 |
<p>SQL Experts,</p>
<p>Is there an efficient way to group runs of data together using SQL?<br>
Or is it going to be more efficient to process the data in code. </p>
<p>For example if I have the following data:</p>
<pre><code>ID|Name
01|Harry Johns
02|Adam Taylor
03|John Smith
04|John Smith
05|Bill Manning
06|John S... | <p>Try this:</p>
<pre><code>select n.name,
(select count(*)
from myTable n1
where n1.name = n.name and n1.id >= n.id and (n1.id <=
(
select isnull(min(nn.id), (select max(id) + 1 from myTable))
from myTable nn
where nn.id > n.id and nn.name <> n.name
... | <p>For this particular case, all you need to do is group by the name and ask for the count, like this:</p>
<pre><code>select Name, count(*)
from MyTable
group by Name
</code></pre>
<p>That'll get you the count for each name as a second column.</p>
<p>You can get it all as one column by concatenating like this:</p>
... | 4,166 |
<p>What memory leak detectors have people had a good experience with?</p>
<p>Here is a summary of the answers so far:</p>
<p><a href="http://valgrind.org/" rel="noreferrer">Valgrind</a> - Instrumentation framework for building dynamic analysis tools.</p>
<p><a href="http://directory.fsf.org/project/ElectricFence/" r... | <p>second the <a href="http://valgrind.org/" rel="noreferrer">valgrind</a>... and I'll add <a href="http://directory.fsf.org/project/ElectricFence/" rel="noreferrer">electric fence</a>.</p>
| <p>I'll second the valgrind as an external tool for memory leaks.<br>
But, for most of the problems I've had to solve I've always used internally built tools. Sometimes the external tools have too much overhead or are too complicated to set up.</p>
<p>Why use already written code when you can write your own :)</p>
<... | 7,686 |
<p>How do you OCR an tiff file using Tesseract's interface in c#?<br>
Currently I only know how to do it using the executable.</p>
| <p>Take a look at <a href="http://www.pixel-technology.com/freeware/tessnet2/" rel="noreferrer">tessnet</a></p>
| <p>Disclaimer: I work for Atalasoft</p>
<p>Our <a href="http://www.atalasoft.com/products/dotimage/ocr" rel="nofollow noreferrer">OCR module supports Tesseract</a> and if that proves to not be good enough, you can upgrade to a better engine and just change one line of code (we provide a common interface to multiple OC... | 5,025 |
<p>I have a number of tracks recorded by a GPS, which more formally can be described as a number of line strings.</p>
<p>Now, some of the recorded tracks might be recordings of the same route, but because of inaccurasies in the GPS system, the fact that the recordings were made on separate occasions and that they migh... | <p>Compute the <a href="http://cgm.cs.mcgill.ca/~athens/cs507/Projects/2002/StephanePelletier/#what" rel="nofollow noreferrer">Fréchet distance</a> on each pair of tracks. The distance can be used to gauge the similarity of your tracks.</p>
<p><em>Math alert:</em> Fréchet was a pioneer in the field of <a href="http://... | <p>I actually side with the person (Aaron F) who said that you might be interested in the Levenshtein distance problem (and cited <a href="http://en.wikipedia.org/wiki/Fasta" rel="nofollow noreferrer">this</a>). His answer seems to me to be the best so far.</p>
<p>More specifically, Levenshtein distance (also called e... | 8,793 |
<p>I have a UserControl that consists of three TextBoxes. On a form I can have one or more or my UserControl. I want to implement my own tab behavior so if the user presses Tab in the second TextBox I should only move to the third TextBox if the the second TextBox has anything entered. If nothing is entered in the seco... | <p>As a general rule, I would say overriding the standard behavior of the TAB key would be a bad idea. Maybe you can do something like disabling the 3rd text box until a valid entry is made in the 2nd text box.</p>
<p><em>Now, having said this, I've also broken this rule at the request of the customer. We made the e... | <p>I agree with DannySmurf. Messing with the tab order might give you hell later on if the requirements for the application change.</p>
<p>Another thing that you could do is to implement some kind of wizard for the user to go through.</p>
| 3,431 |
<p>I have a servlet that is used for many different actions, used in the <a href="http://java.sun.com/blueprints/patterns/FrontController.html" rel="noreferrer">Front Controller pattern</a>. Does anyone know if it is possible to tell if the data posted back to it is enctype="multipart/form-data"? I can't read the req... | <p>Yes, the <code>Content-type</code> header in the user agent's request should include <code>multipart/form-data</code> as described in (at least) the HTML4 spec:</p>
<p><a href="http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2" rel="noreferrer">http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2... | <p><a href="https://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getParts()" rel="nofollow noreferrer">https://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getParts()</a></p>
<p>java.util.Collection getParts()</p>
<p>Throws:
ServletException - if this request is n... | 9,194 |
<p>I am looking for a Regular expression to match only if a date is in the first 28 days of the month. This is for my validator control in ASP.NET</p>
| <p>Don't do this with Regex. Dates are formatted differently in different countries. Use the DateTime.TryParse routine instead:</p>
<pre><code>DateTime parsedDate;
if ( DateTime.TryParse( dateString, out parsedDate) && parsedDate.Day <= 28 )
{
// logic goes here.
}
</code></pre>
<p>Regex is nearly the <a... | <p>Why not just covert it to a date data type and check the day? Using a regular expression, while it could be done, just makes it overly complicated.</p>
| 7,252 |
<p>I"m considering making my own filament, with a device like the one at <a href="http://www.thingiverse.com/thing:380987" rel="nofollow noreferrer">http://www.thingiverse.com/thing:380987</a>. Partly because it's another machine to build, which is cool, but also to save money on filament.</p>
<p>Has anyone here tried... | <ol>
<li><p>Quality depends on 3 things:</p>
<ol>
<li><p>Quality of pellets (purity, fillers, color)</p></li>
<li><p>Where/how they are stored before and during the extrusion (humidity, contaminants)</p></li>
<li><p>Have a filter in your extruder to get rid of random junk and air bubbles ending up in your filament (25... | <p>You can basically use any machine that pulverizes your pellets into small pieces.</p>
<p><a href="https://www.3dhubs.com/talk/thread/how-make-your-own-filament-recycling-old-3d-prints-part-1" rel="noreferrer"><strong>One guy on 3dhubs, explained it in details.</strong></a></p>
<p>My conclusion is that you can recy... | 166 |
<p>I manage a high-school computer lab with ~40 machines, have old PCs with varying hardware. I need to roll out Windows XP + a standard set of apps and settings for new machines, and to re-format older machines. </p>
<p>What tool is available to help with this? It doesn't have to be perfect, but if it minimizes the t... | <p>Remote Installation Services and/or Windows Deployment Services. One or the other comes "free" with Windows Server (RIS with Windows Server 2003 SP1 or earlier; WDS with Windows Server 2003 SP2 or later), and is pretty easy to set up and use. :-) Requires your computers to support PXE booting, however.</p>
| <p><strong>Try <a href="http://www.net-runna.com/Products/net-runna_Enterprise/" rel="nofollow noreferrer">net-runna Enterprise</a>.</strong> </p>
<p>It does so much more than just deploying operating systems. Typically in a lab environment you want to be able to return the desktops to a known good state. This prod... | 9,351 |
<p>Is there an Eclipse command to surround the current selection with parentheses?</p>
<p>Creating a template is a decent workaround; it doesn't work with the "Surround With" functionality, because I want to parenthesize an expression, not an entire line, and that requires <code>${word_selection}</code> rather than <c... | <p>Maybe not the correct answer, but at least a workaround:</p>
<ol>
<li><p>define a Java template with the name "parenthesis" (or "pa") with the following :</p>
<p>(${word_selection})${cursor}</p></li>
<li><p>once the word is selected, <kbd>ctrl</kbd>-<kbd>space</kbd> + <kbd>p</kbd> + use the arrow keys to select th... | <p>Easy, Window->Prefs, then select Java->Editor->Templates</p>
<p>Create a new template with : (${line_selection}${cursor})</p>
<p>The "line_selection" means you have to select more than one line.</p>
<p>You can try creating another one with "word_selection", too.</p>
<p>Then, select text, right click, Surround Wi... | 9,255 |
<p>Does anyone use "space saver" style vacuum storage bags to keep fillament dry? I picked up some Ziploc space bags, but they are larger than ideal. Would probably fit 2.5 spools. I would love a smaller version just big enough for one spool.</p>
| <p>I've read people are using them, makes sense, the less air you contain, the less moisture would be in the bag. Myself, I'm using IKEA ziplock bags (and moisture absorbing sachets), they come in many sizes.</p>
| <p>I have a commercially available product known as a foodsaver (TM) which removes the air from the bag and really squeezes tightly around the spool. The width of the bags I use barely takes the typical spool but it does fit with a little elbow grease.</p>
<p>I include a bag of desiccant in each bag to pull any residu... | 1,369 |
<p>We have a case where clients seem to be eternally caching versions of applets. We're making use of the <code><param name="cache_version"></code> tag correctly within our <code><object></code> tag, or so we think. We went from a version string of <code>7.1.0.40</code> to <code>7.1.0.42</code> and this t... | <p>Unfortunately, different versions of the Java Plug-In have different caching behaviors. Setting your Cache-Control and Last-Modified HTTP headers is the ideal solution, but it only works under <a href="http://java.sun.com/javase/6/docs/technotes/guides/deployment/enhancements.html" rel="noreferrer">the most recent v... | <p>As per <a href="http://docs.oracle.com/javase/1.3/docs/guide/misc/appletcaching.html" rel="nofollow">this link</a>
, same jar file should not be listed int "archive" and "cache_archive" params. In that case, the JAR file is cached using the native browser cache.</p>
| 9,241 |
<p>What is the best way of testing a function that throws on failure? Or testing a function that is fairly immune to failure?</p>
<p>For instance; I have a <code>I/O Completion Port</code> class that throws in the constructor if it can't initialise the port correctly. This uses the <code>Win32</code> function of <code... | <p>It is definitely worthwhile to test failure conditions, both that your class properly throws an exception when you want it to and that exceptions are handled properly in the class.</p>
<p>This can easily be done if you are acting on an object passed in to the constructor... just pass in a mock. If not, I tend to p... | <p>Sound like C++ to me. You need a seam to mock out the Win32 functions. E.g. in your class you would create a protected method <code>CreateIoCompletionPort()</code> which calls <code>::CreateIoCompletionPort()</code> and for your test you create a class that derives from you I/O Completion Port class and overrides <... | 2,917 |
<p>(Ender 3 Pro with Bigtreetech Board and Touchscreen, BlTouch)</p>
<p>Hello everybody,
I want to print something for my family but the hotend gets clogged every time in the same part of the print. I tried:</p>
<ul>
<li>Different Nozzles</li>
<li>Different Filaments</li>
<li>I cleaned every Part</li>
<li>The E-Steps a... | <h1>Conclusion</h1>
<p>So I found my mistake: It was the E-Steps I did wrong it over extruded. The best E-Steps per mm are 92 for me. The mistake took place because I took my E-step number from a Video Tutorial about my dual extruder. I found the optimal number by testing out; the formula I got for the E-Steps was in t... | <p>I noticed that on my Ender 3, if the belts aren't tight enough, I have a similar problem, but mostly when I print anything circular.</p>
| 1,785 |
<p>I am writing a C# client that calls a web service written in Java (by another person). I have added a web reference to my client and I'm able to call methods in the web service ok.</p>
<p>The service was changed to return an array of objects, and the client does not properly parse the returned SOAP message.</p>
<... | <p>It has been a while, but I seem to remember having trouble with the slight differences in how default namespaces were handled between .Net and Java web services.</p>
<p>Double check the generated c# proxy class and any namespaces declared within (especially the defaults xmlns=""), against what the Java service is e... | <p>From your question, it looks like you had the client working at one point, and then the service was changed to return an array. Make sure you re-generate the proxy so the returned SOAP message is deserialized on the client. It wasn't clear you had done this - just making sure.</p>
| 9,046 |
<p>I'm a recent AI graduate (circa 2 years) working for a modest operation. It has fallen to me (primarily as I'm the first 'adopter' in the department) to create a basic (read useful?) C# coding standards document. </p>
<p>I think I should explain that I'm probably the most junior software engineer going, but I'm loo... | <p>We start with </p>
<ul>
<li>Microsoft's .NET guidelines: <a href="http://msdn.microsoft.com/en-us/library/ms229042.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms229042.aspx</a> (link updated for .NET 4.5)</li>
<li>Microsoft's C# guidelines: <a href="http://blogs.msdn.com/brada/articles/361363.asp... | <p>I think I echo the other comments here that the MS guidlines already linked are an excellent starting point. I model my code largely on those.</p>
<p>Which is interesting because my manager has told me in the past that he is not too keen on them :D</p>
<p>You have a fun task ahead of you my friend. Best of luck, a... | 3,575 |
<p>Is there any clear documentation on the binary formats used to serialize the various MFC data structures? I've been able to view some of my own classes in a hex editor and use Java's ByteBuffer class to read them in (with automatic endianness conversions, etc).</p>
<p>However, I am currently running into issues wh... | <p>Since MFC ships with source code I would create a test MFC application that serializes a CObArray and step through the serialization code. This should give you all the information you need.</p>
| <p>I agree with jmatthias: use the MFC source code.</p>
<p>There's also <a href="http://msdn.microsoft.com/en-us/library/32wxt301%28VS.71%29.aspx" rel="nofollow noreferrer">this page</a> on MSDN that may be useful.</p>
| 7,911 |
<p>Because of the weight of my Z-axis and the relative ease of its motion, when the Z-axis motor is powered down the bed has a tendency to slip and fall down.</p>
<p>Obviously leaving the motor powered solves this problem, but that is not ideal.</p>
<p>I am looking for some kind of solution that passively stops the Z... | <p>The simple way to do this is to use a self-locking screw pitch. Pretty much any single-start thread using a sliding nut cannot be back-driven so the load will not fall. Normal 8x8 trapezoidal thread screws will easily back-drive because of the steep pitch. </p>
<p>Likewise, a worm drive between the motor and Z stag... | <p>If your stepper motors have shafts protruding from both ends then it may be possible to simply 3d print a fixture that allows a thumb screw to be tightened and clamp down on the unused part of the shaft.</p>
<p>This would however be a very manual approach and would require you to be mindful that the screw must alwa... | 344 |
<p>What strategies have you used with Model Based Testing?</p>
<ul>
<li>Do you use it exclusively for
integration testing, or branch it
out to other areas
(unit/functional/system/spec verification)? </li>
<li>Do you build focused "sealed" models or do you evolve complex onibus models over time?</li>
<li>When in the p... | <p>[There are several essays worth reading on this. Stack Overflow won't let me post more than one, so I've aggregated them in a blog post, linked at the end of this answer.]</p>
<p>First, a quick note on terms. I tend to use James Bach’s definition of Testing as “Questioning a product in order to evaluate it”. All te... | <p>The best way is to try by yourself a Model based testing tool. It's the best way for know if the model based testing is adapted in your context. And what sort of strategies is the good one.</p>
<p>I advise you the "MaTeLo" tool of All4Tec (www.all4tec.net)</p>
<p>"MaTeLo is a test cases generator for black box fun... | 4,565 |
<p>I'm looking for a simple algorithm to generate a large number of random, aesthetically pleasing colors. So no crazy neon colors, colors reminiscent of feces, etc. </p>
<p>I've found solutions to this problem but they rely on alternative color palettes than RGB.
I would rather just use straight RGB than mapping back... | <p>You could average the RGB values of random colors with those of a constant color:</p>
<p><em>(example in Java)</em></p>
<pre><code>public Color generateRandomColor(Color mix) {
Random random = new Random();
int red = random.nextInt(256);
int green = random.nextInt(256);
int blue = random.nextInt(25... | <p>you could have them be within a certain brightness. that would control the ammount of "neon" colors a bit. for instance, if the "brightness"</p>
<pre><code>brightness = sqrt(R^2+G^2+B^2)
</code></pre>
<p>was within a certain high bound, it would have a washed out, light color to it. Conversely, if it was within a ... | 6,467 |
<p>I'm currently trying to implement a data collector on my Replicator+ by utilizing JSON-RPC. Is there an <strong>official</strong> reference for this? MakerBot used to host a <a href="http://wiki.makerbot.com/" rel="nofollow noreferrer">wiki site</a>, but that seems to be gone for their "troubleshooting" pages.</p>
| <p>It took some digging, but I was able to start scripting a wrapper in C# for the RPC commands.</p>
<ul>
<li><a href="https://github.com/TrueAnalyticsSolutions/MakerBotAgentAdapterCore#api" rel="nofollow noreferrer">C# Wrapper</a> (MTConnect Implementation)</li>
<li>Unofficial <a href="https://github.com/TrueAnalytic... | <h2>The Mystery of Makerbot-Wiki</h2>
<p>According to the Wayback machine, the wiki.makerbot.com went offline on <a href="https://web.archive.org/web/20121126084944/http://wiki.makerbot.com:80/" rel="nofollow noreferrer">31st December 2012</a>:</p>
<blockquote>
<p>Over the past three amazing years, MakerBot owners ... | 1,232 |
<p>Does anyone know of a good code obsfucator for Perl? I'm being ask to look into the option of obsfucating code before releasing it to a client. I know obsfucated code can still be reverse engineered, but that's not our main concern. </p>
<p>Some clients are making small changes to the source code that we give them ... | <p>I've been down this road before and it's an absolute nightmare when you have to work on "obfuscated" code because it drives up costs tremendously trying to debug a problem on the client's server when you, the developer, can't read the code. You wind up with "deobfuscators", copying the "real code" to the client's s... | <p>Another not serious suggestion is to use <a href="https://metacpan.org/pod/Acme%3a%3aBleach" rel="nofollow">Acme::Bleach</a>, it will make your code very clean ;-)</p>
| 9,648 |
<p>What all would be the requirements for the following scenario:</p>
<blockquote>
<p>A GSM modem connected to a PC running
a web based (ASP.NET) application. In
the application the user selects a
phone number from a list of phone nos.
When he clicks on a button named the
PC should call the selected phone
... | <p>I'll pick some points of your very broad question and answer them. Note that there are other points where others may be of more help...</p>
<p>First, a GSM modem is probably not the way you'd want to go as they usually don't allow for concurrency. So unless you just want one user at the time to use your service, yo... | <p>You'll need a GSM library. There appear to be a few of these.<br>
e.g. <a href="http://www.wirelessdevstudio.com/eng/" rel="nofollow noreferrer">http://www.wirelessdevstudio.com/eng/</a></p>
| 7,196 |
<p>The point of this question is to collect a list of examples of hashtable implementations using arrays in different languages. It would also be nice if someone could throw in a pretty detailed overview of how they work, and what is happening with each example. </p>
<p><strong>Edit:</strong> </p>
<p>Why not just use... | <p>A hash table a data structure that allows lookup of items in constant time. It works by hashing a value and converting that value to an offset in an array. The concept of a hash table is fairly easy to understand, but implementing is obviously harder. I'm not pasting the whole hash table here, but here are some s... | <p>I went and read some of the Wikipedia-page on hashing: <a href="http://en.wikipedia.org/wiki/Hash_table" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Hash_table</a>. It seems like a lot of work, to put up code for a hashtable here, especially since most languages I use allready have them built in. Why woul... | 4,494 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.