instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>I have seen lots of questions recently about WPF...</p> <ul> <li>What is it?</li> <li>What does it stand for?</li> <li>How can I begin programming WPF?</li> </ul>
<p>WPF is a new technology that will supersede Windows Forms. WPF stands for Windows Presentation Foundation Here are some useful topics on SO:</p> <ol> <li><a href="https://stackoverflow.com/questions/9591/what-wpf-books-would-you-recommend">What WPF books would you recommend</a></li> <li><a href="https://stackoverfl...
<p>Windows Presentation Foundation. It's basically Microsoft's latest attempt to make development easier, and provide a whole heap of nice functionality out of the box. I'm not sure where to start, but googling "WPF 101" should throw up a few useful links. </p>
5,870
<p>In .NET, is it more appropriate to throw an argument null exception for an Integer if the value is Integer.MinValue or Integer = 0 (assuming that 0 is not a valid value)?</p>
<p>Throwing an ArgumentNullException isn't appropriate unless the argument is actually <strong>null</strong>. Throw an ArgumentOutOfRangeException instead (preferably with a message informing the user what values of int are actually acceptable).</p> <blockquote> <p><strong>ArgumentOutOfRangeException</strong> is thr...
<p>If the argument is not null, don't throw an <code>ArgumentNullException</code>. It would probably be more reasonable to throw an <code>ArgumentException</code>, <a href="http://msdn.microsoft.com/en-us/library/system.argumentexception.aspx" rel="nofollow noreferrer">explained here.</a></p> <p><strong>edit:</strong>...
3,734
<p>So, in your experience, whats the best way? Is there a secure way that's also scriptable/triggerable in a build automation tool?</p> <p>Edit: I should mention this is windows/.net and I'll be deploying to iis6</p>
<p>For some projects I use <a href="http://www.capify.org/" rel="nofollow noreferrer">Capistrano</a> to push out to live. It is built on top of ruby and makes deploy script writing super easy and uses ssh. </p> <p>On other projects I have a tiny deploy app that uses bash to do an svn export to a temporary directory an...
<p>You could always write a small client/server app that encrypts at the source, pushes the files, and then decrypts at the destination. That's a little bit of work, but probably a trivial amount. And it's scriptable as long as your automation tool supports executing something in the file system (which I think all do)....
3,883
<p>I'm using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop, I am doing an insert:</p> <pre><code>insert into ps_tl_compleave_tbl values('2626899', 0, TO_DATE('01/01/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '52', TO_DATE('01/01/2002', 'MM/DD/YYYY'), 16.000000, 24.000)insert into ps_tl_compleave_...
<p>In .net, when we try to execute a single Oracle SQL statement with a semicolon at the end. The result will be an oracle error: ora-00911: invalid character. OK, you figure that one SQL statement doesn't need the semicolon, but what about executing 2 SQL statement in one string for example:</p> <pre><code>Dim db As...
<p>It's a long shot but in the first insert the sql date format is valid for both uk/us, the second insert is invalid if the Oracle DB is setup for UK date format, I realise you have used the TO_DATE function but I don't see anything else ...</p>
9,774
<p>For all the RSS feeds I subscribe to I use <a href="http://www.google.com/reader/" rel="nofollow noreferrer">Google Reader</a>, which I love. I do however have a couple of specific RSS feeds that I'd like to be notified of as soon as they get updated (say, for example, an RSS feed for a forum I like to monitor and r...
<p>If you have access to Microsoft Outlook 2007 or Thunderbird, these email clients allow you to add RSS feeds in the same way you would add an email account.</p> <p>I use Google Reader generally but when I want to keep up-to-date with something specific, I add the RSS feed to Outlook and it arrives in my inbox as if ...
<p>I've used <a href="http://www.pingie.com" rel="nofollow noreferrer">Pingie</a> to send me an SMS when a new item appears in an RSS feed. Perhaps, it will be useful for you, if you have a cellphone text messaging plan.</p>
2,427
<p>One thing I really miss about Java is the tool support. FindBugs, Checkstyle and PMD made for a holy trinity of code quality metrics and automatic bug checking. </p> <p>Is there anything that will check for simple bugs and / or style violations of Ruby code? Bonus points if I can adapt it for frameworks such as ...
<p>I've recently started looking for something like this for Ruby. What I've run across so far:</p> <ul> <li><a href="http://saikuro.rubyforge.org/" rel="noreferrer">Saikuro</a></li> <li><a href="http://www.martyandrews.net/blog/2008/09/first_official_release_of_rood.html" rel="noreferrer">Roodi</a></li> <li><a href=...
<p>There is also <a href="https://github.com/simplabs/excellent" rel="nofollow">excellent</a>. I haven't tried it yet, but it too looks promising. </p>
7,902
<p>I have a little problem with a Listview.</p> <p>I can load it with listview items fine, but when I set the background color it doesn't draw the color all the way to the left side of the row [The listViewItems are loaded with ListViewSubItems to make a grid view, only the first column shows the error]. There is a a...
<p>Ah! I see now :}</p> <p>You want hacky? I present unto you the following:</p> <pre><code> ... lv.OwnerDraw = true; lv.DrawItem += new DrawListViewItemEventHandler( lv_DrawItem ); ... void lv_DrawItem( object sender, DrawListViewItemEventArgs e ) { Rectangle foo = e.Bounds; foo.Offset( -10,...
<p>Ok I'm adding some additional solution notes. If you use the solution above you also need to insert a draw handler for the column headers, otherwise they won't paint. The selected item rectangle also looks funny so you'll want to check for that in the lv_DrawItem function and implement a similar solution. Remeber ...
8,517
<p>I’m just getting my feet wet with 3D printing, and I’ve had a few prints do this. Curious if anyone has any ideas for me that might help clean this up? (I don’t really have anyone in my personal circle who can help out, so hoping this community can :) )</p> <p>Edit 5/23 The first layer of the print is inconsistent i...
<p>It looks like your nozzle is a little too close to the bed, if there is not enough space, you can see through the layer and pressure can build up and ooze out when there is a little more room in a different location (if the bed isn't completely flat/straight).</p> <p>You could level with a thicker piece of paper or ...
<p>It looks like a bed adhesion problem to me. Some additive information: What is your bed material?</p> <p>Z-calibration problem isn't the only suspect. I've seen the same problem with my printer before. There were defects in some parts of my glass print bed that prevented it from sticking.</p> <p>The molten filament ...
1,946
<p>The application my team is currently developing has a DLL that is used to perform all database access. The application can not use a trusted connection because the database is behind a firewall and the domain server is not. So it appears that the connection string needs to have a DB username and password. The DLL...
<p>I'm not certain, but I believe you can put it in a config file and encrypt the config file.</p> <p>Update: See Jon Galloway's post <a href="http://weblogs.asp.net/jongalloway/archive/2008/04/13/encrypting-passwords-in-a-net-app-config-file.aspx" rel="nofollow noreferrer">here.</a></p>
<p>If the app is an ASP.NET app then just encrypt the connection strings section of your <code>web.config</code>.</p> <p>If the app is a client application running on multiple machines, instead of storing the connection string locally, consider using a web service or some other kind of secure mechanism to store it cent...
2,792
<p>I was trying to add a favicon to a website earlier and looked for a better way to implement this than to dump a <code>favicon.ico</code> file in the root of the website.</p> <p>I found this nice little guide: <a href="http://www.w3.org/2005/10/howto-favicon" rel="noreferrer">How to Add a Favicon</a>. However, the p...
<p>This is what I always use: </p> <pre><code>&lt;link rel="icon" href="favicon.ico" type="image/x-icon" /&gt; &lt;link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /&gt; </code></pre> <p>The second one is for IE. The first one is for other browsers.</p>
<p>This is how they're doing it right here on Stack Overflow:</p> <pre><code>&lt;link rel="shortcut icon" href="/favicon.ico" /&gt; </code></pre>
2,838
<p>Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using.</p> <p>What's the best way to figure this out? ++happy for various platform solutions. </p>
<p>Oracle provides a utility called <code>tnsping</code>:</p> <pre><code>R:\&gt;tnsping someconnection TNS Ping Utility for 32-bit Windows: Version 9.0.1.3.1 - Production on 27-AUG-20 08 10:38:07 Copyright (c) 1997 Oracle Corporation. All rights reserved. Used parameter files: C:\Oracle92\network\ADMIN\sqlnet.ora ...
<p>The easiest way is probably to check the <strong>PATH</strong> environment variable of the process that is connecting to the database. Most likely the tnsnames.ora file is in <em>first Oracle bin directory in path</em>..\network\admin. TNS_ADMIN environment variable or value in registry (for the current Oracle home)...
3,169
<p>Using CSS,</p> <p>I'm trying to specify the height of a <code>span</code> tag in Firefox, but it's just not accepting it (IE does).</p> <p>Firefox accepts the <code>height</code> if I use a <code>div</code>, but the problem with using a <code>div</code> is the annoying line break after it, which I can't have in th...
<pre><code>&lt;style&gt; #div1 { float:left; height:20px; width:20px; } #div2 { float:left; height:30px; width:30px } &lt;/style&gt; &lt;div id="div1"&gt;FirstDiv&lt;/div&gt; &lt;div id="div2"&gt;SecondDiv&lt;/div&gt; </code></pre> <p>As long as the container for whatever is holding <code>div's</code> 1 and 2 is wide...
<p><code>height</code> in <code>em</code> = <code>relative line-height</code></p> <p>for example <code>height:1.1em</code> with <code>line-height:1.1</code></p> <p>= 100% filled</p>
4,468
<p>What is the best way to profile a controller action in Ruby on Rails. Currently I am using the brute-force method of throwing in <code>puts Time.now</code> calls between what I think will be a bottleneck. But that feels really, really dirty. There has got to be a better way.</p>
<p>I picked up this technique a while back and have found it quite handy.</p> <p>When it's in place, you can add <code>?profile=true</code> to any URL that hits a controller. Your action will run as usual, but instead of delivering the rendered page to the browser, it'll send a detailed, nicely formatted ruby-prof pag...
<p>This works in Rails 4.2.6:</p> <pre><code> o=OpenStruct.new(logger: Rails.logger) o.extend ActiveSupport::Benchmarkable o.benchmark 'name' do # ... your code ... end </code></pre>
5,125
<p>I sent 3 emails last week as replies from our website. None received them! One was yahoo, hotmail and an overseas domain. I am wondering if it's not a good idea to open a yahoo account with our domain name as the user just to reply to prospective buyers. </p>
<p>Your mail server's IP may have been black listed. This is common on shared servers. <a href="http://www.mxtoolbox.com/blacklists.aspx" rel="nofollow noreferrer">http://www.mxtoolbox.com/blacklists.aspx</a> </p>
<p>You could also try looking at <a href="http://www.google.com/apps/intl/en/business/index.html" rel="nofollow noreferrer">gmail for domains</a>. It's what I use and so far I haven't had a problem withany spam filters. Also make sure that you are not writing the content of the message to where a spam filter could flag...
9,398
<p>I'm looking for sources of inspiration and/or design patterns for navigation 'breadcrumbs'. So far I have found the <a href="http://patterntap.com/tap/collection/breadcrumbs" rel="noreferrer">breadcrumb collection on Pattern Tap</a>. Does anyone know of any other sources?</p>
<p>The article '<a href="http://www.alistapart.com/articles/taminglists/" rel="noreferrer">Taming lists</a>' from A List Apart has some good advice on CSS styling for breadcrumbs (look down for the heading 'Breadcrumb Trails').</p>
<p>If using Microsoft ASP.NET, there's a built in control: <a href="http://msdn.microsoft.com/en-us/library/x20z8c51.aspx" rel="nofollow noreferrer">SiteMapPath</a>.</p>
7,230
<p>If you have an <code>NSMutableArray</code>, how do you shuffle the elements randomly?</p> <p>(I have my own answer for this, which is posted below, but I'm new to Cocoa and I'm interested to know if there is a better way.)</p> <hr> <p>Update: As noted by @Mukesh, as of iOS 10+ and macOS 10.12+, there is an <code>...
<p>I solved this by adding a category to NSMutableArray.</p> <p><strong>Edit:</strong> Removed unnecessary method thanks to answer by Ladd.</p> <p><strong>Edit:</strong> Changed <code>(arc4random() % nElements)</code> to <code>arc4random_uniform(nElements)</code> thanks to answer by Gregory Goltsov and comments by mi...
<pre><code>NSUInteger randomIndex = arc4random() % [theArray count]; </code></pre>
8,063
<p>I've seen questions about (like <a href="https://3dprinting.stackexchange.com/q/2670/11157">What is stopping us from mixing 3d filament colors in an Extruder?</a>) and some solutions for mixing filament colors/materials at print time for multi-color printing, but my question is different: Are there any (affordable) ...
<p>OK, it just turned up on Thingiverse that someone has demonstrated a trivial machine to do exactly what I asked for: any FDM printer.</p> <blockquote> <p>Its sounds crazy, but it works! This technique will allow you to create one offs, and to color match your 3D-prints.</p> <p>It works by changing the filament (and ...
<h2>Making your own filament</h2> <p>Theoretically, this could be done with any filament producing equipment by taking the two filaments and shredding them into pellets and feeding them to the machine in the right mix for the color you want. Industrial setups like a <a href="https://www.filabot.com/" rel="nofollow nore...
1,296
<p>What tools are available to monitor graphics card memory usage in linux?</p>
<p><a href="http://developer.nvidia.com/content/nvidia-perfkit" rel="nofollow noreferrer">NVIDIA PerfKit</a> has a linux version which allows real-time monitoring of various graphics card properties, including graphics card memory usage. Obviously, this only works for NVIDIA graphics cards, and it also requires the use...
<p>If you just need to know it for 3D graphics development purposes, you may want to look into something like <a href="http://www.gremedy.com/" rel="nofollow noreferrer">gDEBugger</a> or, if you only care about NVIDIA cards, you can try <a href="http://developer.nvidia.com/content/nvidia-perfhud" rel="nofollow noreferr...
7,265
<p>I recently discussed editors with a co-worker. He uses one of the less popular editors and I use another (I won't say which ones since it's not relevant and I want to avoid an editor flame war). I was saying that I didn't like his editor as much because it doesn't let you do find/replace with regular expressions.<...
<p>Just last week, I used regex find/replace to convert a CSV file to an XML file.</p> <p>Simple enough to do really, just chop up each field (luckily it didn't have any escaped commas) and push it back out with the appropriate tags in place of the commas.</p>
<p>The first thing I do with any editor is try to figure out it's Regex oddities. I use it all the time. Nothing really crazy, but it's handy when you've got to copy/paste stuff between different types of text - SQL &lt;-> PHP is the one I do most often - and you don't want to fart around making the same change 500 t...
7,510
<p>I am rewriting code to handle some embedded communications and right now the protocol handling is implemented in a While loop with a large case/switch statement. This method seems a little unwieldy. What are the most commonly used flow control methods for implementing communication protocols?</p>
<p>It sounds like the "while + switch/case" is a statemachine implementation. I believe that a well thought out statemachine is often the easiest and most readable way to implement a protocol.</p> <p>When it comes to statemachines, breaking some of the traditional programming rules comes with the territory. Rules like...
<p>For cases where you key off of a field in a protocol header to direct you to the next stage of processing for that protocol, arrays of function pointers can be used. You use the value from the protocol header to index into the array and call the function for that protocol.</p> <p>You <strong>must</strong> handle al...
9,004
<p>I have a multi dimensional OLAP cube with a number of dimensions. Some of these dimensions have hierarchies. The users would like to perform 'what-if' analysis on the measures in the cube by changing the hierarchies in the dimensions. </p> <p>For example, they want to know the impact on departmental resource budget...
<p>have you taken a look here? <a href="http://office.microsoft.com/en-us/excel/HA011265551033.aspx" rel="nofollow noreferrer">http://office.microsoft.com/en-us/excel/HA011265551033.aspx</a> if you are using sql server and excel, you want the "Excel Add-in for SQL Server Analysis Services" and you can perform writeback...
<p>There may be tools that allow this sort of analysis, but I only have experience of writing MDX, which ought to be able to help you.</p> <p>Typical 'what if' analysis is more about changing values in the OLAP cube (e.g. change net sales from 845.45 to 700.00 and see what happens to gross profit). Your case is a bit ...
5,457
<p>In Google Reader, you can use a bookmarklet to "note" a page you're visiting. When you press the bookmarklet, a little Google form is displayed on top of the current page. In the form you can enter a description, etc. When you press Submit, the form submits itself without leaving the page, and then the form disappea...
<p>Aupajo has it right. I will, however, point you towards a bookmarklet framework I worked up for our site (<a href="http://www.iminta.com" rel="nofollow noreferrer">www.iminta.com</a>).</p> <p>The bookmarklet itself reads as follows:</p> <pre><code>javascript:void((function(){ var e=document.createElement('script...
<p>At it's very basic level it will be using <code>createElement</code> to create the elements to insert into the page and <code>appendChild</code> or <code>insertBefore</code> to insert them into the page.</p>
9,327
<p>I'm looking for suggestions for 3D design software which support designing multi-material parts.</p> <p>I will be printing on a multi-extruder machine based on RepRap firmware. The printer will handle the files when given a proper g-code file. Slic3r will produce a proper g-code file given the right input. STL s...
<h2>A Scriptable Process for Generating Multi-Material STL Files:</h2> <p>I am now using interactive CAD software to define the more complex features of the object I am printing (in the current case, clock faces), and then using OpenSCAD to do the boolean volume operations. </p> <p>To print the composite object, I n...
<p>You do not necessarily need a specific design tool, you can use any tool you want to create your multiple material product. It is the slicer software that manages the materials by assigning the correct extruder. E.g. Cura is able to join 2 STL files that fit together and assign each part a specific extruder and thus...
860
<p>Not quite sure what's happening here. I printed it as a single ball and had this effect. I thought it might be a cooling issue so I printed 4 at once but the issue still occurred. If I size the ball up, the problem reduces.</p> <p>Note that the hole is supposed to be a cylinder.</p> <p><a href="https://i.stack.img...
<p>It looks like possibly a combination of too high of extruder temperature and poor retraction.</p> <ol> <li>First, try <strong><em>reducing your extruder temperature</em></strong>. PLA ideal extruder temps range from about 185C to 225C; depending on purity, quality, and climate. This can help prevent additional oozi...
<p>It looks like it is trying to fill in what might be small gaps and is putting blobs down because the gaps to too small of a detail to accurately fill.</p>
411
<p>I have a very simple problem which requires a very quick and simple solution in SQL Server 2005.</p> <p>I have a table with x Columns. I want to be able to select one row from the table and then transform the columns into rows.</p> <pre><code>TableA Column1, Column2, Column3 </code></pre> <p>SQL Statement to rutu...
<p>You should take a look at the UNPIVOT clause.</p> <p><strong>Update1</strong>: GateKiller, strangely enough I read an article (about something unrelated) about it this morning and I'm trying to jog my memory where I saw it again, had some decent looking examples too. It'll come back to me I'm sure.</p> <p><strong>...
<p><a href="http://msdn.microsoft.com/en-us/library/ms180026.aspx" rel="nofollow noreferrer">UNION</a> should be your friend:</p> <pre><code>SELECT Column1 FROM table WHERE idColumn = 1 UNION ALL SELECT Column2 FROM table WHERE idColumn = 1 UNION ALL SELECT Column3 FROM table WHERE idColumn = 1 </code></pre> <p>but i...
2,559
<p>Trying to get my css / C# functions to look like this:</p> <pre><code>body { color:#222; } </code></pre> <p>instead of this:</p> <pre><code>body { color:#222; } </code></pre> <p>when I auto-format the code.</p>
<p><strong>C#</strong></p> <ol> <li>In the <em>Tools</em> Menu click <em>Options</em></li> <li>Click <em>Show all Parameters</em> (checkbox at the bottom left) (<em>Show all settings</em> in VS 2010)</li> <li>Text Editor</li> <li>C#</li> <li>Formatting</li> <li>New lines</li> </ol> <p>And there check when you want new ...
<p>If you're looking for this option within <strong>Visual Studio 2014</strong>, then it's under advanced and is now a 'Brace positions' drop down box:</p> <p><img src="https://i.stack.imgur.com/QbA8S.png" alt="enter image description here"></p>
6,064
<p>How would I go about replacing Windows Explorer with a third party tool such as TotalCommander, explorer++, etc?</p> <p>I would like to have one of those load instead of win explorer when I type "C:\directoryName" into the run window. Is this possible?</p>
<p>From a comment on the first LifeHacker link,</p> <h3>How to make x² your default folder application</h3> <p>As part of the installation process, x² adds "open with xplorer2" in the context menu for filesystem folders.</p> <p>If you want to have this the default action (so that folders always open in x2 when you c...
<p>If you go to Control Panel -> Folder Options And go to the File Types tab. You can go to the "Folder" file type (with "(NONE)" as the extension). Go to Advanced, create a new action that uses your program (I tried it with FreeCommander). Make sure you set it as default.</p> <p>That should do it.</p>
7,864
<p>If I call <code>os.stat()</code> on a broken <code>symlink</code>, python throws an <code>OSError</code> exception. This makes it useful for finding them. However, there are a few other reasons that <code>os.stat()</code> might throw a similar exception. Is there a more precise way of detecting broken <code>symlinks...
<p>A common Python saying is that it's easier to ask forgiveness than permission. While I'm not a fan of this statement in real life, it does apply in a lot of cases. Usually you want to avoid code that chains two system calls on the same file, because you never know what will happen to the file in between your two c...
<p>I had a similar problem: how to catch broken symlinks, even when they occur in some parent dir? I also wanted to log all of them (in an application dealing with a fairly large number of files), but without too many repeats.</p> <p>Here is what I came up with, including unit tests.</p> <p><strong>fileutil.py</stro...
4,115
<p>When looking beyond the <a href="https://en.wikipedia.org/wiki/Rapid_application_development" rel="noreferrer">RAD</a> (drag-drop and configure) way of building user interfaces that many tools encourage you are likely to come across three design patterns called <a href="http://en.wikipedia.org/wiki/Model%E2%80%93vie...
<h2>Model-View-Presenter</h2> <p>In <strong>MVP</strong>, the Presenter contains the UI business logic for the View. All invocations from the View delegate directly to the Presenter. The Presenter is also decoupled directly from the View and talks to it through an interface. This is to allow mocking of the View in a un...
<p><strong>MVP</strong></p> <p>MVP stands for Model - View- Presenter. This came to a picture in early 2007 where Microsoft introduced Smart Client windows applications. </p> <p>A presenter is acting as a supervisory role in MVP which binding View events and business logic from models.</p> <p>View event binding will...
2,428
<p>Let's say you work someplace where every change to source code must be associated with a bug-report or feature-request, and there is no way to get that policy reformed. In such an environment, what is the best way to deal with code refactorings (that is, changes that improve the code but do not fix a bug or add a f...
<p>I vote for the "sneak in refactorings" approach, which is, I believe, the way refactoring is meant to be done in the first place. It's probably a bad idea to refactor just for the sake of "cleaning up the code." This means that you're making changes for no real reason. Refactoring is, by definition, modifying the...
<p>Lets have a look at each option:</p> <ul> <li>Write up a bug-report and associate the refactoring with it.</li> </ul> <p>If you feel that, in your opinion, the original code poses a security risk or potential for crashing or instability. Write a small bug report outlining the danger, and then fix it.</p> <ul> <li...
7,790
<p>I have jQuery but I'm not sure if it has any built-in sorting helpers. I could make a 2d array of each item's <code>text</code>, <code>value</code>, and <code>selected</code> properties, but I don't think that javascript's built in <code>Array.sort()</code> would work correctly.</p>
<p>Extract options into a temporary array, sort, then rebuild the list:</p> <pre><code>var my_options = $("#my_select option"); var selected = $("#my_select").val(); my_options.sort(function(a,b) { if (a.text &gt; b.text) return 1; if (a.text &lt; b.text) return -1; return 0 }) $("#my_select").empty().ap...
<p>Seems jquery still is not particularly helpful enough for sorting options in a html select element. Here is some plain-plain javascript code for sorting options:</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-...
6,790
<p>I have a dropdownlist with the autopostback set to true. I want the user to confirm if they really want to change the value, which on post back fires a server side event (selectedindexchanged).</p> <p>I have tried adding an onchange attribute "return confirm('Please click OK to change. Otherwise click CANCEL?';") b...
<p>Have you tried to set the onChange event to a javascript function and then inside the function display the javascript alert and utilize the __doPostback function if it passes?</p> <p>i.e.</p> <pre><code> drpControl.Attributes("onChange") = "DisplayConfirmation();" function DisplayConfirmation() { if (confirm...
<p>Make sure your event is wired:</p> <pre><code>dropDown.SelectedIndexChanged += new EventHandler(dropDown_SelectedIndexChanged); </code></pre> <p>You can also apply a client-side attribute to return the confirmation. Set the index accordingly if cancelled.</p> <pre><code>dropDown.Attributes.Add("onchange", "javasc...
9,946
<p>We need a good CMS that supports data clustering (managing and storing data on different servers). By "good" , I mean : reliable , minimum bugs , the faster the better. (Oh , and it should make coffee :) ) </p>
<p>Yes … kitchen sink + community + support: Plone. Development heading very much in the right direction. </p> <p>Plone is in some ways a different creature from many other systems. Depending on the environment, ultra-high performance may require some attention but in the community there's great expertise to steer any...
<p>I am not sure about "Performance-oriented" means for you. There are sites with Drupal and Joomla that receives million of visits month after month, and do not need special configurations like data clustering.</p> <p>I think you must ask yourself if you need all you said.</p> <p>For reliability, and no bugs or mini...
9,521
<p>I´ve have read an article to change different pattern depending on amount of layers, but my question is if is possible to have different infill in the same part? For example:</p> <ul> <li>Base: has the infill of 25&nbsp;% but the same base has some tabs for screws and mount the part for this area the infill need to...
<p>This answer explains that you can have different infill within the same part. Firstly the implementation in <strong>Ultimaker Cura</strong> is described, secondly how you can do this in <strong>Slic3r</strong>.</p> <hr /> <h2>Ultimaker Cura</h2> <p>I've used a feature in <strong>Ultimaker Cura</strong> that can be u...
<p>Yes, it's possible, and not just limited to Cura. If you use GrabCAD Print (for Stratasys printers), the <em>Advanced FDM</em> feature allows different infill in different regions of your part - not based on layers, but based on your CAD geometry. Because of this, you have to start the process in CAD, by creating a ...
980
<p>I am trying to print a wing for a rc plane with my 3D printer. In order to make the wing as light as possible I need to hollow it (and afterwards put some stable structure there). I've tried the Blender Solidify modifier to do this but without success. The material on the sharp edge on the rear part of the wing gets...
<p>I am sorry to inform you, that the answer to "How do I fix the thickness" is "Remodel them" - especially in this case as the whole design is... awkward.</p> <p>But you don't necessarily need to resign them from scratch, if you can fix it... But beware, fixing does only work <strong>sometimes</strong>...</p> <p>Fir...
<p>Don't design your part as hollow. Make it solid. Then put it in the slicer and chose the infill (i recomment cubic pattern in cura) you want. So you have a mainly hollow wing with a nice structure in it. </p>
1,079
<p>I am coming from an Enterprise Java background which involves a fairly heavyweight software stack, and have recently discovered the <a href="http://www.stripesframework.org/" rel="noreferrer">Stripes framework</a>; my initial impression is that this seems to do a good job of minimising the unpleasant parts of build...
<p>We've been using Stripes for about 4 years now. Our stack is Stripes/EJB3/JPA.</p> <p>Many use Stripes plus Stripernate as a single, full stack solution. We don't because we want our business logic within the EJB tier, so we simply rely on JPA Entities as combined Model and DTO.</p> <p>Stripes does the binding to ...
<p>Stripes is yesterdays technology, if you can pick something a little more modern like GWT.</p>
6,984
<p>How do I page results in SQL Server 2005?</p> <p>I tried it in SQL Server 2000, but there was no reliable way to do this. I'm now wondering if SQL Server 2005 has any built in method?</p> <p>What I mean by paging is, for example, if I list users by their username, I want to be able to only return the first 10 reco...
<p>You can use <code>the Row_Number()</code> function. Its used as follows:</p> <pre><code>SELECT Row_Number() OVER(ORDER BY UserName) As RowID, UserFirstName, UserLastName FROM Users </code></pre> <p>From which it will yield a result set with a <code>RowID</code> field which you can use to page between.</p> <pre><c...
<p>I believe you'd need to perform a separate query to accomplish that unfortionately.</p> <p>I was able to accomplish this at my previous position using some help from this page: <a href="https://web.archive.org/web/20210510021915/http://aspnet.4guysfromrolla.com/articles/031506-1.aspx" rel="nofollow noreferrer">Pagi...
2,498
<p>I've been using <a href="http://en.wikipedia.org/wiki/Apache_Subversion" rel="nofollow noreferrer">Subversion</a> for a few years and after using <a href="http://en.wikipedia.org/wiki/Microsoft_Visual_SourceSafe" rel="nofollow noreferrer">SourceSafe</a>, I just love Subversion. Combined with <a href="http://en.wiki...
<p>Git is not better than Subversion. But is also not worse. It's different.</p> <p>The key difference is that it is decentralized. Imagine you are a developer on the road, you develop on your laptop and you want to have source control so that you can go back 3 hours.</p> <p>With Subversion, you have a Problem: The S...
<p>First, concurrent version control seems like an easy problem to solve. It's not at all. Anyway...</p> <p>SVN is quite non-intuitive. Git is even worse. [sarcastic-speculation] This might be because developers, that like hard problems like concurrent version control, don't have much interest in making a good UI. [/s...
2,330
<p>Had an interesting discussion with some colleagues about the best scheduling strategies for realtime tasks, but not everyone had a good understanding of the common or useful scheduling strategies.</p> <p>For your answer, please choose one strategy and go over it in some detail, rather than giving a little info on s...
<p>As described in a paper titled <a href="http://www.ee.duke.edu/~krish/wip.pdf" rel="noreferrer">Real-Time Task Scheduling for Energy-Aware Embedded Systems</a>, Swaminathan and Chakrabarty describe the challenges of real-time task scheduling in low-power (embedded) devices with multiple processor speeds and power co...
<p>One common real-time scheduling scheme is to use priority-based preemptive multitasking.<br> Each tasks is assigned a different priority level.<br> The highest priority task on the ready queue will be the task that runs. It will run until it either gives up the CPU (i.e. delays, waits on a semaphore, etc...) or a h...
7,258
<p>I'm working on VS 2005 and something has gone wrong on my machine. Suddenly, out of the blue, I can no longer build deployment files. The build message is:</p> <pre><code>ERROR: An error occurred generating a bootstrapper: Invalid syntax. ERROR: General failure building bootstrapper ERROR: Unrecoverable build erro...
<p><strong>SOLUTION!</strong><br> Thanks to Michael Bleifer of Microsoft support - I installed .NET 2.0 SP1, and the problem was solved!</p>
<p>If it doesn't build only on the one machine, then either you've managed to make that machine different, or the VS2005 install is corrupted. If you take the error message at face-value, then the problem is probably the latter. Try running the repair feature of the VS2005 installer, or failing that, reinstall VS2005...
9,517
<p>I'm trying to check, using an automated discovery tool, when JAR files in remote J2EE application servers have changed content. Currently, the system downloads the whole JAR using WMI to checksum it locally, which is slow for large JARs.</p> <p>For UNIXy servers (and Windows servers with Cygwin), I can just log in ...
<p>I'd imagine its one of:</p> <ul> <li><p>Eclipse doesn't want to display non-C++ resources in the tree (I've had problems with this)</p></li> <li><p>You don't have "Preferences > C/C++ > Indexer > Index All Files" enabled.</p></li> <li><p>You want to use the "Full C/C++ Indexer" rather than the "Fast C/C++ Indexer"<...
<p>The CDT parser/indexer won't recognize weird extensions like that. The only thing you can do is to define macros on the Paths and Symbols property page to trick the parser. Try creating macros for <code>$hdr</code>, <code>$end</code> and <code>$src</code> that have empty bodies. That way the preprocessor will remove...
8,295
<p>Context: I have absolutely no knowledge of 3D printing other than you need a computer, a printer, some software, and a design. That is literally the extent of my knowledge on 3D printing.</p> <p>However, I have an idea of something I'd like to have 3D printed. While the idea has a fairly reasonably defined shape in...
<p><s>There is a <a href="https://3dprinting.meta.stackexchange.com/questions/138/what-is-our-scope">new question on Meta</a> that should help define what is okay on this site. </s></p> <p>However, your question is important to address here.</p> <p>Ultimately, you shouldn't be afraid to go ahead and ask the question....
<p>I think your situation fits for many new users on this site, and saying that "easy" or "semi-defined" questions are discouraged would probably turn you - and many others - away from the site.</p> <p>Rather, I believe it is the community's job to help you find a proper scope for your question. As long as you follow ...
27
<p>We have a requirement to increase the functionality of a grid we are using to edit on our webapp, and our manager keeps citing Excel as the perfect example for a data grid :/ He still doesn't really get that a Spreadsheet like control doesn't exist out of the box, but I thought I'd do a bit of searching nonetheless....
<p>Update: with Silverlight fast approaching, maybe you can use a real excel control.</p> <p><a href="http://www.devexpress.com/Products/NET/Controls/ASP/Grid/" rel="nofollow noreferrer">Devexpress</a> has a powerful grid control for both web and windows. It is not free and I guess nothing really matches Excel. But on...
<p>This may not be directly related to your question, but on the server side have you considered what operations you will need to perform that will mimic Excel? You may want to check out <a href="http://www.spreadsheetgear.com/" rel="nofollow noreferrer">SpreadsheetGear</a> which will give you complete macro functiona...
8,265
<p>Can I write a plug in for Microsoft SQL Enterprise Manager which changes the query window background if the query window points to a production database?</p>
<p>No, Enterprise Manager doesn't have a plug-in framework for you to hook in to.</p>
<p>I see this has already been answered but I'm going to add this in case it helps future readers. The Enterprise Manager has been replaced by SQL Management Studio. Management Studio does have support for add-ins. Also, when you register a server in the properties window you can associate a custom color with the co...
8,951
<p>I'm trying to find a way to list the (static) dependency requirements of a jar file, in terms of which symbols are required at run time.</p> <p>I can see that the methods exported by classes can be listed using "javap", but there doesn't seem to be an opposite facility to list the 'imports'. Is it possible to do th...
<p>You could use the <a href="http://depfind.sourceforge.net/Manual.html#ShowingOnlyOutboundDependencies" rel="nofollow noreferrer">Outbound dependencies</a> feature of <a href="http://depfind.sourceforge.net/" rel="nofollow noreferrer">DependencyFinder</a>. You can do that entirely in the GUI, or in command line expor...
<p>There's a tool called <a href="http://www.kirkk.com/main/Main/JarAnalyzer" rel="nofollow noreferrer">JarAnalyzer</a> that will give you the dependencies between the jars in a directory. It'll also give you a list of dependencies that don't exist in the directory.</p>
4,815
<p>After the suggestion to use a library for <a href="https://stackoverflow.com/questions/34486/what-more-is-needed-for-ajax-than-this-function">my ajax needs</a> I am going to use one, the problem is that there are so many and I've no idea how to even begin telling them apart.</p> <p>Thus, can anybody <br /> A) Give ...
<p>To answer B:</p> <p><a href="http://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks" rel="noreferrer"><strong>Comparison of JavaScript frameworks</strong></a></p> <hr> <p><strong>EDIT:</strong> Although everyone and their mom is apparently riding the <a href="http://jquery.com/" rel="noreferrer"><strong...
<p>I've been using <a href="http://www.prototypejs.org/" rel="nofollow noreferrer">Prototype</a> + <a href="http://script.aculo.us/" rel="nofollow noreferrer">Scriptaculous</a>. </p> <p>They have good API documentation and work great for me! The biggest benefits are:</p> <ul> <li>Cleans up messy javascript code</li...
5,550
<p>What is the best method for executing FTP commands from a SQL Server stored procedure? we currently use something like this:</p> <pre><code>EXEC master..xp_cmdshell 'ftp -n -s:d:\ftp\ftpscript.xmt 172.1.1.1' </code></pre> <p>The problem is that the command seems to succeed even if the FTP ended in error. Also, the...
<p>If you're running SQL 2005 you could do this in a CLR integration assembly and use the FTP classes in the System.Net namespace to build a simple FTP client.</p> <p>You'd benefit from being able to trap and handle exceptions and reduce the security risk of having to use xp_cmdshell.</p> <p>Just some thoughts.</p>
<p>If you need to do FTP from within the database, then I would go with a .NET assembly as Kevin suggested. That would provide the most control over the process, plus you would be able to log meaningful error messages to a table for reporting.</p> <p>Another option would be to write a command line app that read the d...
2,627
<p>Has anyone worked much with Microsoft's Managed Extensibility Framework (MEF)? Kinda sounds like it's trying to be all things to all people - It's an add-in manager! It's duck typing! I'm wondering if anyone has an experience with it, positive or negative.</p> <p>We're currently planning on using an generic IoC imp...
<p>We are not aiming for MEF to be an all-purpose IoC. The best way to think about the IoC aspects of MEF is an implementation detail. We use IoC as a pattern because it is a great way to address the problems we are looking to solve. </p> <p>MEF is focused on extensibility. When you think of MEF look at it as an inves...
<p>More detailed discussion on this in this post and the comments</p> <p><a href="http://mikehadlow.blogspot.com/2008/09/managed-extensibility-framework-why.html" rel="nofollow noreferrer">http://mikehadlow.blogspot.com/2008/09/managed-extensibility-framework-why.html</a> </p>
6,369
<p>How can I left-align the numbers in an ordered list?</p> <pre><code>1. an item // skip some items for brevity 9. another item 10. notice the 1 is under the 9, and the item contents also line up </code></pre> <p>Change the character after the number in an ordered list?</p> <pre><code>1) an item </code></pre> <...
<p>This is the solution I have working in Firefox 3, Opera and Google Chrome. The list still displays in IE7 (but without the close bracket and left align numbers):</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...
<p>I have it. Try the following:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style type='text/css'&gt; ol { counter-reset: item; } li { display: block; } li:before { content: counter(item) ")"; counter-increment: item; display: inline-block; width: 50px; } &lt;/style&gt; &lt;/head&gt; &lt;bod...
3,206
<p>How do I use JUnit to test a class that has internal private methods, fields or nested classes?</p> <p>It seems bad to change the access modifier for a method just to be able to run a test.</p>
<p>If you have somewhat of a legacy <strong>Java</strong> application, and you're not allowed to change the visibility of your methods, the best way to test private methods is to use <a href="http://en.wikipedia.org/wiki/Reflection_%28computer_programming%29" rel="noreferrer">reflection</a>.</p> <p>Internally we're usi...
<p>In your class:</p> <pre><code>namespace my_namespace { #ifdef UNIT_TEST class test_class; #endif class my_class { public: #ifdef UNIT_TEST friend class test_class; #endif private: void fun() { cout &lt;&lt; &quot;I am private&qu...
5,487
<p>I'm interested to get a free, WYSIWYG HTML editor that is compatible with Django template. Any ideas?</p> <blockquote> <p>Thanks LainMH.</p> <p>But I afraid fckeditor is used in web app, for the purpose of editing HTML. What I want is an editor that allows me to write HTML that is Django compatible. </p>...
<p><a href="http://www.fckeditor.net/" rel="noreferrer">http://www.fckeditor.net/</a> ?</p> <p>EDIT: Just found this: <a href="http://blog.newt.cz/blog/integration-fckeditor-django/" rel="noreferrer">http://blog.newt.cz/blog/integration-fckeditor-django/</a></p>
<p>According to brief Googling (no personal experience with this), Aptana now supports Python development via Pydev. Pydev again can be configured to work with Django.</p> <p>Thus I would expect Aptana to be usable with Django templates aswell, though I have no complete guide these links should be helpful :</p> <ul> ...
8,639
<p>Is there a way to create a <code>JButton</code> with your own button graphic and not just with an image inside the button? </p> <p>If not, is there another way to create a custom <code>JButton</code> in java?</p>
<p>When I was first learning Java we had to make Yahtzee and I thought it would be cool to create custom Swing components and containers instead of just drawing everything on one <code>JPanel</code>. The benefit of extending <code>Swing</code> components, of course, is to have the ability to add support for keyboard s...
<p>I haven't done SWING development since my early CS classes but if it wasn't built in you could just inherit <code>javax.swing.AbstractButton</code> and create your own. Should be pretty simple to wire something together with their existing framework.</p>
2,436
<p>This is re-posted from something I posted on the DDD Yahoo! group.</p> <p>All things being equal, do you write phone.dial(phoneNumber) or phoneNumber.dialOn(phone)? Keep in mind possible future requirements (account numbers in addition to phone numbers, calculators in addition to phones).</p> <p>The choice tends t...
<p><code>phone.dial()</code>, because it's the phone that does the dialing.</p> <p>Actor.Verb( inputs ) -> outputs.</p>
<p>Not to be the negative one here, but these kinds of questions are very academic. It completely depends on the application. I can think of very good reasons for doing it either way, and I've seen too many good programmers get bogged down in this kind of moot design details.</p>
9,415
<p>Although I've done programming, I'm not a programmer. I've recently agreed to coordinate getting a Website up for a club. The resources are--me, who has done Web content maintenance (putting content into HTML and ColdFusion templates via a gatekeeper to the site itself; doing simple HTML and XML coding); a serious W...
<p>If you don't require any dynamic content, heck, if you don't plan on editing the content more than once a week, I'd say stick to basic HTML.</p> <p>Later, you'd probably want a basic, no-fuss and easily installable CMS. The brand really depends on the platform (most likely PHP/Rails/ASP), but most of them can be fo...
<p>Personally, I'd never use JPEG images on a website, mainly because of three reasons:</p> <ol> <li>JPEGs often contains artifacts.</li> <li>Quality is often proportional with filesize. </li> <li>Does not support alpha transparency.</li> </ol> <p>That said, I'd recommend you to use PNGs for images since it's lossles...
3,796
<p>Is there a way to disallow publishing of debug builds with ClickOnce?</p> <p>I only want to allow release builds through, but right now human error causes a debug build to slip through once in a while. </p> <p>We're publishing the build from within Visual Studio.</p>
<p>I have started to modify the .csproj files to include the following code to throw an error for debug deploys, effectively preventing the deploy from happening:</p> <pre><code>&lt;!-- The following makes sure we don’t try to publish a configuration that defines the DEBUG constant --&gt; &lt;Target Name="BeforePublis...
<p>I have chosen another solution that worked for me:</p> <p>I couldn't change my build process. So I did <em>Tools</em> → <em>Customize...</em> and change the text of the action, adding an alert like "Publish [CONFIGURE TO RELEASE!]", and placing the Publish button next to the Debug/Release configuration option. It's...
6,930
<p>Following my question regarding a <a href="https://stackoverflow.com/questions/42071/net-yaml-library">.NET YAML Library</a>... as there doesn't seem to be great support for YAML in .NET, are there and good open source <em>really simple</em> .NET XML libraries. I just want something where I can pass it a section na...
<p>isn't the system.xml namespace suficient?</p> <p>once i had to use it for the simple scenarios that you described and thought that it was a simple and efficient solutions.</p> <p>take a look at this examples</p> <p><a href="http://msdn.microsoft.com/en-us/library/443c16cf(VS.71).aspx" rel="nofollow noreferrer">Re...
<p>Can you use the 3.5 framework? Linq to XML is fantastic, and simple.</p>
6,350
<p>Is there a way to check to see if an Microsoft Office process (i.e. Word, Excel) has hung when using Office Automation? Additionally, if the process is hung, is there a way to terminate it?</p>
<p>Let me start off saying that I don't recommend doing this in a service on a server, but I'll do my best to answer the questions.</p> <p>Running as a service makes it difficult to clean up. For example with what you have running as a service survive killing a hung word or excel. You may be in a position to have to...
<p>I can answer the latter half; if you have a reference to the application object in your code, you can simply call "Quit" on it:</p> <pre><code>private Microsoft.Office.Interop.Excel.Application _excel; // ... do some stuff ... _excel.Quit(); </code></pre> <p>For checking for a hung process, I'd guess you'd want to...
3,122
<p>I am working on g code for my homebrew 3d printer and i have found the line <code>G1 -2.000 F2400.000</code>. From what i understand there should be an axis before the number and x and y shouldnt have negative. I am using grbl which is for cnc milling but and i have been deleting this line with no problems but i am ...
<blockquote> <p>G1 -2.000 F2400.000</p> </blockquote> <p>Is not valid G-code. As you note, <code>-2.000</code> should be prefixed with an axis (X,Y,Z or E).</p> <p>Marlin would ignore the <code>-2.000</code> bit and simply treat the command as equivalent to</p> <pre><code>G1 F2400.000 </code></pre> <p>which doesn...
<p>G1 indicates a movement and -2.000 the distance, F2400.000 the feed rate mm/min, normally the <strong>(-)</strong> values are for retraction on extrusion <strong>E</strong>, for example:</p> <p>G0 X12 (move to 12mm on the X axis) <br> G0 F1500 (Set the feedrate to 1500mm/minute) <br> G1 X90.6 Y13.8 E22.4 (Move to ...
727
<p>I was recently asked to come up with a script that will allow the end user to upload a PSD (Photoshop) file, and split it up and create images from each of the layers.</p> <p>I would love to stay with PHP for this, but I am open to Python or Perl as well.</p> <p>Any ideas would be greatly appreciated.</p>
<p>Oops, it's</p> <pre><code>$('#mySelect').attr('size', value) </code></pre>
<pre><code>$("#mySelect").bind("click", function(){ $("#myOtherSelect").children().remove(); var myArray = [ "value1", "value2", "value3" ]; for (var i = 0; i &lt; myArray.length; i++) { $("#myOtherSelect").append( '&lt;option value="' + myArray[i] + '"&gt;' + myArray[i] + '&lt;/option&gt;' ); }...
9,100
<p>I have a page upon which a user can choose up to many different paragraphs. When the link is clicked (or button), an email will open up and put all those paragraphs into the body of the email, address it, and fill in the subject. However, the text can be too long for a mailto link.</p> <p>Any way around this?</p>...
<p>By putting the data into a form, I was able to make the body around 1800 characters long before the form stopped working.</p> <p>The code looked like this:</p> <pre><code>&lt;form action="mailto:youremail@domain.com"&gt; &lt;input type="hidden" name="Subject" value="Email subject"&gt; &lt;input type="hidde...
<p>Does the e-mail content need to be in the e-mail? Could you store the large content somewhere centrally (file-share/FTP site) then just send a link to the content?</p> <p>This makes the recipient have an extra step, but you have a consistent e-mail size, so won't run into reliability problems due to unexpectedly l...
2,769
<p>I have a solution consisting of five projects, each of which compile to separate assemblies. Right now I'm code-signing them, but I'm pretty sure I'm doing it wrong. What's the best practice here?</p> <ul> <li>Sign each with a different key; make sure the passwords are different</li> <li>Sign each with a different ...
<p>If your only objective is to stop FxCop from yelling at you, then you have found the best practice.</p> <p>The best practice for signing your assemblies is something that is completely dependent on your objectives and needs. We would need more information like your intended deployment:</p> <ul> <li>For personal u...
<p>Signing is used to uniquely identify an assembly. More details are in <em><a href="http://msdn.microsoft.com/en-us/library/ms247123%28VS.80%29.aspx" rel="nofollow noreferrer">How to: Sign an Assembly (Visual Studio)</a></em>.</p> <p>In terms of best practice, it's fine to use the same key as long as the assemblies ...
5,585
<p>Is it possible to do image processing in silverlight 2.0?</p> <p>What I want to do is take an image, crop it, and then send the new cropped image up to the server. I know I can fake it by clipping the image, but that only effects the rendering of the image. I want to create a new image.</p> <p>After further rese...
<p>Well, you can actually do local image processing in Silverlight 2... But there are no built in classes to help you. But you can load any image into a byte array, and start manipulating it, or implement your own image encoder.</p> <p>Joe Stegman got lots of great information about "editable images" in Silverlight ov...
<p>There is first-class support for bitmap surfaces in Silverlight 3: <a href="http://blogs.msdn.com/kaevans/archive/2009/03/20/some-silverlight-3-goodness-using-writeablebitmap.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/kaevans/archive/2009/03/20/some-silverlight-3-goodness-using-writeablebitmap.aspx</a></p...
5,556
<p>I have a new database table I need to create...<br> It logically contains an <code>ID</code>, a <code>name</code>, and a <code>"value"</code>.<br> That value field could be either numeric or a character string in nature. </p> <p>I don't think I want to just make the field a <code>varchar</code>, because I also wan...
<p>Your issue with mixing data may be how Sql 2005 sorts text data. It's not a 'natural' sort.</p> <p>If you have a varchar field and you do:</p> <pre><code>where value &gt; '20.5' </code></pre> <p>Values like "5" will be in your result (as in a character based sort "5" comes after "20.5")</p> <p>You're going to be...
<p>If you want to store numeric and string values in the same column, I am not sure you can avoid doing a lot of casts and converts when using that column as a query filter. </p>
5,462
<p>I have the <a href="http://us.xyzprinting.com/us_en/Product/da-Vinci-1.0">XYZPrinting da-Vinci-1.0</a> with ABS filament. I am concerned about ventilation. If this is used inside, what safety precautions are necessary, which are recommended, and/or which are optional?</p>
<p>Yes... The issue with <em>all</em> 3d printing materials. Not just ABS, but worse with ABS is the fine air particulate and Ultra fine it creates during the 3d printing process. PLA is considered <em>safer</em> than ABS. But I fear people will use this as justification, it is like saying I only smoke one cig a day in...
<p>your fine at practical temperatures. source: <a href="https://en.wikipedia.org/wiki/Acrylonitrile_butadiene_styrene#Hazard_for_humans" rel="nofollow">https://en.wikipedia.org/wiki/Acrylonitrile_butadiene_styrene#Hazard_for_humans</a></p> <p>recommended would probably be set your controller to not go above 380c if y...
328
<p>I've got a custom handler applied to a class (using the Policy Injection Application Block in entlib 4) and I would like to know whether the input method is a property when Invoke is called. Following is what my handler looks like.</p> <pre><code>[ConfigurationElementType(typeof(MyCustomHandlerData))] public class...
<p>You can also check IsSpecialName is true. this will be true in a property (amongst other things)</p> <p>At the il level the methods are exposed as follows (using Environment.ExitCode as example):</p> <pre><code>.method public hidebysig specialname static int32 get_ExitCode() cil managed .method public hidebysig sp...
<p>You could check the IsSpecialName property; it will be true for property getters and setters. However, it will also be true for other special methods, like operator overloads.</p>
9,911
<p>My background is primarily as a Java Developer, but lately I have been doing some work in .NET. So I have been trying to do some simple projects at home to get better at working with .NET. I have been able to transfer much of my Java experience into working with .NET (specifically C#), but the only thing that has re...
<p>I can't claim that it's a best practice, but I often see files organized in a directory hierarchy that mirrors the namespace. If it fits your mental model of the code better, then do so - I can't think of any harm. Just because the .NET model doesn't enforce relationships between namespaces, projects, and directory ...
<p>I've always considered source file organization and assigning identifiers to classes and objects to be two separate problems. I tend to keep related classes in groups, but not every group should be a namespace. Namespaces exist (more or less) to solve the problem of name conflicts—in flat-namespace languages like C,...
7,950
<p>I'm working on building a development tool that is written in JavaScript.</p> <p>This will not be an open source project and will be sold (hopefully) as a commercial product.</p> <p>I'm looking for the best way to protect my investment. Is using an obfuscator (code mangler) enough to reasonably secure the code?</p...
<p>I'm going to tell you a secret. Once you understand it, you'll feel a lot better about the fact that Javascript obfuscation is only really useful for saving bandwidth when sending scripts over the wire.</p> <p>Your source-code is not worth stealing.</p> <p>I know this comes as a shock to the ego, but I can say thi...
<p>That's probably about the best you can do. Just be aware that anybody with enough dedication, can probably de-obfuscate your program. Just make sure you're comfortable with that before embarking on your project. I think the biggest problem with this would be to control who's using it on their site. If somebod...
4,904
<p>How does Google manage to properly align the second column <em>(i.e. the ticker name)</em> in the "Get Quotes" search box suggestion drop-down in <a href="http://finance.google.com" rel="nofollow noreferrer">google finance url</a></p> <p><strong>Example:</strong> If you enter <code>iii</code> - the second column is...
<p>most likely just using margins. float the first column left then set the margin to the width of the first column.</p>
<p>I just viewed source with a DOM inspector and it appears that they are <code>span</code>s for each cell with a margin set (as Darren said) to position the right column over.</p>
7,361
<p>I'm setting up my printer in a small room, and I thought I'd come up with a system for more easily swapping filaments, but I'm not yet sure it is feasible.</p> <p>Rather than physically replace the spool, I'd like to hang most of my spools on the wall, where they can rotate, and only swap filament leads in the (dir...
<p>I would say it's not the best approach. </p> <p>In the situation you've described I would rather install some kind of vertical ring a bit above your printer. This ring would organize your filament going from any direction. </p> <p>So let's assume you got one spool on the right and one on the left of your printer, ...
<p>Your idea is actually good, but i would add some edits to it. First of all, to keep your equipment clean, you would like to add little foam rubbers to clean the filament at the entrance of the tubes, to clean out the dust that will be accumulating over the rolls.</p> <p>Another thing that i would recommend is to ha...
314
<p>It's one of those things that seems to have an odd curve where the more I think about it, the more it makes sense. To a certain extent, of course. And then it doesn't make sense to me at all.</p> <p>Care to enlighten me?</p>
<p>Because in most cases you've got to sort your results first. For example, when you search on Google, <a href="http://www.google.com.au/search?hl=en&amp;safe=off&amp;q=google&amp;start=1000&amp;sa=N" rel="noreferrer">you can view only up to 100 pages of results</a>. They don't bother sorting by page-rank beyond 1000 ...
<p>Of course sorting on a random query takes some time, but if you're having problems with the same paginated query being used regulary, there's either something wrong with the database setup (improperly indexing/none at all, too little memory etc. I'm not a db-manager) or you're doing pagination seriously wrong: </p> ...
4,925
<p>I knew of some performance reasons back in the SQL 7 days, but do the same issues still exist in SQL Server 2005? If I have a resultset in a stored procedure that I want to act upon individually, are cursors still a bad choice? If so, why?</p>
<p>Because cursors take up memory and create locks.</p> <p>What you are really doing is attempting to force set-based technology into non-set based functionality. And, in all fairness, I should point out that cursors <em>do</em> have a use, but they are frowned upon because many folks who are not used to using set-bas...
<p>The basic issue, I think, is that databases are designed and tuned for set-based operations -- selects, updates, and deletes of large amounts of data in a single quick step based on relations in the data.</p> <p>In-memory software, on the other hand, is designed for individual operations, so looping over a set of d...
8,255
<p>Most sites are either fully released, or in beta.</p> <p>But what happens if you have a large site, and some of the parts are still in Beta, and other parts aren't. </p> <p>How do you effectively communicate this to the customer?</p>
<p>Maybe take a look at how Facebook, Bloglines, Gmail did it?</p> <p>Like "We have this beta thing going on, come on over and see the same site with new stuff, but if it doesnt work, use the old parts"</p> <p>Maybe gmail labs where you can sign up for "beta features"</p>
<p>If there's a certain way you enter the part of the beta site, maybe you can have a modal that pops up that they have to agree to every time. I wouldn't have it on every page since it gets annoying, so I would only use this approach if there is a definitive way to get into that part of the site (e.g. people won't be...
7,459
<p>Wikipedia says SQL Server Express Edition is limited to "one processor, 1 GB memory and 4 GB database files". Does anyone have practical experience with how well this scales?</p>
<p>It's a regular sql server, it just has a limit. SharePoint by default uses the sql server express if that gives you any idea. We have our entire office (80+) people running on that instance.</p>
<p>It really comes down to the nature of your database and application. What kind of application(s) are hitting SQL Server? In my experience, it only handles 5-10 users with a heavy read/write application.</p>
5,610
<p>Using core jQuery, how do you remove all the options of a select box, then add one option and select it?</p> <p>My select box is the following.</p> <pre><code>&lt;Select id="mySelect" size="9"&gt; &lt;/Select&gt; </code></pre> <p>EDIT: The following code was helpful with chaining. However, (in Internet&nbsp;Explo...
<pre><code>$('#mySelect') .find('option') .remove() .end() .append('&lt;option value="whatever"&gt;text&lt;/option&gt;') .val('whatever') ; </code></pre>
<p>Try</p> <pre><code>mySelect.innerHTML = `&lt;option selected value=&quot;whatever&quot;&gt;text&lt;/option&gt;` </code></pre> <p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false"> <div class="snippet-code snippet-currently-hidden"> <pre class="snippet-code-js lang-js pret...
7,008
<p>I want to create a simple http proxy server that does some very basic processing on the http headers (i.e. if header x == y, do z). The server may need to support hundreds of users. I can write the server in C# (pretty easy) or c++ (much harder). However, would a C# version have as good of performance as a C++ ve...
<p>You can use <strong>unsafe</strong> C# code and <strong>pointers</strong> in critical bottleneck points to make it run faster. Those behave much like C++ code and I believe it executes <em>as fast</em>.</p> <p>But most of the time, C# is JIT-ted to uber-fast already, I don't believe there will be much differences a...
<p>The proxy server you describe would deal mostly with string data and I think its reasonable to implement in C#. In your example,</p> <pre><code>if header x == y, do z </code></pre> <p>the slowest part might actually be doing whatever 'z' is and you'll have to do that work regardless of the language.</p>
5,059
<p>Using WPF, I have a TreeView control that I want to set its ItemTemplate dynamically through procedural code. How do I do this? I assume I need to find the resource somewhere.</p> <pre><code>myTreeViewControl.ItemTemplate = ?? </code></pre>
<p>If the template is defined in your &lt;Window.Resources&gt; section directly:</p> <pre><code>myTreeViewControl.ItemTemplate = this.Resources["SomeTemplate"] as DataTemplate; </code></pre> <p>If it's somewhere deep within your window, like in a &lt;Grid.Resources&gt; section or something, I think this'll work:</p> ...
<p>if your treeview control requires different templates for your items, you should implement DataTemplateSelector class and set it's instance to your tree view. as far as i remember there is a property of DataTemplateSelector.</p>
5,116
<p>Let's say I've got Alpha things that may or may not <em>be</em> or be <em>related to</em> Bravo or Charlie things.</p> <p>These are one-to-one relationships: No Alpha will relate to more than one Bravo. And no Bravo will relate to more than one Alpha.</p> <p>I've got a few goals:</p> <ul> <li>a system that's eas...
<p>If you want each Alpha to be related to by only one Bravo I would vote for the possibility with using a combined FK/PK:</p> <pre><code> Bravos -------- FK PK AlphaId BravoOne BravoTwo BravoThree </code></pre> <p>This way one and only one Bravo may refer to your Alphas.</p> <p>If the B...
<p>I'd go with option 1 unless I had a significant reason not to. It might not cost you as much space as you think, esp. if you are using varchars in Bravo. Don't forget that splitting it will cost you for foreign keys, secondary identity and needed indexes. <p>A place where you might run into trouble is if Bravo is un...
8,135
<p>I have <code>ci</code>, so our staging environment builds itself.<br> Should I have a script that not only builds production but does all the branching for it as well?<br> When you have one code base on two different urls with skinning, should they be required to build at once?</p>
<p>The only way to be too automated is if you are spending more time fighting with building or fixing automation scripts than you would just doing the job manually. As long as your automation scripts take less time and produce fewer errors than doing the job manually, then automation is great.</p> <p>Scripts to build...
<p>In my opinion it's only too automated if no one in your production support group can deploy an application manually in a pinch. Automated deployments really cut down on simple but common errors such as configuration mistakes. However, a manual deployment must always be an option. </p>
4,906
<p>I wonder if someone knows if there is a pre-made solution for this: I have a List on an ASP.net Website, and I want that the User is able to re-sort the list through Drag and Drop. Additionally, I would love to have a second list to which the user can drag items from the first list onto.</p> <p>So far, I found two ...
<p>The Mootools sortables plugin does just that, and best of all, it's free ;)</p> <p><a href="http://demos.mootools.net/Sortables" rel="nofollow noreferrer">http://demos.mootools.net/Sortables</a></p>
<p>I've evaluated the <a href="http://www.telerik.com/" rel="nofollow noreferrer">Telerik</a> grid as well as <a href="http://www.infragistics.com/Default.aspx" rel="nofollow noreferrer">Infragistics</a> version. In the end we took an approach similar to what tags2k suggested. We just wrote our own javascript and cal...
3,453
<p>Is there a way to make S3 default to an index.html page? E.g.: My bucket object listing:</p> <pre><code>/index.html /favicon.ico /images/logo.gif </code></pre> <p>A call to <strong>www.example.com/<em>index.html</em></strong> works great! But if one were to call <strong>www.example.com/</strong> we'd either get ...
<p>Amazon S3 now supports <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/IndexDocumentSupport.html" rel="noreferrer">Index Documents</a></p> <p>The <em>index document</em> for a bucket can be set to something like <code>index.html</code>. When accessing the root of the site or a sub-directory containin...
<p>you can do it using dns webforwards and cloaking. just forward to the complete path of the index.html</p> <p>www.example.com forwards to <a href="http://www.example.com.s3.amazonaws.com" rel="nofollow noreferrer">http://www.example.com.s3.amazonaws.com</a> and make sure you cloak the output.</p>
4,756
<p>I want my controller to return the right HTTP response code when the user lacks permission to view a particular page.</p>
<p>Create an Exception annotated with <a href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/bind/annotation/ResponseStatus.html">@ResponseStatus</a> e.g. like this:</p> <pre class="lang-java prettyprint-override"><code>@ResponseStatus(HttpStatus.FORBIDDEN) public class ForbiddenExcepti...
<p>Use this: <code>response.setStatus(403)</code>.</p>
6,747
<p>There seem to be two rival Eclipse plugins for integrating with Maven: <a href="http://m2eclipse.codehaus.org/" rel="nofollow noreferrer">m2Eclipse</a> and <a href="http://code.google.com/p/q4e/" rel="nofollow noreferrer">q4e</a>. </p> <p>Has anyone recently evaluated or used these plugins?<br> Why would I choose ...
<p><a href="http://docs.codehaus.org/display/MAVENUSER/Eclipse+Integration" rel="nofollow noreferrer">Side by side comparison table of three maven plugins.</a> </p>
<p>I have been using m2Eclipse for quiet some time now and have found it to be very reliable. I wasn't aware of q4e until I saw this question so I can't recommend one over the other.</p>
6,979
<p>I am having problems with my tevo tarantula large bed 12Volt power supply, I am getting the thermal protection message when heating my bed with target temperature set to 115 degrees. The process slows down after reaching 90. I changed merlin settings to trigger thermal shutdown after 5minutes/2degrees and added a co...
<p>You need to increase the power of the heated bed. With a given amount of power, there is an upper limit to the maximum temperature you can reach because at a given point losses due to conduction, convection and radiation will balance out the heating power and the temperature will not increase any more.</p> <p>Somet...
<p>Some simple steps that may help to reach higher temperature:</p> <ol> <li>Check if you can use heated bed insulation of any kind - the most common approach is to use cork sheet</li> <li>Protect heated bed and printer from any possible air movements - arrange a set of walls around printer or just simply put it in th...
834
<p>Recently got a Creator 3 (v2) and single-colour prints are great, but dual colour Benchies are coming out quite bad. Initially, I thought it was X/Y calibration as when I printed a dual-colour cube, I could feel a slight bump as I ran my fingernail across the joins. I tweaked that and the cube now seems good (pics a...
<p>You have a problem with retraction or more broadly with what happens to the material in the inactive extruder while it's waiting to be used again. I'm not sure what your printer does, but there are various strategies for how to handle this, which can possibly be mixed:</p> <ul> <li>doing nothing and letting it make ...
<p>I've tracked down the cause of this, although I don't yet know a solution. It only occurs with dual-colour prints and I noticed the stringing is coming from when the nozzle moves <em>away</em> from the print, not from the new nozzle coming towards it.</p> <p>After watching some prints, I realised what it is. After f...
2,010
<p>Having started with an Ender 3, it just seemed natural to me that the heatbreak should not be load-bearing; Creality's stock hotend has 2 bolts holding the heat block to the heat sink, which of course waste some heating power and increase the cooling needed to avoid heat creep, but serve the important purpose of kee...
<p>The drop-in replacement all metal hotends for the Ender 3 that I've looked at seem to have the two screws -- though I've read/heard opinions that these are intended to be removed after assembly, these are common Mk. 8 type hot ends, but with 2 mm bore through the entire heat break instead of 4 mm. That seems to be ...
<p>You ask in general, not specifically for Ender, so since you mention the Mosquito, which has a characteristic shape and a size, the obvious alternative which doesn't cost that much is the Phaetus Dragon.</p> <p>It copies the idea of the Mosquito, but it is repackaged in a shape and size fully equivalent to standard ...
1,973
<p>I'm just in the process of parsing some text and can't remember what the escape character is for a tab in C#?</p>
<p>Easy one! "\t"</p> <p>Edit: In fact, here's something official: <a href="http://msdn.microsoft.com/en-us/library/h21280bw.aspx" rel="noreferrer">Escape Sequences</a></p>
<p>For someone who needs quick reference of <strong>C# Escape Sequences</strong> that can be used in <code>string</code> literals:</p> <blockquote> <p>\t &nbsp; &nbsp; Horizontal tab (ASCII code value: 9)</p> <p>\n &nbsp; &nbsp; Line feed (ASCII code value: 10)</p> <p>\r &nbsp; &nbsp; Carriage return (ASCI...
2,762
<p>It will be important for developers wanting to develop for the chrome browser to be able to review existing bugs (to avoid too much pulling-out of hair), and to add new ones (to improve the thing). Yet I can't seem to find the bug tracking for this project. It <em>is</em> open source, right?</p>
<p>Google is calling it <a href="http://code.google.com/chromium/" rel="noreferrer">Chromium</a> on Google Code</p> <p>The <a href="http://dev.chromium.org/for-testers/bug-reporting-guidelines" rel="noreferrer">Chromium Bug Reporting Page</a> is there and has the link to submit bugs listed. (Google Account Required)</...
<p>From the <a href="http://www.google.com/support/chrome/bin/answer.py?answer=95760&amp;query=bug&amp;topic=&amp;type=" rel="nofollow noreferrer">Google Site</a></p> <ol> <li>Click the Page menu page menu.</li> <li>Select Report a bug or broken website.</li> <li>Choose an issue type from the drop-down menu. The web a...
6,194
<p>one of the most frequent requests I get is to create XY report for YZ App. These apps are normally built on PHP, so far I have manually created most of this reports, and while I enjoy the freedom of building it as I want, it usually becomes pretty tedious to calculate subtotals, averages, exporting to different form...
<p>The problem you're facing is solved by so-called Business Intelligence software. This software tends to be bloated and expensive, but if you know your way around them you will be able to crank out such reports in no time at all. </p> <p>I'm only familiar with one particular proprietary solution, which isn't too g...
<p>It depends on what kind of reports you're talking about. For example... site stats... you could install google analytics and the client could export whatever format they wanted.</p>
9,162
<p>In my web application I include all of my JavaScripts as js files that are embedded resources in the assembly, and add them to the page using <code>ClientScriptManager.GetWebResourceUrl()</code>. However, in some of my js files, I have references to other static assets like image urls. I would like to make those ass...
<p>I'd suggest that you emit the web resources as a dynamic javascript associative array.</p> <p>Server side code:</p> <pre><code>StringBuilder script = new StringBuilder(); script.Append("var imgResources = {};"); script.AppendFormat("imgResources['{0}'] = '{1}';", "drophint", Page.ClientScript.GetWebResou...
<p>I don't particularly care for the exact implementation <a href="https://stackoverflow.com/questions/46489/referencing-embedded-resources-from-other-resources-in-c#47242"><strong>@Jon</strong></a> suggests, but the idea behind it is sound and I would concur that emitting these would be a good thing to do. </p> <p>A ...
6,862
<p>I know there are a lot of positive things mod-rewrite accomplishes. But are there any negative? Obviously if you have poorly written rules your going to have problems. But what if you have a high volume site and your constantly using mod-rewrite, is it going to have a significant impact on performance? I did a quic...
<p>I've used mod_rewrite on sites that get millions/hits/month without any significant performance issues. You do have to know which rewrites get applied first depending on your rules.</p> <p>Using mod_rewrite is most likely faster than parsing the URL with your current language. </p> <p>If you are really worried abo...
<p>If you're worried about apache's performance, one thing to consider if you have a lot of rewrite rules is to use the "skip" flag. It is a way to skip matching on rules. So, whatever overhead would have been spent on matching is saved.</p> <p>Be careful though, I was on a project which utilized the "skip" flag a lot...
4,612
<p>Ender 3 Pro, PLA, temps 200 °C and 60 °C.</p> <p>I want to not heat the nozzle until after Auto Bed Leveling (CR Touch) is complete. I can do that in the start G-code, but by then, Cura has already heated the nozzle to the temp specified under material and filament starts oozing out during bed leveling. I'd rather...
<p>I've sorted this out. <em>IF</em> I include my own heating commands in my start G-Code, Cura knows to NOT add its own heating commands at the start of the G-Code file.</p> <p>The variables I was referring to have dedicated names. <code>material_print_temperature_layer_0</code> is the printing (extruder/nozzle) temp...
<p>Go to the <code>Settings</code> -&gt; <code>Printers</code> menu from the top menu,</p> <p><a href="https://i.stack.imgur.com/jmivX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jmivX.png" alt="enter image description here" /></a></p> <p>select your active printer (or <code>Activate</code> it) a...
2,152
<p>How can you make the display frames per second be independent from the game logic? That is so the game logic runs the same speed no matter how fast the video card can render. </p>
<p>I think the question reveals a bit of misunderstanding of how game engines should be designed. Which is perfectly ok, because they are damn complex things that are difficult to get right ;)</p> <p>You are under the correct impression that you want what is called Frame Rate Independence. But this does not only refer...
<p>From my experience (not much) Jesse and Adam's answers should put you on the right track.</p> <p>If you are after further information and insight into how this works, i found that the sample applications for <a href="http://www.truevision3d.com/" rel="nofollow noreferrer">TrueVision 3D</a> were very useful.</p>
3,807
<p>One of the things that get me thoroughly confused is the use of <code>session.Flush</code>,in conjunction with <code>session.Commit</code>, and <code>session.Close</code>.</p> <p>Sometimes <code>session.Close</code> works, e.g., it commits all the changes that I need. I know I need to use commit when I have a trans...
<p>Briefly:</p> <ol> <li>Always use transactions</li> <li>Don't use <code>Close()</code>, instead wrap your calls on an <code>ISession</code> inside a <code>using</code> statement or <strong>manage the lifecycle of your ISession somewhere else</strong>.</li> </ol> <p>From <a href="http://nhibernate.info/doc/nh/en/index...
<p>Here are two examples of my code where it would fail without session.Flush():</p> <p><a href="http://www.lucidcoding.blogspot.co.uk/2012/05/changing-type-of-entity-persistence.html" rel="nofollow noreferrer">http://www.lucidcoding.blogspot.co.uk/2012/05/changing-type-of-entity-persistence.html</a></p> <p>at the en...
6,492
<p>So we're trying to set up replicated repositories using PlasticSCM, one in the US, and one in Australia and running into a bit of a snag.</p> <p>The US configuration is Active Directory, the AU configuration is User/Password. This in itself is not a big deal, I've already set up the SID translation table. </p> <...
<p>Ok, I've solved my own problem.<br> To get that "authdata" string, you need to configure your client to how you need to authenticate.<br> Then navigate to c:[users directory][username]\Local Settings\Application Data\plastic.<br> Pick up the client.conf and extract the string from the SecurityConfig element in t...
<p>Check the new GUI <a href="http://www.plasticscm.com/demos/distributed_intro/distributed_intro.html" rel="nofollow noreferrer">here</a>. It's a little bit easier.</p>
5,090
<p>In a C# Windows Forms application I want to detect if another instance of the application is already running. If so, activate the main form of the running instance and exit this instance.</p> <p>What is the best way to achieve this?</p>
<p>Scott Hanselman <a href="http://www.hanselman.com/blog/TheWeeklySourceCode31SingleInstanceWinFormsAndMicrosoftVisualBasicdll.aspx" rel="noreferrer">answers</a> on you question in details.</p>
<p>Aku, that is a good resource. I answered a question similar to this one a while back. You can check my <a href="https://stackoverflow.com/questions/19147/what-is-the-correct-way-to-create-a-single-instance-application#19326">answer here</a>. Even though this was for WPF, you can use the same logic in WinForms.</p...
7,512
<pre><code>&gt;&gt;&gt; import time &gt;&gt;&gt; time.strptime("01-31-2009", "%m-%d-%Y") (2009, 1, 31, 0, 0, 0, 5, 31, -1) &gt;&gt;&gt; time.mktime((2009, 1, 31, 0, 0, 0, 5, 31, -1)) 1233378000.0 &gt;&gt;&gt; 60*60*24 # seconds in a day 86400 &gt;&gt;&gt; 1233378000.0 / 86400 14275.208333333334 </code></pre> <p><code>...
<p>Short answer: Because of timezones.</p> <p>The Epoch is in UTC.</p> <p>For example, I'm on IST (Irish Standard Time) or UTC+1. <a href="https://docs.python.org/3/library/time.html#time.gmtime" rel="nofollow noreferrer"><code>time.mktime()</code></a> is relative to my timezone, so on my system this refers to</p> <...
<p>Interesting. I don't know, but I did try this:</p> <pre><code>&gt;&gt;&gt; now = time.mktime((2008, 8, 22, 11 ,17, -1, -1, -1, -1)) &gt;&gt;&gt; tomorrow = time.mktime((2008, 8, 23, 11 ,17, -1, -1, -1, -1)) &gt;&gt;&gt; tomorrow - now 86400.0 </code></pre> <p>which is what you expected. My guess? Maybe some time c...
4,197
<p>Is there an official convention for naming private fields in VB.NET? For example, if I have a property called 'Foo', I normally call the private field '_Foo'. This seems to be frowned upon in the <a href="http://msdn.microsoft.com/en-us/library/ms229012.aspx" rel="noreferrer">Offical Guidelines</a>:</p> <p>"Do no...
<p>I still use the _ prefix in VB for private fields, so I'll have _foo as the private field and Foo as the property. I do this for c# as well and pretty much any code I write. Generally I wouldn't get too caught up in "what is the right way to do it" because there isn't really a "right" way (altho there are some very ...
<p>I agree with @lomaxx, it's more important to be consistent throughout the team than to have the <em>right</em> convention.</p> <p>Still, here are several good places to get ideas and guidance for coding conventions:</p> <ol> <li><a href="http://www.dotnet2themax.com/PracticalGuidelines.aspx" rel="nofollow noreferr...
2,919
<p>Most of the guides I can find are just canned responses to specific questions. Instead I'm looking for something meant to teach good fundamental understanding and core needed skills. Beginner's guides are common in other hobbies but I am having trouble finding one for 3d printing.</p>
<p>Here's a brief outline I threw out in chat once. I'm marking this as a &quot;community Wiki&quot; answer so feel free to edit.</p> <p>It is not a full Primer, so should date better than a Word6.0 manual.</p> <hr /> <p>Start by reading the instructions that came with your printer. There's a high chance that some as...
<p>Thera are plenty of such guides. But from necessity they deal with specifics, there are too many things to cover otherwise.</p> <p>Multiple types of printers, multiple brands, multiple slicers, multiple ways of modelling etc,. With more all the time. Reading up on something that tells me how to model and slice in Fr...
2,143
<p>I know this will be a really obvious question to some people, but I have bricked about 3 boards doing this so I want to be certain before I brick a fourth. I don't have a lot of experience working with AC voltage, especially crimping / hacking it like what's going on here. Trust me it was my last resort to ask this....
<p>In effect, the ground (from mains) does not need to be connected to the relay, the relay interrupts the "hot" or "neutral" (preferably the "hot", but that is not possible for all plugs, e.g. some European plugs can be inserted 180&deg; turned into the sockets). You connect one of the interrupted wires to the <code>C...
<p>Let's look at the notes on the relay first, as these tell us what to connect the terminals to.</p> <h2>Powered side</h2> <ul> <li><code>NO</code>/<code>NC</code> - Normally Open/Normally Closed lead. Which you use determines the switching behavior: open line on signal (NC) or closed line on signal (NO). Connect th...
1,500
<p>I've just done my <a href="https://www.thingiverse.com/thing:3709044" rel="nofollow noreferrer">first print</a> on an Ultimaker 3 Extended and I'm slightly disappointed with the results, so I'm trying to understand how I can do better next time.</p> <h2>My first print</h2> <p>Preparing for printing I naively just ...
<p>Owning the Ultimaker 3 Extended and having printed kilometers of filament on this printer I can tell you that printing with PVA, apart from the slicing problems you mention, is not easy as it looks. PVA clogs up very fast and is very hygroscopic. Moist PVA will make popping sounds on extrusion and is prone to failin...
<blockquote> <p>What is the reason for the external scaffolding...?</p> </blockquote> <p>Reading through the <a href="https://ultimaker.com/en/resources/52663-support" rel="nofollow noreferrer">Ultimaker support page</a>, I discovered that there is a <em>Support horizontal expansion</em> option in the <em>Support</e...
1,465