instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>Management is thinking of changing out Content Management Systems. What do you use/recommend?</p>
<ol>
<li>What UCM solution is your company using?</li>
<li>How big is your company?</li>
<li>Are you happy with the implementation?</li>
</ol>
<p>Current setup:</p>
<ol>
<li>The company I work for uses <code>Oracle E... | <p>1) CMS: <a href="http://www.bea.com/framework.jsp?CNT=index.htm&FP=/content/products/aqualogic/" rel="nofollow noreferrer">Oracle's BEA Aqualogic</a><br>
2) Size: 10,000+<br>
3) Experience: As an end user with full community and content admin privileges, I find the tool to be outdated and stifling in terms of kn... | <ol>
<li><p>We use the Alterian Content Manager application. It is very robust and suites our needs well.</p></li>
<li><p>20000 staff+</p></li>
<li><p>Very happy. Developers and business team find the application very easy to work with.</p></li>
</ol>
| 3,990 |
<p>Every time I create an object that has a collection property I go back and forth on the best way to do it?</p>
<ol>
<li>public property with a getter that
returns a reference to private variable</li>
<li>explicit get_ObjList and set_ObjList
methods that return and create new or cloned
objects every time</li>
<li>ex... | <p>How you expose a collection depends entirely on how users are intended to interact with it.</p>
<p><strong>1)</strong> If users will be adding and removing items from an object's collection, then a simple get-only collection property is best (option #1 from the original question):</p>
<pre><code>private readonly C... | <p>If you're simply looking to expose a collection on your instance, then using a getter/setter to a private member variable seems like the most sensible solution to me (your first proposed option).</p>
| 5,543 |
<p>In my C/C++ program, I'm using <a href="http://opencvlibrary.sourceforge.net/" rel="noreferrer">OpenCV</a> to capture images from my webcam. The camera (<a href="http://en.wikipedia.org/wiki/Quickcam" rel="noreferrer">Logitech QuickCam IM</a>) can capture at resolutions <strong>320x240</strong>, <strong>640x480</str... | <p>There doesn't seem to be a solution. The resolution can be increased to <strong>640x480</strong> using <a href="http://tech.groups.yahoo.com/group/OpenCV/message/28735" rel="noreferrer">this hack</a> shared by <em>lifebelt77</em>. Here are the details reproduced:</p>
<p>Add to <strong>highgui.h</strong>:</p>
<pre>... | <pre><code>cvQueryFrame(capture);
cvSetCaptureProperty( capture, CV_CAP_PROP_FRAME_WIDTH, any_supported_size );
cvSetCaptureProperty( capture, CV_CAP_PROP_FRAME_HEIGHT, any_supported_size);
cvQueryFrame(capture);
</code></pre>
<p>should be just enough!</p>
| 3,506 |
<p>In SQL Server would a <code>varbinary(16)</code> be the most efficient way of storing an <strong>MD5 hash</strong>? Won't be doing anything with it except returning it in a <strong>linq</strong> query.</p>
| <p>Based on the <a href="http://msdn.microsoft.com/en-us/library/ms188362.aspx" rel="noreferrer">documentation on MSDN</a> and my experience, binary is better, since the md5 hash does not vary in size.</p>
<p>The size for a binary data type is n bytes, so the size of the data. The size of a varbinary data type is n b... | <p>Null values change things: </p>
<p>A null varbinary(16) is 2 bytes. <br />
A null binary(16) is 16 bytes. <br />
16 bytes stored in varbinary(16) takes 18 bytes. <br />
16 bytes in binary(16) takes 16 bytes. <br /></p>
<p><a href="https://stackoverflow.com/a/3731195">https://stackoverflow.com/a/3731195</a></p>
| 7,156 |
<p>I have an Asp.NET application (VS2008, Framework 2.0). When I try to set a property on one of the user controls like</p>
<pre><code>myUserControl.SomeProperty = someValue;
</code></pre>
<p>I get a <code>NullReferenceException</code>. When I debug, I found out that <code>myUserControl</code> is null. How is it poss... | <p>Where are you trying to access the property? If you are in onInit, the control may not be loaded yet.</p>
| <p>If you created the UserControl during runtime (through ControlCollection.Add), you need to create it on postback too.</p>
<p>Another case can be your UserControl does not match the designer.cs page</p>
| 5,015 |
<p>I am running oracle and have a query which pulls some results from the database. I would like to write the results as a text file. How would I go about doing this?</p>
<p>My prefered way would be by using UTL_FILE. Would some one have an example of how to do this?</p>
| <p>If you're using Sql Plus, is as easy as:</p>
<pre>
SQL> spool c:\temp\out.txt
SQL> SELECT * FROM USERS;
SQL> spool off
</pre>
<p>This three sentences will output the result of the query "SELECT * FROM USERS" to the file c:\temp\out.txt.</p>
<p>You can format this query using the string manipulation functions of O... | <p>This seems to be a reasonable tutorial with a few simple examples <a href="http://www.adp-gmbh.ch/ora/plsql/utl_file.html" rel="nofollow noreferrer">UTL_FILE example</a></p>
| 4,715 |
<p>I am trying to set a flag to show or hide a page element, but it always displays even when the expression is false. </p>
<pre><code>$canMerge = ($condition1 && $condition2) ? 'true' : 'false';
...
<?php if ($canMerge) { ?>Stuff<?php } ?>
</code></pre>
<p>What's up?</p>
| <p>This is broken because 'false' as a string will evaluate to true as a boolean.</p>
<p>However, this is an unneeded ternary expression, because the resulting values are simple true and false. This would be equivalent:</p>
<pre><code>$canMerge = ($condition1 && $condition2);
</code></pre>
| <pre><code>$canMerge = ($condition1 && $condition2);
</code></pre>
<p>then</p>
<pre><code>if ($canMerge){
echo "Stuff";
}
</code></pre>
| 2,407 |
<p>Let's say I print a part out of ABS and wait for it to cool. I could theoretically do this with several copies of the same printer, modified to use print beds of different compositions.</p>
<p>Will the material a bed is made out of affect how long it takes a part to cool?</p>
| <p><strong>What bed material cools faster?</strong></p>
<p>I found an <a href="http://www.engineeringtoolbox.com/thermal-conductivity-d_429.html">extensive list</a> which relates various materials to their <em>thermal conductivity</em>, k [W/mK]; the lower thermal conductivity, the better the material insulates, and t... | <p>Assuming you are meaning the build plate and not confusing it with a printed raft, yes, different materials for the build plate will have different cooling rates. I don't know the values of hand, but a Google search can get you to a formula to calculate how long a certain size build plate of a given material type sh... | 143 |
<p>I just started thinking about creating/customizing a web crawler today, and know very little about web crawler/robot etiquette. A majority of the writings on etiquette I've found seem old and awkward, so I'd like to get some current (and practical) insights from the web developer community.</p>
<p>I want to use a ... | <p>Obey robots.txt (and not too aggressive like has been said already).</p>
<p>You might want to think about your user-agent string - they're a good place to be up-front about what you're doing and how you can be contacted.</p>
| <p>I'd say that it is very important to consider how much load you are causing. For instance, if your crawler requests every object of a single site, more or less at once, it might cause load problems for that particular site.</p>
<p>In other words, make sure your crawler is not too aggressive.</p>
| 5,228 |
<p>Let me preface this question by saying I use TextMate on Mac OSX for my text needs and I am in love with it. Anything comparable on the Linux platform? I'll mostly use it for coding python/ruby.</p>
<p>Doing a google search yielded outdated answers.</p>
<p>Edit: Since there has been some concern about the 'meri... | <p><img src="https://i.stack.imgur.com/YayAV.png" alt="Real programmers set the universal constants at the start such that the universe evolves to contain the disk with the data they want."></p>
<p><a href="http://xkcd.com/378/" rel="noreferrer">http://xkcd.com/378/</a></p>
| <p>You can try Emacs with ruby-mode, <a href="http://rinari.rubyforge.org/" rel="nofollow noreferrer">Rinari</a> (for Rails) and <a href="http://code.google.com/p/yasnippet/" rel="nofollow noreferrer">yasnippet</a> which provides automatic snippets like Textmate.</p>
| 2,504 |
<p>Pretty new to 3d Printing. Ultimaker Cura as my Slicer. I have the Ender3 3d Printer.</p>
<p>I have a model from Hero Forge I'm trying to print. I added some caltrops on the base but when I go to print the figure, my Ender3 won't finish the caltrops/smaller items and won't finish the figure. It will basically just g... | <h2>Resolution is limited</h2>
<p>You are printing with FDM. FDM is limited in printing detail by its nozzle diameter: you can not print something that is much smaller than your nozzle diameter. A typical nozzle is 0.4 mm in diameter. Your figurine? That is too thin and fragile.</p>
| <p>I suggest you try again with another filament. It looks like your nozzle is either clogging or your filament is slipping. There could be multiple reasons why, but the easiest first troubleshooting strategy is to change filament because it can rule out half the reasons.</p>
| 2,218 |
<p>Recently I tried understanding the use of <strong>java.math.MathContext</strong> but failed to understand properly. Is it used for rounding in <code>java.math.BigDecimal</code>. If yes why does not it round the decimal digits but even mantissa part.</p>
<p>From API docs, I came to know that it follows the standard ... | <p>@jatan</p>
<blockquote>
<p>Thanks for you answer. It makes sense. Can you please explain me MathContext in the context of BigDecimal#round method.</p>
</blockquote>
<p>There's nothing special about <code>BigDecimal.round()</code> <em>vs.</em> any other <code>BigDecimal</code> method. In all cases, the <code>Mat... | <p>If I'm understanding you correctly, it sounds like you're expecting the MathContext to control how many digits should be kept after the decimal point. That's not what it's for. It specifies how many digits to keep, <em>total</em>. So if you specify that you want 3 significant digits, that's all you're going to ge... | 2,908 |
<p>here is what a I'm doing: </p>
<pre><code>object ReturnMatch(System.Type type)
{
foreach(object obj in myObjects)
{
if (obj == type)
{
return obj;
}
}
}
</code></pre>
<p>However, if obj is a subclass of <code>type</code>, it will not match. But I w... | <p>I've used the IsAssignableFrom method when faced with this problem.</p>
<pre><code>Type theTypeWeWant; // From argument or whatever
foreach (object o in myCollection)
{
if (theTypeWeWant.IsAssignableFrom(o.GetType))
return o;
}
</code></pre>
<p>Another approach that may or may not work with your probl... | <p>the is operator indicates whether or not it would be 'safe' to cast one object as another obeject (often a super class).</p>
<pre><code>if(obj is type)
</code></pre>
<p>if obj is of type 'type' or a subclass thereof, then the if statement will succeede as it is 'safe' to cast obj as (type)obj.</p>
<p>see: <a href... | 9,798 |
<p>I would really like to see a proportional font IDE, even if I have to build it myself (perhaps as an extension to Visual Studio). What I basically mean is MS Word style editing of code that sort of looks like the typographical style in <a href="http://www.research.att.com/~bs/3rd.html" rel="nofollow noreferrer">The ... | <p>I'd still like to see a popular editor or IDE implement <a href="http://nickgravgaard.com/elastictabstops/" rel="noreferrer">elastic tabstops</a>.</p>
| <p>The major problem with proportional fonts is they destroy the vertical alignment of the code and this is a fairly major loss when it comes to writing code.</p>
<p>The vertical alignment makes it possible to manipulate rectangular blocks of code that span multiple lines by allowing block operations like cut, copy, p... | 3,532 |
<p><strong>[SOLVED]</strong> on [EDIT 3]</p>
<p>I just finished changing my i3 Mega's PTFE tube and brass nozzle, reassembled it, always taking care not to damage the heating element and thermistor wires.
Then I check the temperature and it was cooling down, despite the set temperature being higher (210 ºC). I turned i... | <p>I recently had similar problem with my Prusa i3 MK2.5. It was not able to maintain the set tempereature. I measured the heater catridge (which was new) and its resistance was correct (about 4 ohms). So I changed the hotend MOSFET on the stock board with no result. So I changed the heater catridge for the older one a... | <p>I recently had similar problem with my Prusa i3 MK2.5. It was not able to maintain the set tempereature. I measured the heater catridge (which was new) and its resistance was correct (about 4 ohms). So I changed the hotend MOSFET on the stock board with no result. So I changed the heater catridge for the older one a... | 1,761 |
<p>When I run a particular SQL script in Unix environments, I see a '^M' character at the end of each line of the SQL script as it is echoed to the command line.<br />
I don't know on which OS the SQL script was initially created.</p>
<p>What is causing this and how do I fix it?</p>
| <p>It's caused by the DOS/Windows line-ending characters. Like Andy Whitfield said, the Unix command dos2unix will help fix the problem. If you want more information, you can read the man pages for that command.</p>
| <p>Another vi command that'll do: <code>:%s/.$//</code> This removes the last character of each line in the file. The drawback to this search and replace command is that it doesn't care what the last character is, so be careful not to call it twice.</p>
| 9,033 |
<p>I just got my first 3D printer today, QIDI X-ONE[2], and so far so good with the setup and getting my 1<sup>st</sup> print. I wanted to power off the printer, but I don't see any instructions on how to properly power off the machine.</p>
<p>Does anyone know how long I should wait, or what the minimum temperature wo... | <p>Kinda, sort of, but not really. I'll look at the A4988 (<a href="https://www.pololu.com/file/0J450/a4988_DMOS_microstepping_driver_with_translator.pdf" rel="nofollow noreferrer">datasheet</a>).</p>
<p>The motor pins are connected by diodes to ground and Vbb (the motor suppply voltage). Essentially, they act as a br... | <p>"Inductive kickback" from motor coils is caused by the inductance of the coils and the wiring. It is not some strange effect. Inductance is charged with current, just as capacitance is changed with voltage. Most bipolar motor drivers use an H-bridge on the output. By driving the H-bridge correctly, the driver ca... | 830 |
<p>I just requested a hotfix from support.microsoft.com and put in my email address, but I haven't received the email yet. The splash page I got after I requested the hotfix said:</p>
<blockquote>
<p><strong>Hotfix Confirmation</strong></p>
<p>We will send these hotfixes to the following e-mail address:</p>
<pre><code>... | <p>Divide your services by resource requirements at the very least. For example, if you are running a photo album site, separate your image download server from your image upload server. The download server will have many more requests, and because most people have a lower upload speed the upload server will have longe... | <p>Divide your services by resource requirements at the very least. For example, if you are running a photo album site, separate your image download server from your image upload server. The download server will have many more requests, and because most people have a lower upload speed the upload server will have longe... | 5,018 |
<p>What is a magic number?</p>
<p>Why should it be avoided?</p>
<p>Are there cases where it's appropriate?</p>
|
<p>A magic number is a direct usage of a number in the code.</p>
<p>For example, if you have (in Java):</p>
<pre class="lang-java prettyprint-override"><code>public class Foo {
public void setPassword(String password) {
// don't do this
if (password.length() > 7) {
throw new I... | <p>What about return variables?</p>
<p>I specially find it challenging when implementing <strong>stored procedures</strong>.</p>
<p>Imagine the next stored procedure (wrong syntax, I know, just to show an example):</p>
<pre><code>int procGetIdCompanyByName(string companyName);
</code></pre>
<p>It return the Id of t... | 7,019 |
<p>We're running a custom application on our intranet and we have found a problem after upgrading it recently where IIS hangs with 100% CPU usage, requiring a reset.</p>
<p>Rather than subject users to the hangs, we've rolled back to the previous release while we determine a solution. The first step is to reproduce t... | <p>You can find some information about troubleshooting this kind of problem at <a href="http://blogs.msdn.com/tess/archive/2008/05/21/debugdiag-1-1-or-windbg-which-one-should-i-use-and-how-do-i-gather-memory-dumps.aspx" rel="nofollow noreferrer">this blog entry</a>. Her blog is generally a good debugging resource.</p>
| <p>Is your test env the same really as live?
i.e
2 separate vm instances on 2 physical servers - with the network connection and account types?</p>
<p>Is there any other instances on the Database?</p>
<p>Is there any other web applications in IIS?</p>
<p>Is the .Net Config right?</p>
<p>Is the App Pool Config righ... | 3,091 |
<p>I configured Marlin 1.1.3 for auto-leveling with a fix mounted sensor connected to the Z end-stop pin.</p>
<p>I have the following settings in my config:</p>
<pre><code>#define X_PROBE_OFFSET_FROM_EXTRUDER 25
#define Y_PROBE_OFFSET_FROM_EXTRUDER 20
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +... | <p>Yes, with the proper equipment.</p>
<p>Printing wax filament (at 51 seconds): <a href="https://youtu.be/tibkVZB_n9c?t=51s" rel="noreferrer">https://youtu.be/tibkVZB_n9c?t=51s</a></p>
<p>There are also options for melting wax, filling a heated reservoir head, and printing with that. I recommend doing this with a co... | <p>Just make a silicone mold of any of your prints and pour you wax in the silicone,you silicone putty is pretty cheap so is wax ,no need to break the bank as printers have become less expensive and can do a pretty good job </p>
| 630 |
<p>I'm guessing it needs to be something like:</p>
<pre><code>CONVERT(CHAR(24), lastModified, 101)
</code></pre>
<p>However I'm not sure of the right value for the third parameter.</p>
<p>Thanks!</p>
<hr>
<p>Well I'm trying to write a script to copy my sql server db to a sqlite file, which gets downloaded to an ai... | <p>Last epoch is when 1970 GMT?</p>
<pre><code>SELECT DATEDIFF(s,'19700101 05:00:00:000',lastModified)
</code></pre>
<p>See also <a href="http://wiki.lessthandot.com/index.php/Epoch_Date" rel="nofollow noreferrer">Epoch Date</a></p>
| <p>Define "last epoch". Does this come close?</p>
<p>Select Cast(lastModified As Integer)</p>
| 3,237 |
<p>When printing several objects, I recently encountered a problem that arises when the structure in itself is relatively thin or the support towers have a small surface: the printhead would in motion tend to knock one or more over as it traveled or catch at them and create layer shift.</p>
<p>How can I avoid collisio... | <p>The problem was twofold:</p>
<ol>
<li>Lack of bed adhesion due to the small contact surface</li>
<li>motion into the already printed objects.</li>
</ol>
<p>The <em>quick and dirty</em> way was to change two settings:</p>
<ul>
<li>Print with a small (3 mm) brim to stick the supports to the print and provide more s... | <p>For the Creality Ender 3, I had the same collision problem and after a while I found it was because of the X-axis not being level.</p>
<p>I found right hand side was more than 3-4 mm below the left side when the Z-axis height exceeds around 8-10 cm. Below that, the two sides were even. I made some calibration ... | 1,053 |
<p>I want to find any text in a file that matches a regexp of the form <em>t</em><code>[A-Z]</code><em>u</em> (i.e., a match <em>t</em> followed by a capital letter and another match <em>u</em>, and transform the matched text so that the capital letter is lowercase. For example, for the regexp <code>x[A-Z]y</code></p>
... | <p>It looks like <a href="http://steve-yegge.blogspot.com/" rel="noreferrer">Steve Yegge</a> actually already posted the answer to this a few years back: <a href="http://steve-yegge.blogspot.com/2006/06/shiny-and-new-emacs-22.html" rel="noreferrer">"Shiny and New: Emacs 22."</a> Scroll down to "Changing Case in Replace... | <p>I'd do this with a macro as well, but only because executing code from within a replacement string for a regular expression is very unintuitive to me. If you're writing a batch script or something that needs to go very fast, \, is certainly the way to go.</p>
| 8,213 |
<p>I'm going to try something with the format of this question and I'm very open to suggestions about a better way to handle it.</p>
<p>I didn't want to just dump a bunch of code in the question so I've posted the code for the class on <code>refactormycode</code>.</p>
<p><strong><a href="http://www.refactormycode.com... | <p>The way I do it is the following:</p>
<pre><code>class test {
protected $x='';
protected $y='';
function set_y ($y) {
print "specific function set_y\n";
$this->y = $y;
}
function __call($function , $args) {
print "generic function $function\n";
list ($name , ... | <p>I've always handled this issue in a similar with a __call which ends up pretty much as boiler plate code in many of my classes. However, it's compact, and uses the reflection classes to only add getters / setters for properties you have already set (won't add new ones). Simply adding the getter / setter explicitly w... | 5,207 |
<p>I replaced the controller board in my Monoprice Select Mini with an Arduino/Ramps setup and compiled an uploaded Marlin 1.1.0-RC8 to run it. I've got most everything calibrated and working with one exception.</p>
<p>I tell the printer to home for xyz and then level my bed with a piece of paper then start a print an... | <p>I found the issue. When the hotend and bed are at temps for PLA everything works fine but at temps for ABS the Z offset would get all messed up. After a bunch of testing I was able to track it down to a single gcode statment <code>G1 Z15.0 F6000</code>
At the higher temps my Z stepper skips steps at that feed rate.... | <p>If nozzle sets lower than it should, after heating up, then you may need to calibrate with heater turned on.</p>
<p>Another (although less likely) reason can be an incorrect Z steps number. However, if the print, after adjusting the first line height, does well, this should not be the case.</p>
<p>Fast track solut... | 557 |
<p>I have a report with many fields that I'm trying to get down to 1 page horizontally (I don't care whether it's 2 or 200 pages vertically... just don't want to have to deal with 2 pages wide by x pages long train-wreck). That said, it deals with contact information.</p>
<p>My idea was to do:</p>
<pre><code>Name: ... | <p>Alter the report's text box to:</p>
<pre><code>= Fields!Addr1.Value + VbCrLf +
Fields!Addr2.Value + VbCrLf +
Fields!Addr3.Value
</code></pre>
| <p>Try this one :</p>
<pre><code>= Fields!Field1.Value + System.Environment.NewLine + Fields!Field2.Value
</code></pre>
| 4,613 |
<p>What is the best way to transcode audio and video to show on the web? </p>
<p>I need to do it programmatically. I'd like to do something like YouTube or Google Video where users can upload whatever format they want, and I encode it to flv, mp3, and/or mp4. I could do it on our server, but I would rather use an E... | <p>I strongly recommend ffmpeg. On Windows, I have found <a href="https://ffmpeg.zeranoe.com/builds/" rel="nofollow noreferrer">this site</a> to host good binaries.</p>
| <p><a href="http://www.rhozet.com/carbon_coder.html" rel="nofollow noreferrer">Rhozet Carbon Coder</a> can handle a <a href="http://www.rhozet.com/rhozet_formatGuide.pdf" rel="nofollow noreferrer">wide range of formats</a> plus you can use plugins to alter the video (eg add a watermark)</p>
| 2,862 |
<p>I have a radio button list on a page that is used to configure products. when the page loads the first time the first list of options is displayed. you select one of them then click a "Next Step" button and the page posts back and shows a new radio button list for step 2. Now if i click a "Previous Step" button i ca... | <p>It sounds like you are causing a redirect to happen. You aren't by chance doing a Response.Redirect in order to "get back" to the original page? This would cause the functionality you describe. You would first get the Postback from the Previous button to leave the page, and then you would get a fresh Request (IsPost... | <p>Try setting <code>AutoEventWireup = False</code> in the page.</p>
| 8,456 |
<p>I use RCF with boost.serialization (why use RCF's copy when we already use the original?) It works OK, but when an exception is thrown in the server, it's not passed correctly to the client. Instead, I get an RCF::SerializationException quoting an <code>archive_exception</code> saying "class name too long". When I c... | <p>Here's a patch given by Jarl at <a href="http://www.codeproject.com/KB/threads/Rcf_Ipc_For_Cpp.aspx?msg=2739150#xx2730536xx" rel="nofollow noreferrer">CodeProject</a>:</p>
<p>In RcfServer.cpp, before the line where RcfServer::handleSession() is defined (around line 792), insert the following code:</p>
<pre><code>v... | <p>According to Jarl it works, check <a href="http://www.codeproject.com/KB/threads/Rcf_Ipc_For_Cpp.aspx?fid=248794&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=101&select=2365783" rel="nofollow noreferrer">codeproject</a> for a question and answer with sample code:</p>
| 8,830 |
<p>I have a Linux web server farm with about 5 web servers, web traffic is about 20Mbps.</p>
<p>We currently have a Barracuda 340 Load Balancer (keep away from this device - piece of crap!) that is acting as a firewall. I want to put in a dedicated firewall and I'd like to know what peoples opinions are on building ve... | <p>As they say - "there are more than one way to skin a cat":</p>
<p>Build it yourself, running something like Linux or *BSD. The benefit of this, is that it makes it easy to do the dynamic part of your question, it's just a matter of a few well-placed shell/python/perl/whatever scripts. The drawback is that your ceil... | <p>Don't know much about this field, but maybe an <a href="http://www.astaro.com/" rel="nofollow noreferrer">Astaro security gateway</a>?</p>
| 7,095 |
<p>I've printed a 2x2x2 cm test cube with Slic3r (left) and Ultimaker Cura (right) and my Prusa i3 derivative machine with tight belts. The print settings should be quite equal (0.15 mm layer height, 40 mm/s outer wall speed, default accelerations/jerks). Though the top surface of the Ultimaker Cura-cube... | <p>Those wavy lines could be artefacts caused by closely-spaced infill, but they could also be resonance patterns caused by noisy stepper motors and over-tight belts. Since you have said that you have your belts nice and tight, I would suggest reducing the tension on them and see what happens. I know that some pundits ... | <p>It is difficult to see with the lighting and the shiny green, but try printing a more complex object, like the usual <a href="https://www.thingiverse.com/thing:1278865" rel="nofollow noreferrer">XYZ cube</a>. Does it look like this one? which means big waves after a change of direction, but then getting smaller?</p>... | 704 |
<p>I didn't see the option to point the workspace (or it's VS equivalent, I'm still learning the terminology for Visual Studio, but it is called a workspace in Eclipse) to My Documents/Programming instead of -- well -- wherever it is now.</p>
| <p>What Craig said, plus if you do want to change the default it's in Tools -> Options -> Projects And Solutions.</p>
<p>I've never changed the default and never created a solution/project in the default location, which might tell you something about how relevant it is...</p>
| <p>When you create the project you can specify whatever directory you want, you are not limited to the default.</p>
| 5,592 |
<p>What is the difference between old style and new style classes in Python? When should I use one or the other?</p>
| <p>From <em><a href="http://docs.python.org/2/reference/datamodel.html#new-style-and-classic-classes" rel="noreferrer">New-style and classic classes</a></em>:</p>
<blockquote>
<p><strong>Up to Python 2.1, old-style classes were the only flavour available to the user.</strong></p>
<p>The concept of (old-style) c... | <p>New-style classes inherit from <code>object</code> and must be written as such in Python 2.2 onwards (i.e. <code>class Classname(object):</code> instead of <code>class Classname:</code>). The core change is to unify types and classes, and the nice side-effect of this is that it allows you to inherit from built-in ty... | 7,852 |
<p>Java has generics and C++ provides a very strong programming model with <code>template</code>s.
So then, what is the difference between C++ and Java generics?</p>
| <p>There is a big difference between them. In C++ you don't have to specify a class or an interface for the generic type. That's why you can create truly generic functions and classes, with the caveat of a looser typing.</p>
<pre class="lang-cpp prettyprint-override"><code>template <typename T> T sum(T a, T b) { ... | <p>Templates are nothing but a macro system. Syntax sugar. They are fully expanded before actual compilation (or, at least, compilers behave as if it were the case).</p>
<p>Example:</p>
<p>Let's say we want two functions. One function takes two sequences (list, arrays, vectors, whatever goes) of numbers, and returns ... | 5,700 |
<p>I left my printer to print a circular object and when I came back I saw it didn't print anything but left this layer of white on the surface. I can't get it off, I've tried washing it and scraping it off with the chisel, nothing works.</p>
<p><a href="https://i.stack.imgur.com/7zuyK.jpg" rel="nofollow noreferrer" ti... | <p>My guess is it's damaged print surface from the hot extruder mashing against the print surface. Your description seems to indicate that it isn't a layer.</p>
| <p>If it actually is residue from the material you were trying to print, pressed against the surface so tightly and so thin that you can't separate it, the best way to remove it is printing a new object on top of it, using the same material, with the bed properly leveled (i.e. not smashing the nozzle into it again) and... | 2,016 |
<p>While there are 100 ways to solve the conversion problem, I am focusing on performance.</p>
<p>Give that the string only contains binary data, what is the fastest method, in terms of performance, of converting that data to a byte[] (not char[]) under C#?</p>
<p>Clarification: This is not ASCII data, rather binary... | <p>I'm not sure ASCIIEncoding.GetBytes is going to do it, because it only supports the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.text.asciiencoding" rel="nofollow noreferrer">range 0x0000 to 0x007F</a>. </p>
<p>You tell the string contains only bytes. But a .NET string is an array of chars, and 1 ch... | <p>There is <em>no such thing</em> as an ASCII string in C#! Strings <em>always</em> contain UTF-16. Not realizing this leads to a lot of problems. That said, the methods mentioned before work because they consider the string as UTF-16 encoded and transform the characters to ASCII symbols.</p>
<p>/EDIT in response to ... | 9,779 |
<p>I've been looking for a tool to extract exception information from a C++ program. The most wanted feature I'm looking for: I want to know all the exceptions that can be thrown from a function (which would include all the function that is called from that function recursively).</p>
<p>I've always thought that docume... | <p><a href="http://www.gimpel.com/" rel="nofollow noreferrer">PC-Lint</a> claims to do static exception analysis of C++ code.<br>
<a href="http://www.coverity.com/" rel="nofollow noreferrer">Coverity</a> is another static C++ code analysis tool that apparently informs you of unhandled exceptions.<br>
<a href="http://ww... | <p>EDoC++ (<a href="http://edoc.sourceforge.net" rel="nofollow noreferrer">http://edoc.sourceforge.net</a>) is another alternative.</p>
| 4,793 |
<p>I Have a request for the TOTAL's and subtotals column to be moved to the top/left of columns it represents, and by default SSRS does it on the bottom or right hand side of the columns being totaled. Is there a way to this?</p>
| <p>I found my own solution, when you right click on the tiny green triangle, in the top right hand corner of the sub total column. Then select properties, and you can adjust the "Layout" property.. it has 2 options, Before and After. </p>
| <p>You can just add a row which comes before your set of data, for each field you want to total just give that cell an expression which does a SUM() of that particular field.</p>
| 8,202 |
<p>If unit-test names can become outdated over time and if you consider that the test itself is the most important thing, then is it important to choose wise test names?</p>
<p>ie </p>
<pre><code>[Test]
public void ShouldValidateUserNameIsLessThan100Characters() {}
</code></pre>
<p>verse </p>
<pre><code>[Test]
publ... | <p>The name of any method should make it clear what it does.</p>
<p>IMO, your first suggestion is a bit long and the second one isn't informative enough. Also it's probably a bad idea to put "100" in the name, as that's very likely to change. What about:</p>
<pre><code>public void validateUserNameLength()
</code></pr... | <p>The name needs to matter within reason. I don't want an email from the build saying that test 389fb2b5-28ad3 failed, but just knowing that it was a UserName test as opposed to something else would help ensure the right person gets to do the diagnosis.</p>
| 6,973 |
<p>I'm using JBoss Seam Framework, but it's seems to me isn't very popular among java developers.
I want to know how many java programmers here are using it, and in what kind of projects.
Is as good as django, or RoR?</p>
| <p>In our <a href="http://www.lunatech-research.com/archives/2007/12/14/javapolis-2007-seam" rel="noreferrer">JBoss Seam in Action presentation</a> at the Javapolis conference last year, my colleague and I said that 'Seam is the next Struts'. This needed some explanation, which I later wrote-up as <a href="http://www.l... | <p>I have used JBoss Seam on two commercial projects for two different clients. Yet JBoss Seam is still a new approach to developing JSF Web Applications. One measure is the results from a Indeed Job Search. </p>
<p><a href="http://www.indeed.com/jobs?q=jboss+seam&l=" rel="nofollow noreferrer">Indeed Job Search</a... | 5,014 |
<p>Under Windows XP WPF true 3D content (which is usually displayed using the Viewport3D control) looks extremely ugly because it is by default not antialiased as the rest of the WPF graphics are. Especially at lower resolution the experience is so bad that it can not be used in production code.</p>
<p>I have managed ... | <p>Have you tried this (from your thread on MSDN forums)?</p>
<blockquote>
<p>Well, it seems the reference in the MSDN link above incorrectly specify the affected registry root key. In MSDN it is specified as HKEY_CURRENT_USER, while the correct root key should be HKEY_LOCAL_MACHINE. I've tried setting up the HKEY_L... | <p>Does your video card support Shader 2.0? You can refer <a href="http://en.wikipedia.org/wiki/Pixel_shader" rel="nofollow noreferrer">to this wiki page</a> to see if it does...</p>
| 6,050 |
<p>I was wondering if anyone could point to an Open Source date utility class that is fairly robust. I find myself rolling my own when I want to do a lot of things I take for granted in C# and Java. For instance I did find a decent example of a DateDiff() function that I tore apart and another DatePart() function. Anot... | <p><a href="https://github.com/mikechambers/as3corelib" rel="nofollow noreferrer">as3corelib</a> has the <a href="https://github.com/mikechambers/as3corelib/blob/master/src/com/adobe/utils/DateUtil.as" rel="nofollow noreferrer">DateUtil</a> class and it should be pretty reliable since it's written by some Adobe employe... | <p>There is also <a href="http://www.depressedpress.com/Content/Development/JavaScript/Extensions/DP_DateExtensions/Index.cfm" rel="nofollow noreferrer">DP_DateExtensions</a>, though I believe DateJS is more robust.</p>
| 7,627 |
<p>JavaScript needs access to cookies if AJAX is used on a site with access restrictions based on cookies. Will HttpOnly cookies work on an AJAX site? </p>
<p><em>Edit:</em> Microsoft created a way to prevent XSS attacks by disallowing JavaScript access to cookies if HttpOnly is specified. FireFox later adopted this. ... | <p>Yes, HTTP-Only cookies would be fine for this functionality. They will still be provided with the XmlHttpRequest's request to the server.</p>
<p>In the case of Stack Overflow, the cookies are automatically provided as part of the XmlHttpRequest request. I don't know the implementation details of the Stack Overflo... | <p>No, the page that the AJAX call requests has access to cookies too & that's what checks whether you're logged in.</p>
<p>You can do other authentication with the Javascript, but I wouldn't trust it, I always prefer putting any sort of authentication checking in the back-end.</p>
| 4,764 |
<p>I maintain several client sites that have no dynamic data whatsoever, everything is static asp.net with c#.<br>
Are there any pitfalls to caching the entire page for extreme periods of time, like a week?</p>
<p>Kibbee, We use a couple controls on the sites (ad rotator, some of the ajax extensions) on the sites. Th... | <p>The only significant pitfall to long cache times occurs when you want to update that data. To be safe, you have to assume that it will take up to a week for the new version to become available. Intermediate hosts such as a ISP level proxy servers often do cache aggressively so this delay will happen.</p>
<p>If ther... | <p>When you say that you have no data, how are you even using asp.net or c#. What functionality does that provide you over plain HTML? Also, if you do plan on caching, it's probably best to cache to a file, and then when a request is made, stream out the file. The OS will take care of keeping the file in memory so th... | 5,707 |
<p>How do I lock compiled Java classes to prevent decompilation?</p>
<p>I know this must be very well discussed topic on the Internet, but I could not come to any conclusion after referring them.</p>
<p>Many people do suggest obfuscator, but they just do renaming of classes, methods, and fields with tough-to-remember... | <p>Some of the more advanced Java bytecode obfuscators do much more than just class name mangling. <a href="http://www.zelix.com/" rel="noreferrer">Zelix KlassMaster</a>, for example, can also scramble your code flow in a way that makes it really hard to follow and works as an excellent code optimizer...</p>
<p>Also m... | <p>Q: If I encrypt my .class files and use a custom classloader to load and decrypt them on the fly, will this prevent decompilation?</p>
<p>A: The problem of preventing Java byte-code decompilation is almost as old the language itself. Despite a range of obfuscation tools available on the market, novice Java programm... | 7,191 |
<p>I am having two separate issues. One is specific to this particular model, the other is on all my prints, but more pronounced on 90° vertical walls.</p>
<p>The first issue is a localized area of under extrusion only in one area of the print. This issue is specific to this model. The second issue is evenly spaced hor... | <p>The horizontal bands are 5mm apart, which is a common pitch for the screws often used for the Z axis.</p>
<p>I would look for something that binds, moves, slips, or touches once per screw revolution. The movement repeats along the screw, so if it is a screw defect I would look for a scratch or bump that affects the... | <p>Try setting the z-seam to <em>random</em> in your slicer. In Slic3r it is <em>Seam position</em> under <em>Advanced</em> near the bottom of the <em>Layer and perimeters</em> page of the <em>Print Settings</em>.</p>
| 2,068 |
<p>We are working on a large project with a measure of new/modified GUI functionality. We've found in the past that we often introduced new problems in related code when adding new functionality.</p>
<p>We have non-technical users perform testing, but they often miss parts and allow bugs to slip through.</p>
<p>Are th... | <p>There are GUI testing tools that will click buttons and stuff for you but they're pretty fragile in my experience.</p>
<p>The best thing to do is to keep your UI layer as thin as possible. Your event handler classes should optimally be only one or two lines that call out to other more testable classes. That way y... | <p>I can't really help with organization or best practices, but an <a href="http://www.nunit.org/index.php" rel="nofollow noreferrer">NUnit</a> extension appears to be available for forms testing, <a href="http://www.google.com/search?q=nunitforms" rel="nofollow noreferrer">NUnitForms</a>.</p>
| 6,294 |
<p>Windows has a feature that allows an administrator to perform auto-logon whenever it is started. How can this feature be activated?</p>
| <p>Based on the advice, moved the answer to the answers section:</p>
<p>There are tools out there that give you a GUI for setting this easily, but you can also do it relatively easily by editing the registry.</p>
<p>Under the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winl... | <p>If you don't want to store the clear-text password in the registry, use this method:</p>
<ul>
<li>Start -> Run</li>
<li>enter "control userpasswords2"</li>
<li>disable checkbox "Users must enter a user name and password to use this computer"</li>
<li>click "OK"</li>
<li>enter a valid user name and password that is ... | 6,109 |
<p>Suddenly my prints start having small strings and I'm not sure what to do to eliminate them.</p>
<p>I have already tried to clean the filament tube, cleaned up the nozzle, and played with various retraction settings. Nothing seems to work and I still see these small strings.</p>
<p><a href="https://i.stack.imgur.com... | <p>These artifacts can be either moisture, as explored by <a href="https://3dprinting.stackexchange.com/a/16007/8884">this answer</a> or problems with temperature/speed control or the Z-Axis:</p>
<p>If the temperature is not hot enough, the filament might not get melted enough to squish down to the next layer nicely at... | <p>What you're seeing does not look like <em>stringing</em>, which I would characterize as material that exited the nozzle after extrusion was supposed to have stopped, usually due to missing or insufficient retraction, but like the extrusions along the concave contours <em>failed to bond</em> to the previous layer and... | 1,909 |
<p>How do you disable autocomplete in the major browsers for a specific input (or form field)?</p>
| <p>Firefox 30 ignores <code>autocomplete="off"</code> for passwords, opting to prompt the user instead whether the password should be stored on the client. Note the following <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=956906#c100" rel="noreferrer">commentary</a> from May 5, 2014:</p>
<blockquote>
<... | <p>I was having trouble on a form which included input fields for username and email with email being right after username. Chrome would autofill my current username for the site into the email field and put focus on that field. This wasn't ideal as it was a form for adding new users to the web application.</p>
<p>It... | 2,466 |
<p>Do you know any grid control compatible with .NET and Mono?</p>
<p>DataGridView seems to be quite buggy on Mono, and GTK# controls depends on GTK+ so you need to install it in windows machines where, usually, it's not present.</p>
| <p>You might want to try out the preview of Mono 2.0. DataGridView is vastly better in this version, though there are still several places where it is still lacking.</p>
<p><a href="http://mono.ximian.com/monobuild/preview/download-preview/" rel="nofollow noreferrer">http://mono.ximian.com/monobuild/preview/download-... | <p>Which version did you try? Perhaps you should give <a href="http://mono.ximian.com/monobuild/preview/download-preview/" rel="nofollow noreferrer">Mono 2.0 preview</a> a go, it might work for you (no, the Data* controls are not yet perfect, but they have improved greatly). From my experience GTK# controls on Windows ... | 5,647 |
<p>I'd like to create a script that will configure the Visual Studio IDE the way I like it. Nothing vastly complicated, just a few Tools/Options settings, adding some External Tools, that kind of thing. </p>
<p>I know that this can be done inside VS with Import/Export Settings, but I'd like to be able to automate it f... | <p>Answering my own question, in two ways:</p>
<ol>
<li><p>In VS2005/8, the things I mentioned (Tools/Options, External Tools) are all stored in the CurrentSettings.vssettings file, in the folder "Visual Studio 200{5|8}\Settings". This file is just XML, and it can be edited programmatically by anything that knows how ... | <p>On my machine Visual Studio stores it's local settings in a file called VCComponents.dat. Its a text file, so perhaps you could find a way of placing your settings directly in there.</p>
<p>The file is stored in my users local AppData\Local\Microsoft\VC folder</p>
| 6,419 |
<p>I'm looking for suggestions on how to debug and chase down deadlock issues in an SQL Server 2000 database. I've had it recommended to me to use trace flags 1024 and 3605, which I have found give me the following:</p>
<p>1024 - this trace flag returns the type of locks participating in the deadlock and the current ... | <p>Here is the bible on deadlock troubleshooting: <a href="http://blogs.msdn.com/bartd/archive/2006/09/09/Deadlock-Troubleshooting_2C00_-Part-1.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/bartd/archive/2006/09/09/Deadlock-Troubleshooting_2C00_-Part-1.aspx</a></p>
| <p>Once you know the sql statements involved, a code analysis will surely help. Some thumb rules are checking for the order in which the rows are accessed and checking for the isolation level used for the SQL statements. A profiler trace can help a lot.</p>
<p>Most of the time, it is because of a reader trying to get ... | 7,581 |
<p>As I put together each asp.net page It's clear that most of the time I could use the standard HTML tags just as easily as the web forms controls. When this is the case what is the lure of the webforms controls?</p>
| <p>HTML controls will be output a lot faster than server controls since there is nothing required on part of the server.. It just literally copies the markup in the ASPX page.</p>
<p>Server controls however require instantiation.. Parsing of the postback data and the like, this is obviously where the work comes in for... | <p>Webform controls have more server-side pre-built functionality (server side hooks, methods and attributes), I tend to use HTML controls only when I require a high degree of formatting (styling) as that bypasses the way .Net renders it's controls (which, at times, can be very strange).</p>
| 9,565 |
<p>I'm using Eclipse 3.4 and have configured the Java code formatter with all of the options on the <em>Comments</em> tab enabled. The problem is that when I format a document comment that contains:</p>
<pre><code>* @see <a href="test.html">test</a>
</code></pre>
<p>the code formatter inserts a space in t... | <p>I can only assume it's a bug in Eclipse. It only happens with <em>@see</em> tags, it happens also for all 3 builtin code formatter settings.</p>
<p>There are some interesting bugs reported already in the neighbourhood, but I couldn't find this specific one. See for example a search for <em>@see</em> in the <a href=... | <p>Strict XML specifications require that the self closing tags should have a space before the closing slash like so:</p>
<pre><code><gcServer enabled="true" /> <!-- note the space just after "true" -->
</code></pre>
<p>I can only assume, like Bart said, that there is a bug in Eclipse's reformatter that t... | 6,729 |
<p>Using .NET 2.0 with WinForms, I'd like to create a custom, multi-columned menu (similiar to the word 2007 look&feel, but without the ribbon).</p>
<p>My approach was creating a control, and using a left/right docked toolstrip, I have constructed a similar look&feel of a menu. However, there are a few shortco... | <ul>
<li>unless you are in the business of providing .net components, you should be looking to buy it off the shelf. Its a lot of work getting such a control right - There are already vendors providing this kind of UI. e.g. <a href="http://www.componentone.com/SuperProducts/RibbonWinForms/" rel="nofollow noreferrer">Co... | <ul>
<li>unless you are in the business of providing .net components, you should be looking to buy it off the shelf. Its a lot of work getting such a control right - There are already vendors providing this kind of UI. e.g. <a href="http://www.componentone.com/SuperProducts/RibbonWinForms/" rel="nofollow noreferrer">Co... | 9,659 |
<p>Can I run a 64-bit VMware image on a 32-bit machine?</p>
<p>I've googled this, but there doesn't seem to be a conclusive answer.</p>
<p>I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my backgro... | <p>The easiest way to check your workstation is to download the <a href="http://downloads.vmware.com/d/details/processor_check_5_5_dt/dCpiQGhkYmRAZQ==" rel="noreferrer">VMware Processor Check for 64-Bit Compatibility</a> tool from the VMware website.</p>
<p>You can't run a 64-bit VM session on a 32-bit processor. How... | <p>You can if your processor is 64-bit and Virtualization Technology (VT) extension is enabled (it can be switched off in BIOS). You can't do it on 32-bit processor.</p>
<p>To check this under Linux you just need to look into <em>/proc/cpuinfo</em> file. Just look for the appropriate flag (<strong>vmx</strong> for Int... | 8,004 |
<p>I'm writing a web page in ASP.NET. I have some JavaScript code, and I have a submit button with a click event.</p>
<p>Is it possible to call a method I created in ASP with JavaScript's click event?</p>
| <p>Well, if you don't want to do it using Ajax or any other way and just want a normal ASP.NET postback to happen, here is how you do it (without using any other libraries):</p>
<p><em>It is a little tricky though... :)</em></p>
<p>i. In your code file (assuming you are using C# and .NET 2.0 or later) add the followi... | <p>This reply works like a breeze for me thanks cross browser:</p>
<blockquote>
<p>The __doPostBack() method works well.</p>
</blockquote>
<p>Another solution (very hackish) is to simply add an invisible ASP button in your markup and click it with a JavaScript method.</p>
<pre><code><div style="display: none;"&... | 2,576 |
<p>I'm writing a program that sends an email out at a client's specific local time. I have a .NET method that takes a timezone & time and destination timezone and returns the time in that timezone. So my method is to select every distinct timezone in the database, check if it is the correct time using the method, t... | <h1>Hey! These queries are not equivalent.</h1>
<p>Results will be same only if assuming that one email belongs only to the one time zone. Of course it does however SQL engine doesn't know that and tries to remove duplicities. So the first query should be faster.</p>
<p>Always use UNION ALL, unless you know why you w... | <p>Some DBMS's Query Optimizers modify your query to make it more efficient, so depending on the DBMS your using, you probably shouldn't care.</p>
| 4,481 |
<p>I am using Marlin firmware with a RAMPS board on an Anet A8 printer. </p>
<p>The bed size for the printer is 220 x 220 mm and that is stated in the <code>configuration.h</code> file. When using mesh bed leveling, the nozzle jumps to the first corner on the bed perfectly after setting the x-min to 5.0 but the next t... | <hr>
<p><em>None of the answers address your question to solve it! The only sensible contribution comes from a comment of <a href="https://3dprinting.stackexchange.com/users/26/tom-van-der-zanden">@TomvanderZanden</a>.</em></p>
<hr>
<p>For the sensor to stay <em>within</em> the limits of the bed (considering the off... | <p>The problem is in the code.
Please use these:</p>
<pre><code>// The size of the print bed
#define X_BED_SIZE 220
#define Y_BED_SIZE 220
// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS 5
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS ... | 627 |
<p>I have an STL file from thingiverse. The model is of a rectangular lid with an engraving. I would like to print it using two different colors, so that the engraving would be in a different color than the lid base. In the model description, the creator explained that he simply switched the material mid printing.</p>
... | <p>You can also preview the gcode rendering layer by layer (if your software allows this), and insert a toolchange command at the layer where you want to switch colors.</p>
| <p>With OpenScad i would take the stl, and cut half of it off, but subtracting a block. That result I would save to a.stl. Then i would move the block to the other side of the model and subtract that piece off. The result i would save as b.stl.</p>
<p>My slicer is RepG. It has an option for merging two stl files... | 635 |
<p>I am trying to port Marlin to my Qidi Tech 1 printer which previously ran Sailfish 7.8. Everything worked fine on the old board, including the temperature sensors.</p>
<p>All cables except for power, LCD, and USB (for flashing) are disconnected. I am still very early on in testing and have yet to plug anything else ... | <p>#define THERMAL_PROTECTION_HOTENDS is for thermal runaway. When the temperature "should" be climbing or falling at a predicable rate, or holding steady once at running temp.</p>
<p>#define HEATER_0_MAXTEMP defines the maximum temperature Marlin will allow the extruder to get to before initiating a shutdown... | <p><code>MAXTEMP</code> and <code>MINTEMP</code> are <strong>not</strong> part of the <a href="https://3dprinting.stackexchange.com/questions/8466/what-is-thermal-runaway-protection">Thermal Runaway Protection</a>, but separate, equally needed safety nets: Mintemp is meant to make sure that the printer does not try to ... | 1,770 |
<p>What's the best way in c# to determine is a given QFE/patch has been installed?</p>
| <p>Use WMI and inspect the <a href="http://msdn.microsoft.com/en-us/library/aa394391.aspx" rel="nofollow noreferrer">Win32_QuickFixEngineering</a> enumeration.</p>
<p>From TechNet:</p>
<pre><code>strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strCom... | <p>The most reliable way is to determine which files are impacted by the QFE and use <code>System.Diagnostics.FileVersionInfo.GetVersionInfo(path)</code> on each file and compare the version numbers.</p>
<p>edit: I think there's a way to check the uninstall information in the registry as well, but if the QFE ever beco... | 8,187 |
<p>I'm looking to add a testing suite to my application, however I can't move to the newer testing frameworks for .NET 3.5. </p>
<p>Does anyone have a suggestion about good testing frameworks to use?</p>
| <p>We use <a href="http://www.mbunit.com/" rel="noreferrer">MbUnit</a> and <a href="http://www.ayende.com/Blog/archive/2007/03/28/Rhino-Mocks-3.0-Released.aspx" rel="noreferrer">Rihno Mocks</a> and they prove to work very well together. When doing TDD you will almost certainly need to do some form of dependency injecti... | <p>NUnit is always a favorite of mine. However if you are using TFS as your source control I suggest you stick with the Microsoft Stack.</p>
| 2,439 |
<p>I'm working on a .net solution that is run completely inside a single network. When users make a change to the system, I want to launch an announcement and have everyone else hear it and act accordingly. Is there a way that we can broadcast out messages like this (like UDP will let you do) while keeping guaranteed ... | <p>Almost all games have a need for the fast-reacting properties (and to a lesser extent, the connectionless properties) of UDP and the reliability of TCP. What they do is they build their own reliable protocol on top of UDP. This gives them the ability to just burst packets to whereever and optionally make them reliab... | <p>do a RDP multicast. </p>
| 5,153 |
<p>I've created a few <code>autorun</code> script files on various USB devices that run <code>bash</code> scripts when they mount. These scripts run "in the background", how do I get them to run in a terminal window? (Like the "Application in Terminal" gnome Launcher type.)</p>
| <p>Run them as a two stage process with your "autorun" script calling the second script in a new terminal eg</p>
<pre><code>gnome-terminal -e top --title Testing
</code></pre>
<p>Would run the program "top" in a new gnome terminal window with the title "Testing" You can add additional arguments like setting the geome... | <pre><code>xterm -e shellscript.sh
</code></pre>
<p>or (if <code>xterm</code> isn't installed)</p>
<pre><code>gnome-terminal -e shellscript.sh
</code></pre>
<p>or (if you're using kubuntu / kde)</p>
<pre><code>konsole -e shellscript.sh
</code></pre>
| 5,649 |
<p>I was looking at <a href="http://tldp.org/LDP/abs/html/why-shell.html" rel="nofollow noreferrer">http://tldp.org/LDP/abs/html/why-shell.html</a> and was struck by:</p>
<blockquote>
<p>When not to use shell scripts</p>
<p>...</p>
<ul>
<li>Mission-critical applications upon which you are betting the fut... | <p>Using shell scripts is fine when you're using their strengths. My company has some class 5 soft switches and the call processing code and the provisioning interface is written in java. Everything else is written in KSH - DB dumps for backups, pruning, log file rotation, and all the automated reporting. I would ar... | <p>Scripts are inappropriate for implementing certain mission-critical functions, since they must have both +r and +x permissions to function. Executables need only have +x.</p>
<p>The fact that a script has +r means users might be able to make a copy of the script, edit/subvert it, and execute their edited Cuckoo's-E... | 3,793 |
<p>I am currently working on a project with specific requirements. A brief overview of these are as follows: </p>
<ul>
<li>Data is retrieved from external webservices</li>
<li>Data is stored in SQL 2005</li>
<li>Data is manipulated via a web GUI</li>
<li>The windows service that communicates with the web services ha... | <p>Why not use a SQL Job instead of the Windows Service? You can encapsulate all of you db "trigger" code in Stored Procedures. Then your UI and SQL Job can call the same Stored Procedures and create the triggers the same way whether it's manually or at a time interval.</p>
| <p>The way I see it is this.</p>
<p>You have a Windows Service, which is playing the role of a scheduler and in it there are some classes which simply call the webservices and put the data in your databases.</p>
<p>So, you can use these classes directly from the WebUI as well and import the data based on the WebUI tr... | 2,545 |
<p>For parsing player commands, I've most often used the <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split%28java.lang.String%29" rel="noreferrer">split</a> method to split a string by delimiters and then to then just figure out the rest by a series of <code>if</code>s or <code>switch</code>... | <p>I assume you're trying to make the command interface as forgiving as possible. If this is the case, I suggest you use an algorithm similar to this:</p>
<ol>
<li>Read in the string
<ul>
<li>Split the string into tokens</li>
<li>Use a dictionary to convert synonyms to a common form </li>
<li>For example, convert "hi... | <p>A simple string tokenizer on spaces should work, but there are really many ways you could do this.</p>
<p>Here is an example using a tokenizer:</p>
<pre><code>String command = "kick person";
StringTokenizer tokens = new StringTokenizer(command);
String action = null;
if (tokens.hasMoreTokens()) {
action = tok... | 2,509 |
<p>I have a few sites on a shared host that is running Apache 2. I would like to compress the HTML, CSS and Javascript that is delivered to the browser. The host has disabled mod_deflate and mod_gzip, so these options are out. I do have PHP 5 at my disposal, though, so I could use the gzip component of that.</p>
<p>I ... | <p>Sorry about the delay - it's a busy week for me.</p>
<p>Assumptions:</p>
<ul>
<li><code>.htaccess</code> is in the same file as <code>compress.php</code></li>
<li>static files to be compressed are in <code>static</code> subdirectory</li>
</ul>
<p>I started my solution from setting the following directives in .hta... | <p>You can try your luck with <a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html" rel="nofollow noreferrer">mod_rewrite</a>.</p>
<p>Create a script that takes a local static file name as input, through e.g. <code>$_SERVER['QUERY_STRING']</code> and outputs it in compressed form. Many providers don't allow ... | 7,102 |
<p>I have a list of structs and I want to change one element. For example :</p>
<pre><code>MyList.Add(new MyStruct("john");
MyList.Add(new MyStruct("peter");
</code></pre>
<p>Now I want to change one element:</p>
<pre><code>MyList[1].Name = "bob"
</code></pre>
<p>However, whenever I try and do this I get the follow... | <pre><code>MyList[1] = new MyStruct("bob");
</code></pre>
<p>structs in C# should almost always be designed to be immutable (that is, have no way to change their internal state once they have been created).</p>
<p>In your case, what you want to do is to replace the entire struct in specified array index, not to try t... | <p>As of C#9, I am not aware of any way to pull a struct by reference out of a generic container, including <code>List<T></code>. As Jason Olson's answer said:</p>
<p><em>The real underlying issue is that structs are a Value type, not a Reference type. So when you pull out a "reference" to the struct fr... | 7,461 |
<p>I need to deploy a few files that were checked in sometime ago (can't remember the exact ones), so I'm looking to get a list so I can deploy just those files. What is the svn command to do this?</p>
| <p><code>svn log</code> has a <code>--verbose</code> parameter. I don't have a repository here to test with, but does that return a list of modified files?</p>
<p>You can also use <code>svn diff -r <revision></code> to retrieve the full change details, which you can parse or read manually to find out which files... | <p><code>svn log</code> has a <code>--verbose</code> parameter. I don't have a repository here to test with, but does that return a list of modified files?</p>
<p>You can also use <code>svn diff -r <revision></code> to retrieve the full change details, which you can parse or read manually to find out which files... | 6,684 |
<p>About two months ago, I added a heated bed to my custom 3D printer in order to print larger ABS parts for my research project. The heated bed (the PCB kind) was not new, but taken from an old printer I had built, but took apart. The bed worked well for a few weeks, but after one print finished, the glass bed above t... | <p>The problem is in the design of your bed. Let's start from the basic setup of a glass bed:</p>
<p>The heater element is usually mounted to a metal carrier, which is both spreading the thermal energy over the bed, but also is the structural element that is leveled against the carriage. Atop that comes the glass prin... | <p>I would be careful before trying another glass just hoping it will go better, since you haven't found the issue.</p>
<p>I have a PCB heated bed in direct contact (PCB copper traces on top) a 2 mm glass (plain float glass, not hardened and not borosilicate). It never broke and I've been using it intensely for the la... | 1,672 |
<p>Here's the problem, you include multiple assemblies and add 'using namespaceX' at the top of your code file.<br>
Now you want to create a class or use a symbol which is defined in multiple namespaces,
e.g. <code>System.Windows.Controls.Image</code> & <code>System.Drawing.Image</code></p>
<p>Now unless you use ... | <p>Use alias</p>
<pre><code>using System.Windows.Controls;
using Drawing = System.Drawing;
...
Image img = ... //System.Windows.Controls.Image
Drawing.Image img2 = ... //System.Drawing.Image
</code></pre>
<p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive" rel="nof... | <p>This page has a very good writeup on namespaces and the using-statement:</p>
<p><a href="http://www.blackwasp.co.uk/Namespaces.aspx" rel="noreferrer">http://www.blackwasp.co.uk/Namespaces.aspx</a></p>
<p>You want to read the part about "Creating Aliases" that will allow you to make an alias for one or both of the ... | 8,643 |
<p>How do you manage deploying InfoPath forms to different sharepoint servers? Is there a better way to deal all the data connections being site-specific without opening the forms, editing the data connections and republishing for each environment?</p>
| <p>If I understand your scenario correctly:</p>
<p>You have an InfoPath form, with data connections that submit your data.
You wish to deploy this form on multiple SharePoint Servers and have those data connections submit data to the currently deployed server.</p>
<p>You can't really get around needing to do work on ... | <p>By site-specific, do you mean that the data connections in your forms refer to the server the form is deployed to? If that's the case perhaps you could tweak your connections to use localhost instead of the server name for the hostname part of the data connection URLs.</p>
| 4,076 |
<p>What's the instruction to cause a hard-break in Xcode? For example under Visual Studio I could do '_asm int 3' or 'DebugBreak()'. Under some GCC implementations it's asm("break 0") or asm("trap").</p>
<p>I've tried various combos under Xcode without any luck. (inline assembler works fine so it's not a syntax issue)... | <p><a href="http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/090_Running_Programs/chapter_11_section_3.html" rel="noreferrer">http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/090_Running_Programs/chapter_11_section_3.html</a></p>
<pre><c... | <p>There is also the following function that is available as cross platform straight Halt() alternative:</p>
<pre><code>#include <stdlib.h>
void abort(void);
</code></pre>
<p>We use it in our cross platform engine for the iPhone implementation in case of fatal asserts. Cross platform across Nintendo DS/Wii/XBO... | 5,794 |
<p>When defining a method on a class in Python, it looks something like this:</p>
<pre><code>class MyClass(object):
def __init__(self, x, y):
self.x = x
self.y = y
</code></pre>
<p>But in some other languages, such as C#, you have a reference to the object that the method is bound to with the "thi... | <p>I like to quote Peters' Zen of Python. "Explicit is better than implicit."</p>
<p>In Java and C++, '<code>this.</code>' can be deduced, except when you have variable names that make it impossible to deduce. So you sometimes need it and sometimes don't.</p>
<p>Python elects to make things like this explicit rath... | <p>There is also another very simple answer: according to the <a href="http://www.python.org/dev/peps/pep-0020/" rel="nofollow noreferrer">zen of python</a>, "explicit is better than implicit".</p>
| 9,377 |
<p>I am using sp_send_dbmail in SQL2005 to send an email with the results in an attachment. When the attachment is sent it is UCS-2 Encoded, I want it to be ANSI or UTF-8.</p>
<p>Here is the SQL</p>
<pre><code>EXEC msdb.dbo.sp_send_dbmail
@recipients = 'temp@example.com'
, @query = 'DECLARE @string_to_trim va... | <p>After some research on SQL Server 2008 R2:</p>
<ol>
<li><p>Add to <code>sp_send_dbmail</code>:</p>
<pre><code>@ANSI_Attachment BIT = 0
WITH EXECUTE AS 'dbo'
</code></pre></li>
<li><p>Replace</p>
<pre><code>IF(@AttachmentsExist = 1)
BEGIN
.......
END
</code></pre>
<p>with:</p>
<pre><code>IF(@AttachmentsE... | <p>In order to have the file be ANSI/UTF-8 </p>
<p>alter the sp_send_dbmail that lives in the <code>msdb</code> with this line along with the other variables: <code>@ANSI_Attachment BIT = 0</code>
i.e. </p>
<pre><code>@mailitem_id INT = NULL OUTPUT,
@ANSI_Attachment BIT = 0
WITH EXECUTE AS 'dbo'
</code></p... | 6,425 |
<p>I'm new to 3D printing and have bought a resin printer.</p>
<p>Cleaning with <strong>Isopropol Alcohol</strong> seems to be the rage, however I think this is unaware of cost savings. It appears <strong>methylated spirits</strong> is ok and is 25% the cost of Isopropol Alcohol.</p>
<p>I'm now down to wondering if ... | <p>I would personally stick to isopropanol. Be aware that 3D printing is a very expensive hobby, but health wise this is a better option. Methylated spirits can quickly become dangerous, and often can burn with a close to invisible flame, meaning that you may not even see if it is burning. Also, the fumes can quickly b... | <p>Are you for real?</p>
<p>Isopropyl alcohol is less dangerous to your health than ethanol with a touch of denaturant?</p>
<p>Seriously read the MSDS sheets for the products and know what's in them before you say stuff.</p>
<p>The amount of MEK or MIBK is so small.</p>
<p>Some and not many methylated spirits have a sm... | 1,584 |
<p>We have a two-screen DirectX application that previously ran at a consistent 60 FPS (the monitors' sync rate) using a NVIDIA 8400GS (256MB). However, when we swapped out the card for one with 512 MB of RAM the frame rate struggles to get above 40 FPS. (It only gets this high because we're using triple-buffering.) Th... | <p>Are the cards exactly the same (both GeForce 8400GS), and only the memory size differ? Quite often with different memory sizes come slightly different clock rates (i.e. your card with more memory might use slower memory!).</p>
<p>So the first thing to check would be GPU core & memory clock rates, using somethin... | <p>It's an easy test to see if the surface lock is the problem, just comment out the texture update and see if the framerate returns to 60hz. Unfortunately, writing to a locked surface and updating the resource kills perfomance, always has. Are you using mipmaps with the textures? I know DX9 added automatic generatio... | 8,035 |
<p>I'm still trying to get my head around LINQ and accessing a SQL Database.</p>
<p>I was always taught that you should only have execute permissions of stored procedures to your data.</p>
<p>You should never have select / insert / update / delete.</p>
<p>(This is because of performance and security)</p>
<p>To get ... | <p>1) We're programmers, not DBA fascists. If your requirements state that the database must be locked down 100%, Linq is not for you. I'm not a DBA, so I believe that most of the performance/security hype is just that. Linq is for me.</p>
<p>2) You can do joins with linq.</p>
<p><em>@Philippe</em>: Linq automati... | <p>I'm very much in agreement with Jeff Atwood on the "Stored Procedures vs. Inline SQL/LINQ" issue: <a href="https://blog.codinghorror.com/who-needs-stored-procedures-anyways/" rel="nofollow noreferrer">Who Needs Stored Procedures, Anyways?</a>.</p>
<p>I'm confused as to why you'd even want to perform a JOIN if you'... | 7,216 |
<p>I am looking for a simple unpatented one-way encryption algorithm, preferably in c.
I would like to use it to validate passwords.</p>
| <p><a href="http://en.wikipedia.org/wiki/SHA-1" rel="nofollow noreferrer">SHA-1 and the rest of its family</a> were patented by the US government which "has released the patent under a royalty free license". Many public-domain implementations <a href="http://www.google.ca/search?q=sha+c+implementation" rel="nofollow n... | <p>MD5 has suited me fine so far.</p>
| 9,497 |
<p>I coded a Mancala game in Java for a college class this past spring, and I used the <a href="https://www.eclipse.org" rel="nofollow noreferrer" title="Eclipse">Eclipse</a> IDE to write it. One of the great (and fairly simple) visual aids in Eclipse is if you select a particular token, say a declared variable, then ... | <p>In a different question on SO (<a href="https://stackoverflow.com/questions/41908/customizing-visual-studio">link</a>), someone mentioned the VS 2005 / VS 2008 add-in "RockScroll". It seems to provide the "error bar" feature I was inquiring about in my question above.</p>
<p><a href="http://www.hanselman.com/blog/... | <p>The "error bar" functionality is provided in JetBrains ReSharper. I'm not sure if it does highlighting of references to the currently selected identifier.</p>
| 5,243 |
<p>Can I use a metal filament such as Copper, Zinc Alloy, Silver filaments on M3D Micro? <em>The Pro hasn't come out yet but I assume it would if the Micro can since the Pro is suppose to be the improvement edition.</em></p>
<p>An example of a metal filament that I found is this <a href="http://rads.stackoverflow.com/... | <p>Most 3D printers that use non-proprietary filament <em>can</em> print exotic filaments, such as the ones you mention. One thing to be aware of, though, is that some of these filaments <a href="http://makezine.com/2015/09/11/carbon-fiber-filament-ruins-nozzles/" rel="noreferrer">wear down the nozzle</a> far more quic... | <p>It is my understanding that the metals are so fine and mixed in with other ingredients that you cannot tell that there is metal at all. But looks like its 100% metals.</p>
| 329 |
<p>I love PrusaSlicer but I am having a problem.
As you can see in the picture the head makes movements that seem useless<a href="https://i.stack.imgur.com/1CLrS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1CLrS.png" alt="Previsualisation" /></a></p>
<p>(blue lines that come out of the print in t... | <p>I found the solution :
It was the option "avoid crossing perimeters" that seems to do exactly the contrary of what it means.
Thank you all for your answers.</p>
| <p>Enable Z-Hop. I don't know what the actual parameter is called but it should say something like "Z-Hop".</p>
| 1,759 |
<p>I recently had a problem with the z-axis of my printer. To resolve the issue with the Z axis not moving I remove the left polished rod. Am I able to use the printer with just one smooth rod?</p>
| <p>First a resounding no. Not a good idea. Are you saying it works now that you have removed the smooth rod?</p>
<p>That tells me for sure your issue was Binding. Which is a tricky problem to solve. Binding usually happens when your carriage is not level. Take a bubble leveler and verify.</p>
<p>Another time it happe... | <p>No, this is not a good idea. Your X axis is now free to rotate by a few degrees around the remaining Z rod. Parts may appear to print OK, but depending on the dynamics of a print, you will see offsets between layers. You need to resolve the issues with your Z-axis.
These questions, <a href="https://3dprinting.stack... | 470 |
<p>VB 6.0 does not have any global handler.To catch runtime errors,we need to add a handler in each method where we feel an error can occur.But, still some places might be left out.So,we end up getting runtime errors.Adding error handler in all the methods of an application,the only way?</p>
| <p>No there is no way to add a global error handler in VB6. However, you do not need to add an error handler in every method. You only really need to add an error handler in every event handler. E.g. Every click event,load event, etc</p>
| <p>on error resume next - is kinda close but its been a while.
you might want to look up any caveats</p>
| 9,072 |
<p>I want to make some prints of pressure resistants. I am currently trying to print a simple cylinder to find the best parameters to make my prints airtight (by airtight I mean, it needs to resist to 10 bar).</p>
<p>Here is the test model that I have made for this:</p>
<p><a href="https://i.stack.imgur.com/IQyNO.png" ... | <p>This is going to be hard. Even holding a vacuum is hard (I've tried it and not succeeded). I'm not sure what the mechanism of air molecules getting thru the print is - whether it's defects in inter-layer bonding, defects at seams, imperfect mating with the fitting, or even permeability of the plastic itself. It migh... | <h2>Not without postprocessing</h2>
<p>FDM is pretty much welding plastic to plastic. Many many layers. Each of them is a potential breaking point, a corner for stress to arise and break the print.</p>
<h2>Easy with a hollow body</h2>
<p>Printing a hollow item that can be filled with resin is comparatively easy. Once f... | 2,198 |
<p>I have a bunch of perfmon files that have captured information over a period of time. Whats the best tool to crunch this information? Idealy I'd like to be able to see avg stats per hour for the object counters that have been monitored.</p>
| <p>Perhaps look into using <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en" rel="nofollow noreferrer">LogParser</a>.
It depends on how the info was logged (Perfmon doesn't lack flexibility)</p>
<p>If they're CSV you can even use the ODBC Text dr... | <p>Take a look at SmartMon (www.perfmonanalysis.com). It analyzes Perfmon data in CSV and SQL Server databases.</p>
| 4,676 |
<p>Every now and then in a high volume .NET application, you might see this exception when you try to execute a query:</p>
<blockquote>
<p>System.Data.SqlClient.SqlException: A transport-level error has
occurred when sending the request to the server.</p>
</blockquote>
<p>According to my research, this is someth... | <p>I posted <a href="https://stackoverflow.com/questions/154897/what-do-you-do-if-you-cannot-resolve-a-bug#155077">an answer on another question</a> on another topic that might have some use here. That answer involved SMB connections, not SQL. However it was identical in that it involved a low-level transport error.<... | <p>You should also check hardware connectivity to the database.</p>
<p>Perhaps this thread will be helpful:
<a href="http://channel9.msdn.com/forums/TechOff/234271-Conenction-forcibly-closed-SQL-2005/" rel="nofollow noreferrer">http://channel9.msdn.com/forums/TechOff/234271-Conenction-forcibly-closed-SQL-2005/</a></p>... | 3,731 |
<p>We need to add WorkFlow to our Spring managed application. Does anyone have any useful experience in using any of the myriad of OSS Work Flow solutions? Which one is best? Which one integrates with Spring best? Which ones should we avoid?</p>
| <p>If you only need some simple process orchestration, Spring's own <a href="http://springframework.org/webflow" rel="nofollow noreferrer">Web Flow</a>, despite its name can serve as a orchestration task manager. If you need to preserve state for several days then you will need to become an 'early adopter' of one of ... | <p>We're looking at Drools/Guvnor, possibly integrated with jBPM (as in this <a href="http://www.firstpartners.net/blog/technology/java/2008/06/05/jboss-business-rules-and-jbpm-workflow-presentation-dublin/" rel="nofollow noreferrer">presentation</a>), to add a workflow engine to our Spring/Java EE app, but we're still... | 3,044 |
<p>The default <strong>asp.net</strong> membership provider uses a <code>.mdf</code> sql server database file in the <code>app_code</code> database.<br>
How scalable is this in terms of calling a flat file database instead of running it in a standard sql environment?<br>
Is this recommended only for small/medium traffi... | <p>It's a reasonable trade off for any site that can run on one server. It's fairly reasonable for small to medium traffic sites.</p>
<p>When you grow to a point of a web farm, then you'll be better off with a separate server. Also, depending on how database dependent your application is, you may find better performan... | <p>I wouldn't recommend this for anything but a "learning" project.</p>
<p>For any real application, regardless of size, you don't know what type of "next feature" you will add. You want to have a real independent database in which you can delegate functionality to, in which you can set jobs to run independently, sit ... | 7,961 |
<p>Is there a simple way in Perl that will allow me to determine if a given variable is numeric? Something along the lines of:</p>
<pre><code>if (is_number($x))
{ ... }
</code></pre>
<p>would be ideal. A technique that won't throw warnings when the <code>-w</code> switch is being used is certainly preferred.</p>
| <p>Use <code>Scalar::Util::looks_like_number()</code> which uses the internal Perl C API's looks_like_number() function, which is probably the most efficient way to do this.
Note that the strings "inf" and "infinity" are treated as numbers.</p>
<h2>Example:</h2>
<pre><code>#!/usr/bin/perl
use warnings;
use strict;
... | <p>if ( defined $x && $x !~ m/\D/ ) {}
or
$x = 0 if ! $x;
if ( $x !~ m/\D/) {}</p>
<p>This is a slight variation on Veekay's answer but let me explain my reasoning for the change.</p>
<p>Performing a regex on an undefined value will cause error spew and will cause the code to exit in many if not most environm... | 3,373 |
<p>What tools are there available for static analysis against C# code? I know about FxCop and StyleCop. Are there others? I've run across NStatic before but it's been in development for what seems like forever - it's looking pretty slick from what little I've seen of it, so it would be nice if it would ever see the lig... | <p><strong>Code violation detection Tools:</strong></p>
<ul>
<li><p><a href="https://msdn.microsoft.com/en-us/library/bb429476(v=vs.80).aspx" rel="noreferrer">FxCop</a>, excellent tool by Microsoft. Check compliance with .NET framework guidelines.</p>
<p><strong>Edit October 2010:</strong> No longer available as a stan... | <p>I find the <a href="http://www.codeplex.com/reflectoraddins/Wiki/View.aspx?title=CodeMetrics&referringTitle=Home" rel="nofollow noreferrer">Code Metrics</a> and <a href="http://www.tom-carter.net/" rel="nofollow noreferrer">Dependency Structure Matrix</a> add-ins for Reflector very useful.</p>
| 5,955 |
<p>Best recommendations for accessing and manipulation of sqlite databases from JavaScript.</p>
| <p>Well, if you are working on client side JavaScript, I think you will be out of luck... browsers tend to sandbox the JavaScript environment so you don't have access to the machine in any kind of general capacity like accessing a database.</p>
<p>If you are talking about an SQLite DB on the server end accessed from t... | <p>On a Mac? Take a look at Gus Meuller's JSTalk, which leverages Scripting Bridge and Patrick Geiller's JSCocoa.</p>
<p>Gus talks specifically about the Sqlite support here: <a href="http://gusmueller.com/blog/archives/2009/03/jstalk_extras.html" rel="nofollow noreferrer">http://gusmueller.com/blog/archives/2009/03/j... | 8,732 |
<p>Is it possible to use the Asp.Net MVC framework within SharePoint sites?</p>
| <p>In ScottGu's <a href="http://weblogs.asp.net/scottgu/archive/2008/02/12/asp-net-mvc-framework-road-map-update.aspx" rel="noreferrer">blog from February 2008</a>, he writes:</p>
<blockquote>
<p>Currently MVC doesn't directly
integrate with SharePoint. That is
something we'll be looking at
supporting in the ... | <p>I don't believe so, although you can upload standard ASPX files into SharePoint and have them operate I'm pretty sure that the URL rewritting is where it would come unstuck.</p>
| 9,631 |
<p>I'm working on a project using the <a href="http://antlr.org" rel="noreferrer">ANTLR</a> parser library for C#. I've built a grammar to parse some text and it works well. However, when the parser comes across an illegal or unexpected token, it throws one of many exceptions. The problem is that in some cases (not ... | <p>I believe I understand the problem. The exception is being caught, the issue is confusion over the debugger's behavior and differences in the debugger settings among each person trying to repro it.</p>
<p>In the 3rd case from your repro I believe you are getting the following message: "NoViableAltException was unha... | <blockquote>
<p>"Also, you can put some code in to
catch all unhandled exceptions. Read
the link for more info, but the basics
are these two lines."</p>
</blockquote>
<p>This is false. This used to catch all unhandled exceptions in .NET 1.0/1.1 but it was a bug and it wasn't supposed to and it was fixed in .NE... | 5,664 |
<p><strong>Definition:</strong></p>
<p><em>A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction</em></p>
<p>How to check if the given string is a palindrome?</p>
<p>This was one of the FAIQ [Frequently Asked Interview Question] a while ago bu... | <p><strong>PHP sample</strong>:</p>
<pre><code>$string = "A man, a plan, a canal, Panama";
function is_palindrome($string)
{
$a = strtolower(preg_replace("/[^A-Za-z0-9]/","",$string));
return $a==strrev($a);
}
</code></pre>
<p>Removes any non-alphanumeric characters (spaces, commas, exclamation points, etc.)... | <p>Another one from Delphi, which I think is a little more rigorous than the other Delphi example submitted. This can easily turn into a golfing match, but I've tried to make mine readable.</p>
<p><em>Edit0: I was curious about the performance characteristics, so I did a little test. On my machine, I ran this functi... | 7,523 |
<p>I'm writing a simple photo album app using ASP.NET Ajax.<br>
The app uses async Ajax calls to pre-load the next photo in the album, without changing the URL in the browser.</p>
<p>The problem is that when the user clicks the <strong>back</strong> button in the browser, the app doesn't go back to the previous photo,... | <p><strong>Update: There is now the HTML5 History API (pushState, popState) which deprecates the HTML4 <code>hashchange</code> functionality. <a href="https://github.com/balupton/history.js" rel="nofollow noreferrer">History.js</a> provides cross-browser compatibility and an <a href="https://github.com/balupton/history... | <p>The 3.5 SP1 update has support for browser history and back button in ASP.NET ajax now.</p>
| 4,974 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.