instruction
stringlengths 27
22.5k
| chosen
stringlengths 27
28.2k
| rejected
stringlengths 19
24.9k
| __index_level_0__
int64 0
10k
|
|---|---|---|---|
<p>Let's say I have committed some bad changes to Subversion repository. Then I commit good changes, that I want to keep.</p>
<p>What would be easiest way to roll back those bad changes in Eclipse, and keep the good changes? Assuming that files relating to bad changes are not same as those relating to the good changes. How things change if good changes were made to same files as bad changes?</p>
<p>I am mostly looking a way to do this via Eclipse plugins (Subclipse or Subversive) but commandline commands are also interesting.</p>
|
<p>You have two choices to do this.</p>
<p>The Quick and Dirty is selecting your files (using <kbd>ctrl</kbd>) in Project Explorer view, right-click them, choose <code>Replace with...</code> and then you choose the best option for you, from <code>Latest from Repository</code>, or some <code>Branch</code> version. After getting those files you modify them (with a space, or fix something, your call and commit them to create a newer revision. </p>
<p>A more clean way is choosing <code>Merge</code> at team menu and navigate through the wizard that will help you to recovery the old version in the actual revision.</p>
<p>Both commands have their command-line equivalents: <code>svn revert</code> and <code>svn merge</code>.</p>
|
<p>I have same problem but CleanUp eclipse option doesn't work for me.</p>
<p>1) install TortoiseSVN <br>
2) Go to windows explorer and right click on your project directory<br>
3 Choice CleanUp option (by checking break lock option)<br></p>
<p>It's works.</p>
<p>Hope this helps someone.</p>
| 5,659
|
<p>I'm about to start a fairly Ajax heavy feature in my company's application. What I need to do is make an Ajax callback every few minutes a user has been on the page. </p>
<ul>
<li>I don't need to do any DOM updates before, after, or during the callbacks. </li>
<li>I don't need any information from the page, just from a site cookie which should always be sent with requests anyway, and an ID value.</li>
</ul>
<p>What I'm curious to find out, is if there is any clean and simple way to make a JavaScript Ajax callback to an ASP.NET page without posting back the rest of the information on the page. I'd like to not have to do this if it is possible.</p>
<p>I really just want to be able to call a single method on the page, nothing else.</p>
<p>Also, I'm restricted to ASP.NET 2.0 so I can't use any of the new 3.5 framework ASP AJAX features, although I can use the ASP AJAX extensions for the 2.0 framework.</p>
<p><strong>UPDATE</strong><br>
I've decided to accept <a href="https://stackoverflow.com/questions/27258/aspnet-javascript-callbacks-without-full-postbacks#27270">DanP</a>'s answer as it seems to be exactly what I'm looking for. Our site already uses jQuery for some things so I'll probably use jQuery for making requests since in my experience it seems to perform much better than ASP's AJAX framework does. </p>
<p>What do you think would be the best method of transferring data to the IHttpHandler? Should I add variables to the query string or POST the data I need to send?</p>
<p>The only thing I think I have to send is a single ID, but I can't decide what the best method is to send the ID and have the IHttpHandler handle it. I'd like to come up with a solution that would prevent a person with basic computer skills from accidentally or intentionally accessing the page directly or repeating requests. Is this possible?</p>
|
<p>If you don't want to create a blank page, you could call a IHttpHandler (ashx) file:</p>
<pre><code>public class RSSHandler : IHttpHandler
{
public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "text/xml";
string sXml = BuildXMLString(); //not showing this function,
//but it creates the XML string
context.Response.Write( sXml );
}
public bool IsReusable
{
get { return true; }
}
}
</code></pre>
|
<p>You can also use WebMethods which are built into the asp.net ajax library. You simply create a static method on the page's codebehind and call that from your Ajax.</p>
<p>There's a pretty basic example of how to do it <a href="https://web.archive.org/web/20200803212711/http://geekswithblogs.net/frankw/archive/2008/03/13/asp.net-ajax-callbacks-to-web-methods-in-aspx-pages.aspx" rel="nofollow noreferrer">here</a></p>
| 4,691
|
<p>Is there a performant equivalent to the isnull function for DB2?</p>
<p>Imagine some of our products are internal, so they don't have names:</p>
<pre><code>Select product.id, isnull(product.name, "Internal)
From product
</code></pre>
<p>Might return:</p>
<pre><code>1 Socks
2 Shoes
3 Internal
4 Pants
</code></pre>
|
<p>For what its worth, COALESCE is similiar but </p>
<pre><code>IFNULL(expr1, default)
</code></pre>
<p>is the exact match you're looking for in DB2. </p>
<p>COALESCE allows multiple arguments, returning the first NON NULL expression, whereas IFNULL only permits the expression and the default.</p>
<p>Thus</p>
<pre><code>SELECT product.ID, IFNULL(product.Name, "Internal") AS ProductName
FROM Product
</code></pre>
<p>Gives you what you're looking for as well as the previous answers, just adding for completeness.</p>
|
<p><code>COALESCE</code> function same <code>ISNULL</code> function
Note. you must use <code>COALESCE</code> function with same data type of column that you check is null.</p>
| 9,079
|
<p>If you add a image to your browser's DOM, IE6 will not check its cache to see if it already downloaded the image but will, instead, re-retrieve it from the server. I have not found any combination of HTTP response headers (of the ensuing image request) to convince IE6 that it can cache the image: Cache-control, Expires, Last-modified.</p>
<p>Some suggest you can return a 304 of the subsequent image requests to tell IE6 "you already got it" but I want to avoid the whole round trip to the server in the first place.</p>
|
<p>Maybe <a href="http://www.mister-pixel.com/index.php?Content__state=is_that_simple" rel="nofollow noreferrer">this</a> will work? (is the same behaviour like hovering on links with css background image)</p>
|
<p>A quick google mentions the "Expires" header, which you've already tried. Digging deeper, it mentions the ETag header:</p>
<p><a href="http://mir.aculo.us/2005/08/28/internet-explorer-and-ajax-image-caching-woes" rel="nofollow noreferrer">http://mir.aculo.us/2005/08/28/internet-explorer-and-ajax-image-caching-woes</a></p>
<p>Hope this helps. </p>
| 8,801
|
<p>I just bought new TEVO Tarantula and tried to print xyz cube. I found that my cube's layer was shifted as showed in picture. How can I fix this ?</p>
<p><a href="https://i.stack.imgur.com/u53fC.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/u53fC.jpg" alt="enter image description here"></a></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>
| 773
|
<p>I'm trying to find a source control for my own personal use that's as simple as possible. The main feature I need is being able to read/pull a past version of my code. I am the only developer. I've looked at a lot of different version control systems, but they all seem way more complicated than I need. I need one that's simple, runs under Windows, and doesn't expose itself to the network.</p>
<p>Specifically, the version control system should <em>not</em> require exposing an HTTP interface, it should interact with the local filesystem only. It just needs to be a version control system geared for one guy and one guy only. Graphical UI is a plus.</p>
<p>Does anyone know of software would satisfy what I'm looking for?</p>
<p>Thanks!</p>
<p>-Mike</p>
|
<p><a href="http://subversion.tigris.org/" rel="nofollow noreferrer">Subversion</a> is great -- you can run the server yourself or use something like assembla.com to host your code (although that exposes it to the network).</p>
<p>There are numerous gui applications like <a href="http://tortoisesvn.tigris.org/" rel="nofollow noreferrer">tortoise svn</a> that would allow you to interact w/ the source control repo</p>
|
<p>You should check <a href="http://www.cvsnt.org/" rel="nofollow noreferrer">CVSNT</a> as server and use any of the clients you would like (standalone or integrated with your IDE). There are plenty of them.</p>
| 7,223
|
<p>And/or: do I need one?</p>
<p>I've recently started using FogBugz for my hobby projects, and I'm very happy with things so far. Having read more about it, especially the evidence-based scheduling, I'd like to start using it for my PhD as well. (Heh; something tells me my supervisors won't be opening tickets for me, though.)</p>
<p>Last night I stumbled onto <a href="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=9016" rel="noreferrer">TimePost</a>, which looks like a tidy app that doesn't do much but could be a real bonus to logging my time in FogBugz effectively. I tried looking around for similar apps but came up a little empty-handed. Are there any other FogBugz clients that you've used and recommend for Mac OS X? Or are you happy with the web interface?</p>
|
<p>The official answer is no, there is not a dedicated Mac client, other than Safari :)</p>
<p>There's a <a href="http://support.fogcreek.com/default.asp?W840" rel="nofollow noreferrer">command line version</a> that runs on Linux, Windows, and Mac.</p>
<p>There are also plans for an iPhone version although I'm not technically supposed to announce features before they are done or even spec'd so pretend I didn't say that.</p>
|
<p>I don't think there is any other such Mac tool. I've never found the web interface too bad personally.</p>
| 6,942
|
<p>Does anyone have experience using makefiles for Visual Studio C++ builds (under VS 2005) as opposed to using the project/solution setup. For us, the way that the project/solutions work is not intuitive and leads to configuruation explosion when you are trying to tweak builds with specific compile time flags.</p>
<p>Under Unix, it's pretty easy to set up a makefile that has its default options overridden by user settings (or other configuration setting). But doing these types of things seems difficult in Visual Studio.</p>
<p>By way of example, we have a project that needs to get build for 3 different platforms. Each platform might have several configurations (for example debug, release, and several others). One of my goals on a newly formed project is to have a solution that can have all platform build living together, which makes building and testing code changes easier since you aren't having to open 3 different solutions just to test your code. But visual studio will require 3 * (number of base configurations) configurations. i.e. PC Debug, X360 Debug, PS3 Debug, etc.</p>
<p>It seems like a makefile solution is much better here. Wrapped with some basic batchfiles or scripts, it would be easy to keep the configuration explotion to a minimum and only maintain a small set of files for all of the different builds that we have to do.</p>
<p>However, I have no experience with makefiles under visual studio and would like to know if others have experiences or issues that they can share.</p>
<p>Thanks.</p>
<p>(post edited to mention that these are C++ builds)</p>
|
<p>I've found some benefits to makefiles with large projects, mainly related to unifying the location of the project settings. It's somewhat easier to manage the list of source files, include paths, preprocessor defines and so on, if they're all in a makefile or other build config file. With multiple configurations, adding an include path means you need to make sure you update every config manually through Visual Studio's fiddly project properties, which can get pretty tedious as a project grows in size.</p>
<p>Projects which use a lot of custom build tools can be easier to manage too, such as if you need to compile pixel / vertex shaders, or code in other languages without native VS support.</p>
<p>You'll still need to have various different project configurations however, since you'll need to differentiate the invocation of the build tool for each config (e.g. passing in different command line options to make).</p>
<p>Immediate downsides that spring to mind:</p>
<ul>
<li>Slower builds: VS isn't particularly quick at invoking external tools, or even working out whether it needs to build a project in the first place.</li>
<li>Awkward inter-project dependencies: It's fiddly to set up so that a dependee causes the base project to build, and fiddlier to make sure that they get built in the right order. I've had some success getting SCons to do this, but it's always a challenge to get working well.</li>
<li>Loss of some useful IDE features: Edit & Continue being the main one!</li>
</ul>
<p>In short, you'll spend less time managing your project configurations, but more time coaxing Visual Studio to work properly with it.</p>
|
<p>You can use nant to build the projects individually thus replacing the solution and have 1 coding solution and no build solutions.</p>
<p>1 thing to keep in mind, is that the solution and csproj files from vs 2005 and up are msbuild scripts. So if you get acquainted with msbuild you might be able to wield the existing files, to make vs easier, and to make your deployment easier.</p>
| 7,506
|
<p>Up till now, I've tended to scale my first layer according to the print quality, so a 0.12 mm first layer for a 0.08 mm print, and 0.28 mm for a 0.2 mm print.</p>
<p>After changing to a PLA which isn't sticking well, I'm wondering if the first layer is best determined by the printer/tolerance/material, rather than the overall print quality settings. Am I going to get more predictable results if I stick to a 0.12 mm first layer regardless? This is with a 0.4 mm nozzle on an Anet-A8.</p>
|
<p>Default settings for first layer height in Slic3r Prusa Edition print profiles regardless layer height is 0.2 mm.</p>
<p>If you need to improve bed adhesion then try tips from this video <a href="https://www.youtube.com/watch?v=ShFaJ027pFs" rel="nofollow noreferrer">3D Prints not sticking anymore? Watch this! 3DP101</a> by Maker's Muse. It's about using glue stick and spreading it using paper towel and isopropyl alcohol. </p>
<p>There are other possibilities how to improve bed adhesion, e.g. <a href="https://shop.prusa3d.com/en/3d-printer-parts/146-replacement-pei-sheet-for-mk2s-ultem.html" rel="nofollow noreferrer">Ultem sheet</a> or other printing surface like <a href="https://www.buildtak.eu/" rel="nofollow noreferrer">BuildTak</a>.</p>
|
<p>Layer height in my cura settings means that head of extruder will be going up at 0.3mmm, and how i know that? Because i measure few different settings with height of bed.
When I set bed to -0.2mm, ike everybody is proposing on internet, and i started printing first layer, I did stop it and measure with precise caliper thickness, it was 4.2mm, (human precision with leveling bed :P ) that was for me to much, because extruded material almost was not sticking to the bed,, and walls was not connected each other.
I did test also with home position of nozzle and setting bed to touch nozzle, to 0 height. ( YEAH) And again I measure thickness of first layer. It was precise 0.3mm. Exactly as I want.
That means that or I have better software witch can take nozzle up with initial layer in cura settings?, or magical printer, but my printer is cheap and is buy'ed almost by everybody.
That means that peoples who are teaching others how to set bed in a printer are totally wrong. Maybe no one measure thickens of first layer?
Even seller from who I buy printer propose me use paper with thickens of 0.25mm to set level of the bed.</p>
<p>Previously I have problems with first layer, because that was too high from bed, now when I set 0 position of nozzle exactly with bed, I don't have problems with thickens of layer, and printed element looks allot better from bottom.</p>
| 1,003
|
<p>An odd issue that I have been trying to address in a project - my calls to WebClient.DownloadFileAsync seem to be getting ignored and no exceptions are being raised. So far I have been able to determine this might be due to destination folder not existing, but from the looks of the MSDN documentation for <a href="http://msdn.microsoft.com/en-us/library/ms144196(VS.80).aspx" rel="nofollow noreferrer">Webclient.DownloadFileAsync</a> this should still cause an exception to be raised. I did find one <a href="http://forums.msdn.microsoft.com/en-US/netfxnetcom/thread/1c046c42-5b45-43d1-9d48-65ffabd6f798/" rel="nofollow noreferrer">MSDN forum thread</a> that seems to imply that this has been known to happen, but there doesn't seem to be any resolution for it. Any ideas what might be going on?</p>
|
<p>Here are a few more resources you should check out:</p>
<ol>
<li><p>This DevExpress WinForms control: <a href="http://www.devexpress.com/Products/NET/Controls/WinForms/Wizard/" rel="nofollow noreferrer">http://www.devexpress.com/Products/NET/Controls/WinForms/Wizard/</a></p></li>
<li><p>A home-grown wizards framework: <a href="http://weblogs.asp.net/justin_rogers/articles/60155.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/justin_rogers/articles/60155.aspx</a></p></li>
<li><p>A wizard framework by Shawn Wildermut part of the Chris Sells's Genghis framework: <a href="http://www.sellsbrothers.com/tools/genghis/" rel="nofollow noreferrer">http://www.sellsbrothers.com/tools/genghis/</a></p></li>
</ol>
|
<p>The easiest way to create a wizard dialog is to use one of the third-party versions available that handle all of the "hard stuff" (the page navigation, UI framework, etc.) for you. The one I like the most is from <a href="http://www.divelements.co.uk/net/" rel="nofollow noreferrer">Divelements</a>; they have both a WinForms and a WPF version.</p>
| 5,967
|
<p>The company has the traditional complex organizational structure, defining the amount of levels using the letter 'n' rather than an actual number. I will try and express the structure I'm trying to achieve in mono-spaced font: </p>
<pre><code> Alice
,--------|-------,------,------,
Bob Fred Jack Kim Lucy
| |
Charlie Greg
Darren Henry
Eric
</code></pre>
<p>As you can see it's not symmetrical, as Jack, Kim and Lucy report to Alice but have no reports of their own. </p>
<p>Using a <code>TreeView</code> with an <code>ItemsPanel</code> containing a <code>StackPanel</code> and <code>Orientation="Horizontal"</code> is <a href="http://www.codeproject.com/KB/WPF/CustomTreeViewLayout.aspx" rel="nofollow noreferrer">easy enough</a>, but this can result in a very large <code>TreeView</code> once some people have 20 others reporting to them! You can <a href="http://www.codeproject.com/KB/WPF/AdvancedCustomTreeViewLyt.aspx" rel="nofollow noreferrer">also use</a> <code>Triggers</code> to peek into whether a <code>TreeViewItem</code> has children with <code>Property="TreeViewItem.HasItems"</code>, but this is not in the same context as the before-mentioned <code>ItemsPanel</code>. <em>Eg: I can tell that Fred has reports, but not whether they have reports of their own.</em> </p>
<p>So, can you conditionally format <code>TreeViewItems</code> to be Vertical if they have no children of their own?</p>
|
<p>Josh Smith has a excecllent CodeProject article about TreeView. Read it <a href="http://www.codeproject.com/KB/WPF/AdvancedCustomTreeViewLyt.aspx" rel="nofollow noreferrer">here</a></p>
|
<p>I did end up using tips from the linked article, which I'd already read through but didn't think would help me. </p>
<p>The meat of it happens here, in a converter: </p>
<pre><code><ValueConversion(GetType(ItemsPresenter), GetType(Orientation))> _
Public Class ItemsPanelOrientationConverter
Implements IValueConverter
Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, _
ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) _
As Object Implements System.Windows.Data.IValueConverter.Convert
'The 'value' argument should reference an ItemsPresenter.'
Dim itemsPresenter As ItemsPresenter = TryCast(value, ItemsPresenter)
If itemsPresenter Is Nothing Then
Return Binding.DoNothing
End If
'The ItemsPresenter''s templated parent should be a TreeViewItem.'
Dim item As TreeViewItem = TryCast(itemsPresenter.TemplatedParent, TreeViewItem)
If item Is Nothing Then
Return Binding.DoNothing
End If
For Each i As Object In item.Items
Dim element As StaffMember = TryCast(i, StaffMember)
If element.IsManager Then
'If this element has children, then return Horizontal'
Return Orientation.Horizontal
End If
Next
'Must be a stub ItemPresenter'
Return Orientation.Vertical
End Function
</code></pre>
<p>Which in turn gets consumed in a style I created for the TreeView: </p>
<pre><code> <Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate >
<ItemsPanelTemplate.Resources>
<local:ItemsPanelOrientationConverter x:Key="conv" />
</ItemsPanelTemplate.Resources>
<StackPanel IsItemsHost="True"
Orientation="{Binding
RelativeSource={x:Static RelativeSource.TemplatedParent},
Converter={StaticResource conv}}" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</code></pre>
| 9,536
|
<p>I understand that the <code>Ruby 1.8 AST</code> is traversed at runtime using a big switch statement, and many things like calling a method in a class or parent module involve the interpreter looking up and down the tree as it goes. Is there a straightforward way of accessing this <code>AST</code> in a <code>Ruby C</code> extension? Does it involve the Ruby extension API, or necessitate hacking the internal data structures directly?</p>
|
<p>A good starting point is probably to read the source of the <a href="http://rubyforge.org/projects/parsetree/" rel="nofollow noreferrer">ParseTree</a> library, which lets you get at and mess with the AST from ruby.</p>
|
<p>Thanks for the tip. You're right - <code>ParseTree</code> seems to be the only code out there with any manipulation of the AST going on, except that it's actually written in RubyInline. </p>
<p>So, it's a strange mixture between Ruby and C code. Very interesting reading, though.</p>
<p>The other reference of course is eval.c from Ruby itself.</p>
<p>It's going to take a fair bit of reading of both, to get my head around it.</p>
| 3,487
|
<p>I'm trying to get an event to fire whenever a choice is made from a <code>JComboBox</code>.</p>
<p>The problem I'm having is that there is no obvious <code>addSelectionListener()</code> method.</p>
<p>I've tried to use <code>actionPerformed()</code>, but it never fires.</p>
<p>Short of overriding the model for the <code>JComboBox</code>, I'm out of ideas.</p>
<p>How do I get notified of a selection change on a <code>JComboBox</code>?**</p>
<p><strong>Edit:</strong> I have to apologize. It turns out I was using a misbehaving subclass of <code>JComboBox</code>, but I'll leave the question up since your answer is good.</p>
|
<p>It should respond to <a href="http://docs.oracle.com/javase/7/docs/api/java/awt/event/ActionListener.html" rel="noreferrer">ActionListeners</a>, like this:</p>
<pre><code>combo.addActionListener (new ActionListener () {
public void actionPerformed(ActionEvent e) {
doSomething();
}
});
</code></pre>
<p><a href="https://stackoverflow.com/a/58965/1429387">@John Calsbeek</a> rightly points out that <code>addItemListener()</code> will work, too. You may get 2 <code>ItemEvents</code>, though, one for the deselection of the previously selected item, and another for the selection of the new item. Just don't use both event types!</p>
|
<p>I was recently looking for this very same solution and managed to find a simple one without assigning specific variables for the last selected item and the new selected item. And this question, although very helpful, didn't provide the solution I needed. This solved my problem, I hope it solves yours and others. Thanks.</p>
<p><a href="https://stackoverflow.com/questions/14647439/how-to-get-previous-last-item-jcombobox">How do I get the previous or last item?</a></p>
| 8,340
|
<p>My printer just stopped working. It seems like it's working perfectly, but it gives me an error whenever I move the Z-Axis (Error: Printer set into dry run mode until restart) then, the bed temperature appears to be at 293ºC when it's actually at 95ºC.</p>
<p>I suspect that the bed wires short-circuited since they got stuck behind the bed when the printer was moving Y-Axis to home (the wires blocked the movement). Since then, the error appeared. </p>
<p>I suspect that the controller board could have been harmed by the supposed short-circuit, but despite the error, I can move perfectly any axis; I can heat the bed and the extruder; I can extrude filament; it is just the error which doesn't let me print.</p>
<p><strong>Printer:</strong>
Anet A8 Desktop 3D Printer Prusa i3</p>
<p><strong>Software:</strong>
MatterHackers: MatterControl 1.7</p>
<p><strong>Update:</strong> The bed temperature is stuck at ~95ºC, sometimes ~250ºC, even if I disconnect the sensor wires and restart the printer, so apparently, it's failing to read the bed temperature.</p>
|
<p>Following on from Harvey Lim's <a href="https://3dprinting.stackexchange.com/questions/3771/commercially-available-3d-printer-fume-and-ufp-extractor#answer-3977">answer</a>, to give a concrete example of a DIY filter, which uses active carbon, see <a href="https://web.archive.org/web/20200514160332/http://www.3dprintfilemarket.com/140629194058.html" rel="nofollow noreferrer">ABS 3d Printer Nanoparticle and Chemical Exhaust Air Filter</a>:</p>
<blockquote>
<p>###Description
Enclose your 3d printer and use this exhaust air filter along with a recirculating air filter to eliminate nanoparticles and chemical fumes. 95 to 99.5% of partilces up to 0.1 micron in size are filtered before air is exhausted into your 3d printing room. This is 3 times better than HEPA filtration. Chemical fumes such as phenols, hydrogen bromide, hydrogen cyanide, and styrene are also filtered out. The amount of chemicals filtered out depends on the amount of carbon filtration media you put into the unit and the strength of the fan you install on the unit. If you are using this for business purposes, you'll have to experiment a bit to have it pass inspection. If you are using it for personal purposes, know that the human nose is extremely sensitive. People who have the gene for hydrogen cyanide detection can smell it down to a concentration of 2 to 10 ppm. Suffice it to say, that if you can smell no evil, you are probably not experiencing evil. This has totally cleared my 3d printing room of nasty fumes. I invite you to try it out for yourself as the cost is very low since I've designed it to use surgical masks and aquarium activated carbon filtration media, which is very affordable. You should change the filtration media and surgical mask every month or 50 hours of printing, whichever comes first. I offer no warranty of any kind as this is an experimental device.</p>
</blockquote>
<p>This filter is mentioned in <a href="https://3dprinting.stackexchange.com/questions/513/what-are-the-best-air-filtration-options-for-enclosures#answer-539">tbm0115's answer</a> to <a href="https://3dprinting.stackexchange.com/questions/513/what-are-the-best-air-filtration-options-for-enclosures">What are the best air filtration options for enclosures?</a></p>
|
<p>To try to answer your question, I found these enclosures on <a href="https://www.3dprintclean.com/store-1/" rel="nofollow noreferrer">3DPrintClean</a>, by browsing the Ultimaker forum. I'm not sure it fits your needs since you did not give any details about which Ultimaker you have, nor the amount of money you are willing to spend.</p>
| 553
|
<p>3D printing should be relatively safe, however, the inherent nature of 3D printers, with all of the heated parts, constitutes a fire risk. A well designed 3D printer should be designed to be as safe as possible, especially one used in the home... Yes, the recommendation is, when printing, to watch the 3D printer at all times and never leave a print unattended. However, with some print times lasting hours and days, this is not always feasible, nor practical. So, some inbuilt safety features should be included, to at least mitigate the risk of fire, to some extent.</p>
<ul>
<li><p>Is the use of thermal fuses<sup>1,2</sup> a good idea<sup>3</sup>? </p></li>
<li><p>Would you use more than one?</p></li>
<li><p>Where should one place a thermal fuse? Next to a particular component, or <em>free standing</em>, in the air, to get an average, rather than <em>highly localised</em> temperature? </p></li>
<li><p>Against which components should a thermal fuse be placed? There are a number of places to choose from, such as next to:</p>
<ul>
<li>The hotend? </li>
<li>The heated bed? </li>
<li>The extruder? </li>
<li>Each of the stepper motors? </li>
<li>The power supply? </li>
<li>The RAMPS stepper motor drivers?</li>
</ul></li>
<li><p>Of lesser import, which type should one use<sup>4</sup>, radial or axial?</p></li>
</ul>
<p><a href="https://i.stack.imgur.com/RDeIh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RDeIh.jpg" alt="Common thermal fuses"></a></p>
<p>Has anyone added thermal fuses to their 3D printers? Or has anyone examined where the thermal fuses are placed in commercial 3D printer designs, if used at all?</p>
<hr>
<h3>Background</h3>
<p>I have recently found myself having to repair rice cookers and fans in Thailand. In those, it is very often the thermal fuse (axial thermal fuses for the rice cookers and the square "radial" types for fans) that requires replacing, as they have <em>blown</em> before the device got hot enough to start a fire. This got me thinking about their use in a 3D printer. </p>
<hr>
<h3>Footnotes</h3>
<p><sup>1</sup> We are <em>not</em> talking about the standard, replaceable, thermo-fuse,or <a href="https://en.wikipedia.org/wiki/Fuse_(electrical)" rel="nofollow noreferrer">fuse</a>, which blow upon a current surge, short-circuit, etc. These are <a href="https://en.wikipedia.org/wiki/Thermal_cutoff#Thermal_fuse" rel="nofollow noreferrer">thermal fuses</a> that contain metal connector within them that melts (permanently) at a specific temperature (typically ~135°C), thereby breaking the circuit.</p>
<p><sup>2</sup> Nor am I referring to <a href="https://en.wikipedia.org/wiki/Resettable_fuse" rel="nofollow noreferrer">resettable fuses</a> (AKA PPTC, multifuse, polyfuse or polyswitch)</p>
<p><sup>3</sup> Would a thermal fuse be preferable to thermal cut offs, in the case of fire?</p>
<p><sup>4</sup> The thermal fuses used in rice cookers are the <em>axial</em> type, and in the motors of fans are the <em>radial</em> type.</p>
|
<p>Whether you should use a thermal fuse or not depends on what other safety measures you've taken. You can't look at the safety features of a printer in isolation, you need to look at what other measures are in place.</p>
<p>The main fire hazard in printers is unfortunately (still) the fact that some manufacturers use underrated connectors on their boards, and that some users put bare wires in screw terminals or use inadequate torque when tightening terminals. As the wire works itself loose, it starts arcing and burning the connector. A thermal fuse does not help in this situation (unless you place thermal fuses near all of the connectors, which is impractical). Instead:</p>
<ul>
<li><p>Properly tighten screw terminals, check them, and consider using proper wire termination (crimp lugs).</p></li>
<li><p>Use strain relief on wires. Make sure wires don't rub against anything, and guide them so they do not bend in a tight radius. Since the extruder (or print bed) is constantly moving, those wires are subject to fatigue.</p></li>
<li><p>Make sure connectors (especially those for the heated bed) are rated for the current running through them, and solder wires directly to the board if necessary.</p></li>
</ul>
<p>Using a regular fuse may protect against wires shorting against each other should their insulation be damaged. Fuses are usually already integrated into the main board.</p>
<p>Most firmwares include some variant of <em>thermal runaway protection</em>, a feature that monitors the heaters and shuts the printer down if it notices something gone wrong. This protects against:</p>
<ul>
<li>The thermistor coming loose/reading incorrect values/etc...</li>
</ul>
<p>but not against:</p>
<ul>
<li><p>Bugs in the firmware itself</p></li>
<li><p>Failure of the MOSFET</p></li>
</ul>
<p>Most printers use MOSFETs to switch power to the heating element. Unfortunately, when MOSFETs fail, they usually fail <em>closed</em> (i.e. conducting). This means that, even if the firmware detects something has gone wrong, it won't be able to do anything about it. Solid State Relays (TRIACs) can fail in the same way.</p>
<p>To protect against this, mounting a thermal fuse (or resettable bimetallic switch*) on the heated bed may be a good idea. However, thermal fuses with ratings up to the operating temperature of a hotend do not appear to be available so this is not an option.</p>
<p>Attaching the fuse physically to the part it is monitoring is the most reliable, but for instance with the hotend (if you wanted to protect it all) this might not be feasible to the high temperatures involved so you'd have to settle with monitoring the air temperature close by.</p>
<p>Also consider <em>thermal balancing</em>. A thermal fuse is unnecessary if the component can not overheat to begin with. For instance, most MK2 heated beds struggle getting up to even 100C, so even with a shorted MOSFET they present no danger. However, if you have a powerful high wattage (mains-powered) heated bed, you should <em>definitely</em> install thermal protection.</p>
<p>E3D supplies their hot ends with 25W, 30W and 40W heaters. The 25W heater is the safer choice, since it limits the maximum temperature the hot end can get to, while with the 40W heater you can reach higher temperatures (and reach them faster). Barring a very unlikely scenario in which simultaneously (1) the power supply fails and starts supplying excessive voltage and (2) the MOSFET and/or firmware fails, a heater that is sized appropriately to the load it is driving can never pose any danger.</p>
<p>I don't think it's common to install thermal fuses on steppers, stepper drives or the power supply (which should have its own protection). For every possible location to place a thermal fuse, you can probably think up a failure mode in which that fuse would save the day, but at a certain point it just becomes overkill. The stepper drivers would likely burn out well before the steppers would get hot enough to pose a threat, and overheating of the stepper driver would probably (violently) destroy it but afterwards it should not pose any threat.</p>
<p>Axial v.s. radial does not matter, just use whatever is convenient for your situation.</p>
<p><sup>* Note that some bimetallic switches short one of the leads to the (metal)
case when tripped, which poses a danger, especially with mains-powered heaters.</sup></p>
|
<p>I haven't found a good way to flood the entire machine, including the electronics, with CO2 gas or another extinguisher when the alarm sounds.</p>
<p>A servo or some other actuator attached to a fire extinguisher, and then attach it to a thermocouple or some other sensor. Maybe a knockoff Arduino, which the small ones are 2 bucks a pop. Since Arduinos are open source, you aren't pirating anything, so clear conscience.</p>
| 602
|
<p>I'm still fairly new to T-SQL and SQL 2005. I need to import a column of integers from a table in database1 to a identical table (only missing the column I need) in database2. Both are sql 2005 databases. I've tried the built in import command in Server Management Studio but it's forcing me to copy the entire table. This causes errors due to constraints and 'read-only' columns (whatever 'read-only' means in sql2005). I just want to grab a single column and copy it to a table.</p>
<p>There must be a simple way of doing this. Something like:</p>
<pre><code>INSERT INTO database1.myTable columnINeed
SELECT columnINeed from database2.myTable
</code></pre>
|
<p>Inserting won't do it since it'll attempt to insert new rows at the end of the table. What it sounds like your trying to do is add a column to the end of existing rows.</p>
<p>I'm not sure if the syntax is exactly right but, if I understood you then this will do what you're after.</p>
<ol>
<li><p>Create the column allowing nulls in database2.</p></li>
<li><p>Perform an update:</p>
<p>UPDATE database2.dbo.tablename
SET database2.dbo.tablename.colname = database1.dbo.tablename.colname
FROM database2.dbo.tablename INNER JOIN database1.dbo.tablename ON database2.dbo.tablename.keycol = database1.dbo.tablename.keycol</p></li>
</ol>
|
<p>insert into Test2.dbo.MyTable (MyValue) select MyValue from Test1.dbo.MyTable</p>
<p>This is assuming a great deal. First that the destination database is empty. Second that the other columns are nullable. You may need an update instead. To do that you will need to have a common key.</p>
| 7,561
|
<p>We generate web pages that should always be printed in landscape mode. Web browser print dialogs default to portrait, so for every print job the user has to manually select landscape. It's minor, but would be nice for the user if we can remove this unnecessary step. </p>
<p>Thanks in advance to all respondents.</p>
|
<p>A quick Google indicates that it's not really supported. There's more than a few folks out there trying to <a href="http://www.daniweb.com/forums/showthread.php?t=14877&page=2&highlight=javascript+print+landscape" rel="nofollow noreferrer">hack</a> <a href="http://home.tampabay.rr.com/bmerkey/examples/landscape-test.html" rel="nofollow noreferrer">their</a> way to it - but I'd strongly suggest just rendering a server side PDF instead.</p>
|
<p>I was looking to do this same thing and found <a href="http://edacio.us/forum/comments.php?DiscussionID=39" rel="nofollow noreferrer">this</a> article. It looks particularly "hacky" and as the author points out, may invoke an active x warning in IE. Seems like a losing proposition to confuse the user with an active x warning when they just wanted to print a web page.</p>
| 5,785
|
<p>Has anyone got experience with the white framework?</p>
<p><a href="http://www.codeplex.com/white" rel="noreferrer">www.codeplex.com/white</a> ?</p>
<p>I'm thinking about using it for the next project for basic smoke tests of our windows client. I'd like some advice on articles or your own experiences. Thanks.</p>
|
<p>I recently used white to build a few (20+) UI tests for a fairly complex WinForms app with plenty of UserControls, dynamically created and 3rd-party controls.</p>
<p>Here are my impressions:</p>
<ul>
<li>Very easy and intuitive to work with.</li>
<li>Little or no quality issues.</li>
<li>It's a young project so there are
some missing features, but they've
got the basics covered.</li>
<li>Occasionally, if a control didn't have a known AutomationID, I was forced to use keystrokes to navigate to and manipulate a control ("tab, tab, enter" for example) which was kind of a bummer, but still very easy to do in white. This usually only happened with 3rd-party or dynamically generated controls.</li>
<li>White's recorder is helpful (and will actually generate code for you) but does often get confused by complicated or unusual controls. For that reason I'd recommend that you...</li>
<li>...keep UISpy nearby so you can see the AutomationID of the controls you're working with.</li>
<li>And finally, if you're like me, you're hoping to set up some automated tests. This can be tricky since an automated test will usually be run by a CI tool such as CruiseControl which runs as a Windows service, which therefore has no active graphical environment (Windows session)...which white requires. The <a href="http://www.codeplex.com/white/Wiki/View.aspx?title=Using%20with%20Continuous%20Integration&referringTitle=Home" rel="noreferrer">suggested</a> way around this is to use a virtual machine. This is where I lost steam, as my tool chain had just grown too large for my purposes: CruiseControl->NAnt->NUnit->white + virtual machine.</li>
</ul>
<p>Anyway, hope that's useful.</p>
|
<p>I evaluated it recently, but had to reject it because it would not support the third party controls (janus grid) we were using.</p>
| 9,727
|
<p>When prototyping initial GUI functionality with a customer is it better to use a pen/paper drawing or to mock something up using a tool and show them that ?</p>
<p>The argument against a tool generated design being that the customer can sometimes focus on the low-level specifics of the mock-up rather than taking a higher level functional view of the GUI overall.</p>
|
<p>Always start with paper or paper-like mock-ups first. You do not want to fall into a trap of giving the impression of completeness when the back-end is completely hollow.</p>
<p>A polished prototype or pixel-perfect example puts too much emphasis on the design. With an obvious sketch, you have a better shot of discussing desired functionality and content rather than colors, photos, and other stylistic matters. There will be time for that discussion later in the project.</p>
<p>Jeff discusses paper prototyping in his Coding Horror article <a href="http://www.codinghorror.com/blog/archives/001091.html" rel="noreferrer">UI-First Software Development</a></p>
<p>Click the "Watch a video!" link at <a href="http://twitter.com/" rel="noreferrer">twitter.com</a> to see an interesting take on the idea from <a href="http://www.commoncraft.com/" rel="noreferrer">Common Craft</a>.</p>
|
<p>You can try out <a href="http://www.foreui.com/" rel="nofollow noreferrer">ForeUI</a>, it allow prototyping with different styles, what's more, it can make interactive prototype and run it in browser.</p>
| 2,580
|
<p>Is it possible in .NET to list files on a remote location like an URL? Much in the same way the System.IO classes work. All I need is the URLs to images that are on a remote server.</p>
|
<p><strong>Short answer:</strong> No, unless you have more control over that web-server</p>
<p><strong>Long answer:</strong> Here are possible solutions...</p>
<ol>
<li><p>You will need server-side script that will do it locally and output this list in your preferred format.</p></li>
<li><p>Most of the web-servers implement default file-browsing pages, so you could theoretically parse those but this solution will be very fragile and not very portable even between different versions of the same web-server.</p></li>
<li><p>If you have FTP access...</p></li>
</ol>
|
<blockquote>
<p>Is it possible in .NET to list files on a remote location like an URL?</p>
</blockquote>
<p>You should specify which protocol we're talking about.</p>
<p>For HTTP, lubos hasko provided the answer: no. HTTP has no concept of files; only of resources. If you have control over the web server, you can ask it to provide a directory listing, or, better yet, you can write code that lists the directory server-side for you. Without such control, you have to <em>rely</em> on the server to provide a listing, which 1) may be disabled for security reasons, 2) is non-standardized in its format, 3) will be, like lubos said, fragile to parse (<a href="http://en.wikipedia.org/wiki/Web_scraping" rel="nofollow noreferrer">"scrape"</a>).</p>
<p>If you mean / if the server provides a protocol intended for file transfer, such as FTP, SMB/CIFS, etc., it'll be a lot easier. For example, for FTP, you'll want to look into <a href="http://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp.listdirectorydetails.aspx" rel="nofollow noreferrer">WebRequestMethods.Ftp.ListDirectoryDetails</a>.</p>
| 3,460
|
<p>I have a Visual Studio application with a splash screen image cut into "slices". The positions are specified in the Form Designer so they line up properly on the screen. However, the images are out of place when the application is run on the Chinese version of Windows XP. It looks as if the image slices were "exploded" apart.</p>
<p>What's going on here? Do international versions of Windows have a different meaning of the "top left" coordinate of the picture? How can I force the images to be precisely displayed where I want them?</p>
|
<p>We found a solution! Apparently the picture boxes stretched out on the Chinese XP PC, but the images they contained did not. The fix was to add code like the following:</p>
<pre><code>Me.PictureBoxIcon.Width = Me.PictureBoxIcon.Image.Width
Me.PictureBoxIcon.Height = Me.PictureBoxIcon.Image.Height
Dim loc As New Point
loc.X = Me.PictureBoxIcon.Location.X
loc.Y = Me.PictureBoxIcon.Location.Y + Me.PictureBoxIcon.Height
Me.PictureBoxAbout.Location = loc
Me.PictureBoxAbout.Width = Me.PictureBoxAbout.Image.Width
Me.PictureBoxAbout.Height = Me.PictureBoxAbout.Image.Height
</code></pre>
<p>Hope this helps someone else!</p>
|
<p>In the OnLoad event of the form, you could always explicitly set the location of each section. If starting at the top left with the first and assuming an array with the images in order:</p>
<pre><code>images[0].Location = new Point(0,0);
for (int i = 1; i < images.Length; i++)
{
images[i].Location = new Point(images[i - 1].Location.X + images[i - 1].Width, 0);
}
</code></pre>
<p>That will set the first image to the top left corner and all subsequent images to just after the last image.</p>
| 9,185
|
<p>OpenSCAD has <code>rotate</code> function which rotates the body around its origin axis.</p>
<p>Is there a way to specify an arbitrary axis?</p>
<p>For example, this rotates a cylinder around its center:</p>
<pre><code>rotate(a=[90,0,0]) {
cylinder(h=10,r1=10,r2=10);
}
</code></pre>
<p>How to make it rotate around its edge?</p>
|
<p><code>rotate()</code> always rotates around the origin of the object following it.
What you can do is to move your cylinder <em>away</em> from the origin, like this:</p>
<pre><code>rotate(a=[90,0,0]) {
translate([0,10,0]) cylinder(h=10,r1=10,r2=10);
}
</code></pre>
|
<p>You can use the following module in your code to achieve what you wish:</p>
<pre><code>module myrotate(a, orig) {
translate(orig)
rotate(a)
translate(-orig)
children();
}
myrotate([0,0,90], [0, 10, 0]) {
cube([10, 10, 25]);
}
myrotate([0,0,-90], [0, 10, 0]) {
cube([10, 10, 25]);
}
color([1, 0, 0])
cube([10, 10, 25]);
</code></pre>
| 1,204
|
<p>When using MediaWiki's markup language, the only thing that I hate is creating numbered lists. The only way I know to create a list is to do something like this:</p>
<pre><code>#Item1
#Item2
</code></pre>
<p>However, if I want to add spaces or some other text between those lines, the numbering gets lost. For example, the following will create text that has two number one items:</p>
<pre><code>#Item1
Somestuff
#Item2
</code></pre>
<p>Is there any way around this, or should I just use bullet points instead? I noticed just now that the stackoverflow system does not allow numbering like this, you have to do it all manually.</p>
|
<p>Like this:</p>
<pre><code>#Item1
#:Somestuff
#Item2
</code></pre>
|
<p>You can do:</p>
<pre><code># one
# two<br />spanning more lines<br />doesn't break numbering
# three
## three point one
## three point two
</code></pre>
<p>Regular old <code><br></code> works as well but probably pisses off someone.</p>
<p>You can put additional HTML formatting in as well to do <code><pre></code> formatting and the like without breaking the numbering as well. This also works other list formats.</p>
<p>From:
<a href="http://www.mediawiki.org/wiki/Help:Formatting" rel="nofollow noreferrer">http://www.mediawiki.org/wiki/Help:Formatting</a></p>
<p>edit: Also found that inside a <code><pre></pre></code> many of my old tricks don't work, but using <code>&#10;</code> works as a newline, and allows multi-line blocks. The cost is that you jam all your lines on one line.</p>
<pre><code># one
#: <pre>foo&#10;bar</pre>
</code></pre>
| 9,766
|
<p>I'm creating an application which lets you define events with a time frame. I want to automatically fill in the end date when the user selects or changes the start date. I can't quite figure out, however, how to get the difference between the two times, and then how to create a new end Date using that difference.</p>
|
<p>In JavaScript, dates can be transformed to the number of milliseconds since the epoc by calling the <code>getTime()</code> method <strong>or</strong> just using the date in a numeric expression.</p>
<p>So to get the difference, just subtract the two dates.</p>
<p>To create a new date based on the difference, just pass the number of milliseconds in the constructor.</p>
<pre><code>var oldBegin = ...
var oldEnd = ...
var newBegin = ...
var newEnd = new Date(newBegin + oldEnd - oldBegin);
</code></pre>
<p>This should just work</p>
<p><strong>EDIT</strong>: Fixed bug pointed by @bdukes</p>
<p><strong>EDIT</strong>: </p>
<p>For an explanation of the behavior, <code>oldBegin</code>, <code>oldEnd</code>, and <code>newBegin</code> are <code>Date</code> instances. Calling operators <code>+</code> and <code>-</code> will trigger Javascript auto casting and will automatically call the <code>valueOf()</code> prototype method of those objects. It happens that the <code>valueOf()</code> method is implemented in the <code>Date</code> object as a call to <code>getTime()</code>.</p>
<p>So basically: <code>date.getTime() === date.valueOf() === (0 + date) === (+date)</code></p>
|
<pre><code>function checkdate() {
var indate = new Date()
indate.setDate(dat)
indate.setMonth(mon - 1)
indate.setFullYear(year)
var one_day = 1000 * 60 * 60 * 24
var diff = Math.ceil((indate.getTime() - now.getTime()) / (one_day))
var str = diff + " days are remaining.."
document.getElementById('print').innerHTML = str.fontcolor('blue')
}
</code></pre>
| 6,336
|
<p>In C++, there isn't a de-facto standard logging tool. In my experience, shops roll their own. This creates a bit of a problem, however, when trying to create reusable software components. If everything in your system depends on the logging component, this makes the software less reusable, basically forcing any downstream projects to take your logging framework along with the components they really want. </p>
<p>IOC (dependency injection) doesn't really help with the problem since your components would need to depend on a logging abstraction. Logging components themselves can add dependencies on file I/O, triggering mechanisms, and other possibly unwanted dependencies. </p>
<p>Does adding a dependency to your proprietary logging framework sacrifice the reusability of the component?</p>
|
<p>Yes. But dependency injection will help in this case.</p>
<p>You can create an abstract logging base-class and create implementations for the logging-frameworks you want to use. Your components are just dependent on the abstract base-class. And you inject the implementations along with al their dependencies as needed.</p>
|
<p>If you are looking to build libraries which wont be recompiled, but want to provide a logging interface then perhaps a good way is to allow the user (of the library) to provide a callback.</p>
<p>On initialising logging with your library, they would need to specify the callback, and then the glue-code is up to them to make it play well with whatever they have.</p>
<p>If you can make the signature of the callback look like a standard function they might always have available to them, it provides them an easy default option if they dont actually have a logger.</p>
<p>Additionally the caller might have instanced components from the library multiple times, and for resource contention or threading issues, want to provide a different logger callback for each one.</p>
| 6,035
|
<p>I have Carbide.c++ Developer from Nokia and I want to create applications for my S60 phone.
I've looked at the samples that goes with the different SDK's for S60 but I haven't found any simple explanation on how strings, called descriptors, are used in Symbian.</p>
<p>One of the problems are that I'm visually impaired and therefore it takes quite some time to read through large documents that has page up and page down with lots of unuseful info and I've given up.</p>
<p>I'm willing to give it another try. Can anyone help me?</p>
|
<p>Here are a few sites on blogspot that may help. They have RSS feeds that will hopefully be easier to consume than paging through PDFs.</p>
<ul>
<li><a href="http://descriptor-tips.blogspot.com/" rel="nofollow noreferrer">http://descriptor-tips.blogspot.com/</a></li>
<li><a href="http://descriptors.blogspot.com/" rel="nofollow noreferrer">http://descriptors.blogspot.com/</a></li>
</ul>
|
<p>The best advice regarding descriptors I give to any new Symbian developer in my company is to try and avoid using the descriptors when not necessary. The Symbian SDK has the libc API which includes stdio, stdlib, string and more. I usually use char* types and when necessary I convert it to a descriptor (when I need to send a string to an SDK method which requires it).</p>
| 5,919
|
<p>I just moved over to the Visual Basic team here at work.</p>
<p>What is the equivalent keyword to <code>break</code> in Visual Basic, that is, to exit a loop early but not the method?</p>
|
<p>In both Visual Basic 6.0 and <a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET" rel="noreferrer">VB.NET</a> you would use:</p>
<ul>
<li><code>Exit For</code> to break from For loop</li>
<li><code>Wend</code> to break from While loop</li>
<li><code>Exit Do</code> to break from Do loop</li>
</ul>
<p>depending on the loop type. See <a href="https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/exit-statement" rel="noreferrer">Exit Statements</a> for more details.</p>
|
<p><code>Exit</code> [construct], and intelisense will tell you which one(s) are valid in a particular place.</p>
| 2,761
|
<p>I’ve been using Thingiverse pretty heavily since I started printing, and I frequently come across the same text block in unrelated models. Am I missing the joke or a hidden meaning in the frequent reuse of the following content?</p>
<blockquote>
<p>Designed up this dealer button to use in home games or have just as something laying around for any poker fan. It was inspired by a dealer button in Pokerstars VR.</p>
<p>Printing:</p>
<p>Ring - Infil to add weight, supports needed for spade inset. Letter embossing doesn't need it.<br />
Spade - Infil to add weight, no supports<br />
Letters - Print flat, already scaled to fit nicely in the embossing<br />
Star - Infil to add weight.</p>
<p>Full print with 4x4x4 walls/top/bottom and 38% infil came to about 48g in weight.</p>
<p>Glue in lettering and spade. Star may need minor sanding but should push fit into the space tightly and not need anything else to secure it.</p>
</blockquote>
<p>Here is an example of what I mean: <a href="https://www.thingiverse.com/thing:4887617" rel="nofollow noreferrer">Voronoi bear</a>. Just curious if anyone knows why that’s used as a pseudo default description, or if I should avoid those files for any reason I’m unaware of.</p>
<p>Here’s another example: <a href="https://www.thingiverse.com/thing:4871879" rel="nofollow noreferrer">cats</a></p>
|
<p>The "dealer button" text is the default text that Thingiverse inserts when you create a new Thing entry. If you get in a hurry and hit "Publish Thing" before you edit that, it'll go up for everyone to see with the "dealer button" default text still in place. Many times, when you see that, you'll also see the defaults still in place for machine specs, filament type, etc.</p>
<p>In other words, it's just a user error, especially prevalent on "quickie" uploads that aren't intended for a wide audience or long term preservation. Based on comments, this may also be a relatively recent change at Thingiverse; I've only uploaded designs there over the past few months, and I've seen it every time over that time frame (since about April 2021).</p>
|
<p>Consider this example:
<a href="https://www.thingiverse.com/thing:4888256" rel="nofollow noreferrer">https://www.thingiverse.com/thing:4888256</a></p>
<p>The text entered by the author is visible above the seemingly random text you mentioned in your question.</p>
<p>Seeing how Thingiverse is a Makerbot product, it's likely that they've messed up their database somehow.</p>
| 1,989
|
<p>I am printing on a non-heated bed right now, but the question also applies to heated building plates. </p>
<p>How often should you replace the glue layers that's supposed to be applied before printing? Some say you can do up to a few prints, such as in this <a href="https://ultimaker.com/en/community/19056-glue-stick-or" rel="noreferrer">forum</a>, while others say to replace it every print. What is the correct approach?</p>
|
<p>Depends on the glue and on your tolerance for messy undersides on your prints. It's fairly common for some of the glue to come off with the print. Or you may have marks from scrapers or rafts. Do you want to touch up that spot and have some artifacts on the bottom of the next print, or clean and redo the bed to get everything flat?</p>
<p>Gluestick is pretty easy to wash and reapply. It can also be freshened up with a gentle spray of water, smeared flat, and redried, or more gluestick added on top. It will really come down to your preferred workflow. </p>
|
<p>As noted in the answer to the other question you asked, the Flux Delta steel plate bed will handle multiple layers of glue. The determining factor regarding this particular printer and specific glue is how many ripples, bumps and/or lines you are willing to tolerate on the first layer of your prints. </p>
<p>You'll notice that a print made with a couple layers of glue, freshly applied, will have a relatively smooth surface. Peel off the model, apply glue over the now-cleared areas, and you've created a slightly-less-than-smooth surface for your next model.</p>
<p>I've found that I can apply six to ten layers before the ripples become objectionable.</p>
| 311
|
<p>I am used to writing C# Windows applications. However, I have some free hosted PHP webspace that I would like to make use of. I have a basic understanding of PHP but have never used its object-oriented capabilities.</p>
<p>Is there an easy way to convert C# classes to PHP classes or is it just not possible to write a fully object-oriented application in PHP?</p>
<p><strong>Update:</strong> There is no reliance on the .NET framework beyond the basics. The main aim would be to restructure the class properties, variable enums, etc. The PHP will be hosted on a Linux server.</p>
|
<p>It is entirely possible to write a PHP application almost entirely in an object-oriented methodology. You will have to write some procedural code to create and launch your first object but beyond that there are plenty of MVC frameworks for PHP that are all object-oriented. One that I would look at as an example is <a href="http://codeigniter.com" rel="nofollow noreferrer">Code Igniter</a> because it is a little lighter weight in my opinion.</p>
|
<p>I don't know about a tool to automate the process but you could use the Reflexion API to browse your C# class and generate a corresponding PHP class.</p>
<p>Of course, the difficulty here is to correctly map C# types to PHP but with enough unit testing, you should be able to do what you want.</p>
<p>I advice you to go this way because I already did a C# to VB and C++ conversion. That was a pain but the result was worth it.</p>
| 3,459
|
<p>I upgraded to a dual Mk9 extruder, and quickly discovered how critical it is to get the ends of both nozzles exactly level with each other -- that is, equally distant from the build plate at all times. Otherwise the lower one will crash against the plastic just extruded by the higher one.</p>
<p>So, what's a good procedure for getting the nozzles accurately level? About all I've figure out is to move the heads down close to Z=0, and then run X and Y back and forth and eyeball and adjust; then move even closer to Z=0 and repeat. Is there a better / more efficient way?</p>
|
<ol>
<li>Make sure that the <strong>bed is level</strong>. As the saying goes, a level bed is next to godliness or something like that. Pay extra attention to the direction the nozzles are offset by (if one nozzle is offset on the X-axis, pay extra attention to the bed leveling along the X-axis). <a href="http://wiki.solidoodle.com/leveling-the-print-bed" rel="noreferrer">This can be done with just one nozzle and a business card or piece of paper</a>.</li>
<li>Use a <strong>bubble level</strong> to get the nozzles about right. Move your z-axis up a bit and put a bubble level against the nozzles. Adjust as necessary so it's exactly level. The nozzles should be level enough that the bubble stays in the middle.</li>
<li>Fine-tune it with a <strong>business card</strong>. When you home the z- axis, you should be able to just fit a business card under both nozzles with a moderate amount of resistance. Don't force the card. If sliding the business card under produces a different amount of resistance for one nozzle than for another, adjust the nozzle a <em>tiny</em> amount. You can also use an index card or playing card.</li>
<li>Once it passes the card test, try a test print. If it doesn't work, make sure your bed is level, your nozzle offset is correct in the slicing software, and try calibrating with an index card again. If the nozzles become way off, try the bubble level again.</li>
</ol>
<p>As for physically adjusting the level, another answer suggests shims made from aluminum foil, which work well. Personally, my extruder was off-level by almost exactly 1mm, so a pair of washers worked nicely for that.</p>
<p>Happy printing!</p>
<p>Leveling with a bubble:</p>
<p><a href="https://i.stack.imgur.com/O1IDe.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/O1IDe.jpg" alt="Almost level, sorry for the bad lighting"></a></p>
|
<p>Another option, that I found was the simplest one that worked for me: </p>
<ol>
<li>Level your bed using just the first nozzle (temporarily lock the 2nd nozzle higher than the 1st one).</li>
<li>Move the printhead at the center of the bed</li>
<li>Loosen the grub screws on both nozzles (IMPORTANT, don't skip this step)</li>
<li>If you're not using a glass bed, temporarily clip a sheet of glass on your bed.</li>
<li>Home the Z-Axis</li>
<li>Move the the head sideways, front and back a few times just to be sure (X, Y)</li>
<li>Move the printhead back at the center</li>
<li>Lock the grub screws on both nozzles. Lock them slowly alternating between the top and bottom screws. Also make sure the wirings don't pull on the head (it's actually better if they push the nozzles down).</li>
<li>Relevel the bed, this time checking with the 2 nozzles</li>
</ol>
<p>The sheet of glass ensures a completely flat and solid surface, on top of your properly leveled bed.</p>
<p>Try the above in case nothing else works for you.</p>
| 155
|
<p>When I am printing objects that have a lot of surface area on the first layer parts of that layer will rise up causing there to be gaps in the first layer. Here are two pictures. The first one was printing with a raft and the second one was without a raft.<a href="https://i.stack.imgur.com/yLnZA.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/yLnZA.jpg" alt="Raft"></a><a href="https://i.stack.imgur.com/x6vXw.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/x6vXw.jpg" alt="No Raft"></a> I am printing on 3M Painters tape, extruder temperature at 200, bed temperature at 60. I am using Hatchbox PLA Filiment.</p>
|
<p>You got a few things happening. First that temp seems low. I am printing PLA at 215.. but there are a lot of factors. Start with a simple calibration thin wall test. Which is just a wall, no body. </p>
<p>From there your bed could be closer. Maybe. I don't think that's really the issue. Slower speed and heat will make more of a difference. That said. I take a piece of paper and calibrate it so there just a little, but not too much, friction. </p>
<p>Make sure you are printing at 30% speed for first layer.</p>
<p>Last use a glue stick.</p>
|
<p>I am having the same issue. I saw one similar post describe this as "baconing" and said it comes from over extrusion. Looking at the filament coming out I could imagine that if there is too much filament for the given travel speed, then it would buckle up. I tried decreasing the extrusion percentage. The Makerbot slicing program doesn't have a setting for that so I did multiple test prints and raised the filament diameter from the default 1.77 to 1.84 in the end, which is about at 20% decrease in the extruder output. I also slowed the prints speed. Both factors seemed to improve the quality, so over extrusion and speed both seem to be contributing factors, but the problem still hasn't gone away completely. It's happening with white Makerbot brand filament on large layers but not with green Makerbot brand and small layer heights (I haven't yet tried green coarse or white fine). I measured the white filament diameter with calipers and it is the proper 1.75mm, I'm just forcing it to extrude less by putting 1.84mm into the slicer settings.</p>
| 537
|
<p>I'm writing some documentation in Markdown, and creating a separate file for each section of the doc. I would like to be able to convert all the files to HTML in one go, but I can't find anyone else who has tried the same thing. I'm on a Mac, so I would think a simple bash script should be able to handle it, but I've never done anything in bash and haven't had any luck. It seems like it should be simple to write something so I could just run:</p>
<pre><code>markdown-batch ./*.markdown
</code></pre>
<p>Any ideas?</p>
|
<p>This is how you would do it in Bash. </p>
<pre><code>for i in ./*.markdown; do perl markdown.pl --html4tags $i > $i.html; done;
</code></pre>
<p>Of course, you need the <a href="http://daringfireball.net/projects/markdown/" rel="noreferrer">Markdown script</a>.</p>
|
<p>I use this in a .bat file:</p>
<pre><code>@echo off
for %i in (*.txt) python markdown.py "%i"
</code></pre>
| 3,928
|
<p>I'm currently creating an explicit reference to this in the outer class so that I have a name to refer to in the anonymous inner class. Is there a better way to do this?</p>
|
<p>I just found this recently. Use <code>OuterClassName.this</code>.</p>
<pre><code>class Outer {
void foo() {
new Thread() {
public void run() {
Outer.this.bar();
}
}.start();
}
void bar() {
System.out.println("BAR!");
}
}
</code></pre>
<p><strong>Updated</strong> If you just want the object itself (instead of invoking members), then <code>Outer.this</code> is the way to go.</p>
|
<p>You can still use Outer.class to get the class of the outer class object (which will return the same Class object as Outer.this.getClass() but is more efficient)</p>
<p>If you want to access statics in the enclosing class, you can use Outer.name where name is the static field or method.</p>
| 5,110
|
<p>I just read up on a performance of LINQ, and there is a HUGE amount to be gained by using Compiled LINQ.</p>
<p>Now, why won't I always use compiled LINQ?</p>
|
<p>Short answer: when it's only going to happen once in a long time.</p>
<p><a href="http://blogs.msdn.com/ricom/archive/2008/01/14/performance-quiz-13-linq-to-sql-compiled-query-cost-solution.aspx" rel="nofollow noreferrer">Long Answer</a>.</p>
|
<p>You should use it when some linq query is executing most of the time. Those can be converted to compiled lynq. Performance will be improved as execution path of query will be set at compile time. I used it in my project and performance went up a notched.</p>
| 2,962
|
<p>We have a question with regards to XML-sig and need detail about the optional elements as well as some of the canonicalization and transform stuff. We're writing a spec for a very small XML-syntax payload that will go into the metadata of media files and it needs to by cryptographically signed. Rather than re-invent the wheel, We thought we should use the XML-sig spec but I think most of it is overkill for what we need, and so we like to have more information/dialogue with people who know the details.</p>
<p>Specifically, do we need to care about either transforms or canonicalization if the XML is very basic with no tabs for formatting and is specific to our needs?</p>
|
<p>Within your overridden ProcessCmdKey how are you determining which key has been pressed?</p>
<p>The value of keyData (the second parameter) will change dependant on the key pressed and any modifier keys, so, for example, pressing the left arrow will return code 37, shift-left will return 65573, ctrl-left 131109 and alt-left 262181.</p>
<p>You can extract the modifiers and the key pressed by ANDing with appropriate enum values:</p>
<pre><code>protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
bool shiftPressed = (keyData & Keys.Shift) != 0;
Keys unmodifiedKey = (keyData & Keys.KeyCode);
// rest of code goes here
}
</code></pre>
|
<p>I upvoted <a href="https://stackoverflow.com/questions/4850/c-and-arrow-keys/5026#5026">Tokabi's answer</a>, but for comparing keys there is some additional advice on <a href="https://stackoverflow.com/questions/1369312/c-keys-enumeration-confused-keys-alt-or-keys-rbutton-keys-shiftkey-keys-alt/2033796#2033796">StackOverflow.com here</a>. Here are some functions which I used to help simplify everything.</p>
<pre><code> public Keys UnmodifiedKey(Keys key)
{
return key & Keys.KeyCode;
}
public bool KeyPressed(Keys key, Keys test)
{
return UnmodifiedKey(key) == test;
}
public bool ModifierKeyPressed(Keys key, Keys test)
{
return (key & test) == test;
}
public bool ControlPressed(Keys key)
{
return ModifierKeyPressed(key, Keys.Control);
}
public bool AltPressed(Keys key)
{
return ModifierKeyPressed(key, Keys.Alt);
}
public bool ShiftPressed(Keys key)
{
return ModifierKeyPressed(key, Keys.Shift);
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (KeyPressed(keyData, Keys.Left) && AltPressed(keyData))
{
int n = code.Text.IndexOfPrev('<', code.SelectionStart);
if (n < 0) return false;
if (ShiftPressed(keyData))
{
code.ExpandSelectionLeftTo(n);
}
else
{
code.SelectionStart = n;
code.SelectionLength = 0;
}
return true;
}
else if (KeyPressed(keyData, Keys.Right) && AltPressed(keyData))
{
if (ShiftPressed(keyData))
{
int n = code.Text.IndexOf('>', code.SelectionEnd() + 1);
if (n < 0) return false;
code.ExpandSelectionRightTo(n + 1);
}
else
{
int n = code.Text.IndexOf('<', code.SelectionStart + 1);
if (n < 0) return false;
code.SelectionStart = n;
code.SelectionLength = 0;
}
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
</code></pre>
| 2,684
|
<p>I'm a Java programmer, and I like my compiler, static analysis tools and unit testing frameworks as tools that help me quickly deliver robust and efficient code. The JRE is pretty much everywhere I would work, too.</p>
<p>Given that situation, I can't see a reason why I would ever choose to use shell scripting, vb scripting etc, no matter how small the task is if I wear one of my other hats like my cool black sysadmin fedora.</p>
<p>I don't wear the other hats too often, <strong>under what circumstances should I choose scripting over writing compiled code?</strong></p>
|
<p>Whatever you think will be most efficient for you!</p>
<p>I had a co-worker who seemed to use a different language for every task; Perl for quick text processing, PHP for small internal web applications, .NET for our main product, cygwin for filesystem stuff. He preferred to use the technology which was most specific to the task at hand.</p>
<p>Personally, I find that context switching between technologies is painful. My day-to-day work is in .NET, so that's pretty much the terms I think in. For most tasks I find it more efficient to knock something up in C# using SnippetCompiler than I would to hack around in PowerShell or a scripting environment.</p>
|
<p>Weigh the importance of the tool against popping open a text editor for a quick edit vs. opening IDE, recompiling, redeploying, etc.</p>
| 7,829
|
<p>Have just started using <code>Google Chrome</code>, and noticed in parts of our site, e.g. all the links on the page, are bright red. They should be black with a dotted underline.</p>
<p>Is there some gotcha in <code>WebKit</code> rendering that turns all links red regardless of the style?</p>
|
<p>Are all of the resources that you're linking to in the present at the locations where your page is seeking them (verify this by actually checking it). I've also had an issue when checking an app in Safari where I was attempting to pull a file that wasn't there and I had very similar output to yours (red links).</p>
<p>EDIT: Adding Developingchris's find to the answer, since it explains it so well:</p>
<blockquote>
<p>k, found it.</p>
<p>If any of your stylesheets is missing
or pathed incorrectly, it throws a
404. If your 404 page has inline styles, they get respected via the
"alternate sheets" rule in webkit.</p>
<p>Thus, the red links on the "yellow
screen of death" are causing my
problem in overlap.</p>
</blockquote>
|
<p>Have you set a <code>:visited</code> setting in your stylesheet?</p>
| 6,820
|
<p>I would like to print edible cookies or ornamentation for a cake.</p>
<p>Is printing with edible materials achievable by standard thermoplastic-like 3D desktop printer? Or you need to buy a special printer to do that?</p>
|
<p>You cannot print edible models using a "standard" consumer 3D printer without first installing an "hot end" capable of depositing edible - normally thicker - substances as well as a suitable extruder mechanism. </p>
<p>However, there are not necessarily any technical limitations in the electronics, software, slicers etc. in a typical printer that wouldn't allow you to install such an upgrade. For instance, you could calibrate your extrusion rate and nozzle width to suit batter and similar.</p>
<p>Some commercial printers, such as the <a href="http://www.personalfab.it/en/products/deltawasp-20-40/" rel="noreferrer">DeltaWASP</a> allow for upgrades that print clay, which wouldn't be very different from printing liquid food.</p>
|
<p>You can, but that doesn't mean it's very easy.</p>
<p>You don't have to buy a special printer, but you need a special extruder (such as <a href="http://www.structur3d.io/" rel="noreferrer">http://www.structur3d.io/</a>). Most of these systems can print anything with the consistency of Nutella. However, many parts of the printer may not be food safe.</p>
<p>Another option (if you simply want 2d designs) is something like the <a href="http://www.pancakebot.com/" rel="noreferrer">PancakeBot</a>. It can probably also "print" with anything that has the same consistency of pancake batter.</p>
| 119
|
<p>I have a workbook with 20 different pivot tables. Is there any easy way to find all the pivot tables and refresh them in VBA?</p>
|
<p>Yes.</p>
<pre><code>ThisWorkbook.RefreshAll
</code></pre>
<p>Or, if your Excel version is old enough,</p>
<pre><code>Dim Sheet as WorkSheet, Pivot as PivotTable
For Each Sheet in ThisWorkbook.WorkSheets
For Each Pivot in Sheet.PivotTables
Pivot.RefreshTable
Pivot.Update
Next
Next
</code></pre>
|
<p>If you are using MS Excel 2003 then go to view->Tool bar->Pivot Table From this tool bar we can do refresh by clicking ! this symbol.</p>
| 9,638
|
<p>How do I delete untracked local files from the current working tree?</p>
|
<blockquote>
<h2><a href="https://git-scm.com/docs/git-clean" rel="noreferrer">git-clean</a> - Remove untracked files from the working tree</h2>
<h3>Synopsis</h3>
<pre><code>git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>…
</code></pre>
<h3>Description</h3>
<p>Cleans the working tree by recursively removing files that are not under version control, <strong>starting from the current directory</strong>.</p>
<p>Normally, only files unknown to Git are removed, but if the <code>-x</code> option is specified, ignored files are also removed. This can, for example, be useful to remove all build products.</p>
<p>If any optional <code><path>...</code> arguments are given, only those paths are affected.</p>
</blockquote>
<hr />
<p>Step 1 is to show what will be deleted by using the <code>-n</code> option:</p>
<pre><code># Print out the list of files and directories which will be removed (dry run)
git clean -n -d
</code></pre>
<p>Clean Step - <strong>beware: this will delete files</strong>:</p>
<pre><code># Delete the files from the repository
git clean -f
</code></pre>
<ul>
<li>To remove directories, run <code>git clean -f -d</code> or <code>git clean -fd</code></li>
<li>To remove ignored files, run <code>git clean -f -X</code> or <code>git clean -fX</code></li>
<li>To remove ignored and non-ignored files, run <code>git clean -f -x</code> or <code>git clean -fx</code></li>
</ul>
<p><strong>Note</strong> the case difference on the <code>X</code> for the two latter commands.</p>
<p>If <code>clean.requireForce</code> is set to "true" (the default) in your configuration, one needs to specify <code>-f</code> otherwise nothing will actually happen.</p>
<p>Again see the <a href="http://git-scm.com/docs/git-clean" rel="noreferrer"><code>git-clean</code></a> docs for more information.</p>
<hr />
<blockquote>
<h3>Options</h3>
<p><strong><code>-f</code>, <code>--force</code></strong></p>
<p>If the Git configuration variable clean.requireForce is not set to
false, git clean will refuse to run unless given <code>-f</code>, <code>-n</code> or <code>-i</code>.</p>
<p><strong><code>-x</code></strong></p>
<p>Don’t use the standard ignore rules read from .gitignore (per
directory) and <code>$GIT_DIR/info/exclude</code>, but do still use the ignore
rules given with <code>-e</code> options. This allows removing all untracked files,
including build products. This can be used (possibly in conjunction
with git reset) to create a pristine working directory to test a clean
build.</p>
<p><strong><code>-X</code></strong></p>
<p>Remove only files ignored by Git. This may be useful to rebuild
everything from scratch, but keep manually created files.</p>
<p><strong><code>-n</code>, <code>--dry-run</code></strong></p>
<p>Don’t actually remove anything, just show what would be done.</p>
<p><strong><code>-d</code></strong></p>
<p>Remove untracked directories in addition to untracked files. If an
untracked directory is managed by a different Git repository, it is
not removed by default. Use <code>-f</code> option twice if you really want to
remove such a directory.</p>
</blockquote>
|
<p>I use this:</p>
<ol>
<li><code>git status</code></li>
<li>copy the path of the file</li>
<li><code>rm <path of file></code></li>
</ol>
<p>My project has a lot of generated files created by a giant ANT build script. Using <code>git clean</code> would create chaos.</p>
| 8,634
|
<p><strong>Edit</strong>: Let me completely rephrase this, because I'm not sure there's an XML way like I was originally describing.</p>
<p><strong>Yet another edit</strong>: This needs to be a repeatable process, and it has to be able to be set up in a way that it can be called in C# code.</p>
<p>In database A, I have a set of tables, related by PKs and FKs. A parent table, with child and grandchild tables, let's say.</p>
<p>I want to <strong>copy a set of rows from database A to database B</strong>, which has identically named tables and fields. For each table, I want to insert into the same table in database B. But I can't be constrained to use the same primary keys. <strong>The copy routine must create new PKs</strong> for each row in database B, and must propagate those to the child rows. I'm keeping the same relations between the data, in other words, but not the same exact PKs and FKs.</p>
<p>How would you solve this? I'm open to suggestions. SSIS isn't completely ruled out, but it doesn't look to me like it'll do this exact thing. I'm also open to a solution in LINQ, or using typed DataSets, or using some XML thing, or just about anything that'll work in SQL Server 2005 and/or C# (.NET 3.5). The best solution wouldn't require SSIS, and wouldn't require writing a lot of code. But I'll concede that this "best" solution may not exist.</p>
<p>(I didn't make this task up myself, nor the constraints; this is how it was given to me.)</p>
|
<p>I think the SQL Server utility <a href="http://weblogs.sqlteam.com/mladenp/archive/2007/03/03/60125.aspx" rel="nofollow noreferrer">tablediff.exe</a> might be what you are looking for.</p>
<p>See also <a href="https://stackoverflow.com/questions/121243/hidden-features-of-sql-server">this thread</a>.</p>
|
<p>Dump the XML approach and use the import wizard / SSIS.</p>
| 8,392
|
<p>Half a year passed since <a href="https://3dprinting.meta.stackexchange.com/questions/430/tag-maintenance-summer-2019">Tag Maintenance Summer 2019</a>. A lot was done, some wasn't, so cleanup and rinse and repeat: Let's do some tag maintenance, especially regarding printers to make them easier to read. Use an answer to propose a change, merge or split. Discussions for each change should go into the comments of each change.</p>
<p>Some things are easier than others: </p>
<ul>
<li><strong>Renaming</strong> a tag can be done with mod tools.</li>
<li><strong>Alias/Synonyms</strong> are reasonably quick, often follow along renaming</li>
<li>Some tags need <strong>manual (separation)</strong>. Sifting through what is and what isn't this tag has to be done to separate the stuff. It can be noisy to the front site but has to be done.</li>
</ul>
|
<h1>Laundry list:</h1>
<h2>Open</h2>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/a/458/8884">Filled PLA</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/a/459/8884">Repair vs. Maintenance</a></li>
</ul>
<h2>Done</h2>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/a/456/8884">e3d</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/a/455/8884">Monoprice</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/a/457/8884">Creality</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/a/460/8884">Prusa</a></li>
</ul>
|
<h1>Manufacturer: E3D</h1>
<p>Status: <strong>Done</strong>/split up</p>
<p><a href="https://3dprinting.meta.stackexchange.com/a/438/8884">Takeover from Summer 2019</a></p>
<p>We have a lot of questions tagged <a href="https://3dprinting.stackexchange.com/questions/tagged/e3d" class="post-tag" title="show questions tagged 'e3d'" rel="tag">e3d</a>. Some concearn the <a href="https://3dprinting.stackexchange.com/questions/tagged/e3d-v6" class="post-tag" title="show questions tagged 'e3d-v6'" rel="tag">e3d-v6</a>, one the <a href="https://3dprinting.stackexchange.com/questions/tagged/e3d-titan-aero" class="post-tag" title="show questions tagged 'e3d-titan-aero'" rel="tag">e3d-titan-aero</a>, I think I have seen at least one <a href="https://3dprinting.stackexchange.com/questions/tagged/e3d-volcano" class="post-tag" title="show questions tagged 'e3d-volcano'" rel="tag">e3d-volcano</a>. As of today (updated), there's a pair of <a href="https://3dprinting.stackexchange.com/questions/tagged/e3d-hemera" class="post-tag" title="show questions tagged 'e3d-hemera'" rel="tag">e3d-hemera</a>/(formerly: <a href="https://3dprinting.stackexchange.com/questions/tagged/e3d-hemes" class="post-tag" title="show questions tagged 'e3d-hemes'" rel="tag">e3d-hemes</a>) and a single <a href="https://3dprinting.stackexchange.com/questions/tagged/e3d-v5" class="post-tag" title="show questions tagged 'e3d-v5'" rel="tag">e3d-v5</a> on a very old question.</p>
<p>Should we split it? Should we weed out those that use <a href="https://3dprinting.stackexchange.com/questions/tagged/e3d" class="post-tag" title="show questions tagged 'e3d'" rel="tag">e3d</a> but mean <a href="https://3dprinting.stackexchange.com/questions/tagged/all-metal-hotend" class="post-tag" title="show questions tagged 'all-metal-hotend'" rel="tag">all-metal-hotend</a> instead, and make that tag?</p>
<ul>
<li>It has been split.</li>
</ul>
| 73
|
<p>I am a student studying software development, and I feel programming, in general, is too broad of a subject to try to know everything. To be proficient, you have to decide which areas to focus your learning and understanding. Certain skill sets synergize with each other, like data-driven web development and SQL experience. However, all the win32 API experience in the world may not directly apply to linux development. This leads me to believe, as a beginning programmer, I should start deciding where I want to specialize after I have general understanding of the basic principles of software development. </p>
<p>This is a multi-part question really: </p>
<ol>
<li>What are the common specializations within computer programming and software development? </li>
<li>Which of these specializations have more long-term value, both as a foundation for other specializations and/or as marketable skills? </li>
<li>Which skill sets complement each other? </li>
<li>Are there any areas of specialization that hinder your ability of developing other areas of specialization.</li>
</ol>
|
<p>Ben, Almost all seasoned programmers are still students in programming. You never stops learning anything when you are a developer. But if you are really starting off on your career then you should be least worried about the specialization thing. All APIs, frameworks and skills that you expect that gives you a long term existence in the field is not going to happen. Technology seems changing a lot and you should be versatile and flexible enough to learn anything. The knowledge you acquire on one platform/api/framework doesn't die off. You can apply the skills to the next greatest platform/api/framework. </p>
<p>That being said you should just stop worrying about the future and concentrate on the basics. DataStructures, Algorithm Analysis and Design, Compiler Design, Operating system design are the bare minimum stuff you need. And further you should be willing to go back and read tho books in those field any time in your career. Thats all is required. Good luck. </p>
<p>Sorry if I sounded like a big ass advisor; but thats what I think. :-)</p>
|
<p>Go as deep as you can starting off in one environment, win32, .net, Java, Objective C... whatever. </p>
<p>It is important to build the deep understanding of how X works... so that you can translate the same concepts into other languages or platforms/environments, if you so desire. </p>
<p>"Are there any areas of specialization that hinder your ability of developing other areas of specialization." Sort of, but nothing permanent i think.</p>
<p>Since I am relatively green myself (less than 4 years) I come from a really OOP mindset. I've rarely jumped out of .NET, so I had a hard time on one job when coming into contact with embedded code. With embedded programmers fearing object creation and the performance loss of inheritance. I had to learn the environment, seriously low memory and slow clock times, they were coming from. Those are times to grow, I had a better time at it because i understood my area pretty well.</p>
<p>I will say if you pick something to specialize in for marketability and money, you will probably burn out fast. If you do start to specialize pick something you enjoy. I love GUI programing and hate server side stuff, my buddy is the opposite, but we both love our jobs. If he had to do my job, and I his, we would both go insane out of boredom.</p>
| 3,799
|
<p>I'm aware I can add maven repositories for fetching dependencies in ~/.m2/settings.xml. But is it possible to add a repository using command line, something like:</p>
<pre><code>mvn install -Dmaven.repository=http://example.com/maven2
</code></pre>
<p>The reason I want to do this is because I'm using a continuous integration tool where I have full control over the command line options it uses to call maven, but managing the settings.xml for the user that runs the integration tool is a bit of a hassle.</p>
|
<p>You can do this but you're probably better off doing it in the POM as others have said.</p>
<p>On the command line you can specify a property for the local repository, and another repository for the remote repositories. The remote repository will have all default settings though</p>
<p>The example below specifies two remote repositories and a custom local repository.</p>
<pre><code>mvn package -Dmaven.repo.remote=http://www.ibiblio.org/maven/,http://myrepo
-Dmaven.repo.local="c:\test\repo"
</code></pre>
|
<p>I am using <code>xmlstarlet</code> to achieve this. Tested for Maven 3 on CentOS 7, Maven 2 was not tested yet.</p>
<pre class="lang-bash prettyprint-override"><code>XML_FULLPATH="$HOME/.m2/settings.xml"
MIRROR_ID='example'
MIRROR_MIRROROF='*'
MIRROR_NAME='Example Mirror'
MIRROR_URL='http://example.com/maven2'
## Preview settings without comment:
xmlstarlet ed -d '//comment()' "$XML_FULLPATH"
## Add Mirror settings:
xmlstarlet ed -L \
--subnode "/_:settings/_:mirrors" --type elem --name "mirrorTMP" --value "" \
--subnode "/_:settings/_:mirrors/mirrorTMP" --type elem --name "id" --value "$MIRROR_ID" \
--subnode "/_:settings/_:mirrors/mirrorTMP" --type elem --name "mirrorOf" --value "$MIRROR_MIRROROF" \
--subnode "/_:settings/_:mirrors/mirrorTMP" --type elem --name "name" --value "$MIRROR_NAME" \
--subnode "/_:settings/_:mirrors/mirrorTMP" --type elem --name "url" --value "$MIRROR_URL" \
--rename "/_:settings/_:mirrors/mirrorTMP" --value "mirror" \
"$XML_FULLPATH"
## Remove Mirror settings by id:
xmlstarlet ed -L \
--delete "/_:settings/_:mirrors/_:mirror[_:id=\"$MIRROR_ID\"]" \
"$XML_FULLPATH"
</code></pre>
<p>The idea is from: <a href="https://stackoverflow.com/a/9172796/6102698">How to insert a new element under another with xmlstarlet?</a>.</p>
| 9,645
|
<p>in our application we have a Java applet running inside a .NET browser control. It is a know issue from Sun that running an applet this way may crash the control.</p>
<p>Has anyone come across the same problem and solved it?</p>
<p>Atm we are running the applet in a Webbrowser but we need to run it in a browser control.</p>
<p>Thx for any help.</p>
|
<p>After some time the problem solved itself.
It was indeed a bug in the java runtime which is now fixed by sun. Just make sure your JRE is > 1.6.10.</p>
|
<p>If you wrote the applet and have source, then you could try to migrate the Java Applet to a J# Browser control and stuff that in your .net application. </p>
<pre><code>Here is a link - http://msdn.microsoft.com/en-us/library/aa290083(VS.71).aspx
</code></pre>
| 9,726
|
<p>I've only done a bit of Flex development thus far, but I've preferred the approach of creating controls programmatically over mxml files, because (and <em>please</em>, correct me if I'm wrong!) I've gathered that you can't have it both ways -- that is to say, have the class functionality in a separate ActionScript class file but have the contained elements declared in mxml.</p>
<p>There doesn't seem to be much of a difference productivity-wise, but doing data binding programmatically seems somewhat less than trivial. I took a look at how the mxml compiler transforms the data binding expressions. The result is a bunch of generated callbacks and a lot more lines than in the mxml representation. So here's the question: <strong>is there a way to do data binding programmatically that doesn't involve a world of hurt?</strong></p>
|
<p>Don't be afraid of MXML. It's great for laying out views. If you write your own <em>reusable</em> components then writing them in ActionScript may sometimes give you a little more control, but for non-reusable views MXML is much better. It's more terse, bindings are extemely easy to set up, etc.</p>
<p>However, bindings in pure ActionScript need not be that much of a pain. It will never be as simple as in MXML where a lot of things are done for you, but it can be done with not too much effort.</p>
<p>What you have is <code>BindingUtils</code> and it's methods <code>bindSetter</code> and <code>bindProperty</code>. I almost always use the former, since I usually want to do some work, or call <code>invalidateProperties</code> when values change, I almost never just want to set a property.</p>
<p>What you need to know is that these two return an object of the type <code>ChangeWatcher</code>, if you want to remove the binding for some reason, you have to hold on to this object. This is what makes manual bindings in ActionScript a little less convenient than those in MXML.</p>
<p>Let's start with a simple example:</p>
<pre><code>BindingUtils.bindSetter(nameChanged, selectedEmployee, "name");
</code></pre>
<p>This sets up a binding that will call the method <code>nameChanged</code> when the <code>name</code> property on the object in the variable <code>selectedEmployee</code> changes. The <code>nameChanged</code> method will recieve the new value of the <code>name</code> property as an argument, so it should look like this:</p>
<pre><code>private function nameChanged( newName : String ) : void
</code></pre>
<p>The problem with this simple example is that once you have set up this binding it will fire each time the property of the specified object changes. The value of the variable <code>selectedEmployee</code> may change, but the binding is still set up for the object that the variable pointed to before.</p>
<p>There are two ways to solve this: either to keep the <code>ChangeWatcher</code> returned by <code>BindingUtils.bindSetter</code> around and call <code>unwatch</code> on it when you want to remove the binding (and then setting up a new binding instead), or bind to yourself. I'll show you the first option first, and then explain what I mean by binding to yourself.</p>
<p>The <code>currentEmployee</code> could be made into a getter/setter pair and implemented like this (only showing the setter):</p>
<pre><code>public function set currentEmployee( employee : Employee ) : void {
if ( _currentEmployee != employee ) {
if ( _currentEmployee != null ) {
currentEmployeeNameCW.unwatch();
}
_currentEmployee = employee;
if ( _currentEmployee != null ) {
currentEmployeeNameCW = BindingUtils.bindSetter(currentEmployeeNameChanged, _currentEmployee, "name");
}
}
}
</code></pre>
<p>What happens is that when the <code>currentEmployee</code> property is set it looks to see if there was a previous value, and if so removes the binding for that object (<code>currentEmployeeNameCW.unwatch()</code>), then it sets the private variable, and unless the new value was <code>null</code> sets up a new binding for the <code>name</code> property. Most importantly it saves the <code>ChangeWatcher</code> returned by the binding call.</p>
<p>This is a basic binding pattern and I think it works fine. There is, however, a trick that can be used to make it a bit simpler. You can bind to yourself instead. Instead of setting up and removing bindings each time the <code>currentEmployee</code> property changes you can have the binding system do it for you. In your <code>creationComplete</code> handler (or constructor or at least some time early) you can set up a binding like so:</p>
<pre><code>BindingUtils.bindSetter(currentEmployeeNameChanged, this, ["currentEmployee", "name"]);
</code></pre>
<p>This sets up a binding not only to the <code>currentEmployee</code> property on <code>this</code>, but also to the <code>name</code> property on this object. So anytime either changes the method <code>currentEmployeeNameChanged</code> will be called. There's no need to save the <code>ChangeWatcher</code> because the binding will never have to be removed.</p>
<p>The second solution works in many cases, but I've found that the first one is sometimes necessary, especially when working with bindings in non-view classes (since <code>this</code> has to be an event dispatcher and the <code>currentEmployee</code> has to be bindable for it to work).</p>
|
<p>there is a way that I usually use to use mxml and action script together: All my mxml components inherit from a action script class where I add the more complex code. Then you can refer to event listeners implemented in this class in the mxml file.</p>
<p>Regards,</p>
<p>Ruth</p>
| 3,501
|
<p>Does anyone have any experience with a tool that generates test strings from a BNF grammar that could then be fed into a unit test?</p>
|
<p>I don't have an answer to the tool question, but I will say it is fairly easy in any text processing language (perl/python/etc) to randomly generate sentences from a BNF grammar, and slightly more verbose in a bigger language (Java/C/etc), but it shouldn't be too hard to roll your own.</p>
<p>The problem with this, of course, is that it can only generate strings in the grammar, and unless your grammar is very simple, the test space is infinitely large.</p>
|
<p>If, say, you're developing a compiler, then you likely have an abstract syntax tree datatype. If so, then you could write a function to generate an random AST -- with that, you can print it to a string and feed that to your unit test. It's guaranteed to be a valid program this way, since you <em>started</em> with your AST.</p>
<p>If I were writing a compiler in Haskell or ML, this is what I would do, using <a href="http://www.cs.chalmers.se/~rjmh/QuickCheck/" rel="nofollow noreferrer">QuickCheck</a>.</p>
| 7,541
|
<p>I am using MS Access 2003. I want to run a lot of insert SQL statements in what is called 'Query' in MS Access. Is there any easy(or indeed any way) to do it?</p>
|
<p>yes and no.</p>
<p>You can't do:</p>
<pre><code>insert into foo (c1, c2, c3)
values ("v1a", "v2a", "v3a"),
("v1b", "v2b", "v3b"),
("v1c", "v2c", "v3c")
</code></pre>
<p>but you can do</p>
<pre><code>insert into foo (c1, c2, c3)
select (v1, v2, v3) from bar
</code></pre>
<p>What does that get you if you don't already have the data in a table? Well, you could craft a Select statement composed of a lot of unions of Selects with hard coded results. </p>
<pre><code>INSERT INTO foo (f1, f2, f3)
SELECT *
FROM (select top 1 "b1a" AS f1, "b2a" AS f2, "b3a" AS f3 from onerow
union all
select top 1 "b1b" AS f1, "b2b" AS f2, "b3b" AS f3 from onerow
union all
select top 1 "b1c" AS f1, "b2c" AS f2, "b3c" AS f3 from onerow)
</code></pre>
<p>Note: I also have to include a some form of a dummy table (e.g., onerow) to fool access into allowing the union (it must have at least one row in it), and you need the "top 1" to ensure you don't get repeats for a table with more than one row</p>
<p>But then again, it would probably be easier just to do three separate insert statements,
especially if you are already building things up in a loop (unless of course the cost of doing the inserts is greater than the cost of your time to code it).</p>
|
<p>Based on the VBA workaround from @Jonathan, and for execution in the current Access database:</p>
<pre class="lang-vb prettyprint-override"><code>Public Sub InsertMinimalData()
CurrentDb.Execute "INSERT INTO FinancialYear (FinancialYearID) VALUES ('FY2019/2020');"
CurrentDb.Execute "INSERT INTO FinancialYear (FinancialYearID) VALUES ('FY2020/2021');"
End Sub
</code></pre>
| 8,796
|
<p>I've successfully installed <code>mjpg-streamer-experimental</code> from <a href="https://github.com/jacksonliam" rel="nofollow noreferrer">jacksonliam</a>/<a href="https://github.com/jacksonliam/mjpg-streamer" rel="nofollow noreferrer"><strong>mjpg-streamer</strong></a>.</p>
<p>I just can't figure out how to set the parameter I need in order to rotate my camera 180 degrees (I have my webcam mounted upside down for a custom mount I made).</p>
<p>I'm using a Logitech C270. I've been searching online for hours for a solution to this issue and just can't find what I'm looking for. Doesn't help that I'm not very proficient when it comes to this stuff.</p>
<hr />
<p>If I run the command suggested in GiF's <a href="https://3dprinting.stackexchange.com/a/4823/4762">answer</a>:</p>
<pre><code>mjpg_streamer -i 'input_uvc.so -rot 180'
</code></pre>
<p>I get the following error:</p>
<pre><code> libv4l2: error setting pixformat: Device or resource busy Unable to set format: 1196444237 res: 640x480 Init v4L2 failed !! exit fatal i: init_VideoIn failed
</code></pre>
<p>I seem to get that error when setting any parameters. I'm running Octoprint, if that makes any difference. There doesn't seem to be a rotate option in Octoprint.</p>
<p>Information just seems extremely sparse on this particular fork of mjpg-streamer. Searching for that error just gets me a bunch of people that have non-working webcams while mine works perfectly, I just need to rotate it 180 degrees.</p>
<hr />
<p>I would <em>really</em> appreciate some help!</p>
|
<p><strong>Edit: Having now installed Octopi myself, I have found that they made it easy to rotate the image right from the interface. If you open the "Settings" and look under "Webcam & Timelapse", there are settings for flipping the image horizontally or vertically and for rotating 90 degrees.</strong></p>
<hr />
<p>There are a few ways to rotate the image of which I am aware. You can do it via the input plugin, the client, or post-processing.</p>
<p>The "input_uvc" and "input_raspicam" plugins both have options to rotate the image. If you are using one of these plugins see the documentation at <a href="https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental/plugins/input_uvc/README.md" rel="nofollow noreferrer">input_uvc</a> or <a href="https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental/plugins/input_raspicam/README.md" rel="nofollow noreferrer">input_raspicam</a> (it is worth noting that the input options may not be supported by all cameras). You should be able to run the command like the following to get a stream that is rotated 180 degrees:</p>
<pre><code>mjpg_streamer -i 'input_uvc.so -rot 180'
</code></pre>
<p>I'm not sure how you are handling the stream, but it is possible that your client can perform the rotation. For example, if you are using VLC you can set the angle of rotation by doing something like this:</p>
<ul>
<li>Open the “Tools” menu and select “Effects and Filters”</li>
<li>In the “Adjustments and Effects” window, on the “Video Effects” tab, select the “Transform” check box</li>
<li>Select a rotation from the dropdown menu and then click “Close”.</li>
</ul>
<p>Finally, if you are saving the stream and are only concerned with rotating it afterwards, you can post-process it with a utility like <code>ffmpeg</code>. See this <a href="https://superuser.com/questions/578321/how-to-rotate-a-video-180-with-ffmpeg">post</a> as an example and look for "Rotate" in the accepted answer.</p>
<p>If your stream is being rendered via a browser you may be able to add some CSS3 formatting to the video element. For example, you could add an ID of <code>videoElement</code> to the stream and then add the following to your CSS:</p>
<pre><code> #videoElement {
transform: rotateZ(180deg);
-webkit-transform:rotateZ(180deg); /* Safari and Chrome */
-moz-transform:rotateZ(180deg); /* Firefox */
}
</code></pre>
<p>With respect to Octoprint, it appears that Octoprint is an HTML interface, so you could probably edit the markup to use CSS3's transform <code>rotateX</code>. That would rotate the image at the client end (browser). BTW, googling for your error code did have some potentially useful information as well.</p>
|
<p>From the <code>help</code> for input plugin "<strong>raspicam</strong>", the following parameters can be passed to this plugin:</p>
<pre><code>[-fps | --framerate]...: set video framerate, default 5 frame/sec
[-x | --width ]........: width of frame capture, default 640
[-y | --height]........: height of frame capture, default 480
[-quality].............: set JPEG quality 0-100, default 85
[-usestills]...........: uses stills mode instead of video mode
[-preview].............: Enable full screen preview
[-timestamp]...........: Get timestamp for each frame
</code></pre>
<pre><code>-sh : Set image sharpness (-100 to 100)
-co : Set image contrast (-100 to 100)
-br : Set image brightness (0 to 100)
-sa : Set image saturation (-100 to 100)
-ISO : Set capture ISO
-vs : Turn on video stablisation
-ev : Set EV compensation
-ex : Set exposure mode (see raspistill notes)
-awb : Set AWB mode (see raspistill notes)
-ifx : Set image effect (see raspistill notes)
-cfx : Set colour effect (U:V)
-mm : Set metering mode (see raspistill notes)
-rot : Set image rotation (0-359)
-stats : Compute image stats for each picture (reduces noise for -usestills)
-drc : Dynamic range compensation level (see raspistill notes)
-hf : Set horizontal flip
-vf : Set vertical flip
</code></pre>
<p>The <strong>-rot</strong> parameter can rotate the image.</p>
| 715
|
<p>We're building a CMS. The site will be built and managed by the users in aspx pages, but we would like to create a static site of HTML's.
The way we're doing it now is with code I found <a href="http://forums.asp.net/p/931180/1092188.aspx#1092188" rel="nofollow noreferrer">here</a> that overloads the Render method in the Aspx Page and writes the HTML string to a file. This works fine for a single page, but the thing with our CMS is that we want to automatically create a few HTML pages for a site right from the start, even before the creator has edited anything in the system.
Does anyone know of any way to do this?</p>
|
<p>Calling the <code>Render</code> method is still pretty simple. Just create an instance of your page, create a stub <code>WebContext</code> along with the <code>WebRequest</code> object, and call the <code>Render</code> method of the page. You are then free to do whatever you want with the results.</p>
<p>Alternatively, write a little <code>curl</code> or <code>wget</code> script to download and store whichever pages you want to make static.</p>
|
<p>@ckarras: I would rather not use an external tool, because I want the HTML pages to be created programmatically and not manually.</p>
<p>@jttraino: I don't have a time interval in which the site needs to be outputted- the uotput has to occur when a user creates a new site.</p>
<p>@Frank Krueger: I don't really understand how to create an instance of my page using WebContext and WebRequest. </p>
<p>I searched for "wget" in <a href="http://www.searchdotnet.com" rel="nofollow noreferrer">searchdotnet</a>, and got to <a href="http://forums.asp.net/p/540670/540744.aspx#540744" rel="nofollow noreferrer">a post</a> about a .net class called WebClient. It seems to do what I want if I use the DownloadString() method - gets a string from a specific url. The problem is that because our CMS needs to be logged in to, when the method tries to reach the page it's thrown to the login page, and therefore returns the login.aspx HTML...</p>
<p>Any thoughts as to how I can continue from here?</p>
| 8,017
|
<p>I picked up a roll of Overture matte black PLA, and the surface of both the filament and the printed object <em>feel like</em> paper. This made me wonder if it contains wood-based fibers like "wood PLA" does, and if so, whether it's abrasive and harmful to the nozzle. In the past I wouldn't have cared, but I'm using a CHT now and would like to avoid ruining it since it's expensive and I don't have spares sitting around.</p>
|
<p>You may be experiencing the feel of paper, which is typically a matte surface, when feel testing the printed item, as both would be matte. A search for your focus found one purchaser of this product (via Amazon) has <a href="https://www.amazon.com/ask/questions/asin/B089S2QDHD/2/ref=ask_dp_iaw_ql_hza?isAnswered=true#question-Tx2BUDAMGRBE1M0" rel="nofollow noreferrer">left an answer addressing this question</a>. The answer is on the last page of Q/A and is accompanied by another answer suggesting the white filament is abrasive. One has to click "see 2 more answers" in order to locate the quoted answer.</p>
<p>His reply was that he has printed 8 spools and found no deterioration of his nozzle.</p>
<blockquote>
<p>Not any more than any other PLA. I've gone through 8 rolls of this PLA so
far with no noticeable degradation of my nozzle. D. DAmico · September
30, 2021</p>
</blockquote>
<p>My own suspicion is that the filament has a chemical additive to create the matte finish, rather than any particulate that might cause abrasion.</p>
|
<p>At least one filament manufacturer, Protopasta, documents their <a href="https://www.proto-pasta.com/collections/all/products/high-performance-htpla-matte-fiber" rel="nofollow noreferrer">"matte fiber HTPLA"</a> as "containing plant fibers" but also documents that</p>
<blockquote>
<p>Matte Fiber does NOT require a wear resistant nozzle.</p>
</blockquote>
<p>So I think fred_dot_u's suspicion that the finish is produced by a chemical additive is probably false; it looks like these finishes are created with something similar to wood, but softer than brass so that it's non-abrasive.</p>
<p>This also suggests that matte finish filaments (at least the ones that feel paper-like) might have additional benefits beyond cosmetic, such as the fibers helping to resist warping while the extruded material is cooling, which seems to match my experience using it (less sensitive to cooling performance than normal PLA).</p>
| 2,105
|
<p>On my Reprap-like 3D printer, I routed all the wires to a spot near the base; for the motors, endstops, thermistors, etc, I plugged them all into a <a href="http://rads.stackoverflow.com/amzn/click/B00V7S79BW" rel="noreferrer">DB25 breakout board</a>, and that's working great.</p>
<p>For my Extruder (12v), and my heat bed (16v), I'm using a 4-pin molex connector -- like we used to use for old hard drives and such, and it's working, but it gets a bit hot, and my print bed is having trouble reaching temperatures that it didn't have trouble with before. -- None of the wiring gets hot at any other point, and none of the other connectors get hot. -- The only thing that gets hot is this one molex connector.</p>
<p>I believe the heat is caused by passing too much current through that molex connector. -- I'm curious to know what other connectors might be better suited to this task. Can you recommend something that's worked well for you, or others?</p>
<p>I prefer not to double or triple up this connector if it can be avoided, so that I can just have one physical connector to disconnect there, and so that I don't end up mixing them up. -- also, being able to easily disconnect it is important (it's hard to work on the reprap if I can't spin it around or turn it over, etc., that's why I'm using connectors for everything).</p>
|
<p>You might be able to use one of the connectors (Deans Ultra, EC3, XT-60/30, Bullet) that are normally used for RC models. They're made for very high currents. The XT60 connectors depicted below are rated for 60A continuous (well above what you'd need for any heated bed); their smaller XT30 cousins are good for 30A but less commonly available.</p>
<p><a href="https://i.stack.imgur.com/LwWw6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LwWw6.png" alt="XT60 Connector"></a>
(Photo by Mark Fickett)</p>
<p>For your extruder you wouldn't need anything quite as drastic as an XT60, even a simple JST connector would suffice (though if you are going to source XT60/30's for your heated bed anyway, you might use them here as well).</p>
<p><a href="https://i.stack.imgur.com/uhsNc.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/uhsNc.jpg" alt="JST Connector"></a>
(Wikimedia Commons, Mike Mahoney)</p>
|
<p>I agree with Tom's answer about RC connectors. Another good connector option worth considering is Anderson Powerpoles.</p>
<ul>
<li>They're "modular" so you can use them to assemble connectors with multiple wires.</li>
<li>They crimp instead of solder (I really recommend the special crimping tool if you plan to use these regularly)</li>
<li>They're more expensive</li>
<li>No male/female, you use the same connector on both ends so you never run out of either male or female ends.</li>
<li>The small size is a little larger than an XT60 connector.</li>
</ul>
<p><a href="https://i.stack.imgur.com/uSmdJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uSmdJ.jpg" alt="Anderson Powerpole connectors next to XT60"></a></p>
<p>Both good options depending on your specific needs.</p>
| 396
|
<p>The ASP page gets data uses that to draw a graph, I then need to save the image created to JPEG to be displayed on the browser and also used in PDF and other format. What is the best way to compress the image? I am currently porting a JPEG compression library to ASP but I think it will be too slow on this ARM device running Windows CE 6.0.</p>
<p>So, the ASP page, running in Windows CE webservers, gets data, renders it into a bitmap image than then needs to be delivered to the browser accessing that ASP page. The same image is also used in PDF and one other proprietary format that can contain JPEG streams.</p>
<p>Edit:
What I am looking for is to way to create an array representing a bitmap and then compressing it to JPEG with ASP in Windows CE's IIS which has quite limited ASP implementation.</p>
|
<p>Take a look at the Imaging APIs (start your traversal at the <a href="http://msdn.microsoft.com/en-us/library/aa452202.aspx" rel="nofollow noreferrer">IImagingFactory interface</a>). If your device has a JPG compression codec installed (remember that CE is modular, so it may or may not be present) you can use it to create a stream (or file) from the image. From there you can do with it what you wish.</p>
|
<p>I'm confused... </p>
<p>The images from ASP would be compressed on the server side--not client side. </p>
<p>I'm sure your web server is not running on Windows CE, so I don't think your concern is warranted.</p>
<p><strong>EDIT:</strong> Seems as though you can run a web server on Windows CE: <a href="http://www.microsoft.com/windows/embedded/products/windowsce/default.mspx" rel="nofollow noreferrer">http://www.microsoft.com/windows/embedded/products/windowsce/default.mspx</a>. I'll keep my thoughts to myself from now on. :-x</p>
| 6,141
|
<p>I've been printing with my Ender 3 for a while now and it's been great. I've had very few problems - depending on my settings, these are my typical first layers:<a href="https://i.stack.imgur.com/GGhr1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GGhr1.jpg" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/26XCJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/26XCJ.jpg" alt="enter image description here"></a></p>
<p>However with no settings or temperature changes and attempting to print the same files, I am now getting this issue with every print - The lines lay down and adhere fine, but if I watch carefully it looks as if the nozzle is causing the previous line to lift and warp. I have checked belt tensions, calibrated all axes.
<a href="https://i.stack.imgur.com/IfIUS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IfIUS.jpg" alt="enter image description here"></a></p>
<p>The prints come out fine in terms of dimensions - all within 0.1 mm overall size on large prints - but the quality is now terrible. I'm using the same roll. Prints were back-to-back and humidity is at 20 % in the room I store and print in. I've checked the nozzle, checked the belts, tightened everything, rest the printer settings and put them back, regenerated the G-code with multiple slicers... I'm at a loss now. </p>
<p>Any ideas, thoughts, comments, etc would be greatly appreciated. </p>
|
<p>After watching it countless times, I found out that it was the magnetic mat on the bed that has worn out. It no longer adheres to the bed completely flat and some of the texture was worn down more than in other areas. It wasn't visually detectable - I found it by checking the nozzle height with various feeler gauges in multiple random locations.</p>
|
<p>When my printer suddenly started to underextrude, it was the fault of the extruder lever being broken and not pushing out enough material. Replacing the extruder for a metal version did fix it.</p>
<p>Another common issues that can result in bad adhesion is a greasy or destroyed build surface. Such is fixed with cleaning or replacing the part.</p>
| 1,514
|
<p>In WindowsForms world you can get a list of available image encoders/decoders with</p>
<pre><code>System.Drawing.ImageCodecInfo.GetImageDecoders() / GetImageEncoders()
</code></pre>
<p>My question is, is there a way to do something analogous for the WPF world that would allow me to get a list of available </p>
<pre><code>System.Windows.Media.Imaging.BitmapDecoder / BitmapEncoder
</code></pre>
|
<p>You've got to love .NET reflection. I worked on the WPF team and can't quite think of anything better off the top of my head. The following code produces this list on my machine:</p>
<pre><code>Bitmap Encoders:
System.Windows.Media.Imaging.BmpBitmapEncoder
System.Windows.Media.Imaging.GifBitmapEncoder
System.Windows.Media.Imaging.JpegBitmapEncoder
System.Windows.Media.Imaging.PngBitmapEncoder
System.Windows.Media.Imaging.TiffBitmapEncoder
System.Windows.Media.Imaging.WmpBitmapEncoder
Bitmap Decoders:
System.Windows.Media.Imaging.BmpBitmapDecoder
System.Windows.Media.Imaging.GifBitmapDecoder
System.Windows.Media.Imaging.IconBitmapDecoder
System.Windows.Media.Imaging.LateBoundBitmapDecoder
System.Windows.Media.Imaging.JpegBitmapDecoder
System.Windows.Media.Imaging.PngBitmapDecoder
System.Windows.Media.Imaging.TiffBitmapDecoder
System.Windows.Media.Imaging.WmpBitmapDecoder
</code></pre>
<p>There is a comment in the code where to add additional assemblies (if you support plugins for example). Also, you will want to filter the decoder list to remove:</p>
<pre><code>System.Windows.Media.Imaging.LateBoundBitmapDecoder
</code></pre>
<p>More sophisticated filtering using constructor pattern matching is possible, but I don't feel like writing it. :-)</p>
<p>All you need to do now is instantiate the encoders and decoders to use them. Also, you can get better names by retrieving the <code>CodecInfo</code> property of the encoder decoders. This class will give you human readable names among other factoids.</p>
<pre><code>using System;
using System.Linq;
using System.Collections.Generic;
using System.Reflection;
using System.Windows.Media.Imaging;
namespace Codecs {
class Program {
static void Main(string[] args) {
Console.WriteLine("Bitmap Encoders:");
AllEncoderTypes.ToList().ForEach(t => Console.WriteLine(t.FullName));
Console.WriteLine("\nBitmap Decoders:");
AllDecoderTypes.ToList().ForEach(t => Console.WriteLine(t.FullName));
Console.ReadKey();
}
static IEnumerable<Type> AllEncoderTypes {
get {
return AllSubclassesOf(typeof(BitmapEncoder));
}
}
static IEnumerable<Type> AllDecoderTypes {
get {
return AllSubclassesOf(typeof(BitmapDecoder));
}
}
static IEnumerable<Type> AllSubclassesOf(Type type) {
var r = new Reflector();
// Add additional assemblies here
return r.AllSubclassesOf(type);
}
}
class Reflector {
List<Assembly> assemblies = new List<Assembly> {
typeof(BitmapDecoder).Assembly
};
public IEnumerable<Type> AllSubclassesOf(Type super) {
foreach (var a in assemblies) {
foreach (var t in a.GetExportedTypes()) {
if (t.IsSubclassOf(super)) {
yield return t;
}
}
}
}
}
}
</code></pre>
|
<p>Hopefully someone will correct me if I'm wrong, but I don't think there's anything like that in WPF. But hopefully this is one of the many cases where advances in the technology have rendered obsolete the way we're used to doing things. Like "how do I wind my digital watch?"</p>
<p>To my understanding, the reason why ImageCodecInfo.GetImageDecoders() is necessary in System.Drawing has to do with the kludgy nature of System.Drawing itself: System.Drawing is a managed wrapper around GDI+, which is an unmanaged wrapper around a portion of the Win32 API. So there might be a reason why a new codec would be installed in Windows without .NET inherently knowing about it. And what's returned from GetImageDecoders() is just a bunch of strings that are typically passed back into System.Drawing/GDI+, and used to find and configure the appropriate DLL for reading/saving your image.</p>
<p>On the other hand, in WPF, the standard encoders and decoders are built into the framework, and, if I'm not mistaken, don't depend on anything that that isn't guaranteed to be installed as part of the framework. The following classes inherit from BitmapEncoder and are available out-of-the-box with WPF: BmpBitmapEncoder, GifBitmapEncoder, JpegBitmapEncoder, PngBitmapEncoder, TiffBitmapEncoder, WmpBitmapEncoder. There are BitmapDecoders for all the same formats, plus IconBitmapDecoder and LateBoundBitmapDecoder.</p>
<p>You may be dealing with a case I'm not imagining, but it seems to me that if you're having to use a class that inherits from BitmapEncoder but wasn't included with WPF, it's probably your own custom class that you would install with your application.</p>
<p>Hope this helps. If I'm missing a necessary part of the picture, please let me know.</p>
| 3,578
|
<p>I may just be missing this functionality, but does anyone know if there is a widget available:</p>
<p>I need to list the subject for all the entries that are associated with a given tag.</p>
<p>For example: I have 5 articles tagged with "Tutorial", I'd like to see a list as follows:</p>
<ul>
<li>Tutorial 1: Installing the app</li>
<li>Tutorial 2: Customizing</li>
<li>Tutorial 3: Advanced edits</li>
<li>Tutorial 4: User managment</li>
</ul>
<p>Does functionality like this exists in wordpress allready?</p>
|
<p>I don't think this is a concern.</p>
<p>Yes, the mythical "somebody" can replace the implementation of MD5 with something insecure. But in order to do that, the mythical somebody must actually be able to get his code into the Ruby process. And if he can do that, then he presumably could also inject his code into a Java process and e.g. rewrite the bytecode for the MD5 operation. Or just intercept the keypresses and not actually bother with fiddling with the cryptography code at all.</p>
<p>One of the typical concerns is: I'm writing this awesome library, which is supposed to be used like so:</p>
<pre><code>require 'awesome'
# Do something awesome.
</code></pre>
<p>But what if someone uses it like so:</p>
<pre><code>require 'evil_cracker_lib_from_russian_pr0n_site'
# Overrides crypto functions and sends all data to mafia
require 'awesome'
# Now everything is insecure because awesome lib uses
# cracker lib instead of builtin
</code></pre>
<p>And the simple solution is: don't do that! Educate your users that they shouldn't run untrusted code they downloaded from obscure sources in their security critical applications. And if they do, they probably deserve it.</p>
<p>To come back to your Java example: it's true that in Java you can make your crypto code <code>private</code> and <code>final</code> and what not. However, someone can <em>still</em> replace your crypto implementation! In fact, someone actually did: many open-source Java implementations use OpenSSL to implement their cryptographic routines. And, as you probably know, Debian shipped with a broken, insecure version of OpenSSL for years. So, all Java programs running on Debian for the past couple of years actually <em>did</em> run with insecure crypto!</p>
|
<p>If someone monkeypatched an object or a module, then you need to look at 2 cases: He added a new method. If he is the only one adding this meyhod (which is very likely), then no problems arise. If he is not the only one, you need to see if both methods do the same and tell the library developer about this severe problem.</p>
<p>If they change a method, you should start to research why the method was changed. Did they change it due to some edge case behaviour or did they actually fix a bug? especially in the latter case, the monkeypatch is a god thing, because it fixes a bug in many places.</p>
<p>Besides that, you are using a very dynamic language with the assumption that programmers use this freedom in a sane way. The only way to remove this assumption is not to use a dynamic language. </p>
| 5,225
|
<p>What is the best solution of defaultButton and "Enter key pressed" for ASP.NET 2.0-3.5 forms?</p>
|
<p>Just add the "defaultbutton" attribute to the form and set it to the ID of the button you want to be the default. </p>
<pre><form defaultbutton="button1" runat="server">
<asp:textbox id="textbox1" runat="server"/>
<asp:button id="button1" text="Button1" runat="server"/>
</form> </pre>
<p>NOTE: This only works in ASP.NET 2.0+</p>
|
<p>Just add the "defaultbutton" attribute to the form and set it to the ID of the button you want to be the default. </p>
<pre><form defaultbutton="button1" runat="server">
<asp:textbox id="textbox1" runat="server"/>
<asp:button id="button1" text="Button1" runat="server"/>
</form> </pre>
<p>NOTE: This only works in ASP.NET 2.0+</p>
| 9,425
|
<p>I want to know what are the options to do some scripting jobs in windows platform.
I need functionality like file manipulations, registry editing etc. Can files be edited using scripting tools?
What other functionality does windows scripting tools offer?
Can everything that can be done using the Windows GUI be done using a scripting language?</p>
|
<p>I think <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" rel="nofollow noreferrer">Windows PowerShell</a> from Microsoft is the current favourite for this sort of thing.</p>
|
<p>Yesterday I could have repaired this for you ;)</p>
<blockquote>
<p>What all are the tools/languages for
windows shell scripting?</p>
</blockquote>
<p>Would read better as</p>
<blockquote>
<p>What tools and languages are available
for windows shell scripting?</p>
</blockquote>
| 5,204
|
<p>I found this question, <a href="https://3dprinting.stackexchange.com/questions/10010/laser-is-engraving-the-negative-space">laser is engraving the negative space</a> in the close queue this morning as being off topic. I was about to respond, and through I'd look at the community view on meta. I found this question and answer: <a href="https://3dprinting.meta.stackexchange.com/questions/67/fdm-printer-that-can-also-mill-and-engrave-whats-in-scope/68#68">FDM printer that can also mill and engrave -- what's in scope?</a>, and this META discussion <a href="https://3dprinting.meta.stackexchange.com/questions/349/is-it-possible-to-expand-the-scope-of-this-site">Is it possible to expand the scope of this site?</a> which suggests that it would be on topic.</p>
<p>What should I do with the question? As a relatively low-reputation participant, I want to defer to the greater experience.</p>
<p>Many of the problems of 3D printing and laser etching are similar, but not all. The equipment is much like FDM 3D printers, with some differences. How finely should we diagnose the nature of the problem before deciding if it is on topic?</p>
|
<p><strong>I say allow them.</strong> </p>
<p>To let you know what's out there, I work at <a href="http://hyrel3d.com" rel="nofollow noreferrer">Hyrel</a>. </p>
<p>Our printers can take <a href="https://www.youtube.com/watch?v=B0lvN-aPYHI" rel="nofollow noreferrer">spindle (milling) heads and additional axes</a>, and even <a href="https://www.youtube.com/watch?v=OceUiuTixPA" rel="nofollow noreferrer">diode</a> and <a href="https://youtu.be/FnYDoNkgOrI" rel="nofollow noreferrer">CO2 lasers</a>, and they all operate on the same gcode - we tell people E is for Emit as well as Extrude. We even have a <a href="https://www.youtube.com/watch?v=azFY-IqDB_0" rel="nofollow noreferrer">TIG welding</a> attachment. </p>
<p>We also run our <a href="https://www.youtube.com/watch?v=KIGeQmXNbNE" rel="nofollow noreferrer">Fadal CNC machines</a> on our printer software and firmware. </p>
<p>To many people this is a natural progression for a well-built 3D positioning system, and I encourage a broader definition.</p>
|
<p>This is a tricky one, as 3d printers are starting to be bundled with lasers. Note those kits will totally blind you. 3d printers are being bundled with everything, really if you look at the things <a href="http://diabasepe.com/" rel="nofollow noreferrer">http://diabasepe.com/</a> is making. (Cool guys btw)</p>
<p>However. To me this is the same as asking about a woodburning kit question in an electronics forum, because they both use soldering irons. If we allow a removal base machines, such as lasers, we will also have to allow discussions about CNC machines.</p>
<p>In the case of that question, they would get bonus points if it was a pure gcode question. Maybe even if it was on a multi use machine.. Instead its asking us to debug their laser setup. Thats not really formatted for stackoverflow anyways. They need to go to a forum. Also as someone that once made a Cheap Chinese laser cutter use a RAMPS 1.4 board, I know exactly how similar they are. But in the end, additive manufacturing isn't this kind of laser (as we have SLA and powder printing)</p>
<p>At first I was this is dead simple not on topic. Thinking about laser and 3d printing is a good counter arguments, but that is not what this topic is. It is not additive manufacturing, and its not being done to a part which was additively made. </p>
<p>I think its a firm off topic. </p>
| 66
|
<p>Has anyone had any success running two different web servers -- such as Apache and CherryPy -- alongside each other on the same machine? I am experimenting with other web servers right now, and I'd like to see if I can do my experiments while keeping my other sites up and running. You could say that this isn't so much a specific-software question as it is a general networking question.</p>
<ul>
<li>I know it's possible to run two web servers on different ports; but is there any way to configure them so that they can run on the <em>same port</em> (ie, they both run on port 80)?</li>
<li>The web servers would <em>not</em> be serving files from the same domains. For example, Apache might serve up documents from foo.domain.com, and the other web server would serve from bar.domain.com.</li>
</ul>
<p>I do know that this is not an ideal configuration. I'd just like to see if it can be done before I go sprinting down the rabbit hole. :) </p>
|
<p>You can't have two processes bound to the same port on the same IP address. You can add another IP address to the box and have each server listen on one.</p>
<p>Another option is to proxy pass one server to the other. With Apache, you could do something like:</p>
<pre><code>NameVirtualHost *
<virtualhost *>
ServerName other.site.com
# assumes CherryPy listens on port 8080
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</Virtualhost>
</code></pre>
<p>That's a pretty quick example, but you can always check the <a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy.html" rel="noreferrer">ProxyPass documentation</a>. Remember though, the application being proxyed to will get 127.0.0.1 in it's logs instead of the requester's IP address. Some web servers (apache does with <a href="http://stderr.net/apache/rpaf/" rel="noreferrer">mod_rpaf</a>) can substitute the X-Forwarded-For header in place of the wrong IP address. Possibly CherryPy has this?</p>
|
<p>Your best bet would be putting Apache httpd in front of port 80 and relay requests meant for other servers through Apache by using modules. Most popular scenario would be Tomcat behind Apache where you'll be able to run both php and jsp applications.</p>
<p>I'm not familiar with CherryPy, so I can only suggest you look for an Apache module for CherryPy.</p>
<p>Edit: This looks promising: <a href="http://tools.cherrypy.org/wiki/BehindApache" rel="nofollow noreferrer">http://tools.cherrypy.org/wiki/BehindApache</a></p>
| 4,357
|
<p>I have a WCF service that gets called from client side JavaScript. The call fails with a Service is null JavaScript error. WebDevelopment helper trace shows that the calls to load the jsdebug support file results in a 404 (file not found) error. </p>
<p>Restarting IIS or clearing out the Temp ASP.Net files or setting batch="false" on the compilation tag in web.config does not resolve the problem</p>
<p>From the browser </p>
<p><a href="https://Myserver/MyApp/Services/MyService.svc" rel="nofollow noreferrer">https://Myserver/MyApp/Services/MyService.svc</a> displays the service metadata</p>
<p>however </p>
<p><a href="https://Myserver/MyApp/Services/MyService.svc/jsdebug" rel="nofollow noreferrer">https://Myserver/MyApp/Services/MyService.svc/jsdebug</a> results in a 404.</p>
<p>The issue seems to be with the https protocol. With http /jsdebug downloads the supporting JS file.</p>
<p>Any ideas?</p>
<p>TIA</p>
|
<p>Figured it out!</p>
<p>Here is the services configuration section from web.config</p>
<p>Look at the bindingConfiguration attribute on the endpoint. The value "webBinding" points to the binding name="webBinding" tag in the bindings and that is what tells the service to use Transport level security it HTTPS. In my case the attribute value was empty causing the webservice request to the /js or /jsdebug file over HTTPS to fail and throw a 404 error.</p>
<pre><code><services>
<service name="MyService">
<endpoint address="" behaviorConfiguration="MyServiceAspNetAjaxBehavior" binding="webHttpBinding" bindingConfiguration="webBinding" contract="Services.MyService" />
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="webBinding">
<security mode="Transport">
</security>
</binding>
</webHttpBinding>
</bindings>
</code></pre>
<p>Note that the bindingConfiguration attribute should be empty ("") if the service is accessed via http instead of https (when testing on local machine with no certs)</p>
<p>Hope this helps someone.</p>
|
<p>If you still get the same error after all your possible work done. Just add a "AJAX Enabled WCF-Service".</p>
| 8,368
|
<p>While the C# spec does include a pre-processor and basic directives (#define, #if, etc), the language does not have the same flexible pre-processor found in languages such as C/C++. I believe the lack of such a flexible pre-processor was a design decision made by Anders Hejlsberg (although, unfortunately, I can't find reference to this now). From experience, this is certainly a good decision, as there were some really terrible un-maintainable macros created back when I was doing a lot of C/C++. </p>
<p>That said, there are a number of scenarios where I could find a slightly more flexible pre-processor to be useful. Code such as the following could be improved by some simple pre-processor directives:</p>
<pre><code>public string MyProperty
{
get { return _myProperty; }
set
{
if (value != _myProperty)
{
_myProperty = value;
NotifyPropertyChanged("MyProperty");
// This line above could be improved by replacing the literal string with
// a pre-processor directive like "#Property", which could be translated
// to the string value "MyProperty" This new notify call would be as follows:
// NotifyPropertyChanged(#Property);
}
}
}
</code></pre>
<p>Would it be a good idea to write a pre-processor to handle extremely simple cases like this? Steve McConnell wrote in <a href="https://rads.stackoverflow.com/amzn/click/com/0735619670" rel="nofollow noreferrer" rel="nofollow noreferrer">Code Complete</a> (p208):</p>
<blockquote>
<p><em>Write your own preprocessor</em> If a language doesn't include a preprocessor, it's fairly easy to write one...</p>
</blockquote>
<p>I am torn. It was a design decision to leave such a flexible pre-processor out of C#. However, an author I highly respect mentions it may be ok in some circumstances.</p>
<p><strong>Should I build a C# pre-processor? Is there one available that does the simple things I want to do?</strong></p>
|
<p>Consider taking a look at an aspect-oriented solution like <a href="http://www.postsharp.org/" rel="noreferrer">PostSharp</a>, which injects code after the fact based on custom attributes. It's the opposite of a precompiler but can give you the sort of functionality you're looking for (PropertyChanged notifications etc).</p>
|
<p>If you are ready to ditch C# you might want to check out the <a href="http://boo.codehaus.org/" rel="nofollow noreferrer">Boo</a> language which has incredibly flexible <a href="http://boo.codehaus.org/Part+17+-+Macros" rel="nofollow noreferrer">macro</a> support through <a href="http://en.wikipedia.org/wiki/Abstract_syntax_tree" rel="nofollow noreferrer">AST</a> (Abstract Syntax Tree) manipulations. It really is great stuff if you can ditch the C# language.</p>
<p>For more information on Boo see these related questions:</p>
<ul>
<li><a href="https://stackoverflow.com/questions/116654/best-non-c-language-for-generative-programming">Non-C++ languages for generative programming?</a></li>
<li><a href="https://stackoverflow.com/questions/595593/who-is-using-boo-programming-language">https://stackoverflow.com/questions/595593/who-is-using-boo-programming-language</a></li>
<li><a href="https://stackoverflow.com/questions/193862/boo-vs-ironpython">Boo vs. IronPython</a></li>
<li><a href="https://stackoverflow.com/questions/172793/good-dynamic-programing-language-for-net-recommendation">Good dynamic programming language for .net recommendation</a></li>
<li><a href="https://stackoverflow.com/questions/206539/what-can-boo-do-for-you">What can Boo do for you?</a></li>
</ul>
| 5,790
|
<p>After I updated the firmware on my Prusa i3, the Bed won't switch off anymore. It worked perfectly before the update, but now, the moment I power up my printer, the LED on the bed turns on and it starts heating up. The manual control in Repetier Host doesn't turn if off or on and I even tried g-codes <code>M140 S0</code> as well as <code>M0</code>, but it does not switch it off.</p>
<p><strong>Edit:</strong>
I have an Arduino Mega2560 with a RAMPS shield. The Marlin firmware came pre-configured from the store I bought the kit from.</p>
|
<p>To answer the main question "Is ABS better for structural parts of a 3D printer as opposed to PLA".</p>
<p>The answer, unfortunately is it depends.</p>
<p>ABS has lower yield and ultimate strengths compared to PLA. This means that at room temperatures, ABS is weaker than PLA. However the difference between yield and ultimate for ABS is much larger than PLA, meaning that ABS parts will deform, noticeably so before breaking. This <em>can</em> be a good thing. If your ABS part is highly loaded, you may want to be able to inspect it for overloading. The plastic deformation that occurs in ABS may be sufficient for you to identify, and modify your parts before a catastrophic failure. With PLA though since the two strengths are quite close, your part would more than likely fail completely without any warning or deformation before it. So in terms of strength, it's a design consideration. Would you rather have a slightly weaker part that shows signs of load failure, or is a catastrophic failure acceptable. There are use cases where either may be better.</p>
<p>As Ecnerwal pointed out, PLA has a lower Tg (glass transition temperature) compared to ABS. If your printed parts are going on a 3D printer and aren't sufficiently isolated from the hot parts (print bed or extruder) then you may end up having some localized deformation. That being said, the extruder is generally pretty localized and likely won't cause you too many issues assuming you're using any of the already available 3D printer designs out there, same for the print bed. However by the sounds of it your 'room' temperature is a fair bit higher than here in North America, by a factor of almost 2! This <em>could</em> cause you some issues if you're printing parts in the high heat with PLA. Your best option would be ABS, but even with it's higher Tg (roughly 90C if I remember correctly) you may still run into issues. </p>
<p>The warping and shrinkage issues mentioned in the question seem to be more about parts being built by a 3D printer. Once the parts are built warpage and shrinkage are essentially a non-issue unless you've heated parts back to within their melting temperatures.</p>
<p>Depending on where you're getting your plastic parts, there may be a third option. By the sounds of it you're looking at building your own printer. You may be able to get the STL files of the printed parts you need and then have someone print them for you in a stronger material such as Nylon. </p>
<p>Assuming alternative materials aren't an option I would personally suggest going with ABS for your use case. My reasoning is purely due to the potential operating temperatures. While 50C is below the Tg for PLA it's getting very close.</p>
|
<p>Actually, Both PLA and ABS could use for structural parts. PLA has high strength and is brittleness. ABS has better thermal resistance and durable. <a href="https://ecoreprap.com/pla-vs-abs/" rel="nofollow noreferrer">PLA and ABS</a> are the main types of 3D printing material, each has cons and pros.</p>
<p>If you want to choose which type, you need to know the detailed application.</p>
| 585
|
<p>Besides "no connection", what other failure modes should I test for? How do I simulate a high-latency link, an unreliable link, or all the other sorts of crazy stuff that will undoubtedly happen "in the wild"? </p>
<p>How about wireless applications? How do I test the performance in a less-than-ideal WL environment?</p>
|
<blockquote>
<p>To add to TimK's answer, if you have a router, test pulling the upstream link on the router, this will test a bad connection without your system knowing that you lost the physical link.</p>
</blockquote>
<p>Also if you plug it back in after a few seconds it's possible that the connection won't be lost*. This can simulate a very high latency.</p>
<p>*this depends on your ISP and your router. </p>
|
<p>You definitely want to test physically pulling the cable out. Lots of networking code will throw different exceptions in that scenario vs when the connection has just been lost.</p>
| 4,320
|
<p>Does anyone remember the <code>XMP</code> tag?</p>
<p>What was it used for and why was it deprecated?</p>
|
<p>A quick Google search on W3C reveals that <code>XMP</code> was introduced for displaying <strong>preformatted text</strong> in HTML 3.2 and earlier. When W3C deprecated the <code>XMP</code> tag, it suggested using the <code>PRE</code> tag as a preferred alternative.</p>
<p>Update: <a href="http://www.w3.org/TR/REC-html32#xmp" rel="noreferrer">http://www.w3.org/TR/REC-html32#xmp</a>, <a href="http://www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.5.2.1" rel="noreferrer">http://www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.5.2.1</a></p>
|
<p>Still works to show raw html - if you use it in script, break the start tag.</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-js lang-js prettyprint-override"><code>var stuff='<xmp'+'>this is shown as is<br/>hello</xmp>';
document.getElementById("x").innerHTML=stuff;</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code><div id="x"></div></code></pre>
</div>
</div>
</p>
| 2,655
|
<p>Of course the best metric would be a happiness of your users.<br>
But what metrics do you know for GUI usability measurements?<br>
For example, one of the common metrics is a average click count to perform action.
What other metrics do you know? </p>
|
<p>Jakob Nielsen has several articles regarding usability metrics, including one that is entitled, well, <a href="http://www.useit.com/alertbox/20010121.html" rel="nofollow noreferrer">Usability Metrics</a>:</p>
<blockquote>
<p>The most basic measures are based on the definition of usability as a quality metric:</p>
<ul>
<li>success rate (whether users can perform the task at all),</li>
<li>the time a task requires,</li>
<li>the error rate, and</li>
<li>users' subjective satisfaction.</li>
</ul>
</blockquote>
|
<p>I just look at where I want users to go and where (physically) they are going on screen, I do this with data from Google Analytics.</p>
| 6,447
|
<p>I've just built my first 3D printer. It uses a Bowden setup. </p>
<p>When I try to print the extruder starts fine, but after a few seconds the extruder motor start skipping and the nozzle is jammed. </p>
<p>I tried a cold pull, but it didn't help. I removed the PTFE tube and tried to push the filament with my hand, it works but at the start I need the push harder but after it flows fine. But if I reinstall the Bowden setup, it works fine for a few minutes, but after a few seconds it starts again.</p>
<hr>
<p>Note I am using silver PLA at 200-205 °C. I tried to raise the temperature to 215 °C, but it also jammed, and the filament what after I pushed out was black (it is a new hotend and I never used black filament before), like it was burned (if it is possible).</p>
|
<p>Extruder clogging is, at its root, a matter of too much backpressure at the hotend. There are a number of more specific causes, but it very simply comes down to the fact that the printer cannot feed the filament through the hotend as fast as the extruder is pushing it in.</p>
<p>Things to check, pretty much in the order they should be checked/performed for a brand-new printer:</p>
<ul>
<li><strong>Extruder stepper calibration.</strong> With new printers based on RepRap firmware (Enders, Prusas, pretty much any printer in the \$200-\$400 range these days), one of the first things you have to do after assembly is to calibrate your E-stepper (the motor that drives filament through the extruder). The printer is given commands based on millimeters of movement, including the feeding of filament, and it has to translate those into finite steps of the motors. If those steps don't actually move the extruder or the filament as much as expected, the printer will behave poorly, including clogging. E-stepper calibration is pretty easy, especially on Bowden extruders; you basically disconnect the Bowden tube at either end, load filament through the stepper, cut it off flush with the end of the tube or the coupling, then tell the printer to extrude 100 mm of filament. Cut it off flush again and measure, and if it's not 100 mm, look for a command beginning with <code>M92</code> in your printer configuration (it can be in the settings of your actual printer or a configuration script in your slicer software that gets tacked on to the front of the G-code files generated for use with that printer), and adjust the value you see after the <code>E</code> in that command by multiplying it by 100, then dividing by the millimeters of filament actually extruded in the test. Rinse and repeat until the printer is feeding the amount of fil you tell it to.</li>
<li><strong>Bed height/leveling.</strong> This may not sound like it has anything to do with extruder clogs, but in truth, if your extruder is too close to the print bed at any point during the first layer, it can very easily clog the extruder by not allowing enough material to flow out the nozzle to keep up with what's being fed in. Bed leveling is a key step in print prep, and every printer behaves best with subtle changes to the bed leveling procedure. My guess is that you need to re-level for a slightly higher "zero-Z" above the build plate. If you're using the sheet-of-paper method, either use a thicker piece of paper, or go for less friction as you pass the paper between the nozzle and build plate. </li>
<li><strong>Nozzle diameter settings.</strong> The standard nozzle tip diameter is 0.4 mm, however there are others. Your slicer probably expects the standard diameter as a default, so if you're running a 0.3, 0.2 or 0.1 mm nozzle for finer detail, the slicer has to be told that so it can adjust the filament feed rate. Otherwise it'll be jamming up to 16 times as much filament into that hotend as it should be. This isn't likely to be your problem but it's something to check; most extruder nozzles these days have the tip diameter engraved or pressed into the side of the nozzle, and if yours is unlabeled, try heading to the local music store and buying a single 0.013" guitar string (typically sold as a high E for acoustics). If that wire end easily fits through the extruder nozzle, you have a 0.4 mm, if it does not, it's something smaller.</li>
<li><strong>Extruder clog/obstruction.</strong> That guitar string I mentioned makes a really good extruder cleaner. Just feed it through the extruder tip and gently push it up through the hotend till it pops out the top of the extruder, then feed it back and forth a bit to "floss" the extruder tip, cleaning out any minor carbon buildup. If you can't feed the wire completely through the extruder body from either direction, that's probably your problem, and fixes range anywhere from a little more pressure with the wire, to a narrow drill bit carving out the obstruction, up to removing the entire heat block from the printer, putting it on or in something that won't burn, and blasting it with a soldering torch to burn out the obstruction, followed (after letting it cool) by a bath in some acetone to dissolve any remaining gunk.</li>
<li><strong>Gunked-up extruder hobb.</strong> The toothed wheel attached to the extruder stepper is called the "hobb" (you may hear it called a gear, but it's really not one as it doesn't mesh with another gear). As the printer feeds filament, especially if you've had jamming problems, the hobb's teeth will fill with shavings from the filament it feeds through. This can cause the hobb to slip against the filament, which not only reduces the pressure of the filament being pushed through the extruder, it accelerates the accumulation of gunk on the hobb. A short blast of canned air is usually all you need to clean the hobb; if it still looks pretty caked up, a toothbrush will sort it out. While you're at it, check the idler to be sure it's still spinning freely.</li>
<li><strong>Filament type/brand/age.</strong> You mentioned it's "silver PLA"; the silver stuff I have is actually a "silk PLA" product, that sheathes the PLA in a jacket of another plastic (often PET) for that high-gloss appearance. These kinds of filaments can be very temperamental, as can filaments with glitter or fiber aggregate in them (also common in metallic fil colors). You have to have the printer settings dialed in just right, and some of these products just don't work well at all in some printers. Try getting some very basic, brand-name PLA filament like Hatchbox, ColorFabb, MatterHackers, MakerBot, etc, in a good primary color (avoid black or white; the color saturation affects how easily the stuff extrudes at a given temp), no silk finish or other modification. If that prints well, the suspect becomes the silver fil.</li>
<li><strong>Extruder temperature.</strong> You're printing at 200-205 °C, which is usually good, but if you're getting problems, the first thing to do with PLA is to try printing <em>cooler</em>, not hotter. Case in point, getting PLA too hot can cause it to fully melt and drizzle out (vacating the extruder and causing it to overheat the fil further up, jamming the melt tube), it can gum up (directly clogging the extruder nozzle), and it can carbonize (as you see it doing at 215). If you're already flirting with burning your PLA at 10 degrees hotter, you are probably running too hot. Try backing off to 195 or 190 and see if that helps any.</li>
</ul>
|
<p>It is useful to diagnose your problem if you provide more information, specifically what material you are using and what temperature you are using on your hot end.</p>
<p>Even without the above information, it is likely that the hot end temperature is too low. At a low setting, the filament in the nozzle will soften, perhaps even melt as deeply as needed to be extruded, but as new filament is provided by the extruder motor, it also cools the heater block.</p>
<p>By increasing the temperature, you're ensuring there is sufficient thermal energy to handle the incoming cold material.</p>
<p>It would be useful to increase your nozzle temperature by 5°C for each test. Despite matching your controller's temperature to the manufacturer's specification, you can not be certain that the temperature at the nozzle and heat block are what you have programmed.</p>
| 1,542
|
<p>Let's say you have a typical web app and with a file configuration.whatever. Every developer working on the project will have one version for their dev boxes, there will be a dev, prod and stage versions. How do you deal with this in source control? Not check in this file at all, check it with different names or do something fancy altogether?</p>
|
<p>What I've done in the past is to have a default config file which is checked in to source control. Then, each developer has their own override config file which is excluded from source control. The app first loads the default, and then if the override file is present, loads that and uses any settings from the override in preference to the default file.</p>
<p>In general, the smaller the override file the better, but it can always contain more settings for a developer with a very non-standard environment.</p>
|
<p>We just keep the production config file checked in. It's the developer's responsibility to change the file when they pull it out of source safe for staging or development. This has burnt us in the past so I wouldn't suggest it.</p>
| 2,787
|
<p>I am hitting some performance bottlenecks with my C# client inserting bulk data into a SQL Server 2005 database and I'm looking for ways in which to speed up the process.</p>
<p>I am already using the SqlClient.SqlBulkCopy (which is based on TDS) to speed up the data transfer across the wire which helped a lot, but I'm still looking for more.</p>
<p>I have a simple table that looks like this: </p>
<pre><code> CREATE TABLE [BulkData](
[ContainerId] [int] NOT NULL,
[BinId] [smallint] NOT NULL,
[Sequence] [smallint] NOT NULL,
[ItemId] [int] NOT NULL,
[Left] [smallint] NOT NULL,
[Top] [smallint] NOT NULL,
[Right] [smallint] NOT NULL,
[Bottom] [smallint] NOT NULL,
CONSTRAINT [PKBulkData] PRIMARY KEY CLUSTERED
(
[ContainerIdId] ASC,
[BinId] ASC,
[Sequence] ASC
))
</code></pre>
<p>I'm inserting data in chunks that average about 300 rows where ContainerId and BinId are constant in each chunk and the Sequence value is 0-n and the values are pre-sorted based on the primary key. </p>
<p>The %Disk time performance counter spends a lot of time at 100% so it is clear that disk IO is the main issue but the speeds I'm getting are several orders of magnitude below a raw file copy.</p>
<p>Does it help any if I:</p>
<ol>
<li>Drop the Primary key while I am doing the inserting and recreate it later</li>
<li>Do inserts into a temporary table with the same schema and periodically transfer them into the main table to keep the size of the table where insertions are happening small</li>
<li>Anything else?</li>
</ol>
<p>--
Based on the responses I have gotten, let me clarify a little bit:</p>
<p>Portman: I'm using a clustered index because when the data is all imported I will need to access data sequentially in that order. I don't particularly need the index to be there while importing the data. Is there any advantage to having a nonclustered PK index while doing the inserts as opposed to dropping the constraint entirely for import?</p>
<p>Chopeen: The data is being generated remotely on many other machines (my SQL server can only handle about 10 currently, but I would love to be able to add more). It's not practical to run the entire process on the local machine because it would then have to process 50 times as much input data to generate the output.</p>
<p>Jason: I am not doing any concurrent queries against the table during the import process, I will try dropping the primary key and see if that helps.</p>
|
<p>Here's how you can disable/enable indexes in SQL Server:</p>
<pre><code>--Disable Index ALTER INDEX [IX_Users_UserID] SalesDB.Users DISABLE
GO
--Enable Index ALTER INDEX [IX_Users_UserID] SalesDB.Users REBUILD</code></pre>
<p>Here are some resources to help you find a solution:</p>
<p><a href="http://weblogs.sqlteam.com/mladenp/archive/2006/07/17/10634.aspx" rel="noreferrer">Some bulk loading speed comparisons</a></p>
<p><a href="http://www.sqlteam.com/article/use-sqlbulkcopy-to-quickly-load-data-from-your-client-to-sql-server" rel="noreferrer">Use SqlBulkCopy to Quickly Load Data from your Client to SQL Server</a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa178096(SQL.80).aspx" rel="noreferrer">Optimizing Bulk Copy Performance</a></p>
<p>Definitely look into NOCHECK and TABLOCK options:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms187373.aspx" rel="noreferrer">Table Hints (Transact-SQL)</a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms174335.aspx" rel="noreferrer">INSERT (Transact-SQL)</a></p>
|
<p>Yes your ideas will help.<br>
Lean on option 1 if there are no reads happening while your loading.<br>
Lean on option 2 if you destination table is being queried during your processing.</p>
<p>@Andrew<br>
Question. Your inserting in chunks of 300. What is the total amount your inserting? SQL server should be able to handle 300 plain old inserts very fast.</p>
| 4,394
|
<p>I got a Wanhao Duplicator 6 printer branded as a Monoprice Ultimate about a year an and a half ago, 6 months after I got it I decided I hated the buildplate (I had to use a gluestick on every print to get it to stay down) so I removed the original fake buildtak, and got a piece of borosilicate glass and a sheet of PEI that I attached to it.</p>
<p><a href="https://i.stack.imgur.com/Yl5Ns.jpg" rel="nofollow noreferrer" title="Glass buildplate on top of aluminum bed, covered with PEI"><img src="https://i.stack.imgur.com/Yl5Ns.jpg" alt="Glass buildplate on top of aluminum bed, covered with PEI" title="Glass buildplate on top of aluminum bed, covered with PEI"></a> </p>
<p>After about 8 months I started noticing issues with my bed being weird and never really being level no matter how much time I spent leveling it. (I level my buildplate by printing giant concentric circles, comparing the thickness based on the color in different portions, and turning knobs based on that.) Today after an hour of trying to level my bed I decided to just print the model I was going to print anyways (a pyramid model) and discovered why it never seemed level. </p>
<p><a href="https://i.stack.imgur.com/Q5hTb.jpg" rel="nofollow noreferrer" title="A single printed layer of gold silk PLA from tty3d"><img src="https://i.stack.imgur.com/Q5hTb.jpg" alt="A single printed layer of gold silk PLA from tty3d" title="A single printed layer of gold silk PLA from tty3d"></a> </p>
<p>It seems that different portions of my buildplate are at significantly different heights. Is there something I did wrong to cause this to happen, does it just happen over time, and is there anything I can do to fix it? My current plan is just to buy another sheet of the PEI and stick it directly to the aluminum buildplate installed on the printer. It would result in MUCH better thermal transfer between the heater and the PEI anyways, which is important because the whole point of PEI is that it sticks to PLA extremely well at high temperatures, and not very well at low temps.</p>
<p>If nobody knows what might cause this I'm just going to go ahead and get an new sheet of PEI and omit the glass (it was a bad idea anyways). Thanks for reading.</p>
|
<p>Looking at the picture, the first thing that came to mind was, "are you sure it's the bed?". </p>
<p>The height variance looks very regular, and while I'm unfamiliar with this printer's specific mechanics, my thought process trended to the Ender 3 and other v-wheel extruder mounts. If the extruder and gantry carriages are mounted to the gantry spars on V-wheels instead of sleeve bushings or other linear guides, and you've spent a lot of time printing small objects where those wheels are going back and forth over a relatively small travel distance for the entire print, you have been unevenly wearing the wheels so they've become eccentric around their rotational center, and this will cause the extruder to vary its height over the glass in a very regular pattern tied to the circumference of these carriage wheels. This happens especially quickly if you over-tighten the bearings against the gantry spars in an attempt to make the printer more precise.</p>
<p>If the printer uses sleeve bushings, the worn sleeve won't rotate, and any wear on the spar will be very localized to the areas in which you print, but if the printer has spent most of its life printing a grid of small objects (tokens, sets of small figurines), you can still get this regular wear pattern as the printer will spend more time over those areas of the bed.</p>
<p>The fix is to replace the wheels or linear bearings if the printer uses them. If it uses sleeve bushings and the gantry spars themselves are worn in this pattern, you might be able to rotate the spars to put an unworn (or less worn) band of metal on the top of the spar, depending on how the spars are mounted into the endcaps of the frame and y-axis carriages.</p>
|
<p>From experience, my PEI sheet did not stay flat after multiple use, this may be causing the problems you are facing. It could be the adhesive is failing on different locations. </p>
<p>As you mention, a new sheet of PEI may work for you; indeed the glass will not be necessary then, glueing it directly onto the aluminium bed would be enough provided that the metal bed is straight. Note that glass is straight as a result of the production process to make glass, so this can always be used. To remove the PEI sheet, a sticky glue residue is left behind on the build plate, please read <a href="/q/7960">"How to clean up my build plate for a new build surface?"</a> for more information. It is probably easier to remove glue residue from the glass than from the heated bed as that is usually bolted and wired to the printer, but a wet cloth works fine. Personally, I print on glass or directly on the heated bed using an adhesion spray. You do not require the use of a PEI sheet.</p>
<hr>
<p><em>Note that printing PETG filament is not recommended without glue stick or any other bonding agent like hairspray. This is not to get it to stick, but to get the print loose from the build plate, PETG fuses to PEI...</em></p>
| 1,501
|
<p>I know it is not recommended, but is it at all possible to pass the user's password to scp?</p>
<p>I'd like to copy a file via scp as part of a batch job and the receiving server does, of course, need a password and, no, I cannot easily change that to key-based authentication.</p>
|
<p>Use <a href="http://sshpass.sourceforge.net/" rel="noreferrer">sshpass</a>:</p>
<pre><code>sshpass -p "password" scp -r user@example.com:/some/remote/path /some/local/path
</code></pre>
<p>or so the password does not show in the bash history</p>
<pre><code>sshpass -f "/path/to/passwordfile" scp -r user@example.com:/some/remote/path /some/local/path
</code></pre>
<p>The above copies contents of path from the remote host to your local. </p>
<p><strong>Install :</strong></p>
<ul>
<li>ubuntu/debian
<ul>
<li><code>apt install sshpass</code></li>
</ul></li>
<li>centos/fedora
<ul>
<li><code>yum install sshpass</code></li>
</ul></li>
<li>mac w/ macports
<ul>
<li><code>port install sshpass</code></li>
</ul></li>
<li>mac w/ brew
<ul>
<li><code>brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb</code></li>
</ul></li>
</ul>
|
<p>An alternative would be add the public half of the user's key to the authorized-keys file on the target system. On the system you are initiating the transfer from, you can run an ssh-agent daemon and add the private half of the key to the agent. The batch job can then be configured to use the agent to get the private key, rather than prompting for the key's password.</p>
<p>This should be do-able on either a UNIX/Linux system or on Windows platform using pageant and pscp.</p>
| 7,271
|
<p>I hope not everyone is using Rational Purify.</p>
<p>So what do you do when you want to measure:</p>
<ul>
<li>time taken by a function</li>
<li>peak memory usage </li>
<li>code coverage</li>
</ul>
<p>At the moment, we do it manually [using log statements with timestamps and another script to parse the log and output to excel. phew...)</p>
<p>What would you recommend? Pointing to tools or any techniques would be appreciated!</p>
<p>EDIT: Sorry, I didn't specify the environment first, <em>Its plain C on a proprietary mobile</em> platform</p>
|
<p>You probably want different tools for performance profiling and code coverage.</p>
<p>For profiling I prefer Shark on MacOSX. It is free from Apple and very good. If your app is vanilla C you should be able to use it, if you can get hold of a Mac.</p>
<p>For profiling on Windows you can use LTProf. Cheap, but not great:
<a href="http://successfulsoftware.net/2007/12/18/optimising-your-application/" rel="nofollow noreferrer">http://successfulsoftware.net/2007/12/18/optimising-your-application/</a></p>
<p>(I think Microsoft are really shooting themself in the foot by not providing a decent profiler with the cheaper versions of Visual Studio.)</p>
<p>For coverage I prefer Coverage Validator on Windows:
<a href="http://successfulsoftware.net/2008/03/10/coverage-validator/" rel="nofollow noreferrer">http://successfulsoftware.net/2008/03/10/coverage-validator/</a>
It updates the coverage in real time.</p>
|
<p>How are any tools going to work if your platform is a proprietary OS? I think you're doing the best you can right now</p>
| 8,068
|
<p>After building a Delta printer, I noticed that my whole prints are slightly tilted around the Z-axis in comparison to the slicer (e.g. Cura). There is no twist layer wise. This means, the prints themself look actually perfect. </p>
<p>I just don't know what could be the reason of the rotation. I do not believe it is a build issue of the printer, because I tried to keep the printer frame pretty stiff and symmetric.
Could it be, that the Auto-Calibrate Feature of Marlin can add such a rotation?</p>
<p>The picture below illustrates the problem. I expect the black alignment of the print and get the orange one. Note that the print is still a rectangle with ~90° corners. </p>
<p><a href="https://i.stack.imgur.com/pXiHY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pXiHY.png" alt="enter image description here"></a></p>
|
<p>I figured out that the reason is probably a slightly translated slider construction. Instead of using a proper centered slider as shown in <strong>red</strong>, I used a slider construction like illustrated in <strong>yellow</strong>. When all sliders are translated on each tower like this, the print should be tilted by the same amount. This seems to have no influence on the general shape of the object. However, for my next printer I will use a proper centered uni-body slider.</p>
<p><a href="https://i.stack.imgur.com/92vvC.png" rel="nofollow noreferrer" title="Image of centered slider (in red) and (slightly) translated slider (in yellow)"><img src="https://i.stack.imgur.com/92vvC.png" alt="Image of centered slider (in red) and (slightly) translated slider (in yellow)" title="Image of centered slider (in red) and (slightly) translated slider (in yellow)" /></a></p>
|
<p>If I am reading this correctly, your prints are being either stretched or your prints are shifting / leaning on more complicated prints. </p>
<p>In this case, given that you are on a Delta printer, my answer is the same for all. I usually do Cartesian based 3d printing but the concept is the same for any drifting or leaning. You simply need to recalibrate your steps per MM for each motor, and tighten your belts. You will have the complication of the interaction of the 3 arms, that others will be able to answer better. But in the end, if each arm moves as it should, the belts are not slipping, and you do not have issues with moving too fast (jerking can cause the belt to shift, and a loose belt can cause whiplash / and other print artifacts). My bet is your steps per MM is off on one of the motors, or you could have an overheating issue (not likely). </p>
<p>There are many <a href="https://best3dprinter.stan-tech.com/delta-printer-calibration-guide-z-axis" rel="nofollow noreferrer">guides</a> to help with Delta specific calibration. </p>
<p>I can provide a better answer with photos. See <a href="https://stackoverflow.com/help/how-to-ask">Stackoverflows guide on asking questions</a>.</p>
<p>Edit with the diagram (not a photo), you issue might be caused by stepper over voltage and you will need to adjust your pololus. If you hear a repeating Thud noise, you have your voltage too high. </p>
| 1,077
|
<p>Backgrounder:</p>
<p>The <a href="http://en.wikipedia.org/wiki/Opaque_pointer" rel="noreferrer">PIMPL Idiom</a> (Pointer to IMPLementation) is a technique for implementation hiding in which a public class wraps a structure or class that cannot be seen outside the library the public class is part of.</p>
<p>This hides internal implementation details and data from the user of the library.</p>
<p>When implementing this idiom why would you place the public methods on the pimpl class and not the public class since the public classes method implementations would be compiled into the library and the user only has the header file?</p>
<p>To illustrate, this code puts the <code>Purr()</code> implementation on the impl class and wraps it as well.</p>
<p><strong>Why not implement Purr directly on the public class?</strong></p>
<pre class="lang-c++ prettyprint-override"><code>// header file:
class Cat {
private:
class CatImpl; // Not defined here
CatImpl *cat_; // Handle
public:
Cat(); // Constructor
~Cat(); // Destructor
// Other operations...
Purr();
};
// CPP file:
#include "cat.h"
class Cat::CatImpl {
Purr();
... // The actual implementation can be anything
};
Cat::Cat() {
cat_ = new CatImpl;
}
Cat::~Cat() {
delete cat_;
}
Cat::Purr(){ cat_->Purr(); }
CatImpl::Purr(){
printf("purrrrrr");
}
</code></pre>
|
<p>I think most people refer to this as the <em>Handle Body</em> idiom. See James Coplien's book <em><a href="https://rads.stackoverflow.com/amzn/click/com/0201548550" rel="noreferrer" rel="nofollow noreferrer">Advanced C++ Programming Styles and Idioms</a></em>. It's also known as the <a href="http://en.wikipedia.org/wiki/Cheshire_Cat" rel="noreferrer">Cheshire Cat</a> because of <a href="https://en.wikipedia.org/wiki/Lewis_Carroll" rel="noreferrer">Lewis Caroll's</a> character that fades away until only the grin remains.</p>
<p>The example code should be distributed across two sets of source files. Then only <em>Cat.h</em> is the file that is shipped with the product.</p>
<p><em>CatImpl.h</em> is included by <em>Cat.cpp</em> and <em>CatImpl.cpp</em> contains the implementation for <em>CatImpl::Purr()</em>. This won't be visible to the public using your product.</p>
<p>Basically the idea is to hide as much as possible of the implementation from prying eyes.</p>
<p>This is most useful where you have a commercial product that is shipped as a series of libraries that are accessed via an API that the customer's code is compiled against and linked to.</p>
<p>We did this with the rewrite of <a href="https://en.wikipedia.org/wiki/IONA_Technologies" rel="noreferrer">IONA's</a> <a href="https://en.wikipedia.org/wiki/Orbix_(software)" rel="noreferrer">Orbix</a> 3.3 product in 2000.</p>
<p>As mentioned by others, using his technique completely decouples the implementation from the interface of the object. Then you won't have to recompile everything that uses <em>Cat</em> if you just want to change the implementation of <em>Purr()</em>.</p>
<p>This technique is used in a methodology called <a href="http://en.wikipedia.org/wiki/Design_by_contract" rel="noreferrer">design by contract</a>.</p>
|
<p>I don't know if this is a difference worth mentioning but...</p>
<p>Would it be possible to have the implementation in its own namespace and have a public wrapper / library namespace for the code the user sees:</p>
<pre><code>catlib::Cat::Purr(){ cat_->Purr(); }
cat::Cat::Purr(){
printf("purrrrrr");
}
</code></pre>
<p>This way all library code can make use of the cat namespace and as the need to expose a class to the user arises a wrapper could be created in the catlib namespace.</p>
| 8,548
|
<p>Shoes has some built in dump commands (Shoes.debug), but are there other tools that can debug the code without injecting debug messages throughout? Something like gdb would be great.</p>
|
<p>You can also use Shoes.show_log to automatically open a debug console.</p>
|
<p>I was a bit confused about the Apple-/ (or Alt-/) bit mentioned here. What I ended up doing was running <em>./shoes</em> with no arguments, which popped up the console, then started my app with <em>./shoes my_app.rb</em>. </p>
| 8,903
|
<p>You can use a standard dot notation or a method call in Objective-C to access a property of an object in Objective-C.</p>
<pre><code>myObject.property = YES;
</code></pre>
<p>or</p>
<pre><code>[myObject setProperty:YES];
</code></pre>
<p>Is there a difference in performance (in terms of accessing the property)? Is it just a matter of preference in terms of coding style?</p>
|
<p>Dot notation for property access in Objective-C <strong>is</strong> a message send, just as bracket notation. That is, given this:</p>
<pre><code>@interface Foo : NSObject
@property BOOL bar;
@end
Foo *foo = [[Foo alloc] init];
foo.bar = YES;
[foo setBar:YES];
</code></pre>
<p>The last two lines will compile exactly the same. The only thing that changes this is if a property has a <code>getter</code> and/or <code>setter</code> attribute specified; however, all it does is change what message gets sent, not whether a message is sent:</p>
<pre><code>@interface MyView : NSView
@property(getter=isEmpty) BOOL empty;
@end
if ([someView isEmpty]) { /* ... */ }
if (someView.empty) { /* ... */ }
</code></pre>
<p>Both of the last two lines will compile identically.</p>
|
<p>As far as I've seen, there isn't a significant performance difference between the two. I'm reasonably certain that in most cases it will be 'compiled' down to the same code.</p>
<p>If you're not sure, try writing a test application that does each method a million times or so, all the while timing how long it takes. That's the only way to be certain (although it may vary on different architecture.)</p>
| 5,500
|
<p>My company is looking to start distributing some software we developed and would like to be able to let people try the software out before buying. We'd also like to make sure it can't be copied and distributed to our customers' customers.</p>
<p>One model we've seen is tying a license to a MAC address so the software will only work on one machine.</p>
<p>What I'm wondering is, what's a good way to generate a license key with different information embedded in it such as license expiration date, MAC address, and different software restrictions?</p>
|
<p>I'd suggest you take the pieces of information you want in the key, and hash it with md5, and then just take the first X characters (where X is a key length you think is manageable).</p>
<p>Cryptographically, it's far from perfect, but this is the sort of area where you want to put in the minimum amount of effort which will stop a casual attacker - anything more quickly becomes a black hole.</p>
<p>Oh, I should also point out, you will want to provide the expiration date (and any other information you might want to read out yourself) in plain text (or slightly obfuscated) as part of the key as well if you go down this path - The md5 is just to stop the end user from changing he expiration date to extend the license.</p>
<p>The easiest thing would be a key file like this...</p>
<pre><code># License key for XYZZY
expiry-date=2009-01-01
other-info=blah
key=[md5 has of MAC address, expiry date, other-info]
</code></pre>
|
<p>It is difficult to provide a good answer without knowing anything about your product and customers. For enterprise software sold to technical people you can use a fairly complex licensing system and they'll figure it out. For consumer software sold to the barely computer-literate, you need a much simpler system.</p>
<p>In general, I've adopted the practice of making a very simple system that keeps the honest people honest. Anyone who really wants to steal your software will find a way around any DRM system. </p>
<p>In the past I've used Armadillo (now Software Passport) for C++ projects. I'm currently using XHEO for C# projects.</p>
| 7,228
|
<p>I have a large classic ASP app that I have to maintain, and I repeatedly find myself thwarted by the lack of short-circuit evaluation capability. E.g., VBScript won't let you get away with:</p>
<pre><code>if not isNull(Rs("myField")) and Rs("myField") <> 0 then
...
</code></pre>
<p>...because if Rs("myField") is null, you get an error in the second condition, comparing null to 0. So I'll typically end up doing this instead:</p>
<pre><code>dim myField
if isNull(Rs("myField")) then
myField = 0
else
myField = Rs("myField")
end if
if myField <> 0 then
...
</code></pre>
<p>Obviously, the verboseness is pretty appalling. Looking around this large code base, the best workaround I've found is to use a function the original programmer wrote, called TernaryOp, which basically grafts in ternary operator-like functionality, but I'm still stuck using a temporary variable that would not be necessary in a more full-featured language. Is there a better way? Some super-secret way that short-circuiting really does exist in VBScript?</p>
|
<p>Maybe not the best way, but it certainly works... Also, if you are in vb6 or .net, you can have different methods that cast to proper type too.</p>
<pre><code>if cint( getVal( rs("blah"), "" ) )<> 0 then
'do something
end if
function getVal( v, replacementVal )
if v is nothing then
getVal = replacementVal
else
getVal = v
end if
end function
</code></pre>
|
<p>Would that there were, my friend -- TernaryOp is your only hope. </p>
| 8,423
|
<p>X Windows has special processes called Window Managers that manage the layout of windows and decorations like their title bar, control buttons etc. Such processes use an X Windows API to detect events related to windows sizes and positions.</p>
<p>Are there any consistent ways for writing such processes for Microsoft Windows or Mac OS/X?</p>
<p>I know that in general these systems are less flexible but I'm looking for something that will use public APIs and not undocumented hacks.</p>
|
<p>Just to extend what Longhorn213 said, here's the code for it:</p>
<pre><code>Using mysql as SqlCommand = new SqlCommand(sSql, cnInput)
' do stuff'
End Using
Using mysql as SqlCommand = new SqlCommand(otherSql, cnInput)
' do other stuff'
End Using
</code></pre>
<p>(edit) Just as an FYI, using automatically wraps the block of code around a try/finally that calls the Dispose method on the variable it is created with. Thus, it's an easy way to ensure your resource is released. <a href="http://msdn.microsoft.com/en-us/library/htd05whh(VS.80).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/htd05whh(VS.80).aspx</a></p>
|
<p>No, the garbage collector will find the old version of mySql and deallocate it in due course.</p>
<p>The garbage collector should pick up anything that's been dereferenced as long as it hasn't been moved into the Large Object Heap.</p>
| 6,389
|
<p>I have a popup window containing a form which gathers data for a report.
When I click submit in that window, I want it to close the popup, and open the report in the original window that called the popup.</p>
<p>I think I can open the report in the correct window by using</p>
<pre><code>{ :target => <name of window> }
</code></pre>
<p>in the <code>form_tag</code>, but I don't know how to determine or set the name of the originating window.</p>
<p>I also don't know how to close the popup window.</p>
|
<p><code>:target =></code> adds the html attribute target to the link. This opens up a new window and names the new window the target.</p>
<p>You have to use javascript or Ajax to redirect the old page,</p>
<pre><code>window.opener.location.href="http://new_url";
</code></pre>
<p>and then close the old window.</p>
<pre><code>window.close();
</code></pre>
<p>This can be done either through the rjs file or directly in the javascript.</p>
|
<p>How is <a href="http://railsforum.com/viewtopic.php?id=17785" rel="nofollow noreferrer">this</a> for starters?</p>
<pre><code># The submit button in your child window's view:
<%= button_to_function 'Save', "$('my_form').submit(); window.opener.location.reload(); window.close();" %>
</code></pre>
| 5,669
|
<p>See the pictures below. I have a severe under extrusion when the printer starts the outer wall, which is resolved by the time it finishes the outer wall. It starts the layer in the same place every time, so it results in this vertical line, on one side of which is fine (where it finishes the layer) and the other side has bad gaps and the wall is much thinner.</p>
<p>In this picture, the problem is on the outer wall (see red outer line, the print head is moving counter clockwise.</p>
<p><a href="https://i.stack.imgur.com/CEcrn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CEcrn.png" alt="G-Code visualization" /></a></p>
<p>And here is the print showing the issue. Just fine on one side, but terrible on the other, precisely where it starts the layer. Strangely, this only occurs on the layers with infill. The top layers seem fine (despite starting in the same place). I have disabled retraction with no effect.</p>
<p>Here you can see it start at the tip and get gradually better as it progresses.
<a href="https://i.stack.imgur.com/lzzPE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lzzPE.jpg" alt="enter image description here" /></a></p>
<p>Here you can see that by the time it finishes, it's just fine, and also what a contrast is between the start and end. That should be a flush edge, there.
<a href="https://i.stack.imgur.com/RvFSs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RvFSs.jpg" alt="enter image description here" /></a></p>
<p>Another view
<a href="https://i.stack.imgur.com/5qkZW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5qkZW.jpg" alt="enter image description here" /></a></p>
<p>Is there some setting that I should be tweaking? I've exhausted my own ideas of different tweaks to no avail.</p>
<p>The printer is a Monoprice Maker Select V2. I'm using Ultimaker Cura 4.1.0.</p>
<hr />
<ul>
<li>Material: PLA</li>
<li>Layer height: 0.24 mm (in the pictures, but replicated with 0.16 mm also)</li>
<li>Temp: 205 °C, here (but tweaking this hasn't had any effect)</li>
<li>Retraction: Disabled</li>
</ul>
<p>This doesn't happen on layer changes. Although it does line up with the Z seam, you can see from the G-code visualization below that the outer wall is the very last thing it does. The issue occurs at the start of the outer wall (still on the same layer) that it has the issue, but by the time it ends the wall (just before switching layers) it is fine.</p>
<p>I've tweaked a few other settings, one by one, and seeing if any have any effect. So far, not really:</p>
<ul>
<li>Outer Wall Wipe: 0.2 (default), 0.8, 0.0</li>
<li>Jerk Control - Wall Jerk max velocity change, 5 mm/s</li>
<li>Outer Wall before inner (Yes instead of No)</li>
<li>Wall Line Count (3 instead of 2): This improves it some, but I suspect just by making it a little more difficult to see</li>
</ul>
<h2>What have I done since...</h2>
<p>I reset all settings in Cura to a default "Draft" setting and then set layer height to 0.24 mm, and turned off Infill. Then I have tried prints with different settings for "Retract Before Outer Wall" and printing temperature.</p>
<p>Here are those results:</p>
<p>These pics seem to suggest a very clear lag in extrusion. 1 and 2 are different temps. 2 and 3 are different retraction.</p>
<p>205 °C, 0 % Infill, Retract Before Outer Wall: Off
<a href="https://i.stack.imgur.com/fX7K1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fX7K1.jpg" alt="205 Celsius, 0 Infill, Retract Before Outer Wall: Off" /></a></p>
<p>195 °C, 0 % Infill, Retract Before Outer Wall: Off
<a href="https://i.stack.imgur.com/dDMOa.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dDMOa.jpg" alt="195 Celsius, 0 Infill, Retract Before Outer Wall: Off" /></a></p>
<p>195 °C, 0 % Infill, Retract Before Outer Wall: On
Note: the retraction setting resulted in a noticeable pause before printing the outer wall. Retraction distance is 6.5 mm, and this is not a Bowden fed device.
<a href="https://i.stack.imgur.com/DUyRn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DUyRn.jpg" alt="195 Celsius, 0 Infill, Retract Before Outer Wall: On" /></a></p>
<p>There doesn't seem to be anything strange about the G-code, either. Here are the <code>G0</code> travels just before the outer wall followed by the wall.</p>
<pre><code>...
G0 F7200 X106.319 Y93.413
G0 X106.26 Y93.909
G0 X107.213 Y93.658
G0 X107.8 Y92.542
G0 X107.286 Y90.844
G0 X107.509 Y90.394
; (outer wall of outside)
G1 F1328 X107.985 Y90.707 E116.98713
G1 X108.38 Y91.128 E117.01098
G1 X108.658 Y91.623 E117.03444
G1 X108.813 Y92.18 E117.05833
G1 X108.832 Y92.751 E117.08193
G1 X108.713 Y93.315 E117.10575
G1 X108.463 Y93.837 E117.12966
; (first curve complete, on to straightaway)
G1 X99.631 Y107.716 E117.80936
G1 X98.912 Y108.59 E117.85612
...
</code></pre>
<h2>Even more done...</h2>
<p>These are retraction off, and 205 °C</p>
<p>If I set the "print speed" in Cura to 20 mm/s (normally 60 mm/s), the outer wall speed is reduced from 30 mm/s to 10 mm/s. The result is quite good.
<a href="https://i.stack.imgur.com/MUGcj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MUGcj.jpg" alt="enter image description here" /></a></p>
<p>If I leave the "print speed" at 60 mm/s and adjust only the outer wall to 10 mm/s, it's still quite good.
<a href="https://i.stack.imgur.com/m07QN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m07QN.jpg" alt="enter image description here" /></a></p>
<p>So it seems like an acceleration thing. If I can figure out how to get it to slow down in just the right spots or compensate in some way, then perhaps I can make this problem go away with minimal sacrifice in total speed.</p>
|
<p>Based on other comments, answers, and question edits so far, in addition to your original question, I believe there are possibly two things going on here: incorrect retraction settings, including a misunderstanding of which settings are relevant and what they do, and issues related to slow acceleration. Both relate to misdepositing/loss of material.</p>
<p>First, some basics. When the filament is advanced to the point needed to extrude material and print at the intended volumetric rate, it's under significant pressure, compressed between the extruder gear and the nozzle. My understanding is that your printer has a direct drive extruder, not a bowden, so there's far less compression than with a bowden setup but it's still there. This means that, if you try to stop extruding, it's material will continue to come out of the nozzle, just at a decreasing rate, until the pressure dissipates. This effect is reduced but still present if the nozzle is held-against/moving-over already printed material, and heavy if moving over empty space, even moreso if moving across sparsely-filled space like infill where it will bond with the already-deposited material and get "stretched"/"pulled" out.</p>
<p>The idea of retraction is to pull the filament back when the print head is moving to a new location without trying to deposit material, to relieve this pressure and prevent unwanted misdepositing/loss of material, and to reverse the process, putting the filament back exactly where it was when the last printed line ended, the next time it starts trying to deposit material.</p>
<p>The relevant options in Cura are:</p>
<ul>
<li>Enable Retraction - must be on</li>
<li>Retraction Distance - should be at least 5-6 mm for bowden setups, probably more like 0.5-2 mm for direct drive.</li>
<li>Retraction Minimum Travel - should be 0</li>
<li>Combing Mode - try different settings. Off is probably the best relative to your issues, but hurts your print time a lot for certain models, and can hurt quality in other ways.</li>
</ul>
<p>Everything else related to retraction is fairly irrelevant, especially "Retract at Layer Change" is a niche option and not typically useful. As I understand it, turning just "Retract at Layer Change" on does not mean retraction is on.</p>
<p>Now, your other issue may be acceleration. Extrusion works best as acceleration speed approaches infinity, because the extrusion rate and pressure needed to extrude will be fairly constant for the entire line/curve. If acceleration is very slow, pressure will be wrong during the start and end of lines. It's likely that, due to high pressure, excess material will get deposited at the end of one line while slowing down, then after moving to start the next line, even if you retract the filament, you'll have insufficient pressure at the nozzle after reversing the retraction to start the next line.</p>
<p>A jerk limit of 5 mm/s is really low. I'm used to more like 20-30 mm/s. You don't say what your acceleration limit is, but it's probably also low. Slow acceleration has minimal impact if your max speed is slow, because you quickly reach the max speed and most of the print speed (and thus extrusion rate) is steady. But if you want to print at high speeds, you need high acceleration. Try and see if you can increase it. Or accept printing at slow speeds.</p>
<p>Another option, if you're open to hacking on your printer, is replacing the stock firmware with a recent version of Marlin with the <a href="http://marlinfw.org/docs/features/lin_advance.html" rel="nofollow noreferrer">Linear Advance</a> feature. It does the math to model the filament pressure as a spring, with a spring constant you can tweak, so that it can compensate for varying print speed and end lines with approximately no pressure remaining.</p>
|
<p>try retract before outer wall off.</p>
| 1,425
|
<p>I just set up a refurbished <a href="https://www.monoprice.com/product?p_id=29417" rel="nofollow noreferrer">MP Select Mini V2</a> and tried to print the test file included by the manufacturer, <code>cat.gcode</code>, from the included SD card. I printed in PLA (I think; the unlabeled sample included with the printer) at the default extruder temperature, 190 °C. The print bed was set to 50 °C.</p>
<p>It appeared to print the raft fine, and then a couple of layers of the cat. At this point I walked away, and when I came back a few minutes later here's what I found:</p>
<p><a href="https://i.stack.imgur.com/UuaCr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UuaCr.jpg" alt="Printer with awful mess"></a></p>
<p>The raft is still stuck to the bed, but the layers of cat that were printed fell off the base and onto the floor. Here's what I picked up off the floor, (next to the detached raft):</p>
<p><a href="https://i.stack.imgur.com/omh6M.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/omh6M.jpg" alt="Raft and mangled print"></a></p>
<p>The raft was stuck on the bed just fine, so I don't think it's an adhesion issue. The bed and the desk the printer is sitting on are both very close to level (things don't slide or roll off). There's no breeze and I'm certain nothing bumped or touched the printer while it was running.</p>
<p>This is my first attempt at a print so I obviously have no idea what I'm doing. I'm planning to set up a camera to record the next attempt. What other troubleshooting can I do? What is the likely cause of this problem?</p>
|
<p>Your trouble lies within the presliced G-code: the temperatures are rather low for PLA and upping both by 10 degrees would be advisable:</p>
<ul>
<li>200 °C for the Hotend</li>
<li>60 °C for the Bed</li>
</ul>
<p>Atop that, printing a raft for PLA is usually not advisable.</p>
<p>Get yourself a slicer (the most common free ones I am comfortable with using are Cura, Slic3r and Slic3r Prusa Edition) and either import a fitting profile and create your own profile, then slice the <code>.stl</code>-model yoruself.</p>
|
<p>It looks to me as the model did not have enough surface contact with the raft.</p>
<hr>
<p>This can be caused by to big of a gap between raft and model set in the slicer or because of Underextrusion.
The part itself does not look underextruded, at least not a lot, so I would say that the slicer settings were not ideal.</p>
<p>I would suggest you slice a part by yourself and test the printer again.</p>
<p>From personal experience a skirt or brim works better with PLA and uncomplicated models.</p>
<p>For general bugfixing, explanation of slicer settings and anomalies the Simplfy3D hompage is a great resource.</p>
<p>Here is an article about <a href="https://www.simplify3d.com/support/articles/rafts-skirts-and-brims/" rel="nofollow noreferrer">Rafts, Skirts and Brims</a> and <a href="https://www.simplify3d.com/support/print-quality-troubleshooting/" rel="nofollow noreferrer">here the general guide page for print quality.</a></p>
<hr>
<p>Your printing temperature is a bit low but shouldn't be the cause for the problem. Maybe check the specs on the PLA you used.
Your bet temperature seems to be fine as the raft did adhere well.</p>
<hr>
| 1,385
|
<p>We have made use of Passolo for a number of years, but it's kind of clunky and overpriced.</p>
<p>It's got to be able to handle winforms and WPF....</p>
<p>Are there any open source alternatives?</p>
|
<p>Coincidentally I saw this on MS Channel 9 this morning - Babylon.NET <a href="http://www.redpin.eu/" rel="nofollow noreferrer">http://www.redpin.eu/</a>
Sadly I can't vouch for it as I haven't used it, but looks like a reasonable alternative to Passolo (well, at least it's cheaper).</p>
|
<p>Coincidentally I saw this on MS Channel 9 this morning - Babylon.NET <a href="http://www.redpin.eu/" rel="nofollow noreferrer">http://www.redpin.eu/</a>
Sadly I can't vouch for it as I haven't used it, but looks like a reasonable alternative to Passolo (well, at least it's cheaper).</p>
| 9,446
|
<p>I use this question in interviews and I wonder what the best solution is.</p>
<p>Write a Perl sub that takes <em>n</em> lists, and then returns 2^<em>n</em>-1 lists telling you which items are in which lists; that is, which items are only in the first list, the second, list, both the first and second list, and all other combinations of lists. Assume that <em>n</em> is reasonably small (less than 20).</p>
<p>For example:</p>
<pre><code>list_compare([1, 3], [2, 3]);
=> ([1], [2], [3]);
</code></pre>
<p>Here, the first result list gives all items that are only in list 1, the second result list gives all items that are only in list 2, and the third result list gives all items that are in both lists.</p>
<pre><code>list_compare([1, 3, 5, 7], [2, 3, 6, 7], [4, 5, 6, 7])
=> ([1], [2], [3], [4], [5], [6], [7])
</code></pre>
<p>Here, the first list gives all items that are only in list 1, the second list gives all items that are only in list 2, and the third list gives all items that are in both lists 1 and 2, as in the first example. The fourth list gives all items that are only in list 3, the fifth list gives all items that are only in lists 1 and 3, the sixth list gives all items that are only in lists 2 and 3, and the seventh list gives all items that are in all 3 lists.</p>
<p>I usually give this problem as a follow up to the subset of this problem for <em>n</em>=2.</p>
<p>What is the solution? </p>
<p>Follow-up: The items in the lists are strings. There might be duplicates, but since they are just strings, duplicates should be squashed in the output. Order of the items in the output lists doesn't matter, the order of the lists themselves does.</p>
|
<p>Your given solution can be simplified quite a bit still.</p>
<p>In the first loop, you can use plain addition since you are only ever ORing with single bits, and you can narrow the scope of <code>$bit</code> by iterating over indices. In the second loop, you can subtract 1 from the index instead of producing an unnecessary 0th output list element that needs to be <code>shift</code>ed off, and where you unnecessarily iterate m*n times (where m is the number of output lists and n is the number of unique elements), iterating over the unique elements would reduce the iterations to just n (which is a significant win in typical use cases where m is much larger than n), <em>and</em> would simplify the code.</p>
<pre><code>sub list_compare {
my ( @list ) = @_;
my %dest;
for my $i ( 0 .. $#list ) {
my $bit = 2**$i;
$dest{$_} += $bit for @{ $list[ $i ] };
}
my @output_list;
for my $val ( keys %dest ) {
push @{ $output_list[ $dest{ $val } - 1 ] }, $val;
}
return \@output_list;
}
</code></pre>
<p>Note also that once thought of in this way, the result gathering process can be written very concisely with the aid of the <a href="http://search.cpan.org/perldoc?List::Part" rel="nofollow noreferrer">List::Part</a> module:</p>
<pre><code>use List::Part;
sub list_compare {
my ( @list ) = @_;
my %dest;
for my $i ( 0 .. $#list ) {
my $bit = 2**$i;
$dest{$_} += $bit for @{ $list[ $i ] };
}
return [ part { $dest{ $_ } - 1 } keys %dest ];
}
</code></pre>
<p>But note that <code>list_compare</code> is a terrible name. Something like <code>part_elems_by_membership</code> would be much better. Also, the imprecisions in your question Ben Tilly pointed out need to be rectified.</p>
|
<p>Here is my solution:</p>
<p>Construct a hash whose keys are the union of all the elements in the input lists, and the values are bit strings, where bit <em>i</em> is set if the element is present in list <em>i</em>. The bit strings are constructed using bitwise or. Then, construct the output lists by iterating over the keys of the hash, adding keys to the associated output list.</p>
<pre><code>sub list_compare {
my (@lists) = @_;
my %compare;
my $bit = 1;
foreach my $list (@lists) {
$compare{$_} |= $bit foreach @$list;
$bit *= 2; # shift over one bit
}
my @output_lists;
foreach my $item (keys %compare) {
push @{ $output_lists[ $compare{$item} - 1 ] }, $item;
}
return \@output_lists;
}
</code></pre>
<p>Updated to include the inverted output list generation suggested by Aristotle</p>
| 9,387
|
<p>What's the general consensus on supporting Windows 2000 for software distribution? Are people supporting Windows XP SP2+ for new software development or is this too restrictive still?</p>
|
<p>"OK" is a subjective judgement. You'll need to take a look at your client base and see what they're using.</p>
<p>Having said that, I dropped support for Win2K over a year ago with no negative impact.</p>
|
<p>A lot of computers at my company use Win2k, so we couldn't really drop support. It all depends on the client base.</p>
| 3,290
|
<p>I have C# winforms application that needs to start an external exe from time to time, but I do not wish to start another process if one is already running, but rather switch to it.</p>
<p>So how in C# would I so this in the example below?</p>
<pre><code>using System.Diagnostics;
...
Process foo = new Process();
foo.StartInfo.FileName = @"C:\bar\foo.exe";
foo.StartInfo.Arguments = "Username Password";
bool isRunning = //TODO: Check to see if process foo.exe is already running
if (isRunning)
{
//TODO: Switch to foo.exe process
}
else
{
foo.Start();
}
</code></pre>
|
<p>This should do it for ya.</p>
<p><a href="http://www.dreamincode.net/code/snippet1541.htm" rel="noreferrer">Check Processes</a></p>
<pre><code>//Namespaces we need to use
using System.Diagnostics;
public bool IsProcessOpen(string name)
{
//here we're going to get a list of all running processes on
//the computer
foreach (Process clsProcess in Process.GetProcesses()) {
//now we're going to see if any of the running processes
//match the currently running processes. Be sure to not
//add the .exe to the name you provide, i.e: NOTEPAD,
//not NOTEPAD.EXE or false is always returned even if
//notepad is running.
//Remember, if you have the process running more than once,
//say IE open 4 times the loop thr way it is now will close all 4,
//if you want it to just close the first one it finds
//then add a return; after the Kill
if (clsProcess.ProcessName.Contains(name))
{
//if the process is found to be running then we
//return a true
return true;
}
}
//otherwise we return a false
return false;
}
</code>
</pre>
|
<blockquote>
<p>Mnebuerquo wrote: </p>
<blockquote>
<p>Also, I had source code access to the
process I was trying to start. If you
can not modify the code, adding the
mutex is obviously not an option.</p>
</blockquote>
</blockquote>
<p>I don't have source code access to the process I want to run. </p>
<p>I have ended up using the proccess MainWindowHandle to switch to the process once I have found it is alread running:</p>
<pre><code>[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool SetForegroundWindow(IntPtr hWnd);
</code></pre>
| 7,409
|
<p>A semaphore is a programming concept that is frequently used to solve multi-threading problems. My question to the community: </p>
<p>What is a semaphore and how do you use it?</p>
|
<p>Think of semaphores as bouncers at a nightclub. There are a dedicated number of people that are allowed in the club at once. If the club is full no one is allowed to enter, but as soon as one person leaves another person might enter.</p>
<p>It's simply a way to limit the number of consumers for a specific resource. For example, to limit the number of simultaneous calls to a database in an application.</p>
<p>Here is a very pedagogic example in C# :-)</p>
<pre class="lang-cs prettyprint-override"><code>using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace TheNightclub
{
public class Program
{
public static Semaphore Bouncer { get; set; }
public static void Main(string[] args)
{
// Create the semaphore with 3 slots, where 3 are available.
Bouncer = new Semaphore(3, 3);
// Open the nightclub.
OpenNightclub();
}
public static void OpenNightclub()
{
for (int i = 1; i <= 50; i++)
{
// Let each guest enter on an own thread.
Thread thread = new Thread(new ParameterizedThreadStart(Guest));
thread.Start(i);
}
}
public static void Guest(object args)
{
// Wait to enter the nightclub (a semaphore to be released).
Console.WriteLine("Guest {0} is waiting to entering nightclub.", args);
Bouncer.WaitOne();
// Do some dancing.
Console.WriteLine("Guest {0} is doing some dancing.", args);
Thread.Sleep(500);
// Let one guest out (release one semaphore).
Console.WriteLine("Guest {0} is leaving the nightclub.", args);
Bouncer.Release(1);
}
}
}
</code></pre>
|
<p>A semaphore is a way to lock a resource so that it is guaranteed that while a piece of code is executed, only this piece of code has access to that resource. This keeps two threads from concurrently accesing a resource, which can cause problems.</p>
| 5,482
|
<p>So I am writing a registration form and I need the display name to be only numbers, letters and underscores. </p>
<p>Have a look at my code and tell me what I'm doing wrong.</p>
<pre><code><form method="post" action="/" onsubmit="return check_form()">
<input type="text" id="display-name" name="display-name" maxlength="255" />
<input type="submit" />
</form>
<script type="text/javascript">
<!--
var name_regex = /^([a-zA-Z0-9_])+/
function check_form()
{
if (!name_regex.test(document.forms[0].elements[0].value))
{
document.forms[0].elements[0].focus()
alert("Your display name may only contain letters, numbers and underscores")
return false
}
}
-->
</script>
</code></pre>
<p>It's obviously been trimmed down to not include anything not related to the problem but even this snippet doesn't work.</p>
|
<p>Your regex</p>
<pre><code>/^([a-zA-Z0-9_])+/
</code></pre>
<p>Looks for </p>
<ol>
<li>Start of string(check), followed by</li>
<li>1 or more letters, numbers, or underscore (check)</li>
</ol>
<p>And then whatever comes after it doesn't matter. This regex will match anything at all so long as it begins with a letter, number, or underscore</p>
<p>If you put a <code>$</code> at the end, then it will work - <code>$</code> matches 'end of string', so the only way it can match is if there are <em>only</em> numbers, letters, and underscores between the start and end of the string.</p>
<pre><code>/^([a-zA-Z0-9_])+$/
</code></pre>
<p>Secondly, I'd suggest using <code>document.getElementById('display-name').value</code> instead of <code>document.forms</code> as it won't break if you rearrange the HTML, and is more 'the commonly accepted standard of what to do'</p>
|
<p>By 'not working' I take it you mean it is letting invalid entries through (rather than not letting valid entries through).</p>
<p>As @Annan has said, this would probably be due to the lack of the <code>$</code> character at the end of the expression, as currently it only requires a single valid character at the start of the value, and the rest can be anything.</p>
| 3,938
|
<p>I need to store some sensitive data by encrypting it with atleast 128 bit key. I investigated into javax.crypto package and found that there are certain Cipher names, like
PBEWithMD5AndDES or PBEWithSHA1AndDESede which provides encryption upto 56 bit and 80 bit (<a href="http://en.wikipedia.org/wiki/DESede" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/DESede</a>).</p>
<p>I referred other guys posts but those are mainly using RSA and in my understanding RSA is generally suitable for encrypting the communication data (with private-public key pair). My need is different, I just want to store the data and retrieve it back by decrypting it. Therefore I don't need any private-public key pairs.</p>
<p>Please let me know if you have any idea about this.</p>
|
<p>Use <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard" rel="nofollow noreferrer">Advanced Encryption Standard</a> (AES). It supports Key lengths of 128, 192, or 256 bits.</p>
<p>The <a href="http://www.hoozi.com/Articles/AESEncryption.htm" rel="nofollow noreferrer">algorithm</a> is simple. The Sun Java website has a <a href="http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html" rel="nofollow noreferrer">section explaining how to do AES</a> encryption in Java.</p>
<p>From Wikipedia...</p>
<blockquote>
<p>... the Advanced
Encryption Standard (AES), also known
as Rijndael, is a block cipher adopted
as an encryption standard by the U.S.
government. It has been analyzed
extensively and is now used worldwide,
as was the case with its
predecessor, the Data Encryption
Standard (DES)...</p>
</blockquote>
<p>So as a rule of thumb you are not supposed to use DES or its variants because it is being phased out.</p>
<p>As of now, it is better to use AES. There are other options like <a href="http://en.wikipedia.org/wiki/Twofish" rel="nofollow noreferrer">Twofish</a>, <a href="http://en.wikipedia.org/wiki/Blowfish_(cipher)" rel="nofollow noreferrer">Blowfish</a> etc also. Note that Twofish can be considered as an advanced version of Blowfish.</p>
|
<p>I'm not a crypto expert by any means (so take this suggestion with a grain of salt), but I have used <a href="http://en.wikipedia.org/wiki/Blowfish_(cipher)" rel="nofollow noreferrer">Blowfish</a> before, and I think you can use it for what you need. There is also a newer algorithm by the same guy called <a href="http://en.wikipedia.org/wiki/Twofish" rel="nofollow noreferrer">Twofish</a>.</p>
<p>Here is a <a href="http://www.hotpixel.net/software.html" rel="nofollow noreferrer">website with a Java implementation</a>, but be careful of the license (it says free for non-commercial use). You can find that link also from <a href="http://www.schneier.com/blowfish-download.html" rel="nofollow noreferrer">Bruce Schneier's website</a> (the creator of both algorithms).</p>
| 7,171
|
<p>I have a team lead who seems to think that business logic is very subjective, to the point that if my stored procedure has a <code>WHERE ID = @ID</code> — he would call this <em>“business logic”</em></p>
<p>What approach should I take to define <em>“business logic”</em> in a very objective way without offending my team lead?</p>
|
<p>I really think you just need to agree on a clear definition of what you mean when you say "business logic". If you need to be "politically sensitive", you could even craft the definition around your team lead's understanding, then come up with another term ("domain rules"?) that defines what you want to talk about.</p>
<p>Words and terms are relatively subjective -- of course, once you leave that company you will need to 're-learn' industry standards, so it's always better to stick with them if you can, but the main goal is to communicate clearly and get work done.</p>
|
<p>You could try to argue your point with a timed example, run a sql select against an indexed table and then run a loop to find exactly the same item in the same set but this time in code. The code will be much slower.</p>
<p>Let the database do what it was designed to do, select sets and subsets of data :) I think realistically though, all you can do is get your team together to build a set of standards which you will all code to, democracy rules!</p>
| 7,633
|
<p>Around 30% into a large print I had to cancel as the layers of the print were not full layers and looked very stringy. Here's a couple pictures of what it looked like.</p>
<p><a href="https://i.stack.imgur.com/krwhC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/krwhC.jpg" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/L0Nl7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L0Nl7.jpg" alt="enter image description here"></a></p>
<p>I have a feeling that it may be because of my retraction settings either being too high or too fast as this section it was printing had to use a lot of retraction. My retraction settings are 40mm/s for 4.5mm. I was printing at a pretty slow speed (around 55mm/s), and I'm sure confused on why it's not extruding properly at certain times. If anyone has any idea on what is happening and how to fix it it will be gladly appreciated!</p>
<p>I have an Anycubic Delta linear printer with a Bowden extruder, I use white 1.75 mm PLA at 200C, .4mm nozzle</p>
|
<p>It appears that at a certain point, you're running into issues with the extrusion being a bit too viscous / melted causing it to over-deposit or string (fail to retract completely). It also looks like this issue gradually gets worse as you go. This really feels like nozzle over-heating to me.</p>
<p><a href="https://i.stack.imgur.com/S7dKu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S7dKu.jpg" alt="enter image description here"></a><a href="https://i.stack.imgur.com/piGYz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/piGYz.jpg" alt="enter image description here"></a></p>
<p>My troubleshooting steps would go like this:</p>
<ol>
<li><p><strong>Make sure my cooling it set correctly and fan is working properly.</strong> The nozzle doesn't adjust its temp for changes in extrusion speed. At times the printer has to rely on the cooling to get the extrusion leaving the nozzle to an ideal deposition temp, which is far lower than the temperate of the nozzle.</p></li>
<li><p>Check my tool paths to make sure I'm not starting to return to the same X/Y position too immediately when I reach certain layers, not allowing the previous layer to fully solidify. <strong>Consider tweaking the slicer or printing at a lower temperate.</strong></p></li>
<li><p>Check if there's a lot of variance in print speeds for different tasks (shell, infill, etc). It can be hard for some printers to maintain the right temp for the extrusion about to be deposited if the speed changes too rapidly. If your printer has been heating extrusion rapidly for quick movements and then the speed slows way down, it can struggle to keep the subsequent slow filament from getting overcooked, as it can't instantly cool the nozzle even with proper cooling. <strong>Bring the various extrusion speeds closer together.</strong></p></li>
</ol>
|
<p>Try using 20 mm/s and 3.9 mm for your retraction and that should help. Also, what is your fan speed at?</p>
| 614
|
<p>Other than unrolling it and measuring it, is there a method for telling how much filament is left on a spool, for example calculating a length bases on weight or number of turns left on the spook?</p>
<p>Is it possible to extract the amount of filament used from the printer's firmware?</p>
|
<p>If you have an empty spool of the same brand, you could weigh the empty spool and the one you're trying to "measure" to get an approximate weight of the remaining filament. Divide by the (presumably available from manufacturer) weight per meter to get a rough length in meters, if that's more useful to you than weight.</p>
|
<p>Besides using the window on a spool that estimates the amount of filament left, I've used large calipers to measure the diameter of an empty spool and the diameter of the filament left on the spool.</p>
| 2,109
|
<p>While I've seen rare cases where <em>private</em> inheritance was needed, I've never encountered a case where <em>protected</em> inheritance is needed. Does someone have an example?</p>
|
<p>People here seem to mistake Protected class inheritance and Protected methods.</p>
<p>FWIW, I've never seen anyone use protected class inheritance, and if I remember correctly I think Stroustrup even considered the "protected" level to be a mistake in c++. There's precious little you cannot do if you remove that protection level and only rely on public and private. </p>
|
<p><a href="http://www.parashift.com/c++-faq-lite/" rel="nofollow noreferrer">C++ FAQ Lite</a> mentions of a case where using private inheritance is a legitimate solution (See <a href="http://www.parashift.com/c++-faq-lite/private-inheritance.html#faq-24.3" rel="nofollow noreferrer">[24.3.] Which should I prefer: composition or private inheritance?</a>). It's when you want to call the derived class from within a private base class through a virtual function (in this case <code>derivedFunction()</code>):</p>
<pre><code>class SomeImplementationClass
{
protected:
void service() {
derivedFunction();
}
virtual void derivedFunction() = 0;
// virtual destructor etc
};
class Derived : private SomeImplementationClass
{
void someFunction() {
service();
}
virtual void derivedFunction() {
// ...
}
// ...
};
</code></pre>
<p>Now if you want to derive from the class Derived, and you want to use <code>Base::service()</code> from within the derived class (say you want to move <code>Derived::someFunction()</code> to the derived class), the easiest way to accomplish this is to change the private inheritance of <code>Base</code> to protected inheritance.</p>
<p>Sorry, can't think of a more concrete example. Personally I like to make all inheritance public so as to avoid wasting time with "should I make inheritance relation protected or private" discussions.</p>
| 5,178
|
<p>I have a form view, in the edit template I have two drop downs.
Drop down 1 is explicitly set with a list of allowed values. It is also set to autopostback.
Drop down 2 is databound to an objectdatasource, this objectdatasource uses the first dropdown as one of it's parameters. (The idea is that drop down 1 limits what is shown in drop down 2)</p>
<p>On the first view of the edit template for an item it works fine. But if drop down 1 has a different item selected it post back and generates an error </p>
<blockquote>
<p>Databinding methods such as Eval(),
XPath(), and Bind() can only be used
in the context of a databound control.</p>
</blockquote>
<p>Here is the drop down list #2:</p>
<pre><code><asp:DropDownList ID="ProjectList" runat="server" SelectedValue='<%# Bind("ConnectToProject_ID","{0:D}") %>' DataSourceID="MasterProjectsDataSource2" DataTextField="Name" DataValueField="ID" AppendDataBoundItems="true">
<asp:ListItem Value="0" Text="{No Master Project}" Selected="True" />
</asp:DropDownList>
</code></pre>
<p>And here is the MasterProjectDataSource2:</p>
<pre><code><asp:ObjectDataSource ID="MasterProjectsDataSource2" runat="server"
SelectMethod="GetMasterProjectList" TypeName="WebWorxData.Project" >
<SelectParameters>
<asp:ControlParameter ControlID="RPMTypeList" Name="RPMType_ID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</code></pre>
<p>Any help on how to get this to work would be greatly appriciated.</p>
|
<p>I had a similar problem with bound dropdownlists in a FormView. I worked around it by setting the selected value manually in the formview's "OnDataBound". </p>
<p>(don't know where you get ConnectToProject_ID from)</p>
<pre><code>FormView fv = (FormView)sender;
DropDownList ddl = (DropDownList)fv.FindControl("ProjectList");
ddl.SelectedValue = String.Format("{0:D}", ConnectToProject_ID);
</code></pre>
<p>When you ready to save, use the "OnItemInserting" event:</p>
<pre><code>FormView fv = (FormView)sender;
DropDownList ddl = (DropDownList)fv.FindControl("ProjectList");
e.Values["ConnectToProject_ID"] = ddl.SelectedValue;
</code></pre>
<p>or "OnItemUpdating"</p>
<p>When you ready to save, use the "OnItemInserting" event:</p>
<pre><code>FormView fv = (FormView)sender;
DropDownList ddl = (DropDownList)fv.FindControl("ProjectList");
e.NewValues["ConnectToProject_ID"] = ddl.SelectedValue;
</code></pre>
|
<p>Sounds like the controls aren't being databound properly after the postback.</p>
<p>Are you databinding the first dropdown in the page or in the codebehind?
If codebehind, are you doing it in on_init or on_load every time?</p>
<p>There might be an issue of the SelectedValue of the second drop down being set to a non-existent item after the postback.</p>
| 4,254
|
<p>I have an application that uses NHibernate as its ORM and sometimes it experiences performance issues due to how the data is being accessed by it. What kind of things can be done to improve the performance of NHibernate? (Please limit to one recommendation per answer)</p>
|
<p>The first and most dramatic performance problem that you can run into with NHibernate is if you are creating a new session factory for every session you create. Only one session factory instance should be created for each application execution and all sessions should be created by that factory.</p>
<p>Along those lines, you should continue using the same session as long as it makes sense. This will vary by application, but for most web applications, a single session per request is recommended. If you throw away your session frequently, you aren't gaining the benefits of its cache. Intelligently using the session cache can change a routine with a linear (or worse) number of queries to a constant number without much work. </p>
<p>Equally important is that you want to make sure that you are lazy loading your object references. If you are not, entire object graphs could be loaded for even the most simple queries. There are only certain reasons not to do this, but it is always better to start with lazy loading and switch back as needed.</p>
<p>That brings us to eager fetching, the opposite of lazy loading. While traversing object hierarchies or looping through collections, it can be easy to lose track of how many queries you are making and you end up with an exponential number of queries. Eager fetching can be done on a per query basis with a FETCH JOIN. In rare circumstances, such as if there is a particular pair of tables you always fetch join, consider turning off lazy loading for that relationship.</p>
<p>As always, SQL Profiler is a great way to find queries that are running slow or being made repeatedly. At my last job we had a development feature that counted queries per page request as well. A high number of queries for a routine is the most obvious indicator that your routine is not working well with NHibernate. If the number of queries per routine or request looks good, you are probably down to database tuning; making sure you have enough memory to store execution plans and data in the cache, correctly indexing your data, etc.</p>
<p>One tricky little problem we ran into was with SetParameterList(). The function allows you to easily pass a list of parameters to a query. NHibernate implemented this by creating one parameter for each item passed in. This results in a different query plan for every number of parameters. Our execution plans were almost always getting released from the cache. Also, numerous parameters can significantly slow down a query. We did a custom hack of NHibernate to send the items as a delimited list in a single parameter. The list was separated in SQL Server by a table value function that our hack automatically inserted into the IN clause of the query. There could be other land mines like this depending on your application. SQL Profiler is the best way to find them.</p>
|
<p>What lotsoffreetime said.</p>
<p>Read Chapter 19 of the documentation, "Improving Performance".<br>
NHibernate: <a href="http://nhibernate.info/doc/nhibernate-reference/performance.html" rel="nofollow noreferrer">http://nhibernate.info/doc/nhibernate-reference/performance.html</a><br>
Hibernate: <a href="http://docs.jboss.org/hibernate/core/3.3/reference/en/html/performance.html" rel="nofollow noreferrer">http://docs.jboss.org/hibernate/core/3.3/reference/en/html/performance.html</a></p>
<p>Use SQL Profiler (or equivalent for the database you're using) to locate long-running queries. Optimize those queries with appropriate indexes. </p>
<p>For database calls used on nearly every single page of an application, use CreateMultiQuery to return multiple resultsets from a single database query. </p>
<p>And of course, cache. The OutputCache directive for pages/controls. NHibernate caching for data.</p>
| 9,268
|
<p>That's it. If you want to document a function or a class, you put a string just after the definition. For instance:</p>
<pre><code>def foo():
"""This function does nothing."""
pass
</code></pre>
<p>But what about a module? How can I document what a <em>file.py</em> does?</p>
|
<p>For the packages, you can document it in <code>__init__.py</code>.
For the modules, you can add a docstring simply in the module file.</p>
<p>All the information is here: <a href="http://www.python.org/dev/peps/pep-0257/" rel="noreferrer">http://www.python.org/dev/peps/pep-0257/</a></p>
|
<p>It's easy, you just add a docstring at the top of the module.</p>
| 6,572
|
<p>I'm having an amazing amount of trouble starting and stopping a service on my remote server from my msbuild script.</p>
<p>SC.EXE and the ServiceController MSBuild task don't provide switches to allow a username/password so they won't authenticate, so I'm using RemoteService.exe from www.intelliadmin.com</p>
<p>-Authenticating with \xx.xx.xx.xxx
-Authentication complete
-Stopping service
-Error: Access Denied</p>
<p>The user account details I'm specifying are for a local admin on the server, so whats up?! I'm tearing my hair out!</p>
<h3>Update:</h3>
<p>OK here's a bit more background. I have an an XP machine in the office running the CI server. The build script connects a VPN to the datacentre, where I have a Server 2008 machine. Neither of them are on a domain.</p>
|
<p>Often, you can connect to the IPC$ "pseudo-share" on the machine to help establish the credentials before running commands like SC.EXE. Use a command like:</p>
<pre><code>C:\> net use \\xx.xx.xx.xx\ipc$ * /user:username
</code></pre>
<p>The <code>*</code> tells it to prompt you for the password.</p>
|
<p>If I understand your scenario correctly, it could help running the script with a domain account which is administrator on your remote machine (or better: has the right to start and stop the service).</p>
| 4,492
|
<p>I didn't see any similar questions asked on this topic, and I had to research this for something I'm working on right now. Thought I would post the answer for it in case anyone else had the same question.</p>
|
<p>I found the answer here: <a href="http://blog.sqlauthority.com/2007/08/22/sql-server-t-sql-script-to-insert-carriage-return-and-new-line-feed-in-code/" rel="noreferrer">http://blog.sqlauthority.com/2007/08/22/sql-server-t-sql-script-to-insert-carriage-return-and-new-line-feed-in-code/</a></p>
<p>You just concatenate the string and insert a <code>CHAR(13)</code> where you want your line break. </p>
<p>Example:</p>
<pre><code>DECLARE @text NVARCHAR(100)
SET @text = 'This is line 1.' + CHAR(13) + 'This is line 2.'
SELECT @text
</code></pre>
<p>This prints out the following:</p>
<blockquote>
<p>This is line 1.<br>
This is line 2.</p>
</blockquote>
|
<p>In some special cases you may find this useful (e.g. rendering cell-content in MS Report )
<br>example:</p>
<pre><code>select * from
(
values
('use STAGING'),
('go'),
('EXEC sp_MSforeachtable
@command1=''select ''''?'''' as tablename,count(1) as anzahl from ? having count(1) = 0''')
) as t([Copy_and_execute_this_statement])
go
</code></pre>
| 5,092
|
<p>Is there a difference between <code>NULL</code> and <code>null</code> in PHP? Sometimes they seem to be interchangeable and sometimes not.</p>
<p>edit: for some reason when I read the documentation linked to in the answer (before posting this question) I read it as "case sensitive" instead of "case insensitive" which was the whole reason I posted this question in the first place...</p>
|
<p>Null is case insensitive.</p>
<p>From the <a href="http://ca3.php.net/manual/en/language.types.null.php" rel="noreferrer">documentation</a>:</p>
<blockquote>
<p>There is only one value of type null, and that is the <strong>case-insensitive</strong> keyword NULL.</p>
</blockquote>
|
<p>Either will work. But the official PHP style guide, PSR-12, recommends lowercase.</p>
<p><a href="https://www.php-fig.org/psr/psr-12/" rel="nofollow noreferrer">https://www.php-fig.org/psr/psr-12/</a>, Section 2.5</p>
| 3,034
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.