instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I want to buy my first FDM printer, to print household items and wearable gadgets too big for my LCD resin one. Due to financing & tax reasons, what I'll buy now is what I will have for at least a year.</p>
<p>I was thinking about <a href="https://www.prusa3d.com/product/original-prusa-i3-mk3s-kit-3/" rel="nofol... | <p>I would go back to the brass nozzle and try again for comparison.</p>
<p>We had a batch of 10 cheap steel nozzles all of which caused problems.</p>
| <p>I think the answer is printing temperature. This shiny PLA I'm using is Eryone Silk PLA. Although the working temperature is stated as 190-220 °C, my 205 °C was too much for it. A temperature of 190-195 °C produces good results though not as shiny anymore. It is three layers printed on the sample below with no probl... | 2,222 |
<p>I am creating a 3D printed part which will act as an attachment between a plate (actually a strain gauge) with two M2.5 bolts and a 2kg load with a single M4 bolt. I wouldn't be happy with tapping a screw thread into the print itself so I want to try embedding the nuts into the print itself - so I'll pause the print... | <p>It could depend on how well your printer-filament type combination can bridge. If you can generate bridges wider than the washer diameter, then print not only the hex recess but a disc recess for the washer, then print over both.</p>
<p>However, my preference would be to redesign the part so that the washer&h... | <p>If your nut will be exposed, you can simply insert it into the printed cavity and then seat it in place by heating it with a soldering iron.</p>
| 572 |
<p>Please consider the following example. Note that in the real-word, the binding source will likely be a data object. I'm using a <code>TextBlock</code> for simplicity.</p>
<pre><code><Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microso... | <p>You can do this manually just before the save using:</p>
<pre><code>txt_Name.GetBindingExpression(TextBox.TextProperty).UpdateTarget();
</code></pre>
<p>A bit ugly, but it works.</p>
| <p>You can also change focus in your click handler before reading the value, for example forcing the focus to the button or to another text box</p>
<p>This is another "ugly, but it works" solution, it may be appropriate if you have a lot of controls or don't want to mess with their binding expressions. </p>
| 37,856 |
<p>I'm looking to inspect SQL statements in Java/jdbc code to ensure that the SQL to be executed is of acceptable quality. Neither PMD not Findbugs appears to have JDBC or sql rules. I could use p6spy to log the SQL and look at that way, but this is manual. </p>
<p>I'm wondering if the strategy of of using PMD/Findbu... | <p>This is a tricky problem. Comparison operators like <code>=</code> and <code>IN()</code> are some cases, but there's also: <code>!= <> < <= > >= LIKE</code>.</p>
<p>How do you spot cases of interpolating application variables as literals in expressions?</p>
<pre><code>String sql = "SELECT *, " ... | <p>Do you have the ability to completely test the application with a debugger connected to it?</p>
<p>Set a breakpoint in your JDBC driver's implementation of Connection.createStatement(), and run the app... (or if using a driver for which you don't have source code, write a fake driver that just delegates calls to th... | 44,497 |
<p>I seldom use inheritance, but when I do, I never use protected attributes because I think it breaks the encapsulation of the inherited classes.</p>
<p>Do you use protected attributes ? what do you use them for ?</p>
| <p>In this <a href="http://www.artima.com/intv/blochP.html" rel="noreferrer">interview</a> on Design by Bill Venners, Joshua Bloch, the author of <em>Effective Java</em> says:</p>
<blockquote>
<h2>Trusting Subclasses</h2>
<p><strong>Bill Venners:</strong> <em>Should I trust subclasses more intimately than
non... | <p>In general, no you really don't want to use protected data members. This is doubly true if your writing an API. Once someone inherits from your class you can never really do maintenance and not somehow break them in a weird and sometimes wild way. </p>
| 10,176 |
<p>I'm looking for the best way to take a simple input:</p>
<pre><code>echo -n "Enter a string here: "
read -e STRING
</code></pre>
<p>and clean it up by removing non-alphanumeric characters, lower(case), and replacing spaces with underscores.</p>
<p>Does order matter? Is <code>tr</code> the best / only way to go ab... | <p>As dj_segfault points out, the shell can do most of this for you. Looks like you'll have to fall back on something external for lower-casing the string, though. For this you have many options, like the perl one-liners above, etc., but I think tr is probably the simplest.</p>
<pre><code># first, strip underscores
... | <p>After a bit of looking around it seems <code>tr</code> is indeed the simplest way:</p>
<pre><code>export CLEANSTRING="`echo -n "${STRING}" | tr -cd '[:alnum:] [:space:]' | tr '[:space:]' '-' | tr '[:upper:]' '[:lower:]'`"
</code></pre>
<p><a href="http://en.wikipedia.org/wiki/Occam's_Razor" rel="nofollow nore... | 11,512 |
<p><strong>What are the best practices for naming unit test classes and test methods?</strong></p>
<p>This was discussed on SO before, at <a href="https://stackoverflow.com/questions/96297/naming-conventions-for-unit-tests">What are some popular naming conventions for Unit Tests?</a></p>
<p>I don't know if this is a ... | <p><strong>Update (Jul 2021)</strong></p>
<p>It's been quite a while since my original answer (almost 12 years) and best practices have been changing a lot during this time. So I feel inclined to update my own answer and offer different naming strategies to the readers.</p>
<p>Many comments and answers point out that t... | <p>In VS + NUnit I usually create folders in my project to group functional tests together. Then I create unit test fixture classes and name them after the type of functionality I'm testing. The [Test] methods are named along the lines of <code>Can_add_user_to_domain</code>:</p>
<pre><code>- MyUnitTestProject
+ F... | 18,800 |
<p>Ok. I'm having an issue with the following bit of code:</p>
<pre><code>StreamReader arrComputer = new StreamReader(FileDialog.FileName);
</code></pre>
<p>My first question had been answered already now my second question focuses on the tail end of this code.</p>
<p>I'm reading a text file <code>StreamReader</cod... | <p>Looks to me like you're creating a new OpenFileDialog object in your button1_Click method, and storing the only reference to that object in a local variable, fileDialog.</p>
<p>Then, in your buttonRun_Click method, it looks like you wanted to get the file name from the dialog you created in the previous method. Tha... | <p>Is <code>FileDialog</code> the name of your control, or the type of the control? I'm guessing it's the type. When you drag a file dialog into your window, you get a FileDialog named FileDialog1. Try that and let me know.</p>
| 35,282 |
<p>I have some critical logic in a finally block (with an empty try block), because I want to guarantee that the code gets executed even if the thread is aborted. However, I'd also like to detect the ThreadAbortException. I've found that wrapping my critical try/finally block in a try/catch does not catch the ThreadAbo... | <p>This is a curious problem.</p>
<p>The code you posted <em>should</em> work. It seems there's some kind of optimization going on that decides not to call your catch handler.</p>
<p>So, I wanted to detect the exception with this:</p>
<pre><code>bool threadAborted = true;
try {
try { }
finally { /* critical code... | <p>I agree with arul.
Calling Thread.Abort() is a sign of bad design.</p>
<p>Let me quote Peter Ritchie from <a href="http://msdn.microsoft.com/en-us/library/ty8d3wta.aspx" rel="nofollow noreferrer" title="MSDN: Thread.Abort()">MSDN: Thread.Abort</a> (emphasis is mine):</p>
<blockquote>
<p><strong>There's many reas... | 46,008 |
<p>Well, this is my first post here and really enjoying the site.</p>
<p>I have a very basic (ugly as sin) site I have started and for some reason, I can not get the CSS Sticky footer to work for FireFox. IE works but FF shows it halfway up the page.</p>
<p>The URL is <a href="http://dev.aipoker.co.uk" rel="nofollow... | <p>Try this <a href="http://boagworld.com/dev/fixed-footers-without-javascript/" rel="nofollow noreferrer">one</a>, it works well on Firefox. </p>
<p>BTW, you should listen to Boagworld's podcast if you don't already. It's brilliant! :)</p>
<p>Cheers.</p>
| <p>The minimal changes I can see to do this would be:</p>
<ul>
<li>move footerSection inside of body</li>
<li>set position absolute on both body and footerSection</li>
<li>set bottom = 0px on footerSection</li>
</ul>
<p>which ends up with something like this in your head:</p>
<pre><code><style type="text/css">... | 19,290 |
<p>In Python, the where and when of using string concatenation versus string substitution eludes me. As the string concatenation has seen large boosts in performance, is this (becoming more) a stylistic decision rather than a practical one?</p>
<p>For a concrete example, how should one handle construction of flexible ... | <p>Concatenation is (significantly) faster according to my machine. But stylistically, I'm willing to pay the price of substitution if performance is not critical. Well, and if I need formatting, there's no need to even ask the question... there's no option but to use interpolation/templating.</p>
<pre><code>>>&... | <p>Actually the correct thing to do, in this case (building paths) is to use <code>os.path.join</code>. Not string concatenation or interpolation</p>
| 49,279 |
<p>Is there any way of using Memcached for fragment caching in Rails?</p>
| <p>You can set the fragment_cache_store in your environment.rb</p>
<pre><code> ActionController::Base.cache_store = ActiveSupport::Cache::MemCacheStore.new()
</code></pre>
<p><a href="http://api.rubyonrails.org/classes/ActionController/Caching.html#M000628" rel="nofollow noreferrer">http://api.rubyonrails.org/classe... | <p>You can set the fragment_cache_store in your environment.rb</p>
<pre><code> ActionController::Base.cache_store = ActiveSupport::Cache::MemCacheStore.new()
</code></pre>
<p><a href="http://api.rubyonrails.org/classes/ActionController/Caching.html#M000628" rel="nofollow noreferrer">http://api.rubyonrails.org/classe... | 32,234 |
<p>So there seems to be this problem with GNU Make's $(wildcard) function keeping a directory open on Windows. See (unasnwered) post "<a href="http://www.cygwin.com/ml/cygwin/2003-06/msg01182.html" rel="nofollow noreferrer">make is holding a directory open</a>". Google does not provide much information on the topic.</p... | <p>Sounds like a file descriptor leak, all right -- harmless for very-short-lived processes (like make) on UNIX, but a right PITA on Windows.</p>
<p>As this is allegedly a bug in make, as opposed to a problem with its usage, it should be addressed first by validating that it still exists when built from source on the ... | <p>I did find a <strong>workaround</strong> for the problem, which at least lets me work in peace.</p>
<p>The problem was that the <code>$(wildcard)</code> function was used to collect the sources files. My clean rule, however, only deletes a directory - no need for the collecting to take please. So I basically put th... | 24,970 |
<p>I want to make sure that a set of functions have the same signature in some C code. Ideally I would be able to define a new type that described the return value and arguments of a function and then declare my set of functions using this new type. </p>
<p>Additionally, is there a way to specify default values for th... | <pre><code>/* define a typedef for function_t - functions that return void */
/* and take an int and char parameter */
typedef void function_t( int param1, char param2);
/* declare some functions that use that signature */
function_t foo;
function_t bar;
</code></pre>
<p>Now when you define the functions ther... | <p>This is similar to how a function pointer works:</p>
<pre><code> // Declaration of function with int arg returning int
typedef int (*CALLBACK)(int);
//Definition
int myFunc(int arg)
{
return 0;
}
// Function pointer usage
CALLBACK pFunc = myFunc;
</code></pre>
| 22,861 |
<p>I don't have a Rails environment set up and this is actually quite hard to find a quick answer for, so I'll ask the experts.</p>
<p>When Rails creates a table based on your "model" that you have set up, does Rails create a table that mirrors this model exactly, or does it add in more fields to the table to help it ... | <p>In ActiveRecord, models are created from database tables, not the other way around.</p>
<p>You may also want to look into Migrations, which is a way of describing and creating the database from Ruby code. However, the migration is not related to the model; the model is still created at runtime based on the shape of... | <p><a href="http://api.rubyonrails.com/classes/ActiveRecord/Base.html" rel="nofollow noreferrer">Here</a>'s the official documentation for ActiveRecord. It agrees with Brad. You might have seen either a different access method or a migration (which alters the tables and thus the model)</p>
| 20,883 |
<p>I'm specifically thinking about the BugMeNot service, which provides user name and password combos to a good number of sites. Now, I realize that pay-for-content sites might be worried about this (and I would suspect that most watch for shared accounts), but how about other sites? Should administrators be on the loo... | <p>I think it depends on the aim of your site. If usage analytics are all-important, then this is something you'd have to watch out for. If advertising is your only revenue stream, then does it really matter which username someone uses?</p>
<p>Probably the best way to discourage use of bugmenot accounts is to make it ... | <p>From an administrator viewpoint absolutely. That registration is required for a reason, even if it's something just as simple as user tracking/profile maintaining. Several thousand people using that login entirely defeats the purpose. IP tracking could help mitigate this problem, but it would definitely be hard ... | 20,272 |
<p>I've got a spreadsheet with plenty of graphs in it and one sheet with loads of data feeding those graphs.</p>
<p>I've plotted the data on each graph using </p>
<pre><code>=Sheet1!$C5:$C$3000
</code></pre>
<p>This basically just plots the values in C5 to C3000 on a graph.</p>
<p>Regularly though I just want to lo... | <p>OK, I had to do a little more research, here's how to make it work,
completely within the spreadsheet (without VBA):</p>
<p>Using A1 as the end of your desired range,
and the chart being on the same sheet as the data: </p>
<p>Name the first cell of the data (C5) as a named range, say TESTRANGE.<br>
Created a name... | <p>An easy way to do this is to just hide the rows/columns you don't want included - when you go to the graph it automatically excludes the hidden rows/columns</p>
| 24,114 |
<p>If you need to open a SqlConnection before issuing queries, can you simply handle all non-Open ConnectionStates in the same way? For example:</p>
<pre><code> if (connection.State != ConnectionState.Open)
{
connection.Open();
}
</code></pre>
<p>I read somewhere that for ConnectionState.Broken th... | <p><a href="http://msdn.microsoft.com/en-us/library/system.data.connectionstate.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.data.connectionstate.aspx</a></p>
<p>Broken connection state does need to be closed and reopened before eligible for continued use.</p>
<p>Edit: Unfortunately closing a... | <p>You can handle it the same way. I was getting numerous connection state == broken while using IE9. There is something fundamentally wrong with IE9 in this regard since no other browser had this issue of broken connection states after 5 or 6 updates to the database tables. So I use object context. So basically ju... | 12,913 |
<p>I'm attaching a picture to show my issue. I'm hoping might be an easy settings fix, or at least maybe someone has a couple suggestions I can try. I'm using an Ender 3, and the program Cura. The print on the left was printed with the opening facing up. The print on the right with the hole facing down. The support lea... | <p>There's only so much you can do about this without a multi-material printer that can utilize dissolvable material or material that doesn't bond to the print material, and print the supports at zero distance from the model. So expect it to be ugly. But not quite that ugly.</p>
<p>Slicers, including Cura, have options... | <p>You cannot print into the air (hot filament will sag when not supported). Do remember that even with support enabled, you are printing into air. This is because there is always a gap between the print object and the support structure, the option is called <code>Z distance</code>. If there wasn't a gap, the print obj... | 2,197 |
<p>There are similar question, but not regarding C# libraries I can use in my source code.</p>
<p>Thank you all for your help.</p>
<p>I've already saw lucene, but I need something more easy to search for similar strings and without the overhead of the indexing part.</p>
<p>The answer I marked has got two very easy a... | <p>Levenshtein distance implementation: </p>
<ul>
<li><a href="http://www.dotnetperls.com/levenshtein" rel="noreferrer">Using LINQ</a> (not really, see comments) </li>
<li><a href="http://web.archive.org/web/20110720094521/http://www.merriampark.com/ldcsharp.htm" rel="noreferrer">Not using LINQ</a></li>
</ul>
<p>I ha... | <p>The <a href="http://beagle-project.org/Main_Page" rel="nofollow noreferrer">Beagle Project</a> for Linux is written in c# (mono) and is a google-desktop like search tool. It may have some code in there for these kind of string matching.</p>
<p>If I recall correctly, it uses the <a href="http://en.wikipedia.org/wiki... | 10,935 |
<p><strong>NOTE</strong>: I mention the next couple of paragraphs as background. If you just want a TL;DR, feel free to skip down to the numbered questions as they are only indirectly related to this info.</p>
<p>I'm currently writing a python script that does some stuff with POSIX dates (among other things). Unit ... | <p>I agree with Federico - randomised testing is counterproductive. If a test won't reliably pass or fail, it's very hard to fix it and know it's fixed. (This is also a problem when you introduce an unreliable dependency, of course.)</p>
<p>Instead, however, you might like to make sure you've got good data coverage in... | <p>Random testing has the huge advantage that individual tests can be generated for extremely low cost. This is true even if you only have a partial oracle (for example, does the software crash?)</p>
<p>In a complex system, random testing will find bugs that are difficult to find by any other means. Think about wha... | 31,953 |
<p>I wrote a small WPF app where I like to prepend text into a RichTextBox, so that the newest stuff is on top. I wrote this, and it works: </p>
<pre><code> /// <summary>
/// Prepends the text to the rich textbox
/// </summary>
/// <param name="textoutput">The text representing the cha... | <p>Try the following:</p>
<pre><code>BitmapImage bi = new BitmapImage(new Uri(@"C:\SimpleImage.jpg"));
Image image = new Image();
image.Source = bi;
InlineUIContainer container = new InlineUIContainer(image);
Paragraph paragraph = new Paragraph(container);
RichTextBoxOutput.Document.Blocks.Add(paragraph);... | <p>RickTextbox.Document is a FlowDocument to which you can add almost anything that implements ContentElement. That includes Image, Label, StackPanel and all your other WPF favourites.</p>
<p>Check out the <a href="http://msdn.microsoft.com/en-us/library/aa970909.aspx" rel="nofollow noreferrer">FlowDocument Overview</... | 24,240 |
<p>My PM just stopped by and he wanted a copy of all of our pages... Is there a way to do this for all pages without having to go to each one?</p>
| <p>Free/Open Source application to crawl you're own site:</p>
<blockquote>
<p><a href="http://www.httrack.com/" rel="nofollow noreferrer">http://www.httrack.com/</a></p>
</blockquote>
<p>Then send the resulting local html files to the printer.</p>
<hr>
<p>Should mention that httrack has <a href="http://www.httrac... | <p>This is a really crazy idea but how about this: </p>
<p>Get a list of all the pages in an array and use JavaScript to load each page with an interval of like 20 seconds. When the page gets loaded fire the window.print() Javascript function. The print job will be finished within 20 seconds and the new page gets load... | 24,709 |
<p>I have found that SP2 doesn't execute from within SP1 when SP1 is executed.</p>
<p>Below is the structure of SP1:</p>
<pre><code>ALTER PROCEDURE SP1 AS BEGIN
Declare c1 cursor....
open c1 fetch next from c1 ...
while @@fetch_status = 0 Begin
...
Fetch Next from c1 end
close c1
deallocate c1
exec sp2
end
<... | <p>What happens if you run the Stored Procedure code as a single query? If you put a <code>PRINT</code> statement before and after the exec, do you see both outputs?</p>
<ul>
<li>If you do, then the stored procedure must have been executed. Probably it's not doing what you would like.</li>
<li>If you don't see any pri... | <p>I am not sure if it helps you, but from my experience the most popular reasons are:</p>
<ol>
<li><code>sp2</code> gets some parameter which makes it <code>null</code> value -- i.e. you build its name from the strings and one of them is <code>null</code>.</li>
<li><code>sp2</code> has some conditions inside and none... | 20,562 |
<p>I want to call <code>ShowDialog()</code> when a keyboard hook event is triggered, but I'm having some difficulties:</p>
<ul>
<li>ShowDialog() blocks, so I can't call it from the hook triggered event, because it will block the OS.</li>
<li>I can start a new thread and call <code>ShowDialog()</code> from there, but I... | <p>The problem may be that you are trying to put UI in a non-UI thread. Make your event fire from another thread and invoke the method that runs <code>ShowDialog()</code> from your UI thread.</p>
<p>Essentially, you want to keep your UI on the UI thread and move anything else to a back ground thread.</p>
<p>Check out... | <p>ShowDialog() will block your application's thread, but that's what it's supposed to do. If you don't want the form blocking your application, call Show() instead.</p>
<p>ShowDialog() will not "block the OS", so don't be reluctant to use it.</p>
| 21,306 |
<p>this question can create a misunderstanding: I know I have to use CSS to validate successfully my document as XHTML 1.0 Transitional. The fact is that I have to embed in my webpage a picture composed by zeros and ones created with <a href="http://www.text-image.com/index.html" rel="noreferrer" title="text image">tex... | <p>You could replace</p>
<p><code><font color="#000000">0001100000101101100011</font></code></p>
<p>with</p>
<p><code><span style="color:#000000">0001100000101101100011</span></code></p>
<p>etc...</p>
<p>*Edit: I know this is CSS, but it doesn't involve a separate stylesheet like the questi... | <p>Why does it need to validate? </p>
<p>The solution you've already got is absolutely fine for what you're doing. It works. This is not a meaningful document that should be marked up with semantic tags for improved accessibility; it's a work of art, so feel free to ignore the rules if it helps you express your intent... | 46,769 |
<p>The <a href="http://developer.apple.com/documentation/AppleApplications/Reference/SafariWebContent/UsingiPhoneApplications/chapter_6_section_4.html" rel="nofollow noreferrer">Apple Developer Documentation</a> (link is dead now) explains that if you place a link in a web page and then click it whilst using Mobile Saf... | <p>For iOS 5.1.1 and lower, use the <code>openURL</code> method of <code>UIApplication</code>. It will perform the normal iPhone magical URL reinterpretation. so</p>
<pre><code>[someUIApplication openURL:[NSURL URLWithString:@"http://maps.google.com/maps?q=London"]]
</code></pre>
<p>should invoke the Google maps app.... | <p>If you need more flexibility than the Google URL format gives you or you would like to embed a map in your application instead of launching the map app <a href="https://sourceforge.net/projects/quickconnect" rel="nofollow noreferrer">here is an example</a>.</p>
<p>It will even supply you with the source code to do ... | 4,990 |
<p>Given an existing valid SVG document, what's the best way to create "informational popups", so that when you hover or click on certain elements (let's say ) you popup a box with an arbitrary amount (i.e. not just a single line tooltip) of extra information?</p>
<p>This should display correctly at least in Firefox a... | <pre><code><svg>
<text id="thingyouhoverover" x="50" y="35" font-size="14">Mouse over me!</text>
<text id="thepopup" x="250" y="100" font-size="30" fill="black" visibility="hidden">Change me
<set attributeName="visibility" from="hidden" to="visible" begin="thingyouhoverover.mouseover"... | <p>This should work:</p>
<pre><code>nodeEnter.append("svg:element")
.style("fill", function(d) { return d._children ? "lightsteelblue" : "#fff"; })
.append("svg:title")
.text(function(d) {return d.Name+"\n"+d.Age+"\n"+d.Dept;}); // It shows the tool tip box with item [Name,Age,Dept] and upend to the svg dynam... | 12,799 |
<p>We have an ASP.NET application running at a customer site that uses ActiveDirectory for user login via the ActiveDirectoryMembershipProvider. Their primary domain controller that we were pointing to went down this morning, and in getting everything set back up the client was wondering if we could have a redundant co... | <p>If ActiveDirectory couldn't handle multiple domain controllers then it wouldn't be a very good technology.</p>
<p>You just need to make sure in your Membership configuration you are pointing to the 'Domain' rather than the 'Server' and then add two or more controllers to your domain.</p>
<p>Generally if you are re... | <p>It can be done, it will just take some work.</p>
<p>You will need to create a class that inherits off of the ActiveDirectoryMemberhsipProvider and use it has your provider instead. That way you can maintain most of the functionality. Then setup a way to specify two connectionStringName properties, one for primary... | 7,797 |
<p>could someone provide working example (full maven plugin configuration) how to copy built jar file to a specific server(s) at the time of deploy phase?</p>
<p>I have tried to look at wagon plugin, but it is hugely undocumented and I was not able to set it up. The build produces standard jar that is being deployed t... | <p>Actually I have found a different way:
Dependency plugin!</p>
<pre><code><plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-to-ebs</id>
<phase>deploy... | <p>I don't have a working example but the <a href="http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html" rel="nofollow noreferrer">"Maven Assembly Plugin"</a> should do the job. You can configure it to run automatically in the deploy phase.<br>
When you write your own assembly descriptor you can specify ... | 31,044 |
<p>I have got a problem that after upgrading my printer to an aluminum frame my extruder went from around 400 steps per mm at 16 micro steps (which did match the manufacturer's recommendation perfectly) to a bit over 1000 steps per mm at 16 micro steps.</p>
<p>This is a problem for me, since the limited amount of steps... | <p>Ok, thanks everyone for at least taking time to read or thinking about this.</p>
<p>The Problem is an absolute mess and there are two possible reasons:</p>
<p>-> the octoprint eeprom editor is broken</p>
<p>-> the ATMega2560's eeprom is broken. as far as i know companies buy used atmegas to cheapen the price and ... | <p>After a rebuild, and certainly after changing to another extruder (e.g. replacing it by a geared extruder like you supposedly did as taken from the comments above before the edit, which now clearly is not the case) or setup e.g. other stepper drivers, you should always calibrate the extruder. </p>
<p>To calibrate y... | 935 |
<p>I'm begginer in java I'm reading data from serial port and I have stored the data in string array data is 24 byte length.</p>
<p>Data I'm getting as output: 12120814330006050.0 </p>
<p>data also contains hexadecimal character in the string I want to read first character of the string. I have done:</p>
<pre><code>... | <p>single characters you can get from a string with</p>
<pre><code>str.getChar(0);
</code></pre>
<p>When you know that the string contains hex values in every character you dont have to convert every single character. You can put the complete string in and get the dec value of the hex string back. Otherwise you only ... | <p>Java strings are unicode - so the bytes have already been decoded using some encoding (probably UTF-8?). </p>
<p>So:</p>
<ol>
<li>Check the contents of the string.</li>
<li>Check the contents of the substring.</li>
</ol>
| 47,280 |
<p>I am running an Ender 3 pro with an Octoprint connected. I accidentally set the print speed too slow in Cura and the print will take very long. Is there a Marlin command I can issue to the printer to speed it up without stopping the print?</p>
| <h1>yes</h1>
<p>Print speed is a setting that can be altered by just turning the click-wheel of the Ender 3. You don't need to push it to gain access to menus. A turn to the right does increase the speed, left lowers it. It is applied only some moments after
stopping the turning - then the firmware does inject a <code>... | <h1>yes</h1>
<p>Print speed is a setting that can be altered by just turning the click-wheel of the Ender 3. You don't need to push it to gain access to menus. A turn to the right does increase the speed, left lowers it. It is applied only some moments after
stopping the turning - then the firmware does inject a <code>... | 1,769 |
<p>Can an abstract class have a constructor?</p>
<p>If so, how can it be used and for what purposes?</p>
| <p>Yes, an abstract class can have a constructor. Consider this:</p>
<pre><code>abstract class Product {
int multiplyBy;
public Product( int multiplyBy ) {
this.multiplyBy = multiplyBy;
}
public int mutiply(int val) {
return multiplyBy * val;
}
}
class TimesTwo extends Product {
... | <p>Yes..It is like any other class. It can have a constructor and it is called after creating object for the base class.</p>
| 32,592 |
<p>Does anyone have the secret formula to resizing transparent images (mainly GIFs) <em>without</em> ANY quality loss - what so ever?</p>
<p>I've tried a bunch of stuff, the closest I get is not good enough.</p>
<p>Take a look at my main image:</p>
<p><a href="http://www.thewallcompany.dk/test/main.gif" rel="norefer... | <p>If there's no requirement on preserving file type after scaling I'd recommend the following approach.</p>
<pre><code>using (Image src = Image.FromFile("main.gif"))
using (Bitmap dst = new Bitmap(100, 129))
using (Graphics g = Graphics.FromImage(dst))
{
g.SmoothingMode = SmoothingMode.AntiAlias;
g.Interpolatio... | <p>While PNG is definitely better that GIF, occasionally there is a use case for needing to stay in GIF format. </p>
<p>With GIF or 8-bit PNG, you have to address the problem of quantization.</p>
<p>Quantization is where you choose which 256 (or fewer) colors will best preserve and represent the image, and then turn ... | 5,046 |
<p>How to use crystal Reports with ASP.Net 2.0.
Any Samples/Tutorials/Examples which shows how to deploy Crystal Reports on a production Server.</p>
| <p>Having just been through the pain of this myself, here's a couple of pointers that will hopefully save you time...</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb126227.aspx" rel="noreferrer">Crystal Reports on MSDN</a> - lots of good stuff in here</p>
<p><a href="http://msdn.microsoft.com/en-us/library... | <p>This is the code I generally use:</p>
<pre class="lang-vb prettyprint-override"><code>'Generate the Report
Dim oRpt As New ReportDocument
Dim reportPath As String = Server.MapPath("crtTAL.rpt")
oRpt.Load(reportPath)
oRpt.SetDataSource(dsTAL)
If Not IO.Directory.Exists(tempLocation) Then
IO.Directory.CreateDir... | 48,448 |
<p>It is difficult to describe with words what's happening, so take a look at the picture. Somehow PrusaSlicer decides to move and print in the air (blue line), where instead it can continue going from outwards to inward. I understand it wants to print first the outer layer but in this case it is obvious it will not ho... | <p>The inability to do this is not fundamental, but it's currently a limitation in slicing software, and not likely to change soon.</p>
<p>You can see from <a href="https://www.youtube.com/watch?v=c9b7Ey4LyCs" rel="nofollow noreferrer">this demo</a> that the kind of printing you want is possible. However, it's currentl... | <blockquote>
<p>How to configure PrusaSlicer to prevent printing in the air</p>
</blockquote>
<p>You need either support or change the print orientation.</p>
<p>You cannot print into the air, you can however print lines on top of a prior layer with a certain overlap, or bridge a certain gap. E.g. (screw) holes are ofte... | 2,202 |
<p>I've got an arbitrary list of .NET assemblies.</p>
<p>I need to programmatically check if each DLL was built for x86 (as opposed to x64 or Any CPU). Is this possible?</p>
| <p>Look at <code>System.Reflection.AssemblyName.GetAssemblyName(string assemblyFile)</code>.</p>
<p>You can examine assembly metadata from the returned AssemblyName instance:</p>
<p>Using <strong>PowerShell</strong>:</p>
<pre>
[36] C:\> [reflection.assemblyname]::GetAssemblyName("${pwd}\Microsoft.GLEE.dll") | fl
Name ... | <p>An alternative to already mentioned tools is <a href="https://www.telerik.com/products/decompiler.aspx" rel="nofollow noreferrer">Telerik JustDecompile</a> (free tool) which will display the information next to the assembly name:</p>
<p><a href="https://i.stack.imgur.com/41Igu.png" rel="nofollow noreferrer"><img sr... | 34,002 |
<p>I have a groovy script with an unknown number of variables in context at runtime, how do I find them all and print the name and value of each?</p>
| <p>Well, if you're using a simple script (where you don't use the "def" keyword), the variables you define will be stored in the binding and you can get at them like this:</p>
<pre><code>foo = "abc"
bar = "def"
if (true) {
baz = "ghi"
this.binding.variables.each {k,v -> println "$k = $v"}
}
</code></pre>
... | <p>Groovy Object contains method - <code>dump()</code>
<a href="https://docs.groovy-lang.org/latest/html/groovy-jdk/java/lang/Object.html" rel="nofollow noreferrer">https://docs.groovy-lang.org/latest/html/groovy-jdk/java/lang/Object.html</a></p>
<pre><code>String dump()
Generates a detailed dump string of an object s... | 26,614 |
<p>Can I safely download and install .Net framework 3.5 SP1 without requiring my customers to upgrade their .Net Framework distributable?</p>
<p>EDIT: And without changing my build script</p>
<p>EDIT: I'm currently running 3.5</p>
| <p><a href="http://www.hanselman.com/blog/VS2008AndNet35SP1BetaShouldYouFearThisRelease.aspx" rel="nofollow noreferrer">From hanselman</a>,</p>
<p>On the .NET 3.5 side of things, since this is an SP (Service Pack), yes, some stuff goes in your GAC and gets changed. However, the changes are completely additive. That me... | <p>Yes, but </p>
<ul>
<li>make sure you test against 3.5 without SP1 (a virtual machine is invaluable for stuff like this)</li>
<li>Don't use any of the new features introduced with 3.5 SP1 (like ASP.NET Dynamic Data)</li>
</ul>
<p>It might be possible to deploy all the dependencies (even those normally in the GAC) w... | 26,199 |
<p>I have a datetime coming back from an XML file in the format:</p>
<blockquote>
<p>20080916 11:02</p>
</blockquote>
<p>as in </p>
<blockquote>
<p>yyyymm hh:ss</p>
</blockquote>
<p>How can i get the datetime.parse function to pick up on this? Ie parse it without erroring?
Cheers</p>
| <pre><code>DateTime.ParseExact(input,"yyyyMMdd HH:mm",null);
</code></pre>
<p>assuming you meant to say that minutes followed the hours, not seconds - your example is a little confusing. </p>
<p>The <a href="http://msdn.microsoft.com/en-us/library/system.datetime.parseexact(VS.80).aspx" rel="noreferrer">ParseExact do... | <p>Thanks for the tip, i used this to get my date "20071122" parsed, I needed to add datetimestyles, I used none and it worked:</p>
<pre><code>DateTime dt = DateTime.MinValue;
DateTime.TryParseExact("20071122", "yyyyMMdd", null,System.Globalization.DateTimeStyles.None, out dt);
</code></pre>
| 44,330 |
<p>We're embarking on a new middle tier service that will allow internal client systems to create and update and query records in some underlying data stores. The service will aggregate as many as 3 seperate underlying datastores. For the purposes of this question assume:</p>
<p>Data store #1: Proprietary XML Datab... | <p>You shouldn't expose the XML as this fixes your format and any future decisions you may face regarding infrastructure. I would always go the strongly typed route to ensure you properly abstract your implementation away from usage.</p>
<p>If you take the XML route and find out, part way through development, that the... | <p>Certainly the stongly typed approach will be easiest from an end-user-developer perspective which is what I would prefer. However, if ultimately everything is converted to Xml behind the scenes or you are unsure wich approach your clients will take, I'd definitely recommend you support both.</p>
| 48,115 |
<p>What are the new features you would like to avail in ASP.NET MVC in the future releases?</p>
<p>I Would say </p>
<p>1) A separate view engine for ASP.NET MVC instead of current WebForm view engine.<br>
2) Asynchronous Controller Actions.<br>
3) Subcontrollers / Partial Requests. <br> </p>
| <p>Stop dropping new code - start dropping better documentation. :) Oh and prescriptive guidance that uses EF rather than LINQ to SQL would also be welcome.</p>
| <p>good documentation .. better support for server components ..</p>
| 36,369 |
<p>My company has been evaluating Spring MVC to determine if we should use it in one of our next projects. So far I love what I've seen, and right now I'm taking a look at the Spring Security module to determine if it's something we can/should use. </p>
<p>Our security requirements are pretty basic; a user just needs ... | <p>Just do it the usual way and then insert it using <code>SecurityContextHolder.setContext()</code> in your test class, for example:</p>
<p>Controller:</p>
<pre><code>Authentication a = SecurityContextHolder.getContext().getAuthentication();
</code></pre>
<p>Test:</p>
<pre><code>Authentication authentication = Moc... | <p>After quite a lot of work I was able to reproduce the desired behavior. I had emulated the login through MockMvc. It is too heavy for most unit tests but helpful for integration tests. </p>
<p>Of course I am willing to see those new features in Spring Security 4.0 that will make our testing easier.</p>
<pre><code... | 47,055 |
<p>This is kind of a brainteaser question, since the code works perfectly fine as-is, it just irritates my aesthetic sense ever so slightly. I'm turning to Stack Overflow because my own brain is failing me right now.</p>
<p>Here's a snippet of code that looks up an address using the Google Maps JS API and places a mar... | <p>The other answers are good, but here's one more option. This allows you to keep the same form you started with but uses the trick of naming your lambda function so that you can refer to it recursively:</p>
<pre><code>mapstrings = ['mapstring1', 'mapstring2', 'mapstring3'];
geocoder.getLatLng(mapstrings.shift(), f... | <p>How about this?</p>
<pre><code>function place_point(mapstrings,idx)
{
if(idx>=mapstrings.length) return;
geocoder.getLatLng(mapstrings[idx],
function(point)
{
if(!point)
{
pl... | 34,739 |
<p>I'm planning to build a USB device that has buttons that some software needs to respond to, and indicators that the software needs to control. I'm new to USB, so I'm looking for any pointers that will get me started.</p>
| <p>When I did some USB development a while ago, I found the information at <a href="http://www.lvr.com/usb.htm" rel="nofollow noreferrer">USB Central</a> extremely valuable.</p>
<p>For low bandwidth requirements, you can use something like the <a href="http://www.ftdichip.com/Products/FT232R.htm" rel="nofollow norefer... | <p>Checkout <a href="http://www.jungo.com/st/windriver_usb_pci_driver_development_software.html" rel="nofollow noreferrer">WinDriver</a>, which is a commercial multiplatform tool what give you easy way to implement usb drivers in user mode, source code compatible between Linux and Windows. </p>
| 20,304 |
<p>I recently migrated an ASP site from my dev machine to a live server. All the pages except my FAQ page works just fine, but my FAQ brings up:</p>
<pre><code>XML Parsing Error: no element found
Location: http://geniusupdate.com/GSHelp/faq.aspx
Line Number 1, Column 1:
</code></pre>
<p>The only changes I have made ... | <p>This is a very old thread, but I found this while googling for the same problem and wanted to contribute a definitive answer for anyone else who searches for this in the future.</p>
<p>I got this error when an exception was thrown while the page directives were being parsed. I updated aspx files from source contro... | <p>Maybe there is no XML (XML is a blank string)?</p>
| 38,933 |
<p>I am a .NET developer now and have come from <a href="http://en.wikipedia.org/wiki/Visual_FoxPro" rel="nofollow noreferrer">Foxpro</a>/VB6/COM background.</p>
<p>Over the time, I think we have changed to worry too much about languages/tools to do the work. If you look at what a developer in the .NET space would use... | <p>I think it's a good question, but possibly with a rose-tinted look at the past. There have always been issues with APIs not working the way they're expected to etc. The internet certainly makes it a <em>lot</em> easier to find other people who've had the same problem, but I don't think it's any harder to find the so... | <p>Sometimes I spend more time working around a problem in a framework that I could have been able to write my own class that does the exact same thing in less time than it took to solve the framework-problem.</p>
<p>But I still think that the frameworks are needed, there is no way you can learn and create all these t... | 32,631 |
<p>Disclaimer: the following is a sin against XML. That's why I'm trying to change it with XSLT :)</p>
<p>My XML currently looks like this:</p>
<pre><code><root>
<object name="blarg" property1="shablarg" property2="werg".../>
<object name="yetanotherobject" .../>
</root>
</code></pre>... | <p>This is actually a raw XML parsing problem, not something XSLT can help you with. An XML parse must convert the newlines in that attribute value to spaces, as per ‘3.3.3 Attribute-Value Normalization’ in the XML standard. So anything currently reading your description attributes and keeping the newlines in is doing ... | <p>If you can control your XML processor, you can do it.</p>
<p>From my <a href="https://stackoverflow.com/a/29780972/611007">other answer</a> (which has many references linked):</p>
<p>if you have an XML like</p>
<pre><code><?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE elemke [
<!ATTL... | 32,555 |
<p>I have a thread that, when its function exits its loop (the exit is triggered by an event), it does some cleanup and then sets a different event to let a master thread know that it is done.</p>
<p>However, under some circumstances, SetEvent() seems not to return after it sets the thread's 'I'm done' event.</p>
<p>... | <p>Who is unloading the DLL and at what time is the unload done? I am wondering if there is a timing issue here where the DLL is unloaded before the thread has run to completion.</p>
| <p>You might want to use WinDbg to catch the crash and examine the stack.</p>
| 40,010 |
<p>I have a JavaScript widget which provides standard extension points. One of them is the <code>beforecreate</code> function. It should return <code>false</code> to prevent an item from being created. </p>
<p>I've added an Ajax call into this function using jQuery:</p>
<pre><code>beforecreate: function (node, target... | <p>From the <a href="https://api.jquery.com/jquery.ajax/" rel="noreferrer">jQuery documentation</a>: you specify the <strong>asynchronous</strong> option to be <strong>false</strong> to get a synchronous Ajax request. Then your callback can set some data before your mother function proceeds.</p>
<p>Here's what your cod... | <p>Since the original question was about <code>jQuery.get</code>, it is worth mentioning here that (as mentioned <a href="https://stackoverflow.com/a/44172561/1526703">here</a>) one <strong>could</strong> use <code>async: false</code> in a <code>$.get()</code> but <strong>ideally avoid</strong> it since asynchronous <c... | 16,137 |
<p>I'm in a hypothetical situation in which I need to list students in a school. I have one table view controller that has several sections, representing a school. Each school has subsequent students. Now, I have the requirement to give the user the capability to view all students for a particular school by clicking on... | <p>I think the simplest thing to do would be to have a single class that handles an array of schools. If that array contains only one item, you can (optionally) have no title displayed for the single section. Otherwise, all sections have titles.</p>
<p>Put all your schools into an array, and when a single school needs... | <p>I think it would depend on the model you are using to hold your data.
Lets say you have an array of arrays,
(array of schools, each school holds an array of students.)</p>
<p>In this case, I would stick with one tableController.</p>
<p>The logic doesn't have to be hairy if your model design is simple, and I think ... | 42,536 |
<p>The string formatting concept found in <strong>sprintf</strong> can be found in almost any language today <em>(you know, smothering a string with %s %d %f etc. and providing a list of variables to fill their places)</em>. </p>
<p><strong>Which langugage was it originally that had a library function or language cons... | <p><a href="http://en.wikipedia.org/wiki/Printf" rel="noreferrer">Wikipedia has a pretty thorough history.</a> It suggests that the C printf function had its origins in BCPL's writef function.</p>
| <p>I would say all of them trace their roots back to BCPL. We used BCPL to do operating systems programming for the 6809 processor two decades ago and it had a <code>writef()</code> function which took arguments such as <code>%i2</code> (equivalent to C's <code>%2d</code>).</p>
<p>C was based on a cut-down version of... | 26,026 |
<p>Any <a href="http://en.wikipedia.org/wiki/Salt_%28cryptography%29" rel="noreferrer">salt</a> at all will obviously help when salting and hashing a user's password. Are there any best practices for how long the salt should be? I'll be storing the salt in my user table, so I would like the best tradeoff between stor... | <p>Most of these answers are a bit misguided and demonstrate a confusion between salts and cryptographic keys. The purpose of including salts is to modify the function used to hash each user's password so that each stored password hash will have to be attacked individually. The only security requirement is that they ar... | <p>One answer might be to use as size of salt the value that the hash you are going to use provides in term of security. </p>
<p>E.g. If you are going to use SHA-512 use 256 bit salt since the security provided by SHA-512 is 256 bit.</p>
| 22,268 |
<p>I have the following type :</p>
<pre><code>// incomplete class definition
public class Person
{
private string name;
public string Name
{
get { return this.name; }
}
}
</code></pre>
<p>I want this type to be <strong>created</strong> and <strong>updated</strong> with some sort of dedicated ... | <p>Create an interface IReadOnlyPerson which exposes only get accessors. Have Person implement IReadOnlyPerson. Store the reference to Person in your controller. Give other clients only the read only version.</p>
<p>This will protect against mistakes, but not fraud, as with most OO features. Clients can runtime cast t... | <p>Maybe something like that ?</p>
<pre><code>public class Person
{
public class Editor
{
private readonly Person person;
public Editor(Person p)
{
person = p;
}
public void SetName(string name)
{
person.name = name;
}
p... | 11,226 |
<p>I have a project with a bunch of external sounds to a SWF. I want to play them, but any time I attempt load a new URL into the sound object it fails with either,</p>
<blockquote>
<p>Error #2068: Invalid Sound</p>
</blockquote>
<p>or raises an ioError with </p>
<blockquote>
<p>Error #2032 Stream Error</p>
</b... | <p>Well, I've just done a test by putting an mp3 in a directory: <code>soundTest/assets/song.mp3</code> then creating a swf that calls the mp3 in another directory: <code>soundTest/swfs/soundTest.swf</code> and when I use <code>var path:String = "../assets/song.mp3";</code> then it compiles with no errors.</p>
<p>Wha... | <p>In both protocol, RTMP & HTTP, the path should be -- "path/to/mp3:file.mp3" or "path/to/mp3:file". I can remember. Please check both.</p>
| 13,363 |
<p>Ok so part two of <a href="https://stackoverflow.com/questions/146439/way-to-stop-a-program-from-starting-up-using-c">I have no will power experiment</a> is:</p>
<p>Summary Question -
<strong>Is there a way to set the CanStop property on a windows service dynamically?</strong></p>
<p>Whole Spiel -
I have a service... | <p>The "CanStop" is a attribute of the services registration in the windows service control manager. You can't change it mid-stride. </p>
<p>And, of course, if you're smart enough to write your own service then you're smart enough to bring up task-man and simply kill the service process. CanStop will not prevent you f... | <p>Rather than trying to directly access and control the Service, could you set a flag somewhere, (like the registry or a file), that is then checked by your service before it executes the Event you're trying to control.</p>
| 18,033 |
<p>I've been seeing feedback from people in other 3DP communities that they think this stack exchange site is driving away new users by holding newbie questions to an excessively high standard for quality. On one hand, we all know SE works best with clear and logical questions that lead to clear and logical answers. Bu... | <p>I think you highlighted one of the more important points, in that "<em>SE works best with clear and logical questions that lead to clear and logical answers</em>". From what I've noticed (and I just went back through my own voting history), there have been a number of "primarily opinion based" and "too broad" questi... | <p>I think you highlighted one of the more important points, in that "<em>SE works best with clear and logical questions that lead to clear and logical answers</em>". From what I've noticed (and I just went back through my own voting history), there have been a number of "primarily opinion based" and "too broad" questi... | 21 |
<p>How is profiling different from logging?</p>
<p>Is it just that profiling is used for performance measurements to see how long each function takes? Or am I off?</p>
<p>Typically, how are profiling libraries used?</p>
<p>What types of stats are obtained by profiling?</p>
| <p>Logging tells you <em>what</em> happened. It's great for forensics and debugging.</p>
<p>Profiling quantifies that: it tells you how much time your code spent in each area, or how many times a body of code was executed. It helps you improve your code's performance.</p>
<p>Profiling typically operates at the lev... | <p>I see profiling as performance measurement, and you don't have to profile every piece of code running, it's sometimes better to target specific areas.</p>
<p>Logging is storing information for later use, information which may relate to profiling but not necessarily. It may just be to log what happened.</p>
<p>All... | 29,975 |
<p>I want to generate a CSV file for user to use Excel to open it.</p>
<p>If I want to escape the comma in values, I can write it as "640,480".</p>
<p>If I want to keep the leading zeros, I can use ="001234".</p>
<p>But if I want to keep both comma and leading zeros in the value, writing as ="001,002" will be splitt... | <p>Kent Fredric's answer contains the solution:</p>
<pre> "=""001,002"""</pre>
<p>(I'm bothering to post this as a separate answer because it's not clear from Kent's answer that it is a valid Excel solution.)</p>
| <p>Looking more at the Excel spreadsheet it looks what you want can't be done using CSV.</p>
<p>This site <a href="http://office.microsoft.com/en-us/excel/HP052573861033.aspx?pid=CH062527981033" rel="nofollow noreferrer">http://office.microsoft.com/en-us/excel/HP052002731033.aspx</a> says "If cells display formulas in... | 39,713 |
<pre><code>#include <vector>
std::vector<long int> as;
long int a(size_t n){
if(n==1) return 1;
if(n==2) return -2;
if(as.size()<n+1)
as.resize(n+1);
if(as[n]<=0)
{
as[n]=-4*a(n-1)-4*a(n-2);
}
return mod(as[n], 65535);
}
</code></pre>
<p>The above code sample using memoization ... | <p><code>if (as[n] <= 0)</code> is the check. If valid values can be negative like you say, then you need a different sentinel to check against. Can valid values ever be zero? If not, then just make the test <code>if (as[n] == 0)</code>. This makes your code easier to write, because by default vectors of <code>int</... | <p>If the formula can yield both positive and negative values then this function has a serious bug. The check <code>if(as[n]<=0)</code> is <em>supposed</em> to be checking if it had already cached this value of computation. But if the formula can be negative this function recalculates this cached value alot...</p>
... | 17,741 |
<p>What are differences between enabling and disabling "Enable 32-Bit applications" in websites application pools under IIS7 on x64 machine?</p>
<p>Mostly I'm thinking about memory usage.</p>
<p>Thanks in advance</p>
| <p>I believe the current "trend" for hosting like this is to have each site with its own Application Pool, and each application pool running in 32 bitness. This enables Application Pool isolation, and allows each site/application pool to be limited to 4gb of memory, which basically works out to about 2.4 GB before asp.... | <p>A 32-bit application pool allows 32-bit ISAPI .DLL-based applications, like those built with ATL server, to run. They can't be loaded in 64-bit application pools.</p>
| 36,209 |
<p>We have a large codebase that takes approx 12 minutes on the developer machines to auto-generate some Java 5 classes using JavaCC and then compiles all the classes as well as running the units test.</p>
<p>The project consists of multiple projects which can be built in groups, but we are aiming for a full a build i... | <p>One quick fix that might shave some time off is to ensure that you are running Ant using the server JVM (by default it uses the client VM). Set ANT_OPTS to include "-server".</p>
| <p>This probably wouldn't help in the very near term, but figured I should throw it out there anyway.</p>
<p>If your project is breakable into smaller projects (a database subsystem, logging, as examples), you may be interested in using something like maven to handle the build. You can run each smaller bite as a sepa... | 17,680 |
<p>I have a custom built ajax [div] based dynamic dropdown. </p>
<p>I have an [input] box which; <code>onkeyup</code>, runs an Ajax search which returns results in <code>div</code>s and are drawn back in using <code>innerHTML</code>. These <code>div</code>s all have highlights <code>onmouseover</code> so, a typical su... | <p>What you need to do is attach event listeners to the <code>div</code> with <code>id="results"</code>. You can do this by adding <code>onkeyup</code>, <code>onkeydown</code>, etc. attributes to the <code>div</code> when you create it or you can attach these using JavaScript.</p>
<p>My recommendation would be that yo... | <p>Off the top of my head, I would think that you'd need to maintain some form of a data structure in the JavaScript that reflects the items in the current dropdown list. You'd also need a reference to the currently active/selected item. </p>
<p>Each time <code>keyup</code> or <code>keydown</code> is fired, update the... | 2,687 |
<p>How would one write a regular expression to use in Python to split paragraphs?</p>
<p>A paragraph is defined by two line breaks (\n). But one can have any amount of spaces/tabs together with the line breaks, and it still should be considered as a paragraph.</p>
<p>I am using Python, so the solution can use Python's ... | <p>Unfortunately there's no nice way to write "space but not a newline".</p>
<p>I think the best you can do is add some space with the <code>x</code> modifier and try to factor out the ugliness a bit, but that's questionable: <code>(?x) (?: [ \t\r\f\v]*? \n ){2} [ \t\r\f\v]*?</code></p>
<p>You could also try creati... | <p>Almost the same, but using non-greedy quantifiers and taking advantage of the whitespace sequence.</p>
<pre><code>\s*?\n\s*?\n\s*?
</code></pre>
| 14,189 |
<p>I have a revision that has been committed to SVN trunk which I would like to roll back. However, I would like to retain the changes in some fashion such as a branch or even a patch file. Any suggestions?</p>
| <p>Reverse-merge (I think that was the term), commit and that's all.</p>
<p>For the "reverse-merge" part - TSVN has this cool feature called "Revert to this revision" (and "Revert changes from this revision"), accessible through the Log dialogue.</p>
<p>The main purpose of a VCS is to keep history of your changes. Yo... | <p>You can specify a particular revision when you do a copy (ie. branch).</p>
<p>Something like:</p>
<pre>
svn copy -rsome_revision trunk branches/interesting_branch
</pre>
<p>So roll back your changes in your trunk and then do your branch, specifying the revision before you commited your rollback (merge).</p>
<p>Y... | 26,695 |
<p>When I delete a visual component in a base form, and forget any references in inherited forms, my application only breaks in runtime.</p>
<p>What I normally do is to use a search tool to find references in .DFM, but I'm not completely satisfied with this method.</p>
<p>Do you have any better recommendations?</p>
| <p>maybe <a href="http://cc.codegear.com/Item/25538" rel="nofollow noreferrer">Andreas Hausladen's DFMCheck</a> helps?</p>
<p>Uli.</p>
| <p>Just to be sure, but have you used 'inherited' in the inherited dfm?</p>
<pre><code>inherited Form1: TForm1
Caption = 'Form1'
PixelsPerInch = 96
TextHeight = 13
end
</code></pre>
<p>If you have 'object' and not 'inherited' you get a lot of problems.</p>
| 37,745 |
<p>I don't have any experience with creating Skins, but I have the tools to do it (Fireworks, etc.). I'm used to doing as much as I can with styles, but, I want to break out of the mold and start using Skins more, especially so that the look and feel of my apps can be ported to other platforms. Where do I get started?<... | <p><a href="http://www.adobe.com/devnet/flex/quickstart/skinning_components/" rel="nofollow noreferrer">http://www.adobe.com/devnet/flex/quickstart/skinning_components/</a></p>
<p><a href="http://flashenabledblog.com/2008/06/27/tutorials-developing-extending-and-styling-flex-components/" rel="nofollow noreferrer">http... | <p>This is really what I was looking for: <a href="http://www.adobe.com/devnet/flex/articles/skins_styles.html" rel="nofollow noreferrer">http://www.adobe.com/devnet/flex/articles/skins_styles.html</a></p>
| 46,510 |
<p><a href="http://en.wikipedia.org/wiki/Loop_unwinding" rel="noreferrer">Loop unwinding</a> is a common way to help the compiler to optimize performance. I was wondering if and to what extent the performance gain is affected by what is in the body of the loop:</p>
<ol>
<li>number of statements</li>
<li>number of func... | <p>In general unrolling loops by hand is not worth the effort. The compiler knows better how the target architecture works and will unroll the loop if it is beneficial.</p>
<p>There are code-paths that benefit when unrolled for Pentium-M type CPU's but don't benefit for Core2 for example. If I unroll by hand the compi... | <p>Manual loop unwinding is in general useful only for the very most trivial loops.</p>
<p>As a point of reference, the C++ standard library in g++ unrolls exactly two loops in the whole source, which implement the 'find' function with and without predicate, which look like:</p>
<pre><code>while(first != last &&a... | 23,144 |
<p>I've recently had to switch from Visual Studio to Eclipse CDT.<br>
It would seem that Eclipse "workspaces" are not quite like VS solution files.<br>
Eclipse workspaces use the <code>.metadata</code> folder for managing multiple projects, but there doesn't seem to be a simple distinction between user settings or IDE ... | <p>Yes you are right eclipse does not manage projects in the same way VS does with solution files. However for putting a group of related projects into a VCS eclipse has the concept of a <em>Team Project Set</em> available in File->Export then under the Team folder there is Team Project Set.</p>
| <p>I often find IDE's have a preferred way to work. Sure, you might be able to get the IDE to do it your way, but you'll probably end up fighting it all the way.</p>
<p>Try to use your IDE like their makers intended you to. They have made presumptions on how you are supposed to do your work. They have optimized the us... | 7,976 |
<p>I'm having some trouble getting log4net to work from ASP.NET 3.5. This is the first time I've tried to use log4net, I feel like I'm missing a piece of the puzzle.</p>
<p>My project references the log4net assembly, and as far as I can tell, it is being deployed successfully on my server.</p>
<p>My web.config contai... | <p>The root logger is mandatory I think. I suspect configuration is failing because the root doesn't exist.</p>
<p>Another potential problem is that Configure isn't being pointed to the Web.config.</p>
<p>Try Configure(Server.MapPath("~/web.config")) instead.</p>
| <p>This is what i have in Global.ASX. Got it all working in asp.net 3.5</p>
<pre><code><%@ Application Language="C#" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
log4net.Config.XmlConfigurator.Configure(... | 27,722 |
<p>I need to transport my FDM 3D Printer because I am moving.</p>
<p>What are the precautions that one should take?<br> Should I dismount the motors and axes?<br> I would definitively unplug the electronics as far as reasonable and fix the motors to the frame so they don't slide during transport.<br> Should I have a h... | <p>Yes, fix the motors and any other loose/movable parts. Remove the bowden tube if it's there, and any other parts that are sticking out. Put the whole thing in a a bag to protect from dust, and put the bag in a box to protect it from getting beat up. Remember to calibrate it when you're ready to set it up again.</p>
| <p>You just need to take basic security actions. like fixing all movable parts simple as that </p>
| 309 |
<p>Trying to setup the exception_logger plugin on a production server. Everything worked fine on the dev machine. Trying to rake db:migrate on the prod server and i get this error:</p>
<pre><code>rake aborted!
no such file to load -- pagination
</code></pre>
<p>What am i missing?</p>
| <p>Classic Pagination is not supported in 2.1 - or at least it is a dead library</p>
<p><a href="http://workingwithrails.com/railsplugin/5289-classic-pagination" rel="nofollow noreferrer">http://workingwithrails.com/railsplugin/5289-classic-pagination</a></p>
<p>Have a look at will_paginate - </p>
<p><a href="http:/... | <ol>
<li>Your rake is being aborted while loading <strong>environment.rb</strong>. </li>
<li>Check for any <strong>missing gems</strong> that are declared in it ton your production machine.</li>
<li>"<strong>sudo gem install"</strong> those that are missing </li>
<li>Check environment.rb loads up properly by issuing <s... | 22,803 |
<p>I am new to visual studio/asp.net so please bear with me. Using vs 2005 and asp.net 3.5. I have vs installed on the production server. If I set the start option for the site to "use default web server" when I go to debug my website vs tries to open the site at <a href="http://localhost:4579/project" rel="nofollow... | <p>Do this...Instead of trying to debug by hitting F5</p>
<ul>
<li>Go to Tools</li>
<li>Attach to Process</li>
<li>Click View Processes from all users</li>
<li>Ensure you are selected only for Managed Code</li>
<li>Select "W3WP.EXE". This is the ASP.NET Worker process.</li>
<li>Click attach.</li>
<li>You are now attac... | <p>Are you running on Vista or Server 2008? I'm not sure about Vista, but when I was running Server 2008 I had permission errors when trying to debug when I launched VS as my regular user. The solution for me was right-clicking on the VS icon and selecting 'Run as Administrator'.</p>
| 12,317 |
<p>My group is a Perl shop in an organization that is very heterogenous. Although we support the odd Java, PHP, or Python installation, we're using Perl for nearly all of our web applications and systems/data marshalling tasks. All of our boxes are Linux, although we interface with IIS systems as well.</p>
<p>We're ... | <p>Is there a specific technical reason for switching to Java? Is there something you can do in Java but not Perl? Is there a performance difference? Is some other group/person all about Java and doesn't want to learn Perl?</p>
<p>My experience has been that you should stick with what you know. Your group knows Perl r... | <p>If you'd be allowed to move to something Java compatible, yet has a syntax that's at least <strong>closer</strong> to Perl than Java, check out Groovy. <a href="http://groovy.codehaus.org/" rel="nofollow noreferrer">Groovy</a> is a dynamic language that compiles to Java byte-code.</p>
<p>You can code in either Jav... | 19,401 |
<p>I'm trying to customize some TFS work items via the VS2008 xml editor, but every time I open a work item xml file it jumps to the graphical designer. All that gives me is a "View XML" button that doesn't let you edit the xml directly.</p>
| <p>I don't have TFS but I know in regular VS there is an Open With... option in most items' contextual menu that even let you change the default editor. Very useful when you are tired of the Designer opening instead of the Code file on Windows forms.</p>
| <p>As per Coincoin's answer, this feature is also great for setting the default editor for ASPX. If you want to go to the Code Editor most often, then this is a default you'd want to change.</p>
| 2,796 |
<p>What are the private IP address ranges?</p>
| <p>You will find the answers to this in <a href="http://www.faqs.org/rfcs/rfc1918.html" rel="noreferrer">RFC 1918</a>. Though, I have listed them below for you.</p>
<pre><code> 10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255... | <p>also, 169.254.0.0 - 169.254.255.255 are reserved for automatic private IP addressing. Refer to <a href="http://en.wikipedia.org/wiki/Link-local_address" rel="nofollow noreferrer">Link-local address wikipedia article</a></p>
| 10,700 |
<p>Put it another way: what code have you written that <strong>cannot</strong> fail. I'm interested in hearing from those who have worked on projects dealing with heart monitors, water testing, economic fundamentals, missile trajectories, or the O2 concentration on the space shuttle.</p>
<p>How did you prepare for wr... | <p>While I am not personally involved in what is described there, this article will hopefully contribute to the spirit of your question: <a href="http://www.fastcompany.com/magazine/06/writestuff.html" rel="nofollow noreferrer">They Write the Right Stuff</a>.</p>
| <p>While nothing quite so important as an MRI machine or a blood pressure monitor, I did get tapped to do a rewrite of Blackjack when I worked for an online gambling provider. Blackjack is by far the most popular online game, and millions of dollars was going to go through this software (and did).</p>
<p>I wrote the ... | 21,180 |
<p>I wrote a short bash script to complete a task that involves creating a temporary directory and storing various files in it and performing various operations on it.</p>
<p>In my first pass I just created the temp dir at /tmp/$$.$script", but then I tested the script on a computer where I didn't have write access to... | <p>Many systems also have a <code>/var/tmp</code>. If the sysadmin doesn't want you writing in to <code>/tmp</code>, presumably they have provided some alternative… is the <code>$TMPDIR</code> environment variable set? For example, on my Mac:</p>
<pre><code>$ echo $TMPDIR
/var/folders/jf/jfu4pjGtGGGkUuuq8HL7UE+++TI/-... | <p>You could try <code>/var/tmp</code>, although it's likely that <code>/tmp</code> is a symlink to that (or vice-versa).</p>
| 20,792 |
<p>I am starting a a new web development project and I am tired of coding login systems. This is the kind of thing that must have been done dozens of times before. I really want to use someone else's code, because it is easier than rolling my own, and it will likely be better. I prefer open source for all the usual rea... | <p>OpenID is definitely the best solution and there are plennty of open source libraries for all kinds of languages out there. Hava look at <a href="http://openidenabled.com/" rel="noreferrer">openidenabled.com</a>.</p>
| <p>I wound up going with mod_auth_openid. It is super simple and prevents unneeded complication at other levels. but the code is not perfect, and I may have to adjust it later.</p>
| 26,818 |
<p>Is here any performance benefit to using multiple threads on a computer with a single CPU that does not having hyperthreading? </p>
| <p>In terms of speed of computation, No. In fact things will slow down due to the overhead of managing the threads.</p>
<p>In terms of responsiveness, yes. You can for example have one thread wait on an IO operation and have another run a GUI at the same time.</p>
| <p>Regardless of the number of CPUs available, if you require preemptive multitasking and/or applications with asynchronous components (i.e. pretty much anything that combines a responsive GUI with a non-trivial amount of computation or continuous I/O processing), multithreading performs much better than the alternativ... | 6,997 |
<p>In order to verify the data coming from the <a href="http://code.google.com/apis/safebrowsing/developers_guide.html" rel="nofollow noreferrer">Google Safe Browsing API</a>, you can calculate a Message Authentication Code (MAC) for each update. The instructions to do this (from Google) are:</p>
<blockquote>
<p>Th... | <pre><code>c="8eirwN1kTwCzgWA2HxTaRQ==".decode('base64')
</code></pre>
| <pre><code>c="8eirwN1kTwCzgWA2HxTaRQ==".decode('base64')
</code></pre>
| 21,991 |
<p>We've got a classic ASP application that is putting out some very large reports, where the resulting HTML is several MBs. We've made a lot of progress in trimming this down by reducing extraneous HTML, but I'd like to know if there's any way to enable GZIP compression on these dynamic .asp pages. I'm sure compressin... | <p>Sure, that's just a matter of turning on compression in IIS. See this <a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/25d2170b-09c0-45fd-8da4-898cf9a7d568.mspx?mfr=true" rel="nofollow noreferrer">MSDN</a> page for example.</p>
| <p>I recommend using <a href="http://www.port80software.com/products/httpzip/" rel="nofollow noreferrer">HttpZip from Port 80 Softwar</a>e. It basically just enables compression in IIS but from a GUI instead of getting into the metabase. I used it in a web-farm for a big enterprise ASP application.</p>
| 44,250 |
<p>I want to embed Javascript in a hobby game engine of mine. Now that we have the 5th generation of Javascript engines out (all blazing fast) I'm curious what engine would you choose to embed in a C++ framework (that includes actual ease of embeding it)? </p>
<p><sup><em>Note: Just to make it clear, I'm not intereste... | <p><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey" rel="noreferrer">Mozilla's SpiderMonkey</a> is fairly easy and well-documented. It's a C API, but it's straightforward to wrap it in C++. It can be compiled to be thread-safe, which is useful for games since you'd likely want to have ... | <p>You may also want to look at <a href="http://code.google.com/p/v8/" rel="nofollow noreferrer">V8</a> from Google. It's pretty new, though.</p>
| 11,926 |
<p>Is there any way to enforce a template in Bugzilla to guide users fill in bugs descriptions ?</p>
<p>Actually, i'd like to put some markup texts in the bug description field and avoid the creation of custom fields.</p>
<p>I've installed version 3.2rc1.</p>
| <p>Indeed, just check ../enter_bug.cgi?format=guided , which forms an example of the template feature. Half the work is already done for you.</p>
| <p>The mechansism described under <a href="https://www.bugzilla.org/docs/2.18/html/cust-templates.html" rel="nofollow noreferrer">6.2.5 Particular Templates</a> (under the section called bug/create/create.html.tmpl and bug/create/comment.txt.tmpl) works pretty well for us. Even though you say you don't want to create ... | 8,363 |
<p>I'm using NetBeans 6.5 for developing PHP and I have xdebug setup. Is there a way I can tell it not to stop on the first line of the file on every request? JIT mode won't fix this because I don't want it to stop on every exception that I catch.</p>
| <p>I just found my answer, you go to Tools > Options > PHP (section) and there is a checkbox for "stop at the first line"</p>
| <p>Tools -> Options -> Php -> Debugging -> Uncheck "Stop at first line" -> Apply -> OK.</p>
<p><a href="https://i.stack.imgur.com/ao8CZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ao8CZ.png" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgu... | 45,689 |
<p>Ok, I did it, I ordered myself an Ender-3, a genuine 24V e3D hotend, inductive sensor and some better tubing/clamps to cope with the problem the CR10/Ender line has occasionally.</p>
<p>But now I need to fix up my Cura for the machine coming in. The start is the CR10, and fixing the dimensions is easy.</p>
<p>But ... | <h2>The lazy way: Skirt/Brim</h2>
<p>With my TronXY X1 I learned pretty fast, that this first bit of extrusion on an unheated bed can totally mess up the first layer by being just in the way, as explained in the question.</p>
<p>To some degree, this behavior can be avoided by adding a skirt of a certain length. An equa... | <h2>Blob & Cut</h2>
<p>A different approach is to move to a position out off the print bed, then extrude a long piece of filament and then move forward, cutting the filament at the edge of the print surface. A sample G-code that needs to be adjusted to your bed:</p>
<pre><code>G28
G1 Y-5 X5 Z0.1 F500 ; Move off ... | 957 |
<p>I want to redirect URLs from an old site that used raw URL requests to my new site which I have implemented in CodeIgniter. I simply want to redirect them to my index page. I also would like to get rid of "index.php" in my URLs so that my URLs can be as simple as example.com/this/that. So, this is the <... | <p>Yes, there is. Is not an operator but a method on the Class class.</p>
<p>Here it is:
<a href="http://java.sun.com/javase/6/docs/api/java/lang/Class.html#isInstance(java.lang.Object)" rel="nofollow noreferrer">isIntance(Object o ) </a></p>
<p>Quote from the doc:</p>
<blockquote>
<p><em>...This method is the dyn... | <pre><code>if ( someClass.isAssignableFrom( obj.getClass() ) )
</code></pre>
<p>is equivalent to</p>
<pre><code>if ( obj instanceof Foo )
</code></pre>
<p>Use <code>instanceof</code> if the class to be checked against is known at compile time, use <code>isAssignableFrom</code> if it is only known at runtime.</p>
| 49,355 |
<p>Under what circumstances would this or would this not be safe? I have a branch that has a four changes (no file add or deletes). Would this be safe to delete?</p>
<p>Edit:
The reason for wanting to delete it is that it was misnamed and is going to lead to confusion.</p>
| <p>I believe that CVS won't actually delete the branch, it will just remove the tag from the branch -- so the branch is still present in each ",v" file that is affected, it just won't be trivially accessible any more. The result is weird, but probably not dangerous.</p>
| <p>Curt is correct, to delete a branch you have to physically run a delete command from the box. </p>
<p>It seems like in the case you mentioned, it would be ok to delete it. </p>
| 17,043 |
<p>I'm looking for a robust, easy-to-use, regular expression evaluator for native C++, either platform-independent or Windows-specific.</p>
<p>Requirements:</p>
<ul>
<li>Can't use Boost or ACE regex libraries (unfortunately)</li>
<li>Can't use .NET Regex (or any managed code)</li>
</ul>
<p>The main requirement is th... | <p>C++11 now includes the support of regular expressions.
It will be platform independent. You just need a recent compiler.
Check the following list to know which one to use.</p>
<p><a href="http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport" rel="noreferrer">http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport<... | <p>Why don't you use Microsoft ATL's regex library? Kenny Kerr has written a <a href="http://weblogs.asp.net/kennykerr/archive/2008/07/18/visual-c-in-short-regular-expressions.aspx" rel="nofollow noreferrer">short article</a> on that recently.</p>
<blockquote>
<p>ATL includes a lightweight regular expression impleme... | 2,346 |
<p>I would like to know what kinds of builds (i.e for example and learning) does one have.</p>
<p>I currently set up nightly build triggered on changes..</p>
<p>Should I have a different server for ci builds or different config blocks???</p>
<p>Please give ideas or samples on how you maintain CI and nightly build in... | <p>We use one build machine (a slightly older desktop pc at the moment, going to be in the server rack soon), with multiple project blocks in the configuration.</p>
<p>We have several main projects:</p>
<ul>
<li>Debug (triggered automatically every hour)</li>
<li>Test(integration & unit tests) (triggered once a d... | <p>As long as you use different working folders for each build type (unless you don't mind that the build types will overwrite each other) you can effectively have as many CCNet project configurations per product on one server.</p>
<p>At work, one of our build servers builds 4 different products, each with at least 2 ... | 37,481 |
<p>Im looking for ideas on how to effectively notify users that their input into an editable table is invalid. For example, if one column of a table represents an American zip code and the user enters in the zip code "85rr3" into a cell, how would you notify the user of the issue? </p>
| <p>I'd probably highlight it in red after entered, then maybe a warning at the top of the table.</p>
| <p>I think it's effective enough to just delete the value if it's not a valid zip code.</p>
| 22,365 |
<p>I just got started using Adobe Flex SDK. I was very excited because it's the first time I've found a good, <strong>free</strong> way to create Flash applications. But then I noticed something: Flex doesn't seem to be much about making animations or designs. It seems more like an application to build forms and men... | <p>Flex has a cohesive component model, and the basic building blocks were designed to support <em>applications</em>. HTML, on the other hand was designed for displaying text, and the DOM is a sorry excuse for a component model -- and it was most definitely not designed with applications in mind. </p>
<p>There is a pl... | <p>As stated above, "Better cross-browser support." That's probably the biggest factor right now for me.</p>
<p>A few more...</p>
<ul>
<li>It's a lot easier to get "pixel perfect" designs in place.</li>
<li>It's really easy to integrate Flash content into Flex. Which makes it easier to work with designers.</li>
<li... | 18,441 |
<p>When you hit F5, the browser windows pops up, how do you set which browser the debugger users in Visual Studio 2008?</p>
<p><strong>Update 1</strong><br>
I have looked for the 'Browse with' option and not found it.<br>
<a href="https://stackoverflow.com/questions/79954/visual-studio-opens-default-browser-instead-of... | <ul>
<li>(In the Project Solution window) Right click a page (.aspx, or on a folder)</li>
<li>Select Browse With...</li>
<li>Choose your browser</li>
<li>Click Set as Default</li>
<li>Click Browse</li>
</ul>
<p><img src="https://i.stack.imgur.com/b1Wxe.png" alt="context menu screenshot"></p>
| <p>ie ---> Tools ----> Internet options -----> Programe ------> Make Defualt</p>
| 38,034 |
<p>I am testing a Ruby Rails website and wanted to get started with Unit and Functional testing.</p>
| <p><a href="http://github.com/aslakhellesoy/cucumber/wikis" rel="nofollow noreferrer">Cucumber</a> and <a href="http://rspec.info/" rel="nofollow noreferrer">RSpec</a> are worth a look. They encourage testing in a <a href="http://behaviour-driven.org/" rel="nofollow noreferrer">behaviour-driven</a>, example-based styl... | <p>Even if the app is already written, I would recommend using RSpec over Test::Unit for the simple fact that no application is ever finished. You're going to want to add features and refactor code. Getting the right test habit early on will help make these alterations less painful</p>
| 17,212 |
<p>Are these vertical lines described as "banding"?</p>
<p>Would the most likely culprit be the extruder?</p>
<p>FWIW, this was printed in "vase mode".</p>
<p><a href="https://i.stack.imgur.com/0ZCPF.jpg" rel="noreferrer" title=""Vase mode, PLA"><img src="https://i.stack.imgur.com/0ZCPF.jpg" alt="Vase mode, PLA... | <p>Banding usually refers to Z banding and manifests itself in a wavy/non-straight wall in Z direction: </p>
<p><a href="https://i.stack.imgur.com/KYp55.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/KYp55.jpg" alt="Z-banding"></a></p>
<p>This sort of banding is related to mechanical or design issues of th... | <p>Banding usually refers to Z banding and manifests itself in a wavy/non-straight wall in Z direction: </p>
<p><a href="https://i.stack.imgur.com/KYp55.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/KYp55.jpg" alt="Z-banding"></a></p>
<p>This sort of banding is related to mechanical or design issues of th... | 878 |
<p>Is it possible to access the iSight camera on a macbook programmatically? By this I mean I would like to be able to just grab still frames from the iSight camera on command and then do something with them. If so, is it only accessible using objective c, or could other languages be used as well? </p>
| <p>You should check out the <a href="http://developer.apple.com/documentation/QuickTime/Conceptual/QTKitCaptureProgrammingGuide/Introduction/chapter_1_section_1.html#//apple_ref/doc/uid/TP40004574-CH1-DontLinkElementID_41" rel="nofollow noreferrer">QTKit Capture documentation</a>.</p>
<p>On Leopard, you can get at all... | <p>Aside from ObjC, you can use the PyObjC or RubyCocoa bindings to access it also. If you're not picky about which language, I'd say use Ruby, as PyObjC is horribly badly documented (even the official Apple page on it refers to the old version, not the one that came with OS X Leopard)</p>
<p>Quartz Composer is probab... | 3,045 |
<p>My team is moving from Visual SourceSafe to Subversion soon, while developing/supporting a legacy project in Visual Basic 6.0, so I have a couple of questions:</p>
<ul>
<li>What's the best tool for Subversion IDE integration in Visual Studio 6? (or is it not worth the trouble...)</li>
<li>Are there any best practic... | <p>I would agree that Tortoise SVN in Windows Explorer would be the best way to use SVN with VB6.</p>
<p>The biggest change you will find migrating to SVN is the idea of "Check out" and "Check in" aren't exactly the same as "Update" and "Commit". . . thus, any IDE integration with VB6 is limited because VB6 supports M... | <p>For the server side, VisualSVN Server, is a super simple solution, we are running it in a vmware virtual, and its humming along.</p>
<p>If you are a command line guy, I really like the command line interface for svn, I find it less confusing to get to certain actions than tortoise, such as status of the folder. But... | 4,434 |
<p>How does C handle converting between integers and characters? Say you've declared an integer variable and ask the user for a number but they input a string instead. What would happen?</p>
| <p>The user input is treated as a string that needs to be converted to an int using atoi or another conversion function. Atoi will return 0 if the string cannot be interptreted as a number because it contains letters or other non-numeric characters.</p>
<p>You can read a bit more at the atoi documentation on MSDN - <a... | <p>The program would crash, you need to call atoi function.</p>
| 17,383 |
<p>Is there a way to enforce explicit cast for typedefs of the same type? I've to deal with utf8 and sometimes I get confused with the indices for the character count and the byte count. So it be nice to have some typedefs:</p>
<pre><code>typedef unsigned int char_idx_t;
typedef unsigned int byte_idx_t;
</code></pre>
... | <p>For "handle" types (opaque pointers), Microsoft uses the trick of declaring structures and then typedef'ing a pointer to the structure:</p>
<pre><code>#define DECLARE_HANDLE(name) struct name##__ { int unused; }; \
typedef struct name##__ *name
</code></pre>
<p>Then instead of</p>
<pr... | <p>Use strong typedef as defined in <a href="http://www.boost.org/doc/libs/1_50_0/boost/strong_typedef.hpp" rel="nofollow noreferrer">BOOST_STRONG_TYPEDEF</a></p>
| 49,277 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.