instruction
stringlengths 27
22.5k
| chosen
stringlengths 27
28.2k
| rejected
stringlengths 19
24.9k
| __index_level_0__
int64 0
10k
|
|---|---|---|---|
<p>Server Management Studio tends to be a bit un-intuitive when it comes to managing Extended Properties, so can anyone recommend a decent tool that improves the situation.</p>
<p>One thing I would like to do is to have templates that I can apply objects, thus standardising the nomenclature and content of the properties applied to objects.</p>
|
<p>Take a look at Data Dictionary Creator, an open source tool I wrote to make it easier to edit extended properties. It includes the ability to export the information in a variety of formats, as well.</p>
<p><a href="http://www.codeplex.com/datadictionary" rel="nofollow noreferrer">http://www.codeplex.com/datadictionary</a></p>
<p><img src="https://i.stack.imgur.com/z8Qve.png" alt="enter image description here"></p>
|
<p>You might also think about having a nice re-runnable script that lets you maintain the extended properties. The system stored procedures for doing this work well, but they are a pain, so I wrap them with my own stored procedure so I can more easily deal with them.</p>
<p>For example, below is a stored procedure targeted at column level extended properties that a) checks to see if the extended property already exists, and b) if so drops it, and c) then adds it. </p>
<p>This lets me maintain a clean re-runnable (which is critical for automated build processes) script of simple one liners to add the extended properties (column level only - you'd need to modify this one or write a similar one for other object types).</p>
<p>Here is the sproc:</p>
<pre><code>IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo]. [snap_xpColumn_addUpdate]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].snap_xpColumn_addUpdate
GO
CREATE PROCEDURE [dbo].[snap_xpColumn_addUpdate]
@TableName NVARCHAR(255),
@ColumnName NVARCHAR(255),
@ExtPropName NVARCHAR(255),
@ExtPropValue NVARCHAR(255),
@SchemaOwner NVARCHAR(255) = 'dbo'
AS
IF EXISTS(SELECT * FROM ::fn_listextendedproperty(@ExtPropName,'SCHEMA',@SchemaOwner,
'TABLE',@TableName,'COLUMN',@ColumnName))
BEGIN
-- drop it
EXEC sys.sp_dropextendedproperty @name=@ExtPropName,
@level0type=N'SCHEMA',
@level0name=@SchemaOwner,
@level1type=N'TABLE',
@level1name=@TableName,
@level2type=N'COLUMN',
@level2name=@ColumnName
END
-- add it
EXEC sys.sp_addextendedproperty @name=@ExtPropName,
@value=@ExtPropValue,
@level0type=N'SCHEMA',
@level0name=@SchemaOwner,
@level1type=N'TABLE',
@level1name=@TableName,
@level2type=N'COLUMN',
@level2name=@ColumnName
GO
</code></pre>
| 3,887
|
<p>I'm a beginner at rails programming, attempting to show many images on a page. Some images are to lay on top of others. To make it simple, say I want a blue square, with a red square in the upper right corner of the blue square (but not tight in the corner). I am trying to avoid compositing (with ImageMagick and similar) due to performance issues.</p>
<p>I just want to position overlapping images relative to one another.</p>
<p>As a more difficult example, imagine an odometer placed inside a larger image. For six digits, I would need to composite a million different images, or do it all on the fly, where all that is needed is to place the six images on top of the other one.</p>
|
<p>Ok, after some time, here's what I landed on:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.parent {
position: relative;
top: 0;
left: 0;
}
.image1 {
position: relative;
top: 0;
left: 0;
border: 1px red solid;
}
.image2 {
position: absolute;
top: 30px;
left: 30px;
border: 1px green solid;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="parent">
<img class="image1" src="https://via.placeholder.com/50" />
<img class="image2" src="https://via.placeholder.com/100" />
</div></code></pre>
</div>
</div>
</p>
<p>As the simplest solution. That is:</p>
<p>Create a relative div that is placed in the flow of the page; place the base image first as relative so that the div knows how big it should be; place the overlays as absolutes relative to the upper left of the first image. The trick is to get the relatives and absolutes correct.</p>
|
<p>@buti-oxa: Not to be pedantic, but your code is invalid. The HTML <code>width</code> and <code>height</code> attributes do not allow for units; you're likely thinking of the CSS <code>width:</code> and <code>height:</code> properties. You should also provide a content-type (<code>text/css</code>; see Espo's code) with the <code><style></code> tag.</p>
<pre><code><style type="text/css">
.containerdiv { float: left; position: relative; }
.cornerimage { position: absolute; top: 0; right: 0; }
</style>
<div class="containerdiv">
<img border="0" src="http://www.gravatar.com/avatar/" alt="" width="100" height="100">
<img class="cornerimage" border="0" src="http://www.gravatar.com/avatar/" alt="" width="40" height="40">
<div>
</code></pre>
<p>Leaving <code>px;</code> in the <code>width</code> and <code>height</code> attributes might cause a rendering engine to balk.</p>
| 7,091
|
<p>ReSharper Code cleanup feature (with "<a href="http://www.jetbrains.com/resharper/features/code_formatting.html#Reordering_Type_Members_C#_only" rel="noreferrer">reorder members</a>" and "<a href="http://www.jetbrains.com/resharper/features/code_formatting.html#Code_Style_Configuration_and_Sharing" rel="noreferrer">reformat code</a>" enabled) is really great. You define a layout template using XML, then a simple key combination reorganizes your whole source file (or folder/project/solution) according to the rules you set in the template.</p>
<p>Anyway, do you think that could be a problem regarding VCS like subversion, cvs, git, etc. ? Is there a chance that it causes many undesired conflicts ?</p>
<p>Thank you.</p>
|
<p>Yes, it will definitely cause problems. In addition to creating conflicts that have to be manually resolved, when you check in a file that has been reformatted, the VCS will note almost every line as having been changed. This will make it hard for you or a teammate to look back at the history and see what changed when.</p>
<p>That said, if everyone autoformats their code the same way (ie, you distribute that XML template to the team), then it might work well. The problems really only come in when not everyone is doing the same thing.</p>
|
<p>It definitely could cause conflicts.</p>
<p>If you want to use this in a multi-user environment then the configuration of Resharper needs to format your code to a set of standards which are enforced in your organization regardless of whether users make use of Resharper or not.</p>
<p>That way you are using the tool to ensure your own code meets the standards, not blanket applying your preferences to the whole codebase.</p>
| 8,019
|
<p>I have a ARM11 based hardware board which runs a Linux kernel ver. 2.6.21.5-cfs-v19. I have my application running on this ARM-LINUX board. To do source level debugging, of my application I used to use gdb from command prompt of the linux board, that was with some earlier version of the board linux version. </p>
<p>With this version 2.6.21.5-cfs-v19, I dont have a related version of gdb for the board. I tried to look around to get gdb for this version of linux and arm port of it, but without much success. Can anyone point me where I can get either an independant executable for gdb for above mentioned os and board configuration or source for the same, which I may try compiling for that target.</p>
<p>-AD.</p>
|
<p>Sometime ago I published an <a href="http://www.linux.com/feature/121735" rel="nofollow noreferrer">article</a> about cross-target debugging with GDB and GDBServer. The target processor there is PPC7450, but it's rather detailed, so maybe you'll find it useful.</p>
|
<p>You might have some luck using <a href="http://wiki.openembedded.net/index.php/Main_Page" rel="nofollow noreferrer">OpenEmbedded</a>. If there's no precompiled version you can use right away, setting up an OE-cross compile environment is not that hard. </p>
<p>Another option could be to install gdb-server on the board, like described in <a href="http://dominion.thruhere.net/koen/cms/using-gdbserver" rel="nofollow noreferrer">this blogpost</a>.</p>
| 7,457
|
<p>I have a QIDI Tech 1. It has a heated bed, and a cooling fan attachment. Whenever I print without a raft, the first inch or two of material laid down does not adhere to the bed, but the rest of the first layer is flawless.</p>
<p>I have tried speeding up and slowing down the first layer walls, but the problem remains. It also seemed to get a little worse when slower. I also tried not turning on the cooling fan for a bit to see if maybe the material was cooling too quickly, but that had zero effect on it.</p>
<p>I'd like to avoid using tape and other methods since the rest of the print is perfect, and the bed already has a material on it to aid adhesion.</p>
<p>What else can I try to prevent the dragging for the start of the print?</p>
|
<p>I've had this problem in the past with a Flux Delta printer. The first attempt to resolve it was to always use a brim along with a raft. The brim will often have settings to allow number of passes as well as number of layers. If you are not using the brim to provide adhesion, you still can use it to prime the nozzle.</p>
<p>Later versions of the software allowed for start g-code which moved the nozzle to the edge of the print area and extruded 10-40 mm of filament, also providing for priming the nozzle.</p>
<p>You've not noted what slicer you are using. You may find there are suitable locations to position the head to an unused area, run a few mm of filament, then begin your print. </p>
<p>Amazon Q&A says your printer accepts g-code, which implies the slicer generates same. </p>
<p>In combination with a brim, you may have your solution. I've also found that you have a heated bed. If you have a cold spot on the bed, adhesion may be a problem, although I think that is not the case, based on your description.</p>
|
<p><strong>I'd recommend using the "skirt" function</strong> if you're not already. </p>
<p>The idea is to print a few perimeter layers around where your part will be, but not actually touching your part. </p>
<p>Most slicers support this and you can choose how much skirt you want to print. This addresses the issue you mention, and it purges old filament that has spent too much time in the nozzle. As an added bonus, it gives you a good indication that your print location, print height, and first layer adhesion are all good.</p>
| 401
|
<p>3D printer use stepper motors for moving print head and extruding filament. They need to have good torque and resolution.</p>
<p>Microstepping improves resolution as much as 32 fold (I think) but reduces torque the higher you microstep.</p>
<p>So...</p>
<ol>
<li><p>Why not rotate the motor with microstepping at high RPM (which also reduces torque) and increase the torque by heavy gear reduction using a worm gear?</p>
</li>
<li><p>Won't the movement of printhead be even smoother and small errors in microstepping and unevenness of gears be averaged out using high RPM and gear reduction approach?</p>
</li>
<li><p>Does microstepping indeed provide accurate divisions of steps?</p>
</li>
<li><p>Can we get by with weaker motors because torque will be increased by gear reduction?</p>
</li>
<li><p>Can we get by with 48 step stepper motors instead of 200 step because gear reduction provides increased resolution?</p>
</li>
<li><p>There are extruders that use flex shaft to turn worm gear in direct extruder while motor is mounted on frame which turns flex shaft (zesty nimble comes to mind). Why don't they just use smallest possible stepper motor to rotate worm gear directly, instead?</p>
</li>
</ol>
<p>Increasing motor RPM and using gear reduction should preserve the precision and torque, letting you use weaker, lighter motors, potentially reducing granularity of movement. I thought this was simpler approach and I wanted to understand what would I be losing as trade offs. I had considered more friction at worm gear and wear, higher heating of motor etc. But may be it's like "don't fix what ain't broken". 3D printers aren't that costly nowadays. I just wish they were even cheaper.</p>
|
<p>To answer each point:</p>
<ul>
<li><em>Microstepping improves resolution as much as 32 fold (I think) but reduces torque the higher you micro-step.</em></li>
</ul>
<p>Torque is not reduced by micro-stepping. Torque reduction only occurs when you are moving at high RPMs. The motor's phase resistance has to be conducive to the target RPM's (or step rate). Further, micro-stepping can go as has as 1/256, and I have personally used 1/128. Some will say that all higher micro-stepping does is improve smoothness not accuracy. I have personally tested 1/128 micro-stepping over a 17-inch long axis. I was able to achieve accuracy and repeatability to within 5 microns.</p>
<ul>
<li><em>Why not rotate the motor with micro-stepping at high RPM (which also reduces torque) and increase the torque by heavy gear reduction using a worm gear?</em></li>
</ul>
<p>Backlash! The whole point of stepper motors is that they produce backlash-free movement. Putting a transmission between the electromagnetic and the end effector will create backlash that has to be compensated for during the movement. Modern CNC systems account for this in their movement profiles and incorporate automatic backlash compensation (e.g. Mach3)</p>
<ul>
<li><em>Won't the movement of printhead be even smoother and small errors in microstepping and unevenness of gears be averaged out using high RPM and gear reduction approach?</em></li>
</ul>
<p>It is already smooth enough with 1/64th or greater micro-stepping. The extrusion nozzle only goes down to 2mm.</p>
<ul>
<li><em>Does microstepping indeed provide accurate divisions of steps?</em></li>
</ul>
<p>Yes. Yes, it does.</p>
<ul>
<li><em>Can we get by with weaker motors because torque will be increased by gear reduction?</em></li>
</ul>
<p>No, because it will just stall.</p>
<ul>
<li><em>Can we get by with 48 step stepper motors instead of 200 step because gear reduction provides increased resolution?</em></li>
</ul>
<p>Apart from the fact that no one makes 48 steps per revolution motors, using a gear reduction would be counterintuitive. Currently, there are 400 steps per revolution motors, which actually increase accuracy without any torque losses.</p>
<ul>
<li><em>There are extruders that use flex shaft to turn worm gear in direct extruder while motor is mounted on frame which turns flex shaft (zesty nimble comes to mind). Why don't they just use smallest possible stepper motor to rotate worm gear directly, instead?</em></li>
</ul>
<p>Torque! If they used a small motor to drive the extruder they would have to compensate for the torque loss with higher power (i.e. voltages). This would lead to cooling issues for that motor.</p>
<p>Bottom line is that if you size the motors and design the system correctly then a transmission is not needed. If you want more torque, get bigger motors. If the gantry needs to be light weight, then use a delta or corexy mechanism.</p>
|
<p>There's an old rule that says "If the question starts with 'Why don't they,' the answer is most likely 'money.'"</p>
<p>In this case, the issue is the cost of worm gears. Properly mating worm gears are much more expensive to make than common spur gears. That probably accounts for most of it -- not to mention the 200 step motors we see on most FDM printers are a very common item, and the more you make of something the less each one costs.</p>
<p>Beyond that, you can't back-drive most worm gears (especially those with a high reduction ratio). That wouldn't affect an extruder (or would it? I've seen a lot of Things for knobs to go on the extruder motor shaft), but if I couldn't back-drive my X or Y axes I'd be very annoyed (having to use the manual motion control in the firmware for everything like bed tramming) -- even the lead screw Z axis can be back-driven without undue effort.</p>
<p>So, bottom line, what we have now works well enough and making it (maybe a very little bit) better would cost more than what we gain would be worth. IMO.</p>
| 1,963
|
<p>So I have some files I want to ignore in a subversion repository, but I don't want my ignore patterns for this to be propagated to the repository.</p>
<p>In other words, I added some private files in my checkout that I want to keep, but they only exist for me and wouldn't make sense to be ignored for everyone, so if I use the svn:ignore, this will apply on the directory, and I either have to check that in (which I don't want to do), or see that this directory was modified every time I do an svn status.</p>
<p>So, ideally I would like something like a .svnignore file which I could then mark to ignore itself as well as some other files (I think this is a possibility in git for example, using a .gitignore file, or whatever the name is).</p>
<p>I'm guessing it might work to ignore the whole directory (maybe), but then I suspect I won't see any new files in that directory, which would also not be desirable.</p>
<p>So does anybody know a way to do this in subversion?</p>
|
<p>Subversion <strong>does</strong> have a <a href="http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.advanced.props.special.ignore" rel="nofollow noreferrer">per-user, global ignore setting</a>, which sounds like what you want. Look in your <code>.subversion</code> directory (found in your <em>home</em> directory) and locate the <code>Miscellany</code> section of the config file. There should be an entry called global-ignores.</p>
<p>For Windows users, this setting is found in the registry under HKEY_LOCAL_MACHINE\Software\Tigris.org\Subversion.</p>
<p>More information is available in <a href="http://svnbook.red-bean.com/en/1.7/svn-book.html" rel="nofollow noreferrer">the Version Control with Subversion (the SVNBook)</a>.</p>
|
<p>I'm confused about 2 things:</p>
<ul>
<li>why do you have files that you don't want to check in that other people <em>might</em> want to check in? seems like you'd get a conflict if that happened anyway</li>
<li>does just "ignoring" in the human sense not work for you?</li>
</ul>
<p>I'm just having trouble seeing a scenario where you wouldn't want to use svn:ignore...</p>
| 7,565
|
<p>A reliable coder friend told me that Python's current multi-threading implementation is seriously buggy - enough to avoid using altogether. What can said about this rumor?</p>
|
<p>Python threads are good for <strong>concurrent I/O programming</strong>. Threads are swapped out of the CPU as soon as they block waiting for input from file, network, etc. This allows other Python threads to use the CPU while others wait. This would allow you to write a multi-threaded web server or web crawler, for example.</p>
<p>However, Python threads are serialized by the <a href="http://en.wikipedia.org/wiki/Global_Interpreter_Lock" rel="noreferrer">GIL</a> when they enter interpreter core. This means that if two threads are crunching numbers, only one can run at any given moment. It also means that you can't take advantage of multi-core or multi-processor architectures.</p>
<p>There are solutions like running multiple Python interpreters concurrently, using a C based threading library. This is not for the faint of heart and the benefits might not be worth the trouble. Let's hope for an all Python solution in a future release.</p>
|
<p>I've used it in several applications and have never had nor heard of threading being anything other than 100% reliable, as long as you know its limits. You can't spawn 1000 threads at the same time and expect your program to run properly on Windows, however you can easily write a worker pool and just feed it 1000 operations, and keep everything nice and under control.</p>
| 5,419
|
<p>I'm writing a C# POS (point of sale) system that takes input from a keyboard wedge magcard reader. This means that any data it reads off of a mag stripe is entered as if it were typed on the keyboard very quickly. Currently I'm handling this by attaching to the KeyPress event and looking for a series of very fast key presses that contain the card swipe sentinel characters.</p>
<p>Is there a better way to deal with this sort of input? </p>
<p>Edit: The device does simply present the data as keystrokes and doesn't interface through some other driver. Also We use a wide range of these types of devices so ideally a method should work independent of the specific model of wedge being used. However if there is no other option I'll have to make do.</p>
|
<p>One thing you can do is that you should be able to configure your wedge reader so that it presents one or many escape characters before or after the string. You would use these escape characters to know that you are about to have (or just had) a magcard input.</p>
<p>This same technique is used by barcode reader devices so you application knows to get focus or handle the data input from the device.</p>
<p>The negative to this approach is that you have to properly configure your external devices. This can be a deployment issue.</p>
<p>This assumes that your devices simply present the data as keystrokes and don't interface through some other driver.</p>
|
<p>I second <a href="https://stackoverflow.com/questions/42437/best-way-to-handle-input-from-a-keyboard-wedge#42448">@jttraino's idea</a>. </p>
<p>It is the way to go for bar scan/code readers and other such devices that are plug and play (PnP). I have used the same technique to configure a couple of 1D and 2D bar code scanners in my previous assignment.</p>
| 6,390
|
<p>I'm a bit newbieish when it comes to the deeper parts of OSX configuration and am having to put up with a fairly irritating niggle which while I can put up with it, I know under Windows I could have sorted in minutes.</p>
<p>Basically, I have an external disk with two volumes: </p>
<p>One is an HFS+ volume which I use for TimeMachine backups.
The other, an NTFS volume that I use for general file copying etc on Mac and Windows boxes.</p>
<p>So what happens is that whenever I plug in the disk into my Mac USB, OSX goes off and mounts both volumes and shows an icon on the desktop for each. The thing is that to remove the disk you have to eject the volume and in this case do it for both volumes, which causes an annoying warning dialog to be shown every time. </p>
<p>What I'd prefer is some way to prevent the NTFS volume from auto-mounting altogether. I've done some hefty googling and here's a list of things I've tried so far:</p>
<ul>
<li>I've tried going through options in Disk Utility</li>
<li>I've tried setting AutoMount to No in /etc/hostconfig but that is a bit too global for my liking.</li>
<li>I've also tried the suggested approach to putting settings in fstab but it appears the OSX (10.5) is ignoring these settings.</li>
</ul>
<p>Any other suggestions would be welcomed. Just a little dissapointed that I can't just tick a box somewhere (or untick).</p>
<p>EDIT: Thanks heaps to hop for the answer it worked a treat. For the record it turns out that it wasn't OSX not picking up the settings I actually had "msdos" instead of "ntfs" in the fs type column.</p>
|
<p>The following entry in <code>/etc/fstab</code> will do what you want, even on 10.5 (Leopard):</p>
<pre><code>LABEL=VolumeName none ntfs noauto
</code></pre>
<p>If the file is not already there, just create it. Do not use <code>/etc/fstab.hd</code>! No reloading of <code>diskarbitrationd</code> needed.</p>
<p>If this still doesn't work for you, maybe you can find a hint in the syslog.</p>
|
<p>This is not directly an answer, but</p>
<blockquote>
<p>The thing is that to remove the disk you have to eject the volume and in this case do it for both volumes</p>
</blockquote>
<p>I have a similar situation.</p>
<p>OSX remembers where you put your icons on the desktop - I've moved the icons for both of my removable drives to <em>just</em> above where the trash can lives.</p>
<p>Eject procedure becomes</p>
<ul>
<li>Hit top-left of screen with mouse to show desktop</li>
<li>Drag small box around both removable drives</li>
<li>Drag 2cm onto trash so they both get ejected</li>
<li>Remove firewire cable</li>
</ul>
| 4,121
|
<p>We have a Prusa i3 MK2 and we've changed for a print with another colour material but when I pressed "load filament", it didn't make anything. </p>
<p>Often after five times doing that the printer works. I don't have any pictures but the filament is in the hole and the printer holds it. However, it doesn't push it into the extruder and the remains of the old filament do not come out, so I wonder why the motors just stop and don't work. </p>
<p>Sometimes there are no problems - sometimes more and sometimes less. I hope someone has the reason for this problem.</p>
|
<p>My 0.02c:</p>
<ol>
<li>Cut the tip of the new filament at an angle so that it is pointed enough. This will ensure that it easily enters the hole leading into the hot end beneath the extruder drive gear. A lot of times the curl in the filament (from being wound on a spool) will cause misalignment and lead to it not entering this hole properly.</li>
<li>Check filament debris lodged in the extruder gear teeth. Sometimes this will prevent good grip on the filament.</li>
<li>Finally you can try increasing the nozzle temperature. Often times any residue inside the nozzle will be cleared by elevating temperature and pushing in new filament.</li>
</ol>
|
<p>First make sure that the hotend is hot enough.
Second you need to check your extruder if it is clean.
Third try to push the filament by hand and look if it comes out. If yes than the problem should be in the motor.
The motor connection wire could be loose.</p>
| 847
|
<p>While creating a file synchronization program in C# I tried to make a method <code>copy</code> in <code>LocalFileItem</code> class that uses <code>System.IO.File.Copy(destination.Path, Path, true)</code> method where <code>Path</code> is a <code>string</code>.<br>
After executing this code with destination. <code>Path = "C:\\Test2"</code> and <code>this.Path = "C:\\Test\\F1.txt"</code> I get an exception saying that I do not have the required file permissions to do this operation on <strong>C:\Test</strong>, but <strong>C:\Test</strong> is owned by myself <em>(the current user)</em>.<br>
Does anybody knows what is going on, or how to get around this?</p>
<p>Here is the original code complete.</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace Diones.Util.IO
{
/// <summary>
/// An object representation of a file or directory.
/// </summary>
public abstract class FileItem : IComparable
{
protected String path;
public String Path
{
set { this.path = value; }
get { return this.path; }
}
protected bool isDirectory;
public bool IsDirectory
{
set { this.isDirectory = value; }
get { return this.isDirectory; }
}
/// <summary>
/// Delete this fileItem.
/// </summary>
public abstract void delete();
/// <summary>
/// Delete this directory and all of its elements.
/// </summary>
protected abstract void deleteRecursive();
/// <summary>
/// Copy this fileItem to the destination directory.
/// </summary>
public abstract void copy(FileItem fileD);
/// <summary>
/// Copy this directory and all of its elements
/// to the destination directory.
/// </summary>
protected abstract void copyRecursive(FileItem fileD);
/// <summary>
/// Creates a FileItem from a string path.
/// </summary>
/// <param name="path"></param>
public FileItem(String path)
{
Path = path;
if (path.EndsWith("\\") || path.EndsWith("/")) IsDirectory = true;
else IsDirectory = false;
}
/// <summary>
/// Creates a FileItem from a FileSource directory.
/// </summary>
/// <param name="directory"></param>
public FileItem(FileSource directory)
{
Path = directory.Path;
}
public override String ToString()
{
return Path;
}
public abstract int CompareTo(object b);
}
/// <summary>
/// A file or directory on the hard disk
/// </summary>
public class LocalFileItem : FileItem
{
public override void delete()
{
if (!IsDirectory) File.Delete(this.Path);
else deleteRecursive();
}
protected override void deleteRecursive()
{
Directory.Delete(Path, true);
}
public override void copy(FileItem destination)
{
if (!IsDirectory) File.Copy(destination.Path, Path, true);
else copyRecursive(destination);
}
protected override void copyRecursive(FileItem destination)
{
Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(
Path, destination.Path, true);
}
/// <summary>
/// Create's a LocalFileItem from a string path
/// </summary>
/// <param name="path"></param>
public LocalFileItem(String path)
: base(path)
{
}
/// <summary>
/// Creates a LocalFileItem from a FileSource path
/// </summary>
/// <param name="path"></param>
public LocalFileItem(FileSource path)
: base(path)
{
}
public override int CompareTo(object obj)
{
if (obj is FileItem)
{
FileItem fi = (FileItem)obj;
if (File.GetCreationTime(this.Path).CompareTo
(File.GetCreationTime(fi.Path)) > 0) return 1;
else if (File.GetCreationTime(this.Path).CompareTo
(File.GetCreationTime(fi.Path)) < 0) return -1;
else
{
if (File.GetLastWriteTime(this.Path).CompareTo
(File.GetLastWriteTime(fi.Path)) < 0) return -1;
else if (File.GetLastWriteTime(this.Path).CompareTo
(File.GetLastWriteTime(fi.Path)) > 0) return 1;
else return 0;
}
}
else
throw new ArgumentException("obj isn't a FileItem");
}
}
}
</code></pre>
|
<p>It seems you have misplaced the parameters in File.Copy(), it should be File.Copy(string source, string destination).</p>
<p>Also is "C:\Test2" a directory? You can't copy file to a directory.
Use something like that instead:
<pre>
File.Copy(
sourceFile,
Path.Combine(destinationDir,Path.GetFileName(sourceFile))
)</pre>;</p>
|
<p>I'm kinda guessing here, but could it be because:</p>
<ul>
<li>You are trying to perform file operations in C: root? (there may be protection on this by Vista if you are using it - not sure?)</li>
<li>You are trying to copy to a non-existant directory?</li>
<li>The file already exists and may be locked? (i.e you have not closed another application instance)?</li>
</ul>
<p>Sorry I cant be of more help, I have rarely experienced problems with File.Copy.</p>
| 4,399
|
<p>So I know that unit testing is a must. I get the idea that TDD is the way to go when adding new modules. Even if, in practice, I don't actually do it. A bit like commenting code, really. </p>
<p>The real thing is, I'm struggling to get my head around how to unit-test the UI and more generally objects that generate events: user controls, asynchronous database operations, etc. </p>
<p>So much of my code relates to UI events that I can't quite see how to even start the unit testing. </p>
<p>There must be some primers and starter docs out there? Some hints and tips? </p>
<p>I'm generally working in C# (2.0 and 3.5) but I'm not sure that this is strictly relevant to the question. </p>
|
<p>the thing to remember is that unit testing is about testing the units of code you write. Your unit tests shouldn't test that clicking a button raises an event, but that the code being executed by that click event does as it's supposed to.</p>
<p>What you're really wanting to do is test the underlying code does what it should so that your UI layers can execute that code with confidence. </p>
|
<p>You should separate logic and presentation. Using MVP(Model-View-Presenter)/MVC (Model-View-Controller) patterns you can unit test you logic without relying on UI events.
Also you can use <a href="http://www.codeplex.com/white" rel="nofollow noreferrer">White framework</a> to simulate user input.
I would highly recommend you to visit Microsoft's <a href="http://msdn.microsoft.com/en-us/practices/default.aspx" rel="nofollow noreferrer">Patterns&Practices developer center</a>, especially take a look at composite application block and Prism - you can get a lot of information on test driven design.</p>
| 5,869
|
<p>I'm trying to make a water insulated 1 cm<sup>3</sup> (1 ml) transparent container and I bought some plexiglass, I cut and glued some pieces together but it looks really crappy and barely holds the water in. I was wondering, is there a transparent material (similar to plexiglass) that can order to 3D print the container out of it? Also, if 3D printing is not the best option, where can I order around a 100 pieces of 1 cm<sup>3</sup> transparent water insulating containers with caps?</p>
|
<p>Yes. You'll probably want to use SLA or Polyjet printers with transparent resin. For example, here's <a href="https://www.shapeways.com/materials/sla-accura-60" rel="nofollow noreferrer">Shapeways' page on transparent SLA</a> and <a href="https://www.shapeways.com/materials/multi-color-polyjet" rel="nofollow noreferrer">their page on Polyjet</a> (which says you need to phone them for transparent Polyjet parts as their online order system can't handle it).</p>
<p>FDM printing with transparent materials doesn't usually result in parts that look like transparent injection-moulded parts, because the lines of material laid down by the printer are visible. There are <a href="https://3dprinting.stackexchange.com/q/16/13100">some techniques to make this better</a>, but a printing bureau is less likely to offer this kind of special handling.</p>
<p>In any case, you should discuss your requirements in more detail with suppliers, and they'll be able to advise whether they offer any manufacturing processes that meet your needs. In particular, if you need your containers to be food-safe, you should mention that at the start, as it'll rule out a lot of possible suppliers, machines, and materials.</p>
|
<p>You could order an sla or dlp printed part(which would probably be more expensive, but also quite durable and a little more transparent). Or you could order an fdm printed T-glase print, which would come out pretty clear and not be quite as strong as sla, but still pretty good for holding water.</p>
| 1,446
|
<p>Regarding the same program as <a href="https://stackoverflow.com/questions/20061/store-data-from-a-c-application">my question a few minutes ago</a>... I added a setup project and built an MSI for the program (just to see if I could figure it out) and it works great except for one thing. When I tried to install it on my parent's laptop, their antivirus (the free Avast Home Edition) set off an alarm and accused my setup.exe of being a Trojan.</p>
<p>Does anyone have any idea why this would be happening and how I can fix it?</p>
|
<p>Indeed, boot from a clean CD (use a known good machine to build <a href="http://nu2.nu/pebuilder/" rel="nofollow noreferrer">BartPE</a> or something similar) and scan your machine thoroughly. Another good thing to check, though, would be exactly which virus Avast! thinks your program is. Once you know that, you should be able to look it up in one of the virus databases and insure that your software can't contain it.</p>
<p>The odds are that Avast! is just getting a false positive for some reason, and I don't know that there's much you can do about that other than contacting Avast! and hoping for a reply.</p>
|
<p>The very first thing to do would be to scan your build PC for viruses.</p>
| 4,051
|
<p>I create a new Button object but did not specify the <code>command</code> option upon creation. Is there a way in Tkinter to change the command (onclick) function after the object has been created?</p>
|
<p>Though <a href="https://stackoverflow.com/questions/68327/change-command-method-for-tkinter-button-in-python#68455">Eli Courtwright's</a> program will work fine¹, what you really seem to want though is just a way to reconfigure after instantiation any attribute which you could have set when you instantiated². How you do so is by way of the configure() method.</p>
<pre><code>from Tkinter import Tk, Button
def goodbye_world():
print "Goodbye World!\nWait, I changed my mind!"
button.configure(text = "Hello World!", command=hello_world)
def hello_world():
print "Hello World!\nWait, I changed my mind!"
button.configure(text = "Goodbye World!", command=goodbye_world)
root = Tk()
button = Button(root, text="Hello World!", command=hello_world)
button.pack()
root.mainloop()
</code></pre>
<p>¹ "fine" if you use only the mouse; if you care about tabbing and using [Space] or [Enter] on buttons, then you will have to implement (duplicating existing code) keypress events too. Setting the <code>command</code> option through <code>.configure</code> is much easier.</p>
<p>² the only attribute that can't change after instantiation is <code>name</code>.</p>
|
<p>Sure; just use the <code>bind</code> method to specify the callback after the button has been created. I've just written and tested the example below. You can find a nice tutorial on doing this at <a href="http://www.pythonware.com/library/tkinter/introduction/events-and-bindings.htm" rel="nofollow noreferrer">http://www.pythonware.com/library/tkinter/introduction/events-and-bindings.htm</a></p>
<pre><code>from Tkinter import Tk, Button
root = Tk()
button = Button(root, text="Click Me!")
button.pack()
def callback(event):
print "Hello World!"
button.bind("<Button-1>", callback)
root.mainloop()
</code></pre>
| 9,383
|
<p>My printed parts consist rafts, supports and other extraneous filament when printing with ABS or PLA.</p>
<p>What are efficient general techniques of removing them?</p>
|
<p>The best way to get rid of them is to change the design of the printed object to make them unnecessary.</p>
<p>Instead of printing the one part with support material, the piece can be split into two or more parts which can be printed without support material and assembled after the printing.</p>
<hr>
<p>Given that this is not always fully possible, a convenient way to get rid of additional structures is to use a different fillament for them that can be removed easily. <a href="https://www.matterhackers.com/3d-printer-filament-compare">This list of printing materials</a> includes Polyvinyl Acetate (<strong>PVA</strong>), which is water soluble. You can wash the support material away given that your actual printign material is not water soluble. Here's a quote from the website (emphasize mine):</p>
<blockquote>
<p>PVA (Polyvinyl Acetate) filament prints translucent with a slightly yellow tint and is <strong>primarily used as a 3D printing support material</strong> because it is water-soluble, meaning that <strong>it will dissolve when exposed to water</strong> (and so MUST be kept dry prior to use). PVA is most often used with 3D printers capable of dual extrusion: one extruder printing a primary material (such as ABS or PLA) and the other printing this dissolvable filament to provide support for overhanging features. PVA 3D printer filament is available in 1.75mm and 3mm.</p>
</blockquote>
|
<p>I usually use a chisel or a flat-head screwdriver to easily remove the bottom plate that the printer auto-generates. I would also suggest using something like wire cutters or some mini pliers to pull them off.</p>
| 93
|
<p>What is the difference between Introspection and Reflection in .NET</p>
|
<p>They're two parts of the same whole.</p>
<p>Introspection refers to the ability of a class to look 'inside' itself and see, for example, what parameters a method takes, what the names of its members are, etc.</p>
<p>Reflection is the specific name for how .NET implements introspection. Other languages may call it something different (C++ calls its limited introspection RTTI, for run-time type information).</p>
|
<p>They're two parts of the same whole.</p>
<p>Introspection refers to the ability of a class to look 'inside' itself and see, for example, what parameters a method takes, what the names of its members are, etc.</p>
<p>Reflection is the specific name for how .NET implements introspection. Other languages may call it something different (C++ calls its limited introspection RTTI, for run-time type information).</p>
| 9,903
|
<p>So, I have willfully kept myself a Java n00b until recently, and my first real exposure brought about a minor shock: Java does not have C# style properties!</p>
<p>Ok, I can live with that. However, I can also swear that I have seen property getter/setter code in Java in one codebase, but I cannot remember where. How was that achieved? Is there a language extension for that? Is it related to NetBeans or something?</p>
|
<p>There is a "standard" pattern for getters and setters in Java, called <a href="http://docs.oracle.com/javase/tutorial/javabeans/writing/properties.html" rel="nofollow noreferrer">Bean properties</a>. Basically any method starting with <code>get</code>, taking no arguments and returning a value, is a property getter for a property named as the rest of the method name (with a lowercased start letter). Likewise <code>set</code> creates a setter of a void method with a single argument.</p>
<p>For example:</p>
<pre><code>// Getter for "awesomeString"
public String getAwesomeString() {
return awesomeString;
}
// Setter for "awesomeString"
public void setAwesomeString( String awesomeString ) {
this.awesomeString = awesomeString;
}
</code></pre>
<p>Most Java IDEs will generate these methods for you if you ask them (in Eclipse it's as simple as moving the cursor to a field and hitting <kbd>Ctrl</kbd>-<kbd>1</kbd>, then selecting the option from the list).</p>
<p>For what it's worth, for readability you can actually use <code>is</code> and <code>has</code> in place of <code>get</code> for boolean-type properties too, as in:</p>
<pre><code>public boolean isAwesome();
public boolean hasAwesomeStuff();
</code></pre>
|
<p>As previously mentioned for eclipse, integrated development environment (IDE) often can create accessor methods automatically.</p>
<p>You can also do it using NetBeans. </p>
<p>To create accessor methods for your class, open a class file, then Right-click anywhere in the source code editor and choose the menu command Refactor, Encapsulate Fields.
A dialog opens. Click Select All, then click Refactor.
Voilà,</p>
<p>Good luck,</p>
| 9,587
|
<p>I'm looking for a way to configure a DB connection at runtime; specifically using the Enterprise Library. I see that there's a *.Data.Configuration (or something close to this ... don't recall off the top of my head) assembly but am finding not much on the interwebs. Complicating matters is the fact that the API help is broken on Vista.</p>
<p>Now, I found this work-around:</p>
<pre><code>Configuration cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ConnectionStringSettings connection = new ConnectionStringSettings();
connection.Name = "Runtime Connection";
connection.ProviderName = "System.Data.OleDb";
connection.ConnectionString = "myconstring";
cfg.ConnectionStrings.ConnectionStrings.Add(connection);
cfg.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("connectionStrings");
var runtimeCon = DatabaseFactory.CreateDatabase("Runtime Connection");
</code></pre>
<p>And although it gives me what I want, it permanently edits the App.config. Sure I can go back and delete the changes, but I'd rather not go through this hassle.</p>
|
<p>If you're using a winforms app you could try using <a href="http://msdn.microsoft.com/en-us/library/aa221771(office.11).aspx" rel="nofollow noreferrer">UserProperties</a> to store this info. Another possible solution could be <a href="http://msdn.microsoft.com/en-us/library/2tw134k3.aspx" rel="nofollow noreferrer">custom configuration sections</a>.</p>
|
<p>If you don't want it saved, you do not need to execute the cfg.Save command. </p>
<p>The Configuration object will store your changes until it isn't needed anymore.</p>
| 3,650
|
<p>I am writing a C# control that wraps DirectX 9 and provides a simplified interface to perform 2D pixel level drawing. .NET requires that I wrap this code in an unsafe code block and compile with the allow unsafe code option.</p>
<p>I'm locking the entire surface which then returns a pointer to the locked area of memory. I can then write pixel data directly using "simple" pointer arithmetic. I have performance tested this and found a substantial speed improvement over other "safe" methods I know of.</p>
<p>Is this the fastest way to manipulate individual pixels in a C# .NET application? Is there a better, safer way? If there was an equally fast approach that does not require pointer manipulation it would be my preference to use that.</p>
<p>(I know this is 2008 and we should all be using DirectX 3D, <a href="http://en.wikipedia.org/wiki/OpenGL" rel="nofollow noreferrer">OpenGL</a>, etc., however this control is to be used exclusively for 2D pixel rendering and simply does not require 3D rendering.)</p>
|
<p>Using unsafe pointers is the fastest way to do direct memory manipulation in C# (definitely faster than using the Marshal wrapper functions).</p>
<p>Just out of curiosity, what sort of 2D drawing operations are you trying to perform?</p>
<p>I ask because locking a DirectX surface to do pixel level manipulations will defeat most of the hardware acceleration benefits that you would hope to gain from using DirectX. Also, the DirectX device will fail to initialize when used over terminal services (remote desktop), so the control will be unusable in that scenario (this may not matter to you).</p>
<p>DirectX will be a big win when drawing large triangles and transforming images (texture mapped onto a quad), but it won't really perform that great with single pixel manipulation.</p>
<p>Staying in .NET land, one alternative is to keep around a Bitmap object to act as your surface, using LockBits and directly accessing the pixels through the unsafe pointer in the returned BitmapData object.</p>
|
<p>I recently was tasked with creating a simple histogram control for one of our thin client apps (C#). The images that I was analyzing were about 1200x1200 and I had to go the same route. I could make the thing draw itself once with no problem, but the control needed to be re-sizable. I tried to avoid it, but I had to get at the raw memory itself.</p>
<p>I'm not saying it is impossible using the standard .NET classes, but I couldn't get it too work in the end.</p>
| 7,982
|
<p>Where should I start learning about version control systems? I've used SVN, Team Foundation, and Sourcesafe in the past but I don't really feel like I grasp it completely, and my team doesn't seem to grasp it either.</p>
<p>Which points are the most important to master? I realise this differs from VCS to VCS, but for the sake of this question we can assume that Subversion is the VCS I'm the most interested in learning about.</p>
<p>Also, if you could, please recommend any books on the subject that you find useful.</p>
|
<p>The wikipedia article on Revision Control is a great place to start </p>
<p><a href="http://en.wikipedia.org/wiki/Revision_control" rel="nofollow noreferrer">Revision control</a></p>
<p>When trying to teach my colleagues, I found getting him to understand the vocabulary at the end was a great way to start to introduce him to source code control techniques.</p>
<p>Don't know what a branch is? Go find out and how they work :)</p>
<p>There's a free online subversion book at <a href="http://svnbook.red-bean.com" rel="nofollow noreferrer">Version Control with Subversion</a> which provides an invaluable reference.</p>
|
<p><a href="http://ericsink.com/vcbe/" rel="nofollow">Version control by example by Eric Sink</a> is good and easy to follow</p>
| 3,024
|
<p>I'm using BlogEngine.NET (a fine, fine tool) and I was playing with the TinyMCE editor and noticed that there's a place for me to create a list of external links, but it has to be a javascript file:</p>
<p><code>external_link_list_url : "example_link_list.js"</code></p>
<p>this is great, of course, but the list of links I want to use needs to be generated dynamically from the database. This means that I need to create this JS file from the server on page load. Does anyone know of a way to do this? Ideally, I'd like to just overwrite this file each time the editor is accessed.</p>
<p>Thanks!</p>
|
<p>I would create an HTTPHandler that responds with the desired data read from the db. Just associate the HTTPHandler with the particular filename 'example_link_list.js' in your web-config. Make sure you set </p>
<pre><code>context.Response.ContentType = "text/javascript";
</code></pre>
<p>then just context.Response.Write(); your list of external links</p>
|
<p>If you can't change the file extension (and just return plain text, the caller shouldn't care about the file extension, js is plain text) then you can set up a handler on IIS (assuming it's IIS) to handle javascript files.</p>
<p>See this link - <a href="http://msdn.microsoft.com/en-us/library/bb515343.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/bb515343.aspx</a> - for how to setup IIS 6 within windows to handle any file extension. Then setup a HttpHandler to receive requests for .js (Just google httphandler and see any number of good tutorials like this one: <a href="http://www.devx.com/dotnet/Article/6962/0/page/3" rel="nofollow noreferrer">http://www.devx.com/dotnet/Article/6962/0/page/3</a> )</p>
| 9,357
|
<p>For example:</p>
<blockquote>
<p>This is main body of my content. I have a
footnote link for this line [1]. Then, I have some more
content. Some of it is interesting and it
has some footnotes as well [2].</p>
<p>[1] Here is my first footnote.</p>
<p>[2] Another footnote.</p>
</blockquote>
<p>So, if I click on the "[1]" link it directs the web page to the first footnote reference and so on. How exactly do I accomplish this in HTML?</p>
|
<p>Give a container an id, then use <code>#</code> to refer to that Id.</p>
<p>e.g.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><p>This is main body of my content. I have a footnote link for this line <a href="#footnote-1">[1]</a>. Then, I have some more content. Some of it is interesting and it has some footnotes as well <a href="#footnote-2">[2]</a>.</p>
<p id="footnote-1">[1] Here is my first footnote.</p>
<p id="footnote-2">[2] Another footnote.</p></code></pre>
</div>
</div>
</p>
|
<p>anchor tags using named anchors</p>
<p><a href="http://www.w3schools.com/HTML/html_links.asp" rel="nofollow noreferrer">http://www.w3schools.com/HTML/html_links.asp</a></p>
| 9,254
|
<p>Fairly long winded, but hopefully makes sense;</p>
<p>I understand that G-code is executed line-by-line, and in the main printing phase each instruction is effectively go to location XY (assuming staying within the layer) at a set speed with a set extrusion amount (not rate, as far as I can tell). </p>
<p>Imagine you were printing a single road width, say 10 mm long. If the single instruction says to move that 10 mm at a set speed and extrude 10mm of material (which is, I guess, not 10mm of filament), with infinite acceleration and deceleration of the nozzle and extruder gears, then a linear amount of material would be extruded per unit length along the 10 mm. However, given that there is some acceleration and deceleration, that extrusion must be non-linear. </p>
<p>My questions are as follows;
- Is it possible to counteract this within a single line of Gcode by having a variable extrusion rate?
- Can the machine do so regardless of the instructions given to it?
- Is this effect embraced somehow?
- Does the need to accelerate both the nozzle position and filament effectively cancel out?
-Would/could you aim instead to split a single straight line of filament into multiple lines of G-code, some extruding (say in the middle), and some not (say at each end)?</p>
|
<p>My understanding is that the printer firmware will define the maximum acceleration and speeds for each axis (X, Y, Z, and E). When executing a line of g-code that involves more than one axis, the acceleration for each will be limited such that they all begin and end, including acceleration together.</p>
<p>During the start and end of a line, when the print nozzle is moving more slowly, the extruder will also move slowly. In the middle of the line, the extruder will move faster. The amount of material extruded per distance will be constant over the length of the line.</p>
<p>Another way to look at it - suppose you could accelerate quickly on X with a high top speed, but slowly on Y. A move only in the X direction could happen quickly. A move only in the Y direction would be slower. If you want to move at a 45-degree angle, you will need to slow down X so that it doesn't get ahead of Y.</p>
<p>If you did want to intentionally vary the amount of extrusion per distance during a line, you would need to break it into multiple segments with individual lines of g-code.</p>
|
<h1>No</h1>
<p>G-code is written line separated, starting with one command what to do, then who does it with what factors. For example <code>G1 X10 F100 E10</code> says this:</p>
<ul>
<li><code>G1</code> Move...</li>
<li><code>X10</code> The X axis by 10</li>
<li><code>F100</code> Use the factor to 100 units</li>
<li><code>E10</code> Also: the Extruder by 10</li>
</ul>
<p>To my knowledge any repeated or invalid expression is simply ignored (or overwritten). So <code>G1 X10 F100 E10 F200</code> gets parsed as either <code>G1 X10 F100 E10</code> or <code>G1 X10 E10 F200</code>, depending on how your firmware interpreter is set up.</p>
| 1,218
|
<p>I am trying to import an STL file, I created in FreeCAD. It has a hole in the hull of the object and behind that hole there are two pins inside the object (see attached FreeCAD screenshot).</p>
<p>When I import the STL in Cura, there are no walls around the whole object where there is the hole in the hull (see attached Cura screenshots). However the wall and the hole are visible in light grey, Cura just doesn't print it.</p>
<p>Update:</p>
<p> I understand the problem. It's not a watertight solid. I found a way to import it somewhat fine using meshmixer to create a hollow with an offset which makes the outer Hull actually have a thickness to it. Now the problem is, that's not really what I want. The result in cura now can't be printed with infill since the actual inside of the model is only within the walls. Also cura sees both sides of the wall as outer Perimeter. I understand the problem but actually am looking for a way to just prevent printing part of the regular model's wall.. In other words: I would basically like to set the whall line count to zero in that particular area. I just tried to use the support blocker and "Modify settings for overlap" but that doesn't do anything.</p>
<p>CURA:</p>
<p><a href="https://i.stack.imgur.com/hrCAY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hrCAY.png" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/7ETuW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7ETuW.png" alt="enter image description here"></a></p>
<p>FreeCAD:
<a href="https://i.stack.imgur.com/Lddxh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Lddxh.png" alt="enter image description here"></a></p>
|
<p>This is clearly overextrusion relative to the volume the material is being deposited into, but that doesn't necessarily mean your extrusion rate is wrong. It could be:</p>
<ul>
<li>Nozzle smashed down into the bed (bed way too high) but somehow still extruding</li>
<li>Problem in Z axis movement preventing the head from moving up the right amount for each layer (possibly not moving up at all?)</li>
<li>Extrusion (flow) increased significantly above 100% in slicer</li>
<li>Wrong extruder steps/mm setting (usually controlled on printer not slicer, though you can send a setting in the start gcode)</li>
<li>Misconfigued filament diameter (unlikely since there's no common setting smaller than 1.75 mm; larger setting would under-extrude)</li>
</ul>
|
<p>Bad filament is my answer. I bought PRLine and both print terrible like your picture. Suspect 2 factors, one is that the line is less than 1.75, so they underextrude and so you see those lines and in some cases gaps, second is the material itself is slippery suggesting to me that it has florinated additives.</p>
| 1,622
|
<p>I was going to Ask a Question earlier today when I was presented to a surprising functionality in Stackoverflow. When I wrote my question title stackoverflow suggested me several related questions and I found out that there was already two similar questions. That was stunning! </p>
<p>Then I started thinking how I would implement such function. How I would order questions by relatedness:</p>
<ol>
<li>Question that have higher number of
words matchs with the new question</li>
<li>If the number of matchs are the
same, the order of words is considered</li>
<li>Words that appears in the title has
higher relevancy</li>
</ol>
<p>That would be a simple workflow or a complex score algortithm?
Some stemming to increase the recall, maybe?
Is there some library the implements this function?
What other aspects would you consider?
Maybe Jeff could answer himself! How did you implemented this in Stackoverflow? :)</p>
|
<p>One such way to implement such an algorithm would involve ranking the questions as per a heuristic function which assigns a 'relevance' weight factor using the following steps:</p>
<ol>
<li>Apply a noise filter to the 'New' question to remove words that are common across a large number of objects such as: 'the', 'and', 'or', etc.</li>
<li>Get the number of words contained in the 'New' question which match the words the set of questions already posted on the website. [A]</li>
<li>Get the number of tag matches between the words in the 'New' question and the available. [B]</li>
<li>Compute the 'relevance weight' based on [A] and [B] as 'x[A] + y[B]', where x and y are weight multipliers (Assign a higher weight multiplier to [B] as tagging is more relevant than simple word search)</li>
<li>Get the top 5 questions which have the highest 'relevance weight'.</li>
</ol>
<p>The heuristic might require tweaking to get optimal results, but it should work.</p>
|
<p>Isn't StackOverflow going to be open sourced at some point? If so, you can always find out how they did it there.</p>
<p>Update: It appears that they say they <em>might</em> open source it. I hope they do.</p>
| 6,399
|
<p>I've been 3D printing for a while and I've noticed that, when printing small parts, my colored plastics (PLA, PLA+ and ABS) have better layer adhesion than black ones.</p>
<p>Did you notice this?</p>
<p>What could be the cause?</p>
|
<p>Not inherently.</p>
<p>There are two things at work that might cause one color to test weaker than others even as its properties otherwise are functionally identical:</p>
<ol>
<li>A bad print among good ones.</li>
<li>A bad roll among good ones.</li>
</ol>
<p>Let's take a look at both, then do a little excursus into plastics and color.</p>
<h2>A bad print</h2>
<p>There are probably thousands of reasons a print might fail, but bad layer bonding and squish-ability under torsion strongly hint to under extrusion. Now, under extrusion itself can be caused by a plethora of reasons: a clogged nozzle is equally as possible as too thinner diameter as is just a bad temperature. The last one is, in my opinion, the most likely culprit: filaments may look the same and feel the same and bond the same, but in different colors, they sometimes demand different print settings.</p>
<p>As an example, I print most of my Kaisertech PLAs at 200°C, as that offers a quite good result for all of them. Yet when I started I had a white China PLA and a crystal clear PLA from the same manufacturer, both came from the same warehouse in the same shipment. The clear one is quite more brittle on the roll, but their starting-to-print temperature differs by 5°C - the white started to extrude at 180°C decently and printed ok at 195°C-200°C, while the clear needed only 175°C to start to be extrudeable and was really printable at 190°C. Yet recently I tried the same roll again to achieve fully clear prints, and with 210°C and lots of overextrusion, I managed to go almost solid-clear. Because of such experience, I suggest tweaking the settings.</p>
<h2>A Bad Filament</h2>
<p>There are several reasons why one roll might resulting in bad prints, but the most prominent are that the roll has <em>gone</em> bad over bad storage. It might be stored too hot or too humid, making it brittle or bubble in the hotend. Aging under UV plays a role (it degrades PLA). And dimensional accuracy plays a role because it affects the whole roll of filament. This is why tests should always be performed with equally treated and measured samples to achieve comparability.</p>
<h2>Excursus: Plastics and color</h2>
<p>What gives a plastic its color? Pigments added to it. Now, pigments can be of varied kinds. Usually, they are embedded in the plastic (=not bonded to the carrier plastic), and the plastic polymer is often either inherently transparent(ish) or white. Let's take some examples to look at...</p>
<ul>
<li><strong>Yellow</strong>. Yellow can be made from a lot of stuff but many yellow pigments react to UV light by decay more than other colors, leading to yellow to fade quickly in comparison to other colors. It has varied chemical compositions, often they can become quite complex.</li>
<li><strong>Black</strong>. Black pigment is typically the most simplistic coloration to achieve: pure powdered carbon is one of our most potent black pigments, and also one of the cheapest, making black plastic one of the most common plastics. In contrast to other colors, carbon can't fade. But the plastic around it decomposes and turns white, fading the color this way.</li>
</ul>
<p>Now, most colorings are - in physical terms - sizeable. Some few to a couple dozen atoms, making them range in the <em>Angström</em> (~Atom diameter) to <em>few nanometer</em> area overall. However, even something as complex as <span class="math-container">$C_{22}H_{20}O_{13}$</span> (Carmine) is relatively small compared to the <span class="math-container">$(C_3H_4O_2)_n$</span> of <strong>Poly</strong>LacticAcid, aka PLA. Poly tells us that n is at least 100, because shorter chains are <em>oligo</em>mers, not <em>poly</em>mers. In comparison, our red carmine pigment is more dense, much more compact in fact. As a result, a 100-chain of PLA is not just in the <em>Angstöm</em> area but in the <em>dozen nanometer</em> to <em>micrometer</em> range - a magnitude of at least 2 larger. Unless we have a huge excess of pigment or a pigment that reacts with the plastic under heat, then the impact of it on the strength should be neglectible to the other fillers often used.</p>
|
<p>Not inherently.</p>
<p>There are two things at work that might cause one color to test weaker than others even as its properties otherwise are functionally identical:</p>
<ol>
<li>A bad print among good ones.</li>
<li>A bad roll among good ones.</li>
</ol>
<p>Let's take a look at both, then do a little excursus into plastics and color.</p>
<h2>A bad print</h2>
<p>There are probably thousands of reasons a print might fail, but bad layer bonding and squish-ability under torsion strongly hint to under extrusion. Now, under extrusion itself can be caused by a plethora of reasons: a clogged nozzle is equally as possible as too thinner diameter as is just a bad temperature. The last one is, in my opinion, the most likely culprit: filaments may look the same and feel the same and bond the same, but in different colors, they sometimes demand different print settings.</p>
<p>As an example, I print most of my Kaisertech PLAs at 200°C, as that offers a quite good result for all of them. Yet when I started I had a white China PLA and a crystal clear PLA from the same manufacturer, both came from the same warehouse in the same shipment. The clear one is quite more brittle on the roll, but their starting-to-print temperature differs by 5°C - the white started to extrude at 180°C decently and printed ok at 195°C-200°C, while the clear needed only 175°C to start to be extrudeable and was really printable at 190°C. Yet recently I tried the same roll again to achieve fully clear prints, and with 210°C and lots of overextrusion, I managed to go almost solid-clear. Because of such experience, I suggest tweaking the settings.</p>
<h2>A Bad Filament</h2>
<p>There are several reasons why one roll might resulting in bad prints, but the most prominent are that the roll has <em>gone</em> bad over bad storage. It might be stored too hot or too humid, making it brittle or bubble in the hotend. Aging under UV plays a role (it degrades PLA). And dimensional accuracy plays a role because it affects the whole roll of filament. This is why tests should always be performed with equally treated and measured samples to achieve comparability.</p>
<h2>Excursus: Plastics and color</h2>
<p>What gives a plastic its color? Pigments added to it. Now, pigments can be of varied kinds. Usually, they are embedded in the plastic (=not bonded to the carrier plastic), and the plastic polymer is often either inherently transparent(ish) or white. Let's take some examples to look at...</p>
<ul>
<li><strong>Yellow</strong>. Yellow can be made from a lot of stuff but many yellow pigments react to UV light by decay more than other colors, leading to yellow to fade quickly in comparison to other colors. It has varied chemical compositions, often they can become quite complex.</li>
<li><strong>Black</strong>. Black pigment is typically the most simplistic coloration to achieve: pure powdered carbon is one of our most potent black pigments, and also one of the cheapest, making black plastic one of the most common plastics. In contrast to other colors, carbon can't fade. But the plastic around it decomposes and turns white, fading the color this way.</li>
</ul>
<p>Now, most colorings are - in physical terms - sizeable. Some few to a couple dozen atoms, making them range in the <em>Angström</em> (~Atom diameter) to <em>few nanometer</em> area overall. However, even something as complex as <span class="math-container">$C_{22}H_{20}O_{13}$</span> (Carmine) is relatively small compared to the <span class="math-container">$(C_3H_4O_2)_n$</span> of <strong>Poly</strong>LacticAcid, aka PLA. Poly tells us that n is at least 100, because shorter chains are <em>oligo</em>mers, not <em>poly</em>mers. In comparison, our red carmine pigment is more dense, much more compact in fact. As a result, a 100-chain of PLA is not just in the <em>Angstöm</em> area but in the <em>dozen nanometer</em> to <em>micrometer</em> range - a magnitude of at least 2 larger. Unless we have a huge excess of pigment or a pigment that reacts with the plastic under heat, then the impact of it on the strength should be neglectible to the other fillers often used.</p>
| 1,184
|
<p>I have been hearing a lot of good things about DVCS systems, in particular about bazaar. Apart from the concept of distributed repository, I see two main advantages being touted: the merge is better automated, and the rename is handled right.</p>
<p>Could someone please point me at some text explaining how exactly the improvements work? How does bazaar know that I renamed a file? What if I rename two files as part of the same commit? What happens when I refactor by putting half of the file's contents into a new file, re-indenting everything and losing some whitespace in nearly every line?</p>
<p>In other words, I'd like to hear from people using bazaar (or another DVCS) in real life, or from people who know how it (they) works. Is the merge really that much better? And how is it achieved?</p>
<hr>
<p>Related question, with a useful answer:</p>
<p><a href="https://stackoverflow.com/questions/43995/why-is-branching-and-merging-easier-in-mercurial-than-in-subversion">Why is branching and merging easier in Mercurial than in Subversion?</a></p>
|
<p>Merge is not intrinsically better in DVCS, it is just that they would be practically very difficult to use if the branch/merge did not work correctly (svn arguably does not implement branching/merging correctly), because instead of making a checkout, you are making a new branch everytime you start working on a project from an existing code. I think some proprietary, centralized SCS do handle merge/branch correctly.</p>
<p>The way it works for all of them is to record every commit in a Directly Acyclic Graph (DAG), and from this, you have different merge strategies available. Here you can find more information:</p>
<p><a href="http://revctrl.org/CategoryMergeAlgorithm" rel="nofollow noreferrer">http://revctrl.org/CategoryMergeAlgorithm</a></p>
<p>At least hg, bzr and git can use external merge utilities.</p>
|
<p>I'm not familiar with bazaar, but git doesn't track file renames. To git, this looks like a delete and an add. However, git is smart enough to see that the contents of the file already exist in its repository and will track their position in the system. If you split files up or merge them it's smart enough to keep track of segments of code (blobs) and store that information too.</p>
| 6,834
|
<p>This seemed like an easy thing to do. I just wanted to pop up a text window and display two columns of data -- a description on the left side and a corresponding value displayed on the right side. I haven't worked with Forms much so I just grabbed the first control that seemed appropriate, a TextBox. I thought using tabs would be an easy way to create the second column, but I discovered things just don't work that well.</p>
<p>There seems to be two problems with the way I tried to do this (see below). First, I read on numerous websites that the MeasureString function isn't very precise due to how complex fonts are, with kerning issues and all. The second is that I have no idea what the TextBox control is using as its StringFormat underneath.</p>
<p>Anyway, the result is that I invariably end up with items in the right column that are off by a tab. I suppose I could roll my own text window and do everything myself, but gee, isn't there a simple way to do this?</p>
<pre><code> TextBox textBox = new TextBox();
textBox.Font = new Font("Calibri", 11);
textBox.Dock = DockStyle.Fill;
textBox.Multiline = true;
textBox.WordWrap = false;
textBox.ScrollBars = ScrollBars.Vertical;
Form form = new Form();
form.Text = "Recipe";
form.Size = new Size(400, 600);
form.FormBorderStyle = FormBorderStyle.Sizable;
form.StartPosition = FormStartPosition.CenterScreen;
form.Controls.Add(textBox);
Graphics g = form.CreateGraphics();
float targetWidth = 230;
foreach (PropertyInfo property in properties)
{
string text = String.Format("{0}:\t", Description);
while (g.MeasureString(text,textBox.Font).Width < targetWidth)
text += "\t";
textBox.AppendText(text + value.ToString() + "\n");
}
g.Dispose();
form.ShowDialog();
</code></pre>
|
<p>If you want, you can translate this VB.Net code to C#. The theory here is that you change the size of a tab in the control.</p>
<pre><code>Private Declare Function SendMessage _
Lib "user32" Alias "SendMessageA" _
(ByVal handle As IntPtr, ByVal wMsg As Integer, _
ByVal wParam As Integer, ByRef lParam As Integer) As Integer
Private Sub SetTabStops(ByVal ctlTextBox As TextBox)
Const EM_SETTABSTOPS As Integer = &HCBS
Dim tabs() As Integer = {20, 40, 80}
SendMessage(ctlTextBox.Handle, EM_SETTABSTOPS, _
tabs.Length, tabs(0))
End Sub
</code></pre>
<p>I converted a version to C# for you, too. Tested and working in VS2005.</p>
<p>Add this using statement to your form: </p>
<pre><code>using System.Runtime.InteropServices;
</code></pre>
<p>Put this right after the class declaration:</p>
<pre><code> private const int EM_SETTABSTOPS = 0x00CB;
[DllImport("User32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr h, int msg, int wParam, int[] lParam);
</code></pre>
<p>Call this method when you want to set the tabstops:</p>
<pre><code> private void SetTabStops(TextBox ctlTextBox)
{
const int EM_SETTABSTOPS = 203;
int[] tabs = { 100, 40, 80 };
SendMessage(textBox1.Handle, EM_SETTABSTOPS, tabs.Length, tabs);
}
</code></pre>
<p>To use it, here is all I did:</p>
<pre><code> private void Form1_Load(object sender, EventArgs e)
{
SetTabStops(textBox1);
textBox1.Text = "Hi\tWorld";
}
</code></pre>
|
<p>Don't the text boxes allow HTML usage? If that is the case, just use HTML to format the text into a table. Otherwise, try adding the text to a datagrid and then adding that to the form.</p>
| 9,781
|
<p>I want to implement search functionality for a website (assume it is similar to SO). I don't want to use Google search of stuff like that.</p>
<p>My question is:</p>
<p>How do I implement this?</p>
<p>There are two methods I am aware of:</p>
<ol>
<li>Search all the databases in the application when the user gives his query.</li>
<li>Index all the data I have and store it somewhere else and query from there (like what Google does).</li>
</ol>
<p>Can anyone tell me which way to go? What are the pros and cons?</p>
<p>Better, are there any better ways to do this?</p>
|
<p>Use lucene,<br>
<a href="http://lucene.apache.org/java/docs/" rel="noreferrer">http://lucene.apache.org/java/docs/</a></p>
<blockquote>
<p>Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.</p>
</blockquote>
<p>It is available in java and .net. It is also in available in php in the form of a zend framework module.</p>
<p>Lucene does what you wanted(indexing of the searched items), you have to keep track of a lucene index but it is much better than doing a database search in terms of performance. BTW, SO search is powered by lucene. :D</p>
|
<p>If you application uses the Java EE stack and you are using <a href="http://hibernate.org" rel="nofollow noreferrer">Hibernate</a> you can use the <a href="http://www.compass-project.org" rel="nofollow noreferrer">Compass Framework</a> maintain a searchable index of your database. The Compass Framework uses <a href="http://lucene.apache.org" rel="nofollow noreferrer">Lucene</a> under the hood.</p>
<p>The only catch is that you cannot replicate your search index. So you need to use a clustered database to hold the index tables or use the newer grid based index storage mechanisms that have been added to the Compass Framework 2.x.</p>
| 5,453
|
<p>In my browsings amongst the Internet, I came across <a href="http://www.reddit.com/r/programming/comments/6y6lr/ask_proggit_which_is_more_useful_to_know_c_or_java/" rel="nofollow noreferrer">this post</a>, which includes this</p>
<blockquote>
<p>"(Well written) C++ goes to great
lengths to make stack automatic
objects work "just like" primitives,
as reflected in Stroustrup's advice to
"do as the ints do". This requires a
much greater adherence to the
principles of Object Oriented
development: your class isn't right
until it "works like" an int,
following the "Rule of Three" that
guarantees it can (just like an int)
be created, copied, and correctly
destroyed as a stack automatic."</p>
</blockquote>
<p>I've done a little C, and C++ code, but just in passing, never anything serious, but I'm just curious, what it means exactly?</p>
<p>Can someone give an example?</p>
|
<p>Stack objects are handled automatically by the compiler.</p>
<p>When the scope is left, it is deleted.</p>
<pre><code>{
obj a;
} // a is destroyed here
</code></pre>
<p>When you do the same with a 'newed' object you get a memory leak :</p>
<pre><code>{
obj* b = new obj;
}
</code></pre>
<p>b is not destroyed, so we lost the ability to reclaim the memory b owns. And maybe worse, the object cannot clean itself up.</p>
<p>In C the following is common :</p>
<pre><code>{
FILE* pF = fopen( ... );
// ... do sth with pF
fclose( pF );
}
</code></pre>
<p>In C++ we write this :</p>
<pre><code>{
std::fstream f( ... );
// do sth with f
} // here f gets auto magically destroyed and the destructor frees the file
</code></pre>
<p>When we forget to call fclose in the C sample the file is not closed and may not be used by other programs. (e.g. it cannot be deleted).</p>
<p>Another example, demonstrating the object string, which can be constructed, assigned to and which is destroyed on exiting the scope.</p>
<pre><code>{
string v( "bob" );
string k;
v = k
// v now contains "bob"
} // v + k are destroyed here, and any memory used by v + k is freed
</code></pre>
|
<p>Variables in C++ can either be declared on the stack or the heap. When you declare a variable in C++, it automatically goes onto the stack, unless you explicitly use the new operator (it goes onto the heap).</p>
<pre><code>MyObject x = MyObject(params); // onto the stack
MyObject * y = new MyObject(params); // onto the heap
</code></pre>
<p>This makes a big difference in the way the memory is managed. When a variable is declared on the stack, it will be deallocated when it goes out of scope. A variable on the heap will not be destroyed until delete is explicitly called on the object.</p>
| 4,997
|
<p>I'm working on a utility which needs to resolve hex addresses to a symbolic function name and source code line number within a binary. The utility will run on Linux on x86, though the binaries it analyzes will be for a MIPS-based embedded system. The MIPS binaries are in ELF format, using DWARF for the symbolic debugging information.</p>
<p>I'm currently planning to fork objdump, passing in a list of hex addresses and parsing the output to get function names and source line numbers. I have compiled an objdump with support for MIPS binaries, and it is working.</p>
<p>I'd prefer to have a package allowing me to look things up natively from the Python code without forking another process. I can find no mention of libdwarf, libelf, or libbfd on python.org, nor any mention of python on dwarfstd.org.</p>
<p>Is there a suitable module available somewhere?</p>
|
<p>Please check <a href="https://github.com/eliben/pyelftools" rel="nofollow">pyelftools</a> - a new pure Python library meant to do this.</p>
|
<p>I don't know of any, but if all else fails you could use <a href="http://docs.python.org/lib/module-ctypes.html" rel="nofollow noreferrer">ctypes</a> to directly use libdwarf, libelf or libbfd.</p>
| 6,798
|
<p>Is there a way to shutdown a computer using a built-in Java method?</p>
|
<p>Create your own function to execute an OS command through the <a href="http://www.computerhope.com/shutdown.htm" rel="nofollow noreferrer">command line</a>?</p>
<p>For the sake of an example. But know where and why you'd want to use this as others note.</p>
<pre><code>public static void main(String arg[]) throws IOException{
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("shutdown -s -t 0");
System.exit(0);
}
</code></pre>
|
<p>On Windows Embedded by default there is no shutdown command in cmd.
In such case you need add this command manually or use function ExitWindowsEx from win32 (user32.lib) by using JNA (if you want more Java) or JNI (if easier for you will be to set priviliges in C code).</p>
| 4,522
|
<p>I received a Monoprice Maker Select v2 (I3 V2 clone) from my wife for Christmas. The sample .gcode files that came with the printer generally print great with no noticeable defects.</p>
<p>However, when I try to print miniatures for use with table-top gaming (D&D, primarily), I tend to get a lot of oozing and stringing. On top of that, bridge supports don't cool in time and tend to get fudged by the print nozzle, which results in oddities like arms being only half printed, sticking to the nozzle, and getting relocated to some other part of the print. If I use full grid supports with the most modest fill settings (8%) they end up being stronger than the miniature and are a real pain to remove. </p>
<p>My printer is calibrated, as level as can be (the desk it's on is slightly warped but I've got the printer in the center of the warp; there is no wobble or lean) and squared. The build plate is calibrated and set to the right height. </p>
<p>I'm using the version of Cura that came on the SD card with the printer (honestly not sure which one and I'm not at home to check). I've fiddled with print speed, extruder temp (ranging from 185 to 210), layer cooling, retraction settings, and tried switching to Slic3r (didn't go over well -- couldn't even get past the first layer).</p>
<p>I'm using Hatchbox silver PLA filament (1.75mm +/- 0.05mm). I don't have another filament I can test with to compare performance. </p>
<p>Even when I import the profile settings from one of the sample .gcode files I tend to end up with blobbing, pulling, and stringing all over the miniatures, in addition to missing or deformed parts. Notably, arms and hands -- most often overhangs -- tend to stick to the hotend and get repositioned, sending the whole thing out of whack. </p>
<p>I end up with similar problems when I use the Novice mode settings in Cura (Normal Quality, High Quality, etc).</p>
<p>Is there something I'm missing that I can do to improve the quality of small, detailed prints, or is the I3, as an entry-level printer, simply not up to the task? I'm especially interested in answers from users who have experience printing miniatures and their experiences in tuning for that type of print job.</p>
<p>A few things I've tried test printing:</p>
<p><a href="http://www.thingiverse.com/thing:704409" rel="noreferrer">Printer calibration test model v1</a></p>
<p><a href="http://www.thingiverse.com/thing:1363023" rel="noreferrer">Printer calibration test model v3</a></p>
<p>Both of these came out very stringy, with lots of blobbing and layer pulling, especially towards the upper portions of the taller elements.</p>
<p>I have also tried printing these two models:</p>
<p><a href="https://www.shapeways.com/product/YDCPJF8KV/knight?optionId=59811831" rel="noreferrer">Knight with sword - high detail</a></p>
<p><a href="https://www.shapeways.com/product/4Y699HM6N/elf-monk?optionId=61531553&li=marketplace" rel="noreferrer">Elf monk - high detail</a></p>
<p>All test prints of these two models had at least one missing hand due to it getting stuck to the hotend and pulling off the part, and both demonstrated lots of minor blobbing and pulling on otherwise smooth surfaces, with loss of detail in the more finely detailed areas. Here's a sample of the output for the knight model. Please ignore the fact that he has been dismembered, that was mostly my fiddling with it post-printing (I guess I don't know my own strength), though the left hand was not well-attached and fell off rather easily. He was printed with both hands and feet/base intact, but you can see the blobbing and pulling pretty well.</p>
<p><a href="https://i.stack.imgur.com/T4pth.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/T4pth.jpg" alt="enter image description here"></a></p>
|
<p>I've not done much miniatures printing, but I have the same printer and I happen to have the exact same filament loaded. Also, I've been doing a lot of tuning lately, including <a href="https://www.thingiverse.com/thing:921948" rel="nofollow noreferrer">this z-brace mod</a> which has improved my overall print quality, so I thought I'd take a pass at printing the Knight from your photos and sharing my findings.</p>
<p>First, <a href="https://imgur.com/a/YQV23" rel="nofollow noreferrer">I've posted a series of pictures</a> to show my findings. Overall, I'd say my print quality was better than what you showed in your photos, but still isn't good enough. I sliced with Cura 15.04.6, and printed from SD card. Here are my (Full) settings:</p>
<pre><code>Layer height (mm) : 0.1
Shell thickness (mm) : 0.5
Enable retraction : Yes
Bottom/Top thickness (mm) : 0.3
Fill Density (%) : 20
Print Speed (mm/s) : 20
Printing Temperature (C) : 210
Bed Temperature (C) : 67
Support Type : Everywhere
Platform Adhesion : None
Skirts : 3
Filament Diameter (mm) : 1.75
Filament Flow (%) : 100.0
Nozzle size (mm) : 0.5
Retract Speed (mm/s) : 40.0
Retract Distance (mm) : 7
Initial Layer Thick (mm) : 0.2
Initial Later width (%) : 100
Cut off object bottom (mm): 0.0
Travel Speed (mm/s) : 100
Bottom Layer Speed (mm/s) : 20
Infill speed (mm/s) : 50
Top/bottom speed (mm/s) : 20
Outer Shell speed (mm/s) : 20
Inner Shell speed (mm/s) : 20
Min. Layer Time (sec) : 10
Enable cooling fan : Yes
</code></pre>
<p>I do most of my printing with a later height of 0.2mm, but for a detailed mini, 0.1mm is probably the largest that will look good (and probably the smallest possible on this printer. I normally set most of my speeds to 50 mm/s, with first layer at 20 mm/s; for this I slowed it all to 20 mm/s due to the fine details, and I think it helped.</p>
<p>Temps of 67˚C bed and 210˚C extruder are what I've found to work best on my machine for PLA, after much experimentation, but your machine may vary; I'm not sure how accurate the temperature measurements are on these machines. 67˚C gives me an observed bed temp of 60˚C, but that's at the top surface - I have PEI atop Borosilicate glass, adhered to the bare aluminum bed with silicone-based heat transfer pad.</p>
<p>I think I miscalculated the top/bottom heights and infill. I'm not used to printing at 0.1mm layer height, but 3 top layers over 20% infill is clearly not enough - see the closeup of the mini's base in my linked gallery. Next print, I'll either try 0.6mm top/bottom, or much higher infill.</p>
<p>The supports came off easily; I used <a href="https://rads.stackoverflow.com/amzn/click/com/B00FZPDG1K" rel="nofollow noreferrer" rel="nofollow noreferrer">a pair of sidecutters from my electronics bench</a>. A little more cleanup with a sharp hobby knife, combined with a better base top layer would probably produce an acceptable result.</p>
<p>There were two major flaws. The first are the little blobs on many layers; see for example the inseam area on the picture of the knight's back. <a href="https://softsolder.com/2012/01/26/reversal-zits-speed-acceleration-and-a-bestiary/" rel="nofollow noreferrer">Ed Nisley at Softsolder.com calls these "Reveral Zits"</a>, and I think the name is apt. These happen when the print head needs to quickly reverse direction or stop-move-print, but filament continues to extrude. I use fairly aggressive retraction settings, and I think my print shows smaller zits than yours, but still far too many. Ed has explored this topic in some depth; it's possible my extruder stepper isn't keeping up with my settings due to mechanical limits. This is an area I want to pursue, but I don't have time at the moment. I plan to read Ed's work and try some experiments on my machine to see if I can get better results; I will update this answer if/when I do. As it stands, most of them are quite small, and could probably be cleaned up with a knife; the worst are those around unsupported areas, such as the back of the shoulder guard.</p>
<p>The second major flaw is the helmet. It's just... bad. I'm not sure the printer has much hope of nailing those horns, but overall the head is just bad. I'm not sure what can be done there.</p>
<p>To summarize: @disc0ninja's advice on Bed Level and Print speed are certainly the right place to start; You might want to try my Cura settings to see if you get similar results. Also, the Z-brace mod I linked to above has made a big difference for me; I rarely have to adjust my leveling anymore. I also plan to try slicing with Slic3r, which I haven't used previously, but have been looking into. You mentioned you couldn't print with Slic3r, was that USB or SD Card? I'd suggest trying via SD if it failed during USB printing.</p>
<p><strong>Update 30 Jan 2017:</strong> It took a little doing, but I managed to slice and print this model via slic3r. <a href="https://3dprinting.stackexchange.com/questions/3482/slicer-reports-1000s-of-errors-not-seen-in-cura-render-is-missing-big-chunks">I had some issues with the original STL in slic3er</a>, which I ended up fixing with a free trial at makeprintable.com. I spent a lot of time fiddling with slic3r; it has a lot more knobs to turn than Cura, and I make no claims of having the best settings for this print. There are so many settings that rather than transcribe them here, I've captured them in my <a href="https://imgur.com/gallery/Nw0Gv" rel="nofollow noreferrer">pictures of the slic3er print</a>.</p>
<p><a href="https://i.stack.imgur.com/SdOHm.png" rel="nofollow noreferrer" title="Layers and perimeters"><img src="https://i.stack.imgur.com/SdOHm.png" alt="Layers and perimeters" title="Layers and perimeters" /></a></p>
<p><a href="https://i.stack.imgur.com/sIM3D.png" rel="nofollow noreferrer" title="Infill"><img src="https://i.stack.imgur.com/sIM3D.png" alt="Infill" title="Infill" /></a></p>
<p><a href="https://i.stack.imgur.com/pvXlJ.png" rel="nofollow noreferrer" title="Skirt and Brim"><img src="https://i.stack.imgur.com/pvXlJ.png" alt="Skirt and Brim" title="Skirt and Brim" /></a></p>
<p><a href="https://i.stack.imgur.com/cHSzp.png" rel="nofollow noreferrer" title="Support material"><img src="https://i.stack.imgur.com/cHSzp.png" alt="Support material" title="Support material" /></a></p>
<p><a href="https://i.stack.imgur.com/vT0pN.png" rel="nofollow noreferrer" title="Speed"><img src="https://i.stack.imgur.com/vT0pN.png" alt="Speed" title="Speed" /></a></p>
<p><a href="https://i.stack.imgur.com/7QK3c.png" rel="nofollow noreferrer" title="Multiple extruders"><img src="https://i.stack.imgur.com/7QK3c.png" alt="Multiple extruders" title="Multiple extruders" /></a></p>
<p><a href="https://i.stack.imgur.com/0AITv.png" rel="nofollow noreferrer" title="Advanced"><img src="https://i.stack.imgur.com/0AITv.png" alt="Advanced" title="Advanced" /></a></p>
<p><a href="https://i.stack.imgur.com/13mnS.png" rel="nofollow noreferrer" title="Cooling"><img src="https://i.stack.imgur.com/13mnS.png" alt="Cooling" title="Cooling" /></a></p>
<p><a href="https://i.stack.imgur.com/60F2W.png" rel="nofollow noreferrer" title="Filament"><img src="https://i.stack.imgur.com/60F2W.png" alt="Filament" title="Filament" /></a></p>
<p>Overall, I feel like the quality is higher. The "reversal zits" are hardly noticeable; but the big remaining problem is one I didn't fully diagnose in the original Cura print - lack of support for areas such as the shoulders. Slic3r added more support than Cura, but it's also harder to separate from the base. The head isn't great, but much better than the Cura print; I don't think my photos show it as well as it looks. <strong>This print has convinced me that there's plenty of quality still to be wrung from this printer</strong>; I hope to make time to do some more slic3r prints of this model while tweaking the params to see what's possible. If I make any big leaps in quality I will update this answer.</p>
|
<p>I have an Alunar(Anet) Prusa i3 printer I bought from amazon 7 months ago. I have not done much for ultra high detail prints, but it does seem to print everything I've thrown at it quite well. It took sometime for me to get it dialed in. I've found that <strong>Bed Level, Z-axis height,</strong> and <strong>Print Speed</strong> are usually what makes the most difference.</p>
<p>I have only used Inland PLA (Microcenter brand) and can get good quality prints. </p>
<p>I would recommend double checking bed level, z-axis, and going through print quality trouble shooting. Re-measure your PLA thickness and make sure your print multiplier is adjusted appropriately, and try to slow down your print speed.</p>
<p>If you could post a link to a sample file that you're trying to print It may be helpful?</p>
<p>Simplify 3D has a wonderful trouble shooting guide you can check out <a href="https://www.simplify3d.com/support/print-quality-troubleshooting/" rel="nofollow noreferrer">here</a></p>
| 499
|
<p>I'm just getting into creating some WCF services, but I have a requirement to make them backward compatible for legacy (.NET 1.1 and 2.0) client applications. </p>
<p>I've managed to get the services to run correctly for 3.0 and greater clients, but when I publish the services using a basicHttpBinding endpoint (which I believe is required for the compatibility I need), the service refactors my method signatures. e.g.</p>
<pre><code>public bool MethodToReturnTrue(string seedValue);
</code></pre>
<p>appears to the client apps as</p>
<pre><code>public void MethodToReturnTrue(string seedValue, out bool result, out bool MethodToReturnTrueResultSpecified);
</code></pre>
<p>I've tried every configuration parameter I can think of in the app.config for my self-hosting console app, but I can't seem to make this function as expected. I suppose this might lead to the fact that my expectations are flawed, but I'd be surprised that a WCF service is incapable of handling a bool return type to a down-level client.</p>
<p>My current app.config looks like this.</p>
<pre><code><?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service behaviorConfiguration="MyServiceTypeBehaviors" Name="MyCompany.Services.CentreService.CentreService">
<clear />
<endpoint address="http://localhost:8080/CSMEX" binding="basicHttpBinding" bindingConfiguration="" contract="IMetadataExchange" />
<endpoint address="http://localhost:8080/CentreService" binding="basicHttpBinding" bindingName="Compatible" name="basicEndpoint" contract="MyCompany.Services.CentreService.ICentreService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
</code></pre>
<p>Can anyone advise, please?</p>
|
<p>OK, we needed to resolve this issue in the short term, and so we came up with the idea of a "interop", or compatibility layer.</p>
<p>Baiscally, all we did was added a traditional ASMX web service to the project, and called the WCF service from that using native WCF calls. We were then able to return the appropriate types back to the client applications without a significant amount of re-factoring work. I know it was a hacky solution, but it was the best option we had with such a large legacy code-base. And the added bonus is that it actually works surprisingly well. :)</p>
|
<p>You do have to use the XmlSerializer. For example:</p>
<pre><code>[ServiceContract(Namespace="CentreServiceNamespace")]
[XmlSerializerFormat(Style=OperationFormatStyle.Document, SupportFaults=true, Use=OperationFormatUse.Literal)]
public interface ICentreService {
[OperationContract(Action="CentreServiceNamespace/MethodToReturnTrue")]
bool MethodToReturnTrue(string seedValue);
}
</code></pre>
<p>You have to manually set the operation action name because the auto-generated WCF name is constructed differently from the ASMX action name (WCF includes the interface name as well, ASMX does not).</p>
<p>Any data contracts you use should be decorated with <code>[XmlType]</code> rather than <code>[DataContract]</code>.</p>
<p>Your config file should not need to change.</p>
| 2,770
|
<h2><strong>NEW UPDATE BELOW</strong></h2>
<hr />
<p>I am having trouble finding the cause for this under-extrusion at start/end of each layer.
Something changes halfway into the print creating a visible seam at some specific layer height.</p>
<p>This also creates dimensional inaccuracy making my parts unusable.<br />
The first layers are just fine - roundness deviation around 0.03 mm!</p>
<p><strong>Any ideas on which settings I should look into?</strong></p>
<p><strong>Settings</strong><br />
Printer: Dremel 3D45 (newest firmware)<br />
Slicer: Dremel DigiLab (also tried Cura Ultimaker 5.0)<br />
Filament: <a href="https://www.dasfilament.de/filament-refill/petg-1-75-mm/305/petg-filament-1-75-mm-feuerrot-refill-800-g?c=57" rel="nofollow noreferrer">PET-G</a></p>
<p>Printing Temperature: 250 °C<br />
Initial Temperature: 240 °C<br />
Final Temperature: 235 °C<br />
Flow: 105 %<br />
Retraction Distance: 1 mm (tried 3 - 1 mm)<br />
Retraction Speed: 40 mm/s (tried 60 - 20 mm/s)<br />
Prime Amount: 0.6 mm³ (tried 0 - 0.6)
Retraction Minimum Travel: 0
Retract at Layer Change: Off<br />
Maximum Retraction Count: 90 (could this be a problem?)<br />
Minimun Extrusion Distance Window: 1 mm<br />
Print Speed: 35 mm/s<br />
Wall Sprint Speed: 30 mm/s<br />
Combing Mode: All<br />
Fan Speed: 50 %<br />
Seam: Shortest</p>
<p><a href="https://i.stack.imgur.com/2oBBX.jpg" rel="nofollow noreferrer" title="Photo of the top of a 3D printed model showing printing errors"><img src="https://i.stack.imgur.com/2oBBX.jpg" alt="Photo of the top of a 3D printed model showing printing errors" title="Photo of the top of a 3D printed model showing printing errors" /></a>
<a href="https://i.stack.imgur.com/lueum.jpg" rel="nofollow noreferrer" title="Photo of the side of a 3D printed model showing printing errors"><img src="https://i.stack.imgur.com/lueum.jpg" alt="Photo of the side of a 3D printed model showing printing errors" title="Photo of the side of a 3D printed model showing printing errors" /></a></p>
<hr />
<h2><strong>Update 18/05</strong></h2>
<p>Fixed the seam by setting the alignment to random and changing retraction settings.<br />
Remaining problem is the inaccuracy right next to the Y axis (see marked area on the pictures). Besides a hardware issue I cant think about any slicer setting which would adress this deviation.</p>
<p>Diameter X: 30.02 mm<br />
Diameter Y: 30.04 mm<br />
Diameter Marked: 29.90 mm</p>
<p><a href="https://i.stack.imgur.com/ZKcvO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZKcvO.jpg" alt="0.13 deviation in this area" /></a>
<a href="https://i.stack.imgur.com/VxHCQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VxHCQ.jpg" alt="Fixed seam" /></a></p>
|
<h1>That's not under extrusion</h1>
<p>That is the seam, and technically it is over extruding around it. You will find that if you turn the item, you have such a spot on every layer, actually with an inner and outer perimeter, you'll have two visible seams. The seam is where the extrusion line meets itself, and thus the extrusion has to stop.</p>
|
<h1>That's not under extrusion</h1>
<p>That is the seam, and technically it is over extruding around it. You will find that if you turn the item, you have such a spot on every layer, actually with an inner and outer perimeter, you'll have two visible seams. The seam is where the extrusion line meets itself, and thus the extrusion has to stop.</p>
| 2,147
|
<p>I'm sending mail from my C# Application, using the SmtpClient. Works great, but I have to decide if I want to send the mail as Plain Text or HTML. I wonder, is there a way to send both? I think that's called multipart.</p>
<p>I googled a bit, but most examples essentially did not use SmtpClient but composed the whole SMTP-Body themselves, which is a bit "scary", so I wonder if something is built in the .net Framework 3.0?</p>
<p>If not, is there any really well used/robust Third Party Library for sending e-Mails?</p>
|
<p>What you want to do is use the AlternateViews property on the MailMessage</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.alternateviews.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.alternateviews.aspx</a></p>
|
<p>For anyone who bumped into this issue you might want to check if you have preheader tags in your html.</p>
<p>In my html I've added a tag with a phrase of "Activate your client admin account by clicking the link.".</p>
<p>It seems like gmail is flagging the phrase "clicking the link" after removing it, all my emails that has been sent, are going straight to the inbox.</p>
| 6,652
|
<p>Hello I have the following error by git-fsck, which cannot be cleaned by git-gc even in --aggressive mode. What can I do next to fix this repository error? </p>
<pre><code>$ git-fsck
bad sha1 file: .git/objects/55/tmp_obj_a07724
</code></pre>
|
<p>It's not a simple answer, sadly. But this might help:</p>
<p><a href="http://schacon.github.com/git/user-manual.html#recovering-from-repository-corruption" rel="noreferrer">Recovering from repository corruption</a> (from the Git's user manual).</p>
|
<p>From <code>man git-fsck</code>:</p>
<pre><code>Any corrupt objects you will have to find in backups or other archives
(i.e., you can just remove them and do an rsync with some other site in
the hopes that somebody else has the object you have corrupted).
</code></pre>
| 6,055
|
<p>Is there anything similar to rails' scaffolding for pylons? I've been poking around google, but only found this thing called dbsprockets, which is fine, although probably way too much for my needs. What I really need is a basic CRUD that is based on the SQLAlchemy model.</p>
|
<p>The question is super old, but hell: <a href="http://code.google.com/p/formalchemy/" rel="noreferrer">http://code.google.com/p/formalchemy/</a></p>
<p>Gives you basic crud out of the box, customizable to do even relatively complex things easily, and gives you a drop-in Pylons admin app too (written and customizable with the same api, no magic).</p>
|
<p>Just updating an old question. DBSprockets has been replaced by <a href="http://sprox.org/" rel="nofollow noreferrer">sprox</a> which learns a lot of lessons from it and is pretty cool.</p>
<p>It isn't quite the throwaway 'scaffolding' that Rails provides, it is more like an agile form generation tool that is highly extensible.</p>
| 5,529
|
<p>After cleaning a folder full of HTML files with TIDY, how can the tables content be extracted for further processing?</p>
|
<p>I've used BeautifulSoup for such things in the past with great success.</p>
|
<p>In .NET you could use <a href="http://www.codeplex.com/htmlagilitypack" rel="nofollow noreferrer">HTMLAgilityPack</a>.</p>
<p>See this <a href="https://stackoverflow.com/questions/2861/options-for-html-scraping">previous question</a> on StackOverflow for more information.</p>
| 9,426
|
<p>My professor did an informal benchmark on a little program and the Java times were: 1.7 seconds for the first run, and 0.8 seconds for the runs thereafter. </p>
<ul>
<li><p>Is this due entirely to the loading of the runtime environment into the operating environment ?</p>
<p>OR </p></li>
<li><p>Is it influenced by Java's optimizing the code and storing the results of those optimizations (sorry, I don't know the technical term for that)?</p></li>
</ul>
|
<p>Okay, I found where I read that. This is all from "Learning Java" (O'Reilly 2005):</p>
<blockquote>
<p>The problem with a traditional JIT compilation is that optimizing code takes time. So a JIT compiler can produce decent results but may suffer a significant latency when the application starts up. This is generally not a problem for long-running server-side applications but is a serious problem for client-side software and applications run on smaller devices with limited capabilities. To address this, Sun's compiler technology, called HotSpot, uses a trick called adaptive compilation. If you look at what programs actually spend their time doing, it turns out that they spend almost all their time executing a relatively small part of the code again and again. The chunk of code that is executed repeatedly may be only a small fraction of the total program, but its behavior determines the program's overall performance. Adaptive compilation also allows the Java runtime to take advantage of new kinds of optimizations that simply can't be done in a statically compiled language, hence the claim that Java code can run faster than C/C++ in some cases.</p>
<p>To take advantage of this fact, HotSpot starts out as a normal Java bytecode interpreter, but with a difference: it measures (profiles) the code as it is executing to see what parts are being executed repeatedly. Once it knows which parts of the code are crucial to performance, HotSpot compiles those sections into optimal native machine code. Since it compiles only a small portion of the program into machine code, it can afford to take the time necessary to optimize those portions. The rest of the program may not need to be compiled at all—just interpreted—saving memory and time. In fact, Sun's default Java VM can run in one of two modes: client and server, which tell it whether to emphasize quick startup time and memory conservation or flat out performance.</p>
<p>A natural question to ask at this point is, Why throw away all this good profiling information each time an application shuts down? Well, Sun has partially broached this topic with the release of Java 5.0 through the use of shared, read-only classes that are stored persistently in an optimized form. This significantly reduces both the startup time and overhead of running many Java applications on a given machine. The technology for doing this is complex, but the idea is simple: optimize the parts of the program that need to go fast, and don't worry about the rest.</p>
</blockquote>
<p>I'm kind of wondering how far Sun has gotten with it since Java 5.0.</p>
|
<p>Java JVM (actually might change from different implementations of the JVM) when first started out will interpret the byte code. Once it detects that the code will be running enough number of times JITs it to native machine language so it runs faster. </p>
| 9,361
|
<p>How can I connect to a remote SQL server using Mac OS X? I don't really need a GUI, but it would be nice to have for the color coding and resultset grid. I'd rather not have to use a VM.</p>
<p>Is there a SQL client for Mac OS X that works with MS SQL Server?</p>
|
<p>Let's work together on a canonical answer.</p>
<h3>Native Apps</h3>
<ul>
<li><a href="http://www.macsqlclient.com/" rel="noreferrer">SQLPro for MSSQL</a></li>
<li><a href="http://www.navicat.com/products/navicat-for-sqlserver" rel="noreferrer">Navicat</a></li>
<li><a href="http://www.valentina-db.com/en/valentina-studio-overview" rel="noreferrer">Valentina Studio</a></li>
<li><a href="https://tableplus.io" rel="noreferrer">TablePlus</a></li>
</ul>
<h3>Java-Based</h3>
<ul>
<li><a href="http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html" rel="noreferrer">Oracle SQL Developer</a> (free)</li>
<li><a href="http://squirrel-sql.sourceforge.net/" rel="noreferrer">SQuirrel SQL</a> (free, open source)</li>
<li><a href="http://razorsql.com/" rel="noreferrer">Razor SQL</a></li>
<li><a href="http://www.dbvis.com/" rel="noreferrer">DB Visualizer</a></li>
<li><a href="http://dbeaver.jkiss.org/" rel="noreferrer">DBeaver</a> (free, open source)</li>
<li><a href="http://www.sql-workbench.net" rel="noreferrer">SQL Workbench/J</a> (free, open source)</li>
<li><a href="https://www.jetbrains.com/datagrip/" rel="noreferrer">JetBrains DataGrip</a></li>
<li><a href="http://www.metabase.com/" rel="noreferrer">Metabase</a> (free, open source)</li>
<li><a href="https://netbeans.org" rel="noreferrer">Netbeans</a> (free, open source, full development environment)</li>
</ul>
<h3>Electron-Based</h3>
<ul>
<li><a href="https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-develop-use-vscode" rel="noreferrer">Visual Studio Code with mssql extension</a></li>
<li><a href="https://learn.microsoft.com/en-us/sql/azure-data-studio/what-is" rel="noreferrer">Azure Data Studio</a></li>
<li><a href="https://sqlectron.github.io" rel="noreferrer">SQLectron</a></li>
</ul>
<p>(TODO: Add others mentioned below)</p>
|
<p>Since there currently isn't a MS SQL client for Mac OS X, I would, as <a href="https://stackoverflow.com/questions/3452/sql-server-client-for-osx#3455">Modesty</a> has suggested, use <a href="http://www.microsoft.com/mac/products/remote-desktop/default.mspx" rel="nofollow noreferrer">Remote Desktop</a> for the Mac.</p>
| 2,558
|
<p>I've got several examples like the image below where the perimeter either doesn't bond to, or doesn't reach the infill. I tried adjusting the <code>infill overlap</code> parameter in Slic3r from its default of 25 % to 30 %, but it doesn't seem to have made a difference. This is on a new Tevo Tornado that's all stock + a Petsfang Bullseye cooler.</p>
<p><a href="https://i.stack.imgur.com/G97AW.jpg" rel="nofollow noreferrer" title="Visible separation on perimeter of the inner box"><img src="https://i.stack.imgur.com/G97AW.jpg" alt="Visible separation on perimeter of the inner box" title="Visible separation on perimeter of the inner box" /></a></p>
<hr />
<p>Neither speed variations, nor temp variation seems to impact this issue. I'm beginning to suspect that it's related to some sort of play in the Y-axis, as if you look at the defect in the picture, it's the most pronounced running north/south in the picture, which would be layers along the X-axis (meaning their relative position would be impacted by Y-axis movement instability). I'm replacing the leveling springs with PETG standoffs tonight (I have a BLTouch) and will try again then.</p>
<p>I tried 25, 30, and 50 % infill overlap as per a comment request, and that (50 %) seems to have improved another issue where the infill on a first layer would often not reach the perimeter shells.</p>
<p>I tried the following print speeds with all of the following temperatures (nozzle/bed): 190/60 °C, 193/65 °C, 193/70 °C, with 3 perimeters.</p>
<p><a href="https://i.stack.imgur.com/DL4bK.png" rel="nofollow noreferrer" title="Default parameters"><img src="https://i.stack.imgur.com/DL4bK.png" alt="Default parameters" title="Default parameters" /></a></p>
<p>That's default behavior. I've also gone to</p>
<ul>
<li>Perimeters - 80 mm/s</li>
<li>Small perimeters - 20 mm/s</li>
<li>Infill - 90 mm/s</li>
<li>Solid infil - 25 mm/s</li>
<li>Top solid infil - 20 mm/s</li>
<li>Bridges - 70 mm/s</li>
<li>Gap fill - 25 mm/s</li>
</ul>
<p>With no visible change in this outer perimeter behavior (the faster set of numbers is what I print with in general).</p>
|
<p>This has nothing to do with the infill overlap, the image you've added looks as if the issue is related to non-bonding perimeters (it looks as if it is in between the 2<sup>nd</sup> and the 3<sup>rd</sup> perimeter), hence infill overlap doesn't apply here. If that is the case look into <a href="/q/6067">this question</a>.</p>
<p>I've had this same issue, the problem is that if the perimeters do not touch, this is most probably caused by insufficient filament flow which can be a result of a too high of a print speed (or too low print temperature) of the inner perimeters. This is frequently seen when printing PETG. PETG has a limited print speed, the PETG I use (premium brand) has a maximum speed value of 50 mm/s, your values are for some values over that value. That would be fine for PLA, but high for PETG, the question is not clear on the material used for this print (the hotend temperatures hint to PLA, the bed temperatures are rather high though).</p>
<p>If it is not related to the material being printed, these gaps are also explained if the positioning of the nozzle is not correct, e.g. caused by loose belts. This is supported by the comment on the first layer:</p>
<blockquote>
<p>where the infill on a first layer would often not reach the perimeter shells</p>
</blockquote>
|
<p>I had absolutely the same issue. And after some research I finally found that this is because of wrong pressure advance setting (In case of Marlin - linear advance) in the firmware.
Without pressure advance (linear advance) will be more plastic at the end of the travel rather than at the start. As result the fast full infill will have uneven distribution of the plastic with more plastic close to the perimeters that usually produce rounded corners. The pressure advance makes it better and redistribute plastic flow more even with the speed however if you make this setting too big for your 3d printer and filament then this will result in what you can see on the picture with less plastic at the end of the travel. Basically too big pressure advance parameter will result in less plastic near the perimeters and especially near corners where change in speed happening.</p>
| 1,276
|
<p>I had my 3D printer powered by dual 24 V PSUs wired in parallel and my heatbed was wired into the main using a SSR to help power it. I replaced the two PSUs with a single Corsair 750 W ATX. My printer runs smoother and there's much less wiring clutter to deal with but now no matter what the heatbed will not heat up.</p>
<p>The main connection of the ATX I purchased is an 8 pin connection so I tried using all 4 wires to power my printer and it didn't make a difference, I tried using the SSR again using 2 connections from the ATX leaving the other 2 to run the motherboard but that didn't work either. I even tried MOSFET and that also failed. I don't see why the Heatbed no longer heats up yet the thermistor is more accurate and working properly since my switch to the ATX, do I need to go up to a 1000 W ATX instead? I can't imagine what more I could do.</p>
<p><img src="https://i.stack.imgur.com/hJMYN.jpg" alt="Schematic of PSU, bed, control board and SSR" /></p>
|
<p>You indicated that you were using 24 volts, implying you have a 24 volt bed. ATX power supplies do not have 24 volt outputs. The highest is 12 volts which would heat up the bed, but not fast or probably to full temperature.</p>
|
<p>voltage = current x resistance</p>
<p>An ATX PSU is designed to only allow approximately 16 amps per pair of YELLOW and BLACK wires. The yellow is 12 V and the black is GND. If your bed were rated at 24 V then its resistance would be higher than that of the 12 V bed. The best solution for you would be to get a 12 V heated bed, as opposed to using a boost converter. Reason being is that you would need to get a boost converter that can tolerate over 200 W of power! It's just cheaper to replace the bed.</p>
<p>Finally, you need to consider the heat bed, the extruders and the steper motor's power needs before you purchase a PSU. If you had a multimeter with a current measurement, then you could accurately determine how much power each one uses and then purchase to size.
Based on your bed size (600 mm) I think that 500 W should be enough.</p>
| 1,747
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/16991/what-ruby-ide-do-you-prefer">What Ruby IDE do you prefer?</a> </p>
</blockquote>
<p>I've generally been doing stuff on Microsoft .NET out of college almost 2 years ago. I just started looking at Ruby on Rails. So what editor should I use? I'm using <a href="http://en.wikipedia.org/wiki/Notepad%2B%2B" rel="nofollow noreferrer">Notepad++</a> right now but can I get debugging etc. somehow?</p>
|
<p>Try both NetBeans and RadRails for maybe a week each, then you can find which works best for you. The best advice is to learn your tool. If you are not checking out something new about your editor, something that could potentially save you time (regexp, etc) then you are doing yourself a huge disservice.</p>
<p>I have been using Eclipse/Aptana/RadRails and unlike Gaius have been pretty happy with it.
I recommend the Eclipse IDE for Java Developers from Eclipse Downloads: <a href="http://www.eclipse.org/downloads/" rel="noreferrer">http://www.eclipse.org/downloads/</a></p>
<p>Then grab Aptana Studio, following these <a href="http://www.aptana.com/docs/index.php/Plugging_Aptana_into_an_existing_Eclipse_configuration#Eclipse_3.4_Instructions" rel="noreferrer">instructions</a>.</p>
<p>When Eclipse restarts Aptana will have a view, click on rad rails and you are good to go. Just make sure you have ruby installed already, or it becomes a pain to resolve.</p>
|
<p>I mainly code ColdFusion or PHP (and JS/CSS/xHTML), but have dabbled in a bit of RoR. RadRails/Apatana has been great for me, because it's built on Eclipse, which I was already using for my other work. It also integrates with Subversion via the Subclipse plugin. </p>
<p>The Eclipse platform is so extensible that it's worth investing a bit of time in to learn, but then again I like having a single IDE rather than having to switch between different apps.</p>
<p>I briefly looked at Netbeans, but TBH Eclipse just felt better for me, and Aptana itself is great when you come to do anything in JavaScript.</p>
<p>YMMV...</p>
| 3,677
|
<p>I have a Monoprice Maker Select v2. It is the kind where the moving plate (heat bed) provides the Y-axis and the moving extruder provides the X-axis. It has a fairly rigid sheet metal frame. In addition, I added steel rods has Z-braces.</p>
<p>I see some pretty obvious ghosting. This happens for an inch or so right after every sharp turn. Clearly, vibration is to be blamed. I found two simple techniques that improves the situation:</p>
<ol>
<li>soft floor mats under the feet (allowing the machine to move freely)</li>
<li>bolt the machine to the desk (preventing the machine from moving)</li>
</ol>
<p>Surprisingly, these two opposites provided exact same level of improvement for ghosting. My question is: <em>which approach is better</em>? Moreover, to further improvement, should I use...</p>
<ul>
<li>(extreme version of 1) hanging the printer from the ceiling using bungee cords (maximize the freedom to move); or...</li>
<li>(extreme version of 2) bolt the printer to garage floor (0 freedom to move) ?</li>
</ul>
|
<p>Ghosting is caused by differential movement between the bed and the head when the head undergoes acceleration. The forces add energy to a resonance in that differential vibration mode.</p>
<p>By changing how you mount the base, you will change the mode and probably change the frequency. </p>
<p>With the soft mounting, the bed can move more easily. It will tend to follow the head acceleration better. The whole system will still ring (you can't get rid of the momentum change), but you can cause the energy to go somewhere else and not excite that mode.</p>
<p>With the base bolted down tight, the base gets stiffer, increasing resonant frequencies. You also may be making the base more resistant against racking or twisting motions. </p>
<p>It is completely credible that both interventions reduce the problem. Of the two, I would prefer any intervention that increases the stiffness.</p>
<p>If you know your movement speed (perhaps from your configuration file) and can measure the linear frequency of the ringing, you can determine the resonant frequency that is being excited. Depending on the frequency, you may be able to excite that frequency with an audio generator and transducer (maybe even just a speaker), such as with one of these: <a href="https://www.parts-express.com/dayton-audio-tt25-8-puck-tactile-transducer-mini-bass-shaker-8-ohm--300-386" rel="noreferrer">Dayton Audio Transducers</a>.</p>
<p>With the system shaking at the right frequency, you can use your finger to find portions of the frame which are vibrating strongly, or maybe even your phone camera to make a high-speed video of the movement.</p>
|
<p>I'm missing something here. How about damping the movement of table and head by placing a tuned mass damper on table and head? Something like a mass that is mounted in the top of a skyscraper...</p>
| 933
|
<p>I have a gridview that is within an updatepanel for a modal popup I have on a page.<br>
The issue is that the entire page refreshes every time I click an imagebutton that is within my gridview. This causes my entire page to load and since I have grayed out the rest of the page so that the user cannot click on it this is very annoying.</p>
<p>Does any one know what I am missing. </p>
<p><strong>Edit:</strong> I entered a better solution at the bottom</p>
|
<p>do you have ChildrenAsTriggers="false" on the UpdatePanel?</p>
<p>Are there any javascript errors on the page?</p>
|
<p>Is the Modal Window popped up using the IE Modal window? Or is it a DIV that you are showing?</p>
<p>If it is an IE Modal Pop up you need to ensure you have </p>
<pre><code> <base target="_self" />
</code></pre>
<p>To make sure the post back are to the modal page.</p>
<p>If it is a DIV make sure you have your XHTML correct or it might not know what to update.</p>
| 5,516
|
<p>I'm looking for a pattern for performing a dynamic search on multiple tables.</p>
<p>I have no control over the legacy (and poorly designed) database table structure.</p>
<p>Consider a scenario similar to a resume search where a user may want to perform a search against any of the data in the resume and get back a list of resumes that match their search criteria. Any field can be searched at anytime and in combination with one or more other fields.</p>
<p>The actual sql query gets created dynamically depending on which fields are searched. Most solutions I've found involve complicated if blocks, but I can't help but think there must be a more elegant solution since this must be a solved problem by now.</p>
<hr>
<p>Yeah, so I've started down the path of dynamically building the sql in code. Seems godawful. If I really try to support the requested ability to query any combination of any field in any table this is going to be one MASSIVE set of if statements. <em>shiver</em></p>
<hr>
<p>I believe I read that COALESCE only works if your data does not contain NULLs. Is that correct? If so, no go, since I have NULL values all over the place.</p>
|
<p>As far as I understand (and I'm also someone who has written against a horrible legacy database), there is no such thing as dynamic WHERE clauses. It has NOT been solved. </p>
<p>Personally, I prefer to generate my dynamic searches in code. Makes testing convenient. Note, when you create your sql queries in code, don't concatenate in user input. Use your @variables!</p>
<p>The only alternative is to use the COALESCE operator. Let's say you have the following table:</p>
<pre><code>Users
-----------
Name nvarchar(20)
Nickname nvarchar(10)
</code></pre>
<p>and you want to search optionally for name or nickname. The following query will do this:</p>
<pre><code>SELECT Name, Nickname
FROM Users
WHERE
Name = COALESCE(@name, Name) AND
Nickname = COALESCE(@nick, Nickname)
</code></pre>
<p>If you don't want to search for something, just pass in a null. For example, passing in "brian" for @name and null for @nick results in the following query being evaluated:</p>
<pre><code>SELECT Name, Nickname
FROM Users
WHERE
Name = 'brian' AND
Nickname = Nickname
</code></pre>
<p>The coalesce operator turns the null into an identity evaluation, which is always true and doesn't affect the where clause.</p>
|
<p>Search and normalization can be at odds with each other. So probably first thing would be to get some kind of "view" that shows all the fields that can be searched as a single row with a single key getting you the resume. then you can throw something like <a href="http://lucene.apache.org/java/docs/" rel="nofollow noreferrer">Lucene</a> in front of that to give you a full text index of those rows, the way that works is, you ask it for "x" in this view and it returns to you the key. Its a great solution and come recommended by joel himself on the podcast within the first 2 months IIRC.</p>
| 3,108
|
<p>I'm at a location where I don't have easy access to toothed belts for my printer (a <a href="https://reprap.org/wiki/Wallace" rel="nofollow noreferrer">RepRap Wallace</a>). While trying to look for some solution, I saw some talk of using fishing line as a belt, along with a log of admonitions of <code>Don't</code>.</p>
<p>However, as I have easy access to fishing line, but almost no access to a toothed belt, I was thinking of using multiple strands of fishing line with regularly spaced knots to simulate a toothed belt. However, Google didn't help much with either usage or possible Gotchas.</p>
<p>Is there any possible issues that I may face with this solution?</p>
|
<p>I’m going to recommend not using a fishing line with knots. Probably the biggest problem you’ll have using the fishing line with knots is if the knots are not perfectly spaced, movement along the X or Y axis is not going to be consistent. This could result in weird deformations in your print.</p>
<p>Depending on how you tie the knots they may not grip the teeth of the gears quite well enough to prevent slippage. </p>
<p>Both of these issues will mean that you will not get very good quality prints assuming the print doesn’t outright fail.</p>
<p>You would be better off waiting to get the correct belt then attempting to use fishing line. </p>
|
<p>If you are using fishing line, it would perhaps work to wrap the line around the pully and fastening it to the pully (both ends), so that the line wraps around the pully. One side would play out from the pully while the other was wrapping around it.</p>
<p>By attaching the ends of the line to the pully, there will be no slippage between the line and the pully. The knots aren't needed, and their irregularity won't affect the print quality. The problem will be if and when the fishing line wraps tightly over itself and jams. This can be mitigated a bit by having the two ends on opposite sides of the pully, and perhaps adding guide wires to direct the line to the proper side.</p>
<p>Usually, mechanisms like this involve good control of the wrapping and unwrapping, but this might work well enough to print a new pully.</p>
<p>Thin aircraft cable might be a good alternative to fishing line.</p>
| 1,071
|
<p>I am new to all the anonymous features and need some help. I have gotten the following to work:</p>
<pre><code>public void FakeSaveWithMessage(Transaction t)
{
t.Message = "I drink goats blood";
}
public delegate void FakeSave(Transaction t);
public void SampleTestFunction()
{
Expect.Call(delegate { _dao.Save(t); }).Do(new FakeSave(FakeSaveWithMessage));
}
</code></pre>
<p>But this is totally ugly and I would like to have the inside of the Do to be an anonymous method or even a lambda if it is possible. I tried:</p>
<pre><code>Expect.Call(delegate { _dao.Save(t); }).Do(delegate(Transaction t2) { t2.Message = "I drink goats blood"; });
</code></pre>
<p>and</p>
<pre><code>Expect.Call(delegate { _dao.Save(t); }).Do(delegate { t.Message = "I drink goats blood"; });
</code></pre>
<p>but these give me</p>
<blockquote>
<p>Cannot convert anonymous method to type 'System.Delegate' because it is not a delegate type** compile errors.</p>
</blockquote>
<p>What am I doing wrong?</p>
<hr>
<p>Because of what Mark Ingram posted, seems like the best answer, though nobody's explicitly said it, is to do this:</p>
<pre><code>public delegate void FakeSave(Transaction t);
Expect.Call(delegate { _dao.Save(t); }).Do( new FakeSave(delegate(Transaction t2) { t.Message = expected_msg; }));
</code></pre>
|
<p>That's a well known error message. Check the link below for a more detailed discussion.</p>
<p><a href="http://staceyw1.wordpress.com/2007/12/22/they-are-anonymous-methods-not-anonymous-delegates/" rel="noreferrer">http://staceyw1.wordpress.com/2007/12/22/they-are-anonymous-methods-not-anonymous-delegates/</a> </p>
<p>Basically you just need to put a cast in front of your anonymous delegate (your lambda expression).</p>
<p>In case the link ever goes down, here is a copy of the post: </p>
<blockquote>
<p><strong>They are Anonymous Methods, not
Anonymous Delegates.</strong><br>
Posted on December 22, 2007 by staceyw1 </p>
<p>It is not just a talking point because
we want to be difficult. It helps us
reason about what exactly is going on.
To be clear, there is *no such thing
as an anonymous delegate. They don’t
exist (not yet). They are "Anonymous
Methods" – period. It matters in how
we think of them and how we talk about
them. Lets take a look at the
anonymous method statement "delegate()
{…}". This is actually two different
operations and when we think of it
this way, we will never be confused
again. The first thing the compiler
does is create the anonymous method
under the covers using the inferred
delegate signature as the method
signature. It is not correct to say
the method is "unnamed" because it
does have a name and the compiler
assigns it. It is just hidden from
normal view. The next thing it does
is create a delegate object of the
required type to wrap the method. This
is called delegate inference and can
be the source of this confusion. For
this to work, the compiler must be
able to figure out (i.e. infer) what
delegate type it will create. It has
to be a known concrete type. Let
write some code to see why.</p>
</blockquote>
<pre><code>private void MyMethod()
{
}
</code></pre>
<blockquote>
<p><strong>Does not compile:</strong> </p>
</blockquote>
<pre><code>1) Delegate d = delegate() { }; // Cannot convert anonymous method to type ‘System.Delegate’ because it is not a delegate type
2) Delegate d2 = MyMethod; // Cannot convert method group ‘MyMethod’ to non-delegate type ‘System.Delegate’
3) Delegate d3 = (WaitCallback)MyMethod; // No overload for ‘MyMethod’ matches delegate ‘System.Threading.WaitCallback’
</code></pre>
<blockquote>
<p>Line 1 does not compile because the
compiler can not infer any delegate
type. It can plainly see the signature
we desire, but there is no concrete
delegate type the compiler can see.
It could create an anonymous type of
type delegate for us, but it does not
work like that. Line 2 does not
compile for a similar reason. Even
though the compiler knows the method
signature, we are not giving it a
delegate type and it is not just going
to pick one that would happen to work
(not what side effects that could
have). Line 3 does not work because
we purposely mismatched the method
signature with a delegate having a
different signature (as WaitCallback
takes and object).</p>
<p><strong>Compiles:</strong> </p>
</blockquote>
<pre><code>4) Delegate d4 = (MethodInvoker)MyMethod; // Works because we cast to a delegate type of the same signature.
5) Delegate d5 = (Action)delegate { }; // Works for same reason as d4.
6) Action d6 = MyMethod; // Delegate inference at work here. New Action delegate is created and assigned.
</code></pre>
<blockquote>
<p>In contrast, these work. Line 1 works
because we tell the compiler what
delegate type to use and they match,
so it works. Line 5 works for the
same reason. Note we used the special
form of "delegate" without the parens.
The compiler infers the method
signature from the cast and creates
the anonymous method with the same
signature as the inferred delegate
type. Line 6 works because the
MyMethod() and Action use same
signature.</p>
<p>I hope this helps.</p>
<p>Also see:
<a href="http://msdn.microsoft.com/msdnmag/issues/04/05/C20/" rel="noreferrer">http://msdn.microsoft.com/msdnmag/issues/04/05/C20/</a></p>
</blockquote>
|
<p>Try something like:</p>
<pre><code>Expect.Call(delegate { _dao.Save(t); }).Do(new EventHandler(delegate(Transaction t2) { t2.CheckInInfo.CheckInMessage = "I drink goats blood"; }));
</code></pre>
<p>Note the added EventHandler around the delegate.</p>
<p>EDIT: might not work since the function signatures of EventHandler and the delegate are not the same... The solution you added to the bottom of your question may be the only way.</p>
<p>Alternately, you could create a generic delegate type:</p>
<pre><code>public delegate void UnitTestingDelegate<T>(T thing);
</code></pre>
<p>So that the delegate is not Transaction specific.</p>
| 8,413
|
<p>We have a WinForms application written in C# that uses the AxAcroPDFLib.AxAcroPDF component to load and print a PDF file. Has been working without any problems in Windows XP. I have moved my development environment to Vista 64 bit and now the application will not run (on Vista 64) unless I remove the AxAcroPDF component. I get the following error when the application runs:</p>
<p>"System.Runtime.InteropServices.COMException:
Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))." </p>
<p>I have been advised on the Adobe Forums that the reason for the error is that they do not have a 64 bit version of the AxAcroPDF ActiveX control. </p>
<p>Is there some way around this problem? For example can I convert the 32bit ActiveX control to a 64bit control myself?</p>
|
<p>You can't convert Adobe's ActiveX control to 64bit yourself, but you can force your application to run in 32bit mode by setting the platform target to x86.</p>
<p>For instructions for your version of Visual Studio, see section 1.44 of <a href="http://msdn.microsoft.com/en-gb/vstudio/aa718685.aspx" rel="noreferrer">Issues When Using Microsoft Visual Studio 2005</a></p>
|
<p>Use DLL isolation, works with every 32bit COM+ application. See more at:
<a href="http://support.microsoft.com/kb/281335" rel="nofollow noreferrer">http://support.microsoft.com/kb/281335</a></p>
<p>With this solution you can isolate your 32 bit COM+ application into a separate 32bit process.</p>
<p>64bit applications search installed COM+ objects at: HKLM\Software\Classes, but 32bit applications use HKLM\Software\WOW6432\Classes</p>
| 9,275
|
<p>I'd like to start experimenting with Cocoa and programming for Mac OSX. I'm not terribly concerned with Objective C syntax/constructs/bheaviors at this point, but more curious as to an efficient setup on in terms of an editor and/or IDE that will get me going quickly. Is there any IDE even remotely similar to Visual Studio (since that's where I've spent most of my time over the last 7 years) in terms of it's solution/project concept? Any other tools, tips, suggestions and/or resources to get up and experimenting quickly? </p>
<p>I'd like to avoid a lot of the intro stuff and get into things like "If you want to create an Mac desktop application, you can use <i>Acme IDE</i> and set up your project like this." </p>
<hr>
<p>I was afraid Xcode was going to be the answer! :P I tried playing around with that -- literally just getting it off the DVD and just diving in with no idea what to expect (before I even knew that you used Objective C as the language). I figured, the wise guy that I am, that I could just sort of fumble around and get a simple app working ... wrong. </p>
<p>@Andrew - Thanks for the insight on those config settings. Based on my Xcode first impression, I think those may help.</p>
|
<p>I'd suggest you pick a fun little product and dive in. If you're looking for a book I'd suggest <a href="https://rads.stackoverflow.com/amzn/click/com/0321503619" rel="noreferrer" rel="nofollow noreferrer">Cocoa Programming for Max OSX</a> which is a very good introduction both to Objective-C and Cocoa.</p>
<p>XCode is pretty much the de facto IDE and free with OSX. It should be on your original install DVD. It's good but not as good as Visual Studio (sorry, it's really not). </p>
<p>As a long-time VS user I found the default XCode config a little odd and hard to adjust to, particularly the way a new floating window would open for every sourcefile. Some tweaks I found particularly helpful;</p>
<ul>
<li>Settings/General -> All-In-One (unifies editor/debugger window)</li>
<li>Settings/General -> Open counterparts in same editor (single-window edit)</li>
<li>Settings/Debugging - "In Editor Debugger Controls"</li>
<li>Settings/Debugging - "Auto Clear Debug Console"</li>
<li>Settings/Key-binding - lots of binding to match VS (Ctrl+F5/Shift+F5,Shift+Home, Shift+End etc)</li>
</ul>
<p>I find the debugger has some annoying issues such as breakpoints not correctly mapping to lines and exceptions aren't immediately trapped by the debugger. Nothing deal-breaking but a bit cumbersome.</p>
<p>I would recommend that you make use of the new property syntax that was introduced for Objective-C 2.0. They make for a heck of a lot less typing in many many places. They're limited to OSX 10.5 only though (yeah, language features are tied to OS versions which is a bit odd). </p>
<p>Also don't be fooled into downplaying the differences between C/C++ and Objective-C. They're very much related but ARE different languages. Try and start Objective-C without thinking about how you'd do X,Y,Z in C/C++. It'll make it a lot easier.</p>
|
<p>AFAIK, pretty much every OS X developer uses Xcode.</p>
<p>That, and Interface Builder for creating the GUIs.</p>
<p>FWIW, try to get hold of a copy of Hillegas's book, as it's a great introductory tutorial, and the reference Docs Apple provides really aren't. (They are generally very good reference docs, however).</p>
| 3,645
|
<p>Can a (||any) proxy server cache content that is requested by a client over https? As the proxy server can't see the querystring, or the http headers, I reckon they can't.</p>
<p>I'm considering a desktop application, run by a number of people behind their companies proxy. This application may access services across the internet and I'd like to take advantage of the in-built internet caching infrastructure for 'reads'. If the caching proxy servers can't cache SSL delivered content, would simply encrypting the content of a response be a viable option?</p>
<p>I am considering all GET requests that we wish to be cachable be requested over http with the body encrypted using asymmetric encryption, where each client has the decryption key. Anytime we wish to perform a GET that is not cachable, or a POST operation, it will be performed over SSL.</p>
|
<p>No, it's not possible to cache https directly. The whole communication between the client and the server is encrypted. A proxy sits between the server and the client, in order to cache it, you need to be able to read it, ie decrypt the encryption.</p>
<p>You can do something to cache it. You basically do the SSL on your proxy, intercepting the SSL sent to the client. Basically the data is encrypted between the client and your proxy, it's decrypted, read and cached, and the data is encrypted and sent on the server. The reply from the server is likewise descrypted, read and encrypted. I'm not sure how you do this on major proxy software (like squid), but it is possible.</p>
<p>The only problem with this approach is that the proxy will have to use a self signed cert to encrypt it to the client. The client will be able to tell that a proxy in the middle has read the data, since the certificate will not be from the original site.</p>
|
<p>How about setting up a server cache on the application server behind the component that encrypts https responses? This can be useful if you have a reverse-proxy setup.</p>
<p>I am thinking of something like this:</p>
<pre><code>application server <---> Squid or Varnish (cache) <---> Apache (performs SSL encryption)
</code></pre>
| 3,546
|
<p>What are the pros/cons of doing either way. Is there One Right Way(tm) ?</p>
|
<p>If you want to use exceptions instead of errors for your entire application, you can do it with <a href="http://php.net/ErrorException" rel="noreferrer">ErrorException</a> and a custom error handler (see the ErrorException page for a sample error handler). The only downside to this method is that non-fatal errors will still throw exceptions, which are always fatal unless caught. Basically, even an <code>E_NOTICE</code> will halt your entire application if your <a href="http://php.net/error_reporting" rel="noreferrer">error_reporting</a> settings do not suppress them.</p>
<p>In my opinion, there are several benefits to using ErrorException:</p>
<ol>
<li>A custom exception handler will let you display nice messages, even for errors, using <a href="http://php.net/set_exception_handler" rel="noreferrer">set_exception_handler</a>.</li>
<li>It does not disrupt existing code in any way... <a href="http://php.net/trigger_error" rel="noreferrer">trigger_error</a> and other error functions will still work normally.</li>
<li>It makes it really hard to ignore stupid coding mistakes that trigger <code>E_NOTICE</code>s and <code>E_WARNING</code>s.</li>
<li><p>You can use <code>try</code>/<code>catch</code> to wrap code that may generate a PHP error (not just exceptions), which is a nice way to avoid using the <code>@</code> error suppression hack:</p>
<pre><code>try {
$foo = $_GET['foo'];
} catch (ErrorException $e) {
$foo = NULL;
}
</code></pre></li>
<li><p>You can wrap your entire script in a single <code>try</code>/<code>catch</code> block if you want to display a friendly message to your users when any uncaught error happens. (Do this carefully, because only uncaught errors and exceptions are logged.)</p></li>
</ol>
|
<p><em><strong>Using exceptions are not a good idea in the era of 3rd party application integration</em></strong>. </p>
<p>Because, the moment you try to integrate your app with something else, or someone else's app with yours, your entire application will come to a halt the moment a class in some 3rd party plugin throws an exception. Even if you have full fledged error handling, logging implemented in your own app, someone's random object in a 3rd party plugin will throw an exception, and your entire application will stop right there. </p>
<p><em><strong>EVEN if you have the means in your application to make up for the error of that library you are using</em></strong>.... </p>
<p>A case in example may be a 3rd party social login library which throws an exception because the social login provider returned an error, and kills your entire app unnecessarily - hybridauth, by the way. So, There you have an entire app, and there you have a library bringing in added functionality for you - in this case, social login - and even though you have a lot of fallback stuff in the case a provider does not authenticate (your own login system, plus like 20 or so other social login providers), your ENTIRE application will come to a grinding halt. And you will end up having to change the 3rd party library to work around these issues, and the point of using a 3rd party library to speed up development will be lost. </p>
<p>This is a serious design flaw in regard to philosophy of handling errors in PHP. Lets face it - under the other end of most of applications developed today, there is a user. Be it an intranet user, be it a user over internet, be it a sysadmin, it does not matter - there is generally a user.</p>
<p>And, having an application die on your face without there being anything you can do at that point other than to go back to a previous page and have a shot in the dark regarding what you are trying to do, as a user, is bad, bad practice from development side. Not to mention, an internal error which only the developers should know due to many reasons (from usability to security) being thrown on the face of a user. </p>
<p>As a result, im going to have to just let go of a particular 3rd party library (hybridauth in this case) and not use it in my application, solely for that reason. Despite the fact that hybridauth is a very good library, and apparently a lot of good effort have been spent on it, with a phletora of capabilities. </p>
<p>Therefore, you should refrain from using exceptions in your code. EVEN if the code you are doing right now, is the top level code that will run your application, and not a library, it is possible that you may want to include all or part of your code in other projects, or have to integrate parts or entirety of it with other code of yours or 3rd party code. And if you used exceptions, you will end up with the same situation - entire applications/integrations dying in your face even if you have proper means to handle whatever issue a piece of code provides.</p>
| 8,552
|
<p>I'm looking to use SQL to format a number with commas in the thousands, but no decimal (so can't use Money) - any suggestions?</p>
<p>I'm using SQL Server 2005, but feel free to answer for others as well (like MySQL)</p>
|
<p>In MySQL, the <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_format" rel="nofollow noreferrer"><code>FORMAT()</code></a> function will do the trick.</p>
|
<p>For SQL Server, you could format the number as money and then delete the right-most three characters.</p>
<pre><code>replace(convert (varchar, convert (money, 109999), 1), '.00','')
</code></pre>
| 6,363
|
<p>Yes, Podcasts, those nice little Audiobooks I can listen to on the way to work. With the current amount of Podcasts, it's like searching a needle in a haystack, except that the haystack happens to be the Internet and is filled with too many of these "Hot new Gadgets" stuff :(</p>
<p>Now, even though <strong>I</strong> am mainly a .NET developer nowadays, maybe anyone knows some good Podcasts from people regarding the whole software lifecycle? Unit Testing, Continous Integration, Documentation, Deployment...</p>
<p>So - what are you guys and gals listening to?</p>
<hr />
<p>Please note that the categorizations are somewhat subjective and may not be 100% accurate as many podcasts cover several areas. Categorization is made against what is considered the "main" area.</p>
<h1>General Software Engineering / Productivity</h1>
<ul>
<li>[Stack Overflow ] <a href="https://blog.stackoverflow.com/category/podcasts/">1</a>(inactive, but still a good listen)</li>
<li><a href="http://tekpub.com" rel="nofollow noreferrer">TekPub (Requires Paid Subscription)</a></li>
<li><a href="http://www.se-radio.net/" rel="nofollow noreferrer">Software Engineering Radio</a></li>
<li><a href="http://www.43folders.com/podcast" rel="nofollow noreferrer">43 Folders</a></li>
<li><a href="http://perspectives.on10.net/" rel="nofollow noreferrer">Perspectives</a></li>
<li><a href="http://www.drdobbs.com/tv/" rel="nofollow noreferrer">Dr. Dobb's</a> (now a video feed)</li>
<li><a href="http://www.pragprog.com/podcasts" rel="nofollow noreferrer">The Pragmatic Podcast</a> (Inactive)</li>
<li><a href="http://www.thoughtworks.com/what-we-say/podcasts.html" rel="nofollow noreferrer">IT Matters</a></li>
<li><a href="http://agiletoolkit.libsyn.com/" rel="nofollow noreferrer">Agile Toolkit Podcast</a></li>
<li><a href="http://thestacktrace.libsyn.com/" rel="nofollow noreferrer">The Stack Trace</a> (Inactive)</li>
<li><a href="http://www.parleys.com/display/PARLEYS/Home#page=Home" rel="nofollow noreferrer">Parleys</a></li>
<li><a href="http://techzinglive.com/" rel="nofollow noreferrer">Techzing</a></li>
<li><a href="http://startuppodcast.wordpress.com/" rel="nofollow noreferrer">The Startup Success Podcast</a></li>
<li><a href="http://webcast.berkeley.edu/course_feeds.php" rel="nofollow noreferrer">Berkeley CS class lectures</a></li>
<li><a href="http://twit.tv/FLOSS" rel="nofollow noreferrer">FLOSS Weekly</a></li>
<li><a href="http://www.thisdeveloperslife.com/" rel="nofollow noreferrer">This Developer's Life</a></li>
</ul>
<h1>.NET / Visual Studio / Microsoft</h1>
<ul>
<li><a href="http://herdingcode.com/" rel="nofollow noreferrer">Herding Code</a></li>
<li><a href="http://www.hanselminutes.com/" rel="nofollow noreferrer">Hanselminutes</a></li>
<li><a href="http://www.dotnetrocks.com/" rel="nofollow noreferrer">.NET Rocks!</a></li>
<li><a href="http://deepfriedbytes.com/" rel="nofollow noreferrer">Deep Fried Bytes</a></li>
<li><a href="http://altnetpodcast.com/" rel="nofollow noreferrer">Alt.Net Podcast</a> (inactive)</li>
<li><a href="http://www.polymorphicpodcast.com/" rel="nofollow noreferrer">Polymorphic Podcast</a> (inconsistent)</li>
<li><a href="http://www.sparklingclient.com/" rel="nofollow noreferrer">Sparkling Client (The Silverlight Podcast)</a></li>
<li><a href="http://www.dnrtv.com/default.aspx" rel="nofollow noreferrer">dnrTV!</a></li>
<li><a href="http://feeds.feedburner.com/SpaghettiCodePodcasts" rel="nofollow noreferrer">Spaghetti Code</a></li>
<li><a href="http://aspnetpodcast.com/CS11/Default.aspx" rel="nofollow noreferrer">ASP.NET Podcast</a></li>
<li><a href="http://channel9.msdn.com/Media/Podcasts/" rel="nofollow noreferrer">Channel 9</a></li>
<li><a href="http://www.radiotfs.com/" rel="nofollow noreferrer">Radio TFS</a></li>
<li><a href="http://feeds.feedburner.com/powerscripting" rel="nofollow noreferrer">PowerScripting Podcast</a></li>
<li><a href="http://thirstydeveloper.com/" rel="nofollow noreferrer">The Thirsty Developer</a></li>
<li><a href="http://elegantcode.com/elegantcode-cast/" rel="nofollow noreferrer">Elegant Code</a> (inactive)</li>
<li><a href="http://www.connectedshow.com/" rel="nofollow noreferrer">ConnectedShow</a></li>
<li><a href="http://craftycoders.com/?tag=/podcast" rel="nofollow noreferrer">Crafty Coders</a></li>
<li><a href="http://codingqa.com" rel="nofollow noreferrer">Coding QA</a></li>
</ul>
<h1>jQuery</h1>
<ul>
<li><a href="http://yayquery.com/" rel="nofollow noreferrer">yayQuery</a></li>
<li><a href="http://blog.jquery.com/2009/11/13/announcing-the-official-jquery-podcast/" rel="nofollow noreferrer">The official jQuery podcast</a></li>
</ul>
<h1>Java / Groovy</h1>
<ul>
<li><a href="http://javaposse.com/" rel="nofollow noreferrer">The Java Posse</a></li>
<li><a href="http://www.grailspodcast.com/blog/list" rel="nofollow noreferrer">Grails Podcast</a></li>
<li><a href="http://www.javaworld.com/podcasts/jtech/" rel="nofollow noreferrer">Java Technology Insider</a></li>
<li><a href="http://basementcoders.com/" rel="nofollow noreferrer">Basement Coders</a></li>
</ul>
<h1>Ruby / Rails</h1>
<ul>
<li><a href="http://railscasts.com/" rel="nofollow noreferrer">Railscasts</a></li>
<li><a href="http://railsenvy.com/podcast" rel="nofollow noreferrer">Rails Envy</a></li>
<li><a href="http://podcast.rubyonrails.org/" rel="nofollow noreferrer">The Ruby on Rails Podcast</a></li>
<li><a href="http://rubiverse.com/" rel="nofollow noreferrer">Rubiverse</a></li>
<li><a href="http://ruby5.envylabs.com/" rel="nofollow noreferrer">Ruby5</a></li>
</ul>
<h1>Web Design / JavaScript / Ajax</h1>
<ul>
<li><a href="http://webdevradio.com/" rel="nofollow noreferrer">WebDevRadio</a></li>
<li><a href="http://boagworld.com/" rel="nofollow noreferrer">Boagworld</a></li>
<li><a href="http://therissingtonpodcast.co.uk/" rel="nofollow noreferrer">The Rissington podcast</a></li>
<li><a href="http://ajaxian.com/by/category/podcasts" rel="nofollow noreferrer">Ajaxian</a></li>
<li><a href="http://developer.yahoo.com/yui/theater/" rel="nofollow noreferrer">YUI Theater</a></li>
</ul>
<h1>Unix / Linux / Mac / iPhone</h1>
<ul>
<li><a href="http://www.mac-developer-network.com/" rel="nofollow noreferrer">Mac Developer Network</a></li>
<li><a href="http://www.hackerpublicradio.org/" rel="nofollow noreferrer">Hacker Public Radio</a></li>
<li><a href="http://www.linuxoutlaws.com/" rel="nofollow noreferrer">Linux Outlaws</a></li>
<li><a href="http://macosken.com/" rel="nofollow noreferrer">Mac OS Ken</a></li>
<li><a href="http://lugradio.org/" rel="nofollow noreferrer">LugRadio Linux radio show</a> (Inactive)</li>
<li><a href="http://www.jupiterbroadcasting.com/?cat=4" rel="nofollow noreferrer">The Linux Action Show!</a></li>
<li><a href="http://www.kernelpodcast.org/" rel="nofollow noreferrer">Linux Kernel Mailing List (LKML) Summary Podcast</a></li>
<li><a href="http://itunes.stanford.edu/" rel="nofollow noreferrer">Stanford's iPhone programming class</a></li>
<li><a href="http://www.sunsetlakesoftware.com/2010/06/03/advanced-iphone-development-course-now-itunes-u" rel="nofollow noreferrer">Advanced iPhone Development Course - Madison Area Technical College</a></li>
<li><a href="http://developer.apple.com/videos/wwdc/2010/" rel="nofollow noreferrer">WWDC 2010 Session Videos (requires Apple Developer registration)</a></li>
</ul>
<h1>System Administration, Security or Infrastructure</h1>
<ul>
<li><a href="http://feeds.feedburner.com/RunasRadio" rel="nofollow noreferrer">RunAs Radio</a></li>
<li><a href="http://www.grc.com/securitynow.htm" rel="nofollow noreferrer">Security Now!</a></li>
<li><a href="http://crypto-gram.libsyn.com/" rel="nofollow noreferrer">Crypto-Gram Security Podcast</a></li>
<li><a href="http://www.hak5.org/" rel="nofollow noreferrer">Hak5</a></li>
<li><a href="http://blogs.vmware.com/vmtn/podcasts/index.html" rel="nofollow noreferrer">VMWare VMTN</a></li>
<li><a href="http://twit.tv/ww" rel="nofollow noreferrer">Windows Weekly</a></li>
<li><a href="http://pauldotcom.com/" rel="nofollow noreferrer">PaulDotCom Security</a></li>
<li><a href="http://www.theregister.co.uk/hardware/semi_coherent/podcast.rss" rel="nofollow noreferrer">The Register - Semi-Coherent Computing</a></li>
<li><a href="http://feathercast.org/" rel="nofollow noreferrer">FeatherCast</a></li>
</ul>
<h1>General Tech / Business</h1>
<ul>
<li><a href="http://revision3.com/tekzilla/" rel="nofollow noreferrer">Tekzilla</a></li>
<li><a href="http://twit.tv/twit" rel="nofollow noreferrer">This Week in Tech</a></li>
<li><a href="http://www.guardian.co.uk/technology/series/techweekly" rel="nofollow noreferrer">The Guardian Tech Weekly</a></li>
<li><a href="http://www.pcmag.com/category2/0,2806,2007098,00.asp" rel="nofollow noreferrer">PCMag Radio Podcast</a> (Inactive)</li>
<li><a href="http://ecorner.stanford.edu/" rel="nofollow noreferrer">Entrepreneurship Corner</a></li>
<li><a href="http://www.manager-tools.com/" rel="nofollow noreferrer">Manager Tools</a></li>
</ul>
<h1>Other / Misc. / Podcast Networks</h1>
<ul>
<li><a href="http://itc.conversationsnetwork.org/" rel="nofollow noreferrer">IT Conversations</a></li>
<li><a href="http://retrobits.libsyn.org/" rel="nofollow noreferrer">Retrobits Podcast</a></li>
<li><a href="http://cagematch.dvorak.org/index.php/board,45.0.html" rel="nofollow noreferrer">No Agenda Netcast</a></li>
<li><a href="http://www.crankygeeks.com/" rel="nofollow noreferrer">Cranky Geeks</a></li>
<li><a href="http://thecommandline.net/" rel="nofollow noreferrer">The Command Line</a></li>
<li><a href="http://www.freelanceswitch.com/podcasts/" rel="nofollow noreferrer">Freelance Radio</a></li>
<li><a href="http://www.ibm.com/developerworks/podcast/" rel="nofollow noreferrer">IBM developerWorks</a></li>
<li><a href="http://www.theregister.co.uk/software/open_season/podcast.rss" rel="nofollow noreferrer">The Register - Open Season</a></li>
<li><a href="http://www.drunkandretired.com/thepodcast/" rel="nofollow noreferrer">Drunk and Retired</a></li>
<li><a href="http://itc.conversationsnetwork.org/series/technometria.html" rel="nofollow noreferrer">Technometria</a></li>
<li><a href="http://www.sodthis.com/podcast/" rel="nofollow noreferrer">Sod This</a></li>
<li><a href="http://www.radio4nerds.com/" rel="nofollow noreferrer">Radio4Nerds</a></li>
<li><a href="http://hackermedley.org" rel="nofollow noreferrer">Hacker Medley</a></li>
</ul>
|
<p>I like</p>
<p><strong>General Software</strong></p>
<ul>
<li><a href="https://blog.stackoverflow.com/category/podcasts/">Stackoverflow</a> (perhaps too obvious)</li>
<li><a href="http://deepfriedbytes.com/" rel="nofollow noreferrer">Deep Fried Bytes</a></li>
<li><a href="http://www.hanselminutes.com/" rel="nofollow noreferrer">Hanselminutes</a></li>
<li><a href="http://www.se-radio.net/" rel="nofollow noreferrer">Software Engineering Radio</a> (via Brenden)</li>
<li><a href="http://herdingcode.com/" rel="nofollow noreferrer">Herding Code</a></li>
</ul>
<p><strong>Dot Net</strong></p>
<ul>
<li><a href="http://altnetpodcast.com/" rel="nofollow noreferrer">Alt.NET Podcast</a></li>
<li><a href="http://www.polymorphicpodcast.com/" rel="nofollow noreferrer">Polymorphic Podcast</a></li>
</ul>
<p><strong>Productivity</strong></p>
<ul>
<li><a href="http://www.43folders.com/podcast" rel="nofollow noreferrer">43 Folders</a></li>
</ul>
|
<p>Suggest someone with the reputation to do it revise this question to say, "What good technology podcasts are out there?"</p>
<p>I've got all kinds of audio fiction I could recommend, but then this question really runs off into the weeds.</p>
| 2,398
|
<p>I know RIM has their own IDE (<a href="http://na.blackberry.com/eng/developers/downloads/jde.jsp" rel="nofollow noreferrer">BlackBerry JDE</a>) for building BlackBerry apps, but does anyone know how to configure <a href="http://www.jetbrains.com/idea/index.html" rel="nofollow noreferrer">IntelliJ IDEA</a> to build/debug BlackBerry apps?</p>
|
<p>RE: Chris' question about what is different... Blackberry applications can be standard MIDP apps or CLDC apps that make use of the Blackberry specific APIs. Most developers tend to take the latter approach, and then using Blackberry's tools is required - especially if you are using some of their secured APIs and have to sign your deployment files for them to run on the devices.</p>
<p>A potential answer to the original question would be to use the <a href="http://bb-ant-tools.sourceforge.net/" rel="nofollow noreferrer">Blackberry ANT tools</a> to create an ANT script for building the application and reference that from IntelliJ IDEA. Of course, that's only half the battle and to run/debug the application you'll need to connect the debugger to IDEA as noted by Alexander above. Alternatively, you could code in IDEA and run/debug in the JDE, but that seems less than ideal, to say the least.</p>
<p>I use Eclipse with the Blackberry plugin. Also not ideal, since you are forced to use an old (and buggy) version of Eclipse, but at least I'm in one IDE and can step through code running in a simulator.</p>
<p>Blackberry JDE integration would be a great IntelliJ plugin project.</p>
|
<p>Not sure if this will help but here are instructions for <a href="http://www.blackberryforums.com/developer-forum/138210-setup-up-eclipse-blackberry-development.html" rel="nofollow noreferrer">setting up Eclipse</a> for blackberry development.</p>
<p>Maybe you can use that information to figure out what changes to need to make in IDEA.</p>
| 7,594
|
<p>This past summer I was developing a basic ASP.NET/SQL Server CRUD app, and unit testing was one of the requirements. I ran into some trouble when I tried to test against the database. To my understanding, unit tests should be:</p>
<ul>
<li>stateless</li>
<li>independent from each other</li>
<li>repeatable with the same results i.e. no persisting changes</li>
</ul>
<p>These requirements seem to be at odds with each other when developing for a database. For example, I can't test Insert() without making sure the rows to be inserted aren't there yet, thus I need to call the Delete() first. But, what if they aren't already there? Then I would need to call the Exists() function first.</p>
<p>My eventual solution involved very large setup functions (yuck!) and an empty test case which would run first and indicate that the setup ran without problems. This is sacrificing on the independence of the tests while maintaining their statelessness.</p>
<p>Another solution I found is to wrap the function calls in a transaction which can be easily rolled back, like <a href="http://weblogs.asp.net/rosherove/archive/2004/10/05/238201.aspx" rel="noreferrer">Roy Osherove's XtUnit</a>. This work, but it involves another library, another dependency, and it seems a little too heavy of a solution for the problem at hand.</p>
<p>So, what has the SO community done when confronted with this situation?</p>
<hr>
<p>tgmdbm said:</p>
<blockquote>
<p>You typically use your favourite
automated unit testing framework to
perform integration tests, which is
why some people get confused, but they
don't follow the same rules. You are
allowed to involve the concrete
implementation of many of your classes
(because they've been unit tested).
You are testing <strong>how your concrete
classes interact with each other and
with the database</strong>.</p>
</blockquote>
<p>So if I read this correctly, there is really no way to <em>effectively</em> unit-test a Data Access Layer. Or, would a "unit test" of a Data Access Layer involve testing, say, the SQL/commands generated by the classes, independent of actual interaction with the database?</p>
|
<p>There's no real way to unit test a database other than asserting that the tables exist, contain the expected columns, and have the appropriate constraints. But that's usually not really worth doing.</p>
<p>You don't typically <strong>unit</strong> test the database. You usually involve the database in <strong>integration</strong> tests.</p>
<p>You typically use your favourite automated unit testing framework to perform integration tests, which is why some people get confused, but they don't follow the same rules. You are allowed to involve the concrete implementation of many of your classes (because they've been unit tested). You are testing how your concrete classes interact with each other and with the database.</p>
|
<p>If you're using LINQ to SQL as the ORM then you can generate the database on-the-fly (provided that you have enough access from the account used for the unit testing). See <a href="http://www.aaron-powell.com/blog.aspx?id=1125" rel="nofollow noreferrer">http://www.aaron-powell.com/blog.aspx?id=1125</a></p>
| 4,172
|
<p>I played with one of the early beta versions of PowerShell V1, but haven't used it since it went "gold". What is the best way to get started using PowerShell?</p>
<p>Which version of PowerShell should I be using (V1.0 vs 2.0 CTP's)? What are you using PowerShell for? Are there any tools that make using PowerShell easier (that is, development environments)?</p>
|
<p>For learning PowerShell, there are a number of great resources</p>
<ol>
<li>Technet Virtual Labs (<a href="https://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&EventID=1032314395&EventCategory=3" rel="noreferrer">Introduction to Windows PowerShell</a>)</li>
<li>PowerShellCommunity.org - Forums, blogs, script repository</li>
<li><h1>powershell on irc.freenode.net</h1>
</li>
<li>PowerShell podcasts - PowerScripting.net and Get-Scripting.blogspot.com</li>
</ol>
<p>For IDE style environments, you have PowerShell Analyzer (free) and PowerGUI (free), PowerShell Plus (commercial), PrimalScript (commercial), and Admin Script Editor (commerical).</p>
<p>I use PowerShell for everything that I can. Right now, I'm looking at <a href="http://codebetter.com/blogs/james.kovacs/archive/2008/06/27/introducing-psake.aspx" rel="noreferrer">Psake</a>, a PowerShell based build script environment. I use if for managing my Active Directory, Hyper-V, Twitter, some keyboard automation (hosting PowerShell in a winforms app to grab keystrokes), and a ton of other stuff. Another cool project I have to check out is <a href="http://codeplex.com/psexpect" rel="noreferrer">PSExpect</a> for testing. I also use it for database access - monitoring changes made to rows in a database by applications. It is also integrated in to my network monitoring solution.</p>
<p>I am also looking to use PowerShell as a scripting engine for a project I am working on.</p>
<p><strong>EDIT</strong>:
<strike>If you are just learning PowerShell, I would focus on V1. As you get more comfortable, take a look at the CTP, but too much can change from the CTP to what is actually released as V2 to make that your learning tool.</strike>
Version 2 is out and available from XP SP3, Server 2003, Vista, and Server 2008 and in the box for Win7 and Server 2008 R2. What you learned for V1 will still serve you well, but now I would concentrate on V2, as there is a superior feature set.</p>
<p>Good luck!</p>
|
<p>There are <a href="http://www.dnrtv.com" rel="nofollow noreferrer">DNRtv</a>s on PowerShell and PowerGUI. There are also <a href="http://www.dotnetrocks.com" rel="nofollow noreferrer">.NET Rocks!</a> episodes about these tools.</p>
| 5,365
|
<p>Silverlight v2.0 is getting closer and closer to RTM but I have yet to hear any stats as to how many browsers are running Silverlight. If I ask Adobe (by googling "Flash install base") they're <a href="http://www.adobe.com/products/player_census/flashplayer/version_penetration.html" rel="nofollow noreferrer">only too happy to tell me</a> that 97.7% of browsers are running Flash player 9 or better.</p>
<p>Not that I believe everything I read, but <strong>where are these statistics from Microsoft or some other vendor about Silverlight?</strong> I'm going to be making a technology choice soon and a little bit of empirical evidence would be an asset at this point...</p>
<p>All you Silverlight developers out there, show me your stats!</p>
|
<p>Quick Answer: <a href="http://www.riastats.com" rel="nofollow noreferrer">www.riastats.com</a></p>
<p>This site compares the different RIA plugins using graphical charts and graphs.</p>
<p>It gets its data from small snippets of javascripts running on sites accross the web (approx 400,000 last time I looked)</p>
<p>At the time of this post, Silverlight 2 was sitting at close to 11%.</p>
<p>I would not take this as the end-all, be-all in RIA stats, but it's the best site I've found so far.</p>
|
<p>The larger question is how many users will your site lose if implemented in Silverlight. And, it very much depends on your audience.</p>
<p>If you're running a site about the joys of Linux kernel hacking or the virtues of Internet security, you'll probably lose a significant chunk of your audience. If you're running a more mainstream site, my experience is that, sadly, people will download anything they're told to most of the time. That's why spyware and malware work. And, as the NBC/Olympics deal shows, Microsoft will aggressively push its partners to use Silverlight until it's fairly ubiquitous.</p>
<p>I won't be using Silverlight until it's more mature because I <em>do</em> cater to a fair number of Linux users, but I might for a less technically-oriented site.</p>
| 8,494
|
<p>I have recently started using Vim as my text editor and am currently working on my own customizations.</p>
<p>I suppose keyboard mappings can do pretty much anything, but for the time being I'm using them as a sort of snippets facility almost exclusively.</p>
<p>So, for example, if I type <code>def{TAB}</code> (<code>:imap def{TAB} def ():<ESC>3ha</code>), it expands to:</p>
<pre><code>def |(): # '|' represents the caret
</code></pre>
<p>This works as expected, but I find it annoying when Vim waits for a full command while I'm typing a word containing "def" and am not interested in expanding it.</p>
<ul>
<li>Is there a way to avoid this or use this function more effectively to this end?</li>
<li>Is any other Vim feature better suited for this?</li>
</ul>
<hr>
<p>After taking a quick look at <a href="http://www.vim.org/scripts/script.php?script_id=1318" rel="noreferrer">SnippetsEmu</a>, it looks like it's the best option and much easier to customize than I first thought.</p>
<p>To continue with the previous example:</p>
<pre><code>:Snippet def <{}>():
</code></pre>
<p>Once defined, you can expand your snippet by typing <code>def{TAB}</code>.</p>
|
<p>Snipmate - like texmate :)
<a href="http://www.vim.org/scripts/script.php?script_id=2540" rel="noreferrer">http://www.vim.org/scripts/script.php?script_id=2540</a></p>
<p>video:
<a href="http://vimeo.com/3535418" rel="noreferrer">http://vimeo.com/3535418</a></p>
<pre><code>snippet def
""" ${1:docstring} """
def ${2:name}:
return ${3:value}
</code></pre>
|
<p>As noted by MDCore, <a href="http://www.vim.org/scripts/script.php?script_id=1318" rel="nofollow noreferrer">SnippetsEmu</a> is a popular Vim script that does just that and more. If you need only expanding (without moving back the caret), you can use the standard <code>:ab[breviate]</code> command.</p>
<pre><code>:ab[breviate] [<expr>] {lhs} {rhs}
add abbreviation for {lhs} to {rhs}. If {lhs} already
existed it is replaced with the new {rhs}. {rhs} may
contain spaces.
See |:map-<expr>| for the optional <expr> argument.
</code></pre>
| 3,615
|
<p>I have built a couple of 3d printers now and I'm having a little trouble with one I'm currently on. I frankensteined this one with two of my other printers that I had built. I took the Arduino mega and ramps 1.4 out of the older one and wired it up to the newer one. When I plug the printer in and try to move the stepper motors they will go in the positive direction and skip and make loud noises when going the other direction. I have taken and separated out all the wires to make sure it wasn't a stray signal. I have also tried turning the voltage up and down on the drivers with no luck. I also swapped cables in case one might have been broken. The next step when I get home I'm going to try is connecting the old steppers and see if they work. After that I am pretty much at a loss. I already search Google and found a couple of things I could try, but figured maybe someone here might have an answer to why this might be happening. Steppers motors from the old printer are the same as the new one the only difference is manufactures.</p>
<p>Update:
The printers are:
HE3d Prusa XI3
Max Micron Foldbot</p>
<p>I'm just using the LCD, Ramps 1.4 and Arduino Mega 2560 R2 from the He3d and putting it on the Foldbot. With some other features but those shouldn't matter as they would work on both printers. The board from the Foldbot is the Arduino Mega 2560 built into the Ramps board MXP_PRO_V3.0. I'll try and get some pictures. Also switching steppers didn't work. Going to try to get X,Y,Z axis working separately see if i can find the problem that way.</p>
<p>Update: Ok so I attached the old axis up and did a test with the endstops. Basically I think the new endstops must be the opposite of what the other printer was cause when i hold the end stop down the motor rotates in both directions and when i let go then it rotates only in a positive direction. I will see if this is part of the issue. I also believe that one of the motors is bad and that's why it wasn't making any sense when i first diagnose it.</p>
|
<p>From an electrical standpoint, a two-phase stepper motors (what most 3D printers use) works the same backwards and forwards, the phase just reverses. If you are stalling on only one direction, I would look to see if you have a mechanical bind in that direction. Generally a wiring issue will cause the motor to either not run at all or to run in the wrong direction.</p>
<p>A few things you can check:</p>
<ol>
<li>Decouple the motors from their mechanical load and confirm that they all run correctly when they aren't driving a load. If you can't do that, disconnect them all then connect a spare motor to each cable one-at-a-time.</li>
<li>Turn each of the axis with your hand and make sure it turns smoothly throughout the entire range in both directions. Note: Some times a binding issue is acceleration related - a loose frame or coupling can cause this.</li>
<li>Monitor the supply voltage to make sure that one of the motors is not pulling the supply down causing all the others to stall.</li>
</ol>
|
<p>Sounds like you are configured for NC switches but are using NO switches, causing them to invert their reported state. Issue a <strong>M119</strong> command and see if the endstop statuses are correct when none are triggered.</p>
| 772
|
<p>I curious to how different people solve integration of systems. I have a feeling that the last years more and more work has gone into integrating systems and that this kind of work need will increase as well.</p>
<p>I wondering if you solve it developing your own small services that are then connected or if you use some sort of product (WebSphere, BizTalk, <a href="http://mule.mulesource.org/display/MULE/Home" rel="noreferrer">Mule</a> etc). I'd also think it'd be interesting to know how these kind of solutions are managed and maintained (how do you solve security, instrumentation etc, etc), what kind of problems have you experienced with your solution and so on.</p>
|
<p>wow - Ok - will get a post on this but will be big.</p>
<p>Intergration needs to be backed up with a big understanding by the business on the benefits - Get an opertating model sorted out - as the business may acutally need to standardise instead of intergrate, as this can be costly - its why most SOA fail! <a href="http://mitsloan.mit.edu/cisr/papers.php" rel="noreferrer">Enterprise Architecture: Driving Business Benefits from IT
Author(s): Jeanne W. Ross</a></p>
<p>If intergration is needed you then need to settle on type of integration.</p>
<p>What are the speed and performance metrics? </p>
<p>We have a .NET SOA with a Composite Application that uses BizTalk 2006 and webservices with Line of Business Applications. Performance of the application at the composite end (consuming) - is limited to the speed of the webservices (and their implementation) in the line of business application! We need sub <3 second return on results - list of cases. Could not be acheived in the webservices so we need to get go to the database directly for initial search. Then over the webservices for case creation. Cost implications and maintance becomes an issue here.</p>
<p>The point here is to look at the performance criteria in the specs and business requirements this will help in look at the type of integration that you need to do - WebServices (HTTP), File Drop/ EDI etc</p>
<p>Functionally for intergration you need to then look at the points of failure in the proposed architecture - as this will lead to a chain of responisblity in SLA/OLA. You may need to wrapper the intergration/faliure points into things that you control.</p>
<p>On similar point about integration with Line of Business is with how much do you need to know about the other product before you can integrate? Yeah Webservices are supposed to be design by contract but the implementation is often leaky and you need to understand alot about what is happening - and if this is a product that you dont control the abstraction even with webservices leaks into your intergation technology aka BizTalk.</p>
<p>Couple these two points together and you the best advise is to get a intergration hub type like BizTalk - wrapper the line of business applications in webservices you create - so the BizTalk side can be free from leaky abstractions then you also can reduce the points of failure as the you have decoupled the line of business application from the intergration hub and the point of failure to a single source rather than inside an orchestration.</p>
<p>Instrumentation and diagnosics in SOA and Intergation Porjects are hard to acheive! - Dont let any shiney sales person try and tell you differently! Yeah MOM with MOM Ent can do this UniCenter can do blah.</p>
<p>The main problem is understand what the error aka burps in the intergation mean and how to recover from them... You end up with messages stuck and you need to understand what that means to that busienss process. You can get an alert to say - processers are 100% Ram 100% orchestrations have failed - but no real meaning. You have to engineer this stuff in to the solution from the outset - and hopefully into you points of failure.</p>
<p>Types of intergration patterns and how to do them do need to be considered too.</p>
<p>The above is a real world view of a .NET SOA with BizTalk in a LIVE implementation. But it is also due to the architectural limitations of this - BizTalk mainly is a HUB and SPOKE pattern.</p>
<p>Check out <a href="http://www.amazon.co.uk/Enterprise-Application-Architecture-Addison-Wesley-Signature/dp/0321127420/ref=sr_1_2?ie=UTF8&s=books&qid=1218785778&sr=8-2" rel="noreferrer">Enterprise Application Patterns by Martin Fowler</a> </p>
<p>There are many ways to skin the task!</p>
<p>Other considerations... Platform/Developer Languages etc.</p>
<p>One of the big factors for us was the skills needed to start this stuff. We had OO devs with Java and C# understanding, but mainly C#. So we went for the MS stack. But when you choose the intergration type and the product to manage this they will need more skills in understanding that technology. But hey this is normall for us Devs right? Wrong many developers regardless of there expereince can come unstuck with the likes of BizTalk! Big shift in paradigm - which in part is due to messaging shift rather than code.</p>
<p>Best bit for last!</p>
<p>Numbers of transactions that are likely to be faced in the integration is probable the single biggest factor in all of this. As this will guide what pattern, points of failure and tolarance for such things.</p>
<p>You need to select best on anticpated volumes the right one. Something that can scale up and scale out! We selected BizTalk since it can scale up and scale out correctly and with better understanding than some others. </p>
<p>If you dont have volumes then look at not getting something to manage them and go for a webservice to webservice type style with no management - performance and failure understanding will need to be coded into them.</p>
<p>If your on windows platform with .net 3 take look at WWF/WCF as this can help in webservice to webservice - lots more in the acutal platform now for all these concerns without the overhead of BizTalk and others.</p>
<p>Hope this helps.</p>
|
<p>In my experience it depends on what kind of problem you are tacking.</p>
<p>In my experience it's difficult to beat BizTalk 2006 R2 for bang for the buck but it does imply the use of a Microsoft technology stack.</p>
<p>Websphere MQ seems to be an easier sell to larger corporates and it probably seen greater use at the enterprise level.</p>
<p>Both provide good instrumentation but it's really up to you as a developer to customize this to suit your customer's requirements.</p>
<p>In some cases I've found that a bespoke solution is most appropriate or leveraged technologies such MSMQ to keep costs down.</p>
| 3,311
|
<p>We recently lost a database and I want to recover the data from de Production.log.</p>
<p>Every request is logged like this:</p>
<p>Processing ChamadosController#create (for XXX.XXX.XXX.40 at 2008-07-30 11:07:30) [POST]
Session ID: 74c865cefa0fdd96b4e4422497b828f9
Parameters: {"commit"=>"Gravar", "action"=>"create", "funcionario"=>"6" ... (all other parameters go here).</p>
<p>But some stuff to post on de database were in the session. In the request I have the Session ID, and I also have all the session files from the server.</p>
<p>Is there anyway I can, from this Session ID, open de session file and get it's contents?</p>
|
<p>Have you tried using <a href="http://corelib.rubyonrails.org/classes/Marshal.html" rel="nofollow noreferrer">Marshal#load</a>? I'm not sure how you're generating those session files, but it's quite possible Rails just uses Marshal.</p>
|
<p>Have you tried using <a href="http://corelib.rubyonrails.org/classes/Marshal.html" rel="nofollow noreferrer">Marshal#load</a>? I'm not sure how you're generating those session files, but it's quite possible Rails just uses Marshal.</p>
| 6,280
|
<p>I need to get the number of digits containing the number 1. I know in java I can take the input as a <code>String</code> and use <code>charAt</code>, but I understand there is no implicit String function in C. How can I accomplish this?</p>
|
<p>Division and modulus are your friends.</p>
<pre><code>#include "stdio.h"
int main(){
int digits[] = {0,0,0,0,0,0,0,0,0,0};
int i = 11031;
while(i > 0){
digits[i % 10]++;
i = i / 10;
}
printf("There are %d ones.\n", digits[1]);
}
</code></pre>
|
<p>Something along the lines of:</p>
<pre><code>int val=11031;
int count=0;
int i=0;
char buf[100];
sprint(buf, "%d", val);
for(i=0; (i < sizeof(buf)) && (buf[i]); i++) {
if(buf[i] == '1')
count++;
}
</code></pre>
| 9,177
|
<p>I have an images folder with a png in it. I would like to set a MenuItem's icon to that png. How do I write this in procedural code?</p>
|
<pre><code>menutItem.Icon = new System.Windows.Controls.Image
{
Source = new BitmapImage(new Uri("images/sample.png", UriKind.Relative))
};
</code></pre>
|
<p>You can also use your Visual Studio to insert a icon. This is the easiest way</p>
<ul>
<li>Right click at you project in the solution explorer</li>
<li>chose Properties</li>
<li>Make sure you're in the application page.</li>
<li>@ recources you see: Icon and Manifest</li>
<li>@ Icon: Click browse and pick your icon.</li>
</ul>
<p>Problem solved.</p>
| 5,012
|
<p>OK. This is a bit of a vanity app, but I had a situation today at work where I was in a training class and the machine was set to lock every 10 minutes. Well, if the trainers got excited about talking - as opposed to changing slides - the machine would lock up.</p>
<p>I'd like to write a teeny app that has nothing but a taskbar icon that does nothing but move the mouse by 1 pixel every 4 minutes. </p>
<p>I can do that in 3 ways with Delphi (my strong language) but I'm moving to C# for work and I'd like to know the path of least resistance there.</p>
|
<p><strong>for C# 3.5</strong></p>
<p>without notifyicon therefore you will need to terminate this application in task manager manually</p>
<pre><code>using System;
using System.Drawing;
using System.Windows.Forms;
static class Program
{
static void Main()
{
Timer timer = new Timer();
// timer.Interval = 4 minutes
timer.Interval = (int)(TimeSpan.TicksPerMinute * 4 / TimeSpan.TicksPerMillisecond);
timer.Tick += (sender, args) => { Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y + 1); };
timer.Start();
Application.Run();
}
}
</code></pre>
|
<p>(Windows 10 / .Net 5 / C# 9.0)</p>
<p>Instead of faking activity, you could</p>
<blockquote>
<p>inform the system that it is in use, thereby preventing the system
from entering sleep or turning off the display while the application
is running</p>
</blockquote>
<p>using <a href="https://learn.microsoft.com/fr-fr/windows/win32/api/winbase/nf-winbase-setthreadexecutionstate" rel="nofollow noreferrer">SetThreadExecutionState</a>, as described on <a href="https://www.pinvoke.net/default.aspx/kernel32.setthreadexecutionstate" rel="nofollow noreferrer">PInvoke.net</a> :</p>
<pre><code>using System;
using System.Runtime.InteropServices;
using System.Threading;
namespace VanityApp
{
internal static class Program
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern ExecutionState SetThreadExecutionState(ExecutionState esFlags);
[Flags]
private enum ExecutionState : uint
{
ES_AWAYMODE_REQUIRED = 0x00000040,
ES_CONTINUOUS = 0x80000000,
ES_DISPLAY_REQUIRED = 0x00000002,
ES_SYSTEM_REQUIRED = 0x00000001
}
private static void Main()
{
using AutoResetEvent autoResetEvent = new AutoResetEvent(false);
using Timer timer = new Timer(state => SetThreadExecutionState(ExecutionState.ES_AWAYMODE_REQUIRED | ExecutionState.ES_CONTINUOUS | ExecutionState.ES_DISPLAY_REQUIRED | ExecutionState.ES_SYSTEM_REQUIRED), autoResetEvent, 0, -1);
autoResetEvent.WaitOne();
}
}
}
</code></pre>
<p>The Timer is a <a href="https://learn.microsoft.com/en-us/dotnet/api/system.threading.timer" rel="nofollow noreferrer">System.Threading.Timer</a>, with its handy constructor, and it uses <a href="https://learn.microsoft.com/en-us/dotnet/api/system.threading.waithandle.waitone" rel="nofollow noreferrer">AutoResetEvent.WaitOne()</a> to avoid exiting immediately.</p>
| 2,410
|
<p>I printed out this calibration shape from <a href="https://www.thingiverse.com/thing:2656594" rel="nofollow noreferrer">Thingiverse</a> with an unexpectedly catastrophic failure. It looks like there are <em>a lot</em> of things wrong here.</p>
<p><img src="https://i.stack.imgur.com/V7QlZ.jpg" alt="Front View">
<img src="https://i.imgur.com/assIZiQ.png" alt="Side View"></p>
<p>I used the <code>Normal</code> profile in Ultimaker Cura.</p>
<p>There's so much bad in this print that I'm not sure where to start.</p>
<ol>
<li>It appears that walls weren't printed at all. </li>
<li>Resolution is way below par. </li>
<li>Overhangs are collapsing (not sure if that would be expected at those angles)</li>
<li>The in-filling is inconsistent and "blobby".</li>
</ol>
|
<p>The oozing is due to hot-end getting hot before the bed leveling procedure: if you move the hot-end warm up command <strong>after</strong> the <code>G29</code> line you avoid that oozing</p>
<pre><code>; Ender 3 Custom Start G-code
M104 S{material_print_temperature_layer_0} ; Set Extruder temperature
M140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature
G28 ; Home all axes
G29 ; BLTOUCH Mesh Generation
M190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature
M109 S{material_print_temperature_layer_0} ; Wait for Extruder temperature
G1 F1800 E-3 ; Retract filament 3 mm to prevent oozing
G92 E0 ; Reset Extruder
G1 Z5.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
G1 Z5.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
</code></pre>
<p>The above code will activate the heating elements but starts homing and leveling procedure without waiting for the elements to get up to temperature. Only after the bed leveling is finished the printer will pause and wait for the heating elements reach the desired temperature.</p>
<p>This will prevent oozing on a cold start, but you will still be affected if you start a print right after another print, when the hot-end is still close to melting temperature.</p>
<p>If you prefer to avoid that condition you might want to also move the <code>M104</code> and <code>M140</code> commands after the <code>G29</code> bed leveling command.</p>
|
<p>The best solution would be to heat the bed, but not the nozzle at startup. If you level with a cold bed, your ABL mesh is going to be off, since the aluminum heated bed plate expands considerably once the heat is applied. </p>
<p>You could also issue a retract command before leveling, and then add a counteracting filament feed command after ABL is complete. I have no idea how that code would look though. Just my 2 cents.</p>
| 1,143
|
<p>I'm looking for a "safe" eval function, to implement spreadsheet-like calculations (using numpy/scipy).</p>
<p>The functionality to do this (the <a href="http://docs.python.org/lib/module-rexec.html" rel="nofollow noreferrer">rexec module</a>) has been removed from Python since 2.3 due to apparently unfixable security problems. There are several third-party hacks out there that purport to do this - the most thought-out solution that I have found is
<a href="http://code.activestate.com/recipes/496746/" rel="nofollow noreferrer">this Python Cookbok recipe</a>, "safe_eval". </p>
<p>Am I reasonably safe if I use this (or something similar), to protect from malicious code, or am I stuck with writing my own parser? Does anyone know of any better alternatives?</p>
<p>EDIT: I just discovered <a href="http://pypi.python.org/pypi/RestrictedPython" rel="nofollow noreferrer">RestrictedPython</a>, which is part of Zope. Any opinions on this are welcome.</p>
|
<p>Depends on your definition of safe I suppose. A lot of the security depends on what you pass in and what you are allowed to pass in the context. For instance, if a file is passed in, I can open arbitrary files:</p>
<pre><code>>>> names['f'] = open('foo', 'w+')
>>> safe_eval.safe_eval("baz = type(f)('baz', 'w+')", names)
>>> names['baz']
<open file 'baz', mode 'w+' at 0x413da0>
</code></pre>
<p>Furthermore, the environment is very restricted (you cannot pass in modules), thus, you can't simply pass in a module of utility functions like re or random.</p>
<p>On the other hand, you don't need to write your own parser, you could just write your own evaluator for the python ast:</p>
<pre><code>>>> import compiler
>>> ast = compiler.parse("print 'Hello world!'")
</code></pre>
<p>That way, hopefully, you could implement safe imports. The other idea is to use Jython or IronPython and take advantage of Java/.Net sandboxing capabilities.</p>
|
<p>Daniel,
<a href="http://jinja.pocoo.org/2/documentation/intro" rel="nofollow noreferrer">Jinja</a> implements a sandboxe environment that may or may not be useful to you. From what I remember, it doesn't yet "comprehend" list comprehensions. </p>
<p><a href="http://jinja.pocoo.org/2/documentation/sandbox" rel="nofollow noreferrer">Sanbox info</a> </p>
| 4,802
|
<p>What's the best way to import a CSV file into a strongly-typed data structure?</p>
|
<p>Microsoft's <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.fileio.textfieldparser.aspx" rel="nofollow noreferrer">TextFieldParser</a> is stable and follows <a href="https://www.rfc-editor.org/rfc/rfc4180" rel="nofollow noreferrer">RFC 4180</a> for CSV files. Don't be put off by the <code>Microsoft.VisualBasic</code> namespace; it's a standard component in the .NET Framework, just add a reference to the global <code>Microsoft.VisualBasic</code> assembly.</p>
<p>If you're compiling for Windows (as opposed to Mono) and don't anticipate having to parse "broken" (non-RFC-compliant) CSV files, then this would be the obvious choice, as it's free, unrestricted, stable, and actively supported, most of which cannot be said for FileHelpers.</p>
<p>See also: <a href="http://msdn.microsoft.com/en-us/library/cakac7e6.aspx" rel="nofollow noreferrer">How to: Read From Comma-Delimited Text Files in Visual Basic</a> for a VB code example.</p>
|
<p>If you can guarantee that there are no commas in the data, then the simplest way would probably be to use <a href="http://msdn.microsoft.com/en-us/library/system.string.split(VS.71).aspx" rel="nofollow noreferrer">String.split</a>.</p>
<p>For example:</p>
<pre><code>String[] values = myString.Split(',');
myObject.StringField = values[0];
myObject.IntField = Int32.Parse(values[1]);
</code></pre>
<p>There may be libraries you could use to help, but that's probably as simple as you can get. Just make sure you can't have commas in the data, otherwise you will need to parse it better.</p>
| 2,414
|
<p>I have a few kg of 3 mm filament when I only have use for 1.75 mm.</p>
<p>How can I make 1.75 mm from 3 mm filament?</p>
|
<p>In theory, making filament is easy. You take a 3 mm hotend with a 1.75 mm hole, and extrude the 3 mm (sometimes actually 2.85 mm) filament, let it cool, and then reel it up.</p>
<p>In reality there are a lot of pitfalls to making filament - if the pressure isn't even, the hole not perfect, the temperature uneven, you can end up with oval filament, filament with bubbles, or worse. If you are over temperature you may damage the filament and it could look good, but not melt correctly when used. If you reel it too fast you may thin it out more than the intended diameter, or too slow and you may thicken it. A lot of hotends use steppers, which may result in ripples in the filament, so you may end up building a nearly custom filament machine.</p>
<p>Resolving all these problems is probably not worth simply selling or giving away the filament to someone that can use it, and buying the right size for your machine.</p>
<p>If you are still interested, though, you might as well go all the way and build a full filament extruder that accepts raw plastic feedstock (usually pellets) as well as your filament, and convert it that way, then continue using it to create your own filament.</p>
|
<p>You could build a machine that has a nozzle with 3 mm input hole and 1.75 mm output hole, based on some designs for filament making machines. Or you could just cut the filament into little peaces and use them instead of the granulate in an original filament making machines.</p>
<p>There are some open designs for such machines <a href="http://www.instructables.com/id/Build-your-own-3d-printing-filament-factory-Filame/" rel="nofollow noreferrer">you can build</a>, or you could buy one, such as <a href="http://www.filabot.com/collections/filabot-core" rel="nofollow noreferrer">Filabot</a>.</p>
<p>However, as mentioned by <a href="https://3dprinting.stackexchange.com/users/36/kaine">kaine</a>, this is very unlikely to be worth the cost/effort. Best option for you is to try to sell the 3 mm filament to someone who has a use for it, take the money and buy some 1.75 mm filament instead.</p>
| 98
|
<p>After reading the Head First Design Patterns book and using a number of other design patterns, I'm trying to understand the Observer pattern. Isn't this already implemented using Events in the .NET Framework?</p>
|
<p>Yes, it is. The observer pattern is also called the publish/subscribe pattern, which is exactly what events allow you to do.</p>
|
<p>No, they achieve the same intent, however they are different.
I would say that the Observer pattern is quite a hack of over design to achieve something you could have achieved easily with functional programming, and that .NET events uses functional programming to achieve the same goal.</p>
| 5,198
|
<p>While creating classes in Java I often find myself creating instance-level collections that I know ahead of time will be very small - less than 10 items in the collection. But I don't know the number of items ahead of time so I typically opt for a dynamic collection (ArrayList, Vector, etc).</p>
<pre><code>class Foo
{
ArrayList<Bar> bars = new ArrayList<Bar>(10);
}
</code></pre>
<p>A part of me keeps nagging at me that it's wasteful to use complex dynamic collections for something this small in size. Is there a better way of implementing something like this? Or is this the norm?</p>
<p>Note, I'm not hit with any (noticeable) performance penalties or anything like that. This is just me wondering if there isn't a better way to do things.</p>
|
<p>The <code>ArrayList</code> class in Java has only two data members, a reference to an <code>Object[]</code> array and a size—which you need anyway if you don't use an <code>ArrayList</code>. So the only advantage to not using an <code>ArrayList</code> is saving one object allocation, which is unlikely ever to be a big deal.</p>
<p>If you're creating and disposing of many, many instances of your container class (and by extension your <code>ArrayList</code> instance) every second, you <em>might</em> have a slight problem with garbage collection churn—but that's something to worry about if it ever occurs. Garbage collection is typically the least of your worries.</p>
|
<p>The overhead is very small. It is possible to write a hybrid array list that has fields for the first few items, and then falls back to using an array for longer list.</p>
<p>You can avoid the overhead of the list object entirely by using an array. To go even further hardcore, you can declare the field as Object, and avoid the array altogether for a single item.</p>
<p>If memory really is a problem, you might want to forget about using object instances at the low-level. Instead use a larger data structure at a larger level of granularity.</p>
| 8,134
|
<p>I need debug some old code that uses a Hashtable to store response from various threads.</p>
<p>I need a way to go through the entire Hashtable and print out both keys and the data in the Hastable.</p>
<p>How can this be done?</p>
|
<pre><code>foreach(string key in hashTable.Keys)
{
Console.WriteLine(String.Format("{0}: {1}", key, hashTable[key]));
}
</code></pre>
|
<p>This should work for pretty much every version of the framework...</p>
<pre><code>foreach (string HashKey in TargetHash.Keys)
{
Console.WriteLine("Key: " + HashKey + " Value: " + TargetHash[HashKey]);
}
</code></pre>
<p>The trick is that you can get a list/collection of the keys (or the values) of a given hash to iterate through.</p>
<p>EDIT: Wow, you try to pretty your code a little and next thing ya know there 5 answers... 8^D</p>
| 5,525
|
<p>Most of our Eclipse projects have multiple source folders, for example:</p>
<ul>
<li>src/main/java</li>
<li>src/test/java</li>
</ul>
<p>When you right-click on a class and choose New JUnit Test, the default source folder for the new test is "src/main/java" (presumably the first source folder listed in the project properties).</p>
<p>Is there any way to change the default source folder for new JUnit tests, so that when I do the above action, the new test will be created in say the "src/test/java" folder by default?</p>
|
<p>I use <a href="http://moreunit.sourceforge.net/" rel="noreferrer">moreUnit</a>, an Eclipse plugin to assist writing unit tests. Among other features, it lets you configure the default source folder of tests.</p>
|
<p>Now you can use my fast code eclipse plug-in. With this plug-in you can configure the test path to be <code>src/test/java</code> only once. It also has a jump to the unit test feature. It is available at : <a href="http://fast-code.sourceforge.net/" rel="nofollow">http://fast-code.sourceforge.net/</a>.</p>
| 9,451
|
<p>How does the <strong>open-source/free software community</strong> develop drivers for products that offer no documentation?</p>
|
<p>How do you reverse engineer something?</p>
<ul>
<li>You observe the input and output, and develop a set of rules or models that describe the operation of the object.</li>
</ul>
<p>Example:</p>
<p>Let's say you want to develop a USB camera driver. The "black box" is the software driver.</p>
<ol>
<li>Develop hooks into the OS and/or driver so you can see the inputs and outputs of the driver</li>
<li>Generate typical inputs, and record the outputs</li>
<li>Analyze the outputs and synthesize a model that describes the relationship between the input and output</li>
<li>Test the model - put it in place of the black box driver, and run your tests</li>
<li>If it does everything you need, you're done, if not rinse and repeat</li>
</ol>
<p>Note that this is just a regular problem solving/scientific process. For instance, weather forecasters do the same thing - they observe the weather, test the current conditions against the model, which predicts what will happen over the next few days, and then compare the model's output to reality. When it doesn't match they go back and adjust the model.</p>
<p>This method is slightly safer (legally) than clean room reverse engineering, where someone actually decompiles the code, or disassembles the product, analyzes it thoroughly, and makes a model based on what they saw. Then the model (<em>AND NOTHING ELSE</em>) is passed to the developers replicating the functionality of the product. The engineer who took the original apart, however, cannot participate because he might bring copyrighted portions of the code/design and inadvertently put them in the new code.</p>
<p>If you never disassemble or decompile the product, though, you should be in legally safe waters - the only problem left is that of patents.</p>
<p>-Adam</p>
|
<p>This is a pretty vague question, but I would say <a href="http://en.wikipedia.org/wiki/Reverse_engineering" rel="nofollow noreferrer">reverse engineering</a>. How they go about that is dependent on what kind of device it is and what is available for it. In many cases the device may have a similar core chipset to another device that can be modified to work.</p>
| 8,372
|
<p>The following will cause infinite recursion on the == operator overload method</p>
<pre><code> Foo foo1 = null;
Foo foo2 = new Foo();
Assert.IsFalse(foo1 == foo2);
public static bool operator ==(Foo foo1, Foo foo2) {
if (foo1 == null) return foo2 == null;
return foo1.Equals(foo2);
}
</code></pre>
<p>How do I check for nulls?</p>
|
<p>Use <code>ReferenceEquals</code>:</p>
<pre><code>Foo foo1 = null;
Foo foo2 = new Foo();
Assert.IsFalse(foo1 == foo2);
public static bool operator ==(Foo foo1, Foo foo2) {
if (object.ReferenceEquals(null, foo1))
return object.ReferenceEquals(null, foo2);
return foo1.Equals(foo2);
}
</code></pre>
|
<p>You can try to use an object property and catch the resulting NullReferenceException. If the property you try is inherited or overridden from Object, then this works for any class.</p>
<pre><code>public static bool operator ==(Foo foo1, Foo foo2)
{
// check if the left parameter is null
bool LeftNull = false;
try { Type temp = a_left.GetType(); }
catch { LeftNull = true; }
// check if the right parameter is null
bool RightNull = false;
try { Type temp = a_right.GetType(); }
catch { RightNull = true; }
// null checking results
if (LeftNull && RightNull) return true;
else if (LeftNull || RightNull) return false;
else return foo1.field1 == foo2.field2;
}
</code></pre>
| 9,943
|
<p>What does the following Guile scheme code do?</p>
<pre><code>(eq? y '.)
(cons x '.)
</code></pre>
<p>The code is not valid in MzScheme, is there a portable equivalent across scheme implementations?</p>
<p>I am trying to port this code written by someone else. Guile seems to respond to '. with #{.}#, but I'm not sure what it means or how to do this in another scheme.</p>
|
<p>Okay, it seems that '. is valid syntax for (string->symbol ".") in Guile, whereas MzScheme at least requires |.| for the period as a symbol.</p>
|
<p>I'm surprised any Scheme system will accept a dot symbol at all. My advice is to use another symbol as (I'm sure you're aware) the dot is a shorthand to represent a pair, and even if you can find a Scheme that will take your code you will likely confuse anyone that has the unfortunate task of actually reading your code.</p>
| 9,007
|
<p>Can anyone point me to a good introduction to coding against the paypal API?</p>
|
<p>Found this article by Rick Strahl recently <a href="http://www.west-wind.com/presentations/PayPalIntegration/PayPalIntegration.asp" rel="noreferrer">http://www.west-wind.com/presentations/PayPalIntegration/PayPalIntegration.asp</a>. </p>
<p>Have not implemeted anything from it yet, Rick has quite a few articles around the web on ecommerce in aspnet, and he seems to show up everytime I'm searching for it.</p>
|
<p>I don't know what your needs are, but you might want to consider <a href="http://code.google.com/apis/checkout/samples/Google_Checkout_Sample_Code_NET.html" rel="nofollow noreferrer">Google Checkout</a>. <a href="http://www.joeaudette.com/paypal-sandbox-doesnt-work.aspx" rel="nofollow noreferrer">Joe Audette</a> was having considerable difficulty integrating PayPal.</p>
<p>I've <a href="http://www.obtusesoft.com" rel="nofollow noreferrer">used</a> Google Checkout and have had great success. Note that you can go much, MUCH deeper with Google Checkout than the sample linked above.</p>
<hr>
<p>EDIT: I didn't see Joe's updates. Look like he did eventually get it working.</p>
| 7,649
|
<p>I know Windows Vista (and XP) cache recently loaded DLL's in memory...</p>
<p>How can this be disabled via the command prompt?</p>
|
<p>The only thing you can do is disable SuperFetch, which can be done from the command prompt with this command (there has to be a space between the = sign and disabled).</p>
<pre><code>sc config Superfetch start= disabled
</code></pre>
<p>There is a myth out there that you can disable DLL caching, but that only worked for systems prior to Windows 2000. [<a href="http://msdn.microsoft.com/en-us/library/bb776795.aspx" rel="noreferrer">source</a>]</p>
|
<p>Perhaps it would be helpful to know why you want to do this and then try to help solve the original problem...</p>
| 5,709
|
<p>Where can I find the redistributable version of the IBM DB2 Type 4 driver?
I suppose this is the driver I would use to connect from a Java app (on windows) to DB2 on the mainframe?</p>
|
<p><a href="http://www-01.ibm.com/support/docview.wss?rs=71&uid=swg21288110" rel="noreferrer">IBM's Fix pack site</a> has the "IBM Data Server Driver for JDBC and SQLJ" which is nothing but the JDBC type 4 driver. Though the page I pointed to above happens to be the windows page, it's the same type 4 driver for all platforms, as should be expected.</p>
<p>I don't think any user/password is required.</p>
|
<p>If I need any IBM JARs for DB2 or MQ, I usually just add it to the instructions that DB2 or MQ needs to be installed as a prerequisite along with a URL to download it.</p>
<p>The same goes for Java and many other not easily redistributable products as well.</p>
<p>This eliminates the need to worry about licensing issues as it would be on the onus of the user rather than the vendor to obtain the proper licenses.</p>
| 6,883
|
<ol>
<li><p>Is it possible to 3D print multiple 0.1 mm high layers with a 0.4 mm diameter nozzle in FDM while ensuring fidelity to the set layer height? The raster width is set at 0.4 mm and I am not touching that. The part thickness is 3 mm, so 30 layers of 0.1 mm have to be deposited for the completion of the print job. My polymer is PLA.</p>
</li>
<li><p>If not, should I be using a 0.2 mm diameter nozzle for this purpose?</p>
</li>
<li><p>Can a 0.4 mm print nozzle print rasters with higher width (0.5 mm, 0.6 mm, etc.)?</p>
</li>
</ol>
|
<ol>
<li><p>Yes, absolutely. I believe the original sample file that came with the Ender 3 (0.4 mm nozzle) was sliced for 0.1 mm layer height. As long as your printer can get decently precise Z positioning at 0.1 mm increments, it should be able to do it.</p>
</li>
<li><p>I've never used smaller nozzles but they pose challenges that make them unattractive. It's hard to flow material through such a small opening, so you have to go slow and use narrow line widths. This may make sense for really small parts, but even then there are tradeoffs.</p>
</li>
<li><p>Yes, you can print lines wider than the nozzle, up to at least the width of the flat end of the nozzle, and with slightly reduced quality, even beyond that. Lost in Tech on YouTube has several videos showing his results doing this with very wide lines, up to nearly 2 mm if I recall. For 25% to 50% over the nozzle width, it's no problem at all, and a lot of people even recommend doing that. Wider lines improve overhang quality and part strength, but may compromise the ability to print fine detail.</p>
</li>
</ol>
|
<p>The <a href="https://blog.prusaprinters.org/everything-about-nozzles-with-a-different-diameter_8344/" rel="nofollow noreferrer">general consensus for nozzle diameter versus layer height</a> is to limit the layer thickness to eighty percent of the nozzle diameter. For a 0.4 mm nozzle, one usually limits the layer to 0.3 mm. The printer on which the nozzle is installed will determine the minimum layer thickness, often a typical value of 0.10 mm. I have printed successfully to 0.10 mm layer thickness with a 0.40 mm nozzle.</p>
<p>The linked site says just about the same as above, but also provides useful information regarding appearance, speed, strength, etc.</p>
<p>With a "next size up" nozzle of 0.6 mm, you'd want to limit the layer height to 0.48 mm but you might get away with 0.50 mm layers as there is some wiggle woom.</p>
<p>For 0.8 mm nozzle, you can get your 0.60 mm layers as the max for that nozzle is 0.64 mm.</p>
<p>The article also references that one can print wider than nozzle dimensions by increasing the extrusion factor, which may go by other terms, depending on the slicer used.</p>
| 2,118
|
<p>Is there a way to use <code>JQuery</code> to cloak or encrypt email addresses on an <code>HTML</code> page without changing the syntax in the <code>href</code>?</p>
|
<p>Using JQuery may not be the route you want to take since this would be on the client side... Is there a reason you're not encrypting on server side?</p>
|
<p>Semantic nazis would say "encoding", not "encrypting". Encrypting implies a secret is required to decode. Converting to <a href="http://www.asciitable.com/" rel="nofollow noreferrer">HTML entity syntax</a> would be a decent <em>encoding</em> process to keep out prying humans, but bots could easily decode it.</p>
| 6,861
|
<p>Anybody have a good example how to deep clone a WPF object, preserving databindings?</p>
<hr>
<p>The marked answer is the first part.</p>
<p>The second part is that you have to create an ExpressionConverter and inject it into the serialization process. Details for this are here:<br>
<a href="http://www.codeproject.com/KB/WPF/xamlwriterandbinding.aspx?fid=1428301&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2801571" rel="noreferrer">http://www.codeproject.com/KB/WPF/xamlwriterandbinding.aspx?fid=1428301&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2801571</a></p>
|
<p>The simplest way that I've done it is to use a XamlWriter to save the WPF object as a string. The Save method will serialize the object and all of its children in the logical tree. Now you can create a new object and load it with a XamlReader.</p>
<p>ex:
Write the object to xaml (let's say the object was a Grid control):</p>
<pre><code>string gridXaml = XamlWriter.Save(myGrid);
</code></pre>
<p>Load it into a new object:</p>
<pre><code>StringReader stringReader = new StringReader(gridXaml);
XmlReader xmlReader = XmlReader.Create(stringReader);
Grid newGrid = (Grid)XamlReader.Load(xmlReader);
</code></pre>
|
<p>How about:</p>
<pre><code> public static T DeepClone<T>(T from)
{
using (MemoryStream s = new MemoryStream())
{
BinaryFormatter f = new BinaryFormatter();
f.Serialize(s, from);
s.Position = 0;
object clone = f.Deserialize(s);
return (T)clone;
}
}
</code></pre>
<p>Of course this deep clones any object, and it might not be the fastest solution in town, but it has the least maintenance... :)</p>
| 5,250
|
<p>Occasionally, I've come across a webpage that tries to pop open a new window (for user input, or something important), but the popup blocker prevents this from happening.</p>
<p>What methods can the calling window use to make sure the new window launched properly?</p>
|
<p>If you use JavaScript to open the popup, you can use something like this:</p>
<pre><code>var newWin = window.open(url);
if(!newWin || newWin.closed || typeof newWin.closed=='undefined')
{
//POPUP BLOCKED
}
</code></pre>
|
<p>By using onbeforeunload event we can check as follows</p>
<pre><code> function popup()
{
var chk=false;
var win1=window.open();
win1.onbeforeunload=()=>{
var win2=window.open();
win2.onbeforeunload=()=>{
chk=true;
};
win2.close();
};
win1.close();
return chk;
}
</code></pre>
<p>it will open 2 black windows in background</p>
<p>the function returns boolean value.</p>
| 2,507
|
<p>How can I show a web page in a transparent window and have the white part of the web page also transparent.</p>
|
<p>The solution is as follows.</p>
<p>Use Python module <a href="https://docs.python.org/3/library/zipfile.html" rel="noreferrer">zipfile</a> to create zip archive, but as the file specify <a href="https://docs.python.org/3/library/io.html#io.StringIO" rel="noreferrer">StringIO</a> object (ZipFile constructor requires file-like object). Add files you want to compress. Then in your Django application return the content of StringIO object in <code>HttpResponse</code> with mimetype set to <code>application/x-zip-compressed</code> (or at least <code>application/octet-stream</code>). If you want, you can set <code>content-disposition</code> header, but this should not be really required.</p>
<p>But beware, creating zip archives on each request is bad idea and this may kill your server (not counting timeouts if the archives are large). Performance-wise approach is to cache generated output somewhere in filesystem and regenerate it only if source files have changed. Even better idea is to prepare archives in advance (eg. by cron job) and have your web server serving them as usual statics.</p>
|
<p>Can't you just write a link to a "zip server" or whatnot? Why does the zip archive itself need to be served from Django? A 90's era CGI script to generate a zip and spit it to stdout is really all that's required here, at least as far as I can see.</p>
| 9,300
|
<p>Has someone experiment RDF storage solution like <a href="http://www.openrdf.org/" rel="nofollow noreferrer">Sesame</a>? I'm looking for performance review of this kind of solution compared to the traditional database solution.</p>
|
<p>There are plenny scalabity reports and benchmarks on the web about various triple-stores. </p>
<p>Here is a fine <a href="http://simile.mit.edu/reports/stores/" rel="noreferrer">scalability report</a>.</p>
<p>W3C itself maintain a wiki with lots of information about <a href="http://esw.w3.org/topic/LargeTripleStores" rel="noreferrer">Large Triplestores</a> and <a href="http://esw.w3.org/topic/RdfStoreBenchmarking" rel="noreferrer">Benchmarks</a>.</p>
<p>Follow these 3 links and take a time to read it. It's very informative. :)</p>
|
<p>One intuition is that if you have a very large number of entities, tuple stores can save yourself the trouble of having your indexes routinely knocked out of memory as you switch between tables, and instead always have the first couple levels of the tuple index in RAM.</p>
| 3,844
|
<p>Does anyone know how I can, in platform-independent C++ code prevent an object from being created on the heap? That is, for a class "Foo", I want to prevent users from doing this:</p>
<pre><code>Foo *ptr = new Foo;
</code></pre>
<p>and only allow them to do this:</p>
<pre><code>Foo myfooObject;
</code></pre>
<p>Does anyone have any ideas?</p>
<p>Cheers,</p>
|
<p><a href="https://stackoverflow.com/questions/10985/how-to-prevent-an-object-being-created-on-the-heap#11003">Nick's answer</a> is a good starting point, but incomplete, as you actually need to overload:</p>
<pre><code>private:
void* operator new(size_t); // standard new
void* operator new(size_t, void*); // placement new
void* operator new[](size_t); // array new
void* operator new[](size_t, void*); // placement array new
</code></pre>
<p>(Good coding practice would suggest you should also overload the delete and delete[] operators -- I would, but since they're not going to get called it isn't <em>really</em> necessary.) </p>
<p><a href="https://stackoverflow.com/questions/10985/how-to-prevent-an-object-being-created-on-the-heap#11018">Pauldoo</a> is also correct that this doesn't survive aggregating on Foo, although it does survive inheriting from Foo. You could do some template meta-programming magic to HELP prevent this, but it would not be immune to "evil users" and thus is probably not worth the complication. Documentation of how it should be used, and code review to ensure it is used properly, are the only ~100% way.</p>
|
<p>Not sure if this offers any compile-time opportunities, but have you looked at overloading the 'new' operator for your class?</p>
| 3,218
|
<p>I have make a little test with 4 dots aligned with A tower, B and C tower. Distance W and S are the same in the stl but not in the print. I have tried diferent values of diagonal root but S always is smaller than W, and all S are equal (more or less 38.20mm) and all W are equal (more or less 40.80). I expect that W and S will be 40mm. How can fix this problem?</p>
<p><a href="https://i.stack.imgur.com/hkUAj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hkUAj.png" alt="enter image description here"></a></p>
<p><strong>Update:</strong></p>
<p>Here is the stl I use: <a href="https://www.dropbox.com/s/2vwjbo387cmk5qa/DeltaCalibration%20v15.stl?dl=0" rel="noreferrer">https://www.dropbox.com/s/2vwjbo387cmk5qa/DeltaCalibration%20v15.stl?dl=0</a></p>
<p><strong>Update:</strong>
I have replaced the steper motor in tower B but same result.</p>
|
<p>I bet your towers are not standing straight (vertical) or
your bed is not clearly horizontal</p>
<p>I've recreated your picture with some assumptions (for example that your SW calculates properly and your steppers and motors act well).</p>
<p>Take a look here:
<a href="https://i.stack.imgur.com/O4lKx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O4lKx.png" alt="enter image description here" /></a></p>
<p>If you deliver your printer dimensions</p>
<ul>
<li>tower height (from the base)</li>
<li>tower distance from the center</li>
<li>bed distance (height) from the base</li>
</ul>
<p>I can calculate what the inclination angle on all towers is, but, I suppose it's not really important.</p>
<p>The important thing is to set them straight/vertical (perpendicular to the bed).</p>
<p>We can see from the picture that tower A is the most inclined to the center or
the bed highest point is next to tower A (and I bet one of those or both cause the issue).</p>
<p>As an example, I've made some calculations based on imagined assuptions of the tower height
here are details:</p>
<pre><code> towerH | inclination
-----------+----------------
300 mm | 0.11°
400 mm | 0.08°
500 mm | 0.06°
</code></pre>
<p>It seems to be quite small but in fact your differences in dimensions are also small!</p>
<p>The inclination of tower B is bigger as there is bigger difference in dimensions, so maybe the issue is more in bed "horizontality".</p>
<p>It would be good if you would check and measure these parameters.</p>
<p>As for the explanation why bed the inclination causes dimension distortion:</p>
<p><a href="https://i.stack.imgur.com/4jfG1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4jfG1.png" alt="enter image description here" /></a></p>
<p>This is exaggerated but it's just to show the issue.</p>
|
<p>Well, you have two main issues:</p>
<p><strong>1.-</strong> Your calculation for stepping is a little wrong, for example your firmware indicates 2315.84 when you need 2321.70 (REMEMBER this is an example and is not accurate), So you will see a diference about 2.0mm along your printing. If your printing is bigger more diference you will get.</p>
<p><strong>2.-</strong> Misalignment, your printer is not angled correctly to 90° and also Z axe if has the same condition. with this uncalibrated parameter are you going to have pisa towers on every tall part.
For delta Printers this not apply</p>
<p><strong>3.-</strong> Tension. Your belts are a little weak; avoid weak tension band to eliminate something called backslash, of course this is for screw parts but is the same efect and even bigger. Also you will get an accurate dimension of the parts.</p>
| 687
|
<p>I seem to be missing something about LINQ. To me, it looks like it's taking some of the elements of SQL that I like the least and moving them into the C# language and using them for other things.</p>
<p>I mean, I could see the benefit of using SQL-like statements on things other than databases. But if I wanted to write SQL, well, why not just write SQL and keep it out of C#? What am I missing here?</p>
|
<p>LINQ is not about SQL. LINQ is about being apply functional programming paradigmns on objects.</p>
<p>LINQ to SQL is an ORM built ontop of the LINQ foundation, but LINQ is much more. I don't use LINQ to SQL, yet I use LINQ all the time.</p>
<p>Take the task of finding the intersection of two lists:</p>
<p>Before LINQ, this tasks requires writing a nested foreach that iterates the small list once for every item in the big list O(N*M), and takes about 10 lines of code.</p>
<pre><code>foreach (int number in list1)
{
foreach (int number2 in list2)
{
if (number2 == number)
{
returnList.add(number2);
}
}
}
</code></pre>
<p>Using LINQ, it does the same thing in one line of code:</p>
<pre><code>var results = list1.Intersect(list2);
</code></pre>
<p>You'll notice that doesn't look like LINQ, yet it is. You don't need to use the expression syntax if you don't want to.</p>
|
<p>The point is that LINQ integrates your queries into your primary programming language, allowing your IDE to provide you with some facilities (Intellisense and debug support, for example) that you otherwise would not have, and to allow the compiler to type-check your SQL code (which is impossible with a normal string query).</p>
| 4,151
|
<p>I am trying to read a single file from a <code>java.util.zip.ZipInputStream</code>, and copy it into a <code>java.io.ByteArrayOutputStream</code> (so that I can then create a <code>java.io.ByteArrayInputStream</code> and hand that to a 3rd party library that will end up closing the stream, and I don't want my <code>ZipInputStream</code> getting closed).</p>
<p>I'm probably missing something basic here, but I never enter the while loop here:</p>
<pre><code>ByteArrayOutputStream streamBuilder = new ByteArrayOutputStream();
int bytesRead;
byte[] tempBuffer = new byte[8192*2];
try {
while ((bytesRead = zipStream.read(tempBuffer)) != -1) {
streamBuilder.write(tempBuffer, 0, bytesRead);
}
} catch (IOException e) {
// ...
}
</code></pre>
<p>What am I missing that will allow me to copy the stream?</p>
<p><strong>Edit:</strong></p>
<p>I should have mentioned earlier that this <code>ZipInputStream</code> is not coming from a file, so I don't think I can use a <code>ZipFile</code>. It is coming from a file uploaded through a servlet.</p>
<p>Also, I have already called <code>getNextEntry()</code> on the <code>ZipInputStream</code> before getting to this snippet of code. If I don't try copying the file into another <code>InputStream</code> (via the <code>OutputStream</code> mentioned above), and just pass the <code>ZipInputStream</code> to my 3rd party library, the library closes the stream, and I can't do anything more, like dealing with the remaining files in the stream.</p>
|
<p>Your loop looks valid - what does the following code (just on it's own) return?</p>
<pre><code>zipStream.read(tempBuffer)
</code></pre>
<p>if it's returning -1, then the zipStream is closed before you get it, and all bets are off. It's time to use your debugger and make sure what's being passed to you is actually valid.</p>
<p>When you call getNextEntry(), does it return a value, and is the data in the entry meaningful (i.e. does getCompressedSize() return a valid value)? IF you are just reading a Zip file that doesn't have read-ahead zip entries embedded, then ZipInputStream isn't going to work for you.</p>
<p>Some useful tidbits about the Zip format:</p>
<p>Each file embedded in a zip file has a header. This header can contain useful information (such as the compressed length of the stream, it's offset in the file, CRC) - or it can contain some magic values that basically say 'The information isn't in the stream header, you have to check the Zip post-amble'.</p>
<p>Each zip file then has a table that is attached to the end of the file that contains all of the zip entries, along with the real data. The table at the end is mandatory, and the values in it must be correct. In contrast, the values embedded in the stream do not have to be provided.</p>
<p>If you use ZipFile, it reads the table at the end of the zip. If you use ZipInputStream, I suspect that getNextEntry() attempts to use the entries embedded in the stream. If those values aren't specified, then ZipInputStream has no idea how long the stream might be. The inflate algorithm is self terminating (you actually don't need to know the uncompressed length of the output stream in order to fully recover the output), but it's possible that the Java version of this reader doesn't handle this situation very well.</p>
<p>I will say that it's fairly unusual to have a servlet returning a ZipInputStream (it's much more common to receive an inflatorInputStream if you are going to be receiving compressed content.</p>
|
<p>Check if the input stream is positioned in the begging.</p>
<p>Otherwise, as implementation: I do not think that you need to write to the result stream while you are reading, unless you process this exact stream in another thread.</p>
<p>Just create a byte array, read the input stream, then create the output stream.</p>
| 9,285
|
<p>Can anyone recommend a good (preferably open source) tool for creating WSDL files for some soap web services?</p>
<p>I've tried playing around with some of the eclipse plug ins available and was less than impressed with what I found.</p>
|
<p>As mentioned above, probably the easiest thing to do is use Apache CXF or Apache Axis2 to automatically generate your WSDL for you.</p>
<p>If you have downloaded the Java EE version of Eclipse, you should be able to create a Dynamic Web Project with the Axis2 facets. If you create a simple Java class in the project, you should be able to right-click on it, and choose Web Services->Create Web Service. That should automatically create an Axis2 service for you.</p>
<p>WSDL would then be available from some URL like: <code>http://localhost/axis/{yourservice}?WSDL</code></p>
|
<p>Depends on which language you're working in, but if you're active in Java then I'd recommend looking at <a href="http://cxf.apache.org/" rel="nofollow noreferrer">Apache CXF</a>. It's a pretty solid framework for publishing java code as a SOAP web service. It also includes a tool for directly generating WSDL files: <a href="http://cwiki.apache.org/CXF20DOC/java-to-wsdl.html" rel="nofollow noreferrer">java2wsdl</a></p>
| 9,842
|
<p>I'm printing on an Ender 5 with the default flex/magnetic build surface.
I read that PLA and PETG may sometimes be printed without any bed heating at all and also that bed heating is the main contributor to the power consumption of a printer.</p>
<p>As I do see that bed heating definitely helps with the first layer adhesion I did not want to turn it off completely, but I did start experimenting with turning off bed heating after all solid bottom layers have printed (using the ChangeAtZ script in Cura) and so far I haven't seen any negative effects, especially no warping (I am usually printing with a brim or raft; I think that might also help in that regard).</p>
<p>Am I missing something? Why is <em>anyone</em> keeping the bed heated for an entire print?</p>
|
<p>There are three reasons (I can think of):</p>
<ol>
<li><p>A large problem you'd face with allowing the bed to cool after first layer is you stand the chance of losing adhesion after it cools. When you heat the bed, it expands somewhat. When it cools it contracts. It has been known for parts to actually pop off the bed if left on there to cool (after a print). If you allow the bed to cool fully, you could ruin a print due to it losing the adhesion, popping off the bed, then the printer keeps on going. </p></li>
<li><p>When you're dealing with 0.1 mm layer height, that's not a lot of wiggle room. When you level your bed before printing, it should be done after everything is heated. If you were to turn off the bed after you start printing, you could very easily shift the bed enough to take up the worth of an entire layer, which means your print has adjusted and will then have major imperfections. This isn't a <em>given</em>, but definitely a concern ... especially for larger or taller prints.</p></li>
<li><p>Whether PLA or PETG, the extruded filament needs to have heat in order to stay. This is not only heat in the extruder, but heat in the print itself. If the print cools off, this could affect subsequent adhesion for the filament getting laid down. If you turn the bed heater off after print start, you'll lose that heated environment. The print will cool off and you'll start seeing variations in the print, which, if the print is large enough, would most likely be more noticable. Think of it as a heated environment, not just putting piling host plastic on top of each other.</p></li>
</ol>
<p>There may be other reasons, but I believe these are <em>very good</em> reasons not to turn your bed off after print start. If you are worried your power supply isn't providing enough power, then get a bigger power supply. If you're worried about power consumption overall, once the bed is heated, consumption goes way down (as @r_ahlskog stated in their answer). </p>
|
<p>A way to save energy would be use a pretty tight enclosure around the printer, I think a pretty thin layer of insulation would be enough to reduce power usage by a large factor. I've not build one myself yet but there seems to be so many benefits.</p>
| 1,426
|
<p>How do you convert decimal values to their hexadecimal equivalent in JavaScript?</p>
|
<p>Convert a number to a hexadecimal string with:</p>
<pre><code>hexString = yourNumber.toString(16);
</code></pre>
<p>And reverse the process with:</p>
<pre><code>yourNumber = parseInt(hexString, 16);
</code></pre>
|
<p>Here's my solution:</p>
<pre><code>hex = function(number) {
return '0x' + Math.abs(number).toString(16);
}
</code></pre>
<p>The question says: <em>"How to convert decimal to hexadecimal in JavaScript"</em>. While, the question does not specify that the hexadecimal string should begin with a 0x prefix, anybody who writes code should know that 0x is added to hexadecimal codes to distinguish <em>hexadecimal codes</em> from <em>programmatic identifiers</em> and <em>other numbers</em> (1234 could be hexadecimal, decimal, or even octal).</p>
<p>Therefore, to correctly answer this question, for the purpose of script-writing, you must add the 0x prefix.</p>
<p>The Math.abs(N) function converts negatives to positives, and as a bonus, it doesn't look like somebody ran it through a wood-chipper.</p>
<p>The answer I wanted, would have had a field-width specifier, so we could for example show 8/16/32/64-bit values the way you would see them listed in a hexadecimal editing application. That, is the actual, correct answer.</p>
| 8,221
|
<p>I have a string that contains the representation of a date. It looks like: </p>
<p><strong>Thu Nov 30 19:00:00 EST 2006</strong></p>
<p>I'm trying to create a Date object using SimpleDateFormat and have 2 problems. </p>
<p>1.) I can't figure out the pattern to hard-code the solution into the SimpleDateFormat constructor</p>
<p>2.) I can't find a way I could parse the string using API to determine the pattern so I could reuse this for different patterns of date output </p>
<p>If anyone knows a solution using API or a custom solution I would greatly appreciate it.</p>
|
<p>The format to pass to SimpleDateFormat could be looked up at <a href="http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html" rel="noreferrer">http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html</a></p>
<pre><code>new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy")
</code></pre>
<p>As for your second question, I don't know of any Java library to figure out a date format and parse it without knowing in advance what the format is.</p>
|
<p>Are you just asking for the pattern for that given date? If so, I think this should do it:</p>
<pre><code>"EEE MMM d HH:mm:ss z yyyy"
</code></pre>
<p>Or are you trying to take any formatted date, and infer the format, and parse it?</p>
| 6,547
|
<p>Is it possible to determine which property of an ActiveX control is the default property? For example, what is the default property of the VB6 control CommandButton and how would I found out any other controls default!</p>
<p><strong>/EDIT:</strong> Without having source to the object itself</p>
|
<p>Use OLE/Com Object Viewer, which is distributed with Microsoft Visual Studio. </p>
<p>Go to type libraries and find the library the control is housed in, for example CommandButton is stored in <strong><em>Microsoft Forms 2.0 Object Library</em></strong>. Right click the library and select view. Find the coclass representing the control and select it:</p>
<p><img src="https://i.imgur.com/BervR.png" alt="alt text"></p>
<p>As can be seen, the default interface for CommandButton is ICommandButton, when you inspect ICommandButton look for a property that has a dispid of 0. The IDL for the dispid 0 property of CommandButton is:</p>
<pre><code>[id(00000000), propput, bindable, displaybind, hidden, helpcontext(0x001e8d04)]
void Value([in] VARIANT_BOOL rhs);
[id(00000000), propget, bindable, displaybind, hidden, helpcontext(0x001e8d04)]
VARIANT_BOOL Value();
</code></pre>
<p>Showing you the default property.</p>
|
<blockquote>
<p>you have access to the code, look for</p>
</blockquote>
<p>Unfortunetly I don't have access to the code for most of the controls. However the link is useful for the Microsoft Controls, but I still would like a way to know for other controls.</p>
| 6,279
|
<p>I own an Ender 3, it's about 3 years old and the issues I have with extrusion, leaking and filament blockage are monstrous.</p>
<p>Examples of problems like this are filament flow issues, filament blockage, and filament leaking out of the sides.</p>
<p>Problems like this take all day to fix, and in the end, they are never really fixed. Everything is so overbearingly finicky.</p>
<p>Not only that, but it seems one of its parts breaks down about every week (this may just be due to its age but I thought I would note it.)</p>
<p>It seems I run into the exact same problems every single time I 3D print. Nothing ever seems to go right. I am getting really tired of it, and I'm wondering if these kinds of problems aren't so frequent/ as big of a deal with more expensive (better) 3D printers, or if this is just normal.</p>
|
<p>No not at all. The only way to eliminate issues is to practice and break things and learning how to fix it. I have 2 CR-10s, 1 CR-10S5, 1 CR-10 MINI, and 2 Anycubic Photons. They are all heavily modified, and the one thing i learned is that modifications only add to the problems</p>
|
<p>I use a German RepRap printer, which is very expensive compared to many of the printers in the questions on this list. I still see similar printing issues on a RepRap to other printers. The settings often control the issues. The RepRap however has a much larger print area that most of the printers referred to on this list.</p>
| 2,052
|
<p>Moving through the maze forward is pretty easy, but I can't seem to figure out how to back up through the maze to try a new route once you hit a dead end without going back too far?</p>
|
<p>Use <a href="http://www.cs.bu.edu/teaching/alg/maze/" rel="nofollow noreferrer">backtracking</a> by keeping a stack of previous direction decisions.</p>
|
<p>Eric Lippert did a series of articles on creating a <a href="http://blogs.msdn.com/ericlippert/archive/tags/AStar/default.aspx" rel="nofollow noreferrer">C# implemention of A*</a>, which might be more efficient.</p>
| 6,164
|
<p>I'm wondering how to make a release build that includes all necessary dll files into the .exe so the program can be run on a non-development machine without it having to install the microsoft redistributable on the target machine.</p>
<p>Without doing this you get the error message that the application configuration is not correct and to reinstall.</p>
|
<ol>
<li>Choose Project -> Properties</li>
<li>Select Configuration -> General</li>
<li>In the box for how you should link MFC, choose to statically link it.</li>
<li>Choose Linker -> Input. Under <strong>Additional Dependencies</strong>, add any libraries you need your app to statically link in.</li>
</ol>
|
<p>You'd be looking to static link (as opposed to dynamically link)</p>
<p>I'm not sure how many of the MS redistributables statically link in.</p>
| 2,540
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.