instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>I've had a little search and I was wondering if there is back compatibility for the .NET framework.</p> <p>The real question is, if there's a program that uses .NET Framework 1.1, can I install 3.5 and be done, or do I have to install 1.1 and then if something uses 3.5 I have to install 3.5 as well?</p>
<p>Unfortunately you will have to install both versions. Older version of the framework are not automatically bundled with newer versions.</p>
<p>If you install something that requires 3.5, then you will have to install it. The way that .Net works though, you can have 1.1, 2.x and 3.5 all installed at the same time. Programs specify the version of the framework they need, and that version is loaded for them.</p>
9,744
<p>Below I present three options for simplifying my database access when only a single connection is involved (this is often the case for the web apps I work on).</p> <p>The general idea is to make the DB connection transparent, such that it connects the first time my script executes a query, and then it remains conne...
<p>Doh! Someone else here at work figured this out. It was really simple and I should have been able to sort it, but hey, that's how it goes sometimes.</p> <p>Here the fix:<br> On the web server, copy the 'aspnet_client' folder from 'C:\Inetpub\wwwroot' to 'C:\Inetpub\wwwroot\your-website-name'. </p> <p>That's all ...
<p>I took over maintaining some code produced by another developer who had left and suffered this issue too. In my case the compiled report was looking for the images in the crystalreportview115 folder which existed in my local development path and therefore worked locally. The only folder on on the target server was t...
7,675
<p>Sometimes a labeled break or continue can make code a lot more readable. </p> <pre><code>OUTERLOOP: for ( ;/*stuff*/; ) { //...lots of code if ( isEnough() ) break OUTERLOOP; //...more code } </code></pre> <p>I was wondering what the common convention for the labels was. All caps? first cap? </p>
<p>If you have to use them use capitals, this draws attention to them and singles them out from being mistakenly interpreted as "Class" names. Drawing attention to them has the additional benefit of catching someone's eye that will come along and refactor your code and remove them. ;)</p>
<p>The convetion/best practise would still be not to use them at all and to refactor the code so that is more readable using extract as method.</p>
3,629
<p>What is the best way to sanitize user input for a Python-based web application? Is there a single function to remove HTML characters and any other necessary characters combinations to prevent an <a href="http://en.wikipedia.org/wiki/Cross-site_scripting" rel="noreferrer">XSS</a> or SQL injection attack?</p>
<p>Here is a snippet that will remove all tags not on the white list, and all tag attributes not on the attribues whitelist (so you can't use <code>onclick</code>).</p> <p>It is a modified version of <a href="http://www.djangosnippets.org/snippets/205/" rel="noreferrer">http://www.djangosnippets.org/snippets/205/</a>,...
<p>If you are using a framework like <a href="http://www.djangoproject.com/" rel="nofollow noreferrer">django</a>, the framework can easily do this for you using standard filters. In fact, I'm pretty sure django automatically does it unless you tell it not to.</p> <p>Otherwise, I would recommend using some sort of re...
3,756
<p>In a machine with AIX without <code>PERL</code> I need to filter records that will be considered duplicated if they have the same id and if they were registered between a period of four hours. </p> <p>I implemented this filter using <code>AWK</code> and work pretty well but I need a solution much faster: </p> <pre...
<p>This sounds like a job for an actual database. Even something like SQLite could probably help you reasonably well here. The big problem I see is your definition of "within 4 hours". That's a sliding window problem, which means you can't simply quantize all the data to 4 hour segments... you have to compute all "ne...
<p>If your data file contains all your records (i.e. it includes records that do not have dupicate ids within the file) you could pre-process it and produce a file that only contains records that have duplicate (ids).</p> <p>If this is the case that would reduce the size of file you need to process with your AWK progr...
2,821
<p>What are in your opinion the best resources (books or web pages) describing algorithms or techniques to use for collision detection in a 2D environment?</p> <p>I'm just eager to learn different techniques to make more sophisticated and efficient games. ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>
<p>Collision detection is often a two phase process. Some sort of "broad phase" algorithm for determinining if two objects even have a chance of overlapping (to try to avoid n^2 compares) followed by a "narrow phase" collision detection algorithm, which is based on the geometry requirements of your application.</p> <...
<p>If your objects are represented as points in 2D space you can use line intersection to determine if two objects have collided. You can use similar logic to check if an object is inside another object (and thus they have collided even any of their lines are not currently intersecting). The <a href="http://paulbourke....
5,106
<p>I got a little curious after reading <a href="http://it.slashdot.org/it/08/09/09/1558218.shtml" rel="noreferrer">this /. article</a> over hijacking HTTPS cookies. I tracked it down a bit, and a good resource I stumbled across lists a few ways to secure cookies <a href="http://casabasecurity.com/content/using-aspnet-...
<p>Typically I have always done this using a 3rd party aggregator. The messages are compiled into SMIL, which is the description language for the MMS messages. These are then sent on to the aggregator who will then send them through the MMS gateway of the Network Operator. They are typically charged on a per message...
<p>You could use Twilio to accomplish this. You can <a href="https://www.twilio.com/docs/quickstart/csharp/sms/sending-via-rest" rel="nofollow">dive into the docs</a> for specific implementation details but using the <a href="https://www.twilio.com/docs/csharp/install" rel="nofollow">C# helper library</a> the code to s...
7,770
<p>What is the best way to calculate Age using Flex?</p>
<p>I found an answer at <a href="http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&amp;file=08_Dates_and_times_164_2.html" rel="nofollow noreferrer">the bottom of this page in comments section (which is now offline)</a>. </p> <blockquote> <p><strong>jpwrunyan s...
<p>You could also do it roughly the same as discussed <a href="https://stackoverflow.com/questions/9/how-do-i-calculate-someones-age-in-c" title="Jeff Atwodd&#39;s Question about calculating age in C#">here</a>: (translated to AS3)</p> <pre><code>var age:int = (new Date()).fullYear - bDay.fullYear; if ((new Date()) &l...
6,314
<p>I run a high school 3D printer lab and we have several 5th generation MakerBot printers. On one of them I have considerable trouble with "thin" prints and filament slip warnings.</p> <p>So far I've tried changing extruders and using different filament rolls with no luck. But, if I move the job and the extruder to a...
<p>Oh interesting. By slips, I take it you mean that the raw filament slips, not the print slips.</p> <p>This will happen for a few reasons. First the tooth gear that grabs the plastic is either:</p> <ul> <li>Worn out</li> <li>Out of place</li> <li>Not the correct distance from the guide wheel. </li> </ul> <p>This i...
<p>So I had this issue for months, was about to either give up and call my printer a paper weight, but I figured it out. And it doesn't cost anything.</p> <p>I literally reprinted the same hose adapter 6 times (every time the filament slipped about 20 times and it was unusable). I changed 4 settings and since then I'v...
460
<p>I am trying out the debugger built into <code>Zend studio</code>. It seems great! One thing though, when I start a page using the debugger does anyone know how I can set a request get argument within the page?</p> <p>For example, I don't want to debug runtests.php</p> <p>I want to debug <code>runtests.php?test=1...
<p>Just start the debugger on another page, and then change the browser url to what you wanted. It's not ideal but it should work.</p> <p>I have high hopes for their next release.</p>
<p>I recommend getting the <a href="http://www.zend.com/en/products/studio/downloads" rel="nofollow noreferrer">Zend Studio Toolbar</a>. The extension allows you to control which pages are debugged from within the browser instead of from Zend Studio. The options for debugging let you debug the next page, the next form...
9,473
<p>I need to store contact information for users. I want to present this data on the page as an <a href="http://en.wikipedia.org/wiki/Hcard" rel="nofollow noreferrer">hCard</a> and downloadable as a <a href="http://en.wikipedia.org/wiki/VCard" rel="nofollow noreferrer">vCard</a>. I'd also like to be able to search the ...
<p>Consider two tables for People and their addresses: </p> <pre><code>People (pid, prefix, firstName, lastName, suffix, DOB, ... primaryAddressTag ) AddressBook (pid, tag, address1, address2, city, stateProv, postalCode, ... ) </code></pre> <p>The Primary Key (that uniquely identifies each and every row) of People ...
<p>If you assume each user has one or more addresses, a telephone number, etc., you could have a 'Users' table, an 'Addresses Table' (containing a primary key and then non-unique reference to Users), the same for phone numbers - allowing multiple rows with the same UserID foreign key, which would make querying 'all add...
5,926
<p>I want to be able to make an HTTP call updating some select boxes after a date is selected. I would like to be in control of updating the textbox so I know when there has been a "true" change (in the event the same date was selected). Ideally, I would call a function to pop-up the calendar and be able to evaluate th...
<p>JQuery's <a href="http://docs.jquery.com/UI/Datepicker" rel="noreferrer">datepicker</a> is an extremely flexible tool. With the ability to attach handlers prior to opening or after date selection, <a href="http://marcgrabanski.com/article/jquery-ui-datepicker-themes" rel="noreferrer">themes</a>, range selection and ...
<p>I don't like the MS ASP.NET ajax, but their datepicker is superb. Otherwise, jQuery datepicker.</p>
4,501
<p>How can I call a BizTalk Orchestration dynamically knowing the Orchestration name? </p> <p>The call Orchestration shapes need to know the name and parameters of Orchestrations at design time. I've tried using 'call' XLang keyword but it also required Orchestration name as Design Time like in expression shape, we ca...
<p>The way I've accomplished something similar in the past is by using direct binding ports in the orchestrations and letting the MsgBox do the dirty work for me. Basically, it goes something like this:</p> <ol> <li>Make the callable orchestrations use a direct-bound port attached to your activating receive shape.</li...
<p>Look at ESB Guidance (www.codeplex.com/esb) This package provides the functionality you are looking for</p>
9,787
<p>I'm working on a DCOM application with the server and client on two machines, both of which are running WinXP with Service Pack 2. On both machines, I'm logged in with the same username and password.</p> <p>When the client on one machine calls CoCreateInstanceEx, asking the other machine to start up the server appl...
<p>Right, so if your Authentication level is set to Default. What is the authentication level set to in the Default Settings? Just out of interest. (although the fact that it works to a 2000 box probably makes that redundant)</p> <p>EDIT:</p> <p>Also: I seem to remember doing a lot of rebooting when I used to play/wo...
<p>What is the flavor of your Windows 2000 box, btw? Professional, Server, Adv Server...</p> <p>Also, is there a difference between domain membership between the two (one on a domain, the other not, different domains, etc...?)</p> <p>One more thing - DCOM errors will appear in the System event log at times - especial...
4,120
<p>I want to use the Web Browser control within an mono application, but when I do get the error "libgluezilla not found. To have webbrowser support, you need libgluezilla installed." Installing the Intrepid Deb causes any application that references the web browser control to crash on startup with : 'Thread (nil) may...
<pre><code>apt-cache search libgluezilla libmono-mozilla0.1-cil - Mono Mozilla library </code></pre> <p>From the package description: </p> <pre><code>Description: Mono Mozilla library Mono is a platform for running and developing applications based on the ECMA/ISO Standards. Mono is an open source effort led by Nov...
<p>here's a link to it on the ubuntu site:</p> <p><a href="http://packages.ubuntu.com/intrepid/libgluezilla" rel="nofollow noreferrer">http://packages.ubuntu.com/intrepid/libgluezilla</a></p> <p>there is a download section at the bottom for a deb package</p>
6,387
<p>I have a control that is modelled on a <strong>ComboBox</strong>. I want to render the control so that the control <strong>border</strong> looks like that of a standard <strong>Windows ComboBox</strong>. Specifically, I have followed the MSDN documentation and all the rendering of the control is correct except for r...
<p>I'm not 100% sure if this is what you are looking for but you should check out the <strong>VisualStyleRenderer</strong> in the System.Windows.Forms.VisualStyles-namespace.</p> <ol> <li><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.visualstyles.visualstylerenderer.aspx" rel="noreferrer">Visua...
<p>Are any of the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.controlpaint_members.aspx" rel="nofollow noreferrer">ControlPaint</a> methods useful for this? That's what I usually use for custom-rendered controls.</p>
2,503
<p>I often encounter the following scenario where I need to offer many different types of permissions. I primarily use ASP.NET / VB.NET with SQL Server 2000.</p> <p><strong>Scenario</strong></p> <p>I want to offer a dynamic permission system that can work on different parameters. Let's say that I want to give either a ...
<p>I agree with John Downey.</p> <p>Personally, I sometimes use a flagged enumeration of permissions. This way you can use AND, OR, NOT and XOR bitwise operations on the enumeration's items.</p> <pre><code>&quot;[Flags] public enum Permission { VIEWUSERS = 1, // 2^0 // 0000 0001 EDITUSERS = 2, // 2^1 // 0000 00...
<p>An approach I've used in various applications is to have a generic PermissionToken class which has a changeable Value property. Then you query the requested application, it tells you which PermissionTokens are needed in order to use it.</p> <p>For example, the Shipping application might tell you it needs:</p> <pr...
2,382
<p>I had to delete all the rows from a log table that contained about 5 million rows. My initial try was to issue the following command in query analyzer:</p> <p>delete from client_log</p> <p>which took a very long time.</p>
<p>Check out <a href="https://msdn.microsoft.com/en-us/library/ms177570.aspx" rel="noreferrer">truncate table</a> which is a lot faster.</p>
<pre><code>DELETE * FROM table_name; </code></pre> <p>Premature optimization may be dangerous. Optimizing may mean doing something weird, but if it works you may want to take advantage of it.</p> <pre><code>SELECT DbVendor_SuperFastDeleteAllFunction(tablename, BOZO_BIT) FROM dummy; </code></pre> <p>For speed I thin...
8,960
<p>Is it possible to connect two pieces of 1.75 mm filament end to end, with no change in width? I am asking the question because I am interested in creating a multi-filament feeder to a single extruder, and I am curious about the process of changing filament while the 3-d printer extruder continues uninterrupted. My c...
<p>You'd have to ensure that the joining portion of the two filaments do not "bloom" or increase in diameter, which would happen if unconstrained at the melting and joining time. Alignment is also critical, otherwise you have a varying diameter from one color to the next at the point of join.</p> <p>There's an item on...
<p>I haven't tried this but it is something I have thought about. The simplest way to try this that I could think of was to try cutting the ends flat and then using a soldering iron or just the printers printing nozzle to melt the ends and then quickly press them together, then you could sand the filamelt to try and cl...
316
<p>3D-printing newbie here. I have a Geeetech's Prusa i3 mk2 B.</p> <p>I'm trying to print this: <a href="https://www.thingiverse.com/thing:1358311" rel="noreferrer">https://www.thingiverse.com/thing:1358311</a></p> <p>That's a mold, with 2 external parts and a core. The exterior prints wonderful. But the core is too...
<p>Basically, <strong>you print too hot (and fast) without enough cooling</strong>. The deformed small pin in your image is a perfect example of depositing new layers onto too hot (not cooled down enough) prior layers.</p> <p>You can easily solve this by printing two identical parts spaced apart from each other. This ...
<p>I'm sorry for the long time I took to answer, but the ammount of NEW problems I faced since started this question was so big that wanted to write a list of them before answering my own question. I've finally also desisted from the list, as the problems tends towards infinity. </p> <p>Simple version: printing more t...
1,258
<p>Is there any python module to convert PDF files into text? I tried <a href="http://code.activestate.com/recipes/511465/" rel="noreferrer">one piece of code</a> found in Activestate which uses pypdf but the text generated had no space between and was of no use. </p>
<p>Try <a href="http://www.unixuser.org/~euske/python/pdfminer/index.html" rel="noreferrer">PDFMiner</a>. It can extract text from PDF files as HTML, SGML or "Tagged PDF" format.</p> <p>The Tagged PDF format seems to be the cleanest, and stripping out the XML tags leaves just the bare text.</p> <p>A Python 3 version ...
<p>Found that solution today. Works great for me. Even rendering PDF pages to PNG images. <a href="http://www.swftools.org/gfx_tutorial.html" rel="nofollow">http://www.swftools.org/gfx_tutorial.html</a></p>
4,528
<p>Is there a way to enforce constraint checking in MSSQL only when inserting new rows? I.e. allow the constraints to be violated when removing/updating rows?</p> <p>Update: I mean FK constraint.</p>
<p>You could create an INSERT TRIGGER that checks that the conditions are met. That way all updates will go straight through.</p> <pre><code>CREATE TRIGGER employee_insupd ON employee FOR INSERT AS /* Get the range of level for this job type from the jobs table. */ DECLARE @min_lvl tinyint, @max_lvl tinyint, @em...
<p>I think your best bet is to remove the explicit constraint and add a <a href="http://msdn.microsoft.com/en-us/library/ms180169.aspx" rel="nofollow noreferrer">cursor</a> for inserts, so you can perform your checking there and raise an error if the constraint is violated.</p>
5,988
<p>I uploaded a 3D object for <a href="https://lerdagiovanni.wixsite.com/kauda/stl-files" rel="nofollow noreferrer">this project</a> to Fusion 360 and printed it out straightforward:</p> <p><a href="https://i.stack.imgur.com/BLeFU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BLeFU.png" alt="enter ...
<p>Besides offsetting the <strong>clearances</strong> you want into models, you can and should also calibrate your printer to <strong>compensate for included holes</strong> - because often inner holes are solved to be smaller than actually designed out of necessity.</p> <p>However, the option can <em>also</em> be used ...
<p>This seems like a tolerance press fit problem and similar to what you will find if you try the same using normal machining operations on a lathe or milling machine.</p> <p>I print 3 mm clearance fit holes on my Prusa MK3S, meant to fit on 3.00 mm (measured with a digital caliper) stainless steel shafts. The printed ...
1,890
<p>An MFC application that I'm trying to migrate uses <code>afxext.h</code>, which causes <code>_AFXDLL</code> to get set, which causes this error if I set <code>/MT</code>:</p> <blockquote> <p>Please use the /MD switch for _AFXDLL builds</p> </blockquote> <p>My research to date indicates that it is impossible to b...
<p>No, there are many applications built with VS2005 that have to support Windows XP, 2000, NT, the whole stack. The issue is that (by default) VS2005 wants to use libraries/exports not present on NT.</p> <p>See <a href="http://www.mombu.com/microsoft/windows-programmer-win32/t-vs2005-and-nt4-392831.html" rel="norefer...
<p>The idea is that the exe is needed to link to the static library.</p> <p>Please try this "Configuration Properties", "General", "Use of MFC" to "Use MFC in a Static Library" "Configuration Properties", "General", "Use of ATL" to "Static Link to ATL"</p> <p>"Configuration Properties", "C\C++", "Code Generation", "R...
2,303
<p>I have 16,000 jpg's from a webcan screeb grabber that I let run for a year pointing into the back year. I want to find a way to grab every 4th image so that I can then put them into another directory so I can later turn them into a movie. Is there a simple bash script or other way under linux that I can do this.</p>...
<p>One simple way is: </p> <pre> $ touch a b c d e f g h i j k l m n o p q r s t u v w x y z $ mv $(ls | awk '{nr++; if (nr % 4 == 0) print $0}') destdir </pre>
<p>Just iterate over a list of files:</p> <pre><code>files=( frame-*.jpg ) i=0 while [[ $i -lt ${#files} ]] ; do cur_file=${files[$i]} mungle_frame $cur_file i=$( expr $i + 4 ) done </code></pre>
9,732
<p>My HTML is all marked up, ready to make it rain CSS. The problem is that I have to go back and find out what all my id and class names are so I can get started. What I need is a tool that parses my HTML and spits out a stylesheet with all the possible elements ready to be styled (maybe even with some defaults). D...
<p>I have a poor man's version of this I have used in the past... this requires jquery and firebug...</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $('*[@id]').each(function() { console.log('#' + this.id + ' {}'); }); $('*[@class]').each(fu...
<p>I've made a generator which makes the html and css for you = <a href="https://www.andy-howard.com/css-skeleton-screen-generator/" rel="nofollow noreferrer">https://www.andy-howard.com/css-skeleton-screen-generator/</a></p> <p>Not much else to say really, it utilises the :empty selector in css.</p>
3,761
<p>I've got a collection that implements an interface that extends both IList&lt;T> and List. </p> <pre><code>public Interface IMySpecialCollection : IList&lt;MyObject&gt;, IList { ... } </code></pre> <p>That means I have two versions of the indexer. </p> <p>I wish the generic implementation to be used, so I implem...
<p>You can't do this with </p> <p><code>public interface IMySpecialCollection : IList&lt;MyObject&gt;, IList { ... }</code></p> <p>But you can do what you want with a class, you will need to make the implementations for one of the interfaces explicit. In my example I made IList explicit.</p> <p><code>public class My...
<p>List&lt;T> implies IList, so it's a bad idea to use both in the same class.</p>
8,125
<p>Since generics were introduced, Class is parametrized, so that List.class produces Class&lt;List>. This is clear.</p> <p>What I am not able to figure out is how to get a instance of Class of type which is parametrized itself, i.e. Class&lt;List&lt;String>>. Like in this snippet:</p> <pre><code>public class GenTest...
<p>The Class class is a run-time representation of a type. Since parametrized types undergo type erasure at runtime, the class object for Class would be the same as for Class&lt;List&lt;Integer>> and Class&lt;List&lt;String>>.</p> <p>The reason you cannot instantiate them using the .class notation is that this is a sp...
<p>The only thing you can do is instantiate <code>List&lt;String&gt;</code> <em>directly</em> and call its <code>getClass()</code>:</p> <pre><code>instantiate(new List&lt;String&gt;() { ... }.getClass()); </code></pre> <p>For types with multiple abstract methods like <code>List</code>, this is quite awkward. But unfo...
9,711
<p>In the context of a personal project I would like to reproduce the appearance of a commercial product of which I send you a cropped image.</p> <p>I would also like to point out that I do not have the object in question, but it would seem that it is made from a polymer. </p> <p>The product is a case with an embedd...
<p>Surface finish does not really map to the substrate material, Visually, what you have shown could be glass, ceramic, plastic, epoxy or metal.</p> <p>The surface finish is a combination of the shaping process, any post processing, and any surface finishing. Most significantly, there are a wide variety of custom pain...
<p>Is there anything else about this object, but its picture? Softening temperature, biodegradability, is it stiff of flexible, hard or soft, anything could help identifying its material.</p> <p>Also, post-processing (sanding down or chemicals like acetone bath) greatly enhances the range of filaments that can be used...
1,172
<p>I work with embedded Linux systems that sometimes want to get their IP address from a DHCP server. The DHCP Client client we use (<a href="http://www.phystech.com/download/dhcpcd.html" rel="nofollow noreferrer" title="DHCPCD">dhcpcd</a>) has limited retry logic. If our device starts up without any DHCP server avai...
<p>The reference dhclient from the ISC should run forever in the default configuration, and it should acquire a lease later if it doesn't get one at startup.</p> <p>I am using the out of the box dhcp client on FreeBSD, which is derived from OpenBSD's and based on the ISC's dhclient, and this is the out of the box beha...
<p>Add to <code>rc.local</code> a check to see if an IP has been obtained. If no setup an 'at' job in the near future to attempt again. Continue scheduling 'at' jobs until an IP is obtained. </p>
8,909
<p>Common 3D printers (read "cheap") may be used to print masks for PCBs (printed-circuit boards) which use PTH (through-hole) components.</p> <p>But can they be used to print PCBs which use SMD components? I'd like to make boards at least for Arduino-like SMD chips.</p>
<p>In addition to the thermal issues Tormod raised, there is a conductivity issue. Present conductive filaments are much less conductive than copper. The power loss may be enough to affect functionality. Also, the lost power goes to heat, making the thermal problems worse.</p> <p>For bulk materials, "volume resistivit...
<p>In theory, I imagine you can, but there are some practical considerations that might need some thought:</p> <p>If you have a desktop printer with multiple extruders, you could probably print with both one <em>conductive</em> and one <em>structural</em> filament, and thereby build circuits in 3D.</p> <p>One concern...
153
<p>Is it possible to retrieve items from a Python dictionary in the order that they were inserted?</p>
<p>The standard Python <code>dict</code> does this by default if you're using CPython 3.6+ (or Python 3.7+ for any other implementation of Python).</p> <p>On older versions of Python you can use <a href="https://docs.python.org/library/collections.html#ordereddict-objects" rel="noreferrer"><code>collections.OrderedDic...
<p>if you don't need the dict functionality, and only need to return tuples in the order you've inserted them, wouldn't a queue work better?</p>
8,589
<p>Imagine you want to animate some object on a WinForm. You setup a timer to update the state or model, and override the paint event of the Form. But from there, what's the best way to continually repaint the Form for the animation?</p> <ul> <li>Invalidate the Form as soon as you are done drawing?</li> <li>Setup a se...
<p>I've created a library that might help with this. It's called Transitions, and can be found here: <a href="https://github.com/UweKeim/dot-net-transitions" rel="nofollow noreferrer">https://github.com/UweKeim/dot-net-transitions</a>. Available on nuget as the <a href="https://www.nuget.org/packages/dot-net-transitio...
<p>What you're doing is the only solution I've ever used in WinForms (a timer with constant redrawings). There are a bunch of techniques that you can use to make the user's experience with it smoother (such as double-buffering).</p> <p>You might want to give WPF a try. There are built-in facilities for doing animation...
3,247
<p>In Java, there is no such thing as an unsigned byte.</p> <p>Working with some low level code, occasionally you need to work with bytes that have unsigned values greater than 128, which causes Java to interpret them as a negative number due to the MSB being used for sign.</p> <p>What's a good way to work around thi...
<p>It is actually possible to get rid of the if statement and the addition if you do it like this.</p> <pre><code>byte[] foobar = ..; int value = (foobar[10] &amp; 0xff); </code></pre> <p>This way Java doesn't interpret the byte as a negative number and flip the sign bit on the integer also.</p>
<p>I guess you could just use a short to store them. Not very efficient, but really the only option besides some herculean effort that I have seen.</p>
3,227
<p>Been going over my predecessor's code and see usage of the "request" scope frequently. What is the appropriate usage of this scope?</p>
<p>There are several scopes that are available to any portion of your code: Session, Client, Cookie, Application, and Request. Some are inadvisable to use in certain ways (i.e. using Request or Application scope inside your Custom Tags or CFC's; this is <a href="http://en.wikipedia.org/wiki/Coupling_%28computer_science...
<p>Okay, I just wanted to comment on your code. Please forgive me if I seem crazy. But you already verified that the structKeyExists in the beginning. Since you know it's going to be true, it wouldn't make sense to run another check. So my version of it would be this... But thats just me.</p> <hr> <pre><code>&lt;cfif...
4,529
<p>Most wiki software I've presents lots of "features" on their pages. This is fine for desktop users, but is annoying when using an iPhone or other mobile device. <br /><br />I'd prefer pages that just had the content, along with maybe an Edit button and a Search button. The editors are also often too fancy for mob...
<p>There isn't really a right answer. This is what coding standards within the company are for. If you can keep it consistent across the whole company then it will be easy to read. I personally like</p> <pre><code>if ( a == b) { doSomething(); } else { doSomething(); } </code></pre> <p>but this is a hol...
<p>Our boss makes us put { } after a decision statement no matter what, even if it's a single statement. It's really annoying to add two extra lines. The only exception is ternary operators.</p> <p>I guess it's a good thing I have my code monitor in portrait orientation at 1200x1600.</p>
3,229
<p>Since <a href="http://www.iboxprinters.com/" rel="nofollow noreferrer">iBox Nano</a> is the smallest public-production-available 3d Resin printer (and the cheapest so far), I assume it has a huge size limitation. So far I've only seen pictures of its outputs that are <a href="http://www.iboxprinters.com/ibox-nano-1/...
<p>On their <a href="http://www.iboxprinters.com/ibox-nano-1/" rel="nofollow noreferrer">website</a>, I found the following picture, which states a build area of 40 mm x 20 mm x 90 mm (1.57" x 0,79" x 3.54").</p> <p><a href="https://i.stack.imgur.com/TYxa8.jpg" rel="nofollow noreferrer" title="iBox Nano 3D printer spe...
<p>From their website I found a <a href="http://www.iboxprinters.com/pages.php?pageid=17" rel="nofollow">comparison between 300 microns down to 50 microns print quality</a>. My answer would be somewhere around this range.</p>
318
<p>There are lots of PHP articles about the subject so is this a PHP only problem. I am sending emails using System.Net.Mail after some regular expression checks of course. Similar to <a href="http://weblogs.asp.net/scottgu/archive/2005/12/10/432854.aspx" rel="noreferrer">http://weblogs.asp.net/scottgu/archive/2005/12/...
<p>the PHP email injection attack works because of a weakness in the PHP Mail() function. As a .net developer you need not worry.</p>
<p>I've never heard of that issue in ASP.NET. However, you should trust user input about as much as you'd trust a hooker with your wallet.</p>
7,856
<p>I am developing a mid-size application with VB2008. To better test my application I am following a MVP/Supervising Controller approach.</p> <p>My question is: What are your recommendations to separate responsibilites? So far I've come up with a winform with an instance of a controller and with an instance of my cla...
<p>I would suggest you spend time reading Jeremy Millers '<a href="http://codebetter.com/blogs/jeremy.miller/archive/2007/07/25/the-build-your-own-cab-series-table-of-contents.aspx" rel="nofollow noreferrer">Build your own CAB</a>' series of posts to get a feel for what you might like/need to implement as your applicat...
<p>Martin Fowler is a good source of information on all things design patterns including MVC. Fowler discusses Passive View and separation of responsibilities is demonstrated also</p> <p><a href="http://martinfowler.com/eaaDev/ModelViewPresenter.html" rel="nofollow noreferrer">http://martinfowler.com/eaaDev/ModelViewP...
8,865
<p>For a while now, my AmazonBasics PETG filament has been working like a charm. Now, it is balling up on my nozzle. I've tried slowing it down, re-leveling the bed, etc. I don't want to go through the hassle of replacing my nozzle with a Micro-Swiss all metal 0.4&nbsp;mm nozzle. I've tried the other extruder which I k...
<p>PETG does this. PETG is like glue when soft this is why when you level the bed you have to add an additional 0.1&nbsp;mm distance for PETG. PETG should not be as close as PLA, but futher away. It will stick to the hotend so preferably change the hotend from brass to a nickle plated nozzle (e.g. Micro Swiss, PETG doe...
<p>PETG does this. PETG is like glue when soft this is why when you level the bed you have to add an additional 0.1&nbsp;mm distance for PETG. PETG should not be as close as PLA, but futher away. It will stick to the hotend so preferably change the hotend from brass to a nickle plated nozzle (e.g. Micro Swiss, PETG doe...
1,226
<p>I want to escape a DOS filename so I can use it with sed. I have a DOS batch file something like this:</p> <pre><code>set FILENAME=%~f1 sed 's/Some Pattern/%FILENAME%/' inputfile </code></pre> <p>(Note: <code>%~f1</code> - expands <code>%1</code> to a Fully qualified path name - <code>C:\utils\MyFile.txt</code>)<...
<p>This will work. It's messy because in BAT files you can't use set var=`cmd` like you can in unix. The fact that echo doesn't understand quotes is also messy, and could lead to trouble if <code>Some Pattern</code> contains shell meta characters.</p> <pre><code>set FILENAME=%~f1 echo s/Some Pattern/%FILENAME%/ | sed...
<p>@Alexandru &amp; Jeremy, Thanks for your help. You both get upvotes</p> <p>@Jeremy</p> <p>Using your method I got the following error:</p> <blockquote> <p>sed: -e expression #1, char 8: unterminated `s' command</p> </blockquote> <p>If you can edit your answer to make it work I'd accept it. (pasting my soluti...
5,572
<p>I have a weird problem with my old 3D printer, it is a Prusa/Mendel type. When I print a 20&nbsp;mm cube, X and Y are correct, Z is resulting 16 to 17&nbsp;mm. I have checked the correctness of the movement on Z using the manual controls and there are no issues.</p> <p>I played a bit with the layer thickness, I hav...
<p>You should check that the steps per mm for your Z-axis are set correctly. This depends on the pitch of the leadscrews/threaded rods driving the axis and parameters of your steppers (microstepping and raw steps/revolution). <a href="http://prusaprinters.org/calculator/" rel="nofollow noreferrer">This Calculator</a>.<...
<p>A suitable test part for this problem, to check if the bad scaling is linear or the result of missing steps (as was identified in this case) would be a ramp, or sequence of steps. You can check the linearity using a straight edge, and would be able to perform repeated tests to identify of there was a specific Z loca...
391
<p>Google maps in some region can serve traffic information showing the blocked roads and so on. I was wondering if there is any code example demonstrating how can I serve traffice information for my own region. </p>
<p>"Google Maps Hacks" has a hack, <a href="http://safari.oreilly.com/0596101619/googlemapshks-CHP-4-SECT-3" rel="nofollow noreferrer">"Hack 30. Stay Out of Traffic Jams"</a>, on that.</p> <p>You can also find out how to get U.S. traffic info from John Resig's <a href="http://ejohn.org/blog/traffic-conditions-data/" r...
<p>Google is mum on what source they use for their traffic data. You might contact them directly to see if they want to implement something for you, but my guess is that they'd simply refer you to their provider if they really wanted your data.</p> <p>Keep in mind that traffic data is available for more than just the...
9,258
<p>In Ruby, what's the difference between <code>{}</code> and <code>[]</code>?</p> <p><code>{}</code> seems to be used for both code blocks and hashes.</p> <p>Are <code>[]</code> only for arrays?</p> <p>The documention isn't very clear.</p>
<p>It depends on the context:</p> <ol> <li><p>When on their own, or assigning to a variable, <code>[]</code> creates arrays, and <code>{}</code> creates hashes. e.g.</p> <pre><code>a = [1,2,3] # an array b = {1 =&gt; 2} # a hash </code></pre></li> <li><p><code>[]</code> can be overridden as a custom method, and is ge...
<p>a few examples:</p> <pre><code>[1, 2, 3].class # =&gt; Array [1, 2, 3][1] # =&gt; 2 { 1 =&gt; 2, 3 =&gt; 4 }.class # =&gt; Hash { 1 =&gt; 2, 3 =&gt; 4 }[3] # =&gt; 4 { 1 + 2 }.class # SyntaxError: compile error, odd number list for Hash lambda { 1 + 2 }.class # =&gt; Proc lambda { 1 + 2 }.call # =&gt; 3 </cod...
3,358
<p>I'm creating a small database application to teach myself the following concepts</p> <ol> <li>C# programming</li> <li>.Net 3.5 framework</li> <li>WPF</li> <li>LINQ ORM</li> </ol> <p>I want to use Microsoft Access as the database but I can't seem to find any mention of whether its possible to use SQLMetal to genera...
<p>For an embedded database, you can use <a href="http://www.microsoft.com/sql/editions/compact/default.mspx" rel="nofollow noreferrer">SQL Server Compact Edition</a>. Unlike SQL Server Express, it is <em>not</em> compatible with the LINQ to SQL designer, but it is fully compatible with the command-line SQLMetal. It ...
<p>Thanks for all the responses. I never expected to get an answer this quick. For my test application I think SQL Server Compact Edition would be the way to go. I'm basically creating a money managment app similar to Microsoft Money and although it is an exercise to learn skills, I would eventually want to use it to m...
4,984
<p>The Weblogic servers we are using have been configured to allow JNDI datasource names like "appds".</p> <p>For development (localhost), we might be running Tomcat and when declared in the &lt;context&gt; section of server.xml, Tomcat will hang JNDI datasources on "java:comp/env/jdbc/*" in the JNDI tree.</p> <p><st...
<p><code>JndiLocatorSupport</code> has a property <code>resourceRef</code>. When setting this true, "java:comp/env/" prefix will be prepended automatically. So I believe it would be correct to differentiate this parameter when moving from Tomcat to Weblogic.</p>
<p>My application also had a similar problem and this is how I solved it:</p> <p>1) <code>WEB-INF/classes/application.properties</code> contains the entry:</p> <pre> ds.jndi=java:comp/env/jdbc/tcds </pre> <p>2) On the WLS machine, I have an entry in the <code>/etc/sysenv</code> file:</p> <pre> ds.jndi=wlsds </pre> ...
6,992
<p>I know that IList is the interface and List is the concrete type but I still don't know when to use each one. What I'm doing now is if I don't need the Sort or FindAll methods I use the interface. Am I right? Is there a better way to decide when to use the interface or the concrete type?</p>
<p>There are two rules I follow:</p> <ul> <li>Accept the most basic type that will work</li> <li>Return the richest type your user will need</li> </ul> <p>So when writing a function or method that takes a collection, write it not to take a List, but an IList&lt;T&gt;, an ICollection&lt;T&gt;, or IEnumerable&lt;T&gt;....
<p>In situations I usually come across, I rarely use IList directly.</p> <p>Usually I just use it as an argument to a method </p> <pre><code>void ProcessArrayData(IList almostAnyTypeOfArray) { // Do some stuff with the IList array } </code></pre> <p>This will allow me to do generic processing on almost any arra...
3,786
<p>I am trying to solve a persistent IO problem when we try to read or write to a Windows 2003 Clustered Fileshare. It is happening regularly and seem to be triggered by traffic. We are writing via .NET's FileStream object.</p> <p>Basically we are writing from a Windows 2003 Server running IIS to a Windows 2003 file...
<p>I've heard of <a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;q138365" rel="nofollow noreferrer">AutoDisconnect</a> causing similar issues (even if the device isn't idle). You may want to try disabling that on the server.</p>
<p>I've seen other people reporting the "delayed write failed" error. One recommendation was to adjust the size of the cache, there's a utility from sysinternals (<a href="http://technet.microsoft.com/en-us/sysinternals/bb897561.aspx" rel="nofollow noreferrer">http://technet.microsoft.com/en-us/sysinternals/bb897561.a...
5,045
<p>I build and export my model using ZBrush and as STL files.<br /> To fix the mesh for 3D print, I try to use 3D Builder which can automatically repair my parts.<br /> As it saves as a single file, if I import all parts at once,<br /> I import the files one by one, repair them, then save them as a new file.<br /> Afte...
<p>STL models as exported by software often include their origin in the origin of the design software. However, when using software to fix modeling errors, those origins are not always retained and thus when importing them into a different software their <em>center of mass</em> is taken as the new point of reference.</...
<p>It has moved it to the ground as close as it could. This is generally best for 3d printing seperate objects.</p> <p>If you need them together you can reposition them, or combine them.</p> <p>Alternatively change the 'Collision' and 'Intersect' settings until you get what you want.</p>
2,138
<p>Here we go again, the old argument still arises... </p> <p>Would we better have a business key as a primary key, or would we rather have a surrogate id (i.e. an SQL Server identity) with a unique constraint on the business key field? </p> <p>Please, provide examples or proof to support your theory.</p>
<p>Both. Have your cake and eat it.</p> <p>Remember there is nothing special about a primary key, except that it is labelled as such. It is nothing more than a NOT NULL UNIQUE constraint, and a table can have more than one.</p> <p>If you use a surrogate key, you still want a business key to ensure uniqueness accord...
<p>In the case of point in time database it is best to have combination of surrogate and natural keys. e.g. you need to track a member information for a club. Some attributes of a member never change. e.g Date of Birth but name can change. So create a Member table with a member_id surrogate key and have a column for DO...
8,863
<p>We used the "undocumented" xp_fileexist stored procedure for years in SQL Server 2000 and had no trouble with it. In 2005, it seems that they modified the behavior slightly to always return a 0 if the executing user account is not a sysadmin. It also seems to return a zero if the SQL Server service is running under ...
<p>Maybe a CLR stored procedure is what you are looking for. These are generally used when you need to interact with the system in some way.</p>
<p>I still believe that a CLR procedure might be the best bet. So, I'm accepting that answer. However, either I'm not that bright or it's extremely difficult to implement. Our SQL Server service is running under a local account because, according to Mircosoft, that's the only way to get an iSeries linked server working...
3,735
<p>I keep running across this loading image</p> <p><a href="http://georgia.ubuntuforums.com/images/misc/lightbox_progress.gif" rel="nofollow noreferrer">http://georgia.ubuntuforums.com/images/misc/lightbox_progress.gif</a></p> <p>which seems to have entered into existence in the last 18 months. All of a sudden it is...
<p>You can get many different AJAX loading animations in any colour you want here: <a href="http://www.ajaxload.info/" rel="noreferrer">ajaxload.info</a></p>
<p>I think it's just a general extension to the normal clock-face style loading icon. The Firefox <a href="http://en.wikipedia.org/wiki/Throbber" rel="nofollow noreferrer">throbber</a> is the first example of that style that I remember coming across; the only real difference between that and the current trend of strai...
7,679
<p>I am reading a binary file into a parsing program. I will need to iterate through the file and look for certain markers so I can split the file up and pass those parts into their respective object’s constructors.</p> <p>Is there an advantage to holding the file as a stream, either MemoryStream or FileStream, or sh...
<p>A <code>byte[]</code> or <code>MemoryStream</code> will both require bringing the entire file into memory. A <code>MemoryStream</code> is really a wrapper around an underlying byte array. The best approach is to have two <code>FileStream</code> (one for input and one for output). Read from the input stream looking f...
<p>A MemoryStream is basically a byte array with a stream interface, e.g. sequential reading/writing and the concept of a current position.</p>
3,763
<p>In python, you can have a function return multiple values. Here's a contrived example:</p> <pre><code>def divide(x, y): quotient = x/y remainder = x % y return quotient, remainder (q, r) = divide(22, 7) </code></pre> <p>This seems very useful, but it looks like it can also be abused ("Well..functio...
<p>Absolutely (for the example you provided).</p> <h3>Tuples are first class citizens in Python</h3> <p>There is a builtin function <a href="https://docs.python.org/3/library/functions.html#divmod" rel="noreferrer"><code>divmod()</code></a> that does exactly that.</p> <pre><code>q, r = divmod(x, y) # ((x - x%y)/y, x...
<p>It's fine to return multiple values using a tuple for simple functions such as <code>divmod</code>. If it makes the code readable, it's Pythonic.</p> <p>If the return value starts to become confusing, check whether the function is doing too much and split it if it is. If a big tuple is being used like an object, ma...
8,682
<p>I know PHP scripts don't actually compile until they are run. However, say I want to create a small simple program and compile it to a binary without requiring the PHP binary. How could I do this?</p> <p>I've seen a few IDE's out there that would do this, but either they are all for windows or the Linux versions do...
<p>Check out <a href="https://github.com/pbiggar/phc" rel="nofollow noreferrer">phc: the PHP compiler</a></p> <p>If you just want to run it like a script, you may not need to compile it per se, but just run it via the command line. <a href="http://www.php.net/features.commandline" rel="nofollow noreferrer">Read runnin...
<p>Have a look at Facebook's <a href="http://github.com/facebook/hiphop-php#readme" rel="nofollow noreferrer">Hiphop-PHP</a>. It's able to convert PHP code into C++ then compile it with g++. Apparently, they've even gotten it to successfully compile entire WordPress installations.</p>
7,065
<p>What is the best way to find something in a list? I know LINQ has some nice tricks, but let's also get suggestions for C# 2.0. Lets get the best refactorings for this common code pattern.</p> <p>Currently I use code like this:</p> <pre><code>// mObjList is a List&lt;MyObject&gt; MyObject match = null; foreach (M...
<blockquote> <p>@ Konrad: So how do you use it? Let's say I want to match mo.ID to magicNumber.</p> </blockquote> <p>In C# 2.0 you'd write:</p> <pre><code>result = mObjList.Find(delegate(int x) { return x.ID == magicNumber; }); </code></pre> <p>3.0 knows lambdas:</p> <pre><code>result = mObjList.Find(x =&gt; x.ID...
<p>Put the code in a method and you save a temporary and a <code>break</code> (and you recycle code, as a bonus):</p> <pre><code>T Find&lt;T&gt;(IEnumerable&lt;T&gt; items, Predicate&lt;T&gt; p) { foreach (T item in items) if (p(item)) return item; return null; } </code></pre> <p>… but of...
4,364
<p>Do you attach the images? </p> <p>Use absolute urls? </p> <p>How do you best avoid getting flagged as spam? </p>
<p>One of the biggest causes, that I have found, for email to be flagged as spam is DNS. Make sure the domain / MX records from which you are sending the email actually resolve correctly back from the server used for sending.</p> <p>As for images, you could attach them, but the most common way is to host them and use...
<p>Campaign Monitor is a great resources for html email: <a href="http://www.campaignmonitor.com/resources/#building" rel="nofollow noreferrer">http://www.campaignmonitor.com/resources/#building</a></p> <p>Also <a href="http://www.email-standards.org/" rel="nofollow noreferrer">http://www.email-standards.org/</a>, but...
6,631
<p>How do I find out whether or not Caps Lock is activated, using VB.NET?</p> <p>This is a follow-up to my <a href="https://stackoverflow.com/questions/58937/how-do-i-toggle-caps-lock-in-vbnet">earlier question</a>.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.iskeylocked.aspx" rel="noreferrer">Control.IsKeyLocked(Keys) Method - MSDN</a></p> <pre><code>Imports System Imports System.Windows.Forms Imports Microsoft.VisualBasic Public Class CapsLockIndicator Public Shared Sub Main() ...
<p>The solution posted by <a href="https://stackoverflow.com/a/58993/7444103">.rp</a> works, but conflicts with the <code>Me.KeyDown</code> event handler.<br> I have a sub that calls a sign in function when enter is pressed (shown below).<br> The <code>My.Computer.Keyboard.CapsLock</code> state works and does not confl...
8,343
<p>Looking to print a new part for a home appliance. There's going to need to be a new model created with the customizations made, but the model (after printing) will have to fit where the old part was. Is there any 3D modeling software that is better for this purpose? Will I just have to guess at proper proportions an...
<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,144
<p>I'm planning on creating a social networking + MP3 lecture downloading / browsing / commenting / discovery website using Ruby on Rails. Partially for fun and also as a means to learn some Ruby on Rails. I'm looking for a social networking framework that I can use as a basis for my site. I don't want to re-invent the...
<p>It depends what your priorities are.</p> <p>If you really want to learn RoR, <strong>do it all from scratch</strong>. Seriously. Roll your own. It's the best way to learn, far better than hacking through someone else's code. If you do that, sometimes you'll be learning Rails, but sometimes you'll just be learning t...
<p>One other positive to Community Engine is that it is using <a href="http://rails-engines.org/" rel="nofollow noreferrer">Engines</a> which is an advanced type of plugin that <a href="http://weblog.rubyonrails.org/2009/2/1/rails-2-3-0-rc1-templates-engines-rack-metal-much-more" rel="nofollow noreferrer">is becoming a...
7,073
<p>We have an application that has to be flexible in how it displays it's main form to the user - depending on the user, the form should be slightly different, maybe an extra button here or there, or some other nuance. In order to stop writing code to explicitly remove or add controls etc, I turned to visual inheritan...
<p>I thought they had more or less sorted the desktop designer issues in 2005. Have you tried the usual culprits?</p> <ul> <li>No abstract control types</li> <li>No constructor arguments in any form</li> <li>Initialisation moved to Form_Load as opposed to the Ctor</li> <li>No controls in the same project as the userco...
<p>Read this: <a href="http://cs.rthand.com/blogs/blog_with_righthand/archive/2005/11/10/186.aspx" rel="nofollow noreferrer">http://cs.rthand.com/blogs/blog_with_righthand/archive/2005/11/10/186.aspx</a></p> <p>AFAIK, there are still issues with Visual Inheritance and objects that rely on collections for the design el...
7,204
<p>We have <a href="https://3dprinting.stackexchange.com/questions/1117/alternative-3d-molding-techniques-at-home">a recent question</a> that brings up the question of "<em>Should we support general hobbyist questions?</em>"</p> <p>Currently, there doesn't appear to be a viable site within the SE network. The question...
<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 ...
28
<p>I need to find out time taken by a function in my application. Application is a MS VIsual Studio 2005 solution, all C code. </p> <p>I used thw windows API GetLocalTime(SYSTEMTIME *) to get the current system time before and after the function call which I want to measure time of. But this has shortcoming that it lo...
<p>There are some other possibilities.</p> <h2>QueryPerformanceCounter and QueryPerformanceFrequency</h2> <p><a href="http://msdn.microsoft.com/en-us/library/ms644904.aspx" rel="noreferrer">QueryPerformanceCounter</a> will return a "performance counter" which is actually a CPU-managed 64-bit counter that increments f...
<p>On Windows you can use the 'high performance counter API'. Check out: <a href="http://msdn.microsoft.com/en-us/library/ms644904(VS.85).aspx" rel="nofollow noreferrer">QueryPerformanceCounter</a> and <a href="http://msdn.microsoft.com/en-us/library/ms644905(VS.85).aspx" rel="nofollow noreferrer">QueryPerformanceCoun...
7,231
<p>I'm using a winforms webbrowser control to display some content in a windows forms app. I'm using the DocumentText property to write the generated HTML. That part is working spectacularly. Now I want to use some images in the markup. (I also would prefer to use linked CSS and JavaScript, however, that can be wor...
<p>Here's what we do, although I should mention that we use a custom web browser to remove such things as the ability to right-click and see the good old IE context menu:</p> <pre><code>public class HtmlFormatter { /// &lt;summary&gt; /// Indicator that this is a URI referencing the local /// file path. ...
<p>I ended up using something that's basically the same as what Ken suggested. However, instead of manually appending the file prefix, I used the UriBuilder class to build the complete URI with the "file" protocol.</p> <p>This also solved a subsequent problem when we tested the app in a more realistic location, Progr...
9,767
<p>Are there any conflicts with having any combination of Visual Studio 2003, 2005 and/or 2008 installed? I noticed a related question <a href="https://stackoverflow.com/questions/9693/visual-studio-2005-macros-stop-working-when-visual-studio-2008-is-installed">here</a> but wanted a more general answer.</p>
<p>6, 2000/2001 (I can't remember which is .net 1.0), 2003, 2005, 2008... of course within .NET you may have issues with getting the right solution with the right version. I haven't really seen any conflicts in particular.</p>
<p>I've got 2005 and 2008 installed concurrently.</p> <p>2008 is a superset of 2005, so I have no reason whatsoever to have them both, I just haven't gotten around to un-installing it yet</p>
4,892
<p>any idea how if the following is possible in PHP as a single line ?:</p> <pre><code>&lt;?php $firstElement = functionThatReturnsAnArray()[0]; </code></pre> <p>... It doesn't seem to 'take'. I need to do this as a 2-stepper:</p> <pre><code>&lt;?php $allElements = functionThatReturnsAnArray(); $firstElement = $allE...
<p>Try:</p> <pre><code>&lt;?php $firstElement = reset(functionThatReturnsAnArray()); </code></pre> <p>If you're just looking for the first element of the array.</p>
<p>As far as I know this is not possible, I have wanted to do this myself several times.</p>
9,427
<p>I have a model that's placed on the bed exactly like on this picture:</p> <p><a href="https://i.stack.imgur.com/hDTcF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hDTcF.png" alt="sample model placement" /></a></p> <p>I have constant quality degradation as the bed moves down to print in the uppe...
<p>I think this is resolved. After looking at every conceivable source of over-extrusion and coming up negative, <code>R.. GitHub STOP HELPING ICE</code> suggested that it might be a mechanical problem in Z axis movement, like in <a href="https://3dprinting.stackexchange.com/questions/8022/first-3-mm-prints-poorly-then...
<p>I had the same problem with my Ender-3 V2.</p> <p>You need to check if the feeder bracket is square like explained in <a href="https://www.youtube.com/watch?v=xnzNd_FIMKY" rel="nofollow noreferrer">this YouTube</a></p> <p>If that is not the problem maybe you need a custom bracket to change the spacing between the Z-...
1,695
<p>I apologize for asking such a generalized question, but it's something that can prove challenging for me. My team is about to embark on a large project that will hopefully drag together all of the random one-off codebases that have evolved through the years. Given that this project will cover standardizing logical e...
<p>There's a million ways to skin a cat. However, the simplest one is always the best. Which way is the simplest for you? Depends on your requirements. But there are some general rules of thumb I follow.</p> <p>First, reduce the overall number of projects as much as possible. When you compile twenty times a day, ...
<p>Large solutions with lots of projects can be quite slow to compile, but are easier to manage together.</p> <p>I often have Unit test assemblies in the same solution as the ones they're testing, as you tend to make changes to them together.</p>
3,329
<p>I plan to be storing all my config settings in my application's app.config section (using the <code>ConfigurationManager.AppSettings</code> class). As the user changes settings using the app's UI (clicking checkboxes, choosing radio buttons, etc.), I plan to be writing those changes out to the <code>AppSettings</cod...
<p>since you're using a winforms app, if it's in .net 2.0 there's actually a user settings system (called Properties) that is designed for this purpose. <a href="https://learn.microsoft.com/en-us/previous-versions/aa730869%28v=vs.80%29" rel="nofollow noreferrer">This article on MSDN</a> has a pretty good introduction i...
<p>Could I ask why you're not saving the user's settings in a database?</p> <p>Generally, I save application settings that are changed very infrequently in the appSettings section (the default email address error logs are sent to, the number of minutes after which you are automatically logged out, etc.) The scope of t...
2,615
<p>On 16 September 2020, Autodesk announced changes in the way that Fusion 360 can be used for non-commercial use with their Personal license. As a hobbyist, most of these changes will not affect me very much, since I do not use Fusion 360's advanced features. The most irksome will be only being allowed to have up to t...
<p>Most of my answer is based off of what Autodesk has said and <a href="https://www.youtube.com/watch?v=SlnEThQ4HR8" rel="nofollow noreferrer">this video</a> from Maker's Muse, which explains this topic in much more detail.</p> <p>In summary, Autodesk is planning on restricting your ability to export any parametric fi...
<h1>If you use the private license: there was supposed to be a cutoff date.</h1> <p>As long as you use the &quot;private&quot; license, you will get some restrictions. Originally, including the lock off of <code>.step</code> and similar files as well as limiting you to 10 active projects. This means, that you will need...
1,745
<p>I have a bunch of <strong>.NET</strong> frameworks installed on my machine.<br> I know that with the <strong>Java JDK</strong>, I can use the <strong>6.0</strong> version to target <strong>5.0</strong> and earlier. </p> <p>Can I do something similar with the <strong>.NET</strong> framework - target <strong>1.0</st...
<p>Visual Studio 2008 was the first to support targeting older versions of .NET. Unfortunately, it supports only .NET 2 and up.</p> <p>In other words, you'll need .NET framework SDK 1 or 1.1 to do this.</p>
<p>(<strong>Updated</strong>)</p> <p>You need to compile with the 1.0 compilers. These are only available with the 1.0 release of the runtime/SDK.</p> <p>The 2.0/3.5 compilers won't emit 1.0-compatible assemblies.</p> <p>Visual Studio 2008 can generate 2.0 assemblies, but 1.0 was left off.</p>
5,128
<p>I've just finished reading Domain Driven Design and I'm enchanted with some of the ideas covered in it. Do you know any companies that implement ubiquitous language in their projects?</p>
<p>The <a href="http://tech.groups.yahoo.com/group/domaindrivendesign/" rel="nofollow noreferrer">Domain Driven Design Yahoo Group</a> may be a better place to find an answer to your question.</p>
<p>The company I work for uses Domain-Driven Design to its fullest and after a few very successful projects, we're sticking with the design philosophy.</p> <p>The company is <a href="http://www.hintinnovation.com" rel="nofollow noreferrer">Hint Innovation</a>, we are a relatively new company so the website is not done...
9,941
<p>I have a dl containing some input boxes that I "clone" with a bit of JavaScript like: </p> <pre><code>var newBox = document.createElement('dl'); var sourceBox = document.getElementById(oldkey); newBox.innerHTML = sourceBox.innerHTML; newBox.id = newkey; document.getElementById('boxes').appendChild(col...
<p>You could try the <code>cloneNode</code> method. It might do a better job of copying the contents. It should also be faster in most cases</p> <pre><code>var newBox; var sourceBox = document.getElementById(oldkey); if (sourceBox.cloneNode) newBox = sourceBox.cloneNode(true); else { newBox = document.createE...
<p>You could try the <code>cloneNode</code> method. It might do a better job of copying the contents. It should also be faster in most cases</p> <pre><code>var newBox; var sourceBox = document.getElementById(oldkey); if (sourceBox.cloneNode) newBox = sourceBox.cloneNode(true); else { newBox = document.createE...
9,509
<p>I know I've seen this in the past, but I can't seem to find it now.</p> <p>Basically I want to create a page that I can host on a <a href="http://www.codeplex.com/dasblog" rel="nofollow noreferrer">dasBlog</a> instance that contains the layout from my theme, but the content of the page I control.</p> <p>Ideally th...
<p>The easist way to do this is to "hijack" the FormatPage functionality.</p> <p>First add the following to your web.config in the newtelligence.DasBlog.UrlMapper section:</p> <pre><code>&lt;add matchExpression="(?&amp;lt;basedir&amp;gt;.*?)/Static\.aspx\?=(?&amp;lt;value&amp;gt;.+)" mapTo="{basedir}/FormatPage.aspx?...
<p>I did something similar setting up a handler to stream video files from the blog on my home server. I ended up ditching it because it killed my bandwidth whenever someone would view a video, but I did have it up and working for a while.</p> <p>To get it to work I had to check dasBlog out from source control and op...
7,250
<p>I am trying to create a mechanism with moving parts, and would like to see how it works (whether it even works) before printing it.</p> <p>For example, there's a servo with a bracket, and I would like to see how far can the bracket move before colliding with other objects.</p> <p><a href="https://i.stack.imgur.com...
<p>freeCad has a draft rotate function in <strong>DRAFT workbench</strong>:</p> <ol> <li>Select an object;</li> <li>Press the Draft Rotate button, then;</li> <li>Click to set the rotating point and rotate. </li> </ol> <p>You will get used to that after a few trails.</p> <p>There is a <a href="https://www.freecadweb....
<p>I would also like to take a look at the A2plus Workbench (Freecad Addon). There you can define constraints which can help with this problem. As far as I know, parts cannot be moved with the mouse pointer, but angle parameters can be entered.</p> <p><a href="https://freecadweb.org/wiki/A2plus_Workbench" rel="nofollo...
1,059
<p>My C# project - we'll call it the SuperUI - used to make use of a class from an external assembly. Now it doesn't, but the compiler won't let me build the project without the assembly reference in place. Let me elaborate.</p> <p>This project used to throw and catch a custom exception class - the <code>SuperExceptio...
<p>It's likely a transitive reference, where some type method call returns an instance of SuperException boxed ("downcast") as e.g. Exception, but from inspecting the code in the transitively included code, i.e. code from your external method calls, the compiler knows that you need to be able to have information about ...
<p><code>grep -R SuperException *</code> in the base of your project (get <code>grep</code> from somewhere first) just to be sure.</p>
3,060
<p>So if I have a method of parsing a text file and returning a <strong>list</strong> <em>of a</em> <strong>list</strong> <em>of</em> <strong>key value pairs</strong>, and want to create objects from the kvps returned (each list of kvps represents a different object), what would be the best method?</p> <p>The first met...
<p>Take a deep look at the <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx" rel="nofollow noreferrer">XmlSerializer</a>. Even if you are constrained to not use XML on-disk, you might want to copy some of its features. This could then look like this:</p> <pre><code>public cl...
<p>@David:<br> I already have the parser (and most of these will be hand written, so I decided against XML). But that looks like I really nice way of doing it; I'll have to check it out. Excellent point about versioning too. </p> <p>@Argelbargel:<br> That looks good too. :')</p>
7,238
<p>I have windows 2003 terminal servers, multi-core. I'm looking for a way to monitor individual CPU core usage on these servers. It is possible for an end-user to have a run-away process (e.g. Internet Explorer or Outlook). The core for that process may spike to near 100% leaving the other cores 'normal'. Thus, t...
<p>Individual CPU usage is available through the standard windows performance counters. You can monitor this in perfmon.</p> <p>However, it won't give you the result you are looking for. Unless a thread/process has been explicitly bound to a single CPU then a run-away process will not spike one core to 100% while al...
<p>perfmon from Microsoft can monitor each individual CPU. perfmon also works remote and you can monitor farious aspects of Windows.</p> <p>I'm not sure if it helps to find run-away processes because the Windows scheduler dos not execute a process always on the same CPU -> on your 8 CPU machine you will see 12.5 % usa...
7,051
<p>I've been looking into this, but:</p> <ol> <li>I'm not certain how to configure my multimeter; </li> <li>I don't know how to keep the voltage going, and;</li> <li>I don't know how to keep the multimeter connected to the VMOT?</li> </ol> <p>I'm told you're supposed to aim for about 1&nbsp;A.</p>
<p>Generally speaking voltage on stepstick output should be around 1V. </p> <p>To imagine more or less what the current and what the voltage is, you can think about it in the same way as about water.</p> <p>The wire is more or less the same as the pipe. The voltage can be imagined as (sort of) the height from which t...
<p>I want to add some points and clarifications to the answer that @darthpixel already has given. Most information you need is in there, I want to give some more practical advice, since that is what I understand you're question is asking for. I'll start with some points on the more theoretical side, though:</p> <ul> <l...
339
<p>From what I've been able to find out, online sources recommend around 205ºC for PLA and around 240ºC for ABS. But these are only guidelines, of course. Optimal printing temperature can be different depending on the printer, the filament, the model and other slicer settings.</p> <p>For example, I've had success prin...
<h1>Printing temperature basics</h1> <p>Manufacturers generally specify a somewhat wide range of printing temperatures, and what temperature you should actually need can only be determined by trial and error:</p> <ol> <li><p>The thermistor in your hotend is not 100 % accurate and may have an offset of a few degrees com...
<ol> <li><p>Some manufacturers give a recommended temperature which would be the best place to start at and adjust from there. Otherwise you could print calibration objects and find the best temp that way. Here is a <a href="http://www.thingiverse.com/thing:915435" rel="nofollow">temp tower</a> for that purpose. Mostly...
302
<p>I need to do a simple mail merge in OpenOffice using C++, VBScript, VB.Net or C# via OLE or native API. Are there any good examples available?</p>
<p>I haven't come up with a solution I'm really happy with but here are some notes:</p> <ul> <li><p>Q. What is the OO API for mail merge?</p> <p>A. <a href="http://api.openoffice.org/docs/common/ref/com/sun/star/text/MailMerge.html" rel="noreferrer">http://api.openoffice.org/docs/common/ref/com/sun/star/text/MailMerg...
<p>You should take a look at <strong><a href="http://api.openoffice.org" rel="nofollow noreferrer">Apache OpenOffice API</a></strong>. A project for creating an API for Open Office. A few languages they said to support are: C++, Java, Python, CLI, StarBasic, JavaScript and OLE.</p> <p><a href="http://codesnippets.serv...
5,982
<p>Using C++ (and Qt), I need to process a big amount of 3D coordinates.</p> <p>Specifically, when I receive a 3D coordinate (made of 3 doubles), I need to check in a list if this coordinate has already been processed. If not, then I process it and add it to the list (or container).</p> <p>The amount of coordinates c...
<p>Probably the simplest way to speed up such processing is to store the already-processed points in <a href="http://en.wikipedia.org/wiki/Octree" rel="noreferrer">Octree</a>. Checking for duplication will become close to logarithmic.</p> <p>Also, make sure you tolerate round-off errors by checking the distance betwee...
<p>Pick a constant to scale the coordinates by so that 1 unit describes an acceptably small box and yet the integer part of the largest component by magnitude will fit into a 32-bit integer; convert the X, Y and Z components of the result to integers and hash them together. Use that as a hash function for a map or hash...
9,773
<p>While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could come up with off the top of my head was something like this:</p> <pre><code>public String appendWithDelimiter( Stri...
<h3>Pre Java 8:</h3> <p>Apache's commons lang is your friend here - it provides a join method very similar to the one you refer to in Ruby: </p> <p><a href="http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#join(java.lang.Iterable,%20char)" rel="noreferrer"><code>StringUt...
<pre><code>public static String join(String[] strings, char del) { StringBuffer sb = new StringBuffer(); int len = strings.length; boolean appended = false; for (int i = 0; i &lt; len; i++) { if (appended) { sb.append(del); } sb.append(""+strings[i]); ...
8,872
<p>I have a large codebase that targetted Flash 7, with a <em>lot</em> of AS2 classes. I'm hoping that I'll be able to use Flex for any new projects, but a lot of new stuff in our roadmap is additions to the old code.</p> <p>The syntax for AS2 and AS3 is generally the same, so I'm starting to wonder how hard it would...
<p>Some notable problems I saw when attempting to convert a large number of AS2 classes to AS3:</p> <h3>Package naming</h3> <pre><code>class your.package.YourClass { } </code></pre> <p>becomes</p> <pre><code>package your.package { class YourClass { } } </code></pre> <h3>Imports are required</h3> <p>Yo...
<p>Migrating a bigger project like this from as2 will be more than a simple search and replace. The new syntax is fairly similar and simple to adapt (as lilserf mentioned) but if nothing else the fact that as3 is more strict and the new event model will mostly likely cause a lot of problems. You'll probably be better o...
6,818
<p>I am trying to print a <a href="https://www.thingiverse.com/thing:2755765" rel="nofollow noreferrer">12 hole Ocarina</a> I found on thingiverse. When printing I have to stop it around 25-30 layers because the edge of the shell is higher then the infill. </p> <p><a href="https://i.stack.imgur.com/kMrn5.jpg" rel="nof...
<p>Did you verify the Cura z-offset actually changed the corresponding G-Codes? </p> <p>I had the opposite problem on my RF1000. To fix the problem I added the following 2 lines to my start G-Codes:</p> <pre><code>M3001 ; Activate Z-Compensation M206 Z-0.3 ; Set z offset 0.3mm closer to the nozzle </code></pre> <p>...
<p>Did you verify the Cura z-offset actually changed the corresponding G-Codes? </p> <p>I had the opposite problem on my RF1000. To fix the problem I added the following 2 lines to my start G-Codes:</p> <pre><code>M3001 ; Activate Z-Compensation M206 Z-0.3 ; Set z offset 0.3mm closer to the nozzle </code></pre> <p>...
1,438
<p>I have got the following situation. On a machine there is a <strong>Fritz ISDN</strong> card. There is a process that is responsible for playing a certain wave file on this device's wave out (<strong>ISDN</strong> connection is made at startup and made persistent). The scenario is easy, whenever needed the process c...
<p>I don't have the time to Google too much for this, but I know that either Larry Osterman or Raymond Chen blogged about a similar situation.</p> <p>I'll check back later when I have more time to see if this question is still open.</p>
<p>What is the return value when the sound does not play? If you get MMSYSERR_NOERROR that points to the driver incorrectly reporting to the OS that the buffer was processed.</p> <p>Has the WAV file itself changed? This <a href="http://blogs.msdn.com/larryosterman/archive/2007/07/24/playsound-is-failing-on-vista-what-...
3,101
<p>How can I close a browser window without receiving the <em>Do you want to close this window</em> prompt?</p> <p>The prompt occurs when I use the <code>window.close();</code> function.</p>
<p>My friend... there is a way but "hack" does not begin to describe it. You have to basically exploit a bug in IE 6 &amp; 7. </p> <p>Works every time!</p> <p>Instead of calling <code>window.close()</code>, redirect to another page. </p> <p>Opening Page:</p> <pre><code>alert("No whammies!"); window.open("closer.htm...
<p>The best solution I have found is:</p> <pre><code>this.focus(); self.opener=this; self.close(); </code></pre>
8,227
<p>I'm still fairly new to 3D printing; got my Ender 3 V2 for Christmas last year. Recently the tension arm in the stock extruder snapped, so I bought and installed an all-aluminum replacement. My first successful(ish) print since installing it lasted two to three hours before I noticed the filament wasn't feeding. It ...
<p>You could still get heat creep with a Bowden tube. It has different characteristics. Instead of jamming up in the direct drive, the filament can melt too far upwards into the heat break where it can refreeze and jam. The characteristic, if you can pull out the filament, is widened filament extending into the heat...
<p><em>Answer created from octopus8's comments. If octopus8 wants to post their own answer, this wiki answer can be deleted.</em></p> <hr /> <p>185 °C is quite ok for several PLAs I have when printing slow.</p> <p>Honestly, I couldn't believe that the heat can go up the heatsink and Bowden tube to make extruder frame h...
1,887
<p>What should I do if I want to release a .net assembly but wish to keep its internals detailed in the manifest private (from a utility such as <a href="https://learn.microsoft.com/en-us/dotnet/framework/tools/ildasm-exe-il-disassembler" rel="nofollow noreferrer">ildasm.exe</a>) ?</p>
<p>I think what you're talking about is "obfuscation". There are lots of articles about it on the net:</p> <p><a href="http://en.wikipedia.org/wiki/Obfuscation" rel="noreferrer">http://en.wikipedia.org/wiki/Obfuscation</a></p> <p>The "standard" tool for obfuscation on .NET is by Preemptive Solutions:</p> <p><a href=...
<p>The CLR cannot directly load modules that contain no manifest. So you can't make an assembly completely private unless you also want to make it unloadable ;)</p> <p>You can however, as Mark noted above, use obfuscation tools to hide the parts you would like to keep truly internal. </p> <p>It's too bad the <strong>...
4,937
<p>I have seen <a href="http://blogs.msdn.com/djpark/archive/2007/11/07/how-to-use-solutions-and-projects-between-visual-studio-2005-and-2008.aspx" rel="nofollow noreferrer">Solutions created in Visual Studio 2008 cannot be opened in Visual Studio 2005</a> and tried workaround 1. Yet to try the workaround 2. </p> <p>B...
<p>I have a project that I work on in both VS 2005 and VS 2008. The trick is just to have to different solution files, and to make sure they stay in sync. Remember that <strong>projects</strong> keep track of their <strong>files</strong>, so the main thing <strong>solutions</strong> do is keep track of which <strong>...
<p>I'd say you should restore your 2005 version from source control, assuming you have source control and a 2005 copy of the file.</p> <p>Otherwise, there are plenty of pages on the net that details the changes, but unfortunately no ready-made converter program that will do it for you.</p> <p>Be aware that as soon as...
4,542
<p>This error just started popping up all over our site.</p> <p><strong><em>Permission denied to call method to Location.toString</em></strong></p> <p>I'm seeing google posts that suggest that this is related to flash and our crossdomain.xml. What caused this to occur and how do you fix?</p>
<p>Are you using javascript to communicate between frames/iframes which point to different domains? This is not permitted by the JS "same origin/domain" security policy. Ie, if you have</p> <pre><code>&lt;iframe name="foo" src="foo.com/script.js"&gt; &lt;iframe name="bar" src="bar.com/script.js"&gt; </code></pre> <p>...
<p>This <a href="http://willperone.net/Code/as3error.php" rel="nofollow noreferrer">post</a> suggests that there is one line that needs to be added to the crossdomain.xml file.</p> <pre><code>&lt;allow-http-request-headers-from domain="*" headers="*"/&gt; </code></pre>
5,042
<p>I understand the principle of why a heater block is used. Helping to reduce temperature variation as the filament is extruded using the heat capacity of the block.</p> <p>But I’m wondering why it takes the form it does? I imagine it is cuboid in shape just for convenience as it’s easy to machine?</p> <p>From a sur...
<p>Changing the <strong>flow rate</strong> during a print can <strong>not</strong> be saved. There simply is no way. It is usually meant to be a fix with filament inconsistencies or to look for the right extrusion factor for a new filament batch.</p> <h2>Slicer</h2> <p>The only way to consistently increase the flow rat...
<p>You should be able to add a global override to the flow percentage on Marlin firmware printers.</p> <p>Add this line somewhere in your start code:</p> <p><code>M221 S97 ; Flow Percentage hard set.</code></p> <p>In Cura, edit the printer's machine settings. The <code>S</code> is the percentage. In my case, 97 % works...
1,507
<p>The backstory: I'm installing a pigeon net in my home. Because of the shape of the opening I'm installing the net in and the material on the sides it's difficult to anchor the net using the normal means but I can print clips that will hold the net in place.</p> <p>The clips will be outside and will be exposed to th...
<p>Ok, I tried all 3 materials.</p> <p>PLA failed after less then one day, I believe it deformed from the constant pressure and fell out (I didn't find the part but I didn't really search for it, there's some tall grass below the window)</p> <p>ABS lasted about a year, it fell strait down and I found the part, it loo...
<p>What colour was your PLA? PLA will soften around 60C and a dark colour will easily get hotter than that in direct sun on a 30C day. Clear PLA seems to have much, much better temperature resistance, but any sort of PETG will kick it's butt in that regard.</p>
565
<p>OK, I am not sure if the title it completely accurate, open to suggestions!</p> <p>I am in the process of creating an ASP.NET custom control, this is something that is still relatively new to me, so please bear with me.</p> <p>I am thinking about the event model. Since we are not using Web Controls there are no ev...
<p>You might like to try this <a href="http://www.vim.org/scripts/script.php?script_id=1491" rel="noreferrer">improved Javascript syntax highlighter</a> rather than the one that ships with VIMRUNTIME.</p>
<p>For a quick and dirty fix, sometimes I just scroll up and down and the highlighting readjusts. <kbd>Ctrl</kbd>+<kbd>L</kbd> for a screen redraw can also fix it.</p>
8,327
<p>There are many different printing technologies. While it might be clear to the asker that he's talking about his home 3D printing machine, that's not necessarily the case for those that try to answer the question.</p> <p>I think it would help to specify the scope of questions with tags, to allow future visitors to ...
<p>No, there will be many questions which are more general in nature, and have little to do with the actual process used to produce the part.</p> <p>We should encourage tag use for process when appropriate, but I don't think making it mandatory will work in the long term.</p>
<p>No, there will be many questions which are more general in nature, and have little to do with the actual process used to produce the part.</p> <p>We should encourage tag use for process when appropriate, but I don't think making it mandatory will work in the long term.</p>
1
<p>Is there a good ruby gem for a WYSIWYG editor that will easily work with a rails app?</p>
<p>Though it's certainly not a direct answer, in the past I've found I prefer to use RedCloth (or a Markdown parser if you don't enjoy Textile) and use a simple textarea with an AJAXy preview. Generally speaking, WYSIWYG editors have a long history of creating redundant tags and similar, leading to potentially broken p...
<p>I'm really loving CKeditor gem. It's much, much more elegant than TinyMCE, especially if you deal with raw HTML. CKeditor displays on page--TinyMCE gives a popup. CKeditor allows access to things like all headings right out of the box, too. TinyMCE requires hacking.</p> <p>RedCloth's inability to support ALL HT...
4,420
<p>My main application for my 3D printer (Zortrax M200 Plus) is making 28 mm scale miniatures for role-playing games. Basically people and animals at 1:60 scale, which means that things like arms, legs, or weapons are only a few millimeters thick. If I use the automatically generated supports of the Z-Suite software, t...
<p>I see that you've already tried <a href="http://www.meshmixer.com/download.html" rel="nofollow noreferrer" title="Meshmixer - Free Download">Meshmixer</a> and didn't find it helpful, but I wanted to call out <a href="https://www.prusaprinters.org/how-to-create-custom-overhang-supports-in-meshmixer/" rel="nofollow no...
<p>I had good experience with the support interfaces from CURA. But reduce the thickness of the support interface to be just enough, that a smooth support interface top can be printed and set the top distance so that the model itself can be printed smooth and you can remove the interface easy enough. (I got good result...
897
<p>In a Flex <code>AdvancedDatGrid</code>, we're doing a lot of grouping. Most of the columns are the same for the parents and for the children, so I'd like to show the first value of the group as the summary rather than the MAX, MIN or AVG</p> <p>This code works on numerical but not textual values (without the comme...
<p>It looks like the summaryFunction has to return a number. According to the <a href="https://bugs.adobe.com/jira/browse/FLEXDOCS-431" rel="nofollow noreferrer">Adobe bug tracker</a>, it is a bug in the documentation:</p> <blockquote> <p>Comment from Sameer Bhatt:</p> <p>In the documentation it is mentioned th...
<p>It looks like the summaryFunction has to return a number. According to the <a href="https://bugs.adobe.com/jira/browse/FLEXDOCS-431" rel="nofollow noreferrer">Adobe bug tracker</a>, it is a bug in the documentation:</p> <blockquote> <p>Comment from Sameer Bhatt:</p> <p>In the documentation it is mentioned th...
9,134
<p>I have a .tag file that requires a JavaScript library (as in a .js file).</p> <p>Currently I am just remembering to import the .js file in every JSP that uses the tag but this is a bit cumbersome and prone to error.</p> <p>Is there a way to do the importing of the .js inside the JSP tag?</p> <p><em>(for caching r...
<p>There is no reason you cannot have a script tag in the body, even though it is preferable for it to be in the head. Just emit the script tag before you emit your tag's markup. The only thing to consider is that you do not want to include the script more than once if you use the jsp tag on the page more than once. T...
<p>Short of just including the js in every page automatically, I do not think so. It really would not be something that tags are designed to to.</p> <p>Without knowing what your tag is actually doing (presumably its its outputting something in the body section) then there is no way that it will be able to get at the h...
7,159
<p>I have an application that I would like to embed inside our companies CMS. The only way to do that (I am told), is to load it in an <code>&lt;iframe&gt;</code>.</p> <p>Easy: just set <code>height</code> and <code>width</code> to <code>100%</code>! Except, it doesn't work.</p> <p>I did find out about setting <code>...
<p>You could either just use a scripting language to include the page into the parent page, other wise, you might want to try one of these javascript methods:</p> <p><a href="http://brondsema.net/blog/index.php/2007/06/06/100_height_iframe" rel="nofollow noreferrer">http://brondsema.net/blog/index.php/2007/06/06/100_h...
<p>I might be missing something here, but adding <code>scrolling=no</code> as an attribute to the <code>iframe</code> tag normally gets rid of the scrollbars.</p>
8,291