instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>I have a problem with IIS 6.0 ceasing to work for an ASP.NET application after installing Service Pack 1 for <code>.NET 3.5</code>.</p>
<p>I have 2 identical virtual dedicated servers. Installing SP1 on the first had no adverse effect. Installing it on the second caused ASP.NET pages to start returning 404 page not... | <p>This is broad problem, so let's start by asking some troubleshooting questions:</p>
<blockquote>
<ul>
<li>Based on your description, the ASP.NET runtime is not catching your request and processing the aspx files. You may need to register the asp.net pipeline with IIS again using ASPNET_REGIIS -i.</li>
<li>Ha... | <p>No-one did before, so I'll point to the trivial solution:<br>
Have you already de-installed the Service Pack and re-installed it again (or the whole framework)?</p>
<p>Edit: @Kev:<br>
Easy explanation: He said the update works on one machine, but not on the other. I had similar problems in the past and re-installin... | 3,574 |
<p>As a general rule, I prefer using value rather than pointer semantics in C++ (ie using <code>vector<Class></code> instead of <code>vector<Class*></code>). Usually the slight loss in performance is more than made up for by not having to remember to delete dynamically allocated objects.</p>
<p>Unfortunate... | <p>Since the objects of different classes will have different sizes, you would end up running into the slicing problem if you store them as values.</p>
<p>One reasonable solution is to store container safe smart pointers. I normally use boost::shared_ptr which is safe to store in a container. Note that std::auto_ptr i... | <p>I'm using my own templated collection class with exposed value type semantics, but internally it stores pointers. It's using a custom iterator class that when dereferenced gets a value reference instead of a pointer. Copying the collection makes deep item copies, instead of duplicated pointers, and this is where mos... | 6,234 |
<p>Selecting a large amount of text that extends over many screens in an IDE like Eclipse is fairly easy since you can use the mouse, but what is the best way to e.g. select and delete multiscreen blocks of text or write e.g. three large methods out to another file and then delete them for testing purposes in Vim when ... | <p>Well, first of all, you can set <code>vim</code> to work with the mouse, which would allow you to select text just like you would in <code>Eclipse</code>.</p>
<p>You can also use the Visual selection - <kbd>v</kbd>, by default. Once selected, you can <code>yank</code>, <code>cut</code>, etc.</p>
<p>As far as comm... | <p>v enters visual block mode, where you can select as if with shift in most common editors, later you can do anything you can normally do with normal commands (substitution :'<,'>s/^/#/ to prepend with a comment, for instance) where '<,'> means the selected visual block instead of all the text.</p>
| 8,298 |
<p>I'm trying to create a custom workflow action with an output parameter for error handling. Working from various examples, I can't get Parameter Direction="Out" to work. Everything seems right, but when I try to assign the output to the "error" variable in SharePoint Designer, it places asterisks around it and flags... | <p>I think you may want Direction="InOut" from the looks of the binding</p>
| <p>Are you sure the issue is with the parameters and not maybe the variable in SPD? Certainly nothing looks wrong with your XML.</p>
<p>I always hated the way SPD and workflows make you create a variable within the workflow and another within the page to assign to the same value as the workflow variable.</p>
| 3,583 |
<p>As of the fall of 2008 I'm about to embark on a new development cycle for a major product that has a winforms and an asp.net interface. We use Telerik, DevExpress and Infragistics components in it and all are going to have a release within a month or so which will be the one I target for our spring release of our p... | <p>It's worth it. It's faster, the designer is vastly improved (split view, faster context switching), it has better support for javascript and when you're ready to target 3.5, you'll be ready to go.</p>
| <p>It is worth the upgrade for me for the main reason that I can target different .NET versions (2, 3, 3.5) from the same IDE whereas in the past, one version of Visual Studio supported one version of .NET.</p>
<p>The UI seems much more responsive now, but the core set of tools and processes hasn't changed that much.<... | 9,047 |
<p>I have the following webform:</p>
<pre><code><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="TestWebApp.Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="h... | <p>can't help with VB6 solution, can help with .net or java solution on the server.<br>
Get iText or iTextSharp from <a href="http://www.lowagie.com/iText/" rel="nofollow noreferrer">http://www.lowagie.com/iText/</a>.<br>
It has a PdfStamper class that can merge a PDF and FDF FDFReader/FDFWriter classes to generate F... | <p>Take my advice. Ditch PDF for XPS. I am working on two apps, both server based. One displays image-based documents as PDFs in a browser. The second uses FixedPage templates to construct XPS documents bound to data sources. </p>
<p>My conclusion after working on both projects is that PDFs suck; XPS documents le... | 7,845 |
<p>I'm working on a WinCE 6.0 system with a touchscreen that stores its calibration data (x-y location, offset, etc.) in the system registry (HKLM\HARDWARE\TOUCH). Right now, I'm placing the cal values into registry keys that get put into the OS image at build time. That works fine for the monitor that I get the orig... | <p>I think what you're probably looking for is the Flush function of the RegistryKey class. This is normally not necessary (the registry is lazily-flushed by default), but if the power is turned off on the device before the system has a chance to do this, changes will be discarded:</p>
<p><a href="http://msdn.microsof... | <p>As I understood you need to know how to set a value to the registry during runtime. I hope the codes bellow can help you.</p>
<p>using Microsoft.Win32; </p>
<pre><code> /// <summary>
/// store a key value in registry. if it don't exist it will be created.
/// </summary>
/// <pa... | 8,195 |
<p>A lot of consumer desktop F.D.M. printers comes with a 0.4mm nozzle. I'm looking to print fine details objects and I was considering trying to use a smaller size nozzle. But before I do so I would like to establish a list of downsides and unwanted consequences.</p>
| <p>Here are some things to look out for when switching to a smaller nozzle size:</p>
<ul>
<li><strong>Curling</strong> (out of the nozzle): Make sure the nozzle is clear of any debris to avoid the extruded filament from catching and therefore curling around the nozzle.</li>
<li><strong>Warping</strong>: You might expe... | <p>In addition to the <a href="https://3dprinting.stackexchange.com/a/2974/5740">answer</a> of <a href="https://3dprinting.stackexchange.com/users/98/tbm0115">tbm0115</a>; special care has to be given to the strength and stiffness of the model. Lines are thinner and thus when using the same amount of walls and infill p... | 414 |
<p>Reading through <a href="https://stackoverflow.com/questions/39879/why-doesnt-javascript-support-multithreading">this question</a> on multi-threaded javascript, I was wondering if there would be any security implications in allowing javascript to spawn mutliple threads. For example, would there be a risk of a malic... | <p>No, multiple threads would not add extra security problems in a perfect implementation. Threaded javascript would add complexity to the javascript interpreter which makes it more likely to have an exploitable bug. But threads alone are not going to add any security issues. </p>
<p>Threads are not present in javasc... | <p>Well I think that the only major example of multi-threaded javascript is Google's chrome (WOULD THEY RELEASE IT ALREADY JEEZ) and if I understand it the javascript will only one process per tab, so unless it started spawning tabs (popups) I would assume this would be a null issue, but I think that Google has that un... | 6,117 |
<p>Looking for books or other references that discuss actually <em>how</em> to write a code coverage tool in Java; some of the various techniques or tricks - source vs. byte code instrumentation. </p>
<p>This is for a scripting language that generates Java byte code under the hood.</p>
| <p>Does your scripting language generate bytecode? Does it generate debug metadata? If so, bytecode instrumentation is probably the way to go. In fact existing tools will probably work (perhaps with minimal modification).</p>
<p>The typical problem with such tools that they are written to work with Java and assume tha... | <p>Thxm, Mc! <a href="http://asm.objectweb.org" rel="nofollow noreferrer">http://asm.objectweb.org</a>/ is another one. <em>Excellent</em> documentation on byte code instrumentation, but nothing "directly" aimed at writing a coverage tool - just some hints or ideas.</p>
| 2,429 |
<p>I know that the SLS 3D printer stands for selective laser sintering,where as DMLS stands for direct metal laser sintering.</p>
<p>I want to know that,can i convert SLS 3D printer to DMLS.</p>
<p>By just changing powder(or another way?)</p>
| <p>By just changing powder: No.<br>
Changing the powder, the laser and the chamber, maybe you can get something, but it's not recommended.<br>
DMLS machines use a sealed chamber with a flow of Argon, Nitrogen, or other gas to prevent oxidation of metal powder (and avoid fire or explosions).<br>
Laser power for metal ne... | <p>Totally agreed with the answer provided.To add to that answer, the use of DMLS lies on the thickness and material limitations of SLS method. So, regarding the amount of thickness, the <a href="http://www.atlanticprecision.com" rel="nofollow">original source</a> of sizing for both the methods vary drastically and hen... | 291 |
<p>I have used cyanoacrylate glue aka superglue to bond PLA. I have created several electronics enclosures. (Definitely the most time-consuming part of the project.)</p>
<p>Now my question is which debonder/solvent can I use to separate the pieces again without destroying the PLA parts?</p>
<p>Wikipedia proposes the ... | <p><strong>Acetone</strong></p>
<p>Acetone will dissolve cynoacrylate (superglue) and should weaken it enough to be able to separate the parts.<br>
A readily available cheap source of acetone is nail varnish remover (just make sure you don't buy the acetone free version!).<br>
Give the pieces a soak in nail varnish re... | <p>Gamma butyrolactone is by far the best product to remove cyanoacrylate and also great to dissolve PLA.</p>
| 380 |
<p>I enjoy programming, usually. Tedious stuff is easy to get done as quickly and correctly as possible so I can get through it and not have to see it again.</p>
<p>But a lot of my coding is <em>fun</em> and when I get in the 'zone' I just really enjoy myself.</p>
<p>Which is where I make the mistake of spending too... | <p>Keep a detailed prioritized feature list/bug list. review it often then balance the fun work with bugs/features that need to get done.</p>
| <p>Justify any "fun" features you insert by regarding them as marketable eye-candy.</p>
<p>Unless, of course, they're not visible ;)</p>
| 8,508 |
<p>How would you describe and promote WCF as a technology to a non-technical client/manager/CEO/etc?</p>
<p>What are competing solutions or ideas that they might bring up(such as those they read about in their magazines touting new technology)?</p>
<p>What is WCF <em>not</em> good for that you've seen people try to s... | <p>Comparing with .asmx: WCF is the next generation of Microsoft's Web service development platform, which addresses many of the issues with older versions, specifically:</p>
<ul>
<li>better interoperation, so you can interoperate with Web services that aren't from Microsoft or that are published on the Internet</li>
... | <p>In a single sentence, I'd say that WCF is "software that lets you set up and manage communication between systems a lot more efficiently than in the past".</p>
<p>I can see them bringing up BizTalk as a competitor, but of course you could say that WCF works with it and is in fact used as base technology for it in t... | 7,281 |
<p>What is the correct way to get the process size on <code>Solaris, HP-UX</code> and <code>AIX</code>? Should we use <code>top</code> or <code>ps -o vsz</code> or something else?</p>
| <p>The exact definitions of <code>vsize</code>, <code>rss</code>, <code>rprvt</code>, <code>rshrd</code>, and other obscure-looking abbreviations vary from OS to OS. The manual pages for the <code>top</code> and <code>ps</code> commands will have some sort of description, but all such descriptions are simplified great... | <p>Yes, you are right to lock at the VSZ.</p>
<p><code>ps u</code> will give you the VSZ and RSS, which are the virtual memory size and resident set size. The RSS is how much physical memory has been allocated to the process, and the VSZ is the virtual memory size of the process. If you have several copies of a prog... | 2,351 |
<p>I have quite a few developers asking me if certain SQL jobs ran, and I would like to give them access to check it on their own without giving them <code>sysadmin</code> rights. I know that in <code>SQL 2005</code>, you can grant them the <code>SQLAgentReaderRole</code>, but I am looking for a solution in <code>SQL ... | <p>Pretty sure there isn't one out of the box. This thread seems to be pretty decent...halfway down they discuss creating a role and then locking that down further. Also you could just create a mini-program (sp even?) to email the results of the job as a summary, or add to each job an on completion event to email an ... | <p>Looks like there's some hope for those of us still working with 2000 -</p>
<p>"In order to accomplish this in SQL Server 2000 the DBA must add the user to TargetServersRole role in MSDB database. Prior to Service Pack 3 on SQL Server 2000 the user must be added to the sysadmin group in order to get a chance to view... | 9,289 |
<p>I have two identical tables and need to copy rows from table to another. What is the best way to do that? (I need to programmatically copy just a few rows, I don't need to use the bulk copy utility).</p>
| <p>As long as there are no identity columns you can just </p>
<pre><code>INSERT INTO TableNew
SELECT * FROM TableOld
WHERE [Conditions]
</code></pre>
| <p>To select only few rows..This will work like charm..</p>
<pre><code>SELECT TOP 10 *
INTO db2.dbo.new_table
FROM db1.dbo.old_table;
</code></pre>
<p>Note : Just create a new table in the required db..We need not define its structure.</p>
| 8,137 |
<p>Does anybody know of a tool to test OCSP responses? Preferably, something that can be used from a Windows Command-line and/or can be included (easily) in a Java/python program </p>
| <p>Looking a bit more, I think I've found some answers:</p>
<p>a) OpenSSL at the rescue:</p>
<pre><code>openssl ocsp -whatever
</code></pre>
<p>For more info, <a href="http://www.openssl.org/docs/apps/ocsp.html" rel="nofollow noreferrer">http://www.openssl.org/docs/apps/ocsp.html</a></p>
<p>b) <a href="http://www.o... | <p>Can you test it over HTTP as described in the specs in Appendix A? If so, then you can use any web test util. Since you mentioned Java, <a href="http://jakarta.apache.org/jmeter/" rel="nofollow noreferrer">JMeter</a> comes to mind. With JMeter, you can create your java code to do validation, etc and re-use it in ... | 9,695 |
<p>This isn't a design question, really, though it may seem like it. (Well, okay, it's kind of a design question). What I'm wondering is why the C++ <code>std::fstream</code> classes don't take a <code>std::string</code> in their constructor or open methods. Everyone loves code examples so:</p>
<pre><code>#include <... | <p>By taking a C string the C++03 <a href="http://en.cppreference.com/w/cpp/io/basic_fstream" rel="noreferrer"><code>std::fstream</code></a> class reduced dependency on the <code>std::string</code> class. In C++11, however, the <code>std::fstream</code> class does allow passing a <code>std::string</code> for its constr... | <p>Is there any class in STL that takes a string... I dont think so (couldnt find any in my quick search). So it's probably some design decision, that no class in STL should be dependent on any other STL class (that is not directly needed for functionality).</p>
| 5,222 |
<p>What I want to achieve is this. I want to give the user the ability to upload an image file, store the image in BLOB in SQL Server, and then use this image as a logo in other pages of the site. </p>
<p>I have done this by using </p>
<pre><code> Response.Clear();
Response.ContentType = "image/pjpeg";
Respo... | <p>Add a 'Generic Handler' to your web project, name it something like Image.ashx. Implement it like this:</p>
<pre><code>public class ImageHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
using(Image image = GetImage(context.Request.QueryString["ID"]))
{
... | <p>We actually just released some classes that help with exactly this kind of thing:</p>
<p><a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=16449" rel="nofollow noreferrer">http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=16449</a></p>
<p>Specifically, check out the... | 4,191 |
<p>What would be a good place to go to understand arrows? Ideally, I am just looking for some place with a concise definition with motivation from some good examples, something similar to Wadler's exposition on monads.</p>
| <p><a href="http://en.wikibooks.org/wiki/Haskell/Understanding_arrows" rel="nofollow noreferrer"><a href="http://en.wikibooks.org/wiki/Haskell/Understanding_arrows" rel="nofollow noreferrer">http://en.wikibooks.org/wiki/Haskell/Understanding_arrows</a></a></p>
| <p>If you learn better from practice than theory, try using <a href="http://www.fh-wedel.de/~si/HXmlToolbox/" rel="nofollow noreferrer">HXT</a> for XML manipulation, or <a href="http://www.cs.helsinki.fi/u/ekarttun/PArrows/" rel="nofollow noreferrer">PArrows</a> for general parsing. They both have APIs centered around... | 9,060 |
<p>I'm returning to c++ after being away for a bit and trying to dust off the old melon. </p>
<p>In Java Iterator is an interface to a container having methods: <code>hasNext()</code>, <code>next()</code> and <code>remove()</code>. The presence of <code>hasNext()</code> means it <strong>has the concept of a limit</str... | <p>Yes, there is a large conceptual difference. C++ utilizes different "classes" of iterators. Some are used for random access (unlike Java), some are used for forward access (like java). While even others are used for writing data (for use with, say, <code>transform</code>). </p>
<p>See the iterators concept in the <... | <p>Iterators are only equivalent to pointers in the trivial case of iterating over the contents of an array in sequence. An iterator could be supplying objects from any number of other sources: from a database, from a file, from the network, from some other calculation, etc.</p>
| 8,026 |
<p>I'm having a similar issue to <a href="https://3dprinting.stackexchange.com/questions/1207/how-to-remove-a-pla-print-stack-to-a-buildtak-sheet">this one</a>: I have retrofitted my printer with a BuildTak sticker. I'm printing PLA at 60°C bed temperature - currently using a 0.3 mm nozzle, but I had similar issues wit... | <p>Try printing with the heated printbed off. Heat makes the pla stick more to buildtak</p>
| <p>These are more like backups for when the part gets stuck, but you could try spraying that part where it meets the bed with liquid computer duster. The shrinkage from cooling usually helps to release the part from the bed. You could also try heating the bed very hot to save the bed at the expense of the part.</p>
| 554 |
<p>I once had the task of determining the following performance parameters from inside a running application:</p>
<ul>
<li>Total virtual memory available</li>
<li>Virtual memory currently used</li>
<li>Virtual memory currently used by my process<hr></li>
<li>Total RAM available</li>
<li>RAM currently used</li>
<li>RAM ... | <h2>Windows</h2>
<p>Some of the above values are easily available from the appropriate Win32 API, I just list them here for completeness. Others, however, need to be obtained from the Performance Data Helper library (PDH), which is a bit "unintuitive" and takes a lot of painful trial and error to get to work.... | <p>I used this following code in my C++ project and it worked fine:</p>
<pre><code>static HANDLE self;
static int numProcessors;
SYSTEM_INFO sysInfo;
double percent;
numProcessors = sysInfo.dwNumberOfProcessors;
//Getting system times information
FILETIME SysidleTime;
FILETIME SyskernelTime;
FILETIME SysuserTime; ... | 8,874 |
<p>I've been tasked with <em>improving the performance of an ASP.NET 2.0 application</em>.<br> The page I'm currently focused on has many problems but one that I'm having trouble digging into is the render time of the page. Using Trace.axd the duration between Begin Render and End Render is 1.4 seconds. From MSDN I ... | <p>Download ANTS PROFILER, this will give you a perfect overview of the lines causing the slowdown.</p>
<p>Also when it's about rendering make sure you don't use to much string concats (like string += "value") but use StringBuilders to improve performance.</p>
| <p>It may not help if the problem is inside one of your controls - as you expect - but if the page is poorly designed and that's causing render to be slow, <a href="http://developer.yahoo.com/yslow/" rel="nofollow noreferrer">YSlow</a> should help clean that up.</p>
| 3,632 |
<p>Is there some reasonably cross platform way to create a thumbnail image given a URL? I know there are thumbnail web services that will do this, but I want a piece of software or library that will do this locally. I guess in Linux I could always spawn a browser window using a headless X server, but what about Windows... | <p>You can use Firefox or XULRunner with some fairly simple XUL to create thumbnails as PNG dataURLs (that you could then write to file if needed). Robert O'Callahan has some excellent information on it here:</p>
<p><a href="http://weblogs.mozillazine.org/roc/archives/2005/05/rendering_web_p.html" rel="nofollow norefe... | <p>There are a number of commercial packages that will do what you want. I'm not sure from reading your question if free is a requirement. But here are some applications I've found that are reasonably priced and which do exactly what you want. I have not used them myself, but they have free trial downloads so you ca... | 9,082 |
<p>3D printing can be used to make injection molds of unimaginable complexity but which kind of 3D printing process is suitable when? </p>
<p>Suppose that a part is to be made using injection molding in large quantity for an extended period of time, what Additive Manufacturing (AM) process will be the best, such that ... | <p>Yes, this is very broad. That said...</p>
<p>For high detail you want SLA. i.e. jewelry. If you just want a prototype of a mold, you can do a standard FDM style printer (95% of printers are FDM, and that number is a guess)</p>
<p>Really, you should be asking what material you need for your mold, but you can open a... | <p>Injection molds generally require tooling and are not usually cast from 3D prints. Depending on the size of your part - costs can easily skyrocket to over $60,000. The price per part is sometimes lower than other methods. Other possible methods (depending on the part) are Thermo-Forming, Vacu-Forming, and differe... | 450 |
<p>I’m designing a part that will need to be autoclaved—it will be under steam at 121°C for about 15 min per job and I will want it to be able to go through the autoclave repeatedly. I ran a test PLA part through the autoclave and it warped noticeably; based on their glass transition temperatures, ABS (105ºC) and PETG ... | <p>It might seem that common 3D printer materials such as PLA and ABS should be capable of being autoclaved—unfortunately. However, although their melting temperatures are higher than autoclave temperature (typically 121ºC), their glass transition temperatures are below that limit so they can warp or undergo creep defo... | <p>You need to order the part printed by an SLA machine in PA, preferably with 10 % mineral or glass content. The heat deflection temperature is suitably high for any autoclaving you'll do, and the material will resist most every that your lab and throw at it. I also went down this road with a part for my own lab ... | 1,320 |
<p>I want to make Polyurethane molds for <strong>concrete</strong> using 3D printed PLA or ABS master object. like this video:</p>
<p><div class="youtube-embed"><div>
<iframe width="640px" height="395px" src="https://www.youtube.com/embed/UhkrEm5XtRU?start=0"></iframe>
</div></div> (this ... | <p>In my experience, polyurethane sticks to PLA like super glue, not good. But silicone and alginate doesn't stick at all.</p>
<p>What I do is print the model of the mold with PLA or ABS, no matter. Then, cast a mold of the PLA model of the mold with alginate, then you have the negative of your mold.</p>
<p>Now with th... | <h2>Temperature</h2>
<p>As polyurethane cures (or hardens), it undergoes a chemical bonding reaction, linking the mono- and oligomer strings in the components into long polyurethane chains. <a href="http://www.essentialchemicalindustry.org/polymers/polyurethane.html" rel="nofollow noreferrer">The chemical reaction is e... | 1,481 |
<p>If you're using Opera 9.5x you may notice that our client-side <a href="http://docs.jquery.com/Plugins/Validation" rel="noreferrer">JQuery.Validate</a> code is disabled here at Stack Overflow.</p>
<pre><code>function initValidation() {
if (navigator.userAgent.indexOf("Opera") != -1) return;
$("#post-text").... | <p>turns out the problem was in the</p>
<pre><code>{ debug : true }
</code></pre>
<p>option for the JQuery.Validate initializer. <strong>With this removed, things work fine in Opera.</strong> Thanks to Jörn Zaefferer for helping us figure this out!</p>
<p>Oh, and the $50 will be donated to the JQuery project. :)</p>... | <p>I can't seem to reproduce this bug. Can you give more details?</p>
<p>I have my copy of Opera masquerading as Firefox so the validation should be executing:</p>
<pre><code>>>> $.browser.opera
false
</code></pre>
<p>When I go to the edit profile page and enter a malformed date, the red text comes up and ... | 3,014 |
<p>I have binary data in a file that I can read into a byte array and process with no problem. Now I need to send parts of the data over a network connection as elements in an XML document. My problem is that when I convert the data from an array of bytes to a String and back to an array of bytes, the data is getting... | <p>If you encode it in base64, this will turn any data into ascii safe text, but base64 encoded data is larger than the orignal data</p>
| <p>How are you building your XML document? If you use java's built in XML classes then the string encoding should be handled for you.</p>
<p>Take a look at the javax.xml and org.xml packages. That's what we use for generating XML docs, and it handles all the string encoding and decoding quite nicely.</p>
<p>---EDIT... | 4,110 |
<p>I have the Xming X Window Server installed on a laptop running Windows XP to connect to some UNIX development servers. </p>
<p>It works fine when I connect directly to the company network in the office. However, it does not work when I connect to the network remotely over a VPN.</p>
<p>When I start Xming when conn... | <p>Chances are it's either X authentication, the X server binding to an interface, or your DISPLAY variable. I don't use Xming myself but there are some general phenomenon to check for. One test you can do to manually verify the DISPLAY variable is correct is:</p>
<ol>
<li>Start your VPN. Run ipconfig to be sure you h... | <p>Haven't have the exact problem, but I think you need to look at the xhost and make sure that the vpn remote is allowed to send data to the x server. </p>
<p>This link might help:
<a href="http://www.straightrunning.com/XmingNotes/trouble.php" rel="nofollow noreferrer">http://www.straightrunning.com/XmingNotes/troub... | 2,650 |
<p>Is there any convention on how to mark an all metal hotend to distinguish it from a hotend with a PTFE tube in the heatbreak? Once assembled for a German Riprap 3D printer, they look exactly the same on the outside. I'm trying to decide on a way of marking them to indicate the difference.</p>
<p>Hotend with heatsi... | <p>Given your heatbreaks are the same material and external dimensions, it seems that the most practical way to distinguish one from the other would be to mount the all metal heatbreaks in a heat sink that's anodized to some other color than natural aluminum -- red or blue, for instance.</p>
<p>If you can't buy them th... | <p>Usually, the neck of an all-metal heat break would be thinner (as it does not need to contain the PTFE tube, and making it overly thick would conduct heat unneccesarily). This may be observable when one loses track of what is where.
If one needs to see at a glance, I do not think there is a convention.</p>
| 1,971 |
<p>I have an application with one form in it, and on the Load method I need to hide the form. </p>
<p>The form will display itself when it has a need to (think along the lines of a outlook 2003 style popup), but I can' figure out how to hide the form on load without something messy.</p>
<p>Any suggestions?</p>
| <p>I'm coming at this from C#, but should be very similar in vb.net.</p>
<p>In your main program file, in the Main method, you will have something like:</p>
<pre><code>Application.Run(new MainForm());
</code></pre>
<p>This creates a new main form and limits the lifetime of the application to the lifetime of the main... | <p>Here is a simple approach:<br>
It's in C# (I don't have VB compiler at the moment)</p>
<pre><code>public Form1()
{
InitializeComponent();
Hide(); // Also Visible = false can be used
}
private void Form1_Load(object sender, EventArgs e)
{
Thread.Sleep(10000);
Show(); // Or visible = true;
}
</code><... | 9,564 |
<p>Is the standard Java 1.6 <a href="http://java.sun.com/javase/6/docs/api/javax/xml/parsers/DocumentBuilder.html" rel="noreferrer">javax.xml.parsers.DocumentBuilder</a> class thread safe? Is it safe to call the parse() method from several threads in parallel?</p>
<p>The JavaDoc doesn't mention the issue, but the <a h... | <p>Even though DocumentBuilder.parse appears not to mutate the builder it does on the Sun JDK default implementation (based on Apache Xerces). Eccentric design decision. What can you do? I guess use a ThreadLocal:</p>
<pre><code>private static final ThreadLocal<DocumentBuilder> builderLocal =
new ThreadLocal... | <p>You can also check this code to make further optimization <a href="https://svn.apache.org/repos/asf/shindig/trunk/java/common/src/main/java/org/apache/shindig/common/xml/XmlUtil.java" rel="nofollow">https://svn.apache.org/repos/asf/shindig/trunk/java/common/src/main/java/org/apache/shindig/common/xml/XmlUtil.java</a... | 8,081 |
<p>I have this CTC i3 printer; when I print square test prints, as it moves along the Y-axis back to zero (front). It extrudes lines but very thin or none at all.</p>
<p>But opposite direction along the Y axis is 100 % </p>
<p><img src="https://i.stack.imgur.com/BChHj.jpg" alt="enter image description here"></p>... | <p>Without images of the problem it is difficult to diagnose, but, the described symptoms sounds as if the nozzle is too close to the bed. If the nozzle is too close to the bed, and the extruder not strong enough, the filament flow is very limited due to pressure caused by a very small opening between the nozzle and th... | <p>Clearly you're having an extrusion problem. Extrusion problems usually come either from a clogged nozzle (as @Adam S. said) or from the extruder it self. To determine where the problem is located I would first do a flow rate test using <a href="https://www.youtube.com/watch?v=lWBkPIXTOlo&feature=emb_logo" rel="n... | 1,661 |
<p>I'm trying to do this (which produces an unexpected T_VARIABLE error):</p>
<pre><code>public function createShipment($startZip, $endZip, $weight =
$this->getDefaultWeight()){}
</code></pre>
<p>I don't want to put a magic number in there for weight since the object I am using has a <code>"defaultWeight"</code> ... | <p>This isn't much better:</p>
<pre><code>public function createShipment($startZip, $endZip, $weight=null){
$weight = !$weight ? $this->getDefaultWeight() : $weight;
}
// or...
public function createShipment($startZip, $endZip, $weight=null){
if ( !$weight )
$weight = $this->getDefaultWeight();... | <p>Improving upon Kevin's answer if you are using PHP 7 you may do:</p>
<pre><code>public function createShipment($startZip, $endZip, $weight=null){
$weight = $weight ?: $this->getDefaultWeight();
}
</code></pre>
| 2,383 |
<p>This is a line drawing and I would like to print it a couple of mm high. I cannot figure out how to get this line drawing filled. I converted to SVG with Inkscape, used GIMP, took it online to TinkerCad and tried it with Onshape but all I ever get is just the line and this does not work well on my printer. What is a... | <p>If you don't mind adding another tool to your toolbox, you can use a plug-in for Inkscape called <a href="https://www.thingiverse.com/thing:14221" rel="nofollow noreferrer">Inkscape OpenSCAD DXF Export</a> that will convert your SVG drawing to appropriate code to import to <a href="http://www.openscad.org/" rel="nof... | <p>Free 3D printing program <a href="https://www.nanodlp.com" rel="nofollow noreferrer">NanoDLP</a> does support extruding single image frame to 3D object in required height. You can use Windows or Linux version of the program.</p>
| 645 |
<p>Here's my first question at SO.</p>
<p>I have a internal application for my company which I've been recently ask to maintain. The applications is built in PHP and its fairly well coded (OO, DB Abstraction, Smarty) nothing WTF-ish. </p>
<p>The problem is the applications is <strong>very slow</strong>.</p>
<p>How d... | <p>I've used <a href="http://www.xdebug.org/docs/profiler" rel="noreferrer">XDebug profiling</a> recently in a similiar situation. It outputs a full profile report that can be read with many common profiling apps ( Can't give you a list though, I just used the one that came with slackware ). </p>
| <p>We use Zend Development Environment (windows). We resolved a memory usage spike yesterday by stepping through the debugger while running Process Explorer to watch the memory/cpu/disk activity as each line was executed. </p>
<p>Process Explorer: <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"... | 7,955 |
<p>What is your favorite method to handle errors in Bash?
The best example of handling errors I have found on the web was written by William Shotts, Jr at <a href="http://www.linuxcommand.org" rel="noreferrer">http://www.linuxcommand.org</a>. </p>
<p>He suggests using the following function for error handling in Bash... | <p>Use a trap!</p>
<pre><code>tempfiles=( )
cleanup() {
rm -f "${tempfiles[@]}"
}
trap cleanup 0
error() {
local parent_lineno="$1"
local message="$2"
local code="${3:-1}"
if [[ -n "$message" ]] ; then
echo "Error on or near line ${parent_lineno}: ${... |
<p>Using trap is not always an option. For example, if you're writing some kind of re-usable function that needs error handling and that can be called from any script (after sourcing the file with helper functions), that function cannot assume anything about exit time of the outer script, which makes using traps very... | 9,039 |
<p>Working with software day-to-day usually means you have to juggle project work, meetings, calls and other interrupts.</p>
<p>What single technique, trick, or tool do you find most useful in managing your time?</p>
<p>How do you stay focused?</p>
<p>What is your single biggest distraction from your work?</p>
| <p>I read this rule somewhere, and I use it every day...</p>
<ul>
<li>If someone asks you to do something - if it takes less than 2 minutes, do it immediately. If it takes longer, put it on your list and come back to it.</li>
</ul>
<p>This really works for me.</p>
| <p>Single most useful? <a href="http://www.nowdothis.com" rel="nofollow noreferrer">http://www.nowdothis.com</a> is AWESOME for focusing on what currrently needs to get done, and has raised my productivity by tons. (Bonus tip: Use Google Chrome to make it its own application and then make the app always be on top of ot... | 9,675 |
<p>I have printed a couple weeks perfectly fine with my Ender 3. Two weeks ago I changed the firmware but the settings were all fine and resulted in good prints.</p>
<p>Now, suddenly <em>during</em> a print the extruder motor started to under-extrude.</p>
<p>I thought "hey, could be the file" and used a test file tha... | <p>A close inspection of what happened when printing the first layer resulted in this:</p>
<ul>
<li>The missing steps on the new print came from the nozzle scraping too close to the print surface, which lead to no first layer</li>
<li>Readjusting the Z-axis end stop, which had moved down, resulted in no more lost step... | <p>Sounds similar to something I experienced with my Y-axis. The grub screw on the toothed wheel had come a little loose, and I was experiencing a reasonably consistent degree of slip.</p>
<p>In the extruder particularly, these locking screws might not be too obvious to check.</p>
| 1,026 |
<p>I am working on a SharePoint application that supports importing multiple documents in a single operation. I also have an ItemAdded event handler that performs some basic maintenance of the item metadata. This event fires for both imported documents and manually created ones. The final piece of the puzzle is a ba... | <p>Sometimes I see the <code>ItemAdded</code> or <code>ItemUpdated</code> firing twice for a single operation.
You can try to put a breakpoint in the <code>ItemAdded()</code> method to confirm that.</p>
<p>The solution in my case was to single thread the <code>ItemAdded()</code> method:</p>
<pre><code>private static... | <p>I'll have to look into that and get back to you. The problem on my end seems to be that there is code running in a different class, in a different feature, being controlled by a different thread, all of which are trying to access the same record.</p>
<p>I am trying to avoid using a fixed delay. With any threading... | 4,237 |
<p>Given a select with multiple option's in jQuery. </p>
<pre><code>$select = $("<select></select>");
$select.append("<option>Jason</option>") //Key = 1
.append("<option>John</option>") //Key = 32
.append("<option>Paul</option>") //Key = 423
</code></pre>
... | <p>Like lucas said the value attribute is what you need. Using your code it would look something like this ( I added an id attribute to the select to make it fit ):</p>
<pre><code>$select = $('<select id="mySelect"></select>');
$select.append('<option value="1">Jason</option>') //Key = 1
.ap... | <p>If you are using HTML5, you can use a <a href="http://ejohn.org/blog/html-5-data-attributes/" rel="nofollow noreferrer">custom data attribute</a>. It would look like this:</p>
<pre><code>$select = $("<select></select>");
$select.append("<option data-key=\"1\">Jason</option>") //Key = 1
.a... | 4,683 |
<p>I was looking for a good free debugger for STP (Stored Procedures) as I need to make changes to a few of them as a part of my recent project. The stored procedures are stored in independent <code>.sql</code> files and not in the code.</p>
<p>A debugger would speed things up quite a it in my case. Could anyone recom... | <blockquote>
<p>The stored procedures are stored in independent '.sql' files and not in the code.</p>
</blockquote>
<p>In order to debug a proc it has to be created in the RDBMS and then executed, how will you debug a proc stored in a file?</p>
| <p>Yes, you are right. These stored procedures are called through code which has all the necessary libraries to connect to the database (RDBMS). </p>
<p>However, what I am looking for is to understand what the stored procedures do. At the moment I am using dbVisualizer for this. I have set up the connections to the RD... | 3,873 |
<p>In VB.NET is there a library of template dialogs I can use? It's easy to create a custom dialog and inherit from that, but it seems like there would be some templates for that sort of thing.</p>
<p>I just need something simple like Save/Cancel, Yes/No, etc. </p>
<p>Edit: MessageBox is not quite enough, because I ... | <p>Do you need something more than what can be provided by MsgBox?</p>
<pre><code>MsgBox("Do you want to see this message?", MsgBoxStyle.OkCancel + MsgBoxStyle.Information, "Respond")
</code></pre>
| <p>Are you unable to use the <a href="http://msdn.microsoft.com/en-us/library/aa335422(VS.71).aspx" rel="nofollow noreferrer">MessageBox class</a>?</p>
| 8,839 |
<p>I have a <code>String</code> representation of a date that I need to create a <code>Date</code> or <code>Calendar</code> object from. I've looked through <code>Date</code> and <code>Calendar</code> APIs but haven't found anything that can do this other than creating my own ugly parse method. I know there must be a w... | <p>In brief:</p>
<pre><code>DateFormat formatter = new SimpleDateFormat("MM/dd/yy");
try {
Date date = formatter.parse("01/29/02");
} catch (ParseException e) {
e.printStackTrace();
}
</code></pre>
<p>See <a href="http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html" rel="noreferrer"><code>Sim... | <p>Try this:</p>
<pre><code>DateFormat.parse(String)
</code></pre>
| 6,538 |
<p>I was wondering if I could access the iPhones Core Location framework over a website?</p>
<p>My goal is to build a webapp/website that the iPhone would browse to, then upload its current GPS location. This would be a simple site primary for friends/family so we could locate each other. I can have them manually ente... | <p>Why not simply use W3C <a href="https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/GettingGeographicalLocations/GettingGeographicalLocations.html" rel="nofollow noreferrer">GeoLocation</a> API available in mobile Safari? This will work on ipod touch as well (suburb... | <p>We built a really thin iphone client app that simply calls a predefined .js file on our site. Works like a charm. </p>
<p>See arisgames.org for the project.</p>
| 4,678 |
<p>What code analysis tools do you use on your Java projects?</p>
<p>I am interested in all kinds</p>
<ul>
<li>static code analysis tools (FindBugs, PMD, and any others)</li>
<li>code coverage tools (Cobertura, Emma, and any others)</li>
<li>any other instrumentation-based tools </li>
<li>anything else, if I'm missin... | <p>For static analysis tools I often use CPD, <a href="http://pmd.sourceforge.net" rel="noreferrer">PMD</a>, <a href="http://findbugs.sourceforge.net" rel="noreferrer">FindBugs</a>, and <a href="http://checkstyle.sourceforge.net" rel="noreferrer">Checkstyle</a>.</p>
<p><p>CPD is the PMD "Copy/Paste Detector" tool. I w... | <p>I am looking for many answers to learn about new tools and consolidate this knowledge in a one question/thread, so I doubt there will be 1 true answer to this question.</p>
<p>My answer to my own question is that we use:</p>
<ul>
<li>Findbugs to look for common errors bad/coding - run from maven, and also integrat... | 2,610 |
<p>If all you see is the ugly no-char boxes, what tools or strategies do you use to figure out what went wrong?</p>
<p>(The specific scenario I'm facing is no-char boxes within a <select> when it should be showing Japanese chars.)</p>
| <p>Firstly, "ugly no-char boxes" might not be an encoding problem, they might just be a sign you don't have a font installed that can display the glyphs in the page.</p>
<p>Most character encoding problems happen when strings are being passed from one system to another. For webapps, this is usually between the browser... | <p>Redirect the data to disk and use a <a href="https://www.hhdsoftware.com/free-hex-editor" rel="nofollow noreferrer">Hex Editor</a>. Most text editors / viewers do their own conversions behind the scenes, so it is difficult to be sure you are seeing the data in it's true form.</p>
| 4,915 |
<p>Another discussion (we've been having a lot of them these days!) in our work is whether data binding is a bad idea or not.</p>
<p>Personally, I think it is a Bad Thing™.</p>
<p>My reasons are thrice:</p>
<ol>
<li><p>It circumvents my well architectured MVP framework - with databinding, the view communicates bi-di... | <p>As we say in the UK, <em>"It's Horses for courses"</em></p>
<p>First off all, I agree with you! But...</p>
<p>For enterprise level applications, then spending the extra time on the system architecture, modelling and standards will give you a robust and sustainable system.</p>
<p>But it will take longer to develop... | <p>@Timbo:</p>
<p>Yes and no.... but from a TDD perspective I'd like to cordon-off each controller so that I can test it in isolation. Also, say we want to run each edit via an EditCommand (so that we support Undo, for example) - for me, this rules out databinding.</p>
<p>@Guy:</p>
<p>Yes, this is exactly my POV. ... | 3,996 |
<p>A client of mine has asked me to integrate a 3rd party API into their Rails app. The only problem is that the API uses SOAP. Ruby has basically dropped SOAP in favor of REST. They provide a Java adapter that apparently works with the Java-Ruby bridge, but we'd like to keep it all in Ruby, if possible. I looked i... | <p>I built <a href="http://savonrb.com" rel="noreferrer">Savon</a> to make interacting with SOAP webservices via Ruby as easy as possible.<br>
I'd recommend you check it out.</p>
| <p>I was having the same issue, switched to Savon and then just tested it on an open WSDL (I used <a href="http://www.webservicex.net/geoipservice.asmx?WSDL" rel="nofollow">http://www.webservicex.net/geoipservice.asmx?WSDL</a>) and so far so good!</p>
<p><a href="https://github.com/savonrb/savon" rel="nofollow">https:... | 6,150 |
<pre><code>#if SYMBOL
//code
#endif
</code></pre>
<p>what values does C# predefine for use?</p>
| <p>To add to what Nick said, the MSDN documentation does not list any pre-defined names. It would seem that all need to come from <code>#define</code> and <code>/define</code>.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/4y6tbswk.aspx" rel="nofollow noreferrer">#if on MSDN</a></p>
| <p>Well, that depends on the compiler you are using, and the command line options. Mono defines different names than Microsoft's compiler by default, and depending on what system you are you get different defines, etc.</p>
<p>If you provide a more specific system for which you are compiling, we might be able to come u... | 4,164 |
<p>Let's say I have a drive such as <strong>C:\</strong>, and I want to find out if it's shared and what it's share name (e.g. <strong>C$</strong>) is.</p>
<p>To find out if it's shared, I can use <a href="https://learn.microsoft.com/en-us/windows/desktop/api/Lmshare/nf-lmshare-netsharecheck" rel="nofollow noreferrer"... | <p>If all else fails, you could always use <a href="https://learn.microsoft.com/en-us/windows/win32/api/lmshare/nf-lmshare-netshareenum" rel="nofollow noreferrer">NetShareEnum</a> and call <a href="https://learn.microsoft.com/windows/desktop/api/lmshare/nf-lmshare-netsharegetinfo" rel="nofollow noreferrer">NetShareGetI... | <p>Use;</p>
<pre><code>SHGetFileInfo with SHGFI_ATTRIBUTES
</code></pre>
<p>upon return check the dwAttributes flag for SFGAO_SHARE.</p>
<p>I'm not sure how to find the actual path tho.</p>
| 3,365 |
<p>I have an Anet A8 and have a problem with my first layer. I printed nice prints but starting today the first layer is tearing in the middle:</p>
<p><a href="https://i.stack.imgur.com/4BiUc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4BiUc.jpg" alt="enter image description here"></a></p>
<p><... | <p>The great pics really help with the answerability of this question. From how catastrophic the failure is, and how it's clearly independent of any specialty needs for the particular print such as tiny bed-adhesion contacts, sharp overhangs, bridges, etc. this is definitely not a problem with temperature. Different pe... | <p>I found the solution to be the exact opposite. My bed was too low (as in too far from the hotend). All the above mentioned aside, I did also drop the flow rate on the brim and initial layer by roughly 2-3 %. Now it prints perfectly again. (your mileage may vary)</p>
| 1,447 |
<p>Windows has its 3D Builder software which upon importing an image, converts it to a heightmap of the image, aka turning it to a 3D model that can be saved as an stl.</p>
<p>Does Linux have software with similar properties that takes a black and white image and turning it into a 3D heightmap model?</p>
| <p>The OpenSCAD <code>surface</code> function will do this. You can feed it a greyscale image or a textfile containing a matrix. Documentation and examples can be found at <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Surface" rel="nofollow noreferrer">https://en.wikibooks.org/wi... | <p>FreeCAD can import JPG (and IIRC TIFF and PNG as well) image files and produce a lithophane type height-map based on the brightness of each pixel. I'd be rather surprised if other 3D CAD software aimed at the 3D printing user base couldn't do the same. Most of the common free-to-use 3D CAD packages have Linux vers... | 1,954 |
<p>I have seen lots of printers that print chocolate using a syringe with molten chocolate. But, even cooler, would it be possible to print chocolate using some kind of feed system for <strong>continuous</strong> chocolate printing, so large objects and for a prolonged time, not only lasting the content of one syringe ... | <p>Update: I found a nice article about chocolate printing: <a href="https://all3dp.com/2/chocolate-3d-printer-all-you-need-to-know/" rel="nofollow noreferrer">https://all3dp.com/2/chocolate-3d-printer-all-you-need-to-know/</a></p>
<hr>
<p>You are searching for chocolate extruder. I did not find one, which would fulf... | <p>I would look into what Hershey did for this chocolate printer in junction with 3ds. Behold state of the art Chocolate 3d printing.. The
<a href="http://richport3d.com/2015/02/17/3d-systems-unveils-the-cocojettm/" rel="nofollow noreferrer">CocoJett</a></p>
<p>That said there is little said about their tank system.</... | 174 |
<p>I'm using markdown to edit this question right now. In some <a href="http://en.wikipedia.org/wiki/Wikipedia:How_to_edit_a_page#Wiki_markup" rel="noreferrer">wikis</a> I used wiki markup. Are they the same thing? Are they related? Please explain. If I want to implement one or the other in a web project (like stackove... | <ul>
<li><a href="http://en.wikipedia.org/wiki/Markup_language" rel="noreferrer">Markup</a> is a generic term for a language that describes a document's formatting</li>
<li><a href="http://en.wikipedia.org/wiki/Markdown" rel="noreferrer">Markdown</a> is a specific markup library: <a href="http://daringfireball.net/proj... | <p>Markup is a general term for content formatting - such as HTML - but markdown is a library that generates HTML markup. Take a look at <a href="http://daringfireball.net/projects/markdown/" rel="noreferrer">Markdown</a>.</p>
| 4,382 |
<p>Following this <a href="https://3dprinting.stackexchange.com/questions/2617/decent-cnc-control-software-for-osx">issue</a> I would like to propose to allow general CNC related questions here as well. 3D Printers are CNC machines, they only add instead of subtract. 3D printers use G-Code, just like CNC milling machin... | <p>There are tens of SE sites that deal with programming in some way, shape or form. SO is obviously the most general one of these, but there are many more specialized ones (CodeReview,TeX,Programmers,Drupal/Wordpress/Joomla/Server Fault/Ubuntu/...). If this site had been "Makers StackExchange" or "Digital Fabrication"... | <p>As has been discussed previously <a href="https://3dprinting.meta.stackexchange.com/questions/147/hobbyist-machine-questions-on-topic">here</a>, the relevance of CNC questions on this site depend on the questions closeness to 3D printing. So, for instance, if the software you are asking about is the same as a 3D pri... | 34 |
<p>What are the advantages and disadvantages of turning <strong><code>NOCOUNT</code></strong> off in SQL server queries?
</p>
| <p>From SQL BOL: </p>
<blockquote>
<p>SET NOCOUNT ON prevents the sending of
DONE_IN_PROC messages to the client
for each statement in a stored
procedure. For stored procedures that
contain several statements that do not
return much actual data, <strong>setting SET
NOCOUNT to ON can provide a
signific... | <p>I personally like to turn <strong>NOCOUNT</strong> on for queries that get run in an manual fashion and use a lot of <code>Print</code> statements to output debugging messages. In this way, your output would look less like:</p>
<pre>
Updating usernames
(287 rows updated)
Done
Updating passwords
(287 rows updated)... | 4,611 |
<p>Before reading anything else, please take time to read the <a href="https://stackoverflow.com/questions/1615/how-can-i-modify-xfdl-files-update-1">original thread</a>.</p>
<p>Overview: a .xfdl file is a gzipped .xml file which has then been encoded in base64. I wish to de-encode the .xfdl into xml which I can the... | <p>As far as I know you cannot find the compression level of an already compressed file. When you are compressing the file you can specify the compression level with -# where the # is from 1 to 9 (1 being the fastest compression and 9 being the most compressed file). In practice you should never compare a compressed fi... | <p>Different implementations of the gzip algorithm will always produce slightly different but still correct files, also the compression level of the original file may be different then what you are running it at.</p>
| 2,850 |
<p>Is it realistic to try and learn and code a Flex 3 application without purchasing FlexBuilder? Since the SDK and BlazeDS are open source, it seems technically possible to develop without Flex Builder, but how realistic is it.</p>
<p>I would like to test out Flex but don't want to get into a situation where I am dep... | <p>I've been using Flex since version 2 and Flex3/BlazeDS since it came out of beta. I also have some experience with Lazzlo and the difference is day and night (Flex rocks!). I have not regretted once using Flex. Regarding FlexBuilder, it is worth every penny. While it is completely possible and reasonable to writ... | <p>Absolutely. I've been a Flex developer since Flex 2 and until recently I've used my regular editor, TextMate, for coding and Ant for building. TextMate has some good extensions for ActionScript and Flex coding, but I think you could get that for any decent editor.</p>
<p>What's been missing from my setup is a usabl... | 6,185 |
<p>Visually both of the following snippets produce the same UI. So why are there 2 controls..<br>
<strong>Snippet1</strong> </p>
<pre><code><TextBlock>Name:</TextBlock>
<TextBox Name="nameTextBox" />
</code></pre>
<p><strong>Snippet2</strong></p>
<pre><code><Label>Name:</Label>
<Tex... | <p>The WPF Textblock inherits from <strong>FrameworkElement</strong> instead of deriving from <strong>System.Windows.Control</strong> like the Label Control. This means that the Textblock is much more lightweight. The downside of using a textblock is no support for Access/Accerelator Keys and there is no link to other ... | <p>Label can be used as an alternative to TextBlock for situations where minimal text support is required such as the label for a control. Using Label can be advantageous because it requires even less resources (lighter weight) then a TextBlock. </p>
| 8,355 |
<p>I am wondering if this piece of G-code is valid:</p>
<pre><code>G0 (Some comment (Its G0 command)) Y10 Z-5
</code></pre>
<p>I have tested this on my Chinese CNC machine and it strips out the comment and works flawlessly.</p>
<p>The machine processes this as <code>G0Y10Z-5</code> which seems like the correct appro... | <p>This is not universally valid G-code, and how it is handled depends on the implementation. You can use this style of comment on <em>some</em> machines, but not all.</p>
<p>The way parsing used to be implemented in Marlin (a very common 3D printer firmware), it would work fine unless the comment string included a X,... | <p>It looks like comments inside parentheses are not allowed in numerous parsers (ie. Marlin). This seems to be true for most of the 3D printers. Classical CNC milling machines use parentheses without problems.</p>
<p>It should work on Prusa printers as stated in their <a href="https://reprap.org/wiki/G-code#Comments" ... | 964 |
<p>I have been trying to implement Win32's <code>MessageBox</code> using GTK. The app uses SDL/OpenGL, so this isn't a GTK app.</p>
<p>I handle the initialization (<code>gtk_init</code>) sort of stuff inside the <code>MessageBox</code> function as follows:</p>
<pre><code>int MessageBox(HWND hwnd, const char* text, cons... | <p>Hmm, ok. I'd suggest code like this, then:</p>
<pre class="lang-c prettyprint-override"><code>typedef struct {
int type;
int result;
} DialogData;
static gboolean
display_dialog(gpointer user_data)
{
DialogData *dialog_data = user_data;
GtkWidget *dialog;
if (dialog_data->type & ... | <p>A few things:</p>
<p>You are creating (and not using) an unnecessary toplevel window, named <code>window</code>. You can just delete these lines:</p>
<pre><code>window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL);
g_signal_connect(G_OBJE... | 2,276 |
<p>I'm stuck trying to create a dynamic linq extension method that returns a string in JSON format - I'm using System.Linq.Dynamic and Newtonsoft.Json and I can't get the Linq.Dynamic to parse the "cell=new object[]" part. Perhaps too complex? Any ideas? : </p>
<p><strong>My Main method:</strong></p>
<pre><code>stat... | <p>This is really ugly and there may be some issues with the string replacement, but it produces the expected results:</p>
<pre><code>public static class JSonify
{
public static string GetJsonTable<T>(
this IQueryable<T> query, int pageNumber, int pageSize, string IDColumnName, string[] columnN... | <pre><code>static void Main(string[] args)
{
NorthwindDataContext db = new NorthwindDataContext();
var query = db.Customers;
string json = query.GetJsonTable<Customer>(2, 10, "CustomerID", new string[] {"CustomerID", "CompanyName", "City", "Country", "Orders.Count" });
}
public static class JSonif... | 7,297 |
<p>Apply / find / create a stainless steel coating to apply to a PETG or PLA part to make it react to a magnet.</p>
<p>My goal is to make a small tubular and conical shapes that can be painted with a stainless steel coating and will react with a magnet.</p>
<p>I know I can buy iron filled PLA but these rust which I wan... | <h1>The surface won't work</h1>
<p>The only true-metallic surface treatments I know to be actual metal in large enough amounts to conduct electricity would be leafmetal, akin to leaf gold, and electroplating. However, you can't use the procedures for stainless steels, and even then, the thickness is in the tenth of a µ... | <p>No rust but has magnetic properties? You could try varnishing the iron filled PLA.</p>
| 1,854 |
<p>Searching for some sample code for converting a point in WGS84 coordinate system to a map position in Google Maps (pixel position), also supporting zoom levels. </p>
<p>If the codes is well commented, then it can also be in some other language.</p>
<p>You can also point me to a open source Java project :)</p>
<p>... | <p><a href="http://web.archive.org/web/20110809084551/http://mapki.com/wiki/Tile_utility_code_in_Java" rel="nofollow noreferrer">Tile utility code in Java</a> on mapki.com (great resource for google map developers)</p>
| <p>Someone took the javascript code from Google Maps and ported it to python: <a href="http://code.google.com/p/gheat/source/browse/trunk/__/lib/python/gmerc.py" rel="nofollow noreferrer">gmerc.py</a></p>
<p>I've used this and it works great.</p>
| 2,922 |
<p>What are the strategies for versioning of a web application/ website? </p>
<p>I notice that here in the Beta there is an svn revision number in the footer and that's ideal for an application that uses svn over one repository. But what if you use externals or a different source control application that versions sep... | <p>For my big apps I just use a incrementing version number id (1.0, 1.1, ...) that i store in a comment of the main file (usually index.php).<Br />
For just websites I usually just have a revision number (1,2,3,...).</p>
| <p>I maintain a system of web applications with various components that live in separate SVN repos. To be able to version track the system as a whole, I have another SVN repo which contains all other repos as external references. It also contains install / setup script(s) to deploy the whole thing. With that setup, the... | 4,958 |
<p>Are there conventions for function names when using the Perl Test::More or Test::Simple modules?</p>
<p>I'm specifically asking about the names of functions that are used to set up a test environment before the test and to tear down the environment after successful completion of the test(s).</p>
<p>cheers,</p>
<p... | <p>I dont think there are any such conventions out there.</p>
<p>The only way you can do it is perhaps use BEGIN/END blocks, if the resources are to be used over the whole file.</p>
<p>The general approach I take is to put related tests in one code block and then initialize the variables/resource etc there. You can p... | <p>First convention I'd suggest is ditching Test::More for Test::Most</p>
| 6,737 |
<p>I am at a school with several Makerbot Replicator+ – a total of 9 of them.</p>
<p>So, they seem to print fine and I can hook up to two of them to one laptop (they are some Lenovo models from a few years back) using Makerbot Print. Well and good.</p>
<p>But I wanted to hook them up to my MacBook Pro (2020, OS X Catal... | <p><em><strong>It would seem that the printer control board doesn't use a CH340 (see bottom of this answer) and therefore this answer should be ignored.</strong></em></p>
<hr />
<h3>CH340 and OS X incompatibility</h3>
<p>The reason your Mac might not see the printers <em>could</em> be down to the USB interface <em><str... | <blockquote>
<p>what do you mean by SD card approach? The Makerbots take flash drives, but my attempts to print off of one were unsuccessful (it seems to be rather hard to make the right kind of file, it won't work with STLs and I gave up figuring out how to make them .makerbot files)</p>
</blockquote>
<p>This sounds l... | 2,049 |
<p>I'm trying to model the threads of a "Poland Spring" 500 ml bottle so I can 3D print an adapter for it. But I can't find information about it. I emailed them but they said they didn't have the information.</p>
<p>How can I find this information out?</p>
<p>The bottle seems to use non standard threads. It u... | <p>You can use a program known as <a href="http://www.openscad.org/" rel="nofollow noreferrer">OpenSCAD</a> with the <a href="https://dkprojects.net/openscad-threads/" rel="nofollow noreferrer">threads library</a> to assist your objective.</p>
<p>The important aspects of a thread are the major diameter (outside diamete... | <p>It's really unlikely that a bottle is using nonstandard threads; the engineering and tooling cost for doing so would not make sense. Most plastic drink bottles use PCO 1881 or PCO 1810 threads. If not, it should be one of a number of other less widely used standards.</p>
<p>The industry term for drink bottle thread ... | 1,721 |
<p>Just downloaded the CodeRush trial version and I can't easily find the one feature that I really wanted. I would like to be able to start typing a class name and to jump to its definition, sort of like the quick navigator but I want it to search in closed files within my solution as well as open ones. I know R# ha... | <p>1) <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Q</kbd> (this will bring up the Quick Nav)</p>
<p>2) Start typing the name of the Type, Variable, etc. </p>
<p>3) Hit Enter to select when the target shows in the top of the list</p>
<p>If the scope is not already set to "Solution" (you can tell via the drop-down on th... | <p>A quick remark to the excellent answer by Troy, if the version you downloaded is the newer one, 3.2, the Quick Nav has been remapped to <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Q</kbd>.</p>
| 7,878 |
<p>The subject says it all - normally easy and cross platform way is to poll, intelligently. But every OS has some means to notify without polling. Is it possible in a reasonably cross platform way? (I only really care about Windows and Linux, but I use mac, so I thought posix may help?)</p>
| <p>Linux users can use <a href="http://en.wikipedia.org/wiki/Inotify" rel="noreferrer">inotify</a></p>
<blockquote>
<p>inotify is a Linux kernel subsystem
that provides file system event
notification.</p>
</blockquote>
<p>Some goodies for Windows fellows:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/l... | <p>I believe OS X now has appropriate hooks/callbacks because they were needed for Spotlight indexing. </p>
<p>On linux you'll have the additional trouble that there are multiple file systems commonly used. If you need the functionality for only a limited amount of files/directories, I'd try about actively looking for... | 8,641 |
<p>Some web applications, like Google Docs, store data generated by the users. Data that can only be read by its owner. Or maybe not?</p>
<p>As far as I know, this data is stored as is in a remote database. So, if anybody with enough privileges in the remote system (a sysadmin, for instance) can lurk my data, my priva... | <p>If encryption/decryption is performed on the server, there is no way you can make sure that the cleartext is not dumped somewhere in some log file or the like.</p>
<p>You need to do the encryption/decryption inside the browser using JavaScript/Java/ActiveX or whatever. As a user, you need to trust the client-side o... | <p>No, you can't use passwords, but you could use password hashes. However, Google Docs are all about sharing, so such a method would require storing a copy of the document for each user.</p>
| 6,094 |
<p>I am sketching the architecture for a set of programs that share various interrelated objects stored in a database. I want one of the programs to act as a service which provides a higher level interface for operations on these objects, and the other programs to access the objects through that service.</p>
<p>I am c... | <p>Yes you can. I do it using the pythoncom libraries that come included with <a href="http://www.activestate.com/Products/activepython/index.mhtml" rel="noreferrer">ActivePython</a> or can be installed with <a href="https://sourceforge.net/projects/pywin32/" rel="noreferrer">pywin32</a> (Python for Windows extensions)... | <p><a href="https://www.chrisumbel.com/article/windows_services_in_python" rel="nofollow noreferrer">https://www.chrisumbel.com/article/windows_services_in_python</a></p>
<ol>
<li><p>Follow up the PySvc.py</p></li>
<li><p>changing the dll folder </p></li>
</ol>
<p>I know this is old but I was stuck on this forever. F... | 5,233 |
<p><a href="https://stackoverflow.com/questions/32230/tracking-down-where-disk-space-has-gone-on-linux">In this question</a> someone asked for ways to display disk usage in Linux. I'd like to take this one step further down the cli-path... how about a shell script that takes the output from something like a reasonable ... | <p>I would recommend <a href="http://munin.projects.linpro.no/" rel="nofollow noreferrer">munin</a>. It is designed for exactly this sort of thing - graphing CPU usage, memory usage, disc-usage and such. sort of like MRTG (but MRTG is primarily aimed at graphing router's traffic, graphing anything but bandwidth with it... | <p>I guess there are a couple of options:</p>
<ol>
<li><p>For a pure CLI solution, use something like gnuplot. See <a href="http://t16web.lanl.gov/Kawano/gnuplot/intro/working-e.html" rel="nofollow noreferrer">here</a> for example usage. I haven't used gnuplot since my student days :-)</p></li>
<li><p>Not really a pur... | 6,202 |
<p>I've been utlising a "web browser control" in desktop based applications (in my case Windows Forms .NET) for a number of years. I mostly use it to create a familiar flow-based user interface that also allows a seamless transition to the internet where required.</p>
<p>I'm really tired of the IE browser control bec... | <p>hmm..Interestingly </p>
<ol>
<li><a href="http://www.iol.ie/~locka/mozilla/control.htm" rel="nofollow noreferrer">Mozilla</a> seems to provide ActiveX control</li>
<li><a href="http://kmeleon.sourceforge.net/" rel="nofollow noreferrer">K-Melon</a> is another Gecko based browser control</li>
</ol>
| <p>Popular layout engines:</p>
<ol>
<li>Mozilla Gecko</li>
<li>KHTML</li>
<li>WebKit (based on KHTML)</li>
</ol>
<p>Though I'm not sure how easy it is to embed those in a .Net app.</p>
| 8,631 |
<p>What is the easiest way to compare strings in Python, ignoring case?</p>
<p>Of course one can do (str1.lower() <= str2.lower()), etc., but this created two additional temporary strings (with the obvious alloc/g-c overheads).</p>
<p>I guess I'm looking for an equivalent to C's stricmp().</p>
<p>[Some more conte... | <p>Here is a benchmark showing that using <a href="http://docs.python.org/2/library/string.html?highlight=lower#string.lower" rel="nofollow noreferrer"><code>str.lower</code></a> is faster than the accepted answer's proposed method (<code>libc.strcasecmp</code>):</p>
<pre><code>#!/usr/bin/env python2.7
import random
i... | <p>You could subclass <code>str</code> and create your own case-insenstive string class but IMHO that would be extremely unwise and create far more trouble than it's worth.</p>
| 8,805 |
<p>This has been driving me crazy for a few days. Why doesn't the following work?</p>
<blockquote>
<pre><code> Dim arr(3, 3) As Integer
For y As Integer = 0 To arr.GetLength(0) - 1
For x As Integer = 0 To arr.GetLength(y) - 1
arr(y, x) = y + x
Next
Next
</code></pre>
</blockquo... | <p>Ok, so what you really need is a "jagged array". This will allow you to have an "array that contains other arrays of varying lengths".</p>
<pre><code> Dim arr As Integer()() = {New Integer() {1, 2, 3}, New Integer() {4, 5, 6, 7, 8, 9, 9, 9}, New Integer() {5, 4, 3, 2}}
For x = 0 To arr.GetUpperBound(0)
Co... | <p>Your declaration: <code>DIM arr(3,3) As Integer</code> allready specifies that there are 3 elements in any given row (or 4, I'm not so sure about VB)</p>
<p>You could try:</p>
<pre><code>Dim arr(3) as Integer()
</code></pre>
<p>You should then be able to do:</p>
<pre><code>arr(n).Length
</code></pre>
<p>To find... | 7,324 |
<p>Do you actively manage <a href="http://forums.construx.com/blogs/stevemcc/archive/2007/11/01/technical-debt-2.aspx" rel="noreferrer">technical debt</a> debt on your software development projects and if so, how do you do it?</p>
| <p>One aspect of managing technical debt is in convincing non-technical managers that you need time allocated for refactoring and bug fixing.</p>
<p><a href="https://blog.asmartbear.com/software-quality-mortgage.html" rel="nofollow noreferrer">Here's an article with specific suggestions</a> on how to do that.</p>
| <p>It depends a lot on the product. When I worked in a field where our code had to be outside-audited it was a planned part of our sprint. PM just asked development what area needed refactoring and it was put in the plan. That's not to say you wouldn't fix the code in the area you were working on, but you wouldn't d... | 7,918 |
<p>I was just listening to some older .Net Rocks! episodes, and I <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=D91887EA-5128-4BB1-B861-1DC1F9564941&displaylang=en" rel="nofollow noreferrer">found #329 on DSLs</a> to be interesting. My problem is that I can't find any good online resources for p... | <p>The architects of the DSL Tools team wrote a book, <a href="https://rads.stackoverflow.com/amzn/click/com/0321398203" rel="nofollow noreferrer" rel="nofollow noreferrer">Domain-Specific Development with Visual Studio DSL Tools.</a> The book's <a href="http://www.domainspecificdevelopment.com/" rel="nofollow noreferr... | <p>A fantastic option for DSLs is <a href="http://boo.codehaus.org/" rel="nofollow noreferrer">Boo</a>. I've been using it for things like setting up my IoC container, defining routes, validation rules. <a href="http://www.ayende.com/Blog/" rel="nofollow noreferrer">Ayende Rahien</a> is writing an fantastic book on t... | 2,646 |
<p>Having worked with Classic ASP for about 2 years now by creating a few 100 simple web forms I can't see a good reason for switching to .net; however, I'm not that versed in .net so I'm sure I could be missing a few things.</p>
<p>Some points that I often hear around work can be found here: <a href="http://www.packt... | <p>You're missing more than a few things! ASP.NET is orders of magnitudes more productive, robust, and maintainable than old-school ASP ever thought about being. Server side controls, third-party controls, master pages, forms authentication, forms validation, an OO model than encourages appropriate application partitio... | <h2><a href="http://weblogs.asp.net/dwahlin/archive/2009/04/06/5-reasons-you-should-take-a-closer-look-at-asp-net-mvc.aspx" rel="nofollow noreferrer">5 Reasons You Should Take a Closer Look at ASP.NET MVC</a></h2>
| 6,700 |
<p>I'm starting to develop a browser-based game (and by this I mean text-based, no Flash or similar stuff on it) and I'm struggling to decide on which development framework to use.</p>
<p>As far as requirements are concerned, the most important thing that I can think of right now is the ability to translate it to seve... | <blockquote>
<p>I would reccomend sticking to what you know - PHP is more than capable.</p>
</blockquote>
<p>That's true of course, but:</p>
<blockquote>
<p>I don't mind, and I would even like to use this as an excuse, learning some new thing like Python or Ruby.</p>
</blockquote>
<p>Then writing a browser game ... | <p>I would reccomend sticking to what you know - PHP is more than capable.</p>
<p>I used to play a game called <a href="http://www.hyperiums.com/" rel="nofollow noreferrer">Hyperiums</a> - a text based browser game like yours - which is created using Java (it's web-based quivalent is JSP?) and servlets. It works fairl... | 4,563 |
<p>I have created a namespace extension that is rooted under Desktop. The main purpose of the extension is to provide a virtual list of ZIP files that represent a list of configurable directories. When the user clicks one of the those items the contents of the related directory are zipped in place and the resulting ZIP... | <p>What would be wrong with doing something like the following:</p>
<p>Defining a 'Maintainer' interface with the addListener(Listener, Enum) method.</p>
<p>Create a DefaultMaintainer class (as above) which implements Maintainer.</p>
<p>Then, in each Listener class, 'inject' the Maintainer interface (constructor inj... | <blockquote>
<p>You said "... you can't have java.lang.Enum as"
annotation param ..."</p>
</blockquote>
<p>I think you are wrong on that. I have recently used on a project something like this :</p>
<pre><code>public @interface MyAnnotation {
MyEnum value();
}
</code></pre>
| 9,697 |
<p>Continuing the "Hidden features of ..." meme, let's share the lesser-known but useful features of Ruby programming language.</p>
<p>Try to limit this discussion with core Ruby, without any Ruby on Rails stuff.</p>
<p>See also:</p>
<ul>
<li><a href="https://stackoverflow.com/questions/9033/hidden-features-of-c">Hi... | <p>Peter Cooper has a <a href="http://www.rubyinside.com/21-ruby-tricks-902.html" rel="nofollow noreferrer">good list</a> of Ruby tricks. Perhaps my favorite of his is allowing both single items and collections to be enumerated. (That is, treat a non-collection object as a collection containing just that object.) It... | <pre><code>@user #=> nil (but I did't know)
@user.name rescue "Unknown"
</code></pre>
| 8,945 |
<p>How do I fix a broken debugger, one that just won't start, in <a href="http://www.eclipseme.org/" rel="nofollow noreferrer">EclipseME</a> (now Mobile Tools Java)?</p>
<p>(This question has an answer which will be transferred from another question soon)</p>
| <p>The most annoying issue with EclipseME for me was the "broken" debugger, which just wouldn't start. This is covered in docs, but it took me about an hour to find this tip when I first installed EclipseME, and another hour when I returned to JavaME development a year later, so I decided to share this piece of knowled... | <p>most debuggers are just plug-ins that also have a command-line interface; try running the debugger from the command-line and see if it works. If it does, then check the plug-in configuration; you may have to re-install the plug-in.</p>
<p>caveat: I have not used EclipseME, but had similar problems with the Gnu C de... | 9,311 |
<p>I am very new to 3D printing. I am looking to purchase the Ender 3 V2 but before I do I would appreciate some advice on what I should purchase as the upgrades/addons for it. I'm not sure as to what I would need for the V2 since most websites are for the original Ender 3 so I don't know if the V2 already has that upg... | <p>IMHO, it's probably better to get the printer as-is first. This way you can get familiar with the printer and 3D printing in general before you get overwhelmed with all the extra introduced variables from your upgrades.</p>
<p>The new model already has loads of features that were considered upgrades on the older mod... | <p>I have an Ender 3 v2 and I haven't upgraded anything except updating the firmware. The first thing I suggest is updating the firmware and changing the hotend to an all-metal one. This will allow you to print in higher temperatures and adding a BLTouch for automatic bed leveling will make your life a bit easier.</p>
| 1,736 |
<p>I'm looking for a tool to generate a JavaScript stub from a WSDL.</p>
<p>Although I usually prefer to use REST services with JSON or XML, there are some tools I am currently integrating that works only using SOAP.</p>
<p>I already created a first version of the client in JavaScript but I'm parsing the SOAP envelop... | <p>I had to do this myself in the past and I found this <a href="http://www.codeproject.com/KB/ajax/JavaScriptSOAPClient.aspx" rel="noreferrer">CodeProject article</a>. I changed it up some, but it gave me a good foundation to implement everything I needed. One of the main features it already has is generating the SO... | <p>It would probably be an overkill, but NetBeans has this feature.</p>
| 6,273 |
<p>I'm having trouble figuring out how to get the testing framework set up and usable in <strong>Visual Studio 2008</strong> for <code>C++</code> presumably with the built-in unit testing suite.</p>
<p>Any links or tutorials would be appreciated.</p>
| <p><a href="http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle" rel="nofollow noreferrer">This page</a> may help, it reviews quite a few C++ unit test frameworks:</p>
<ul>
<li>CppUnit </li>
<li>Boost.Test</li>
<li>CppUnitLite </li>
<li>NanoCppUnit</li>
<li>Unit++</li>
<li>CxxTest</li>
</ul>
<p>... | <p>I've used <a href="http://cppunit.sourceforge.net/cppunit-wiki" rel="nofollow noreferrer">CppUnit</a> with VS2005 and Eclipse. The wiki is very thorough (especially if you are familiar with JUnit).</p>
| 2,532 |
<p>We are trying out Visual Studio 2008 and Expression Blend on a new project. The goal is to clearly define the role of the developer and designer as separate, but reap the benefit of the developer being able to directly consume the XAML produced by the designer.</p>
<p>For the most part this has worked great, and I ... | <p>I would suggest reading <a href="http://www.galasoft.ch/mydotnet/articles/article-2007091401.html" rel="nofollow noreferrer">this blog</a>. The final method seems to work well, your test data shows up in Blend very nicely. Just keep in mind that you have to compile the DLL before it will display the data.</p>
| <p>I would look into creating XML data islands which emulate the structure of the objects you will eventually bind the UI to. This way your designer can bind the root element of the page (or user control, etc.) to the top level of your fake XML data island and all the relative paths will stay the same when you swap tha... | 9,200 |
<pre><code>$output = preg_replace("|(/D)(/s+)(/d+)(;)|", "//1,//3;", $output);
</code></pre>
<p>I'm trying to replace all alphabetical character followed by one or more whitespace characters (tabs and/or spaces) followed by one or more numerical characters followed by a semicolon with the alphabetical character follow... | <p>The two <code>|</code> at the start and end probably are incorrect - and should both be forward-slashes.</p>
<p>All other forward slashes should be backward slashes (and need escaping).</p>
<p>And since PHP 4.04 <code>$n</code> is the preferred way of referring to a capture group.</p>
<pre><code>$output = preg_re... | <p>You want backslashes in the regular expression, not forward slashes. The starting and ending pipes <strong>are</strong> needed (or another delimiter for the regex)</p>
<pre><code>$x = "hello world 1007;";
echo preg_replace('|(\D)(\s+)(\d+)(;)|','$1,$3',$x);
echo preg_replace('/(\D)(\s+)(\d+)(;)/','$1,$3',... | 7,754 |
<p>Is there an integrated kickback protection in stepper motor drivers or should I make my own?
I am afraid the steppers might fry the driver or the arduino when i turn off the power for them.
I do that by turning off the power supply.
I haven't had an issue yet but it still bothers me.</p>
| <p>Kinda, sort of, but not really. I'll look at the A4988 (<a href="https://www.pololu.com/file/0J450/a4988_DMOS_microstepping_driver_with_translator.pdf" rel="nofollow noreferrer">datasheet</a>).</p>
<p>The motor pins are connected by diodes to ground and Vbb (the motor suppply voltage). Essentially, they act as a br... | <p>"Inductive kickback" from motor coils is caused by the inductance of the coils and the wiring. It is not some strange effect. Inductance is charged with current, just as capacitance is changed with voltage. Most bipolar motor drivers use an H-bridge on the output. By driving the H-bridge correctly, the driver ca... | 829 |
<p>I have a set of Berkeley DB files on my Linux file system that I'd like to examine.</p>
<p>What useful tools exist for getting a quick overview of the contents? I can write Perl scripts that use BDB modules for examining them, but I'm looking for some CLI utility to be able to take a look inside without having to s... | <p>Check out the <strong>db-utils</strong> package. If you use apt, you can install it with the following: <code>apt-get install db-util</code> (or <code>apt-get install db4.8-util</code> or whatever version you have or prefer.)</p>
<p>Additional links:</p>
<ul>
<li><a href="http://rpmfind.net/linux/rpm2html/search... | <p>Under Amazon Linux you can install it with:</p>
<p><strong>yum install db43-utils</strong></p>
| 5,841 |
<p>I'm running a master-slave MySQL binary log replication system (phew!) that, for some data, is not in sync (meaning, the master holds more data than the slave). But the slave stops very frequently on the slightest MySQL error, can this be disabled? (perhaps a my.cnf setting for the replicating slave ignore-replicati... | <p>Yes, with --slave-skip-errors=xxx in my.cnf, where xxx is 'all' or a comma sep list of error codes.</p>
| <p>i think you are doing replication with out sync the database first sync the database and try for replication and servers are generating same unique ids and try to set auto incerment offset</p>
| 5,054 |
<p>In a C# .NET 3.5 app (a mix of WinForms and WPF) I want to let the user select a folder to import a load of data from. At the moment, it's using <code>System.Windows.Forms.FolderBrowserDialog</code> but that's a bit lame. Mainly because you can't type the path into it (so you need to map a network drive, instead of ... | <p>Don't create it yourself! It's been done. You can use <a href="http://dotnetzip.codeplex.com/SourceControl/changeset/view/29832#432677" rel="nofollow noreferrer">FolderBrowserDialogEx</a> -
a re-usable derivative of the built-in FolderBrowserDialog. This one allows you to type in a path, even a UNC path. You ca... | <p>So far, based on the lack of responses to <a href="https://stackoverflow.com/questions/31059/how-do-you-configure-an-openfiledialog-to-select-folders">my identical question</a>, I'd assume the answer is to roll your own dialog from scratch.</p>
<p>I've seen things here and there about subclassing the common dialogs... | 6,801 |
<p>Most restrictions and tricks with windows forms are common to most programmers. But since .NET 3.0 there is also WPF available, the Windows Presentation Foundation. It is said that you can make "sexy applications" more easy with it and with .NET 3.5 SP1 it got a good speed boost on execution.</p>
<p>But on the othe... | <p>WPF enables you to do some amazing things, and I LOVE it... but I always feel obligated to qualify my recommendations, whenever developers ask me whether I think they should be moving to the new technology.</p>
<p>Are your developers willing (preferrably, EAGER) to spend the time it takes to learn to use WPF effect... | <p>For conversion projects (from <a href="http://en.wikipedia.org/wiki/Visual_Basic#Timeline" rel="nofollow noreferrer">Visual Basic 6.0</a>), it's hard to get a team to switch to WPF. Besides the learning curve, people are already used to the old interface. Windows Forms, although being phased out, will be around for ... | 8,233 |
<p>I was given an .xml file that I needed to read into my code as a DataSet (as background, the file was created by creating a <code>DataSet</code> in C# and calling <code>dataSet.WriteXml(file, XmlWriteMode.IgnoreSchema)</code>, but this was done by someone else). </p>
<p>The .xml file was shaped like this:</p>
<pre... | <p>This appears to be correct for your <em>nested</em> Foo tags:</p>
<pre><code><NewDataSet>
<Foo> <!-- Foo-Id: 0 -->
<Bar>abcd</Bar>
<Foo>efg</Foo> <!-- Foo-Id: 1, Parent-Id: 0 -->
</Foo>
<Foo> <!-- Foo-Id: 2 --... | <p>These are my observations rather than a full answer:</p>
<p>My guess (without trying to re-produce it myself) is that a couple of things may be happening as the DataSet tries to 'flatten' a hierarchical structure to a relational data structure.</p>
<p>1) thinking about the data from a relational database perspecti... | 7,493 |
<p>I finished a 3D object for 4 wheels, but something seems wrong with the final scene to me:</p>
<p>The nearer wheels (#1 and #2) appear smaller than the far one (#3 and #4), and the distance between wheel #3 an #4 seems longer than between (1) and (2), like you can see in this picture:</p>
<p><a href="https://i.sta... | <p>CAD programs uses parallel view not perspective view.
So the length of 2 objects with the same length are displayed as 2 objects with the same length on the screen.
This is better for constructing stuff. </p>
| <p>CAD programs uses parallel view not perspective view.
So the length of 2 objects with the same length are displayed as 2 objects with the same length on the screen.
This is better for constructing stuff. </p>
| 1,044 |
<p>I'm trying to send messages to Objective-C objects in gdb.</p>
<pre><code>(gdb) p $esi
$2 = (void *) 0x1268160
(gdb) po $esi
<NSArray: 0x1359c0>
(gdb) po [$esi count]
Target does not respond to this message selector.
</code></pre>
<p>I can't send any message to it. Am I missing something? Do I really need th... | <p>If you must override gdb and send a message to an object when it will not let you, you can use performSelector:</p>
<pre><code>(gdb) print (int)[receivedData count]
Target does not respond to this message selector.
(gdb) print (int)[receivedData performSelector:@selector(count) ]
2008-09-15 00:46:35.854 Executable... | <p>@[John Calsbeek]</p>
<p>Then it complains about missing symbols.</p>
<pre><code>(gdb) p (NSUInteger)[(NSObject*)$esi retainCount]
No symbol table is loaded. Use the "file" command.
(gdb) p [(NSArray *)$esi count]
No symbol "NSArray" in current context.
</code></pre>
<p>I tried to load the symbols for Foundation:... | 8,041 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.