instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>I have a Prusa i3 made by Geeetech. My 3D prints keep suffering from warping when printing with PLA.</p> <p>Whenever I print something with a base at about 10 cm x 10 cm, at least one corner of the print would warp up. I've read numerous articles about warping and tried all sorts of methods. My printer's bed is lev...
<p>For ABS it will warp unless you build a heat chamber. </p> <p>That said the tricks to reduce warping come down to: </p> <ol> <li>Material, i.e. PLA is less likely to warp; </li> <li>Use a fan, it helps so much; </li> <li>Make sure you have temps calibrated well - Too hot is more warp; </li> <li>Use a raft. The Mak...
<p>Source (at least in part): </p> <ul> <li><a href="http://books.google.co.uk/books?id=MJqoBQAAQBAJ&amp;pg=RA10-PA6" rel="nofollow noreferrer">SolidWorks 2015 Tutorial with Video Instruction, page 11-6</a>, and;</li> <li><a href="https://www.makerbot.com/media-center/2011/06/23/12-ways-to-fight-warping-and-curling" r...
510
<p>Having briefly looked at Haskell recently, what would be a <em>brief, succinct, practical</em> explanation as to what a monad essentially is?</p> <p>I have found most explanations I've come across to be fairly inaccessible and lacking in practical detail.</p>
<p>First: The term <strong>monad</strong> is a bit vacuous if you are not a mathematician. An alternative term is <strong>computation builder</strong> which is a bit more descriptive of what they are actually useful for.</p> <p>They are a pattern for chaining operations. It looks a bit like method chaining in object-or...
<h2>Explanation</h2> <p>It's quite simple, when explained in C#/Java terms:</p> <ol> <li><p>A monad is a function that takes arguments and returns a special type. </p></li> <li><p>The special type that this monad returns is <strong>also</strong> called monad. (A monad is a combination of #1 and #2)</p></li> <li><p>Th...
6,675
<p>My Anet A8 suddenly had issues with being unable to heat the bed. After ruling out software issues, I disconnected the connector and found this (sorry for the terrible quality):</p> <p><a href="https://i.stack.imgur.com/7WYfE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7WYfE.jpg" alt="Faulty ...
<p>Owning an Anet A8 I confirm that the connectors are not rated for the amount of current that pass through them. <strong>You do not need a new bed unless the heat element has burned through</strong> (but that is pretty uncommon, it usually is the connector). This burning of the bed connectors is a very well known pro...
<h1>New Bed (Connection)</h1> <p>You will at least need a new female connector, but as the connector burnt, you have some underlying problem that made the connector burn in the first place: either the board is sending bad signals to the bed, or the bed is not rated for the board or you <em>just</em> had a faulty connec...
1,147
<p>Here is the problem I have:</p> <p>I have a lot (tens of thousands) of mp3 files that my users would like to be able to search. Is there is software out there that you've used or heard good things about that would allow me to index that content and put it in a database so I can search on it later?</p>
<p>I've heard very good reviews of <a href="http://www.nuance.co.uk/naturallyspeaking/" rel="nofollow noreferrer" title="Dragon Naturally Speaking">Dragon Naturally Speaking</a>, by Nuance. They offer a <a href="http://www.nuance.com/naturallyspeaking/products/sdk.asp" rel="nofollow noreferrer">software development kit...
<p>I've heard very good reviews of <a href="http://www.nuance.co.uk/naturallyspeaking/" rel="nofollow noreferrer" title="Dragon Naturally Speaking">Dragon Naturally Speaking</a>, by Nuance. They offer a <a href="http://www.nuance.com/naturallyspeaking/products/sdk.asp" rel="nofollow noreferrer">software development kit...
9,799
<p>This one has been bugging me for a while now.</p> <p>Is there a way I can stop Intellj IDEA from reporting missing keys in tags?</p> <p>My messages are not stored in property files so the issue does not apply in my case.</p> <p>I'm using IntelliJ IDEA 7.0.4</p>
<p>I <a href="http://jetbrains.net/jira/browse/IDEADEV-30407" rel="nofollow noreferrer">reported this as an issue</a> to JetBrains and according to their issue report this is fixed in "Diana 8858". AFICT that means this will be fixed in IDEA 8.0.</p>
<p>IMHO you can disable every hint or error marker in IDEA. Please tell us the version of IDEA that you use.</p>
8,994
<p>After I level my Ender 3, the distance between the nozzle and the bed seems fine on both ends, but moving the bed on the Y axis shows that it's increasing and decreasing for three times, which I just cant fix.</p> <p>This only occurs on the left side - the right side is constant from beginning to end. Also I've bee...
<p>Your video shows that your bed seems warped somewhat.</p> <h2>Ammount of error</h2> <p>As I assume you did level the bed with a sheet of paper to be 0.1 mm thick, we can estimate the change of thickness. The thickest point seems to be 0.2 mm, the thinnest 0.05. that's in average an error of 0.075 mm for the first la...
<p>Blue Painters tape on the left side starting at the center and leaving a band on the far left side and the rear Perfetto side. I checked the before and after and the thickness of the tape shimmed out the deflection on the plate. It sounds like whatever the use to stamp the steel out is creating the bend we are only ...
1,202
<p>Trying to avoid the .net WebBrowser control (I don't need to navigate to a url, print rendered html or any of the other inbuilt goodies). Wrapping the IE dll seems a bit heavyweight.</p> <p>I simply require something that can display basic html marked up text - an html equivalent of <a href="http://msdn.microsoft....
<p>I developed this <a href="http://www.modeltext.com/html/" rel="noreferrer">HTML control for .NET</a>, which does what you were asking: i.e. display basic html marked up text.</p> <p>It doesn't use IE or any other unmanaged code (except for the .NET framework itself).</p>
<p>While it takes a bit of effort, you can disable almost all of the 'extra' functionality of the built in WebBrowser control.</p> <p>If the built in web browser provides all the functionality you need why look elsewhere?</p>
3,851
<p>I work on an application that uses DCOM to communicate between what are essentially several peers; in the course of normal use, instances on separate machines serve a variety of objects to one another. Historically, for this to work we have used some magic incantations, chief among which is that on every machine th...
<p><em>Programming Windows Security</em> by Keith Brown includes a thorough discussion of DCOM security. I can highly recommend this book.</p>
<p>You could also try to round up a copy of <em>Inside Distributed COM</em> by Guy and Henry Eddon (Microsoft Press) - It is out of print but amazon shows a number of used copies for sale:</p> <p><a href="https://rads.stackoverflow.com/amzn/click/com/157231849X" rel="nofollow noreferrer" rel="nofollow noreferrer">http...
7,229
<p>I want to write an <code>onClick</code> event which submits a form several times, iterating through selected items in a multi-select field, submitting once for each. </p> <p><strong>How do I code the loop?</strong></p> <p>I'm working in Ruby on Rails and using <code>remote_function()</code> to generate the JavaSc...
<p>My quick answer (as I've not coded it yet) would be to create another function that creates a POST using XMLHTTPRequest and the specific parameters for a single call. Then inside your onClick() handler call that function as you loop through your selected items.</p> <p>I would suggest that you do a Proof of Concept ...
<p>Unless you're modifying the browser DOM, I can't think of a reason that you would want to do this. (But without knowing fully what you're trying to do, I could be wrong in this case =)</p> <p>You should be able to send back data from mulitple objects (even nested complex objects in your form) in just one POST.</p> ...
8,656
<p>I'm writing an Emacs major mode for an APL dialect I use at work. I've gotten basic font locking to work, and after setting comment-start and comment-start-skip, comment/uncomment region and fill paragraph also work.</p> <p>However, comment blocks often contain javadoc style comments and i would like fill-paragraph...
<p>The problem was that the paragraph-start regexp has to match the entire line to work, including the actual comment character. The following elisp works for the example I gave:</p> <pre><code>(setq paragraph-start "^\\s-*\\#\\s-*\\\\\\(arg\\|ret\\).*$") </code></pre> <p>Here a page that has an example regexp for ph...
<p>There's other modes that have less complex functions used for <code>fill-paragraph-function</code>. Browsing through my install, it looks like the ones in ada-mode and make-mode are good examples.</p>
9,734
<p>I'm a bit confused here. Microsoft as far as I can tell claims that parametrization is the best way to protect your database from SQL injection attacks. But I find two conflicting sources of information here:</p> <p><a href="http://support.microsoft.com/kb/200190" rel="nofollow noreferrer">This page</a> says to u...
<p>I could be wrong here, but I think this just means that someone could use the Command object to do bad things. I.e. it's not to be trusted if someone else is scripting it.</p> <p>See <a href="http://www.avdf.com/mar97/art_interface.html" rel="nofollow noreferrer">safe for scripting</a> in this article. Every inst...
<p>I think "safe for scripting" means "safe to be run from a webpage we just retrieved from some Nigerian prince". The command object should be safe to run on the server.</p> <p>At work though, back in the day my colleagues didn't trust it so we had an in-house framework that basically did the same thing.</p>
8,180
<p>I have a couple of questions regarding VBScript and ASP Classic:</p> <ol> <li><p>What is the preferred way to access an MS SQL Server database in VBScript/ASP?</p></li> <li><p>What are best practices in regards to separating model from view from controller?</p></li> <li><p>Any other things I should know about eithe...
<p>ADO is an excellent way to access a database in VBScript/Classic ASP.</p> <pre><code>Dim db: Set db = Server.CreateObject("ADODB.Connection") db.Open "yourconnectionstring -&gt; see connectionstrings.com" Dim rs: Set rs = db.Execute("SELECT firstName from Employees") While Not rs.EOF Response.Write rs("firstNam...
<p>way way back in the day when VBScript/ASP were still ok I worked in a utility company with a very mixed DB envrionment, I used to swear by this website: <a href="http://www.connectionstrings.com/" rel="nofollow noreferrer">http://www.connectionstrings.com/</a></p> <p>@michealpryor got it right</p>
4,572
<p>I'm running MAMP 1.7.2 on a Mac and I'd like to install the extension php_gd2. How do I do this? I know that on Windows using WAMP I'd simply select the <code>php_gd2</code> entry in the extensions menu to activate it. How is it done when using MAMP? I know that I can do it using MacPorts but I'd prefer not to ma...
<p>You shouldn't need to install the extension. I have 1.7.2 installed and running right now and it has GD bundled (2.0.34 compatible).</p> <p>From the MAMP start page, click on phpinfo and you should see a GD section.</p>
<p>php.ini for MAMP 1.7.2 is located: if using <strong>php5</strong>, here: <strong>/Applications/MAMP/conf/php5/php.ini</strong> if <strong>php4</strong>, here: <strong>/Applications/MAMP/conf/php4/php.ini</strong></p> <p>hope that helps...</p>
4,698
<p>I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore.</p> <p>Example:</p> <pre><code>input : 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] </code></pre> <...
<pre><code>var str = 'foo bar "lorem ipsum" baz'; var results = str.match(/("[^"]+"|[^"\s]+)/g); </code></pre> <p>... returns the array you're looking for.<br> Note, however:</p> <ul> <li>Bounding quotes are included, so can be removed with <code>replace(/^"([^"]+)"$/,"$1")</code> on the results.</li> <li>Spaces be...
<p>One that's easy to understand and a general solution. Works for all delimiters and 'join' characters. Also supports 'joined' words that are more than two words in length.... ie lists like </p> <p><code>"hello my name is 'jon delaware smith fred' I have a 'long name'"</code>....</p> <p>A bit like the answer by AC b...
9,057
<p>I'd like to be able to see what registry keys are used for. A book on the registry would be fine as well. Info on Windows Vista changes would be great!</p>
<p>Oh, how I wish there was a single site where the registry was collectively documented by all who write values there! Keep in mind, any app can create its own set of registry keys and values, so it's not just MS who would be necessary to such an effort. Though they would be a key player!</p> <p>In the meantime, ther...
<p>I have used <a href="http://www.majorgeeks.com/Mystery_Behind_Windows_Registry_d415.html" rel="nofollow noreferrer">this help file</a> in the past. Very good resource</p>
8,230
<p>VC++ makes functions which are implemented within the class declaration inline functions.</p> <p>If I declare a class <code>Foo</code> as follows, then are the CONSTRUCTOR and DESTRUCTOR inline functions?</p> <pre><code>class Foo { int* p; public: Foo() { p = new char[0x00100000]; } ~Foo() { delete []...
<p>Defining the body of the constructor INSIDE the class has the same effect as placing the function OUTSIDE the class with the &quot;inline&quot; keyword.</p> <p>In both cases it's a hint to the compiler. An &quot;inline&quot; function doesn't necessarily mean the function will be inlined. That depends on the complexi...
<p>To the same extent that we can make any other function inline, yes.</p>
4,154
<p>I get the following error when building my Windows Forms solution: </p> <blockquote> <p>"LC.exe" exited with code -1</p> </blockquote> <p>I use two commercial Windows Forms Libraries: Infragistics and the Gantt-Control from plexityhide.com, that's why I have licenses.licx files in my WinForms Projects. We also u...
<p>Problem mainly arises due to license file. Exclude the file <code>licenses.licx</code> from your project</p>
<p>There should be a <code>license.licx</code> file in the properties folder when you use commercial components. It is often corrupted. If you clean its contents, the <code>"LC.EXE" exited with code -1</code> disappears.</p>
5,446
<p>I have a BLTouch clone (3DTouch) on my printer (Artillery Sidewinder X1). I installed it on the printer ages ago and has been working fine since. Recently, I did a BTT smart filament sensor upgrade.</p> <p>I updated and edited both the Marlin firmware and the MKS TFT28 screen firmware to get it to work with the smar...
<p>So I discovered that the fade height must have been set to something really off.</p> <p>I didn't know this at the time so I thought I should set the fade height to the default 10 mm just to make sure nothing was wrong and tested it. The printer now levels and compensates perfectly!</p>
<p>Make sure <code>RESTORE_LEVELING_AFTER_G28</code> is uncommented in <code>configuration.h</code>.</p>
1,941
<p>This is a php example, but an algorithm for any language would do. What I specifically want to do is bubble up the United States and Canada to the top of the list. Here is an example of the array shortened for brevity. </p> <pre><code>array( 0 =&gt; '-- SELECT --', 1 =&gt; 'Afghanistan', 2 =&gt; 'Albania', ...
<p>What I usually do in these situations is to add a separate field called DisplayOrder or something similar. Everything defaults to, say, 1... You then sort by DisplayOrder and then the Name. If you want something higher or lower on the list, you can tweak the display order accordingly while keeping your normal IDs...
<p>You can not change the order of elements within the same array by "moving" an item around. What you can do it to build a new array that first has your favourite items and then adds anything else from the original countries array at the end:</p> <pre><code>$countries = array( 0 =&gt; '-- SELECT --', 1 =&gt; 'Afg...
6,600
<p>Whilst starting to learn lisp, I've come across the term <em>tail-recursive</em>. What does it mean exactly?</p>
<p>Consider a simple function that adds the first N natural numbers. (e.g. <code>sum(5) = 0 + 1 + 2 + 3 + 4 + 5 = 15</code>).</p> <p>Here is a simple JavaScript implementation that uses recursion:</p> <pre class="lang-js prettyprint-override"><code>function recsum(x) { if (x === 0) { return 0; } else { ...
<p>This question has a lot of great answers... but I cannot help but chime in with an alternative take on how to define "tail recursion", or at least "proper tail recursion." Namely: should one look at it as a property of a particular expression in a program? Or should one look at it as a property of an <em>implementat...
5,405
<p>Are there any good references for synchronisation algorithms?</p> <p>I'm interested in algorithms that synchronize the following kinds of data between multiple users:</p> <ul> <li>Calendars</li> <li>Documents</li> <li>Lists and outlines</li> </ul> <p>I'm not just looking for synchronization of contents of directo...
<p>There's a high-level and very broad overview of all synchronisation algorithms in <em><a href="http://www.ece.cmu.edu/~ece845/docs/optimistic-data-rep.pdf" rel="nofollow noreferrer">Optimistic Replication</a></em> (by Yasushi Saito and Marc Shapiro, <a href="http://en.wikipedia.org/wiki/Portable_Document_Format" re...
<p>I would have thought that looking at any of the open-source source code control applications would give you the right idea - merging changes between files is exactly what they do...</p>
8,414
<p>In a web application like wiki or forums or blogging software, it is often useful to store your data in a relational database. Since many hosting companies offer a single database with their hosting plans (with additional databases costing extra) it is very useful for your users when your database objects (tables, v...
<p>I've now researched what it takes to do this in both Entity Framework and LINQ to SQL and <a href="http://theruntime.com/blogs/jacob/archive/2008/08/27/changing-table-names-in-an-orm.aspx" rel="nofollow noreferrer">documented the steps required in each</a>. It's much longer than answers here tend to be so I'll be co...
<p><a href="https://www.mindscape.co.nz/products/LightSpeed/default.aspx" rel="nofollow noreferrer">LightSpeed</a> allows you to specify an <em>INamingStrategy</em> that lets you resolve table names dynamically at runtime.</p>
3,283
<p>We have been developing an Outlook Add-in using Visual Studio 2008. However I am facing a strange behavior while adding a command button to a custom command bar. This behavior is reflected when we add the button in the reply, reply all and forward windows. The issue is that the caption of the command button is not v...
<p>I don't know the answer to your question, but I would highly recommend Add-In Express for doing the addin. See <a href="http://www.add-in-express.com/add-in-net/" rel="nofollow noreferrer">http://www.add-in-express.com/add-in-net/</a>. I've used this in many projects, including some commercial software and it is com...
<p>I don't know, but your code raises two questions:</p> <ol> <li><p>Why are you declaring "CommandBarControl myCommandbarButton" instead of "CommandBarButton myCommandbarButton"?</p></li> <li><p>Why are you setting the width to 900 pixels? That's huge. I never bother with this setting in Excel since it autosizes, and...
4,387
<p>I am running into an issue I had before; can't find my reference on how to solve it.</p> <p>Here is the issue. We encrypt the connection strings section in the app.config for our client application using code below:</p> <pre><code> config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.No...
<p>I found a more elegant solution that in my original answer to myself. I found if I just logged in as th euser who orignally installed the application and caused the config file connectionstrings to be encrypted and go to the .net framework directory in a commadn prompt and run </p> <pre><code>aspnet_regiis -pa "Net...
<p>Sounds like a permissions issue. The (new) user in question has write permissions to the app.config file? Was the previous user a local admin or power user that could have masked this problem? </p>
6,349
<p>I just saw this mentioned in Stack Overflow question <em><a href="http://web.archive.org/web/20090503103538/http://stackoverflow.com:80/questions/7975/best-css-editor" rel="nofollow noreferrer">Best WYSIWYG CSS editor</a></em> and didn't know it could be done. I'm a Visual Studio newbie, so how do you do it?</p> <p>...
<p>I prefer using <a href="http://en.wikipedia.org/wiki/Firebug_%28software%29" rel="nofollow noreferrer">Firebug</a> for projects I can't use <a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_2008" rel="nofollow noreferrer">Visual&nbsp;Studio&nbsp;2008</a> on.</p>
<p>In Internet&nbsp;Explorer, select <em>View</em> -> <em>Script Debugger</em> -> <em>Open</em>. That should do it.</p>
2,981
<p>Given the code bellow, how do I style the radio buttons to be next to the labels and style the label of the selected radio button differently than the other labels?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-c...
<p>The first part of your question can be solved with just HTML &amp; CSS; you'll need to use Javascript for the second part.</p> <h3>Getting the Label Near the Radio Button</h3> <p>I'm not sure what you mean by "next to": on the same line and near, or on separate lines? If you want all of the radio buttons on the sa...
<p>This will get your buttons and labels next to each other, at least. I believe the second part can't be done in css alone, and will need javascript. I found a page that might help you with that part as well, but I don't have time right now to try it out: <a href="http://www.webmasterworld.com/forum83/6942.htm" rel=...
6,524
<p>In the WCF application that I am working on, I need to access the generated source of a particular webpage (after all the AJAX calls on the page are made).</p> <p>I have tried using <code>System.Net.WebRequest</code> but it just brings me back the original source of the page. Is there a way to execute a page and th...
<p>You could use Javascript to traverse and pass the DOM than make a call into your WCF service from the Javascript when all the Ajax calls are complete. If you are after the data that is stored on the page after all the Ajax calls I would re-think your implementation...</p> <p>Petar</p>
<p>Well, WCF is designed to be consumed by non-browsers, so there really is no way to expect that a WCF response can contain Javascript that will be automatically executed by the client.</p>
9,611
<p>I have a weird bug involving Flash text and hyperlinks, htmlText in a TextField with <code>&lt;a&gt;</code> tags seem to truncate surrounding space:</p> <p><a href="https://i.stack.imgur.com/FDA7a.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FDA7a.gif" alt="output"></a></p> <p>Once I place my...
<p>Make sure you styleSheet declares what it is supposed to do with Anchors. You are obviously using htmlText if your using CSS so soon as it sees &lt; in front of "a href" it immedietly looks for the CSS class definition for a and when it doesn't find one, the result is the different looking text you see.</p> <p>Add...
<p>Does it make any difference if you put non-breaking spaces immediately before and after the anchor element?</p> <pre><code>&lt;p&gt; ... &amp;nbsp;&lt;a ... &gt;Link text&lt;/a&gt;&amp;nbsp; ... &lt;/p&gt; </code></pre> <p>Admittedly a workaround at best but it might buy you some time to research a real solution.<...
7,263
<p>I am using the code snippet below, however it's not working quite as I understand it should. </p> <pre><code>public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line; try { line = br.readLine(); while(line != null)...
<blockquote> <p>From my understanding of this, readLine should return null the first time no input is entered other than a line termination, like '\r'.</p> </blockquote> <p>That is not correct. <code>readLine</code> will return <code>null</code> if the end of the stream is reached. That is, for example, if you are r...
<p>There's a nice <a href="http://commons.apache.org/lang/" rel="nofollow noreferrer">apache commons lang</a> library which has a good api for common :) actions. You could use statically import StringUtils and use its method isNotEmpty(String ) to get:</p> <pre><code>while(isNotEmpty(line)) { System.out.println(li...
4,467
<p>In most C or C++ environments, there is a "debug" mode and a "release" mode compilation.<br> Looking at the difference between the two, you find that the debug mode adds the debug symbols (often the -g option on lots of compilers) but it also disables most optimizations.<br> In "release" mode, you usually have all s...
<p>Without any optimization on, the flow through your code is linear. If you are on line 5 and single step, you step to line 6. With optimization on, you can get instruction re-ordering, loop unrolling and all sorts of optimizations.<br> For example:</p> <pre><code> void foo() { 1: int i; 2: for(i = 0; i &lt 2; ) ...
<p>If you're debugging at the instruction level rather than the source level, it's an awful lot for you easier to map unoptimized instructions back to the source. Also, compilers are occasionally buggy in their optimizers.</p> <p>In the Windows division at Microsoft, all release binaries are built with debugging symbo...
9,465
<p>I've read in several places that the rectangle functions in emacs are very useful. I've read a bit about them, and I can't quite figure why. I mean, when you want to kill a paragraph, you mark the first row/column and then the last one, and that's actually a rectangle, right? But you can still use the normal kill.....
<p>If you have data in columns in a text file with <code>M-x delete-rectangle</code> or <code>M-x kill-rectangle</code> you can delete a single column of data. Similarly, <code>M-x yank-rectangle</code> will paste in a column of text.</p> <p>For example, take the following text:</p> <pre><code>1. alligator alphor...
<p>In emacs24+ there's also function for numbering lines:</p> <pre><code>(rectangle-number-lines START END START-AT &amp;optional FORMAT) Insert numbers in front of the region-rectangle. START-AT, if non-nil, should be a number from which to begin counting. FORMAT, if non-nil, should be a format string to pass to `...
8,331
<p>I get the following error message in SQL Server 2005:</p> <pre><code>User '&lt;username&gt;' does not have permission to run DBCC DBREINDEX for object '&lt;table&gt;'. </code></pre> <p>Which minimum role do I have to give to user in order to run the command?</p>
<p>You will need to be a member of the <strong>db_ddladmin</strong> or the <strong>db_owner</strong> role AFAIK</p>
<blockquote> <p>Caller must own the table, or be a member of the sysadmin fixed server role, the db_owner fixed database role, or the db_ddladmin fixed database role.</p> </blockquote> <p><a href="http://msdn.microsoft.com/en-us/library/ms181671(SQL.90).aspx" rel="nofollow noreferrer">DBCC DBREINDEX (Transact-SQL) @...
8,077
<p>After answering on <a href="https://stackoverflow.com/questions/45650/common-files-in-visual-studio-solution#45664">this question</a> I thought it would be nice to collect some tips &amp; tricks for working with MSVS solutions and projects. </p> <p>Here is my list: </p> <ul> <li><p>How to avoid saving new projec...
<p>First rule of working with Visual Studio:</p> <ul> <li><strong>Install <a href="http://www.jetbrains.com/resharper/" rel="noreferrer">ReSharper</a></strong></li> </ul>
<p>I have a tip regarding the "Track Active Item" option mentioned above, for when working with big projects. It's posted here:</p> <p><a href="https://stackoverflow.com/questions/31163/forcing-the-solution-explorer-to-select-the-file-in-the-editor-in-visual-studio#46193">Forcing the Solution Explorer to select the fi...
6,793
<p>I'm getting this printing where it's not laying the plastic down very well. What could be causing this? I've printed with these settings before, and it turned out just fine. If you need any other info to properly diagnose this, let me know.</p> <p>I'm using a Robo3D R1+</p> <p>[<img src="https://i.stack.imgur.com/...
<p>I´ve seen this in my Prusa due two parameters that may vary your results depending on climate if your printer has not a temperature chamber or having a mechanical issue too.</p> <p>Lack of extrusion is due a cold filament which it can't reach the melting temperature due a fast extrusion feed; I mean in normal condi...
<p>I had this problem also. After a few hours of troubleshooting and changing the extruder temp, printing speed, layer height, and infill density. I realized that I had set the PLA diameter at 2.85 mm when it was 1.75 mm. Changing that fixed all my problems.</p>
680
<p>Are PHP variables passed by value or by reference?</p>
<p>It's by value according to the <a href="http://php.net/manual/en/functions.arguments.php" rel="noreferrer">PHP Documentation</a>.</p> <blockquote> <p>By default, function arguments are passed by value (so that if the value of the argument within the function is changed, it does not get changed outside of the func...
<p>Depends on the version, 4 is by value, 5 is by reference.</p>
2,331
<p>I have an internal enterprise app that currently consumes 10 different web services. They're consumed via old style "Web References" instead of using WCF.</p> <p>The problem I'm having is trying to work with the other teams in the company who are authoring the services I'm consuming. I found I needed to capture the...
<p>This seems to be a common question, as I just asked it and was told to look <a href="https://stackoverflow.com/questions/300674/getting-raw-soap-data-from-a-web-reference-client-running-in-aspnet">here</a>.</p> <p>You don't have to edit the generated <code>Reference.cs</code>. You can reference the extension in yo...
<p>I used the following code is an example of how I captured SOAP requests in a application written a while back.</p> <pre><code>&lt;System.Diagnostics.Conditional("DEBUG")&gt; _ Private Sub CheckHTTPRequest(ByVal functionName As String) Dim e As New UTF8Encoding() Dim bytes As Long = Me.Context.R...
7,782
<p>I've googled around for this, but I still have trouble relating to what Django defines as "apps". </p> <p>Should I create a new app for each piece of functionality in a site, even though it uses models from the main project? </p> <p>Do you guys have good rule of thumb of when to split off a new app, and when to ke...
<p>James Bennett has a wonderful <a href="http://www.b-list.org/weblog/2008/mar/15/slides/" rel="noreferrer">set of slides</a> on how to organize reusable apps in Django.</p>
<p>An 'app' could be many different things, it all really comes down to taste. For example, let's say you are building a blog. Your app could be the entire blog, or you could have an 'admin' app, a 'site' app for all of the public views, an 'rss' app, a 'services' app so developers can interface with the blog in their ...
8,976
<p>I maintain an old PC-only application written in Delphi 7. Although Delphi has served me very well in the past I now only use it for this one application and find my skills with the language diminishing. Its syntax is too different from my 'day job' languages of Java/Ruby so it takes me longer to get into the groove...
<p>I am not aware of any automated tools for making that conversion. Personally I would suggest you stick with Delphi, maybe just upgrade to a new version. I have seen a couple code DOM's that attempt to convert from Delphi to C#, but that doesn't address the library issue. </p> <p>CodeGear (formally Borland) has a...
<blockquote> <p>Many of my users are moving to Vista which may run the app in compatibility mode or may have GPF problems depending on how their PC is configured by their IT department, so I have to do some maintenance on the application. I'm wondering if I should jump to a more familiar stack.</p> </bl...
8,418
<p>Is there any way to capture the MouseDown even from the .NET 2.0 TextBox control? I know the inherited Control class has the event, but it's not exposed in TextBox. Is there a way to override the event handler?</p> <p>I also tried the OpenNETCF TextBox2 control which does have the MouseDown event exposed, but no ma...
<p>I know this answer is way late, but hopefully it ends up being useful for someone who finds this. Also, I didn't entirely come up with it myself. I believe I originally found most of the info on the OpenNETCF boards, but what is typed below is extracted from one of my applications.</p> <p>You can get a mousedown ev...
<p>According to the .Net Framework, the <a href="http://www.csharpfriends.com/quickstart/aspplus/samples/classbrowser/cs/classbrowser.aspx?assembly=System.Windows.Forms,%20Version=1.0.5000.0,%20Culture=neutral,%20PublicKeyToken=b77a5c561934e089&amp;namespace=System.Windows.Forms&amp;class=TextBox" rel="nofollow norefer...
2,932
<p>Graphics and audio editing and processing software often contain functions called "High-Pass Filter" and "Low-Pass Filter". Exactly what do these do, and what are the algorithms for implementing them?</p>
<p>Wikipedia:</p> <ul> <li><a href="http://en.wikipedia.org/wiki/High-pass_filter" rel="noreferrer">High-pass filter</a></li> <li><a href="http://en.wikipedia.org/wiki/Low-pass_filter" rel="noreferrer">Low-pass filter</a></li> <li><a href="http://en.wikipedia.org/wiki/Band-pass_filter" rel="noreferrer">Band-pass filte...
<p>They are generally Electrical circuits that tend to pass parts of analog signals. High pass tends to transmit more of the high frequency parts and low pass tends to pass more of the low frequency parts.</p> <p>They can be simulated in software. A walking average can act as a low pass filter for instance and the dif...
5,604
<p>I need to select data when a page is viewed and update the 'views' column is there a way to do this in one query, or do I have to use to distinct queries?</p>
<p>If you do not want/need to use a transaction, you could create a stored procedure that first updates the view count and then selects the values and return them to the user.</p>
<p>PostgreSQL's <a href="http://www.postgresql.org/docs/8.3/static/sql-update.html" rel="nofollow noreferrer">UPDATE</a> statement has the RETURNING clause that will return a result set like a SELECT statement:</p> <pre><code>UPDATE mytable SET views = 5 WHERE id = 16 RETURNING id, views, othercolumn; </code></pre>...
6,525
<blockquote> <p>HyperTerminal is a program that you can use to connect to other computers, Telnet sites, bulletin board systems (BBSs), online services, and host computers, using either your modem, a null modem cable or Ethernet connection.</p> </blockquote> <p>But My main usage of Hyperterminal is to comm...
<p>Here are two:</p> <p><a href="http://hp.vector.co.jp/authors/VA002416/teraterm.html" rel="nofollow noreferrer">Tera Term</a></p> <blockquote> <p>Tera Term (Pro) is a free software terminal emulator (communication program) for MS-Windows. It supports VT100 emulation, telnet connection, serial port connection, and...
<p>Here is a better tool specificaly designed to test serial devices: <a href="http://www.caerustech.com/UDT.php" rel="nofollow noreferrer">http://www.caerustech.com/UDT.php</a> . You can save settings and commands for various devices - I use it often at work.</p>
8,586
<p>Alright, currently I have my SWF hitting a php file that will go and find all the files I specify to it, add their sizes together and return their combined sizes as one number. I then use this number with a ProgressEvent listener to determine the current percentage of files downloading for that particular section of...
<p>You could do an HTTP HEAD request to the server for the files. This will return the header info (including file size) but not the actual file. You could then make a GET request to load the files.</p> <p><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html" rel="nofollow noreferrer">http://www.w3.org/Proto...
<p>If it's absolutely necessary to control how the files are loaded, then I believe Mike Chambers' suggestion to make an HTTP HEAD request is the way to go.</p> <p>However, unless there's a good reason not to, I'd simply begin loading all the files at once and get my file sizes from each file's getBytesTotal method. S...
9,309
<p>I have a coworker who writes unit tests for objects which fill their fields with random data. His reason is that it gives a wider range of testing, since it will test a lot of different values, whereas a normal test only uses a single static value.</p> <p>I've given him a number of different reasons against this, t...
<p>There's a compromise. Your coworker is actually onto something, but I think he's doing it wrong. I'm not sure that totally random testing is very useful, but it's certainly not invalid.</p> <p>A program (or unit) specification is a hypothesis that there exists some program that meets it. The program itself is then ...
<p>How can your guy run the test again when it has failed to see if he has fixed it? I.e. he loses repeatability of tests.</p> <p>While I think there is probably some value in flinging a load of random data at tests, as mentioned in other replies it falls more under the heading of load testing than anything else. It i...
5,239
<p>I have seen mechanical (micro switch), optical and magnetic(magnet + hall sensor) end stops.</p> <p>Are there any differences in how exact they switch at the right location? If so which are the most precise?</p>
<p>There are some different criteria that we should use to select a switch type:</p> <ul> <li>Precision / repeatability: does the switch trigger at the same place every time? How much spread is there in the trigger position? Do environmental changes or machine setting changes affect the trigger position?</li> <li>Cont...
<p>A separate issue not addressed in other answers is that the end stops for X/Y axes have different requirements than those for the Z axis.</p> <h3>X/Y Axes</h3> <p>When the printer offers XYZ calibration (like Prusa i3 MK2), the properties of the X and Y switches play a role, since for the Z probing the probe should ...
278
<p>I'm trying to find a way of finding out who is downloading what image from an image gallery. Users can download using a button beside the thumbnail or right click and use the "save link as" Is it possible to relate a user session or ID to a "save link as" action from all browsers using either PHP or JavaScript.</p>
<p>Yes, my preferred way of doing this would be via PHP. You'd have to set up a script which would load up the file and send it to the user browser. This script would also be able to log the download somewhere (e.g. your database).</p> <p>For example - in very rough pseudo-code:</p> <p>download.php</p> <pre><code>$f...
<p>You need a gateway script, like ImageDownload.php?picture=me.jpg, or something like that.</p> <p>That page whould return the image bytes, as well as logging that the image is downloaded.</p>
9,603
<p>I administrate several Oracle Apps environment, and currently check profile options in lots of environments by loading up forms in each environment, and manually checking each variable, which requires a lot of time.</p> <p>Is there a snippet of code which will list profile options and at what level and who they are...
<p>You'll want to query <code>APPLSYS.FND_PROFILE_OPTIONS</code> and <code>FND_PROFILE_OPTION_VALUES</code>. For a comprehensive script that you can pick up the SQL from, look here: <a href="http://tipsnscripts.com/?p=16" rel="nofollow noreferrer">http://tipsnscripts.com/?p=16</a></p>
<p>Armed with the knowledge of which tables to get (thanks Sten) and a bit of judicious editing, I have come up with a query which serves my needs:</p> <pre><code>SELECT SUBSTR(e.profile_option_name,1,30) PROFILE, DECODE(a.level_id,10001,'Site',10002,'Application',10003,'Responsibility',10004,'User') L, DECODE...
9,618
<p>I'm a web developer, and I want to make the web sites I develop more accessible to those using screen readers. What limitations do screen readers have that I should be most aware of, and what can I do to avoid hitting these limitations.</p> <p>This question was sparked by reading another question about <a href="ht...
<blockquote> <p>Are screen readers really so primitive that they would read text that isn't even displayed on the screen?</p> </blockquote> <p>What you have to remember is that any HTML parser doesn't read the screen - it reads the source markup. Whta you see on the screen is the browser's attempt to apply CSS to th...
<p>Have a look at <a href="http://www.w3.org/WAI/" rel="nofollow noreferrer">ARIA</a>, it's a standard for developing accessible rich-web-client applications.</p>
4,651
<p>On my Monoprice Mini Select v2 there is poor adhesion when the print head goes to put down a new layer on the bed as seen in the photo. Does anyone have a fix for this?</p> <p><a href="https://i.stack.imgur.com/NVbXE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NVbXE.jpg" alt="enter image desc...
<p>You could try a higher bed temp, but also check to make sure bed is levelled all round as this can sometimes cause this to happen </p>
<p>Things you need to check or do: </p> <ol> <li>Use adhesion layers </li> <li>Set lower speeds at first layer.</li> <li>Increase bed temperature (try 5 degrees steps)</li> <li>Clean the bed</li> <li>Check if the bed is completely leveled up. </li> <li>Increase the thickness of the first layer. </li> </ol>
1,634
<p>I have a "numeric textbox" in C# .NET which is nothing more than a derivation of Textbox, with some added logic to prevent the user entering anything non-numeric. As part of this, I have added a Value property of type <code>double?</code> (or <code>Nullable&lt;double&gt;</code>). It's nullable to support the case wh...
<p>Or, if you don't want the designer adding any code at all... add this to the Property.</p> <pre><code>[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] </code></pre>
<p>Could it help to setting the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.defaultvalueattribute(VS.80).aspx" rel="nofollow noreferrer">DefaultValue attribute</a> on that property to new Nullable(1)?</p> <pre><code>[DefaultValue(new Nullable&lt;double&gt;(1))] public double? Value ... </c...
8,046
<p>I work on a large Visual C++ (MFC) project in VS.NET 2005.</p> <p>I have noticed strange behavior in Visual C++ 2005. Often, I will change one line of code in a .CPP file but many .CPP files will compile as a result of this. I have never seen this until VS.NET 2005. Theortically, changing a line of code in a .CPP f...
<p>I found <a href="http://untidy.net/blog/2006/07/10/vs-always-builds/" rel="nofollow noreferrer">this link</a> helpful when solving a similar problem, was under pressure at the time, I tried a few things and the issue went away, for the life of me I don't know (or can't remember) which - if any - helped.</p> <p>Hope...
<p>This is a strange bug in the VS2005 dependency behavior. To find out one suggestion would be to take the following steps:</p> <ol> <li><p>Go to <strong>Tools</strong> <strong>-> Options -> Projects and Solutions -> Build and Run -> MSBuild Project Build output Verbosity</strong> and select <strong>Detailed</strong>...
6,706
<p>I am looking for a reliable technique for adding Ajax to a working ASP.NET MVC application. I want to use jQuery, and understand how to use the AJAX functionality from jQuery. </p> <p>What I need to know is how I should write my controller so that I can run the site without JavaScript, but at the same time make AJA...
<p>Typically you would create your site so that it works without JavaScript being enabled. Then you would add the <a href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript" rel="nofollow noreferrer">unobtrusive JavaScript</a> needed to enhance your site with Ajax e.g. adding event handlers for links, form submits, e...
<p>in your controller (derived from Controller), you can call Request.IsMvcAjaxRequest() to check if the request is a normal POST or an AJAX request. This will be true if the request was created from a an AjaxForm submit or an AsyncHyperlink. The Ajax form can be made visible by javascript, along with hiding the stand...
8,039
<p>I just got into 3D printing with an Ender-3 Pro. The test dog printed great, some custom small/thin objects printed good, and now I tried my first big object.</p> <p>Designed in Tinkercad (<a href="https://www.tinkercad.com/things/1JZRKfOQHxr" rel="nofollow noreferrer">link to my (updated) design</a>), exported to ....
<p>One hundred percent infill is not necessarily stronger than lower values. By having such a high infill figure, the forces on the model as it cools are magnified and not in a particularly good manner.</p> <p>Consider that you could use twenty to thirty percent infill to get the strength you require for this applicat...
<p>The reason for this sort of error might be either 1) a clogged nozzel, <a href="https://www.youtube.com/watch?v=bg4sOaSvimY" rel="nofollow noreferrer">try doing this </a> 2) disturbed bed level,<a href="https://www.youtube.com/watch?v=lL3Gmy4hh3Y" rel="nofollow noreferrer">resolve this issue </a> 3) poor filament q...
1,643
<p>Let's say I have a list of categories for navigation on a web app. Rather than selecting from the database for every user, should I add a function call in the application_onStart of the global.asax to fetch that data into an array or collection that is re-used over and over. If my data does not change at all - (Ed...
<p>You can store the list items in the Application object. You are right about the <code>application_onStart()</code>, simply call a method that will read your database and load the data to the Application object.</p> <p>In Global.asax</p> <pre><code>public class Global : System.Web.HttpApplication { // The key t...
<p>I use a static collection as a private with a public static property that either loads or gets it from the database.</p> <p>Additionally you can add a static datetime that gets set when it gets loaded and if you call for it, past a certain amount of time, clear the static collection and requery it.</p>
8,980
<p>When is it a good idea to use factory methods within an object instead of a Factory class?</p>
<p>I like thinking about design pattens in terms of my classes being 'people,' and the patterns are the ways that the people talk to each other.</p> <p>So, to me the factory pattern is like a hiring agency. You've got someone that will need a variable number of workers. This person may know some info they need in th...
<p><a href="https://i.stack.imgur.com/wAQvR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wAQvR.png" alt="enter image description here" /></a> Imagine you have a different customers with different preferences. Someone need Volkswagen another one Audi and so on. One thing is common - it's a car.</p>...
9,525
<p>I'm working on an application that needs to quickly render simple 3D scenes on the server, and then return them as a JPEG via HTTP. Basically, I want to be able to simply include a dynamic 3D scene in an HTML page, by doing something like:</p> <pre><code>&lt;img src="http://www.myserver.com/renderimage?scene=1&amp;...
<p>RealityServer by mental images is designed to do precisely what is described here. More details are available on the product page (including a downloadable Developer Edition).</p> <p><a href="http://www.migenius.com/doc/realityserver/latest/" rel="nofollow noreferrer">RealityServer docs</a></p>
<p>Check out <a href="http://www.wgpu.net" rel="nofollow">wgpu.net</a>.</p> <p>I think it's very helpful.</p>
8,982
<p>In my slicing software (Slic3r) some of the vertices/walls of my model seem to have disappeared, so that the inside of the model - which should be solid - is visible, while the surface appears as a thin shell.</p> <p>Why does this happen? Is it still safe to export the model for printing?</p>
<p>My understanding is that this occurs when the object is not a true solid. Since an STL holds the triangulation of each face and spline, the slicing engine is not &quot;smart&quot; enough to determine if there is a gap in the model and therefore if it should be filled in and how. When the slicer encounters a gap, it ...
<p>Had similar problems with blender &lt;-> Slic3r, modified a stl in blender then slic3r started acting up, showing strange faces where it shouldn't. The solution was (as suggested by @tbm0115) to solidify the exported object. Just add a Solidify modifier to the object(no need to apply), and when exporting to stl make...
121
<p>How do I create a windows application that does the following:</p> <ul> <li>it's a regular GUI app when invoked with no command line arguments</li> <li>specifying the optional "--help" command line argument causes the app to write usage text to stdout then terminate</li> <li>it must be a single executable. No chea...
<p>Microsoft designed console and GUI apps to be mutually exclusive. This bit of short-sightedness means that there is no perfect solution. The most popular approach is to have two executables (eg. cscript / wscript, java / javaw, devenv.com / devenv.exe etc) however you've indicated that you consider this "cheating".<...
<p>I know my answer is coming in late, but I think the preferred technique for the situation here is the ".com" and ".exe" method. </p> <p>This may be considered "cheating" by your definition of two executables, but it requires very little change on the programmers part and can be done one and forgot about. Also this ...
7,814
<p>Is there any feasible way of using generics to create a Math library that does not depend on the base type chosen to store data?</p> <p>In other words, let's assume I want to write a Fraction class. The fraction can be represented by two ints or two doubles or whatnot. The important thing is that the basic four ari...
<p>Here is a way to abstract out the operators that is relatively painless.</p> <pre><code> abstract class MathProvider&lt;T&gt; { public abstract T Divide(T a, T b); public abstract T Multiply(T a, T b); public abstract T Add(T a, T b); public abstract T Negate(T a); pub...
<p>.NET 7 introduces a new feature - generic math (read more <a href="https://devblogs.microsoft.com/dotnet/dotnet-7-generic-math/" rel="nofollow noreferrer">here</a> and <a href="https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#generic-math-support" rel="nofollow noreferrer">here</a>) which is based...
8,910
<p>What's the most efficient algorithm to find the rectangle with the largest area which will fit in the empty space?</p> <p>Let's say the screen looks like this ('#' represents filled area):</p> <pre><code>.................... ..............###### ##.................. .................### .................### #####....
<p>@lassevk</p> <p>I found the referenced article, from DDJ: <a href="http://www.ddj.com/184410529" rel="noreferrer">The Maximal Rectangle Problem</a></p>
<p>Implementation of the stack-based algorithm in plain Javascript (with linear time complexity):</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>function maxRectangle(mask) ...
2,887
<p>A z-axis homing issue is giving me an ulcer. I'm hoping someone can help with this.</p> <p>As per usual, after the Z endstop is triggered on my TEVO Tarantula the gantry raises a bit then slowly lowers back down to the z=0 point established by the trigger. However, the gantry is now lowering well past the point tri...
<p>The soldering in the Tevo components is very low quality as I replaced/resoldered most of the end-stops.</p> <p>As the gantry goes down - please ensure that the cable is not pulled over (no contact) and there is contact on the edge of the acrylic and the end-stop, also the small acrylic switch holder could bend/sli...
<p>I'm not familiar with your particular model, so this may not be directly applicable.</p> <p>For many printer models, a swing thru thingiverse.com will find you a replacement z-stop switch mount that uses a threaded screw to set the z-height at which the microswitch fires. It may well be that you simply need to off...
1,064
<p>When Visual Studio (2005) has <em>Options -> Text Editor -> C/C++ -> Tabs -> Indenting</em> set to Smart it will automatically indent code blocks and line up squiggly brackets, {}, as expected. However, if you hit enter inside a code block, move the cursor to another line, and then move it back, the inserted tabs ar...
<p>As far as I know, the only way to do that is to enter something (anything) on that line, then delete it. Or hit space and you'll never see it there until you return to that line.</p> <p>Once VS determines that you've edited a line of text, it won't automatically modify it for you (at least, not in that way that yo...
<p>This is an annoyance to myself as well. Anytime the code is reformatted the blank lines are de-tabbed. You might look at this: <a href="http://visualstudiogallery.msdn.microsoft.com/ac4d4d6b-b017-4a42-8f72-55f0ffe850d7" rel="nofollow">http://visualstudiogallery.msdn.microsoft.com/ac4d4d6b-b017-4a42-8f72-55f0ffe850d7...
9,956
<pre><code>std::vector&lt;int&gt; ints; // ... fill ints with random values for(std::vector&lt;int&gt;::iterator it = ints.begin(); it != ints.end(); ) { if(*it &lt; 10) { *it = ints.back(); ints.pop_back(); continue; } it++; } </code></pre> <p>This code is not working because...
<p>The call to <a href="http://en.cppreference.com/w/cpp/container/vector/pop_back" rel="noreferrer"><code>pop_back()</code></a> removes the last element in the vector and so the iterator to that element is invalidated. The <code>pop_back()</code> call does <em>not</em> invalidate iterators to items before the last el...
<p>Check out the information <a href="http://www.cplusplus.com/reference/stl/vector/pop_back.html" rel="nofollow noreferrer">here (cplusplus.com)</a>:</p> <blockquote> <p><strong>Delete last element</strong></p> <p>Removes the last element in the vector, effectively reducing the vector size by one and invalidat...
8,773
<p>I'm trying to get the <strong>GWTShell</strong> mode to load my <em>context.xml</em> file in which my database is described.</p> <p>The only usable info can be found <a href="http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit-plugin/configure_tomcatlite.html" rel="nofollow noreferrer">here</a>, but thi...
<p>I'm using Eclipse with Cypal Studio (previously called Googlipse). If there is any other <em>better</em> plugin for Eclipse please recommend it.</p> <p>As the Shell mode uses a Tomcat instance, which is the same target server we are using in the final deployment, it should be possible to achieve (or fake) a similar...
<p>As of version 1.4, I have been running all my server side code, in my container of choice (Glassfish) and hooking up the GWTShell to that. Are you using Netbeans, Eclipse or something else? The Netbeans plugin gwt4nb does this for you out of the box, you just have to start your web project in debug mode. I'm sure th...
8,451
<p>I always thought Java uses <strong>pass-by-reference</strong>.</p> <p>However, I've seen <a href="http://javadude.com/articles/passbyvalue.htm" rel="noreferrer">a blog post</a> that claims that Java uses <strong>pass-by-value</strong>.</p> <p>I don't think I understand the distinction they're making.</p> <p>What is ...
<p>The terms &quot;pass-by-value&quot; and &quot;pass-by-reference&quot; have special, <a href="https://en.wikipedia.org/w/index.php?title=Pass-by-value" rel="noreferrer">precisely defined</a> meanings in computer science. These meanings differ from the intuition many people have when first hearing the terms. Much of t...
<p>Every single answer here is tying to take pass pointer by reference from other languages and show how it is impossible to do in Java. For whatever reason nobody is attempting to show how to implement pass-object-by-value from other languages.</p> <p>This code shows how something like this can be done:</p> <pre><code...
6,171
<p>I run a non-profit designed to expose high school students to 3D printing and entrepreneurship. The concept is based on pop-up shop-style sales of 3D printed trinkets, toys, artifacts, etc.</p> <p>Can I legally sell models we print from the many open source and publicly available museum collections that are availabl...
<h1>Not all museum pieces are out of copyright!</h1> <p>Let's start with a general primer: an Artwork is out of copyright if it was made by someone that died more than about 70 years ago. For items created by companies a different rule applies.</p> <p>When the copyright on an artwork lapses, anyone can reproduce it.</p...
<p>Just read the license that comes with the STL. Most I have seen prohibit commercial use without permission.</p> <blockquote> <p>good places to find fully licensed models that we could sell without having to worry about copyright infringement.</p> </blockquote> <p>Draw them yourself and there's no issues. Or buy the ...
2,159
<p>I've got bunches of auxiliary files that are generated by code and LaTeX documents that I dearly wish <em>would not</em> be suggested by SpotLight as potential search candidates. I'm not looking for <code>example.log</code>, I'm looking for <code>example.tex</code>!</p> <p>So can Spotlight be configured to ignore, ...
<p>@Will - these things that define types are called <a href="http://developer.apple.com/macosx/uniformtypeidentifiers.html" rel="nofollow noreferrer">uniform type identifiers</a>.</p> <p>The problem is they are a combination of extensions (like .txt) and generic types (i.e. public.plain-text matches a txt file withou...
<p>The only option probably is to have them not indexed by spotlight as from some reason you cannot do negative searches. You can search for files with specifix file extension, but you cannot not search for ones that don't match.</p> <p>You could try making those files invisible for Finder, Spotlight won't index invis...
6,257
<p>By graphing I mean bar charts, pie charts, line graphs, that sort of thing. I've used a couple over the years, but what is your favourite and why?</p> <p>One tool per answer please (to make the voting easier :o)</p>
<p>I like <a href="http://zedgraph.org/wiki/index.php?title=Main_Page" rel="noreferrer">ZedGraph</a> it is a free library and produces quality output. You can tweak the anti-aliasing to work the way it looks best to you and it supports a variety of charts and graphs.</p>
<p><a href="http://www.steema.com/products/teechart/whatsnew.html" rel="nofollow noreferrer">TeeChart</a>. I've been using this tool for a few years now, although it is not free (~500€) it is packed with features.<br></p> <p>What I prefer:</p> <ul> <li>axes scale automatically</li> <li>automatic colours for different...
9,529
<p>How many possible combinations of the variables a,b,c,d,e are possible if I know that:</p> <pre><code>a+b+c+d+e = 500 </code></pre> <p>and that they are all integers and >= 0, so I know they are finite.</p>
<p>@Torlack, @Jason Cohen: Recursion is a bad idea here, because there are "overlapping subproblems." I.e., If you choose <code>a</code> as <code>1</code> and <code>b</code> as <code>2</code>, then you have 3 variables left that should add up to 497; you arrive at the same subproblem by choosing <code>a</code> as <code...
<p>Including negatives? Infinite.</p> <p>Including only positives? In this case they wouldn't be called "integers", but "naturals", instead. In this case... I can't really solve this, I wish I could, but my math is too rusty. There is probably some crazy integral way to solve this. I can give some pointers for the mat...
8,444
<p>I'm trying to write a regular expression that validates a date. The regex needs to match the following</p> <ul> <li>M/D/YYYY</li> <li>MM/DD/YYYY</li> <li>Single digit months can start with a leading zero (eg: 03/12/2008)</li> <li>Single digit days can start with a leading zero (eg: 3/02/2008)</li> <li>CANNOT inclu...
<p>This is not an appropriate use of regular expressions. You'd be better off using</p> <pre><code>[0-9]{2}/[0-9]{2}/[0-9]{4} </code></pre> <p>and then checking ranges in a higher-level language.</p>
<p>A slightly different approach that may or may not be useful for you.</p> <p>I'm in php.</p> <p>The project this relates to will never have a date prior to the 1st of January 2008. So, I take the 'date' inputed and use strtotime(). If the answer is >= 1199167200 then I have a date that is useful to me. If someth...
7,422
<p>I'm part of a team that develops a pretty big Swing Java Applet. Most of our code are legacy and there are tons of singleton references. We've bunched all of them to a single "Application Context" singleton. What we now need is to create some way to separate the shared context (shared across all applets currently sh...
<p>Singletons are evil, what do you expect? ;)</p> <p>Perhaps the most comprehensive approach would be to load the bulk of the applet in a different class loader (use java.net.URLClassLoader.newInstance). Then use a WeakHashMap to associate class loader with an applet. If you could split most of the code into a common...
<p>If I understand you correctly, the idea is to get a different "singleton" object for each caller object or "context". One thing you can do is to create a thread-local global variable where you write the ID of the current context. (This can be done with AOP.) Then in the singleton getter, the context ID is fetched fr...
2,890
<p>I'm still new to the ASP.NET world, so I could be way off base here, but so far this is to the best of my (limited) knowledge!</p> <p>Let's say I have a standard business object "Contact" in the <em>Business</em> namespace. I write a Web Service to retrieve a Contact's info from a database and return it. I then wri...
<p>You are on the right track. To get the data from the proxy object back into one of your own objects, you have to do left-hand-right-hand code. i.e. copy property values. I'll bet you that there is already a generic method out there that uses reflection.</p> <p>Some people will use something other than a web serv...
<p>I would recommend that you look at writing a Schema Importer Extension, which you can use to control proxy code generation. This approach can be used to (gracefully) resolve your problem without kludges (such as copying around objects from one namespace to another, or modifying the proxy generated reference.cs class...
2,842
<p>Does anyone have battle stories to share trying to use Visual Studio to develop applications for Unix? And I'm not talking using .NET with a Mono or Wine virtual platform running beneath.</p> <p>Our company has about 20 developers all running Windows XP/Vista and developing primarily for Linux &amp; Solaris. Unti...
<p><em>VS chugs to catch up with me.</em> <br> Hmmm ... you machine needs more memory &amp; grunt. Never had performance problems with mine.</p> <p>I've about a decade's experience doing exactly what you're proposing, most of it in the finance industry, developing real-time systems for customers in the banking, stock ...
<p>We are using a similar solution to what you described.</p> <p>We have our code stored on the Windows side of the world and UNIX (QNX 4.25 to be exact) has access though an NFS mount (thanks to UNIX services for Windows). We have an ssh into UNIX to run make and the pipe to output into VS. Accessing the code is fast...
3,640
<p>For a System.Windows.Forms.TextBox with Multiline=True, I'd like to only show the scrollbars when the text doesn't fit.</p> <p>This is a readonly textbox used only for display. It's a TextBox so that users can copy the text out. Is there anything built-in to support auto show of scrollbars? If not, should I be usi...
<p>Add a new class to your project and paste the code shown below. Compile. Drop the new control from the top of the toolbox onto your form. It's not quite perfect but ought to work for you.</p> <pre><code>using System; using System.Drawing; using System.Windows.Forms; public class MyTextBox : TextBox { private ...
<p>What Aidan describes is almost exactly the UI scenario I am facing. As the text box is read only, I don't need it to respond to TextChanged. And I'd prefer the auto-scroll recalculation to be delayed so it's not firing dozens of times per second while a window is being resized.</p> <p>For most UIs, text boxes with ...
9,879
<p>How do I convert function input parameters to the right type?</p> <p>I want to return a string that has part of the URL passed into it removed.</p> <p><strong>This works, but it uses a hard-coded string:</strong></p> <pre><code>function CleanUrl($input) { $x = "http://google.com".Replace("http://", "") re...
<p>The concept here is correct.</p> <p>The problem is with the variable name you have chosen. $input is a reserved variable used by PowerShell to represent an array of pipeline input. If you change your variable name, you should not have any problem.</p> <p>PowerShell does have <a href="https://technet.microsoft.com/...
<p>This worked for me:</p> <pre><code>function CleanUrl($input) { return $input.Replace("http://", "") } </code></pre>
3,586
<p>I have a need to close a parent form from within child form from a Windows application. What would be the best way to do this?</p>
<p>When you close form in WinForms it disposes all of it's children. So it's not a good idea. You need to do it asynchronously, for example you can send a message to parent form.</p>
<p>The Form class doesn't provide any kind of reference to the 'parent' Form, so there's no direct way to access the parent (unless it happens to be the MDI parent as well, in which case you could access it through the MDIParent property). You'd have to pass a reference to the parent in the constructor of the child, or...
6,223
<p>I'm using <b>Struts 2</b>.</p> <p>I'd like to return from an Action to the page which invoked it.</p> <p>Say I'm in page <strong>x.jsp</strong>, I invoke Visual action to change CSS preferences in the session; I want to return to <strong>x.jsp</strong> rather than to a fixed page (i.e. <strong>home.jsp</strong>)<b...
<p>You can use a dynamic result in struts.xml. For instance:</p> <pre><code>&lt;action name="Visual" class="it.___.web.actions.VisualizationAction"&gt; &lt;result name="next"&gt;${next}&lt;/result&gt; &lt;/action&gt; </code></pre> <p>Then in your action, you create a field called next. So to invoke the acti...
<p>I prefer the way when you navigating users by particular actions. </p> <p><a href="http://domain.com/myAction.action" rel="nofollow noreferrer">http://domain.com/myAction.action</a></p> <p>You could use some parameter as indicator, that you want to change current design: i.e.</p> <p><a href="http://domain.com/myA...
6,730
<p>I am new at this and maybe my model is not the best, I adapted it for another one actually. Can you tell me why I can't get the holes printed? I already checked the faces and they are all in the correct orientation (I think)</p> <p>What happens is that I start printing with the holes facing down and they are not pri...
<h1>The problem is internal geomoetry</h1> <p>The body you modeled consists of a non-manifold shell: There exists a fully enclosed shell on the inside of the item that tries to define an &quot;outside&quot; of the body. In the following picture, I have hidden part of the geometry to better show the problematic internal...
<p>The overall appearance is that the normals are &quot;normal,&quot; that you have no reversed facets, but there are discontinuities within the model that Meshmixer and Netfabb show as failure points. Windows 10 3DBuilder also attempts a repair which fills in the holes.</p> <p><a href="https://i.stack.imgur.com/L92T7....
2,125
<p>Browse to a webpage with hyperlinks using IE (I am using IE7) Once on the page, enlarge the fonts using ctl + mouse wheel. Now when you try to hover over the hyperlinks, they are laterally displaced to the right. To click on the link, i have to move the mouse to the right till the cursor turns into a hand. Anyone...
<p>IE7 doesn't handle Zoom correctly, You can see this error on this page (I mean the page you're reading right now) if you zoom large enough, view the logout | about link at the top, hover over it, hover off to the right, back over.</p>
<p>All of the links on that page are displaced to the right on my copy of IE7 (7.0.6001.18000) even before I enlarge or shrink the fonts. Whereas other pages act normally. (My test page was <a href="http://www.frito-lay.com/fl/flstore/cgi-bin/good_questions.htm" rel="nofollow noreferrer">http://www.frito-lay.com/fl/f...
3,795
<p>When I am running the following statement:</p> <pre><code>@filtered = map {s/&amp;nbsp;//g} @outdata; </code></pre> <p>it is returning an empty list instead of the filtered list that I expected. What I am trying to do is remove every occurrence of <code>&amp;nbsp;</code> from an array of string (which is an XML f...
<p>Try this:</p> <pre><code>@filtered = map {s/&amp;nbsp;//g; $_} @outdata; </code></pre> <p>The problem is the s operator in perl modifies $_ but actually returns the number of changes it made. So, the extra $_ at the end causes perl to return the modified string for each element of @outdata.</p>
<p>As a counterpoint to Greg's answer, you could misuse grep:</p> <pre><code>@filtered = grep {s/&amp;nbsp;//g; 1} @outdata; </code></pre> <p><strong>Don't do this.</strong></p>
3,319
<p>I'm trying to modify some parts on <a href="https://www.thingiverse.com/thing:2115095" rel="noreferrer">this</a> thing. I'm kind of new to dealing with the modeling aspects of this.</p> <p>I am attempting to widen the part essentially 3mm. This would involve modifying the chain segments, and the anchor points.</p> ...
<p>I found that the answer provided by @Marco was helpful but not the correct answer I was looking for.</p> <p>Here is the general approach I used (Based on <a href="https://open-shelf.appspot.com/FreeCAD/en-US/34.html" rel="nofollow noreferrer">this</a>).</p> <ol> <li>Create new document</li> <li>Import STL file</li...
<p>I found Dave G's answer to be helpful, however I could only use additive features (e.g. Pad) on the created object, and could not make subtractive features <em>into</em> the object (e.g. Pocket).</p> <p>Here's what worked for me using FreeCAD 0.19 (Instructions from <a href="http://pinter.org/archives/4255" rel="no...
972
<p>I've found many Youtube videos of makers upgrading to BLTouch sensor. </p> <p>I have a Creality CR-10S Pro, so far bed leveling hasn't been an issue (after some days of trial and error). </p> <p>My question is what are the problems/issues users need to face in order to need (or justify) an upgrade?</p>
<p>A touch or an inductive/capacitive sensor is useful when you cannot get prints to stick to the build surface because of a skew bed platform/heated plate or if the plate has a bend, large concave or convex area.</p> <p>Even with such a sensor, you need to provide a bed that is as level (trammed) as you can get. Auto...
<p>I don't know your printer but I don't have BLtouch, and I have to set the height every time because the bed expands with heat.</p> <p>If you print at variable bed temperature (PLA, ABS, PETg, nylon require different values) then that sensor helps a lot.</p> <p>BL touch can also speed up bed calibration: you scan t...
1,639
<p>In our application, we are using RMI for client-server communication in very different ways:</p> <ol> <li>Pushing data from the server to the client to be displayed.</li> <li>Sending control information from the client to the server.</li> <li>Callbacks from those control messages code paths that reach back from the...
<p>You can do this with a custom RMI Socket Factory. </p> <p>The socket factories create the sockets for RMI to use at both the client and server end so if you write your own you've got full control over the ports used. The client factories are created on the server, Serialized and then sent down to the client which...
<p>I've been having various problems implementing an RMI Server/Client architecture, with Client Callbacks. My scenario is that both Server and Client are behind Firewall/NAT. In the end I got a fully working implementation. Here are the main things that I did:</p> <h2>Server Side , Local IP: 192.168.1.10. Public (Int...
8,073
<p>Simple question: how do you reinsulate the MakerBot Smart Extruders? </p> <p>Backstory: I work at the library. We've recently replaced the MakerBot (extruder connection issues followed by software incompatibility) with a Prusa.</p> <p>As a new hire, I'm obsessed with the 3D printers. I'm trying to make it my missi...
<p>I recently wrapped a LOT of hot PLA around my print head and, as a result, had to remove the kapton tape and the fibreglass insulation that came with it.</p> <p>I was reluctant to use fibreglass because of the tissue embedding hazard and the lung hazard (especially on what is effectively an indoor appliance) and ka...
<p>Strictly speaking, you do not require the insulation to be there. It is supposed to keep some of the heat contained in the core to allow more heat to be available for the filament to melt (basically higher print speeds and less chance of burning your fingers :) ). </p> <p>If I go to the Makerbot website and look at...
934
<p>I was reviewing some code that a consultant checked in and notice they were using SQLCLR. I don't have any experience with it so thought I would research what it was about. I noticed that they used</p> <pre><code>Dim cn As New SqlConnection("server=LOCALHOST;integrated security=yes;database=" &amp; sDb) </code></...
<p>The context connection uses the user's already established connection to the server. So you inherit things like their database context, connection options, etc.</p> <p>Using localhost will connect to the server using a normal shared memory connection. This can be useful if you don't want to use the user's connect...
<p>Consider a big office phone systems:</p> <p>My office has an internal phone system. But every phone also has an external phone number (virtual numbers that utilize one of a group of real TELCO lines). I can call another office by dialing their phone extension directly and the call will route through our internal ...
8,090
<p>Does Google Reader have an API and if so, how can I get the count of the number of unread posts for a specific user knowing their username and password?</p>
<p>This URL will give you a count of unread posts per feed. You can then iterate over the feeds and sum up the counts.</p> <p><a href="http://www.google.com/reader/api/0/unread-count?all=true" rel="nofollow noreferrer">http://www.google.com/reader/api/0/unread-count?all=true</a></p> <p>Here is a minimalist example i...
<p>In the API posted in [1], the "token" field should be "T"</p> <p>[1] <a href="http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI" rel="nofollow noreferrer">http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI</a></p>
7,622
<p>I've created an Access 2007 form that displays, for example, Products from a Product table. One of the fields in the Product table is a CategoryID that corresponds to this product's parent category.</p> <p>In the form, the CategoryID needs to be represented as a combo box that is bound to the Category table. The ...
<p>You need to use both values in the query for the combo box.<br> e.g. SELECT CategoryId, CategoryName FROM CategoryTable... Bind the combo box to the fist column, CategoryId. Set the column widths for the combo box to 0in (no second value need, so there is no limit). This will hide the first column which contains you...
<p>You should also check that your categories table has a primary key on the CategoryName field. You original configuration should have thrown an error or message saying the update would violate the key. As it is it seems you can have 2 categories with the same name.</p>
9,449
<p>I need a way to determine the space remaining on a disk volume using python on linux, Windows and OS X. I'm currently parsing the output of the various system calls (df, dir) to accomplish this - is there a better way?</p>
<pre><code>import ctypes import os import platform import sys def get_free_space_mb(dirname): """Return folder/drive free space (in megabytes).""" if platform.system() == 'Windows': free_bytes = ctypes.c_ulonglong(0) ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(dirname), None, No...
<p>I Don't know of any cross-platform way to achieve this, but maybe a good workaround for you would be to write a wrapper class that checks the operating system and uses the best method for each.</p> <p>For Windows, there's the <a href="http://aspn.activestate.com/ASPN/docs/ActivePython/2.2/PyWin32/win32api__GetDiskF...
7,484
<p>As far as I know, in gcc you can write something like:</p> <pre><code>#define DBGPRINT(fmt...) printf(fmt); </code></pre> <p>Is there a way to do that in VC++?</p>
<p>Yes but only since VC++ 2005. The syntax for your example would be:</p> <pre><code>#define DBGPRINT(fmt, ...) printf(fmt, __VA_ARGS__) </code></pre> <p>A full reference is <a href="http://msdn.microsoft.com/en-us/library/ms177415(VS.80).aspx" rel="noreferrer">here</a>.</p>
<p>Almost. It's uglier than that though (and you probably don't want a trailing semi-colon in the macro itself:</p> <pre><code>#define DBGPRINT(DBGPRINT_ARGS) printf DBGPRINT_ARGS // note: do not use '(' &amp; ')' </code></pre> <p>To use it:</p> <pre><code>DBGPRINT(("%s\n", "Hello World")); </code></pre> <p>(was mi...
9,075
<p>I work with Fusion360 for designing lots of things. Recently I learned how to work with parameters that I can easily modify all at once, allowing to pretty much make easily customizable pieces.</p> <p>Now, Thingiverse wants customizer pieces in the shape of <code>.SCAD</code> files, and some people just can't work ...
<p>Even though OpenSCAD can import a variety of formats, the file structure will not be accepted by Thingiverse in the manner presented by the OP.</p> <p>OpenSCAD is a text-based description language. One creates parameters assigned to specific aspects of a model and implements those parameters to create the desired s...
<p>No, you cannot import STEP nor Fusion360 files in OpenSCAD.</p> <p>OpenSCAD <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Importing_Geometry" rel="nofollow noreferrer">currently supports</a>:</p> <p><strong>3D formats</strong></p> <ul> <li>STL (both ASCII and Binary)</li> <li>OFF</li> <li>AMF [Note:...
1,619
<p>Let's suppose you deploy a network-attached appliances (small form factor PCs) in the field. You want to allow these to call home after being powered on, then be identified and activated by end users.</p> <p>Our current plan involves the user entering the MAC address into an activation page on our web site. Later o...
<p>I don't think there's anything magic about what you're doing here - couldn't what you're doing be described as:</p> <p>"At production we burn a unique number into each of our devices which is both readable by the end user (it's on the label) and accessible to the internal processor. Our users have to enter this nu...
<p>From a security perspective, I know that it is possible to spoof a MAC, though I am not entirely sure how difficult it is or what it entails.</p> <p>Otherwise, if the customers don't have easy access to the hardware or the OS, you should be fairly safe doing this... probably best to put a warning sticker on saying ...
5,000
<p>I just noticed that Chromium was installed in AppData in both Vista and XP. If Google does that and if other applications does this, than is that becuase there is some form of protection? Should we write installers that does the same thing as Google?</p>
<p>Windows still lacks a convention for per-user installation.</p> <ul> <li>When an installer asks whether to install for the current user or all users, it really only refers to shortcut placement (Start Menu; Desktop). The actual application files still go in the system-wide <code>%PROGRAMFILES%</code>.</li> <li>Micr...
<p>Just so you people know, Google has created an MSI installer for global system installation and management. It's located here:</p> <p><a href="https://www.google.com/intl/en/chrome/business/browser/" rel="nofollow">https://www.google.com/intl/en/chrome/business/browser/</a></p>
6,989
<p>Reading <a href="https://stackoverflow.com/questions/437/what-is-your-solution-to-the-fizzbuzz-problem">this question</a> I found this as (note the quotation marks) "code" to solve the problem (that's perl by the way). </p> <pre><code>100,{)..3%!'Fizz'*\5%!'Buzz'*+\or}%n* </code></pre> <p>Obviously this is an inte...
<p>My process for situations where I think performance may be an issue:</p> <ol> <li>Make it work.</li> <li>Make it clear.</li> <li>Test the performance.</li> <li>If there are meaningful performance issues: refactor for speed.</li> </ol> <p>Note that this does not apply to higher-level design decisions that are more ...
<p>at times when optimization is necessary, i'd rather sacrifice compactness and keep the performance enhancement. perl obviously has some deep waters to plumb in search of the conciseness/performance ratio, but as cute as it is to write one-liners, the person who comes along to maintain your code (who in my experienc...
5,061
<p>I see them all the time and always ignore them. Can someone explain to me why they have become so prevalent? If I'm using a site that allows me to explore it via tags (e.g., this one, del.icio.us, etc.) that's what I will do. Why would I need a "cloud" of tags upon which to click? I can just type that tag(s) into...
<p>It's more of a browse assist than a search assist. If you see a large or bold tag in a tag cloud that interests you it my lead to some knowledge discovery that wouldn't have otherwise been sought out with a deliberate search. When I am browsing del.ico.us or stackoverflow I appreciate the tags as they sometimes le...
<p>Tags give a way of explicitly labelling something with what it is about instead of relying on computers to extract this information.</p> <p>For example, you might be interested in on questions about stackoverflow. If you search for "stackoverflow" you will get all kinds of questions that are not about stackoverflow...
8,519
<p>This is a tricky one and I've always relied on techniques, such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly <em>spamish</em> terminology.</p> <p>Of late, some of the emails I send out programmatically have started being shuffled into people's spam ...
<p>Use email authentication methods, such as <a href="http://en.wikipedia.org/wiki/Sender_Policy_Framework" rel="nofollow noreferrer">SPF</a>, and <a href="https://help.ubuntu.com/community/Postfix/DKIM" rel="nofollow noreferrer">DKIM</a> to prove that your emails and your domain name belong together, and to prevent sp...
<p>To allow <strong>DMARC</strong> checks for SPF to pass and also be <strong>aligned</strong> when using sendmail, make sure you are setting the envelope sender address (<code>-f</code> or <code>-r</code> parameter) to something that matches the domain in the <code>From:</code> header address.</p> <h2>With PHP:</h2> <...
2,286
<p>What's the best Python idiom for this C construct?</p> <pre><code>while ((x = next()) != END) { .... } </code></pre> <p>I don't have the ability to recode next().</p> <p>update: and the answer from seems to be:</p> <pre><code>for x in iter(next, END): .... </code></pre>
<p>@Mark Harrison's answer:</p> <pre><code>for x in iter(next_, END): .... </code></pre> <p>Here's an excerpt from <a href="http://docs.python.org/library/functions.html" rel="noreferrer">Python's documentation</a>:</p> <pre><code>iter(o[, sentinel]) </code></pre> <blockquote> <p>Return an iterator object. ...
<p>What are you trying to do here? If you're iterating over a list, you can use <code>for e in L</code> where e is the element and L is the list. If you're filtering a list, you can use list comprehensions (i.e. <code>[ e for e in L if e % 2 == 0 ]</code> to get all the even numbers in a list).</p>
4,817
<p>We are using <a href="http://en.wikipedia.org/wiki/JetBrains" rel="nofollow noreferrer">JetBrains</a>' <a href="http://en.wikipedia.org/wiki/DotTrace" rel="nofollow noreferrer">dotTrace</a>. What other profiling tools can be recommended that are better for profiling C# <a href="http://en.wikipedia.org/wiki/Windows_F...
<p>No. I have tried pretty much every .NET profiler on the market (ANTS, vTune, OptimizeIt, DevPartner, YourKit), and in my opinion dotTrace is the best of the lot. It is one of only two profilers I have used (the other being YourKit) that has low enough overhead to handle a highly CPU-intensive application.</p> <p>If...
<p><a href="http://nprof.sourceforge.net/Site/Description.html" rel="nofollow noreferrer">nProf</a> is a good tool if you're looking for something free. It's kind of finicky at points, and a little buggy, but if you're on a tight budget, it'll do the job.</p>
7,251
<p>Actually, this question seems to have two parts:</p> <ul> <li>How to implement pattern matching?</li> <li>How to implement <a href="http://erlang.org/doc/reference_manual/expressions.html#6.9" rel="noreferrer">send and receive</a> (i.e. the Actor model)?</li> </ul> <p>For the pattern matching part, I've been looki...
<p>One of the important things about erlang is how the features are used to make robust systems.</p> <p>The send/recieve model is no-sharing, and explicitly copying. The processes themselves are lightweight threads.</p> <p>If you did desire the robust properties of the erlang model, you would be best to use real proc...
<p>I would definitely be interested in looking at your "acedia" library and would love to help in any way that I could. Erlang has some wonderful constructs and C++ could definitely benefit from such a library.</p>
6,166
<p>I have Sun webserver iws6 (iplanet 6) proxying my bea cluster. My cluster is under /portal/yadda. I want anyone who goes to </p> <pre><code>http://the.domain.com/ </code></pre> <p>to be quickly redirected to </p> <pre><code>http://the.domain.com/portal/ </code></pre> <p>I have and index.html that does a post and...
<p>Does this help? <a href="http://docs.sun.com/source/816-5691-10/essearch.htm#25618" rel="nofollow noreferrer">http://docs.sun.com/source/816-5691-10/essearch.htm#25618</a></p> <hr> <p>To map a URL, perform the following steps:</p> <p>Open the Class Manager and select the server instance from the drop-down list.</...
<p>You should be able to configure the webserver to do a header redirect (301 or 302 depending on your situation) so it redirects without ever loading an HTML page. This can be done in PHP as well:</p> <pre><code>&lt;?php header("Location: http://www.example.com/"); /* Redirect browser */ /* Make sure that code belo...
8,880
<p>I would love to re-use my failed prints by re-extruding the plastic to be used in the 3D printer once again. One thing that stands in my way is finding an effective way to shred the plastic into smaller bits for the extrude to use. What is a good thing to look for to accomplish this? Maybe a really big 'paper' shred...
<p>there is a project called <code>precious plastic</code> and there is a <a href="https://bazar.preciousplastic.com/en/listings/572981-star-international-shipping-star-shredder-kit" rel="nofollow noreferrer">plastic shredder</a>, but it is a rather expensive solution.</p> <p>As I am waiting for parts for my <a href="h...
<p>there is a project called <code>precious plastic</code> and there is a <a href="https://bazar.preciousplastic.com/en/listings/572981-star-international-shipping-star-shredder-kit" rel="nofollow noreferrer">plastic shredder</a>, but it is a rather expensive solution.</p> <p>As I am waiting for parts for my <a href="h...
899