instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>The LCD resin printers I've looked at have pretty standard resolutions like for a smartphone and I understand they use the same technology. However, color LCD screens have three RGB sub-pixels for each color pixel. Check for example this magnified picture of an S-IPS LCD screen:
<a href="https://i.stack.imgur.com/bm... | <p>If what Thomas Sanladerer states is correct, the Mars 2 Pro (monochrome LCD, no color filter) has a layer time approximately 1/3 as long as the Mars/Pro printers (where color LCDs are used):</p>
<p><div class="youtube-embed"><div>
<iframe width="640px" height="395px" src="https://www.youtube.com/emb... | <p>It should be as simple as using a monochrome LCD. You don't actually want any color filters to interfere with the UV light.</p>
<p>Do we know that LCD printers are not using monochrome LCD panels? It always seemed so obvious that I assumed it was the practice. All you need are the front and back polarizer layer ... | 1,420 |
<p>I'm new to 3D printing. I've made some projects before just fine, but this project is giving me problems.</p>
<p>I 3D printed a trumpet mouthpiece, and the printer made supports inside the mouthpiece funnel. I can easily remove the exterior supports, but I don't know how to get to the supports inside. Does anyone k... | <p>That model didn’t need supports. Most of the time you can break the connections with the supports to the model by inserting a knife or flat object into the cavity. In this case you could use a probe to loosen the joins then wedge it out. If that doesn’t work you can use needle nose pliers to remove prices. </p>
<p>... | <p>"Don't use supports"<-- that is the best answer.</p>
<h2>Warning</h2>
<p>Sadly, if you print vertically, you end up with an extremely fragile piece -it'll snap between layers. The OP properly printed horizontally for strength, and possibly by using a very "thin" layer height he can get by wi... | 1,522 |
<p>I asked a couple of coworkers about <a href="http://ankhsvn.open.collab.net" rel="nofollow noreferrer">AnkhSVN</a> and neither one of them was happy with it. One of them went as far as saying that AnkhSVN has messed up his devenv several times.</p>
<p>What's your experience with AnkhSVN? I really miss having an IDE... | <p>Older AnkhSVN (pre 2.0) was very crappy and I was only using it for shiny icons in the solution explorer. I relied on Tortoise for everything except reverts.</p>
<p>The newer Ankh is a complete rewrite (it is now using the Source Control API of the IDE) and looks & works much better. Still, I haven't forced it t... | <p>I tried AnkhSVN (1.0.3, just 4 months ago), and it did not work the way I wanted it to (i.e. needed to select things in the browser window instead of based on active file). I ended up making some macros that utilize TortoiseSVN that work much more like what I expected.</p>
<p>I've been very happy with using Tortois... | 3,864 |
<p>I've heard I should store filament in sealed container, preferably with a desiccant. </p>
<p>But let's say I let a spool get a little old on the printer, or I purchased a filament spool that was old or improperly packaged. How would I know? How would this impact prints (what kind of symptoms would I see)? What thin... | <p>The primary issue with long-term exposure of filament to the environment is that it will absorb water moisture from the air. When a filament that has absorbed water is passing though the hot end of a printer, the water will turn to steam and cause problems with extrusion:</p>
<ul>
<li>Small bubbles of steam can for... | <p>Moisture creeps into the filament when PLA is exposed for a long time to a humid environment. This is audible like popping bubbles when heated in the hotend and does worsen the print quality. The moisture causes a noticeable property as it breaks the long molecular chains of the thermoplastic material. Once this has... | 1,022 |
<p>I like Doxygen to create documentation of C or PHP code. I have an upcoming Python project and I think I remember that Python doesn't have <code>/* .. */</code> comments, and also has its own self-documentation facility which seems to be the pythonic way to document.</p>
<p>Since I'm familiar with Doxygen, how can I... | <p>This is <a href="http://www.doxygen.nl/manual/docblocks.html#pythonblocks" rel="noreferrer">documented on the doxygen website</a>, but to summarize here:</p>
<p>You can use doxygen to document your Python code. You can either use the Python documentation string syntax:</p>
<pre><code>"""@package docstring
Document... | <p>An other very good documentation tool is <a href="http://www.sphinx-doc.org/en/master/index.html" rel="nofollow noreferrer">sphinx</a>. It will be used for the upcoming python 2.6 <a href="http://docs.python.org/dev/" rel="nofollow noreferrer">documentation</a> and is used by <a href="http://docs.djangoproject.com/e... | 8,303 |
<p>I've been using Subversion for code control with TortoiseSVN to interface with the server for the past few months, and in general it's been going great! However, occasionally my FoxPro IDE will change the case of a file extension without warning where "<em>program.prg</em>" becomes "<em>program.<strong>PRG</em></st... | <p>Unfortunately, Subversion is case-sensitive. This is due to the fact that files from Subversion can be checked out on both case-sensitive file systems (e.g., *nix) and case-insensitive file systems (e.g., Windows, Mac).</p>
<p><a href="http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/case-insen... | <p>Nope you sure can't. SVN is case-sensitive unless you were to rewrite the code somehow ... it <em>is</em> open-source.</p>
| 3,539 |
<p>As much as we would all like to say it is a benefit to programmers to be language agnostic, is it really feasible to support multiple enterprise Web applications of the same type all written in different languages? Think about how complicated a CMS or e-commerce system can be -- now imagine supporting three differen... | <p><a href="http://racket-lang.org/" rel="noreferrer">Racket</a> (<a href="http://racket-lang.org/new-name.html" rel="noreferrer">formerly Dr Scheme</a>) has a nice editor, several different Scheme dialects, an attempt at visual debugging, lots of libraries, and can run on most platforms. It even has some modes specifi... | <p>LispMe works on a Palm Pilot, take it anywhere, and scheme on the go. GREAT way to learn scheme.</p>
| 8,403 |
<p>Seems like there are so many different ways of automating one's build/deployment that it becomes difficult to parse through all the different scenarios that people support in tutorials on the web. So I wanted to present the question to the stackoverflow crowd ... what would be the best way to set up an automated bu... | <p>I recently spent a few days working on automating deployments at my company.</p>
<p>We use a combination of CruiseControl, NAnt, MSBuild to generate a release version of the app. Then a separate script uses MSDeploy and XCopy to backup the live site and transfer the new files over.</p>
<p>Our solution is briefly d... | <p>I had a <a href="https://stackoverflow.com/questions/55323/aspnet-web-application-build-output-how-do-i-include-all-deployment-files">related question</a> about getting a deployable set of files from an automated build. I found Web Deployment Projects (links and all in the old question) did what I needed - they're a... | 8,215 |
<p>The handle of a micro wave oven broke.</p>
<p>I can't just order a replacement part because I can't even attach the new one. </p>
<p>The problem is that the screw heads are somewhere on the interior side of the door, which cannot be disassembled (non destructively at least). I wouldn't even do it because of safety... | <p>This answer is intended to be a generic answer for Z-offset determination. The question is not clear on how the Z-offset has been determined. It appears as if this distance is measured, while in reality this cannot be measured.</p>
<p>A touch (or a inductive or capacitive) probe uses a trigger point to determine th... | <p>You should be able to offset this with a <code>G54 Z-1.3</code> - <strong>if your setup accepts these gcodes</strong>. </p>
<p>If you do this, always add a <code>G53</code> to the very start and just before the <code>M30</code> to clear all offsets after job finish (or in the event of a cancel, at the start of the ... | 1,468 |
<p>I got myself a Creality Ender 3 and just finished assembling it and I noticed that the home position is at the right instead of the left. It also is about about 3 mm in front of the right corner.</p>
<p>Anyone could maybe help me to understand what is wrong?</p>
| <p>Homing is the process where the machine finds all the limits of the 3 axis (at the endstop switches), to have a common reference point for each axis. From the endstops, firmware defined values exist to give the printer head the offset to the home position, also known as origin (X=0, Y=0). If the origin position is i... | <p>Did you make sure that the x,y,z and other cords / connectors, were connected to the right areas? TO clarify, the things that connect into the motors.<a href="https://i.stack.imgur.com/05zAt.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/05zAt.jpg" alt="What I was trying to explain. Apologies for... | 1,192 |
<p>I am using jQuery. I call a JavaScript function with next html:</p>
<pre><code><li><span><a href="javascript:uncheckEl('tagVO-$id')">$tagname</a></span></li>
</code></pre>
<p>I would like to remove the <code>li</code> element and I thought this would be easy with the <code>$(thi... | <p>Try something like this (e.g. to hide the <code><li></code>):</p>
<pre><code>function unCheckEl(id, ref) {
(...)
$(ref).parent().parent().hide(); // this should be your <li>
}
</code></pre>
<p>And your link:</p>
<pre><code><a href="javascript:uncheckEl('tagVO-$id', \$(this))">
</code></pre>
... | <p>Why not something like:</p>
<pre><code><li id="uncheck_tagVO-$id">$tagname</li>
</code></pre>
<p>and</p>
<pre><code>$('li').click( function() {
var id = this.id.split("_")[1];
$('#'+id).attr("checked","").parent("li").css("color","black");
$(this).remove();
retrieveItems();
});
</code... | 8,530 |
<p>Simple as the title states: Can you use only Java commands to take a screenshot and save it? Or, do I need to use an OS specific program to take the screenshot and then grab it off the clipboard?</p>
| <p>Believe it or not, you can actually use <a href="http://java.sun.com/javase/6/docs/api/java/awt/Robot.html#createScreenCapture(java.awt.Rectangle)" rel="noreferrer"><code>java.awt.Robot</code></a> to "create an image containing pixels read from the screen." You can then write that image to a file on disk.</p... | <p>You can use <code>java.awt.Robot</code> to achieve this task.</p>
<p>below is the code of server, which saves the captured screenshot as image in your Directory.</p>
<pre><code>import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket... | 8,267 |
<p>I was always attracted to the world of kernel hacking and embedded systems.<br>
Has anyone got good tutorials (+easily available hardware) on starting to mess with such stuff?<br>
Something like kits for writing drivers etc, which come with good documentation and are affordable?</p>
<p>Thanks!</p>
| <p>If you are completely new to kernel development, i would suggest not starting with hardware development and going to some "software-only" kernel modules like proc file / sysfs or for more complex examples filesystem / network development , developing on a uml/vmware/virtualbox/... machine so crashing your machine wo... | <p>Some things to be prepared for:</p>
<ul>
<li>you'll be cross-compiling. The embedded device will use a MIPS, PowerPC, or ARM CPU but won't have enough CPU power, memory, or storage to compile its own kernel in a reasonable amount of time. </li>
<li>An embedded system often uses a serial port as the console, and to... | 8,575 |
<p>How do I duplicate a whole line in <strong>Vim</strong> in a similar way to <kbd>Ctrl</kbd>+<kbd>D</kbd> in IntelliJ IDEA/ Resharper or <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>↑</kbd>/<kbd>↓</kbd> in <strong>Eclipse</strong>?</p>
| <p><kbd>y</kbd><kbd>y</kbd> or <kbd>Y</kbd> to copy the line (mnemonic: <strong><em>y</strong>ank</em>)
<br />or
<br /><kbd>d</kbd><kbd>d</kbd> to <strong><em>d</strong>elete</em> the line (Vim copies what you deleted into a clipboard-like "register", like a <em>cut</em> operation)</p>
<p>then</p>
<p><kbd>p</kbd> to ... | <p>I use this mapping, which is similar to vscode. I hope it is useful!!!.</p>
<pre><code>nnoremap <A-d> :t. <CR>==
inoremap <A-d> <Esc>:t. <CR>==gi
vnoremap <A-d> :t$ <CR>gv=gv
</code></pre>
| 9,900 |
<p>In Ruby on Rails, I'm attempting to update the <code>innerHTML</code> of a div tag using the <code>form_remote_tag</code> helper. This update happens whenever an associated select tag receives an onchange event. The problem is, <code><select onchange="this.form.submit();"></code>; doesn't work. Nor does <co... | <p>I realize this question is kind of old, but what the heck are you doing eval for?</p>
<pre><code>document.getElementById('formId').onsubmit();
document.getElementById('formId').submit();
</code></pre>
<p>or</p>
<pre><code>document.formName.onsubmit();
document.formName.submit();
</code></pre>
<p>When the DOM of ... | <p>If you didn't actually want to submit the form, but just invoke whatever code happened to be in the onsubmit, you could possibly do this: (untested)</p>
<pre><code>var code = document.getElementById('formId').getAttribute('onsubmit');
eval(code);
</code></pre>
| 5,399 |
<p>Anything thats as good and as stable and as feature-rich as gigaspaces?</p>
| <p>Gigaspaces is top notch as far as a Javaspaces implementation goes for scalability and performance. Are you restricted to a Javaspaces implementation? Blitz Javaspaces is top notch for a free product.</p>
| <p>I'd suggest taking a look at Gartner's "Competitive Landscape: In-Memory Data Grids" at <a href="http://www.gartner.com/technology/reprints.do?id=1-1HCCIMJ&ct=130718&st=sb" rel="nofollow">http://www.gartner.com/technology/reprints.do?id=1-1HCCIMJ&ct=130718&st=sb</a></p>
| 4,339 |
<p>In Java 5 and above you have the foreach loop, which works magically on anything that implements <code>Iterable</code>:</p>
<pre><code>for (Object o : list) {
doStuff(o);
}
</code></pre>
<p>However, <code>Enumerable</code> still does not implement <code>Iterable</code>, meaning that to iterate over an <code>Enum... | <p>Enumeration hasn't been modified to support Iterable because it's an interface not a concrete class (like Vector, which was modifed to support the Collections interface).</p>
<p>If Enumeration was changed to support Iterable it would break a bunch of people's code.</p>
| <p>It is possible to create an Iterable from any object with a method that returns an Enumeration, using a lambda as an adapter. In Java 8, use Guava's static <a href="https://guava.dev/releases/snapshot-jre/api/docs/com/google/common/collect/Iterators.html#forEnumeration(java.util.Enumeration)" rel="nofollow noreferre... | 4,686 |
<p>I purchased a new 4.2.7 (256k) board for my Ender 5 Pro and added the CR Touch. I got everything connected and flashed the board with the "Ender-5 Pro- Marlin2.0.1 - V1.1.1 - ALT - TMC2235.bin" firmware from the creality.com/download > Accessory Firmware > CR Touch Firmware for 32-bit Motherboard >... | <p>If you have an empty spool of the same brand, you could weigh the empty spool and the one you're trying to "measure" to get an approximate weight of the remaining filament. Divide by the (presumably available from manufacturer) weight per meter to get a rough length in meters, if that's more useful to you... | <p>Besides using the window on a spool that estimates the amount of filament left, I've used large calipers to measure the diameter of an empty spool and the diameter of the filament left on the spool.</p>
| 2,111 |
<p>Quite a few methods exist for passing data into a Flex binary from a Rails application. Right now, I'm using the old e4x resultFormat with a xml.erb template. I've done AMF before, but I feel like inlining parameters into the embed itself is a better solution because you don't have to wait for the browser to load ... | <p>Sounds to me like you shouldn't use Flex at all. Flex is great for writing applications that load and display data, but is a huge overhead if you just want to display charts. If you're worried about delivering the SWF and the data in two separate responses, you should be worrying about the 200-300 K overhead of the ... | <p>It depends, are you going to want the charts to be 'live', as in get updated in real-time when data changes? If so then using AMF with a Flex native RemoteObject gives you plenty of polling options, you can also just use a simpler Flex native HTTPService.</p>
<p>Read about them both here: <a href="http://livedocs.a... | 6,951 |
<p>I tried out printing a "bridge" for the first time using this <a href="https://www.thingiverse.com/thing:284380" rel="nofollow noreferrer">Bridge Calibration model</a>. The model creator suggests printing, tweaking settings, and printing again until it works "properly." </p>
<p>My first try worked reasonably well, ... | <p>Unless you are using a calibrated temperature sensor, it is a question what the temperature will be. </p>
<p>Actually it doesn't really matter what the temperature exactly is, you just need to find the sweet spot for your filaments on your machine. With respect to reported temperatures by others, your settings may ... | <p>Temperature from thermosensors gets collected as a resistance value that changes with temperature. The chip in your board decides the temperature from this value based on a temperature-resistance table.</p>
<p>If you are using Marlin Firmware, the setting which table is referenced by your machine to get its values ... | 1,126 |
<p>Recently I noticed that Cura always is giving me less printing time than the print itself takes on my TEVO Tarantula with Marlin firmware.</p>
<p>The time difference is about 15 %, at requested 50 mm/s printing speed.</p>
<p><strong>How could I verify real printing speed?</strong></p>
| <p><strong>Printing speed is dependent by the firmware and physical properties of your printer</strong>.</p>
<p>Slicers typically compute the expected time by assuming the printer will execute <em>exactly</em> what it is instructed to do, but a printer is a real object, with mass and momentum, and stepper motors that ... | <p>I use a Anet A8 which has a system acceleration and jerk of 400 and 20
When i slice with Cura, then I use a gcode without acceleration control, because the printer does this by its own and a combination with the gcode acceleration/jerk control gets me some strange behavior (e.g. sometimes some ultra slow movement i... | 874 |
<p>Is there anything like <a href="http://en.wikipedia.org/wiki/ELMAH" rel="noreferrer">ELMAH</a> for Windows Forms? </p>
<p>I'm looking for a standard way to process unhandled exceptions and grab a screenshot and other environment information before packaging that up for support.</p>
| <p>The very same Jeff Atwood coded a nice solution (albeit in VB.NET) which I had to modify and "fix" but that I am happily using since then.</p>
<p>You can view his solution <a href="http://www.codeproject.com/KB/exception/ExceptionHandling.aspx" rel="nofollow noreferrer">Here</a></p>
| <p>There is a commercial alternative called <a href="http://www.smartassembly.com/product/index.aspx" rel="nofollow noreferrer">{smartassembly}</a> that does error reporting.</p>
| 9,226 |
<p>I just started using GNU Emacs as my text editor and I am concerned about getting afflicted with "<a href="http://en.wikipedia.org/wiki/Emacs#Emacs_pinky" rel="nofollow noreferrer">Emacs Pinky</a>" by having to constantly press the control key with my pinky finger as is required when using Emacs. How can I avoid pot... | <p>Making <KBD>caps lock</KBD> another control key is a good place to start. Invest in an ergonomic keyboard. Some emacs users even go as far as to get foot pedal things for control and meta...</p>
| <p>
Just to overcome this issue I remap all the copy,paste,save...etc into numpad.For further ease I bought a separate numpad and place it behind my laptop key board.</p>
<p><img src="https://i.stack.imgur.com/zBQUO.jpg" /></p>
<p>
You can easily remap the keys using AHK(auto hot key).I am using the following key map... | 7,574 |
<p>I am having issue with my new printer it is not printing circles correctly although I have change firmware and stepping of motor
advise if anyone know the solution.
<a href="https://i.stack.imgur.com/7egRT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7egRT.jpg" alt="enter image description here... | <p>Possible causes for the printer not printing correct dimensions:</p>
<ul>
<li>Incorrect number of steps/mm in firmware settings</li>
<li>Belts are not tight enough</li>
<li>Pulley slips on the shaft</li>
</ul>
<p>Looking at the picture, I would go for the first case, because distortion looks regular. Try checking ... | <p>This could be because your belts are either old or not tight enough. Try adjust or replacing the belts and try again. </p>
| 685 |
<p>My company has a common code library which consists of many class libary projects along with supporting test projects. Each class library project outputs a single binary, e.g. Company.Common.Serialization.dll. Since we own the compiled, tested binaries as well as the source code, there's debate as to whether our con... | <p>It sounds to me as though you've covered all the major points. We've had a similar discussion at work recently and we're not quite decided yet.</p>
<p>However, one thing we've looked into is to reference the binary files, to gain all the advantages you note, but have the binaries built by a common build system wher... | <p>I think that if the project is not part of the solution, you shouldn't include it there... but that's just my opinion</p>
<p>I separate it by concept in short</p>
| 6,875 |
<p>I'm a software engineer, not a lawyer, and my university doesn't offer any courses geared toward licensing software. In fact, their law-related courses are lacking (but slowly growing in number). Where can I go to learn about open-source licenses and how to choose them?</p>
| <p>There are lots described here:
<a href="http://www.gnu.org/licenses/license-list.html#SoftwareLicenses" rel="noreferrer">http://www.gnu.org/licenses/license-list.html#SoftwareLicenses</a></p>
<p>The decision of which one to use can be political, but should ultimately be determined by your plans/desires for the sof... | <p>We had a similar dilemma. At our company we decided invest lots of time on a framework, with the eventual hope of releasing it to the open source community. The business is built using open source tools (apache, php, etc.), it was time to give back. We decided on an LGPL/MPL dual license. That way, we could inco... | 6,330 |
<p>I'm using ADO.NET to access SQL Server 2005 and would like to be able to log from inside the T-SQL stored procedures that I'm calling. Is that somehow possible?</p>
<p>I'm unable to see output from the 'print'-statement when using ADO.NET and since I want to use logging just for debuging the ideal solution would be... | <p>I solved this by writing a SQLCLR-procedure as Eric Z Beard suggested. The assembly must be signed with a strong name key file.</p>
<pre><code>using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
public partial class StoredProcedures
{
[Mic... | <p>You could use output variables for passing back messages, but that relies on the proc executing without errors.</p>
<pre><code>create procedure usp_LoggableProc
@log varchar(max) OUTPUT
as
-- T-SQL statement here ...
select @log = @log + 'X is foo'
</code></pre>
<p>And then in your ADO code somehwere:</p>
<... | 8,313 |
<p>In .NET there are two version numbers available when building a project, File Version and Assembly Version. How are you using these numbers? Keeping them the same? Auto-incrementing one, but manually changing the other?</p>
<p>Also what about the <code>AssemblyInformationalVersion</code> attribute?</p>
<p>I'd fo... | <p>In solutions with multiple projects, one thing I've found very helpful is to have all the AssemblyInfo files point to a single project that governs the versioning. So my AssemblyInfos have a line:</p>
<pre><code>[assembly: AssemblyVersion(Foo.StaticVersion.Bar)]
</code></pre>
<p>I have a project with a single file... | <p>I keep them the same. But then, I don't have multifile assemblies, which is when the AssemblyVersion number becomes important. I use Microsoft-style date encoding for my build numbers, rather than auto-incrementing (I don't find the number of times that something has been built to be all that important).</p>
| 3,556 |
<p>What is the minimum I need to add to a .NET 2.0 WebSite's web.config to make it .NET 3.5? </p>
<p>Visual Studio adds all the config sections and script handlers, but if you aren't using those are they are really necessary?</p>
<p>Is there a command line tool to "upgrade" a .NET 2.0 web.config to 3.5?</p>
| <p>There is a good description of the 3.5 web.config available here:
<a href="https://web.archive.org/web/20211020153237/https://www.4guysfromrolla.com/articles/121207-1.aspx" rel="nofollow noreferrer">https://web.archive.org/web/20211020153237/https://www.4guysfromrolla.com/articles/121207-1.aspx</a></p>
<p>The assem... | <p>It depends on which features you want to include. Most of the 3.5 ASP.NET extensions are optional. You will want to include the assembly for System.Core and System.Xml.Linq. You will also to add compiler support for C# 3.0 if you plan to use that in your code behind. If you're deploying to IIS 7 there are HTTP handl... | 5,408 |
<p>What are some resources for getting started writing a Firefox Addon? Is there an API guide somewhere? Is there a getting started tutorial somewhere? Is there a developer discussion board somewhere?</p>
| <p>We tried to make <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions</a> answer all those questions. The first three links in the documentation section are about getting started (that include... | <p>This has the best solutions:
<a href="https://developer.mozilla.org/en/Extensions" rel="nofollow">https://developer.mozilla.org/en/Extensions</a>
but you can try greasemonkey script compiler</p>
| 4,441 |
<p>According to the documentation, they're pretty much interchangeable. Is there a stylistic reason to use one over the other?</p>
| <p>I like to use double quotes around strings that are used for interpolation or that are natural language messages, and single quotes for small symbol-like strings, but will break the rules if the strings contain quotes, or if I forget. I use triple double quotes for docstrings and raw string literals for regular expr... | <p><code>'</code> = <code>"</code></p>
<p><code>/</code> = <code>\</code> = <code>\\</code></p>
<p>example : </p>
<pre><code>f = open('c:\word.txt', 'r')
f = open("c:\word.txt", "r")
f = open("c:/word.txt", "r")
f = open("c:\\\word.txt", "r")
</code></pre>
<p>Results are the same</p>
<p>=>> no, they're not the sa... | 7,987 |
<p>While plenty of solutions exist for entering dates (such as calendars, drop-down menus, etc.), it doesn't seem like there are too many "standard" ways to ask for a time (or time range).</p>
<p>I've personally tried drop-down menus for the hour, minute, and second fields (and sometimes an "AM/PM" field, as well). I... | <p>What I found works best is to really learn CSS. I mean <strong>really</strong> learn CSS.</p>
<p>It can be a confusing language to learn, but if you read enough about it and practice, eventually you'll learn the best way to do things.</p>
<p>The key is to do it enough that it comes natural. CSS can be very elegant... | <p>CSS takes a bit of time to learn, but the thing I initially found most discouraging was the fact that so many hacks were needed to get all browsers to behave the same way. Learning a system which doesn't adhere to logic seems dumb... but I've clung to the vague belief that there is logic behind each browser's idios... | 4,508 |
<p>Suppose I want to to print several copies of a large, flat object, such as a hollow frame. If I make an STL file consisting of several copies floating just above each other then my 3D printer's software happily generates supports for the upper objects to sit on, as shown below:</p>
<p><a href="https://i.stack.imgur... | <p>According to the RepRap.org <a href="http://reprap.org/wiki/G-code" rel="nofollow noreferrer">list of G-Code commands</a>, see <strong><a href="http://reprap.org/wiki/G-code#G0_.26_G1:_Move" rel="nofollow noreferrer">G0 & G1: Move</a></strong>:</p>
<blockquote>
<p>The <code>Ennn</code> command is <em>The amou... | <p>Is the hotend temperature set correctly? If you only preheat the hotend but then turn it off, it will behave exactly as you described (while you're above <code>EXTRUDE_MINTEMP</code> it will behave normally, but once the temperature drops too low it will continue doing the XYZ-moves, but stop extruding). Perhaps you... | 232 |
<p>I have never used octal numbers in my code nor come across any code that used it (hexadecimal and bit twiddling notwithstanding).</p>
<p>I started programming in C/C++ about 1994 so maybe I'm too young for this? Does older code use octal? C includes support for these by prepending a 0, but where is the code that us... | <p>I recently had to write network protocol code that accesses 3-bit fields. Octal comes in handy when you want to debug that. </p>
<p>Just for effect, can you tell me what the 3-bit fields of this are?</p>
<pre><code>0x492492
</code></pre>
<p>On the other hand, this same number in octal:</p>
<pre><code>022222222... | <p>Octal is and was most useful with the first available display hardware (7-segment displays). These original displays did not have the decoders available later.</p>
<p>Thus the digital register outputs were grouped to fit the available display which was capable of only displaying eight(8) symbols: 0,1,2 3,4,5,6,7 .<... | 6,635 |
<p>I'm still putting aside money for buying my first 3D printer and I'm designing all the things I have to print. </p>
<p>As I have <strong>a lot of things</strong> to print I would like to print as much of them as possible in a single print.</p>
<p>I have some arcs of circle (between 90° and 320° and 10/30 cm of di... | <p>Again, I'm not a specialist in intellectual property law (or any other sort of lawyer), but I have a different interpretation.</p>
<p>There is a potential difference between the use of the product, and the use of the derivatives of the product. For example, GCC has a restrictive (open) license, but its OK (in some ... | <p>IANAL, naturally, so take this with that in mind.</p>
<p>From what I've read and been instructed, any software which is licenced as non-commercial cannot be redistributed or incorporated into any commercial software product. The other thing about "noncommercial" software licenses is that they can't be used for cor... | 512 |
<p>This question would probably apply equally as well to other languages with C-like multi-line comments. Here's the problem I'm encountering. I'm working with Java code in Eclipse, and I wanted to comment out a block of code. However, there is a string that contains the character sequence "*/", and Eclipse thinks that... | <p>Eclipse is correct. There is no interpretation context inside a comment (no escaping, etc). See <a href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#48125" rel="noreferrer">JLS §3.7</a>.</p>
| <p>A simple test shows Eclipse is correct:</p>
<pre><code>public class Test {
public static final void main(String[] args) throws Exception {
String s = "This is the original string.";
/* This is commented out.
s = "This is the end of a comment: */ ";
*/
System.out.println(s);
}
}
</code></pre>... | 5,289 |
<p>How do I get the key of the current element in a <code>foreach</code> loop in C#?</p>
<p>For example:</p>
<h2>PHP</h2>
<pre><code>foreach ($array as $key => $value)
{
echo("$value is assigned to key: $key");
}
</code></pre>
<h3>What I'm trying to do in C#:</h3>
<pre><code>int[] values = { 5, 14, 29, 49, ... | <p><a href="https://stackoverflow.com/questions/60032/getting-the-array-key-in-a-foreach-loop#60035">Grauenwolf's way</a> is the most straightforward and performant way of doing this with an array:</p>
<blockquote>
<p>Either use a for loop or create a temp variable that you increment on each pass.</p>
</blockquote>
... | <p><code>myKey = Array.IndexOf(values, val);</code></p>
| 8,481 |
<p>In the PHP manual, to show the syntax for functions with optional parameters, they use brackets around each set of dependent optional parameter. For example, for the <a href="http://php.net/date" rel="noreferrer"><code>date()</code></a> function, the manual reads:</p>
<pre><code>string date ( string $format [, int ... | <p>Much like the manual, use an equals (<code>=</code>) sign in your definition of the parameters:</p>
<pre><code>function dosomething($var1, $var2, $var3 = 'somevalue'){
// Rest of function here...
}
</code></pre>
| <p>Starting with 7.1 there is a type hinting for nullable parameters</p>
<pre><code>function func(?Object $object) {}
</code></pre>
<p>It will work for these cases:</p>
<pre><code>func(null); //as nullable parameter
func(new Object()); // as parameter of declared type
</code></pre>
<p>But for optional value signature... | 5,524 |
<p>Has anyone built a website with IronPython and ASP.NET. What were your experiences and is the combination ready for prime-time?</p>
| <p>The current version of ASP.NET integration for IronPython is not very up-to-date and is more of a "proof-of-concept." I don't think I'd build a production website based on it.</p>
<p><strong>Edit:</strong>: I have a very high level of expectation for how things like this should work, and might setting the bar a lit... | <p>Keep a look out for ASP.NET MVC</p>
<p>The IronRuby guys have got some internal builds of MVC to work with IronRuby, and IronPython 2 and IronRuby have a lot of code in common with the DLR.</p>
<p>I'm not sure if they'll support IronPython/IronRuby when MVC is released, but it's definitely worth keeping your eye o... | 3,379 |
<p>I am trying to dynamicaly compile code using CodeDom. I can load other assemblies, but I cannot load System.Data.Linq.dll. I get an error:</p>
<p>Metadata file 'System.Data.Linq.dll' could not be found</p>
<p>My code looks like:</p>
<pre><code>CompilerParameters compilerParams = new CompilerParameters();
compile... | <p>That may be because this assembly is stored in a different location than mscorlib is. It should work if you provide a full path to the assembly. The most convenient way to get the full path is to let the .NET loader do the work for you. I would try something like this:</p>
<pre><code>compilerParams.ReferencedAss... | <p>This may be a silly answer, but are you sure the code is running on a machine with .NET Framework 3.5?</p>
| 8,577 |
<p>I have had my Ender 3 Pro for about 2 years now and it has been working amazingly!</p>
<p>Since November it's struggling very much while printing. I am quite sure the problem lives on the extruder motor.</p>
<p>About 1 of 5 prints come out ok. The main problem is that the first 2-3 first layers are all good. But as ... | <p>There are a few probable causes I can think of based on your description. That it only starts happening after the printer has been running for a bit makes me think it's a heat issue.</p>
<p>The first problem I'd check out is that extruder motor getting that hot. It should be warm, but not so hot it's uncomfortable t... | <blockquote>
<p>I noticed that the motor is getting pretty hot.</p>
</blockquote>
<p>That's not normal. Replacement motors are cheap and easy to find, so I'd swap out the motor before doing anything else. If the new one also heats up the same way, there might be a problem with the main board, but I'll bet a new motor w... | 2,086 |
<p>Is there a way to draw a line along a curved path with a gradient that varies in a direction perpendicular to the direction of the line? I am using the GDI+ framework for my graphics.</p>
| <p>The simple answer is no. You can create a GraphicsPath in order to describe what you would like to draw, using AddPoint/AddLine/AddBezier and so forth as needed to describe the complex path of what you want to draw. When you draw the path you can provide a Brush which can be something like LinearGradientBrush or Rad... | <p>One possible method you can use is to set the clip region of the Graphics object to be that of the line only. Then draw a Linear Gradient over the extremes of the line e.g.</p>
<pre><code>GraphicsPath gp = new GraphicsPath();
gp.AddArc(); // etc...
graphics.SetClip( gp );
graphics.FillRectangle( myLinearGradient... | 8,824 |
<p>What are some guidelines for maintaining responsible session security with PHP? There's information all over the web and it's about time it all landed in one place!</p>
| <p>There are a couple of things to do in order to keep your session secure:</p>
<ol>
<li>Use SSL when authenticating users or performing sensitive operations.</li>
<li>Regenerate the session id whenever the security level changes (such as logging in). You can even regenerate the session id every request if you wish.</... | <p>This is pretty trivial and obvious, but be sure to <a href="http://www.php.net/session_destroy" rel="nofollow noreferrer">session_destroy</a> after every use. This can be difficult to implement if the user does not log out explicitly, so a timer can be set to do this.</p>
<p>Here is a good <a href="http://www.elate... | 2,281 |
<p>Cura does not seem let the full print area to be used. My printer is a <a href="https://www.lulzbot.com/store/printers/lulzbot-mini" rel="noreferrer">Lulzbot Mini</a>. The design illustrated below can be found <a href="https://www.tinkercad.com/things/hBE6Aj2EJMo-skyrail-marble-coster-banked-curve-beta" rel="norefer... | <p>Cura is likely factoring in your skirt. Change the skirt lines to 0 and you might be able to print (<code>Expert</code> -> <code>Switch to full settings</code>, then click the options button next to "platform adhesion type."). Cura also seems to have an in-built build size offset of about 2 mm. I can't ... | <p>If you set skirt setting to 'none', it will get you up to full bed area -1 mm at the edges, so, for example, 198x198 instead of 200x200.</p>
<p>You need to go to 'Travel' and set 'Travel avoid distance' to zero to get the full 200x200, or whatever, bed area.</p>
| 203 |
<p>What's needed to succesfully make a crossdomain call from Silverlight?</p>
| <p>If I understand your question correctly you would need to have a clientaccesspolicy.xml file in the domain web root of the server that you wish to call (ie www.example.com/clientaccesspolicy.xml) that defines that it is ok for services from other domains to call services on that domain.</p>
<p>Read the <a href="htt... | <p>Maybe also check out JSONP <a href="http://www.west-wind.com/weblog/posts/107136.aspx" rel="nofollow noreferrer">http://www.west-wind.com/weblog/posts/107136.aspx</a> for example this is how you can get Twitter updates in JavaScript on the client side even though Twitter is on a different domain than you web page.</... | 4,961 |
<p>Is there actually a way to determine whether the sheet of glass that one has received from a Chinese supplier on eBay is actually a sheet of Borosilicate glass, and not just a piece of normal glass intended for glazing purposes?</p>
<p>Are there any laminations, or markings/features, visible under a certain light o... | <p>Google turned up this thread: <a href="http://arstechnica.com/civis/viewtopic.php?t=96214" rel="nofollow noreferrer">http://arstechnica.com/civis/viewtopic.php?t=96214</a></p>
<p>There don't seem to be any easy, definitive tests. You have two main options, both of which seem to require a fairly high level of labora... | <blockquote>
<p>"toughened" glass,</p>
</blockquote>
<p>Lead, cadmium and barium would have that effect. It goes without saying that you wouldn't want that kind of glass anywhere near your neighborhood. </p>
<p>Even those items that mention borosilicate glass in the product description may have never seen any boron... | 436 |
<p>In TFS when you merge branch A to branch B and checkin, you get a single changeset on B (typically with a comment like "merged A->B"). </p>
<p>This means B doesn't have any of the checkin history from A. So if someone created a new file on branch A, you can't tell who created it from branch B. And if someone upd... | <p>TFS 2010 will include support for this.</p>
<p>Brian Harry talks about it in <a href="http://channel9.msdn.com/pdc2008/TL52/" rel="noreferrer">this presentation</a>.</p>
<p>You will now be able to see where a change originated and who made it after the change has been merged to a different branch.</p>
| <p>Might want to try the TFS Follow branch History tool:</p>
<p><a href="http://www.codeplex.com/TFSBranchHistory" rel="nofollow noreferrer"><a href="http://www.codeplex.com/TFSBranchHistory" rel="nofollow noreferrer">http://www.codeplex.com/TFSBranchHistory</a></a></p>
| 6,789 |
<p>Im testing an ASP.NEt site. When I execute it, it starts the ASP.NET Development Server and opens up a page.</p>
<p>Now I want to test it in the intranet I have. </p>
<ol>
<li><p>Can I use this server or I need to configure IIS in this machine? </p></li>
<li><p>Do I need to configure something for it to work?</p>... | <p><strong>Yes you can! And you don't need IIS</strong></p>
<p>Just use a simple Java TCP tunnel. Download this Java app & just tunnel the traffic back.
<a href="http://jcbserver.uwaterloo.ca/cs436/software/tgui/tcpTunnelGUI.shtml" rel="nofollow noreferrer">http://jcbserver.uwaterloo.ca/cs436/software/tgui/tcpTun... | <p>I believe the built in ASP.NET server only works on localhost. You'll have to use IIS.</p>
| 3,942 |
<p>I haven't touched sharepoint in years. If I want to setup a development environment to get up to speed, what options do I have? I don't have an MSDN license, is there anyway I can get up and running for free? (for development only)</p>
| <p>You <strong>need</strong> a Windows 2003 Server (or 2008 Server, but I have no experience with that), no way around that. You can then of course use Visual C# 2005 Express and the SHarepoint Services 3.0 if that's your target.</p>
<p>If you want to do development on Sharepoint 2007, you have to buy a Sharepoint 200... | <p>The action pack is fantastic value, you can use the Windows Server from that, as well as SharePoint Enterprise / Standard.</p>
| 3,275 |
<p>I have a page that uses </p>
<pre><code>$(id).show("highlight", {}, 2000);
</code></pre>
<p>to highlight an element when I start a ajax request, that might fail so that I want to use something like</p>
<pre><code>$(id).show("highlight", {color: "#FF0000"}, 2000);
</code></pre>
<p>in the error handler. The proble... | <p>From the jQuery docs: </p>
<p><a href="http://docs.jquery.com/Effects/stop" rel="nofollow noreferrer">http://docs.jquery.com/Effects/stop</a></p>
<blockquote>
<p><em>Stop the currently-running animation on the matched elements.</em>...</p>
<p>When <code>.stop()</code> is called on an element, the currently-... | <p>In my case, using below code does not work and keep your opacity value remain: </p>
<pre><code>$('#identifier').stop(true, true).effect("pulsate", { times: 1 }, 1);
</code></pre>
<p>For me just remove opacity are working:</p>
<pre><code>$('#identifier').stop(true, true).css('opacity','');
</code></pre>
| 8,467 |
<p>How do I save each sheet in an Excel workbook to separate <code>CSV</code> files with a macro?</p>
<p>I have an excel with multiple sheets and I was looking for a macro that will save each sheet to a separate <code>CSV (comma separated file)</code>. Excel will not allow you to save all sheets to different <code>CSV... | <p>Here is one that will give you a visual file chooser to pick the folder you want to save the files to and also lets you choose the CSV delimiter (I use pipes '|' because my fields contain commas and I don't want to deal with quotes):</p>
<pre><code>' ---------------------- Directory Choosing Helper Functions ------... | <p>Please look into <a href="http://www.mrexcel.com/forum/excel-questions/265154-saving-multiple-sheets-separate-csv-files-visual-basic-applications.html" rel="nofollow">Von Pookie's answer</a>, all credits to him/her. </p>
<pre><code> Sub asdf()
Dim ws As Worksheet, newWb As Workbook
Application.ScreenUpdating = Fal... | 8,351 |
<p>Does C# have built-in support for parsing strings of page numbers? By page numbers, I mean the format you might enter into a print dialog that's a mixture of comma and dash-delimited.</p>
<p>Something like this:</p>
<pre><code>1,3,5-10,12
</code></pre>
<p>What would be really nice is a solution that gave me back... | <p>Should be simple:</p>
<pre><code>foreach( string s in "1,3,5-10,12".Split(',') )
{
// try and get the number
int num;
if( int.TryParse( s, out num ) )
{
yield return num;
continue; // skip the rest
}
// otherwise we might have a range
// split on the range delimiter
... | <p>Here's a slightly modified version of lassevk's code that handles the string.Split operation inside of the Regex match. It's written as an extension method and you can easily handle the duplicates problem using the Disinct() extension from LINQ.</p>
<pre><code> /// <summary>
/// Parses a string represe... | 6,139 |
<p>I'm in the process of refactoring some code which includes moving folders around, and I would like to regularly merge to keep things current. What is the best way to merge after I've moved folders around in my working copy?</p>
| <p>You can move the files around in StarTeam also. Then merge after that. </p>
<p>Whatever you do, make sure you don't delete the files and re-add in StarTeam. You'll lose the file history if you do that.</p>
| <p>The problem is I'm worried about breaking the build in the meantime while I'm moving folders in StarTeam. I suppose the only way to avoid that is to be ready to upload updated project files as soon as I move things around in StarTeam and do it as quickly as possible.</p>
| 4,819 |
<p>Does anyone here have any useful code which uses reduce() function in python? Is there any code other than the usual + and * that we see in the examples?</p>
<p>Refer <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=98196" rel="noreferrer">Fate of reduce() in Python 3000</a> by GvR</p>
| <p>The other uses I've found for it besides + and * were with and and or, but now we have <code>any</code> and <code>all</code> to replace those cases. </p>
<p><code>foldl</code> and <code>foldr</code> do come up in Scheme a lot... </p>
<p>Here's some cute usages:</p>
<p><b>Flatten a list</b></p>
<p>Goal: turn <cod... | <p>Using reduce() to find out if a list of dates are consecutive:</p>
<pre><code>from datetime import date, timedelta
def checked(d1, d2):
"""
We assume the date list is sorted.
If d2 & d1 are different by 1, everything up to d2 is consecutive, so d2
can advance to the next reduction.
If d2 &... | 3,675 |
<p>I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object.</p>
| <p>You can also define signals inside the class definition:</p>
<pre><code>class MyGObjectClass(gobject.GObject):
__gsignals__ = {
"some-signal": (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, (object, )),
}
</code></pre>
<p>The contents of the tuple are the the same as the three last arguments to <code>... | <p>Here is how:</p>
<pre><code>import gobject
class MyGObjectClass(gobject.GObject):
...
gobject.signal_new("signal-name", MyGObjectClass, gobject.SIGNAL_RUN_FIRST,
None, (str, int))
</code></pre>
<p>Where the second to last argument is the return type and the last argument is a tuple of argument types.</p>... | 9,225 |
<p>Does anyone have a trusted Proper Case or PCase algorithm (similar to a UCase or Upper)? I'm looking for something that takes a value such as <code>"GEORGE BURDELL"</code> or <code>"george burdell"</code> and turns it into <code>"George Burdell"</code>.</p>
<p>I have a simple one that handles the simple cases. Th... | <p>Unless I've misunderstood your question I don't think you need to roll your own, the TextInfo class can do it for you.</p>
<pre><code>using System.Globalization;
CultureInfo.InvariantCulture.TextInfo.ToTitleCase("GeOrGE bUrdEll")
</code></pre>
<p>Will return "George Burdell. And you can use your own culture if th... | <p>You do not mention which language you would like the solution in so here is some pseudo code.</p>
<pre><code>Loop through each character
If the previous character was an alphabet letter
Make the character lower case
Otherwise
Make the character upper case
End loop
</code></pre>
| 5,208 |
<p>So I was reading those Windows Vista UI guidelines someone linked to in another question, and they mentioned that you should be able to survive a switch to 120 DPI. Well, I fire up my handy VM with my app installed, and what do we get... AAAAGH!!! MASSIVE UI FAIL!</p>
<p>Everything's all jumbled: some containers ar... | <p>Learn how the <em>Anchor</em> and <em>Dock</em> properties work on your controls, leave anything that can <em>AutoSize</em> itself alone, and use a <code>TableLayoutPanel</code> when you can.</p>
<p>If you do these three things, you'll get a lot of the WPF design experience in Windows Forms. A well-designed <code>... | <blockquote>
<p>If I were to stick with Windows Forms, what are all the tricks to achieving a font-size-independent layout that can survive the user setting his fonts large, or setting the display to 120 DPI?</p>
</blockquote>
<p>For one, <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.autoscal... | 7,331 |
<p>I have a web application developed with ASP.net and C# that is running on my companies' intranet. Because all the users for this application are all using Microsoft Outlook without exception, I would like for the the application to open up an Outlook message on the client-side. <strong>I understand that Office is... | <p>You cannot open something on the client from server side code. You'd have to use script on the page to do what you're wanting (or something else client-side like ActiveX or embedded .NET or something) </p>
<p>Here's a sample Javascript that invokes an Outlook MailItem from an webpage. This could easily be injected... | <p>If everyone in the company uses Outlook, then just using a standard "mailto" link should always open Outlook. It sounds like you're over-engineering this.</p>
| 6,620 |
<p>I printed a test cube with ABS on my Ender 3 and after some tuning, I still have a problem I cannot solve. Two of the vertical edges (I believe they are the ones on the X+ side) are slightly squished in. Could this be due to warping or something else? I printed it at 0.1 mm layer height, 235/110 °C hotend/bed temper... | <p>I think this is caused by the shape of the hole. The shape is parabolic or circular, this means that if you slice it as in the green part, the slicer determines the placing of the layers along the curvature. If it has a shallow curvature, and slicing layer height is relatively thick, the curvature of the object cann... | <p>I think this is caused by the shape of the hole. The shape is parabolic or circular, this means that if you slice it as in the green part, the slicer determines the placing of the layers along the curvature. If it has a shallow curvature, and slicing layer height is relatively thick, the curvature of the object cann... | 1,149 |
<p><em>TLDR - I’ve just driven myself insane trying to fix what I thought was a physical problem with my Z-axis, but it seems to have been solved by switching from the TH3D firmware to the Creality firmware. I’m hoping someone can help me see where I went wrong here, so I can learn from it. Have I missed something obvi... | <p>It's well known in mathematical circles that the "salesman problem" is what mathematicians call "hard" -- in their usage, that means a lot of extremely smart people have worked on the problem for many years (more than a century?) and still not found a robust, works-every-time solution.</p>
<p>Wha... | <p><strong>Long story short:</strong> I only know the setting "Combing Mode OFF" that improves the travel paths. In my case it did not help. In your case I suggest you should give PrusaSlicer a try. I assume that the overall print duration will be improved because of a better calculation of the travel paths. ... | 1,992 |
<p>In past few months, there are a devastatingly few number of users that cast up votes, and many of users aren't coming back to site, and existing users don't have so much reputation, because no one is voting up great questions / answers.</p>
<p>So... let me start like this..</p>
<p><a href="https://3dprinting.stack... | <p>I completely agree! I just posted <a href="https://3dprinting.meta.stackexchange.com/questions/197/3d-printing-se-beta-status">my own reminder</a>, focusing more on efforts to get us out of Beta.</p>
<p>I'm sorry you can feel discouraged sometimes, I think a lot of users around the Stack Exchange network can feel t... | <p>Hmm yeah we might have a minor problem. I know most of my rep is disportionately from question acceptance and unusually low for +1s. I wonder if it has to do with any active member being able to be on the top 50 list their first month, thus people maybe hoarding their upvotes trying to be number one? </p>
| 36 |
<p>I'm trying to find a least-resistance path from C# to C++, and while I feel I handle C# pretty well after two solid years, I'm still not sure I've gotten the "groove" of C++, despite numerous attempts.</p>
<p>Are there any particular books or websites that might be suitable for this transition?</p>
| <p>I recommend <em>The C++ Programming language</em> by Bjarne Stroustrup. It's not a suitable book for new programmers, but I found it quite effective as programmer who was experienced in other languages and didn't want to waste too much time with learning how while loops work. It's a dense but quite comprehensive boo... | <p>I'd consider [K&R](<a href="http://en.wikipedia.org/wiki/The_C_Programming_Language_(book))" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/The_C_Programming_Language_(book))</a> a prerequisite for C++. Perhaps the best thing about C++ is that it's a better C.</p>
<p>And of course, Stroustrup (as sugge... | 9,359 |
<p>We've been using the 32bit linux version of the <a href="http://wrapper.tanukisoftware.org/" rel="nofollow noreferrer">JavaServiceWrapper</a> for quite a while now and it's working perfectly. We are now considering also using it on 64bit linux systems. There are downloads for 64bit binaries on the website, but looki... | <p>I've had it running in production on 64-bit red hat without any trouble for the last year or so. </p>
| <p>Take a look at <a href="http://yajsw.sourceforge.net/" rel="nofollow">http://yajsw.sourceforge.net/</a>. </p>
<p>It's free and rather compatible reimplementation of TanukiSoftware Java Service Wrapper featuring free 64-bit support.</p>
| 4,719 |
<p>I'm coding a framework along with a project which uses this framework. The project is a Bazaar repository, with the framework in a subfolder below the project.</p>
<p>I want to give the framework a Bazaar repository of its own. How do I do it?</p>
| <p>You use the split command:</p>
<pre><code>bzr split sub_folder
</code></pre>
<p>This creates an independant tree in the subfolder, which you can now export and work on separately.</p>
| <p>As far as I know, there is not a way to do this easily with bazaar. One possibility is to take the original project, branch it, and then remove everything unrelated to the framework. You can then move the files in the subdir to the main dir. It's quite a chore, but it is possible to preserve the history. </p>
<... | 9,260 |
<p>I've got a direct drive extruder printer, that I have equipped with a Bowden-tube to give it a nice and defined filament path from my spool and to protect it from moisture when it exits my drybox. I've noticed that this 1 m Bowden tube adds quite a bit of friction to the system. I am keenly aware of it as feeding fi... | <p>A Bowden tube is by design fairly small diameter to match the filament within, constraining the forces applied by the remote extruder mechanism. As you've noted, friction is a consideration.</p>
<p>For your application, you would not have to have such a tightly constrained diameter. You could use a Bowden tube for 2... | <p>I have a similar setup with one of my printers (that is using 1.75 mm filament), this answer is therefore my own experience with guiding tubes from spool to extruder (my previous was a direct drive extruder, the latter uses a Bowden setup, but both with a tube leading up to the extruder).</p>
<p>Initially I used sma... | 1,741 |
<p>I have a table similar to this:</p>
<pre><code>CREATE TABLE example (
id integer primary key,
name char(200),
parentid integer,
value integer);
</code></pre>
<p>I can use the parentid field to arrange data into a tree structure.</p>
<p>Now here's the bit I can't work out. Given a parentid, is it possible ... | <p>There are a few ways to do what you need in PostgreSQL.</p>
<ul>
<li><p>If you can install modules, look at the tablefunc contrib. It has a connectby() function that handles traversing trees. <a href="http://www.postgresql.org/docs/8.3/interactive/tablefunc.html" rel="noreferrer">http://www.postgresql.org/docs/8.3/... | <p>If you need to store arbitrary graphs, not just hierarchies, you could push Postgres to the side and try a graph database such as <a href="http://agraph.franz.com/support/learning/" rel="nofollow noreferrer">AllegroGraph</a>:</p>
<p>Everything in the graph database is stored as a triple (source node, edge, target n... | 7,653 |
<blockquote>
<p>See also <a href="https://stackoverflow.com/questions/1700917/how-does-a-wcf-server-inform-a-wcf-client-about-changes-better-solution-then-si">How does a WCF server inform
a WCF client about changes? (Better
solution then simple polling, e.g.
Coment or long polling)</a></p>
</blockquote>
<p>I n... | <p>I've found a couple of solutions:</p>
<p><a href="http://www.zeroc.com/" rel="nofollow noreferrer" title="ZeroC Ice">ZeroC Ice</a> GPL with a commercial option. Have only tested quickly. Looks more powerful than .NET Remoting and is very actively developed.</p>
<p><a href="http://www.remobjectssdk.com/" rel="nofol... | <p>You can do following change in client for accessing duplex web service on Firewall enabled client.</p>
<ul>
<li>Set WebHttp option checked in Firewall -> Advanced -> Settings (of Network Connection Setting) -> Web Server (Http)</li>
</ul>
| 4,235 |
<p>How can I improve the look and feel of my Linux desktop to suit my programming needs?</p>
<p>I found Compiz and it makes switching between my workspaces (which is something I do all the time to make the most of my 13.3" screen laptop) easy and look great - so what else don't I know about that make my programming en... | <p>I found that the best programming experience comes from having quick access all your tools. This means getting comfortable with basic command line acrobatics and really learning keyboard shortcuts, flags, and little productivity apps.</p>
<p>I find that most of my workflow comes down to just a few apps and command... | <p>If you have half decent 3D acceleration on board, CompizFusion adds attractive desktop effects like mapping your workspaces onto a cube using that to switch between them/move windows between them. Looks pretty and improves general usability - great!</p>
<p><a href="http://en.wikipedia.org/wiki/Compiz" rel="nofollow... | 5,730 |
<p>I have a JavaScript object. Is there a built-in or accepted best practice way to get the length of this object?</p>
<pre><code>const myObject = new Object();
myObject["firstname"] = "Gareth";
myObject["lastname"] = "Simpson";
myObject["age"] = 21;
</code></pre>
| <h2>Updated answer</h2>
<p><strong>Here's an update as of 2016 and <a href="http://kangax.github.io/compat-table/es5/" rel="noreferrer">widespread deployment of ES5</a> and beyond.</strong> For IE9+ and all other modern ES5+ capable browsers, you can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript... | <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var myObject = new Object();
myObject["firstname"] = "Gareth";
myObject["lastname"] = "Simpson";
myObject["age"] = 21;
var s... | 2,719 |
<p>I've been asked to write a Windows service in C# to periodically monitor an email inbox and insert the details of any messages received into a database table.</p>
<p>My instinct is to do this via POP3 and sure enough, Googling for ".NET POP3 component" produces countless (ok, 146,000) results.</p>
<p>Has anybody d... | <p>I recomment <a href="http://www.chilkatsoft.com" rel="nofollow noreferrer">chilkat</a>. They have pretty stable components, and you can get their email component for as cheap as $99 for a single developer. Personally, I think going with the whole package of components is a better deal, as it's only $289, and comes... | <p>How about WCF? It's free.</p>
<p>If you have an Exchange server:
<a href="http://msdn.microsoft.com/en-us/library/bb397812.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/bb397812.aspx</a></p>
<p>an example for pop3:
<a href="http://bartdesmet.net/blogs/bart/archive/2006/09/13/4417.aspx" re... | 3,863 |
<p>I need to do a dump of a table on a remote server, but I can't access the server directly. The only access I have is through PHP scripts.</p>
<p>Is there some way in which MySQL will return an </p>
<pre><code>INSERT INTO `table_name` (`field1`, `field2`) VALUES ('a', 'b'), ('c', 'd')
</code></pre>
<p>statement, l... | <p>1) can you run mysqldump from exec or passthru<br />
2) take a look at this: <a href="http://www.php-mysql-tutorial.com/perform-mysql-backup-php.php" rel="noreferrer">http://www.php-mysql-tutorial.com/perform-mysql-backup-php.php</a></p>
| <p>If you can use php-scripts on the server i would recommend <a href="http://www.phpmyadmin.net/home_page/index.php" rel="nofollow noreferrer">phpmyadmin</a>. Then you can do this from the web-interface.</p>
| 8,887 |
<p>Working on a little side project web app...</p>
<p>I'd like to have it set up so that, when users send email to a certain account, I can kick off a PHP script that reads the email, pulls out some key info, and writes it to a database.</p>
<p>What's the best way to do this? A cron job that checks for new email?</p>... | <p>Procmail is how I do it. Here's an example where I actually process the text inside the email to archive it back to a MySQL database. </p>
<pre><code>:0:
* ^(From).*test@example.com
{
:0 c
| php /var/www/app/process_email.php
}
</code></pre>
| <p>The Cronjob is the common solution to such a task. <a href="http://php.net/manual/en/function.imap-getmailboxes.php" rel="nofollow noreferrer">Checking for new Mails with PHP</a> is no Problem. If you run a qmail-server (maybe other servers can do this too?) you can <a href="http://www.faqts.com/knowledge_base/view.... | 5,351 |
<p>I'd really like to handle this without monkey-patching but I haven't been able to find another option yet.</p>
<p>I have an array (in Ruby) that I need to sort by multiple conditions. I know how to use the sort method and I've used the trick on sorting using an array of options to sort by multiple conditions. How... | <p>How about:</p>
<pre>
<code>
ordered_list = [[1, "b"], [1, "a"], [2, "a"]]
ordered_list.sort! do |a,b|
[a[0],b[1]] <=> [b[0], a[1]]
end
</code>
</pre>
| <p>I had this same basic problem, and solved it by adding this:</p>
<pre><code>class Inverter
attr_reader :o
def initialize(o)
@o = o
end
def <=>(other)
if @o.is && other.o.is
-(@o <=> other.o)
else
@o <=> other.o
end
end
end
</code></pre>
<p>This is a... | 9,867 |
<p>Recently my printer has been creating double images along the X-axis, I just printed a calibration cube after checking all of my rods to make sure nothing was catching and here was my result:
<a href="https://i.stack.imgur.com/vAqB6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vAqB6.jpg" alt="C... | <p>I agree with @FernandoBaltazar. You have several things going on. If the problem is recent, you may have loose belts, but you may also need to perform acceleration and jerk tuning. Reducing your print speeds may also help.</p>
| <p>There are several problems, but lets start with a method for discovering them.</p>
<p>The first thing to do is look for any looseness or slop in the mechanism. Try wiggling the hot end, looking for any free movement. Try moving along the axes that move. You haven't specified the machine, so I can't suggest the s... | 735 |
<p>This may be a long shot, but I was wondering if the signals seen across a stepper motor's windings could indicate whether the stepper was being told to move over some short time period. This is in particular for the stepper used on extruders.</p>
<p>I've read that PWM in used in stepper drivers and controls curren... | <blockquote>
<p>So it would seem that there is always a pulsing waveform across the windings whenever the stepper is energized, correct?</p>
</blockquote>
<p>Correct.</p>
<blockquote>
<p>When the motor is holding its position, is there anything distinctive about the waveform?</p>
</blockquote>
<p><a href="https:... | <p>There is nothing you can do to monitor the extruder stepper motor to assure that filament is being fed when it should be fed. A common condition is where the filament binds but the extruder stepper continues to move as commanded. The drive pully strips the dents it presses in the filament, and grinds down the fila... | 1,270 |
<p>What sort of database schema would you use to store email messages, with as much header information as practical/possible, into a database?</p>
<p>Assume that they have been fed into a script from the MTA and parsed into the relevant headers/body/attachments.</p>
<p>Would you store the message body whole in the da... | <p>You may want to check the <a href="http://www.archiveopteryx.org/architecture" rel="noreferrer">architecture</a> and the <a href="http://www.archiveopteryx.org/schema" rel="noreferrer">DB schema</a> of "Archiveopteryx".</p>
| <p>If it is already split up, and you can be sure that the routine to split the data is sound, then I would split up the table as granular as possible. You can always parse it back together in your middle tier. If space is not an issue, you could always store it twice. One, split up into the relevant fields, and ano... | 9,068 |
<p>I was just looking through some information about Google's <a href="http://code.google.com/apis/protocolbuffers/" rel="noreferrer">protocol buffers</a> data interchange format. Has anyone played around with the code or even created a project around it?</p>
<p>I'm currently using XML in a Python project for structu... | <p>If you are looking for user facing interaction, stick with xml. It has more support, understanding, and general acceptance currently. If it's internal, I would say that protocol buffers are a great idea.</p>
<p>Maybe in a few years as more tools come out to support protocol buffers, then start looking towards that ... | <p>From your brief description, it sounds like protocol buffers is not the right fit. The phrase "structured content created by hand in a text editor" pretty much screams for XML.</p>
<p>But if you want efficient, low latency communications with data structures that are not shared outside your organization, binary se... | 2,404 |
<p>I've worked on a number of database systems in the past where moving entries between databases would have been made a lot easier if all the database keys had been <a href="http://en.wikipedia.org/wiki/Globally_Unique_Identifier" rel="noreferrer">GUID / UUID</a> values. I've considered going down this path a few time... | <p>Advantages:</p>
<ul>
<li>Can generate them offline.</li>
<li>Makes replication trivial (as opposed to int's, which makes it REALLY hard)</li>
<li>ORM's usually like them</li>
<li>Unique across applications. So We can use the PK's from our CMS (guid) in our app (also guid) and know we are NEVER going to get a clash.<... | <p>One thing not mentioned so far: UUIDs make it much harder to profile data</p>
<p>For web apps at least, it's common to access a resource with the id in the url, like <code>stackoverflow.com/questions/45399</code>. If the id is an integer, this both</p>
<ul>
<li>provides information about the number of questions (ie ... | 6,724 |
<p>In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this?</p>
| <p>Sharepoint Lists automatically have an column with "ID" which auto increments. You simply need to select this column from the "modify view" screen to view it.</p>
| <p>Peetha has the best idea, I've done the same with a custom list in our SP site. Using a workflow to auto increment is the best way, and it is not that difficult. Check this website out: <a href="http://splittingshares.wordpress.com/2008/04/11/auto-increment-a-number-in-a-new-list-item/" rel="nofollow noreferrer">htt... | 9,812 |
<p>I get the following error pretty regularly when compiling in Visual Studio and running my web application:</p>
<p>"Unable to start debugging on the web server. The web server did not respond in a timely manner. This may be because another debugger is already attached to the web server."</p>
<p>Normally this is af... | <p>I find that this happens if I'm debugging with Firefox as my browser. When I exit Firefox the VS2005/8 debug session doesn't terminate. I have not found a solution for this (yet).</p>
<p>If this is what's happening with you then a quicker solution than running iisreset is to hit Shift-F5 when in Visual Studio and t... | <p>I just solved this problem on my machine.
My problem is that I upgraded IE 9 To IE 10 and I got this error.
Solution : Remove IE 10 and downgrade to IE 9.
Go to "Programs and Features" --> "View recent updates" --> find IE 10---> Uninstall it-->reboot--->ie 9 is back--->debug--->works OK.</p>
| 2,463 |
<p>What is the best way to setup one Linux box to listen on its serial port for incoming connections? I've done a lot of googling but I can't find the right combination of commands to actually get them to talk!</p>
<p>My main objective is to provide a serial interface to running instances of kvm/qemu VMs. They current... | <p>The <a href="http://tldp.org/HOWTO/Serial-HOWTO.html" rel="noreferrer">Linux Serial HOWTO</a> has a lot of detailed information about serial communication in general. The more-specific <a href="http://tldp.org/HOWTO/Remote-Serial-Console-HOWTO/index.html" rel="noreferrer">Linux Remote Serial Console HOWTO</a> is wha... | <p>I assume you connect the two serial ports using a "null modem" cable.</p>
<p>Use a program like minicom to talk to remote system -- you probably need to set up the communication parameters and possibly turn off hardware flow control (if your cable doesn't have the flow-control lines connected).</p>
| 9,503 |
<p>Using online interfaces to a version control system is a nice way to have a published location for the most recent versions of code. For example, I have a LaTeX package here (which is released to CTAN whenever changes are verified to actually work):</p>
<p><a href="http://github.com/wspr/pstool/tree/master" rel="no... | <p>I am using Tortoise SVN for small system ASP.NET development. Most code is interpreted ASPX, but there are around a dozen binary DLLs generated by a manual compile step. Whilst it doesn't make a lot of sense to have these source-code versioned in theory, it certainly makes it convenient to ensure they are correctly ... | <p>In some cases we do, but it's more of a sysadmin type of use case, where the generated files (say, DNS zone files built from a script) have intrinsic interest in their own right, and the revision control is more linear audit trail than branching-and-tagging source control.</p>
| 6,024 |
<p>Does anybody know if there is a way to create an SQLite database based on an XSD <code>DataSet</code>? In the past, I've just used a basic SQLite manager, but I want to fuse things a bit more with my <code>.NET</code> development if possible.</p>
| <p>I suspect in the general case this is hard; XML Schema allows for some quite bizarre type constructions. I'm not sure how you would do substitution groups, or extensions to restrictions of types for example.</p>
<p>However it should be possible to knock something together quite quickly (especially mapping from the... | <p>I'm sure you could write a small app that takes an XSD file and parses it into a SQL script. I've never seen code out there to do it though, but that's not saying it doesn't exist.</p>
| 2,274 |
<p>Alright, this might be a bit of a long shot, but I have having problems getting AnkhSVN to connect from Visual Studio 2005 to an external SVN server. There is a network proxy in the way, but I can't seem to find a way in AnkhSVN to configure the proxy and doesn't seem to be detecting the Internet Explorer proxy conf... | <p><a href="http://en.wikipedia.org/wiki/Printf#printf_format_placeholders" rel="noreferrer">http://en.wikipedia.org/wiki/Printf#printf_format_placeholders</a> is Wikipedia's reference for format placeholders in printf. <a href="http://www.cplusplus.com/reference/clibrary/cstdio/printf.html" rel="noreferrer">http://www... | <p>One issue that hasn't been raised by others is whether <strong>double</strong> is the same as a <strong>float</strong>. On some systems a different format specifier was needed for a double compared to a float. Not least because the parameters passed could be of different sizes.
<PRE>
%f - float
%lf - double
%g ... | 3,861 |
<p>So I've done the trivial "warmup" apps with GAE. Now I'd like to build something with a more complex directory structure. Something along the lines of:</p>
<pre><code>siteroot/
models/
controllers/
controller1/
controller2/
...
templates/
template1/
template2/
... | <p>You can't use relative paths, as Toni suggests, because you have no guarantee that the path from your working directory to your app's directory will remain the same.</p>
<p>The correct solution is to either use os.path.split, as you are, or to use something like:</p>
<pre><code>path = os.path.join(os.path.dirname(... | <p>The <code>dirname</code> function returns an absolute path, use relative paths. See what is the current directory when your controllers are executed with <code>os.path.abspath(os.path.curdir)</code> and build a path to the templates relative to that location (without the <code>os.path.abspath</code> part of course).... | 8,722 |
<p>I am using Tomcat as a server and Internet Explorer 6 as a browser. A web page in our app has about 75 images. We are using SSL. It seems to be very slow at loading all the content. How can I configure Tomcat so that IE caches the images?</p>
| <p>If you are serving a page over https then you'll need to serve all the included static or dynamic resources over https (either from the same domain, or another domain, also over https) to avoid a security warning in the browser.</p>
<p>Content delivered over a secure channel will not be written to disk by default b... | <p>Content served over a HTTPS connection <strong>never gets cached</strong> in the browser. You cannot do much about it. </p>
<p>Usually, images in your web site are not very sensitive and are served over HTTP for this very reason.</p>
| 9,797 |
<p>Is there a way to convert a HTML string into a Image .tiff file?</p>
<p>I am using C# .NET 3.5. The requirement is to give the user an option to fact a confirmation. The confirmation is created with XML and a XSLT. Typically it is e-mailed. </p>
<p>Is there a way I can take the HTML string generated by the transf... | <p>Here are some free-as-in-beer possibilities:</p>
<p>You can use the PDFCreator printer driver that comes with ghostscript and print
directly to a TIFF file or many other formats.</p>
<p>If you have MSOffice installed, the Microsoft Office Document Image Writer will produce
a file you can convert to other formats.<... | <p>A starting point might be the software of <a href="http://www.websupergoo.com" rel="nofollow noreferrer">WebSuperGoo</a>, which provide rich image editing products, cheap or for free.</p>
<p>I know for sure their PDF Writer can do basic HTML (<a href="http://www.websupergoo.com/helppdf6net/source/3-concepts/b-htmls... | 7,752 |
<p>Glass is always level, easy to clean, easy to work with.</p>
<p>Aluminium allows for the addition of automatic bed leveling with an inductive sensor and distributes heat a little more evenly.</p>
<p>When printing mostly ABS and PLA, which one is better?</p>
| <p>I believe printing directly on aluminium is unwise, simply because it will expand when heated, typically giving the bed a concave or convex shape. Glass, on the other hand, does not (at least not significantly).</p>
<p>As pointed out in the comments below, the heat expansion of aluminium could potentially be mitiga... | <p>you could always slightly slot the holes on your aluminum bed so its not corner constrained and forced to bow in the middle..</p>
<p>My advice is use both and hairspray
currently testing the effectiveness of insulation on the bottom of the plate</p>
| 186 |
<p>I have a very dense point cloud (billions of points) of the exterior of a building obtained by laser scanning it with a Leica head.
I successfully subsampled it down to around 500,000 and I'm trying to print the building by first creating a mesh.
I tried using CloudCompare, Meshlab and PDAL, using Poisson surface re... | <p>The foundation of any 3D printer is the controller and the firmware. Many devices are based on Arduino type controllers, with stepper motor driver boards either integrated or added as a plug-in component.</p>
<p>Some manufacturers will use in-house or outside resources and develop their own boards and firmware.</p>... | <p>this is an extension to fred_dot_u answer.
As I am in the process of building my own printer, I decided to use RAMPS Arduino shield for electronics and Marlin firmware + Arduino mega2560 as a logic controller. </p>
<p>As above are battle-tested, I don't need to discover wheel again, but rather focus on the mechani... | 885 |
<p>I'm looking for a tool ($, free, open source; I don't care) that will allow me to view not just the memory statistics for a .NET program, but also the object hierarchy. I'd really like to be able to drill down each thourgh each object and view it's foot print, as well as all the object's it references.</p>
<p>I've ... | <p>I have used JetBrains DotTrace and Redgate Ants, both of which I would recommend. A lesser known profiler I have also used is .Net Memory Profiler (<a href="http://memprofiler.com/" rel="nofollow noreferrer">http://memprofiler.com/</a>), which at the time I used it provided a different perspective on memory usage t... | <p><a href="http://www.jetbrains.com/profiler/" rel="nofollow noreferrer">JetBrains dottrace profiler</a> is the best. I wouldn't work without it. It is hard to find a tool that is free and performs well in this arena. Dottrace is hands down the best profiler I have used for .Net.</p>
| 7,296 |
<p>I mostly use Java and generics are relatively new. I keep reading that Java made the wrong decision or that .NET has better implementations etc. etc.</p>
<p>So, what are the main differences between C++, C#, Java in generics? Pros/cons of each?</p>
| <p>I'll add my voice to the noise and take a stab at making things clear:</p>
<h2>C# Generics allow you to declare something like this.</h2>
<pre><code>List<Person> foo = new List<Person>();
</code></pre>
<p>and then the compiler will prevent you from putting things that aren't <code>Person</code> into the ... | <p>NB: I don't have enough point to comment, so feel free to move this as a comment to appropriate answer.</p>
<p>Contrary to popular believe, which I never understand where it came from, .net implemented true generics without breaking backward compatibility, and they spent explicit effort for that.
You don't have to ... | 5,162 |
<p>Are there any <strong>good</strong> grid-hosting companies out there that offer .NET stacks? Something like MediaTemple - which won't host the worlds fastest websites, but for the price is far better than "shared hosting". I've used Rackspace's Mosso, but it sucked - it never felt like a normal .NET stack (caching w... | <p>Try <a href="http://www.gogrid.com" rel="noreferrer">gogrid.com</a> they seem to have a very nice following in the cloud computing circles.</p>
| <p>can talk a bit more about the not so normal .net experience? I was thinking to go for Mosso...</p>
| 2,631 |
<p>At my job, I have a clutch of six Windows services that I am responsible for, written in C# 2003. Each of these services contain a timer that fires every minute or so, where the majority of their work happens.</p>
<p>My problem is that, as these services run, they start to consume more and more CPU time through eac... | <p>It's obviously pretty difficult to remotely debug you're unknown application... but here are some things I'd look at:</p>
<ol>
<li>What happens when you only run one of the services at a time? Do you still see the slow-down? This may indicate that there is some contention between the services.</li>
<li>Does the p... | <blockquote>
<p>Good suggestions, but rest assured, we have tried all of the usual troubleshooting. What I'm hoping is that this is a .NET issue that someone might know about, that we can work on solving.</p>
</blockquote>
<p>My feeling is that no matter how bizarre the underlying cause, the usual troubleshooting st... | 4,575 |
<p>Could someone recommend any good resources for creating Graphics User Interfaces, preferably in C/C++?</p>
<p>Currently my biggest influence is <a href="http://www.3dbuzz.com" rel="nofollow noreferrer">3DBuzz.com</a>'s <a href="http://www.3dbuzz.com/xcart/product.php?productid=30&cat=12&page=1" rel="nofollo... | <p>I wouldn't use OpenGL for the GUI unless you are planning for hardware accelerated and/or 3D effects that you don't think you would get with a more traditional GUI toolkit (e.g <a href="http://trolltech.com/" rel="nofollow noreferrer">Qt</a>, <a href="http://www.wxwidgets.org/" rel="nofollow noreferrer">wxWidgets</a... | <p>I'll second Qt. It's cross platform, and I found it <em>much</em> easier to work with than the built in Visual Studio GUI stuff. It's dual-licensed, so if you don't want your code to be GPL you could purchase a license instead.</p>
| 3,456 |
<p>I'm seeing the following pattern on my Prusa clone:</p>
<p><a href="https://i.stack.imgur.com/uskfa.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/uskfa.jpg" alt="Photo of low quality second layer print"></a></p>
<p>The first layer prints OK, layer adhesion to the bed is good. The second layer shows the... | <p>I wouldn't describe that as an "OK" first layer. The nozzle is either too far from the bed, or you're underextruding. Underextrusion also looks like the cause of your second layer problems.</p>
| <p>Your first layer is horribly misscalibrated as well. </p>
<p>You really should do all calibrations over. Including your firmware when your result is this bad. </p>
<p>Following. Let's just assume your firmware is set right. And that your flow is right as well. The second layer speaks loudly of overcooked dribbling... | 434 |
<p>I am running an application through gdb and I want to set a breakpoint for any time a specific variable is accessed / changed. Is there a good method for doing this? I would also be interested in other ways to monitor a variable in C/C++ to see if/when it changes.</p>
| <p><em>watch</em> only breaks on write, <em>rwatch</em> let you break on read, and <em>awatch</em> let you break on read/write.</p>
<p>You can set read watchpoints on memory locations:</p>
<pre><code>gdb$ rwatch *0xfeedface
Hardware read watchpoint 2: *0xfeedface
</code></pre>
<p>but one limitation applies to the rw... | <p>In addition to what has already been answered/commented by <a href="https://stackoverflow.com/users/5577/asksol">asksol</a> and <a href="https://stackoverflow.com/users/2508150/paolo-m">Paolo M</a></p>
<p>I didn't at first read understand, why do we need to cast the results. Though I read this: <a href="https://sour... | 8,330 |
<p><a href="https://stackoverflow.com/questions/180/function-for-creating-color-wheels">Original Question</a></p>
<p>If you are given N maximally distant colors (and some associated distance metric), can you come up with a way to sort those colors into some order such that the first M are also reasonably close to bein... | <p>This also sounds to me like some kind of <em>resistance graph</em> where you try to map out the path of least resistance. If you inverse the requirements, path of maximum resistance, it could perhaps be used to produce a set that from the start produces maximum difference as you go, and towards the end starts to go ... | <p>Do you mean that from a set of N colors, you need to pick M colors, where M < N, such that M is the <em>best</em> representation of the N colors in the M space?</p>
<p>As a better example, reduce a true-color (24 bit color space) to a 8-bit mapped color space (GIF?).</p>
<p>There are quantization algorithms for... | 2,374 |
<p>Below is my current char* to hex string function. I wrote it as an exercise in bit manipulation. It takes ~7ms on a AMD Athlon MP 2800+ to hexify a 10 million byte array. Is there any trick or other way that I am missing?</p>
<p>How can I make this faster?</p>
<p>Compiled with -O3 in g++</p>
<pre><code>static con... | <p>At the cost of more memory you can create a full 256-entry table of the hex codes:</p>
<pre><code>static const char _hex2asciiU_value[256][2] =
{ {'0','0'}, {'0','1'}, /* ..., */ {'F','E'},{'F','F'} };
</code></pre>
<p>Then direct index into the table, no bit fiddling required.</p>
<pre><code>const char *pHex... | <p>Make sure your compiler optimization is turned on to the highest working level.</p>
<p>You know, flags like '-O1' to '-03' in gcc.</p>
| 9,459 |
<p>Is there a realistic way of implementing a multi-threaded model in PHP whether truly, or just simulating it. Some time back it was suggested that you could force the operating system to load another instance of the PHP executable and handle other simultaneous processes.</p>
<p>The problem with this is that when the... | <h1>Multi-threading is possible in php</h1>
<p>Yes you can do multi-threading in PHP with <a href="https://github.com/krakjoe/pthreads" rel="noreferrer">pthreads</a> </p>
<p>From <a href="http://www.php.net/manual/en/intro.pthreads.php" rel="noreferrer">the PHP documentation</a>:</p>
<blockquote>
<p>pthreads is an... | <p>Multithreading means performing multiple tasks or processes simultaneously, we can achieve this in php by using following code,although there is no direct way to achieve multithreading in php but we can achieve almost same results by following way.</p>
<pre><code>chdir(dirname(__FILE__)); //if you want to run this... | 9,634 |
<p>Once I've called <code>DragManager.acceptDrag</code> is there any way to "unaccept" the drag? Say that I have a view which can accept drag and drop, but only in certain areas. Once the user drags over one of these areas I call <code>DragManager.acceptDrag(this)</code> (from a <code>DragEvent.DRAG_OVER</code> handler... | <p>Are you using only the dragEnter method? If you are trying to reject the drag while still dragging over the same component you need to use both the dragEnter and dragOver methods.</p>
<p>Check out this example:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adob... | <p>ok, I see the problem now. Rather than null, try setting it to the dragInitiator.</p>
<p>Check this out.</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
impo... | 3,204 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.