instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>I'm trying to do a file system backup of a RedHat Enterprise Linux v4 server using Symantec Backup Exec 11d (Rev 7170). The backup server is Windows Server 2003.</p> <p>I can browse the target server to create a selection list, and when I do a test run it completes successfully.</p> <p>However, when I run a real ...
<p>Sure sounds like firewall issues. Try stopping iptables, and running again. Also, RALUS can dump a log file - which may give some more to go on. </p> <p>I use the older UNIX agent myself, which uses port 6101 IIRC - but I believe that the newer client uses tcp/10000 for control and 1024-65535 for transfer.</p> <p>...
<p>To clarify the answer, the solution was to open up the tcp ports from 1024-65535.</p> <p>The iptables looked liked this:</p> <pre><code>[root@MYSERVER ~]# service iptables status Table: filter Chain INPUT (policy ACCEPT) target prot opt source destination RH-Firewall-1-INPUT all -- 0.0...
4,128
<p>I run a rather complex project with several independent applications. These use however a couple of shared components. So I have a source tree looking something like the below.</p> <ul> <li>My Project <ul> <li>Application A</li> <li>Shared1</li> <li>Shared2 </li> <li>Application B </li> <li>Application C</li> </u...
<p>Your scheme is sound and achievable in VSS (although I would suggest you consider an alternative, VSS is really an outdated product).</p> <p>For your "CI" Build - you would do the Versioning take a look at <a href="http://msbuildtasks.tigris.org/" rel="nofollow noreferrer">MSBuild Community Tasks Project</a> which ...
<p>UppercuT can do all of this with a custom packaging task to split the applications up. And to get the version number of the source, you might think about Subversion.</p> <p>It's also insanely easy to get started.</p> <p><a href="http://code.google.com/p/uppercut/" rel="nofollow noreferrer">http://code.google.com/...
8,209
<p>The discussion of Dual vs. Quadcore is as old as the Quadcores itself and the answer is usually "it depends on your scenario". So here the scenario is a Web Server (Windows 2003 (not sure if x32 or x64), 4 GB RAM, IIS, ASP.net 3.0).</p> <p>My impression is that the CPU in a Webserver does not need to be THAT fast b...
<p>For something like a webserver, dividing up the tasks of handling each connection is (relatively) easy. I say it's safe to say that web servers is one of the most common (and ironed out) uses of parallel code. And since you are able to split up much of the processing into multiple discrete threads, more cores actu...
<p>The more the better. As programming languages start to become more complex and abstract, the more processing power that will be required.</p> <p>Atleat Jeff believes <a href="https://blog.stackoverflow.com/2008/04/our-dedicated-server/">Quadcore is better</a>.</p>
2,584
<p>I simply wondered whether people thought it was worth learning to use the MSBuild syntax in order to customise the build process for a .net project, or whether it is really not worth it given the ease with which one can build a project using visual studio. </p> <p>I am thinking in terms of nightly builds, etc., but...
<p>@kronoz<br> I would say YES.<br> The neat thing about MSBuild is that if you modify your csproj files to include custom build steps then those steps will happen from within VS or from MSBuild. Also if you ever have a build server you will not need to install full VS, only the SDK to build your projects.</p>
<blockquote> <p>@kronoz I would say YES. The neat thing about MSBuild is that if you modify your csproj files to include custom build steps then those steps will happen from within VS or from MSBuild. Also if you ever have a build server you will not need to install full VS, only the SDK to build your ...
7,021
<p>What are your favorite (G)Vim plugins/scripts?</p>
<p><a href="http://www.vim.org/scripts/script.php?script_id=1658" rel="noreferrer">Nerdtree</a></p> <p>The NERD tree allows you to explore your filesystem and to open files and directories. It presents the filesystem to you in the form of a tree which you manipulate with the keyboard and/or mouse. It also allows you t...
<p>During maintenance of a very big and old C++ project I've created two plugins and these are the only ones I use:</p> <ul> <li><a href="http://www.vim.org/scripts/script.php?script_id=1638" rel="nofollow noreferrer">SourceCodeObedience</a> </li> <li><a href="http://www.vim.org/scripts/script.php?script_id=2507" rel=...
4,184
<p>Related to my <a href="https://stackoverflow.com/questions/28975/anyone-using-couchdb">CouchDB</a> question.</p> <p>Can anyone explain MapReduce in terms a numbnuts could understand?</p>
<p>Going all the way down to the basics for Map and Reduce.</p> <hr> <p><strong>Map</strong> is a function which "transforms" items in some kind of list to another kind of item and put them back in the same kind of list.</p> <p>suppose I have a list of numbers: [1,2,3] and I want to double every number, in this case...
<p>I don't want to sound trite, but this helped me so much, and it's pretty simple:</p> <pre><code>cat input | map | reduce &gt; output </code></pre>
4,866
<p>I've written PL/SQL code to denormalize a table into a much-easer-to-query form. The code uses a temporary table to do some of its work, merging some rows from the original table together.</p> <p>The logic is written as a <a href="http://www.oreillynet.com/lpt/a/3136" rel="nofollow noreferrer">pipelined table funct...
<p>I think a way to approach this is to use analytic functions...</p> <p>I set up your test case using:</p> <pre><code>create table employee_job ( emp_id integer, job_id integer, status varchar2(1 char), eff_date date ); insert into employee_job values (1,10,'A',to_date('10-JAN-2008','DD-MON-YY...
<p>I couldn't agree with you more, HollyStyles. I also used to be a TSQL guy, and find some of Oracle's idiosyncrasies more than a little perplexing. Unfortunately, temp tables aren't as convenient in Oracle, and in this case, other existing SQL logic is expecting to directly query a table, so I give it this view inste...
4,043
<p>I have been using PLA filament for two years now and have had good prints. ABS on the other hand has not been so good, so my choice of filament is PLA. </p> <p>I am getting ready to do a sign for the American Legion and the colors are black, blue, and red and are 0.8 mm thin. The black letters are 4" x 2.5", blue a...
<p>I printed a handle for a rather big rolling door in natural PLA (From Fabberparts) - no UV protection. It's on the weather side of the house and is exposed to direct sun half the day.</p> <p>And after three years cycling to all the German seasons it's still absolutely fine. Also, Wikipedia told me that PLA has good ...
<p>Keep in mind that PLA has a much lower temperature point, where is starts getting flexible. I once had PLA-printed parts in my car in the summer for three hours and when I came back, they where bent. </p> <p>I don't know about the weather conditions in your local environment, but if you experience hot temperatures ...
410
<p>I have been using Solidworks and AutoCAD to create STL file of a 3D model I want to print. I slice the STL file using Freesteel Z level slicer (<a href="http://www.freesteel.co.uk/wpblog/slicer/" rel="nofollow">http://www.freesteel.co.uk/wpblog/slicer/</a>) and save the slices in a bmp format. </p> <p>My 3d print h...
<p>Your objective has a serious constraint regarding the pixel resolution. Within that limitation, the software (slicer) you are using will generate "best guess" images, particularly dependent on floating point math. There may be a single combination of circular shapes (radius) and spacing for these shapes that provide...
<p>Your objective has a serious constraint regarding the pixel resolution. Within that limitation, the software (slicer) you are using will generate "best guess" images, particularly dependent on floating point math. There may be a single combination of circular shapes (radius) and spacing for these shapes that provide...
258
<p>Im using Prusa Slicer 2.1 for my FlyingBear Ghost 4.</p> <p>I just changed my 0.4 mm nozzle for a 0.2 mm but it seems to jam in the heater probably due to too much filament trying to get out by the nozzle. Where is the setting to reduce the filement speed and how much I should reduce it?</p> <p>Here are my settings:...
<p>0.2 mm and 0.4 mm are half the diameter, but the maximum flow is not just half: Flow scales with the area. The 0.4 mm nozzle has an area 4 times as the 0.2 mm one:</p> <p><span class="math-container">$\frac{A_1} {A_2}=\frac {0.2^2}{0.1^2}=4$</span></p> <p>You need to reduce <code>print speed</code> or the <code>volu...
<p>The discussion about slowing the print speed is important, but in my experience it is not at the root of the problem, and slowing down printing may make it worse.</p> <p>If ny &quot;heater&quot; you mean the complete hot-end, then I suspect you are jamming in the cooler part of the hot-end. This cooler part is sepa...
1,743
<p>The minimum spanning tree problem is to take a connected weighted graph and find the subset of its edges with the lowest total weight while keeping the graph connected (and as a consequence resulting in an acyclic graph).</p> <p>The algorithm I am considering is:</p> <ul> <li>Find all cycles.</li> <li>remove the l...
<p>What happens if two cycles overlap? Which one has its longest edge removed first? Does it matter if the longest edge of each is shared between the two cycles or not?</p> <p>For example:</p> <pre><code>V = { a, b, c, d } E = { (a,b,1), (b,c,2), (c,a,4), (b,d,9), (d,a,3) } </code></pre> <p>There's an a -> b -> c ...
<p>@Tynan The system can be described (somewhat over simplified) as a systems of rules describing categorizations. "Things are in category A if they are in B but not in C", "Nodes connected to nodes in Z are also in Z", "Every category in M is connected to a node N and has 'child' categories, also in M for every node c...
5,815
<p>My JavaScript is pretty nominal, so when I saw this construction, I was kind of baffled:</p> <pre><code>var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings"); shareProxiesPref.disabled = proxyTypePref.value != 1; </code></pre> <p>Isn't it better to do an if on <code>proxyTypePref.val...
<p>It depends on the context of this code. If it's running on page load, then it would be better to put this code in an if block.</p> <p>But, if this is part of a validation function, and the field switches between enabled and disabled throughout the life of the page, then this code sort of makes sense.</p> <p>It's i...
<p>It's hard to say what's better to do without more context.</p> <p>If this code being executed every time that proxyTypePref changes, then you're always going to need set <code>shareProxiesPref.disabled</code>.</p> <p>I would agree than an if statement would be a bit more readable than the current code.</p> <block...
4,668
<p>I have a winform app that calls a web service to check for updates. This works in dev and it also works everywhere else I've tried it, just not on the installed copy on my machine (which happens to be the same in dev).</p> <p>The error is:</p> <p>Cannot execute a program. The command being executed was "C:\WINDOW...
<p>The ".cmdline" file is an autogenerated file produced by the .NET framework. The application is attempting to real-time compile an XML Serializer used to parse the data from the web service.</p> <p>Have you verified that you can execute "csc.exe" from a command-line window? Even just typing "C:\WINDOWS\Microsoft.NE...
<p>If AppLocker is enforced, please allow below (add as path exception) </p> <p><code>c:\windows\MICROSOFT.NET\FRAMEWORK\V2.0.50727\CSC.EXE</code> <code>c:\windows\MICROSOFT.NET\FRAMEWORK\V2.0.50727\CVTRES.EXE</code></p>
8,764
<p>I think most people know how to do this via the GUI (right click table, properties), but doing this in T-SQL totally rocks.</p>
<pre> CREATE TABLE #tmpSizeChar ( table_name sysname , row_count int, reserved_size varchar(50), data_size varchar(50), index_size varchar(50), unused_size varchar(50)) CREATE TABLE #tmpSizeInt ( table_name sysname , row_count int, reserved_siz...
<p>Check out this, I know it works in 2005 (<a href="https://learn.microsoft.com/sql/relational-databases/system-catalog-views/sys-database-files-transact-sql" rel="nofollow noreferrer">Microsoft Documentation</a>):</p> <p>Here is is for the pubs DB <pre><code> select * from pubs.sys.database_files </pre></code></p> ...
2,482
<p>I am wondering what experiences people are having using the ASP.NET MVC Framework? In particular I am looking for feedback on the type of experience folks are having using the framework.</p> <p>What are people using for their view engine? What about the db layer, NHibernate, LINQ to SQL or something else?</p> <p...
<p>I've been getting into some pretty heavy use of NHibernate with ASP.NET MVC lately, and am really loving it.</p>
<blockquote> <p>Why the choice of NHibernate over anything else?</p> </blockquote> <p>It's a very powerful tool, and is (relatively) easy to learn. It takes away all the monotony and repetitiveness of manually implementing object-relational mapping.</p>
4,379
<p>Let's aggregate a list of free quality web site design templates. There are a million of these sites out there, but most are repetitive and boring. </p> <p>I'll start with <a href="http://www.freecsstemplates.org/" rel="noreferrer">freeCSStemplates.org</a></p> <p>I also think other sites should follow some sort of...
<p>Check out:</p> <ul> <li><a href="http://www.oswd.org/" rel="noreferrer">Open Source Web Designs</a></li> <li><a href="http://cssremix.com/" rel="noreferrer">CSS Remix</a></li> <li><a href="http://bestwebgallery.com/" rel="noreferrer">Best Web Gallery</a></li> <li><a href="http://www.cssbased.com/" rel="noreferrer">...
<p>+1 for <a href="http://www.csszengarden.com/" rel="nofollow noreferrer">Zen garden.</a></p> <p>I like the resources at <a href="http://inobscuro.com/" rel="nofollow noreferrer">inobscuro.com</a></p>
2,481
<p>Is it possible to upload a file from a client's computer to the server through a web service? The client can be running anything from a native desktop app to a thin ajax client.</p>
<p>It's certainly possible to send binary files via web services (eg. SOAP), but you usually have to do some kind of encoding such as base64, which increases the amount of data to send. One of the most efficient ways to send an arbitrary binary file is via an HTTP PUT operation, since there is no encoding overhead. Not...
<p>I'm not a master in "webservice", but if you develop the webservice (and the client), you always can convert the binary file to <a href="http://en.wikipedia.org/wiki/Base64" rel="nofollow noreferrer">BASE64</a> in the client (can do in java... and i soupose in ajax too) and transfer as "string", in the other side, i...
3,288
<p>For some strange, bizarre reason, my images in my website just will not display on webkit based languages (such as safari and chrome).</p> <p>This is the image tag</p> <pre><code>&lt;img src="images/dukkah.jpg" class="imgleft"/&gt; </code></pre> <p>Not only does it not display in the website, it wont display when...
<p>Imagemagick reports that this particular image is saved in CMYK colorspace instead of the more standard RGB. Try converting it, it should be more compatible with the webkit rendering engine.</p> <p>Imagemagick is available for download from <a href="http://www.imagemagick.org/script/index.php" rel="nofollow norefer...
<p>I tried the url you gave in FireFox 3 and IE 6, IE 6 won't show it either, firefox works. My guess is that there is something wrong with the jpg file.</p>
6,514
<p>Without resorting to PInvoke, is there a way in .net to find out what windows are open? This is slightly different than asking what applications are running in memory. For example, Firefox could be running, but could be more than one window. Basically, I just want to be privy to the same information that the task...
<p>You could check out the new <a href="http://msdn.microsoft.com/en-us/library/ms747327.aspx" rel="nofollow noreferrer">UI Automation</a> stuff in .NET 3.5. It is supposed to mask a whole lot of the PInovke stuff and works with web and WPF applications.</p> <p>I haven't used it yet, so I don't have a more specific p...
<p>I'm afraid there is no way you can do it without PInvoke. To give focus to some window you should call SetForegroundWindow function, see <a href="http://www.codeproject.com/KB/cs/windowhider.aspx" rel="nofollow noreferrer">this</a> article for details.</p>
5,640
<p>I would like to print a custom version of something akin to this rugged case that was originally created using injection molding:</p> <p><a href="https://i.stack.imgur.com/oL8JW.jpg" rel="nofollow noreferrer" title="ea weather proofed tablet with over-molded rubber"><img src="https://i.stack.imgur.com/oL8JW.jpg" alt...
<p>I do it a couple of ways.</p> <p>I use TPU which is pretty good for impacts and either make it thick or stiffen it with another filament as an inside or outside shell.</p> <p>But TPU is what you want for this project because it's flexible in the way you need it to be.</p>
<p>Case designers usually use TPU for flexibility and polycarbonate for stiffness</p>
2,201
<p>I need to get a log of user access to our <code>SQL Server</code> so I can track <strong>average</strong> and <strong>peak concurrency usage</strong>. Is there a hidden table or something I'm missing that has this information for me? To my knowledge the application I'm looking at does not track this at the applicati...
<p>In SQL Server 2005, go to tree view on the left and select Server (name of the actual server) > Management > Activity Monitor. Hope this helps.</p>
<ul> <li>on <code>2000</code> you can use <code>sp_who2</code> or the <code>dbo.sysprocesses</code> system table</li> <li>on <code>2005</code> take a look at the <code>sys.dm_exec_sessions</code> DMV</li> </ul> <p>Below is an example</p> <pre><code>SELECT COUNT(*) AS StatusCount,CASE status WHEN 'Running' THEN 'Runn...
2,777
<p>I need a database that could be stored network drive and would allow multiple users (up to 20) to use it without any server software.</p> <p>I'm considering MS Access or Berkeley DB.</p> <p>Can you share your experience with file databases? <br> Which one did you use, did you have any problems with it?</p>
<p>I would suggest <a href="http://www.sqlite.org/index.html" rel="noreferrer">SQLite</a> because the entire database is stored in a single file, and it quite safely handles multiple users accessing it at the same time. There are several different libraries that you can use for your client application and there is no s...
<p>I have been using Access for some time and in a variety of situations, including on-line. I have found that Access works well if it is properly set up according to the <a href="http://msdn.microsoft.com/en-us/library/aa167840.aspx" rel="nofollow noreferrer">guidelines</a>. One advantage of Access is that it includes...
5,545
<p>I am attempting to print the Benchy boat but every attempt so far has been unsuccessful. The print has a sort of slope/blob on the nose of the boat, which emerges after the first 30 layers.</p> <p><a href="https://i.stack.imgur.com/vx2cM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vx2cM.jpg" ...
<p>Looks like curling from to much being extruded and no cooling I had the same problem added part cooling and problem was gone </p>
<p>The lines along the length of the boat also appear to be wobbling, can you confirm this? Have you used this material before? The layers should look straight and equal. <a href="https://i.stack.imgur.com/PvV5g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PvV5g.png" alt="enter image description h...
849
<p>I am modifying some Slic3r config parameters and comparing the results. How can I have two instances (or equivalent: I would like to see two model windows with their associated configuration screens) of Slic3r at the same time? I'm on OS X, but if there is a generic (e.g. within Slic3r) solution that will be prefe...
<p>From a terminal window, run the command</p> <pre><code>open -n -a slic3r </code></pre> <p>Each time the command is executed, a new instance of Slic3r is created.</p> <p>As per Carl's note, keep in mind that both instances of Slic3r will be sharing the same configuration files, so it will be safest not to save con...
<p>From a terminal window, run the command</p> <pre><code>open -n -a slic3r </code></pre> <p>Each time the command is executed, a new instance of Slic3r is created.</p> <p>As per Carl's note, keep in mind that both instances of Slic3r will be sharing the same configuration files, so it will be safest not to save con...
1,081
<p>I suspect that one of my applications eats more CPU cycles than I want it to. The problem is - it happens in bursts, and just looking at the task manager doesn't help me as it shows immediate usage only.</p> <p>Is there a way (on Windows) to track the history of CPU &amp; Memory usage for some process. E.g. I will ...
<p>Press <kbd>Win</kbd>+<kbd>R</kbd>, type <code>perfmon</code> and press <kbd>Enter</kbd>. When the Performance window is open, click on the <strong>+</strong> sign to add new counters to the graph. The counters are different aspects of how your PC works and are grouped by similarity into groups called &quot;Performan...
<p>I use taskinfo for history graph of CPU/RAM/IO speed. <a href="http://www.iarsn.com/taskinfo.html" rel="nofollow noreferrer">http://www.iarsn.com/taskinfo.html</a></p> <p>But bursts of unresponsiveness, sounds more like interrupt time due to a falty HD/SS drive. </p>
9,474
<p>I have a "Status" class in C#, used like this:</p> <pre><code>Status MyFunction() { if(...) // something bad return new Status(false, "Something went wrong") else return new Status(true, "OK"); } </code></pre> <p>You get the idea. All callers of MyFunction <em>should</em> check the returned Status:...
<p>I know this doesn't answer your question directly, but if "something went wrong" within your function (unexpected circumstances) I think you should be throwing an exception rather than using status return codes.</p> <p>Then leave it up to the caller to catch and handle this exception if it can, or allow it to propo...
<p>You can throw an exception by:</p> <pre><code>throw MyException; [global::System.Serializable] public class MyException : Exception { // // For guidelines regarding the creation of new exception types, see // http://msdn.microsoft.com/library/default.asp?url=/library/en-...
4,001
<p>And on top of that, are there cases where one has to use the global assembly cache or where one cannot use it?</p>
<ul> <li>Loading assemblies from GAC mean less overhead and security that your application will always load correct version of .NET library</li> <li>You shouldn't ngen assemblies that are outside of GAC, because there will be almost no performance gain, in many cases even loss in performance.</li> <li>You're already us...
<p>In all my life, I have had maybe one application where I had to put an assembly in the GAC, simply because these assemblies were part of a framework that a number of applications would use it, and it seemed right to put them into the GAC.</p>
4,349
<p>I build up an array of strings with</p> <pre><code>string[] parts = string.spilt(" "); </code></pre> <p>And get an array with X parts in it, I would like to get a copy of the array of strings starting at element </p> <pre><code>parts[x-2] </code></pre> <p>Other than the obvious brute force approach (make a new a...
<p>How about Array.Copy?</p> <p><a href="http://msdn.microsoft.com/en-us/library/aa310864(VS.71).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa310864(VS.71).aspx</a></p> <blockquote> <p>Array.Copy Method (Array, Int32, Array, Int32, Int32)</p> <p>Copies a range of elements from an Array star...
<p>Use <a href="http://msdn.microsoft.com/en-us/library/system.array.copy(VS.80).aspx" rel="nofollow noreferrer">Array.Copy</a>. It has an overload that does what you need: </p> <blockquote> <p>Array.Copy (Array, Int32, Array, Int32, Int32)<br> <em>Copies a range of elements from an Array starting at the specif...
5,087
<p>How do I find the start of the week (both Sunday and Monday) knowing just the current time in C#?</p> <p>Something like:</p> <pre><code>DateTime.Now.StartWeek(Monday); </code></pre>
<p>Use an extension method:</p> <pre><code>public static class DateTimeExtensions { public static DateTime StartOfWeek(this DateTime dt, DayOfWeek startOfWeek) { int diff = (7 + (dt.DayOfWeek - startOfWeek)) % 7; return dt.AddDays(-1 * diff).Date; } } </code></pre> <p>Which can be used as fo...
<pre><code>public static System.DateTime getstartweek() { System.DateTime dt = System.DateTime.Now; System.DayOfWeek dmon = System.DayOfWeek.Monday; int span = dt.DayOfWeek - dmon; dt = dt.AddDays(-span); return dt; } </code></pre>
5,897
<p>I have a .exe and many plug-in .dll modules that the .exe loads. (I have source for both.) A cross-platform (with source) solution would be ideal, but the platform can be narrowed to WinXP and Visual Studio (7.1/2003 in my case).</p> <p>The built-in VS leak detector only gives the line where new/malloc was called f...
<p>I personally use <a href="http://vld.codeplex.com" rel="noreferrer">Visual Leak Detector</a>, though it can cause large delays when large blocks are leaked (it displays the contents of the entire leaked block).</p>
<p>Try <a href="http://www.codeproject.com/KB/applications/leakfinder.aspx" rel="nofollow noreferrer">Jochen Kalmbach's Memory Leak Detector</a> on Code Project. The URL to the latest version was somewhere in the comments when I last checked.</p>
4,531
<p>I've been looking at ways to implement gmail-like messaging inside a browser, and arrived at the <a href="http://en.wikipedia.org/wiki/Comet_(programming)" rel="noreferrer">Comet</a> concept. However, I haven't been able to find a good .NET implementation that allows me to do this within IIS (our application is writ...
<p>Comet is challenging to scale with IIS because of comet's persistent connectivity, but there is a team looking at Comet scenarios now. Also look at <a href="http://www.aaronlerch.com/blog/2007/07/08/creating-comet-applications-with-aspnet/" rel="noreferrer">Aaron Lerch's blog</a> as I believe he's done some early Co...
<p>I think the Comet approach isn't really scalable unless you are prepared to expand the web farm horizontally (by adding more web servers to the mix). The way it works is that it leaves a TCP connection open per user session, just so the server can push stuff into that connection from time to time to immediately info...
9,137
<p>I want to run a web application on php and mysql, using the CakePHP framework. And to keep the threshold of using the site at a very low place, I want to not use the standard login with username/password. (And I don't want to hassle my users with something like OpenID either. Goes to user type.)</p> <p>So I'm think...
<p>I have used the <a href="http://www.phpclasses.org/browse/file/3.html" rel="nofollow noreferrer">pop3 php class</a> with great success (there is also a <a href="http://pear.php.net/package/Net_POP3" rel="nofollow noreferrer">Pear POP3 module</a>).</p> <p>Using the pop3 class looks something like this:</p> <pre><co...
<p>I would seriously reconsider this approach. E-mail hasn't got very high reliability. There's all kinds of spamfilters that might intercept e-mails with links thereby rendering the "command" half-finished, not to mention the security risks.</p> <p>It's very easy to spoof the sender-address on an e-mail. You are basi...
6,894
<p>Is there a general procedure for programming extensibility capability into your code?</p> <p>I am wondering what the general procedure is for adding extension-type capability to a system you are writing so that functionality can be extended through some kind of plugin API rather than having to modify the core code ...
<p>This is generally something that you'll have to expose yourself, so yes, it will be dependent on the language your system is written in (though often it's possible to write wrappers for other languages as well).</p> <p>If, for example, you had a program written in C, for Windows, plugins would be written for your p...
<ol> <li><p>Find out what minimum requrements you want to put on a plugin writer. Then make one or more Interfaces that the writer must implement for your code to know when and where to execute the code. </p></li> <li><p>Make an API the writer can use to access some of the functionality in your code. </p></li> </ol> ...
2,961
<p>Say a development team includes (or makes use of) graphic artists who create all the images that go into a product. Such things include icons, bitmaps, window backgrounds, button images, animations, etc.</p> <p>Obviously, everything needed to build a piece of software should be under some form of version control. ...
<p>Yes, having art assets in version control is very useful. You get the ability to track history, roll back changes, and you have a single source to do backups with. Keep in mind that art assets are MUCH larger so your server needs to have lots of disk space &amp; network bandwidth.</p> <p>I've had success with us...
<p>With respect to diff and merging, I think the version control is more critical for graphics and media elements. If you think about it, most designers are going to be the sole owners of a file -- at least in the case of graphics -- or at least I would think that'd be the case. I'd be curious to hear from a designer...
4,894
<p>I've just started working on an <code>ASP.NET</code> project which I hope to open source once it gets to a suitable stage. It's basically going to be a library that can be used by existing websites. My preference is to support <code>ASP.NET 2.0</code> through <code>3.5</code>, but I wondered how many people I would ...
<p>Increasingly I think not.</p> <p>The kind of large rigid organisation currently still clinging to 1.1 (probably because they're only just upgraded to it) is also the kind that's highly unlikely to look at open source solutions.</p> <p>If I were starting a new ASP.Net project right now I'd stick with .Net 3.5 and p...
<p>I think you would be perfectly fine with targeting just 2.0 and above, someone who would use your library would most likely be doing new development and using at least ASP.NET 2.0. I think it would be a very small group of people doing new development in 1.1.</p>
3,412
<p>Can anyone tell me what exactly does this Java code do?</p> <pre><code>SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); byte[] bytes = new byte[20]; synchronized (random) { random.nextBytes(bytes); } return Base64.encode(bytes); </code></pre> <hr> <p>Step by step explanation will be useful so that...
<p>Using code snippets you can get to something like this</p> <pre> Dim randomNumGen As RandomNumberGenerator = RNGCryptoServiceProvider.Create() Dim randomBytes(20) As Byte randomNumGen.GetBytes(randomBytes) return Convert.ToBase64String(randomBytes) </pre>
<p>Basically the code above:</p> <ol> <li>Creates a secure random number generator (for VB see link below)</li> <li>Fills a bytearray of length 20 with random bytes</li> <li>Base64 encodes the result (you can probably use Convert.ToBase64String(...))</li> </ol> <p>You should find some help here: <a href="http://msdn....
9,808
<p>While <kbd>Ctrl</kbd><kbd>X</kbd> works fine in vim under windows, <kbd>Ctrl</kbd><kbd>A</kbd> selects all (duh).</p> <p>Is there a way to increment a number with a keystroke under windows?</p>
<p>Try Ctrl-NumPad + ?</p> <p>(<a href="https://web.archive.org/web/20080912200928/http://www.vim.org/tips/tip.php?tip_id=305" rel="nofollow noreferrer">from here</a>)</p>
<p>I am using cygwin terminal + screen, so &lt;c-a> is captured by the terminal multiplexer. I used this mapping:</p> <p>:noremap &lt;c-i> &lt;c-a></p>
9,248
<p>I want to be able to run my Chiron during night-time, but my neighbours tries to sleep at that time of day. I have put a lot of effort into making the printer silent. The controller-fan and power-supply-fan now run slower and only when needed, I have put the printer on those <a href="https://www.thingiverse.com/thin...
<p>Have you tried a concrete tile for garden with foam below it?</p> <p>Check <a href="https://www.cnckitchen.com/blog/reduce-your-3d-printing-noise-with-a-concrete-paver" rel="noreferrer">https://www.cnckitchen.com/blog/reduce-your-3d-printing-noise-with-a-concrete-paver</a></p> <p>The same is on</p> <p><div class="yo...
<p>I noticed that my TMC drivers make a loud KLANK sound when switching from stealthchop to spreadcycle. The solution is to keep the in stealthchop at all time by butting the threshold really high (I set mine to 1000 mm/s). You may also look for resonance in your frame. If you’re using Klipper, you can use input Shaper...
1,885
<p>I'm currently trying to read in an XML file, make some minor changes (alter the value of some attributes), and write it back out again.</p> <p>I have intended to use a StAX parser (<code>javax.xml.stream.XMLStreamReader</code>) to read in each event, see if it was one I wanted to change, and then pass it straight o...
<p>StAX works pretty well and is very fast. I used it in a project to parse XML files which are up to 20MB. I don't have a thorough analysis, but it was definitely faster than SAX. </p> <p>As for your question: The difference between streaming and event-handling, AFAIK is control. With the streaming API you can walk t...
<p>After a bit of mucking around, the answer seems to be to use the Event reader/writer versions rather than the Stream versions.</p> <p>(i.e. javax.xml.stream.XMLEventReader and javax.xml.stream.XMLEventWriter)</p> <p>See also <a href="http://www.devx.com/tips/Tip/37795" rel="nofollow noreferrer">http://www.devx.com...
3,177
<pre><code>public static void main(String[] args) { List&lt;? extends Object&gt; mylist = new ArrayList&lt;Object&gt;(); mylist.add("Java"); // compile error } </code></pre> <p>The above code does not allow you to add elements to the list and wild cards can only be used as a signature in methods, again not ...
<p>Let's say you have an interface and two classes:</p> <pre><code>interface IResult {} class AResult implements IResult {} class BResult implements IResult {} </code></pre> <p>Then you have classes that return a list as a result:</p> <pre><code>interface ITest&lt;T extends IResult&gt; { List&lt;T&gt; getResult();...
<p>This works:</p> <pre><code>List&lt;? super Object&gt; mylist = new ArrayList&lt;Object&gt;(); mylist.add("Java"); // no compile error </code></pre> <p>From O'Reilly's <a href="http://oreilly.com/catalog/9780596527754/" rel="nofollow noreferrer">Java Generics</a>:</p> <blockquote> <p>The Get and Put Principle: u...
9,506
<p>We are currently working on a new version of our main application. one thing that I really wish to work on is providing support for multiple monitors. Increasingly, our target users are adding second screens to their desktops and I think our product could leverage this extra space to improve user performance.</p> ...
<p>Few random tips:</p> <ul> <li>If multiple windows can be open at one time, allow users to have them on separate screens. Seems obvious, but some very popular apps (e.g. Visual Studio) fail miserably at this.</li> <li>Remember the position of the last opened window, and open new windows on the same screen as before....
<p>One thing to keep in mind is that the user may have more than two monitors. My main system has six monitors, and I've run 4+ monitors on Linux, Windows, and Mac OS. Many applications--even multi-monitor utilities--will support 2 monitors but freak out over more than 2.</p> <p>Applications work best when they know...
3,429
<p>I have a RepRap Prusa i2. I have done the majority of my printing with clear PLA that I got on the cheap from eBay. It works just fine.</p> <p>I bought a roll of Hatchbox Silver PLA (1.75&nbsp;mm) from Amazon. I have never had a print go well with it. I have tried various combinations of hotter and cooler extruder ...
<p>I've been using Hatchbox 1.75&nbsp;mm (but white), and settled on 190°C extruder temp, and 60°C bed. I've had trouble getting some prints to adhere to the bed, but most have been ok; I don't see a clear pattern. I don't know whether it's the fiber or my settings. I'm trying slightly higher temperatures, higher extru...
<p>I use a Wahao Duplicator I3 with a heated bed. I have only used the orange Hatchbox PLA with great results. I use 210°C for the extruder and 55°C for the bed. Speed is 40&nbsp;mm/s which works well for me. </p>
276
<p>I'm sure we've all seen it before...A code base that has been around for a year or two, and as features have been added and bugs fixed, we end up with pieces of code that aren't actually in use anymore. I'm wondering if there is a way (especially in VS.NET with or without a third-party tool) to search the codebase ...
<p><a href="http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx" rel="noreferrer">FxCop</a> will warn you of methods where nothing calls them.</p>
<p>The following tool can find orphan/unused code:</p> <p><a href="http://www.mztools.com/index.aspx" rel="nofollow noreferrer">MZ-Tools</a></p>
3,585
<p>What would be the best way to develop a text box that remembers the last x number of entries that were put into it. This is a standalone app written with C#.</p>
<p>This is actually fairly easy, especially in terms of showing the "AutoComplete" part of it. In terms of remembering the last x number of entries, you are just going to have to decide on a particular event (or events) that you consider as an entry being completed and write that entry off to a list... an AutoComplete...
<p>I store the completion list in the registry. </p> <p>The code I use is below. It's reusable, in three steps: </p> <ol> <li>replace the namespace and classname in this code with whatever you use.</li> <li>Call the FillFormFromRegistry() on the Form's <strong>Load</strong> event, and call SaveFormToRegistry on the...
6,458
<p>I have a 3D printer built from generic, scrap parts. It's controlled by a 2+ years old <code>MKS GEN L</code> board running Marlin version <code>1.1.x</code>.</p> <p>I want to do a complete bed assembly replacement, including:</p> <ul> <li>Heated bed</li> <li>Thermistor</li> <li>Y-carriage</li> </ul> <p>All the hard...
<h1>The surface won't work</h1> <p>The only true-metallic surface treatments I know to be actual metal in large enough amounts to conduct electricity would be leafmetal, akin to leaf gold, and electroplating. However, you can't use the procedures for stainless steels, and even then, the thickness is in the tenth of a µ...
<p>No rust but has magnetic properties? You could try varnishing the iron filled PLA.</p>
1,855
<p>So far, I've only used Rational Quantify. I've heard great things about Intel's VTune, but have never tried it!</p> <p>Edit: I'm mostly looking for software that will instrument the code, as I guess that's about the only way to get very fine results.</p> <hr /> <h3>See also:</h3> <p><a href="https://stackoverflow.co...
<p>For linux development (although some of these tools might work on other platforms). These are the two big names I know of, there's plenty of other smaller ones that haven't seen active development in a while.</p> <ul> <li><a href="http://valgrind.org/" rel="noreferrer">Valgrind</a></li> <li><a href="http://www.cs.u...
<p>Let me give a plug for EQATEC... just what I was looking for... simple to learn and use and gives me the info I need to find the hotspots quickly. I much prefer it to the one built in to Visual Studio (though I haven't tried the VS 2010 one yet, to be fair).</p> <p>The ability to take snapshots is HUGE. I often g...
4,620
<p>How do you set the Windows time zone on the local machine programmatically in C#? Using an interactive tool is not an option because the remote units have no user interface or users. The remote machine is running .NET 2.0 and Windows XP Embedded and a local app that communicates with a central server (via web serv...
<p><a href="http://msdn.microsoft.com/en-us/library/ms724944.aspx" rel="nofollow noreferrer">SetTimeZoneInformation</a> should do what you need. You'll need to use <a href="http://pinvoke.net/default.aspx/kernel32/SetTimeZoneInformation.html" rel="nofollow noreferrer">P/Invoke</a> to get at it.</p> <p>Note also that y...
<p>Try this...</p> <p>First, you need to find, in the registry, the <strong>key</strong> that represents the zone you want ("Central Standard Time" is an example). Those are located here:</p> <blockquote> <p>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Current Version\Time Zones</p> </blockquote> <p>So, with t...
5,272
<p>I'm a new one for this community. This also not directly related with 3D printing. I searched about this and I couldn't find good answer.</p> <p>One of my friends told me CNC machining centers (Milling) mostly use servo motors and CNC laser cutter and plasma cutters use stepper motors mostly.</p> <p>Position contr...
<p>Servos do have several advantages; but, they are more expensive and more difficult to control.</p> <p>Generally, a servo motor is a DC motor but with an encoder to provide position feedback. A circuit (can be a computer) then compares the actual position (from the encoder) against the commanded position and uses t...
<p>Servo for spindle to control rotation speed of cutting bit. Stepper to control movement and tool position. All CNC machines.</p>
610
<p>The rich presentational capabilities of WPF and Silverlight mean developers like me will be working closely with graphic designers more often these days, as is the case in my next project. </p> <p>Does anyone out there have any tips and experience (from both points of view) on making this go more smoothly? </p> ...
<p>I have spent 4 months on a project working extremely closely with a designer and he has still not picked up the basic idea of CVS (which is not my choice of source control system). I'm talking template files, JavaScript and CSS here. He's not stupid, it's just one of these things that makes his job harder so he resi...
<p>Quite frankly you should tell the designer that images can, should and "will be put in source control mister!" :) </p> <p>It may be slightly non-conventional and you wont be able to do a merge or anything of that nature, but there will be revisions and a history, etc .. Images can also be embedded in a resource fi...
7,478
<p>I have an asp.net url path which is being generated in a web form, and is coming out something like "/foo/bar/../bar/path.aspx", and is coming out in the generated html like this too. It should be shortened to "/foo/bar/path.aspx". </p> <p>Path.Combine didn't fix it. Is there a function to clean this path up? </p>
<p>You could create a helper class which wrapped the UriBuilder class in System.Net</p> <pre><code>public static class UriHelper { public static string NormalizeRelativePath(string path) { UriBuilder _builder = new UriBuilder("http://localhost"); builder.Path = path; return build...
<p>Sarcastic's reply is so much better than mine, but if you were working with filesystem paths, my <strong>ugly hack below</strong> could turn out to be useful too. (Translation: I typed it, so I'll be damned if I don't post it :)</p> <p>Path.Combine just slaps two strings together, paying attention to leading or tra...
7,787
<p>I'm trying to figure out how big a certain database would be (it hasn't been created yet). I know how many rows and what the tables will be. Is there a feature in Oracle that will tell me the size of such a theoretical database? Is there a known math formula I can use? I know there is a feature to determine the size...
<p>you can from the size of the data types for the columns in a table. You can then get a rough estimate of the size of a row in that table. then for 1 to n tables, then for 1 row in 1 table for x rows in x tables = estimate of the database for a given rowsize.</p> <p>Long handed I know but this is how i normally do ...
<p>Having an exact size wasn't too important, so I went with littlegeek's method. I figured out what my tables and columns would be, and <a href="http://lbd.epfl.ch/f/teaching/courses/oracle8i/server.815/a68003/01_04blt.htm" rel="nofollow noreferrer">looked up the sizes of the data types</a>, then did some good 'ole mu...
3,224
<p>I'm trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definitions on Wikipedia <a href="http://en.wikipedia.org/wiki/Coupling_%28computer_science%29" rel="noreferrer">here</a> and <a href="http://en.wikipedi...
<p><strong>Coupling</strong></p> <ul> <li><p>Loose: You and the guy at the convenience store. You communicate through a well-defined protocol to achieve your respective goals - you pay money, he lets you walk out with the bag of Cheetos. Either one of you can be replaced without disrupting the system.</p></li> <li><p>...
<p>"Coupling is a measure of interdependencies between modules, which should be minimized" "cohesion, a quality to be maximized, focuses on the relationships between the activities performed by each module."</p> <p>quoted from this paper: <a href="http://steve.vinoski.net/pdf/IEEE-Old_Measures_for_New_Services.pdf" re...
6,114
<p>When I've registered an object <strong>foo</strong> to receive KVO notifications from another object <strong>bar</strong> (using addObserver:...), if I then deallocate <strong>foo</strong> do I need to send a <code>removeObserver:forKeyPath:</code> message to <strong>bar</strong> in -dealloc?</p>
<p>You need to use <code>-removeObserver:forKeyPath:</code> to remove the observer before <code>-[NSObject dealloc]</code> runs, so yes, doing it in the <code>-dealloc</code> method of your class would work.</p> <p>Better than that though would be to have a deterministic point where whatever owns the object that's doi...
<p>Definitely agree with Chris on the "Stick to memory (and other scarce resource) management in -dealloc and -finalize..." comment. A lot of times I'll see people try to invalidate NSTimer objects in their dealloc functions. The problem is, NSTimer retains it's targets. So, if the target of that NSTimer is self, de...
3,483
<p>I'm very new to 3D printing. When my printer was new, I got loads of really good prints, however, now they're all failing.</p> <p>I suspected that the nozzle was in bad shape, so I replaced it, but even now, the prints are still quite bad.</p> <p>I suspect that the filament is not coming out properly. (extruding?)</...
<p>The CR-6 SE uses strain gauge based sensing for the auto leveling. This implies that the nozzle itself is the probe for the leveling procedure. It is important that there is no filament left on the nozzle and no debris is on the bed (of so, this causes incorrect measurement of the bed surface and results in a too la...
<p>It almost looks like that nozzle is too far away from the bed. Try releveling your bed.</p>
2,193
<p>I am currently printing PLA infused with 80% copper powder. So far I mainly used it because it looks and feels really nice and post-processing is almost limitless, however recently I have thought that metal-like filaments might actually be a good idea for gears (in case I don't want to use polycarbonate or carbon fi...
<p>With the right material, you could print the gear and then sinter it, resulting in actual metal gears. However, 80 % metal-filled PLA is at the lowest border to achieve this, and a lot of that technology is patented.</p> <h2>Filamet<sup>TM</sup></h2> <p>Filamet<sup>TM</sup> is a <a href="https://shop.thevirtualfound...
<p>At a guess, copper really isn't that strong so you're likely to see minimal improvements, if any.</p> <p>The PLA carrier plastic is still PLA, with a low melting point.</p> <p>The copper won't &quot;fuse&quot; with the PLA, it will still be flakes of metal embedded in a tiny pocket inside of a plastic structure.</p>...
2,088
<p>I am considering buying an Apple MacBook Pro. Are there any pitfalls developing C#/.NET code in a virtual machine running on a Mac?</p> <p>Also, is it better to run Vista or XP Pro for this purpose?</p>
<p>I can't tell you any specific experiences since I don't have a Mac, but I did want to point out that there was an awesome episode of the DeepFriedBytes podcast that discussed this very topic. It made me want to give it a try. They discuss the pros and cons of going this route - well worth the listen IMO if this is s...
<p>Probably better not to run vista in a VM. Especially if you want the Aero UI turned on. VMs aren't very good with advanced graphics, so you'll probably want to run XP, or Vista in classic mode.</p>
4,794
<p>I've got a peculiar issue today, and was looking for some help with it.</p> <p>Of the six Ender 3s I manage at my college, one of them seems to be <strong>stretching the Y axis</strong> of all the prints I make with it.</p> <p>Some points about the issue:</p> <ul> <li>It's variable, but is much more pronounced in...
<p>If an axis doesn't print the sizes you command it there are basically 2 options causing this.</p> <ol> <li>The printer is incorrectly configured,</li> <li>The printer has an hardware issue.</li> </ol> <p>To find out which of the 2 is applicable, you need to look into your setup and into the firmware settings. E.g....
<p>It is likely you have PU belt and it is likely it stretched in some area. I had all my PU belts finally stretched with big tension and high speed printing. Now I am using reinforced rubber belts.</p>
1,613
<p>I am operating a laser sintering machine, using polyamide 2200 powder (with a grain size of approximately 50 micrometers). During a print, a lot of powder goes unsintered and can theoretically be reused. However, using purely recycled powder degrades print quality to an unacceptable level.</p> <p>Mixing a little us...
<p>You'll find generally that mixing 40% new polyamide with 60% recycled polyamide will result in a reasonable finish and part. You will obviously want to use all new for parts requiring the best possible finish and mechanical properties, but this mixture will be very difficult to tell apart from a fully new mixture pa...
<p>You'll find generally that mixing 40% new polyamide with 60% recycled polyamide will result in a reasonable finish and part. You will obviously want to use all new for parts requiring the best possible finish and mechanical properties, but this mixture will be very difficult to tell apart from a fully new mixture pa...
141
<p>I have a PrusaI3(Chinese kit that I assembled myself). my strange problem is that: when I try to leveling the bed, upper-left and bottom-right corners of the bed, are more far than the nozzle, respect to upper-right and bottom-left.</p> <p>I don't know why, but I can't level them with the screws(because upper-left ...
<p>The Prusha I3 design uses two rods to guide the Y axis, which moves along the rods on linear bearings. If the rods are not strictly planar, there will be movement of the bed as it moves to and fro. You would not be able to correct this with the leveling screws.</p> <p>Be sure that the rods are planar, and that th...
<p>The Prusha I3 design uses two rods to guide the Y axis, which moves along the rods on linear bearings. If the rods are not strictly planar, there will be movement of the bed as it moves to and fro. You would not be able to correct this with the leveling screws.</p> <p>Be sure that the rods are planar, and that th...
737
<p>On their website they say the following</p> <pre><code>0.25 mm nozzle: 150 to 60 micron 0.40 mm nozzle: 200 to 20 micron 0.60 mm nozzle: 400 to 20 micron 0.80 mm nozzle: 600 to 20 micron </code></pre> <p>That confuses me. Why can I go down to 20 micron with the 0.40, 0.60 and 0.80 nozzle but only down to 60 micron...
<p>You need a certain minimum flow rate to achieve consistent extrusion. Flow rate is the product of print speed, extrusion width (proportional to nozzle size) and print speed. If you use a very small nozzle and very low layer height, you'd need a very high printing speed to achieve a reasonable flow rate. Therefore, i...
<p>In addition of Tom van der Zanden's answer, when the filament moves too slowly through the heated part of the printhead it is very likeley to clog.</p> <p>I have had this multiple times on my UM1+, most of the time resulting from a heated printhead with no extrusion (before or after prints). So you need to be sure ...
388
<p>I want to use magnets to hold the lid of a box down tight enough to keep it relatively airtight (along with a rubber seal etc.), but I am not sure what strength of magnet to use, that will still allow it to be opened without causing damage either by having to be pried open or by crushing the print layers. I cannot s...
<p>You can vary the “strength” of the magnet by making a membrane of 3D printed plastic in between the magnets. The strength of the attraction is something like a logarithmic relationship to distance- small changes in thickness of material in between the magnets have a large effect on how strong they stick to each othe...
<p>I had a similar experience using magnets to hold two plates together. Currently also building a device (3d-printed) that clamps together with magnets. For both of these scenarios, I typically start by looking at what size and force you need. I would look into maybe 3 options of different magnets to start with. It co...
2,103
<p>So I've switched the Trigorilla board in the printer with a SKR 1.3 with TMC2208 drivers and installed the latest Marlin 2.0, with a config based on <a href="https://www.thingiverse.com/thing:3741425/" rel="nofollow noreferrer">this one</a>. You can find the <a href="https://pastebin.com/ij1G5tSw" rel="nofollow nore...
<p>So the problem was that the TMC2208 were wired for UART mode, yet Marlin was configured for standalone, which apparently makes them work, but with completely wrong step sizes. Changing it in the configuration completely eliminated the problem</p>
<p>I would check the "steps per distance" setting. If the motors were moving more than the firmware thinks, the height would measure as shorter than actual (since the number of steps would be less than the firmware expected). Similarly, the radius would scale up.</p> <p>You replaced the controller and motor drivers,...
1,476
<p>I am looking to allow users to control of subdomain of an app I am toying with, much like Basecamp where it is <code>customusername.seework.com</code>.</p> <p>What is required on the <code>DNS</code> end to allow these to be created dynamically and be available instantly. </p> <p>And how do you recommend dealing w...
<p>The way we do this is to have a 'catch all' for our domain name registered in DNS so that anything.ourdomain.com will point to our server.</p> <p>With Apache you can set up a similar catch-all for your vhosts. The ServerName must be a single static name but the ServerAlias directive can contain a pattern.</p> <pr...
<p>I was looking to do something similar (<code>www.mysite.com/SomeUser</code>).</p> <p>What I did was I edited <code>404.shtml</code> to include this server side include (SSI) code:</p> <pre><code>&lt;!--#include virtual="404.php" -- &gt; </code></pre> <p>Then I created the file <code>404.php</code>, where I parsed...
2,360
<p>I am looking to write some C# code for linux/windows/mac/any other platform, and am looking for best practices for portable code.</p> <p>Project <a href="http://go-mono.org" rel="noreferrer">mono</a> has some great <a href="http://www.mono-project.com/Category:Porting" rel="noreferrer">porting</a> resources.</p> <...
<p>I've actually used winforms and it was fine. It was BUTT UGLY, but it worked.</p> <p>Obviously, don't use P/Invoke, or any win32 stuff like the registry. Also be aware of any third party DLL's. For example, we use a third party SQLite dll which actually contains native code in it which we have to swap out if we wan...
<p>If you want the code to be portable, you need to closely review the list of completed features on the Mono site. They go into detail on each class in the framework, and the level of completeness. You will have to take these things into consideration during the design process so that you don't go too far down a pat...
6,418
<p>Imagine you homebrew a custom gui framework that <em>doesn't</em> use windows handles (compact framework, so please don't argue with "whys"). One of the main disadvantages of developing such a framework is that you lose compatability with the winform designer.</p> <p>So my question is to all of you who know a lot a...
<pre><code>select * from information_schema.tables WHERE OBJECTPROPERTY(OBJECT_ID(table_name),'IsMSShipped') =0 </code></pre> <p>Will exclude dt_properties and system tables</p> <p>add </p> <pre><code>where table_type = 'view' </code></pre> <p>if you just want the view</p>
<pre><code>select * from information_schema.tables where table_type = 'view' </code></pre>
5,325
<p>One of my favourite tools for linux is <a href="http://en.wikipedia.org/wiki/Lsof" rel="noreferrer" title="Wikipedia">lsof</a> - a real swiss army knife!</p> <p>Today I found myself wondering which programs on a WinXP system had a specific file open. Is there any equivalent utility to lsof? Additionally, the file i...
<p>Use <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="noreferrer" title="Process Explorer">Process Explorer</a> from the Sysinternals Suite, the Find Handle or DLL function will let you search for the process with that file open.</p>
<p>If you right-click on your "Computer" (or "My Computer") icon and select "Manage" from the pop-up menu, that'll take you to the Computer Management console.</p> <p>In there, under System Tools\Shared Folders, you'll find "Open Files". This is probably close to what you want, but if the file is on a network share th...
3,651
<p>From C# on a Windows box, is there a way to find out how a process was stopped? I've had a look at the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx" rel="nofollow noreferrer">Process</a> class, managed to get a nice friendly callback from the Exited event once I set <code>EnableR...
<p>Fire up Process Monitor (from Sysinternals, part of Microsoft), run your process and let it die, then filter the Process Monitor results by your process name -- you will be able to see everything that it did, including exit codes.</p>
<p>You can use the return code of the process for that. If your process returns a non-zero value from its Main method, you can then check whether or not the process exited by itself (the return value matches).</p>
8,249
<p>My website was recently attacked by, what seemed to me as, an innocent code:</p> <pre><code>&lt;?php if ( isset( $ _GET['page'] ) ) { include( $ _GET['page'] . ".php" ); } else { include("home.php"); } ?&gt; </code></pre> <p>There where no SQL calls, so I wasn't afraid for SQL Injection. But, apparen...
<p>Use a whitelist and make sure the page is in the whitelist:</p> <pre><code> $whitelist = array('home', 'page'); if (in_array($_GET['page'], $whitelist)) { include($_GET['page'].'.php'); } else { include('home.php'); } </code></pre>
<p>@pek - That won't work, as your array keys are 0 and 1, not 'home' and 'page'.</p> <p>This code should do the trick, I believe:</p> <pre><code>&lt;?php $whitelist = array( 'home', 'page', ); if(in_array($_GET['page'], $whitelist)) { include($_GET['page'] . '.php'); } else { include('home.php'); } ?&gt; ...
5,987
<p><img src="https://i.stack.imgur.com/DibJS.jpg" alt="Visual Studio folder structure"></p> <p>I need some advice as to how I easily can separate test runs for unit tests and integration test in Visual Studio. Often, or always, I structure the solution as presented in the above picture: separate projects for unit test...
<p>I actually found kind of a solution for this on my own by using keyboard command bound to a macro. The macro was recorded from the menu Tools>Macros>Record TemporaryMacro. While recording I selected my [Tests] folder and ran ReSharpers UnitTest.ContextRun. This resulted in the following macro, </p> <pre><code>Sub T...
<p>This is a bit of fiddly solution, but you could configure some <a href="http://blogs.msdn.com/saraford/archive/2008/04/24/did-you-know-you-can-run-external-tools-within-visual-studio-201.aspx" rel="nofollow noreferrer">external tools</a> for each of group of tests you want to run. I'm not sure if you'll be able to l...
3,484
<p>I am building a java server that needs to scale. One of the servlets will be serving images stored in Amazon S3.</p> <p>Recently under load, I ran out of memory in my VM and it was after I added the code to serve the images so I'm pretty sure that streaming larger servlet responses is causing my troubles.</p> <p>M...
<p>When possible, you should not store the entire contents of a file to be served in memory. Instead, aquire an InputStream for the data, and copy the data to the Servlet OutputStream in pieces. For example:</p> <pre><code>ServletOutputStream out = response.getOutputStream(); InputStream in = [ code to get source in...
<p>You have to check two things:</p> <ul> <li>Are you closing the stream? Very important</li> <li>Maybe you're giving stream connections "for free". The stream is not large, but many many streams at the same time can steal all your memory. Create a pool so that you cannot have a certain number of streams running at th...
7,952
<p>Would like to programmically change the connecton string for a database which utilizes the membership provider of asp.net within a windows application. The system.configuration namespace allows changes to the user settings, however, we would like to adjust a application setting? Does one need to write a class with u...
<p>You can programatically open the configuration with using the System.configuration namespace: </p> <p><code>Configuration myConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);</code></p> <p>Then you can access the connection strings collection at:</p> <p><code>myConfig.ConnectionStrin...
<p>Use the ConnectionStringsSection class. The documentation even provides an example on how to create a new ConnectionString and have the framework save it to the config file without having to implement the whole XML shebang.</p> <p>See <a href="http://msdn.microsoft.com/en-us/library/system.configuration.connections...
8,898
<p>I'm working on a gadget a bit like a jewelry box. I want the lid on a hinge. Are 3d printed hinges robust enough for daily use long term? Perhaps with a metal pin?</p> <p>I want to incorporate the hinge into the design but my thinking is that it would be a waste of time if the hinge will break as I'd need to reprint...
<p>You can make a print-in-place hinge as a horizontal cone with a 45-degree angle. The opposing face will be a similar conical hole with a 0.25 mm gap between the faces (or whatever your printer's tolerance needs to be).</p> <p>The strength of this (as in the other answers) depends on the diameter of the hinge. The ...
<p>Maker's Muse has <a href="https://www.youtube.com/watch?v=7JhjhgjchfM" rel="nofollow noreferrer">a video</a> on how to design hinged objects for printing. It's quite old and might be outdated with regard to materials, slicer functionality, etc. but I think it provides a good background on the topic and a source of i...
2,119
<p>I'm using a Prusa i3 MK3S printer. After ~8 months of printing PLA, PET-G, ABS I decided to buy some HIPS and print something with it. I cannot print >1 filaments at once, so I'm not using it as a support for ABS, <strong>I want to create some high durability working models, like gears, robot parts etc.</strong> </p...
<p>It might. If HIPS is a single material with consistent properties, it might have a narrower temperature range. Online references suggest up to 240&nbsp;&deg;C. Try that, then 245 and 250&nbsp;&deg;C. Maybe higher. </p>
<p>I've been using HIPS for nearly 2 years now to print the housings of EDF units for RC planes. They come out light and strong but have poor layer adhesion, especially on thin-wall parts.</p> <p>Normally I print at with a 260 °C nozzle and 100 °C bed but will try higher temperature when I upgrade my Ender 5 to a 32-bi...
1,543
<p>So I came across an interesting problem today. We have a WCF web service that returns an IList. Not really a big deal until I wanted to sort it.</p> <p>Turns out the IList interface doesn't have a sort method built in. </p> <p>I ended up using the <code>ArrayList.Adapter(list).Sort(new MyComparer())</code> method ...
<p>How about using LINQ To Objects to sort for you?</p> <p>Say you have a <code>IList&lt;Car&gt;</code>, and the car had an <code>Engine</code> property, I believe you could sort as follows:</p> <pre><code>from c in list orderby c.Engine select c; </code></pre> <p><em>Edit: You do need to be quick to get answers in ...
<p>Convert your <code>IList</code> into <code>List&lt;T&gt;</code> or some other generic collection and then you can easily query/sort it using <code>System.Linq</code> namespace (it will supply bunch of extension methods)</p>
3,630
<p>When is it appropriate to use an unsigned variable over a signed one? What about in a <code>for</code> loop?</p> <p>I hear a lot of opinions about this and I wanted to see if there was anything resembling a consensus. </p> <pre><code>for (unsigned int i = 0; i &lt; someThing.length(); i++) { SomeThing var = ...
<p>I was glad to find <a href="https://web.archive.org/web/20170323034837/http://coding.derkeiler.com/Archive/C_CPP/comp.lang.c/2004-02/1382.html" rel="noreferrer">a good conversation</a> on this subject, as I hadn't really given it much thought before.</p> <p>In summary, signed is a good general choice - even when you...
<p>In your example above, when 'i' will always be positive and a higher range would be beneficial, unsigned would be useful. Like if you're using 'declare' statements, such as: </p> <pre><code>#declare BIT1 (unsigned int 1) #declare BIT32 (unsigned int reallybignumber) </code></pre> <p>Especially when these values wi...
2,283
<p>When creating a database structure, what are good guidelines to follow or good ways to determine how far a database should be normalized? Should you create an un-normalized database and split it apart as the project progresses? Should you create it fully normalized and combine tables as needed for performance?</p>
<p>You want to start designing a normalized database up to 3rd normal form. As you develop the business logic layer you may decide you have to denormalize a bit but <em>never, never</em> go below the 3rd form. Always, keep 1st and 2nd form compliant. You want to denormalize for simplicity of code, not for performance. ...
<p>Often if you normalize as far as your other software will let you, you'll be done.</p> <p>For example, when using Object-Relational mapping technology, you'll have a rich set of semantics for various many-to-one and many-to-many relationships. Under the hood that'll provide join tables with effectively 2 primary ...
6,999
<p>I would like to extract a reduced collection of "meaningful" tags (10 max) out of an english text of any size. </p> <p><a href="http://tagcrowd.com/" rel="noreferrer">http://tagcrowd.com/</a> is quite interesting but the algorithm seems very basic (just word counting)</p> <p>Is there any other existing algorithm t...
<p>There are existing web services for this. <s>Two</s> Three examples:</p> <ul> <li><a href="http://developer.yahoo.com/search/content/V1/termExtraction.html" rel="nofollow noreferrer">Yahoo's Term Extraction API</a></li> <li>Topicalizer</li> <li><a href="http://www.opencalais.com/" rel="nofollow noreferrer">OpenCala...
<p>Perhaps "Term Frequency - Inverse Document Frequency" <a href="http://en.wikipedia.org/wiki/Tf-idf" rel="nofollow noreferrer">TF-IDF</a> would be useful...</p>
9,328
<p>I am modelling a few cut templates to be used on an hexagonal grid (honeycomb) material using OpenSCAD. Basically, from a reference cell, I need to select all cells that are within a given range and given angle.</p> <p>I implemented this by creating an in memory grid that covers an area larger than what I need (ex...
<p>I ended up finding a reasonable solution myself:</p> <p><a href="https://i.stack.imgur.com/mp3ET.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mp3ET.png" alt="enter image description here"></a></p> <p>Basically, I diffed two identical, non-hollow geometries, in which the first one had the cell...
<p>Unfortunately, OpenSCAD does not have a 2D hull() transformation, although it has been requested. You might be able to find a pre-written package that implements a 2D hull. However, if all you want is a hexagonal grid with a border of some arbitrary shape, could you not cheat, and get your slicer to generate the gri...
752
<p>I want to parse some HTML in order to find the values of some attributes/tags etc.</p> <p>What HTML parsers do you recommend? Any pros and cons?</p>
<p><a href="http://sourceforge.net/projects/nekohtml/" rel="nofollow noreferrer">NekoHTML</a>, <a href="http://home.ccil.org/~cowan/XML/tagsoup/" rel="nofollow noreferrer">TagSoup</a>, and <a href="http://sourceforge.net/projects/jtidy/" rel="nofollow noreferrer">JTidy</a> will allow you to parse HTML and then process ...
<p>Do you need to do a full parse of the HTML? If you're just looking for specific values within the contents (a specific tag/param), then a simple regular expression might be enough, and could very well be faster.</p>
4,618
<p>Why does C#.Net allow the declaration of the string object to be case-insensitive?</p> <pre><code>String sHello = "Hello"; string sHello = "Hello"; </code></pre> <p>Both the lower-case and upper-case S of the word String are acceptable and this seems to be the only object that allows this.</p> <p>Can anyone expla...
<p><strong><code>string</code></strong> is a language keyword while <code>System.String</code> is the type it aliases.</p> <p>Both compile to exactly the same thing, similarly:</p> <ul> <li><strong><code>int</code></strong> is <code>System.Int32</code></li> <li><strong><code>long</code></strong> is <code>System.Int64...
<p>string is an alias for System.String. They are the same thing.</p> <p>By convention, though, objects of type (System.String) are generally refered to as the alias - e.g.</p> <pre><code>string myString = "Hello"; </code></pre> <p>whereas operations on the class use the uppercase version e.g.</p> <pre><code>Strin...
3,111
<p>When spliting a solution in to logical layers, when is it best to use a separate project over just grouping by a folder?</p>
<p>By default, <strong>always just create new folder</strong> within the same project</p> <ul> <li>You will get single assembly (without additional ILMerge gymnastic)</li> <li>Easier to obfuscate (because you will have less public types and methods, ideally none at all)</li> </ul> <p>Separating your source code into ...
<blockquote> <p>Separating your source code into multiple projects makes only sense if you... ... More developers involved and you want to treat their work as consumable black box. (not very recommended) ...</p> </blockquote> <p>Why isn't this recommended? I've found it a very useful way to manage an ...
2,396
<p>I am looking for open source or free data collaboration software. Specifically this is for a non-profit organization that wants to teach remote students how a foreign language. The idea is that an instructor would teach a class and there would be up to 10 students in the class at a time. The instructor would be ab...
<p>I know a few of the developers on the Carleton University developed <a href="http://code.google.com/p/blindside/" rel="nofollow noreferrer">Blindside Project</a>. They are actively developing an open-source web conferencing and presentation tool for e-learning, with the intent of eventually offering university cour...
<p>Although it's not what you're looking for, <a href="http://moodle.org/" rel="nofollow noreferrer">Moodle</a> might be of use to you if you're looking into having online courses. </p>
4,355
<p>I just want to ask if anyone has successfully printed a screw (M3 or M4). Is the printed output usable as a screw? What printer is capable of printing screws? I am using an M3D printer - is there a configuration to successfully print a screw that is usable?</p> <p>Can anyone share a picture of the best 3D printed s...
<p>well... it's hard to imagine printing M3 or even M4 I haven't try but I haven't because I'm pretty sure it's not possible (on my printer of course)</p> <p>but some time ago I've tried M8 which is of course way from your needs it was printed on 0.1mm layer height</p> <p>it went ok into the nut without any problems ...
<p>Not very likely unfortunately.</p> <p>M3D nozzle diameter is too wide to be able to print something that would print reliably, not to mention any FDM machine won't have the precision to build good threads. even 0.05mm layer heights won't run very well. </p> <p>I've tried on a Form1 (SLA style printer) and even tha...
445
<p>Tag <a href="https://3dprinting.stackexchange.com/questions/tagged/nylon" class="post-tag" title="show questions tagged &#39;nylon&#39;" rel="tag">nylon</a> exists already, but I think it would be incredibly useful to have a TPE/TPU tag and a tag for all flexibles as a category.</p> <p><strong>EDIT:</strong> It has...
<p>Let's stay with the classic $.</p> <p>Example: \$\$\frac{1 \times 2}{2} = 1\$\$</p> <hr> <p><em>Now that MathJax is enabled, it renders to: $$\frac{1 \times 2}{2} = 1$$</em></p>
<p>An alternative character could be the Tilde <code>~</code>.</p>
60
<p>I need to simply go through all the cells in a Excel Spreadsheet and check the values in the cells. The cells may contain text, numbers or be blank. I am not very familiar / comfortable working with the concept of 'Range'. Therefore, any sample codes would be greatly appreciated. (I did try to google it, but the...
<p>If you only need to look at the cells that are in use you can use:</p> <pre><code>sub IterateCells() For Each Cell in ActiveSheet.UsedRange.Cells 'do some stuff Next End Sub </code></pre> <p>that will hit everything in the range from A1 to the last cell with data (the bottom right-most cell)</p>
<p>In Excel VBA, this function will give you the content of any cell in any worksheet.</p> <pre><code>Function getCellContent(Byref ws As Worksheet, ByVal rowindex As Integer, ByVal colindex As Integer) as String getCellContent = CStr(ws.Cells(rowindex, colindex)) End Function </code></pre> <p>So if you want to c...
9,949
<p>Let's assume we've got the following Java code:</p> <pre><code>public class Maintainer { private Map&lt;Enum, List&lt;Listener&gt;&gt; map; public Maintainer() { this.map = new java.util.ConcurrentHashMap&lt;Enum, List&lt;Listener&gt;&gt;(); } public void addListener( Listener listener, Enum eve...
<p>What would be wrong with doing something like the following:</p> <p>Defining a 'Maintainer' interface with the addListener(Listener, Enum) method.</p> <p>Create a DefaultMaintainer class (as above) which implements Maintainer.</p> <p>Then, in each Listener class, 'inject' the Maintainer interface (constructor inj...
<blockquote> <p>You said "... you can't have java.lang.Enum as" annotation param ..."</p> </blockquote> <p>I think you are wrong on that. I have recently used on a project something like this :</p> <pre><code>public @interface MyAnnotation { MyEnum value(); } </code></pre>
9,696
<p>I need to enumerate though generic IList&lt;> of objects. The contents of the list may change, as in being added or removed by other threads, and this will kill my enumeration with a "Collection was modified; enumeration operation may not execute."</p> <p>What is a good way of doing threadsafe foreach on a IList&lt...
<p>Cloning the list is the easiest and best way, because it ensures your list won't change out from under you. If the list is simply too large to clone, consider putting a lock around it that must be taken before reading/writing to it.</p>
<p>Wrap the list in a locking object for reading and writing. You can even iterate with multiple readers at once if you have a suitable lock, that allows multiple concurrent readers but also a single writer (when there are no readers). </p>
9,211
<p>I'm looking for any tools that can give you code churn metrics (graphs and charts would be even better) for a Subversion repository.</p> <p>One tool I know of is <a href="http://www.statsvn.org/" rel="noreferrer">statsvn</a> - a Java tool that creates some HTML reports and some code churn metrics. Statsvn reports ...
<p>If you are willing to go the commercial route check out <a href="http://www.atlassian.com/software/fisheye/" rel="noreferrer">FishEye</a> from Atlassian (also see their <a href="http://www.cenqua.com/fisheye/demo" rel="noreferrer">demo site</a> ). FishEye also supports adding <a href="http://confluence.atlassian.co...
<p>try <a href="http://programeter.edicypages.com/" rel="nofollow noreferrer">programeter</a> which analyses Subversion and many other dev. tools. </p>
7,794
<p>In Windows XP:</p> <p>How do you direct traffic to/from a particular site to a specific NIC?</p> <p>For Instance: How do I say, all connections to stackoverflow.com should use my wireless connection, while all other sites will use my ethernet?</p>
<p>I'm not sure if there's an easier way, but one way would be to add a route to the IP(s) of stackoverflow.com that explicitly specifies your wireless connection, using a lower metric (cost) than your default route.</p> <p>Running nslookup www.stackoverflow.com shows only one IP: 67.199.15.132, so the syntax would be...
<p>you should be able to do it using the route command. Route add (ip address) (netmask) (gateway) metric 1</p>
9,923
<p>As you can see the left side of the edge came out jagged. The right side came out just fine. What happened to the left side?</p> <p>I am using Ender 3 + BLTouch using Sunlu PLA+ with 200 °C hotend.</p> <p><a href="https://i.imgur.com/Ki7ZzQ4.jpg" rel="nofollow noreferrer" title="Left side"><img src="https://i.imgur....
<p>This may be due to uneven cooling. The part cooling fan only comes from one direction on the Ender 3 series of printers. You may be able to solve the issue by printing the walls from the outside in. If not, I recommend printing a fan shroud that has part cooling ducts on both sides; there are plenty of them on thing...
<p>This may be due to uneven cooling. The part cooling fan only comes from one direction on the Ender 3 series of printers. You may be able to solve the issue by printing the walls from the outside in. If not, I recommend printing a fan shroud that has part cooling ducts on both sides; there are plenty of them on thing...
1,980
<p>When trying to implement an asynchronous API calls / Non-blocking calls, I know a little in a All Plain-C application I have, I read a about APM (Asynchronous Programming Model) by 'Delegates'. Basically what I want to do is call one API <code>f1()</code> to do a functionality(which takes long time 8-10 seconds), So...
<p>You basically need to create a multi-threaded (or multi-process) application. The f1() API needs to spawn a thread (or process) to process the data in a separate execution space. When it completes, the f1() routine needs to signal the main process that the execution is done (signal(), message queues, etc).</p>
<p>Replace delegates with pointers to functions in C, everything else is basically same to what you have read.</p>
8,770
<p>I want to ask how other programmers are producing Dynamic SQL strings for execution as the CommandText of a SQLCommand object.</p> <p>I am producing parameterized queries containing user-generated WHERE clauses and SELECT fields. Sometimes the queries are complex and I need a lot of control over how the different p...
<p>I had the need to do this on one of my recent projects. Here is the scheme that I am using for generating the SQL: </p> <ul> <li>Each component of the query is represented by an Object (which in my case is a Linq-to-Sql entity that maps to a table in the DB). So I have the following classes: Query, SelectColumn, Jo...
<p>Out of curiousity, have you considered using an ORM for managing your data access. A lot of the functionality you're trying to implement could already be there. It may be something to look at because its best not to re-invent the wheel.</p>
7,503
<p>When we create stored procedures in Visual Studio (with the extension .sql) the file encoding is automatically set to 'Unicode (UTF-8 with signature) - Codepage 65001'.</p> <p>This causes ours DBA's problems as their scripts don't like it.</p> <p>We have to manually go in and change them to 'Western European (wind...
<p>I think somebody faced a similar problem like yours and had the following workaround which is posted at</p> <p><a href="http://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=319830" rel="nofollow noreferrer">http://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=319830...
<p>To summarise the link provided by Codeslayer (in case the page url changes)...</p> <p><em>Change the sql file templates to ANSI encoding by opening with notepad and then saving it as an ANSI file. You can do the same for files already created. \Common7\Tools\Templates\Database Project Items</em></p> <p>You've just...
6,731
<p>Could someone tell me what the units the <code>SetTimeout(int)</code> method in the <code>ICriteria</code> interface uses?<br> Is it milliseconds, seconds, minutes or other?</p>
<p>A little bit of poking around suggests that it could be seconds:</p> <p>Assuming that ICriteria is the same as the Criteria interface in Hibernate core, then the JavaDoc for <a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Criteria.html#setTimeout(int)" rel="noreferrer">org.hibernate.Criteria</a> pro...
<p>I think it's seconds. The NHibernate API closely mirrors Hibernate Core for Java, where the <a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Criteria.html#setTimeout(int)" rel="nofollow noreferrer">Criteria.setTimeout(int)</a> method uses seconds as the units (see also <a href="http://java.sun.com/j2...
5,409
<p>How do I avoid read locks in my database?</p> <p>Answers for multiple databases welcome!</p>
<p>In Oracle the default mode of operation is the <em>Read committed</em> isolation level where a select statement is not blocked by another transaction modifying the data it's reading. From <a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96524/c21cnsis.htm" rel="nofollow noreferrer">Data Concurrency ...
<p>In SQL Server you can use the with(nolock) keyword in your select statements. For example:</p> <pre><code>Select table1.columna, table2.columna from table1 with(nolock), table2 with(nolock) </code></pre> <p>Make sure to specify with(nolock) for each table/view in the query.</p>
5,778
<p>Multiple approaches exist to write your unit tests when using Rhino Mocks:</p> <ul> <li>The Standard Syntax</li> <li>Record/Replay Syntax</li> <li>The Fluent Syntax</li> </ul> <p>What is the ideal and most frictionless way?</p>
<p>For .NET 2.0, I recommend the record/playback model. We like this because it separates clearly your expectations from your verifications.</p> <pre><code>using(mocks.Record()) { Expect.Call(foo.Bar()); } using(mocks.Playback()) { MakeItAllHappen(); } </code></pre> <p>If you're using .NET 3.5 and C# 3, then ...
<p>Interesting question! My own preference is the for the reflection-based syntax (what I guess you mean by the Standard Syntax). I would argue that this is the most frictionless, as it does not add much extra code: you reference the stubs directly on your interfaces as though they were properly implemented. </p> <...
7,831
<p>I'm writing a C# application which downloads a compressed database backup via FTP. The application then needs to extract the backup and restore it to the default database location.</p> <p>I will not know which version of SQL Server will be installed on the machine where the application runs. Therefore, I need to f...
<p>What I discovered is that </p> <pre><code>Microsoft.SqlServer.Management.Smo.Server(ServerName).Settings.DefaultFile </code></pre> <p>only returns non-null when there is no path explicitly defined. As soon as you specify a path which is not the default, then this function returns that path correctly.</p> <p>So, ...
<p>One option, that may be a simpler solution, is to create a new database on your destination server and then RESTORE over that database with your backup. Your backup will be in the right place and you will not have to fuss with "MOVING" the backup file when you restore it. SQL expects backups to be restored to exac...
8,854
<p>What is Dynamic Code Analysis?</p> <p>How is it different from <a href="https://stackoverflow.com/questions/49716/what-is-static-code-analysis">Static Code Analysis</a> (ie, what can it catch that can't be caught in static)?</p> <p>I've heard of bounds checking and memory analysis - what are these?</p> <p>What ot...
<p>Simply put, static analysis collect information based on <strong>source code</strong> and dynamic analysis is based on the <strong>system execution</strong>, often using instrumentation.</p> <h2>Advantages of dynamic analysis</h2> <ul> <li>Is able to detect dependencies that are not possible to detect in static anal...
<blockquote> <p>Bounds checking</p> </blockquote> <p>This means runtime checks of array accesses. Contrary to C's laissez-faire approach to memory accesses and pointer arithmetic, other languages like Java or C# actually check whether or not a given array has the element one is trying to access.</p>
7,256
<p>I have recently installed .net 3.5 SP1. When I deployed a compiled web site that contained a form with its action set:</p> <pre><code>&lt;form id="theForm" runat="server" action="post.aspx"&gt; </code></pre> <p>I received this error.<br> Method not found: 'Void System.Web.UI.HtmlControls.HtmlForm.set_Action(Syste...
<p><a href="http://johnsheehan.me/blog/less-code-is-fun-aspnet-35-sp1-removes-need-for-control-adapter-when-using-url-rewriting/" rel="nofollow noreferrer">.NET 3.5 SP1 tries to use the action="" attribute</a> (.NET 3.5 RTM did not). So, when you deploy, your code is attempting to set the HtmlForm.Action property and f...
<p>I just ran into the same problem. From what I understood it is indeed caused by the fact the my PC has .NET 3.5 SP1 on it, and the server to which I deployed the project doesn't.<br> From what I understand, one solution is that the server be updated with .NET 3.5 SP1. As I don't want to do that yet, I just removed t...
5,513
<p>I've been trying a lot of different things to combat corners curling upward in the first few tens of layers after the bottom skin. To be clear, I'm not talking about corners of the first layer printed on the bed, but rather the points of the outline in layers above the base where direction of print motion changes di...
<p>While I tried a lot of things to solve this, including tuning temperature, fan, speed, etc., ultimately the single biggest factor that causes or prevents it is the state of Cura's <em>Outer Before Inner Walls</em> (<code>outer_inset_first</code>) option. With outer walls first, I don't have the problem at all. With ...
<p>Cura has an additional setting that you can make visible called "Lift Head". My recommendation is that you do the following:</p> <ol> <li>Set your minimum print speed to something actually reasonable like 30mm/s or higher. Printing too slowly negates the following two settings and is not beneficial to printing smal...
1,408