instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>is there anyway to have an image act as an ajax actionlink? I can only get it to work using text. Thanks for your help!</p>
<p>From Stephen Walthe, from his <a href="http://www.asp.net/mvc/tutorials/older-versions/contact-manager/iteration-1-create-the-application-cs" rel="noreferrer">Contact manger project</a> </p> <pre><code> public static class ImageActionLinkHelper { public static string ImageActionLink(this AjaxHelper helper, str...
<pre><code>actionName+"/"+routeValues Proje/ControlName/ActionName/Id using System.Web; using System.Web.Mvc; using System.Web.Mvc.Ajax; namespace MithatCanMvc.AjaxHelpers { public static class ImageActionLinkHelper { public static IHtmlString ImageActionLink(this AjaxHelper helper...
44,410
<p>I need to move backwards through an array, so I have code like this:</p> <pre><code>for (int i = myArray.Length - 1; i &gt;= 0; i--) { // Do something myArray[i] = 42; } </code></pre> <p>Is there a better way of doing this?</p> <p>Update: I was hoping that maybe C# had some built-in mechanism for this like:<...
<p>While admittedly a bit obscure, I would say that the most typographically pleasing way of doing this is</p> <pre><code>for (int i = myArray.Length; i --&gt; 0; ) { //do something } </code></pre>
<p>NOTE: This post ended up being far more detailed and therefore off topic, I apologize.</p> <p>That being said my peers read it and believe it is valuable 'somewhere'. This thread is not the place. I would appreciate your feedback on where this should go (I am new to the site).</p> <hr> <p>Anyway this is the C# v...
34,793
<p>i remember there being a way of marking a section of code in eclipse (special comment or annotation?) which made the autoformatter ignore that section. Or I may have drempt this...</p> <p>Used mainly when I have strings which wrap onto several lines and i don't want the autoformatter to rearrange this.</p>
<p>Since eclipse 3.5 (or 3.6) this is possible: - Go to project properties -- Java Code Style -- Formatter -- Edit... - choose the tab marked "Off/On Tags", - include the tags in comments in your source code, like</p> <pre><code>/* @formatter:on */ </code></pre>
<p>You can mark the code you want to format and selct format with right mouse click in this section. This is a "whitlist" solution, perhaps it helps...</p>
45,918
<p>When developing an application wich will be used inside an intranet do you think Silverlight and WCF is a good solution ?</p> <p>Whould you use WCF Services or WCF Web Services to expose your model to the client ?<br> <br>When consuming a WCF Service the proxies will be generated under a reference and you can only...
<p>Not yet. I had a difficult time getting WCF configured, and Silverlight 2 beta was not well documented. </p>
<p>Your questions is way too broad. It's really hard to answer these kinds of questions, since, really, "any" technology is good for "any" solution. Otherwise everybody would just use one! </p> <p>What's your application supposed to do, how soon you need to get it done, is there any existing investment in the same or...
36,526
<p>I have a program that, for the most part, operates in the background. Let's say it DoesWork(). Once a week, I want it to notify the user on some of the work it has completed over the past few days. It will be a basic status report, listing some files that have been downloaded.</p> <p>Initially, I wanted to sent ...
<p>An alternative is to have the program generate an RSS feed and direct the user how to subscribe to it. Also, once a new update is generated, show the update toast for about a minute, then hide it automatically and change your systray icon to something different. In about a day change it back to the original icon. Al...
<p>Does it need to be a weekly digest? Instead, how about using <a href="http://growl.info/" rel="nofollow noreferrer">Growl</a> (or equivalent) to notify the user of the tasks being completed in real-time, in the background?</p>
31,409
<p>Given say 11/13/2008 - 12/11/2008 as the value posted back in TextBox, what would be the best way to parse out the start and end date using C#?</p> <p>I know I could use:</p> <pre><code>DateTime startDate = Convert.ToDateTime(TextBoxDateRange.Text.Substring(0, 10)); DateTime endDate = Convert.ToDateTime(TextBoxDat...
<pre><code>var dates = TextBoxDateRange.Text.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries); var startDate = DateTime.Parse(dates[0], CultureInfo.CurrentCulture); var endDate = DateTime.Parse(dates[1], CultureInfo.CurrentCulture); </code></pre>
<p>Instead of Convert.ToDateTime, it could be worth to use DateTime.Parse and explicitely put in the Culture you desire. If I try that example with any European Culture, i get an Error because 11/13/2008 points to the 11th Day in the 13th Month of 2008...</p> <pre><code> CultureInfo ci = new CultureInfo("en-us"...
40,147
<p>I have an NHibernate Dao..lets call it MyClassDao for want of a better name.</p> <p>I am writing the following code.</p> <pre><code>MyClassDao myDao = new MyClassDao(); var values = myDao.GetByCriteria(Restrictions.Eq("Status", someStatusValue)); </code></pre> <p>I am using this in a Unit Test to pull back value...
<p>Use ICriteria.SetMaxResults()</p>
<p>I have something like this in my repository to help with the unbound result sets</p> <pre><code>public IQueryable&lt;T&gt; SelectWithLimit&lt;T&gt;(int maxResults) where T : class { ICriteria criteria = SessionWrapper.Session.CreateCriteria(typeof (T)).SetMaxResults(maxResults); return criteria....
49,900
<p>If you use Image.Save Method to save an image to a EMF/WMF, you get an exception (<a href="http://msdn.microsoft.com/en-us/library/ktx83wah.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ktx83wah.aspx</a>)</p> <p>Is there another way to save the image to an EMF/WMF? Are there any encoders a...
<p><code>Image</code> is an abstract class: what you want to do depends on whether you are dealing with a <code>Metafile</code> or a <code>Bitmap</code>.</p> <p>Creating an image with GDI+ and saving it as an EMF is simple with <code>Metafile</code>. Per Mike's <a href="https://stackoverflow.com/questions/152729/gdi-c...
<p>It appears there is much confusion over vector vs. bitmap. All of the code in this thread generates bitmap (non-vector) files - it does not preserve the vector GDI calls. To prove this to yourself, download the "EMF Parser" tool and inspect the output files: <a href="http://downloads.zdnet.com/abstract.aspx?docid=74...
18,428
<p>Is it possible Firebug may be incorrectly adding downloads to the Net tab when things may be loaded from the cache?</p> <p>I have some code in a Javascript gallery which is meant to lazily download an image when the thumbnail is clicked and then display it once downloaded. It is meant to determine if it's been down...
<p>The image appearing in the net tab in firebug does not mean it is downloaded from the server. Check the HTTP response code that firebug reports for the image - for me after one visit, it kept returning "304 - Not Modified" which means it is being loaded from the cache.</p> <p>You can avoid the extra HTTP request th...
<p>I checked your site and using CacheViewer confirmed that it is indeed caching it and fetching it from disk, with an expiration one month from today. If you want you could also use plsicing by combining all the images into one large image and only show the area of interest, although I typically use splicing for small...
45,807
<p>I've be working with a Java application run through the command-line. It deals with XML files, specially the dblp.xml database which has more than 400MB. </p> <p>I was using JVM 5 and my app needed sort of 600-700MB of memory to processe the dblp.xml. After updating to JVM 6, it starting needing more than 1gb of me...
<p>My advice would be to use a tool like <a href="http://www.ej-technologies.com/products/jprofiler/overview.html" rel="nofollow noreferrer">JProfiler</a> to try to get a handle on exactly where your memory consumption increased. If you can't spend on JProfiler, check out this list of <a href="http://java-source.net/o...
<p>sounds like the newer JVM is trading memory space for speed (ie, caching or what not)?</p>
41,309
<p>I am trying to hide some divs before the user prints this giant form, then display the divs again afterward. Thus I want to ignore the rest of the page, and only print the form itself.</p> <p>Sure I <em>could</em> open a separate page when the user clicks the print button. The only thing is that the form is really ...
<h2>First, The Ok Way:</h2> <p>Take a look at window.onbeforeprint and window.onafterprint (the original question asked about how to do it programmatically I believe). </p> <h2>Now, the Better Way:</h2> <p>A better way to do this is with a style that is specifically for printing. In other words, your div might loo...
<p>You may want to consider creating a style sheet specifically for printing using <a href="http://www.alistapart.com/stories/goingtoprint/" rel="nofollow noreferrer">media="print"</a></p>
27,683
<p>Let's say I have a table that represents a super class, <strong>students</strong>. And then I have N tables that represent subclasses of that object (<strong>athletes</strong>, <strong>musicians</strong>, etc). How can I express a constraint such that a student must be modeled in one (not more, not less) subclass?</...
<p>Here are a couple of possibilities. One is a <code>CHECK</code> in each table that the <code>student_id</code> does not appear in any of the other sister subtype tables. This is probably expensive and every time you need a new subtype, you need to modify the constraint in all the existing tables.</p> <pre><code>C...
<p>interesting problem. Of course the FK constraints are there for the subtables so there has to be a student for those. </p> <p>The main problem is trying to check as it is inserted. The student has to be inserted first so that you don't violate a FK constraint in a subtable so a trigger that does a check wouldn't...
43,093
<p>The scenario</p> <ul> <li>You have developed a webapp using EJBs version 3.</li> <li>The system is deployed, delivered and is used by the customer.</li> </ul> <p>If you would have to rewrite the system from scratch, would you use EJBs again?</p> <p><strong>Yes</strong>: Don't answer this question, answer <a href=...
<p>The project did not have any of the problems that EJBs are supposed to solve. Using EJBs just made it harder to code, to debug, to build, to deploy and to document and understand.</p>
<p>Having to do relationship-child management yourself: Hibernate's all-delete-orphan didn't make it into the 3.0 spec.</p>
19,500
<p>I have been a .net developer for the past three yrs. Just curious to know about the network security field. What kind of work does the developers working in these area do? I really have not much idea about network security but what my understanding is these people are involved in securing network, preventing attacks...
<p>Basic questions include:</p> <ul> <li><a href="https://stackoverflow.com/questions/479142/when-to-use-an-interface-instead-of-an-abstract-class-and-vice-versa">Whats the difference between an abstract class and interface? When would you want to use them?</a></li> <li><a href="https://stackoverflow.com/questions/448...
<p>I would prefer giving him a problem and asking him to solve it using the features of .net you know and why do you think it is best solution.</p> <p>This will crack almost all the capabilities of a candidate in terms of technical, analytical and problem solving skills along with his approach for solving a problem.</...
47,720
<p>Has anyone else had any problems using google's Domain Tracking API, I am specifically talking about the _link() method.</p> <p><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApiDomainDirectory.html#_gat.GA_Tracker_._link" rel="nofollow noreferrer">The documentation is here</a></p> <p>The example pro...
<p>You should ensure that you are using the correct version of <code>svnadmin</code> for your repository version. It's possible to get errors like this by using the wrong version.</p> <p>Having said that, version 1.3.x is pretty old now and you should consider upgrading to the latest 1.5.x.</p> <p>I also found throug...
<p>You should ensure that you are using the correct version of <code>svnadmin</code> for your repository version. It's possible to get errors like this by using the wrong version.</p> <p>Having said that, version 1.3.x is pretty old now and you should consider upgrading to the latest 1.5.x.</p> <p>I also found throug...
30,428
<p>I have a list of images that i’ve loaded with the Loader class, but I’m having a tough time assigning them unique names. I need unique names because I want to remove certain images after a while. Is there a way to assign loaders a name or some unique tag so i can remove them later? thanks.</p> <p>Here's part of my ...
<p>All display objects in ActionScript 3 have a name property. Whenever you create a Loader object you can assign a name to it like so:</p> <pre><code>var myLoader:Loader = new Loader(); myLoader.name = "myUniqueName"; myLoader.load( .... ); addChild( myLoader ); </code></pre> <p>If you'd like to refer to the loader ...
<p>Not sure I 100% understand your problem, but why not put them in an object map rather than a list and generate unique names for them if you don't have them...</p> <pre><code>var img:Image; var img_map:Object = new Object(); var last_added:int = 0; for each (img in yourListOfImages) { img_map["img_"+last_added] ...
40,570
<p>What I want to do is patch an existing Python module that uses urllib2 to run on App Engine, but I don't want to break it so it can be used elsewhere. So I'm looking for a quick solution to test if the module is imported in the App Engine environment or not. Catching ImportError on urllib2 might not be the best solu...
<p>You could simply use sys.modules to test if a module has been imported (I'm using unicodedata as an example):</p> <pre><code>&gt;&gt;&gt; import sys &gt;&gt;&gt; 'unicodedata' in sys.modules False &gt;&gt;&gt; import unicodedata &gt;&gt;&gt; 'unicodedata' in sys.modules True </code></pre>
<p>You could do a simple check against key environment variables. No telling exactly how reliable this might be, though.</p> <pre><code>import os, logging try: os.environ['APPENGINE_RUNTIME'] except KeyError: logging.warn('We are not in App Engine environment') else: logging.info('We are in the App Engine enviro...
43,499
<p>The requirements for my document management system were:</p> <ol> <li>Must be secure from theft by simple copying of directories, files etc.</li> <li>Must be secure against traditional virus infection (infection of physical file)</li> <li>Must be fast to retrieve</li> <li>The repository must not be visible to casua...
<p>When your DB grows bigger and bigger it will become harder to backup. Restoring a backup of a table with over 100 GB of data is not something that makes you happy.</p> <p>Another thing that get is that all the table management functions get slower and slower as the dataset grows.<br> But this can be overcome by mak...
<p>Sorry - the answer I offered was based on SQL Server, so the maintenance portion is not appropriate. But file I/O is accomplished at the hardware level and any database adds extra processing steps.</p> <p>The database will impose extra overhead when retrieving the document. When the file is on disk you are only a...
26,046
<p>So I'm refactoring my code to implement more OOP. I set up a class to hold page attributes.</p> <pre><code>class PageAtrributes { private $db_connection; private $page_title; public function __construct($db_connection) { $this-&gt;db_connection = $db_connection; $this-&gt;page_title ...
<p>It means that <code>$objPage</code> is not an instance of an object. Can we see the code you used to initialize the variable?</p> <p>As you expect a specific object type, you can also make use of <a href="http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration" rel="noreferrer">PHPs t...
<p>I realized that I wasn't passing <strong>$objPage</strong> into <strong>page_properties()</strong>. It works fine now.</p>
7,817
<p>Like this: const void * test = sqlite3_column_blob(stat, 1); Can I delete or delete[] test?</p>
<p>From the <a href="http://www.sqlite.org/c3ref/column_blob.html" rel="noreferrer">sqllite documentation</a>:</p> <blockquote> <p>The pointers returned are valid until a type conversion occurs or until sqlite3_step() or sqlite3_reset() or sqlite3_finalize() is called. The memory space used to hold strings and BLOBs...
<p>Look at its API Manual. If it is a C API, you probably have to <code>free</code> it. If it doesn't provide its own function like sqlite3_free (pcre does this for example), you have to use that function.</p> <p>What you can't do is delete it using C++'s delete operator, since you have got a void pointer. You cannot ...
42,098
<p>Is it possible to serialize and deserialize a class in C++?</p> <p>I've been using Java for 3 years now, and serialization / deserialization is fairly trivial in that language. Does C++ have similar features? Are there native libraries that handle serialization?</p> <p>An example would be helpful.</p>
<p>The <a href="http://www.boost.org/doc/libs/1_36_0/libs/serialization/doc/index.html" rel="noreferrer"><code>Boost::serialization</code></a> library handles this rather elegantly. I've used it in several projects. There's an example program, showing how to use it, <a href="http://www.boost.org/doc/libs/1_36_0/libs/se...
<p>Here is a simple serializer library I knocked up. It's header only, c11 and has examples for serializing basic types. Here's one for a map to class.</p> <p><a href="https://github.com/goblinhack/simple-c-plus-plus-serializer" rel="nofollow noreferrer">https://github.com/goblinhack/simple-c-plus-plus-serializer</a><...
29,053
<p>Suppose you have:</p> <pre><code>A-B-C </code></pre> <p>Now your build/test fails. The fix should be merged in A. My current work-flow is like this:</p> <pre><code>$ git commit -m "fixA" A-B-C-fixA $ git rebase -i A~1 </code></pre> <p>And squash fixA in A, result in: </p> <pre><code>A'-B-C </code></pre> <p>...
<p><em>If you're just looking for the easy solution for fixing up earlier commits, read the question! It explains it all. But since Elmarco was asking for a slick way, here we go:</em></p> <p>As of Git 1.7.0, there is an <code>--autosquash</code> option for <a href="https://www.kernel.org/pub/software/scm/git/docs/git...
<p>I think the root of the problem is that git (and version control generally) forces you to think in terms of sequences of changes, but a changeset or feature-branch or whatever you call a cohesive group of related changes is in general not logically sequential. The order in which the code was written is incidental an...
25,023
<p>We are making an automated patching application and would like to post files on production server through asp.net page (or maybe a web service), since we can only access production server via http. The page should accept files and store them to appropriate location. The path to files will be declared in external XML...
<p>If unlocker comes with parameters -L and -U, I don't think L would be the one you want to unlock with. Probably U is for unlocking ;)</p> <p>If you have any control of the application that is locking the file, it would be a better solution to have that program free the file rather than a third party app rip it awa...
<p>Look at the documentation for the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx" rel="nofollow noreferrer">System.Diagnostics.Process</a> class and the related ProcessStartInfo class.</p>
42,459
<p>I want to create a script that parses or makes sense of apache's error log to see what the most recent error was. I was wondering if anyone out there has something that does this or has any ideas where to start?</p>
<p>There are a few things to consider first:</p> <ol> <li>Firstly, your PHP user may not have access to Apache's log files.</li> <li>Secondly, PHP and Apache aren't going to tell you where said log file is,</li> <li>Lastly, Apache log files can get quite large.</li> </ol> <p>However, if none of these apply, you can u...
<p>Have you tried biterScripting ? I am a system admin and I have been using to parse logs. It is univx style scripting. biterScripting.com -> Free download.</p>
19,281
<p>I am using a ResourceDictionary, but I would like to be able to look up the value or the key with the other item. Each is always unique, so that is not a problem. Is there a type that has this double sided lookup feature?</p>
<p>Not built in, but this is pretty easy to write. I would probably implement IDictionary for this though... You would then dump the ResourceDictionary into your custom type.</p> <pre><code>public class DoubleLookup&lt;TKey, TValue&gt; { private IDictionary&lt;TKey, TValue&gt; keys; private IDictionary&lt;TValue...
<p>Be very careful when reversing the key/value relationship in a dictionary.</p> <p>The contract of the dictionary guarantees that, for every value in the collection, there is exactly one key which maps to that value. The keys are unique. But the reverse is not true; for every distinct value, there can be many differ...
38,434
<p>I have a query on my database as such:</p> <pre><code>SELECT * FROM expenses WHERE user_id = ? AND dated_on = ? </code></pre> <p>I have added an index to the table on both the <code>user_id</code> and <code>dated_on</code> columns. When I inspect the indexes using <code>SHOW INDEXES FROM expenses</code>, there ar...
<p>MySQL can use <a href="http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html" rel="noreferrer">any left portion of an index</a>.</p> <p>In your example <code>SELECT * FROM expenses WHERE user_id = ?</code> will use the index but <code>SELECT * FROM expenses WHERE dated_on = ?</code> won't.</p> <p>For a 3-colum...
<p>If your index on user_id and dated_on is really in that order (user_id first), then it will be used for a user_id query also. You can check by using EXPLAIN to see the actual strategy for the query.</p>
32,735
<p>I have a 3 column grid in a window with a GridSplitter on the first column. I want to set the MaxWidth of the first column to a third of the parent Window or Page <code>Width</code> (or <code>ActualWidth</code>) and I would prefer to do this in XAML if possible.</p> <p>This is some sample XAML to play with in XamlP...
<p>I think the XAML-only approach is somewhat circuitous, but here is a way to do it.</p> <pre><code>&lt;Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" &gt; &lt;!-- This c...
<p>Too lazy to actually write it up myself, but you should be able to use a mathematical converter and bind to your parent windows width (either by name, or with a RelativeSource ancestor search). </p> <pre><code>//I know I borrowed this from someone, sorry I forgot to add a comment from whom public class ScaledValue...
10,800
<p>Is it okay to directly connect together the grounds of the logic supply and the motor supply when using a Pololu style stepper driver?</p> <p><a href="https://i.stack.imgur.com/yijCn.jpg" rel="nofollow noreferrer" title="A4988 connection schematic"><img src="https://i.stack.imgur.com/yijCn.jpg" alt="A4988 connectio...
<p>That depends on how much noise you have on your motor power supply ground. You definitely want the 100&nbsp;µF capacitor to have a good high frequency response. Motors turning on and off can be noisy, and that noise can cause false clock signals in your logic circuitry if you tie the grounds together. </p>
<p>That depends on how much noise you have on your motor power supply ground. You definitely want the 100&nbsp;µF capacitor to have a good high frequency response. Motors turning on and off can be noisy, and that noise can cause false clock signals in your logic circuitry if you tie the grounds together. </p>
1,341
<p>For a new Java web project I thought about using:</p> <ul> <li>Eclipse as IDE</li> <li>Mercurial for version control</li> <li>Some kind of bug tracking software</li> </ul> <p>I have heard of bug tracking software where you can tie a change to an unresolved bug when you check it in. I haven't used any such solution...
<p>In my experience the MercurialEclipse plug-in works quite well - as far as I understood, nobody commenting here has actually used it, so don't base your decisions solely on those opinions. You'd probably be better off to test it yourself. As I said before - it works for me.</p> <p>Disclaimer: I've participated in d...
<p>Trac can sometimes be a pain to set up. Take a look at <a href="http://www.redmine.org/" rel="nofollow noreferrer">Redmine</a>. I'd recommend installing <a href="http://tortoisehg.sourceforge.net/" rel="nofollow noreferrer">TortoiseHg</a> too.</p>
23,000
<p>I'm pretty new in the 3D printing world, and there are some doubts that have come my way and I've not been able to find anywhere.</p> <p>Usually, I'm going to try to print pieces bigger than the bed of my Elegoo Mars Pro (which is 115 x 65 x 150 mm, so it's pretty small). Everywhere I try to look at this they are ta...
<p>I don't think it is the thermistor degrading. To answer your question directly, all my thermistors have failed because the tiny wire has broken off, and generally the fail is “hard” not soft.</p> <p>It is more likely you’re experiencing absorbed humidity in the filament from it being out on the spool too long. this ...
<p>It is indeed possible that the thermistor is broken (yet not sure). I am aware of two types of issues with thermistors:</p> <ol> <li><p>The contact (soldering) is broken, usually due to the temperature extreme variations. The thermistor will indicate the maximum temperature in case of PTC or minimum temperature in c...
1,728
<p>Normally I use <code>imagecreatefromjpeg()</code> and then <code>getimagesize()</code>, but with Firefox 3 I need to go round this different. So now im using <code>imagecreatefromstring()</code>, but how do I retreive the image dimensions now?</p>
<p><code>imagesx()</code> and <code>imagesy()</code> functions seem to work with images made with <code>imagecreatefromstring()</code>, too.</p>
<p>ah yes! i just found the answer on the internet a second ago :)</p> <p>for those who still interested :</p> <pre><code>$image = imagecreatefromstring($img_str); $w = imagesx($image); $h = imagesy($image); </code></pre>
13,448
<p>What is the troubleshooting process for the "Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80080005" errors in .Net? To clarify: I am getting this at runtime, on my XP machine, with client being .net code running under admin account. {XXXX} refers to one of our i...
<p>Seems to be a rather generic error relating to starting up the COM server. Possible issues include <a href="http://blogs.msdn.com/adioltean/archive/2005/06/24/432519.aspx" rel="noreferrer">timeouts</a>, <a href="http://alt.pluralsight.com/wiki/default.aspx/Keith/ComSecurityFaqEx2.html" rel="noreferrer">logon failure...
<p>One thing that you can look at is the DCOM security configuration. It is controlled by the dcomcnfg utility. There are <a href="http://www.opcactivex.com/Support/Tutorials/DCOM_Tutorial_-_Configuring_th/DCOM_Videos/dcom_videos.html" rel="nofollow noreferrer">helpful tutorial videos</a> on the web to explain how to...
35,250
<p>I have a file I need to move that's already under perforce. Once moved it needs some editing - update the package, etc - appropriate to its new location. Should I submit the move changespec and then reopen it for edit, or can I do this in one go? If so, what is the appropriate sequence of events?</p>
<p>I have done this before in one go, but depending on your build process, I recommend against it. What I generally do is this:</p> <ol> <li>Move the file.</li> <li>If the move needs a change in order to compile, open it for edit and make those changes.</li> <li>Submit the changes, telling perforce to reopen the file...
<p>&quot;Safely&quot; is probably an important point here. Once you rename or move the file it'll get a revision number of &quot;1&quot; which looks like a new file to your Perforce client. Of course, admins will be able to get its prior history, but if the editing/version history of the file is important to you it's...
14,052
<p>Why use a GlobalClass? What are they for? I have inherited some code (shown below) and as far as I can see there is no reason why strUserName needs this. What is all for?</p> <pre><code>public static string strUserName { get { return m_globalVar; } set { m_globalVar = value; } } </code></pre...
<p>You get all the bugs of global state and none of the yucky direct variable access. </p> <p>If you're going to do it, then your coder implemented it pretty well. He/She probably thought (correctly) that they would be free to swap out an implementation later.</p> <p>Generally it's viewed as a bad idea since it make...
<p>When you want to use a <b>static</b> member of a type, you use it like <code>ClassName.MemberName</code>. If your code snippet is in the same class as the member you're referring (in this example, you're coding in a GlobalClass member, and using strUserName) you <b>can</b> omit the class name. Otherwise, it's requir...
40,564
<p>Is there a succinct way to retrieve a random record from a sql server table? </p> <p>I would like to randomize my unit test data, so am looking for a simple way to select a random id from a table. In English, the select would be "Select one id from the table where the id is a random number between the lowest id i...
<blockquote> <p>Is there a succinct way to retrieve a random record from a sql server table?</p> </blockquote> <p>Yes</p> <pre><code>SELECT TOP 1 * FROM table ORDER BY NEWID() </code></pre> <h2>Explanation</h2> <p>A <code>NEWID()</code> is generated for each row and the table is then sorted by it. The first recor...
<p>I was looking to improve on the methods I had tried and came across this post. I realize it's old but this method is not listed. I am creating and applying test data; this shows the method for "address" in a SP called with @st (two char state)</p> <pre><code>Create Table ##TmpAddress (id Int Identity(1,1), street V...
23,234
<p>The following code should find the appropriate project tag and remove it from the XmlDocument, however when I test it, it says:</p> <p><strong>The node to be removed is not a child of this node.</strong></p> <p>Does anyone know the proper way to do this?</p> <pre><code>public void DeleteProject (string projectNam...
<p>Instead of </p> <pre><code>configDoc.RemoveChild(projectNodes[i]); </code></pre> <p>try </p> <pre><code>projectNodes[i].parentNode.RemoveChild(projectNodes[i]); </code></pre>
<p>It would be handy to see a sample of the XML file you're processing but my guess would be that you have something like this</p> <pre><code>&lt;Root&gt; &lt;Blah&gt; &lt;project&gt;...&lt;/project&gt; &lt;/Blah&gt; &lt;/Root&gt; </code></pre> <p>The error message seems to be because you're trying to remove <co...
4,095
<p>I want to include a batch file rename functionality in my application. A user can type a destination filename pattern and (after replacing some wildcards in the pattern) I need to check if it's going to be a legal filename under Windows. I've tried to use regular expression like <code>[a-zA-Z0-9_]+</code> but it doe...
<p>You can get a list of invalid characters from <a href="http://msdn.microsoft.com/en-us/library/system.io.path.getinvalidpathchars.aspx" rel="noreferrer"><code>Path.GetInvalidPathChars</code></a> and <a href="http://msdn.microsoft.com/en-us/library/system.io.path.getinvalidfilenamechars.aspx" rel="noreferrer"><code>G...
<p>One liner for verifying illigal chars in the string:</p> <pre><code>public static bool IsValidFilename(string testName) =&gt; !Regex.IsMatch(testName, "[" + Regex.Escape(new string(System.IO.Path.InvalidPathChars)) + "]"); </code></pre>
8,825
<p>My guess is that class variables ("class var") are truly global in storage (that is, one instance for the entire application).</p> <p>But I am wondering whether this is the case, or whether they are thread in storage (eg similar to a "threadvar") - once instance per thread.</p> <p>Anyone know?</p> <p><em>Edit: ch...
<p>Yes, class variables are globally scoped. Have a look in the RTL source for details of how threadvars are implemented. Under Win32 each thread can have a block of memory allocated automatically to it on thread creation. This extra data area is what is used to contain your threadvars.</p>
<p>Class variables are just like classes: global and unique for the application.</p>
10,781
<p>From time to time I read that Fortran is or can be faster then C for heavy calculations. Is that really true? I must admit that I hardly know Fortran, but the Fortran code I have seen so far did not show that the language has features that C doesn't have.</p> <p>If it is true, please tell me why. Please don't tell ...
<p>The languages have similar feature-sets. The performance difference comes from the fact that Fortran says aliasing is not allowed, unless an EQUIVALENCE statement is used. Any code that has aliasing is not valid Fortran, but it is up to the programmer and not the compiler to detect these errors. Thus Fortran compile...
<p>Most of the posts already present compelling arguments, so I will just add the proverbial 2 cents to a different aspect.</p> <p>Being fortran faster or slower in terms of processing power in the end can have its importance, but if it takes 5 times more time to develop something in Fortran because:</p> <ul> <li>it ...
17,607
<p>Does anyone know of a system for automatic error reporting in java? We have a server product that is installed on client servers. The idea is that our server would phone home with the details of an error to one of our servers, which then enters a bug in our bug tracker. Preferable, this would happen over http. It wo...
<p>Not conventional, but maybe you could use <a href="http://logging.apache.org/log4j/1.2/index.html" rel="nofollow noreferrer">Log4J</a> appenders to do it.</p> <p>The <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/net/SocketAppender.html" rel="nofollow noreferrer">SocketAppender</a> allows you...
<p>Have a look at <a href="http://www.snmp4j.org/" rel="nofollow noreferrer">SNMP4J</a>. There are quite a lot of system administration tools to aggregate SNMP infomation (ask your systems administrator), and the <a href="http://en.wikipedia.org/wiki/Simple_Network_Management_Protocol" rel="nofollow noreferrer">Simple...
24,740
<p>Has anyone ever had the issue where trying to "View Designer" on a windows form in Visual Studio .NET causes the error: <strong>"Could not load file or assembly…"</strong> ?</p> <p>In this case, the assembly in question was <code>XYZ.dll</code>. I managed to fix this by adding <code>XYZ.dll</code> and all its refer...
<p>We have same problem. Some Form/UserControl classes can not be viewed in designer and Visual Studio causes various exceptions.</p> <p>There are one typical cause: One of designed component thrown unhandled exception during initialization ( in constructor or in Load event or before ).</p> <p>Not only for this case, y...
<p>I concur with the Resharper comment. I'm running 4.1. I disabled it, restart VS2008, and tried the "Convert to Web Application" again, and it worked.</p>
20,146
<p>I have a little dilemma on how to set up my visual studio builds for multi-targeting.</p> <p>Background: c# .NET v2.0 with p/invoking into 3rd party 32 bit DLL's, SQL compact v3.5 SP1, with a Setup project. Right now, the platform target is set to x86 so it can be run on Windows x64.</p> <p>The 3rd party company ...
<p>Yes, you can target both x86 and x64 with the same code base in the same project. In general, things will Just Work if you create the right solution configurations in VS.NET (although P/Invoke to entirely unmanaged DLLs will most likely require some conditional code): the items that I found to require special attent...
<p>Regarding your last question. Most likely you cant solve this inside a single MSI. If you are using registry/system folders or anything related, the MSI itself must be aware of this and you must prepare a 64bit MSI to properly install on 32 bit machine.</p> <p>There is a possibility that you can make you product in...
17,577
<p>For a given class I would like to have tracing functionality i.e. I would like to log every method call (method signature and actual parameter values) and every method exit (just the method signature). </p> <p>How do I accomplish this assuming that: </p> <ul> <li>I don't want to use any 3rd party AOP libraries...
<p>C# is not an AOP oriented language. It has some AOP features and you can emulate some others but making AOP with C# is painful.</p> <p>I looked up for ways to do exactly what you wanted to do and I found no easy way to do it.</p> <p>As I understand it, this is what you want to do:</p> <pre><code>[Log()] public vo...
<ol> <li>Write your own AOP library.</li> <li>Use reflection to generate a logging proxy over your instances (not sure if you can do it without changing some part of your existing code).</li> <li>Rewrite the assembly and inject your logging code (basically the same as 1).</li> <li>Host the CLR and add logging at this l...
4,540
<p>This is an issue that I've spent hours researching in the past. It seems to me to be something that should have been addressed by modern <a href="http://en.wikipedia.org/wiki/Relational_database_management_system" rel="noreferrer">RDBMS</a> solutions but as yet I have not found anything that really addresses what I...
<p>Yeah, it's a pain, and the way you're doing it looks similar to what I do:</p> <pre><code>order by case when @SortExpr = 'CustomerName' and @SortDir = 'ASC' then CustomerName end asc, case when @SortExpr = 'CustomerName' and @SortDir = 'DESC' then CustomerName end desc, ... </code></pre> <p>This, to me,...
<p>This solution might only work in .NET, I don't know. </p> <p>I fetch the data into the C# with the initial sort order in the SQL order by clause, put that data in a DataView, cache it in a Session variable, and use it to build a page.</p> <p>When the user clicks on a column heading to sort (or page, or filter), ...
18,002
<p>I'm considering altering some tables to use nvarchar(50) as primary key instead of an int primary key. Using an int ID for a key really is irrelevant data, it's the string I'm interested in. What sort of performance hit will occur, or where do you research this? Other than cut and try that is.</p>
<p>You have hit upon one of the major "holy wars" of database design. The debate you're referring to is the "surrogate vs. natural key" argument that's been raging for as long as there have been RDBMSs (as nearly as I can tell).</p> <p>The debate essentially boils down to whether a representative key (surrogate, for ...
<p>Why UNICODE? e.g. if I translated an English word into Chinese Han characters, would they be considered to be duplicates?</p> <p>Why variable? Fixed width is a good physical characteristic of a key.</p> <p>Why 50 characters? That's a lot of keying for users (I agree "an int ID for a key really is irrelevant data" ...
27,751
<p>Not for the first time, I've accidentally done "svn switch" from somewhere below the root of my project. This switches that subdirectory only, but how do I undo this?</p> <p>If I try switching the subdirectory back to the original branch I get:</p> <pre><code>"svn: Directory 'subdir\_svn' containing working copy a...
<p>Quick hack: Delete the directory, go one level up, and run svn update.</p>
<pre><code>svn revert &lt;dir&gt; </code></pre> <p>Or, yes, delete it and grab another copy.</p>
12,610
<p>How can I do Exp and Imp by using PL/SQL?</p>
<p>This could be done in a few ways.</p> <p>First, if you're using 10g or later, you can consider using data pump (expdp and impdp) as opposed to imp and exp. These are the newer and more capable versions of those tools.</p> <p>As for how to call them from PL/SQL, you can do so by: </p> <ul> <li>You can make an exte...
<p>You can see an example about exactly you are requesting in the <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_api.htm#sthref460" rel="nofollow noreferrer">Examples of Using the Data Pump API</a> inside the <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/toc.htm" re...
47,739
<p>I've several web user controls on my asp.net page and I wanna pass values between them. For example :</p> <p>There is a dropDownList in one of them and when user selects any item from dropDownList, it can pass the selected value to the other user control which includes GridView to show related data of selected item...
<p>On the DropDownList onChange event you could then assign the selected item value to the property of the other user control. </p> <p>Ok, your UserControls should have properties that allow data to be set. For example in Control2 you would have:</p> <pre><code>public string needData { get { return MyData; } set { ...
<p>Use delegates, example <a href="http://www.dotnetfunda.com/articles/article201.aspx" rel="nofollow noreferrer">here</a></p> <p>Hope this helps</p>
47,506
<p>I recently broke the cooling fan on my Voxelab Aquila while doing some maintenance, and I'm in the middle of a multi piece print that I would like to finish soon. I found the fan replacement I need, but it's not going to arrive for over a week. I was wondering if it would be ok to print a few things with the broken ...
<p>As long as your ambient temperature is not excessive and you're not using a very high bed temperature, you should be fine.</p> <p>With insufficient cooling, there is a risk of heat creep - that is, of the heat from the melt zone working its way up to the area where the filament is supposed to be solid, potentially c...
<p>If the fan is the part cooling fan, you'll have reduced cooling on the part as it is printed. This isn't necessarily going to be a problem, although you may have irregularities in the print surface.</p> <p>If the fan is the heat sink cooling fan, reduced cooling will be problematic. This could result in heat creep a...
2,142
<p>Are hints really necessary for every sql statement? We have a dba who is anal about it and asks us to put hints on every select and update statements in our stored procs. Is this really necessary?</p>
<p>Not usually. Putting them on everything sounds like overkill.</p> <p>The <a href="http://msdn.microsoft.com/en-us/library/ms187713.aspx" rel="nofollow noreferrer">documentation</a> says</p> <p><em>Because the SQL Server query optimizer typically selects the best execution plan for a query, we recommend that join_...
<p>Hints are merely hints. They help the optimizer to do the best job possible. But like any optimization, you should focus on the statements that are actually problems.</p>
33,281
<p>I want to move various parts of my app into simple scripts, to allow people that do not have a strong knowledge of c++ to be able to edit and implement various features.</p> <p>Because it's a real time app, I need to have some kind of multitasking for these scripts. Ideally I want it so that the c++ app calls a scr...
<p>You can use either Lua or Python. Lua is more "lightweight" than python. It's got a smaller memory footprint than python does and in our experience was easier to integrate (people's mileage on this point might vary). It can support a bunch of scripts running simultaneously. Lua, at least, supports stopping/start...
<p>You can also embed C/C++ scripts using <a href="http://softintegration.com/" rel="nofollow noreferrer">Ch</a>. I've been using it for a game project I'm working on, and it does well. Nice blend of power and adaptability.</p>
8,923
<p>As far as i know it is not possible to do the following in C# 2.0</p> <pre><code>public class Father { public virtual Father SomePropertyName { get { return this; } } } public class Child : Father { public override Child SomePropertyName { get ...
<p>This is not possible in any .NET language because of type-safety concerns. In type-safe languages, you must provide covariance for return values, and contravariance for parameters. Take this code:</p> <pre><code>class B { S Get(); Set(S); } class D : B { T Get(); Set(T); } </code></pre> <p>For th...
<p>No. C# does not support this idea (it's called "return type covariance"). You can however do this:</p> <pre><code>public class FatherProp { } public class ChildProp: FatherProp { } public class Father { public virtual FatherProp SomePropertyName { get { return new FatherProp(...
19,013
<p>I have a binary file that I have to parse and I'm using Python. Is there a way to take 4 bytes and convert it to a single precision floating point number?</p>
<pre><code>&gt;&gt;&gt; import struct &gt;&gt;&gt; struct.pack('f', 3.141592654) b'\xdb\x0fI@' &gt;&gt;&gt; struct.unpack('f', b'\xdb\x0fI@') (3.1415927410125732,) &gt;&gt;&gt; struct.pack('4f', 1.0, 2.0, 3.0, 4.0) '\x00\x00\x80?\x00\x00\x00@\x00\x00@@\x00\x00\x80@' </code></pre>
<p>I would add a comment but I don't have enough reputation.</p> <p>Just to add some info. If you have a byte buffer containing X amount of floats, the syntax for unpacking would be:</p> <pre><code>struct.unpack('Xf', ...) </code></pre> <p>If the values are doubles the unpacking would be:</p> <pre><code>struct.unpack('...
2,731
<p>The Eclipse <a href="http://www.eclipse.org/projects/project_summary.php?projectid=tools.ve" rel="noreferrer">Visual Editor</a> project seems to be dead, no commits, no updates. Any one know what is happening?</p>
<p><strong>Update 2:</strong> The project <a href="http://www.eclipse.org/archived/" rel="nofollow noreferrer">has been archived</a> (i.e. dead) since June 2011 again.</p> <p><strong>Update:</strong> The project <a href="http://dev.eclipse.org/mhonarc/lists/ve-dev/msg01818.html" rel="nofollow noreferrer">has been revi...
<p>WindowBuilder can be a good alternative. I had several problems with VE and I end up with WindowBuilder who worked for me perfectly.</p> <p><a href="http://www.eclipse.org/windowbuilder/" rel="nofollow">http://www.eclipse.org/windowbuilder/</a></p>
41,272
<p>I'm using a QTableWidget to display several rows. Some of these rows should reflect an error and their text color is changed :</p> <p>Rows reflecting that there is no error are displayed with a default color (black text on white background on my computer).<br> Rows reflecting that there is an error are displayed wi...
<p>Answering myself, here is what I ended up doing : a delegate.</p> <p>This delegate will check the foreground color role of the item. If this foreground color is not the default WindowText color of the palette, that means a specific color is set and this specific color is used for the highlighted text color.</p> <p...
<p>You could, of course, inherit from the table widget and override the paint event, but I don't think that is what you want to do.</p> <p>Instead, should use the <code>QAbstractItemDelegate</code> functionality. You could either create one to always be used for error rows, and set the error rows to use that delegate...
36,419
<p>I run all my integers through a <code>(int)Integer</code> to make them safe to use in my query strings.</p> <p>I also run my strings through this function code:-</p> <pre><code>if(!get_magic_quotes_gpc()) { $string = mysql_real_escape_string($string); } $pattern = array("\\'", "\\\"", "\\\\", "...
<p>yeah I think you've got things going a bit strangely there.</p> <p>First of all, I'd check for magic quotes and <em>remove</em> the slashes if it's turned on. That way you've got a string which actually represents the information you want (and not one that has been treated with slashes).</p> <p>If you particularly...
<p>On your second point:<br /> It is completely redundant, all the characters have been properly escaped if you run it through mysql_real_escape_string()</p>
44,044
<p>I've been writing C / C++ code for almost twenty years, and I know Perl, Python, PHP, and some Java as well, and I'm teaching myself JavaScript. But I've never done any .NET, VB, or C# stuff. What exactly does <strong>managed</strong> code mean?</p> <p>Wikipedia <a href="http://en.wikipedia.org/wiki/Managed_code" r...
<p>When you compile C# code to a .exe, it is compiled to Common Intermediate Language(CIL) bytecode. Whenever you run a CIL executable it is executed on Microsofts Common Language Runtime(CLR) virtual machine. So no, it is not possible to include the VM withing your .NET executable file. You must have the .NET runtime ...
<p>Managed Code--MSIL and IL and Managed Code are same.When we build our application the .dll or .exe files are generated in the Bin folder.These files are called as Managed code.Later these files are given to CLR to generate Native code which would be understood by OS.</p>
8,238
<p>In previous releases there were 3 ways to pass data from controller to view AFAIK (shown below). </p> <p>I want to use method (2) with MVC Beta 1, but I can't find the renderView method. So what's the new syntax (if it's still possible)? Thanks in advance.</p> <p>Ben.</p> <p>Syntax #1: Old-school dictionary</p> ...
<p>In beta 1, use the View method:</p> <pre><code>return View ("ShowCat", &lt;TYPED_DATA_SET_OR_OTHER_MODEL&gt;); </code></pre> <p>The View method has replaced the RenderView method.</p>
<p>Following from Kieron's comment, in Visual Studio 2008 (maybe 2005/VSE?), when you right click on your controller action, you can choose 'Add View' at the top of the context menu.</p> <p>This brings up a little dialog box, which will allow you to create a strongly typed view by specifying it.</p>
38,191
<p>Last Friday where I work, an oracle client was upgarded and our IIS server from version 9 to version 10. Now that its on version 10, we are seeing a lot of connections being open up to the database. It is opening up so many connections that we cannot log onto the database using tools like PlSQL developer or Toad. We...
<p>lex/flex and yacc/bison provide easy-to-use, well-understood lexer- and parser-generators, and I'd really recommend doing something like that as opposed to doing it procedurally in e.g. Perl. Regular expressions are powerful stuff for ripping apart strings with relatively-, but not totally-fixed structure. With an...
<p>In trying to find my answer, I found this on <a href="http://www.ibm.com/developerworks/edu/au-dw-au-parsingwithantlr-i.html" rel="nofollow noreferrer">ANTLR</a> - might be of use</p>
9,615
<p>I'm scanning through a file looking for lines that match a certain regex pattern, and then I want to print out the lines that match but in alphabetical order. I'm sure this is trivial but vbscript isn't my background</p> <p>my array is defined as</p> <pre><code>Dim lines(10000) </code></pre> <p>if that makes any dif...
<p>From <a href="http://www.microsoft.com/technet/scriptcenter/funzone/games/tips08/gtip1130.mspx#E4C" rel="noreferrer">microsoft</a></p> <p>Sorting arrays in VBScript has never been easy; that’s because VBScript doesn’t have a sort command of any kind. In turn, that always meant that VBScript scripters were forced to...
<p>I actually just had to do something similar but with a 2D array yesterday. I am not that up to speed on vbscript and this process really bogged me down. I found that the articles <a href="https://web.archive.org/web/20180927040044/http://www.4guysfromrolla.com:80/webtech/011001-1.shtml" rel="nofollow noreferrer">her...
33,719
<p>Following Jonathan Holland's suggestion in his comment for my previous question: <a href="https://stackoverflow.com/questions/137360/is-there-any-way-in-net-to-programmatically-listen-to-http-traffic">Is there any way in .NET to programmatically listen to HTTP traffic?</a> I've made a separate (but not exactly a dup...
<p>WebAii 2.0 has a built-in HTTP proxy:</p> <p><a href="http://www.artoftest.com/community/blogs/09-03-25/WebAii_2_0_Beta_Released.aspx" rel="nofollow noreferrer">http://www.artoftest.com/community/blogs/09-03-25/WebAii_2_0_Beta_Released.aspx</a></p>
<p>I'm not sure if it's what you're looking for, but here is an example of ASP.NET unit testing using selenium. <a href="http://www.stevetrefethen.com/blog/AutomatedTestingOfASPNETWebApplicationsUsingSelenium.aspx" rel="nofollow noreferrer">http://www.stevetrefethen.com/blog/AutomatedTestingOfASPNETWebApplicationsUsing...
16,624
<p>I need to come up with a solution for users to be able to paste an image on to a website, then upload that image on to the web server. I'm not sure what the right solution for this - I am pretty sure javascript is out of the question because I don't think it can handle binary clipboard data (or any clipboard data?)<...
<p>Or this <a href="http://lassebunk.dk/2009/08/04/clipboard-java-applet/" rel="nofollow noreferrer">free one</a> (via another StackOverflow question)</p>
<p><a href="http://www.radinks.com/upload/applet.php" rel="nofollow noreferrer">Rad Upload</a> (java applet). It's not free, but it is relatively cheap.</p>
47,153
<p>I am trying to get some <code>JavaScript</code> to programmatically adjust a HTML <code>img</code> tag's width to display various sized images correctly.</p> <p>I have a fixed width <code>img</code> tag at <code>800px</code> to display an image, this is the max width.</p> <p>If the image is wider then <code>800px<...
<p>I have never seen a safari in work, but you can try changing your onload event to this:</p> <pre><code>onload="resize_image(self.id);return true" </code></pre> <p>It could be that without a return value, safari thinks that this object should not be loaded.</p>
<p>Have you tried monkey with <code>img.style.width</code>? You could also try having 2 CSS classes for each of the 2 conditions and programmaticly change them. </p>
48,548
<p>I need an equivalent to c++'s <code>std::multimap&lt;K, V, Comp, Alloc&gt;</code> in C-sharp. Does it exist in the standard library?</p>
<p>Because it's almost christmas :)</p> <pre><code>////////////////////////////////////////////////////////////////////// // Algorithmia is (c) 2008 Solutions Design. All rights reserved. // http://www.sd.nl ////////////////////////////////////////////////////////////////////// // COPYRIGHTS: // Copyright (c) 2008 Sol...
<p>Consider using <a href="http://www.codeproject.com/Articles/612301/The-List-Trifecta-Part-2" rel="nofollow"><code>BMultiMap&lt;K,V&gt;</code></a> if your collection as a whole is large. It saves a lot of memory compared to <code>Dictionary&lt;K,List&lt;V&gt;&gt;</code>, especially if the number of values associated ...
49,873
<p>I'm not really sure where to ask this question as I think it is a design question, but also a printing question. So if there is a better place to post, I'd be happy to harass someone else.<br> I'm (re)designing a sprinkler manifold for a dripper system because the stupid pegs for this <a href="https://rads.stackove...
<p>I examined and sliced your STL file, and the profile of your threads looks very strange.</p> <p>It's definitely possible to do very strong, perfectly-fitting threads down to small sizes (at least down to M4 or slightly smaller) using modern inexpensive 3D printers, and contrary to widespread belief (there's a well-...
<p>If I may suggest a slight alternative: don't try to make the threads part of the 3Dprint. Instead, thicken the walls where the threads would have been, increasing the ID (inner diameter) of the hole, maybe even "thread" to match the outside of : metal <a href="https://www.homedepot.com/p/Everbilt-1-4-in-20-tpi-x-20...
1,327
<p>I have a copy of emacs that I use on a couple of different (windows) computers from a thumb drive, and I am wondering if it is possible to create something that is sort of the equivalent of a bash alias or symlink within emacs? Something that I could use within find-file is the main thing that i'm looking for, so fo...
<p>I'm not really clear on what you're asking for. I store my commonly-used files in registers in my .emacs:</p> <pre><code>(set-register ?c '(file . "c:/data/common.txt")) (set-register ?f '(file . "c:/data/frequent.txt")) </code></pre> <p>Then I can jump to a file with <code>jump-to-register</code> (<code>C-x r j<...
<p><strong><em>I Moved this into the original question, but i'm leaving it here because people responded to it already</em></strong></p> <p>That's way better than what i've got, but what i feel like probably exists is something that would replace, for example:</p> <pre><code>(defun nuke () "alias delete-trailing-w...
21,199
<p>Right up front: I do <em>not</em> want to start a religious war.</p> <p>I've used <em>vi</em> for as long as I can remember, and the few times I've tried to pick up <em>Emacs</em> I've been so lost that I've quickly given up. Lots of people find Emacs very powerful, however. Its programmability is somewhat legendar...
<p>I prefer emacs to vi, but I'm comfortable in both. </p> <p>There are some things that you can do in emacs that make it more powerful than vi, but not all of them are even programming-related. (Can you send email or read news from within vi? No, but who cares?) If you're comfortable with lisp (I'm not), you might be...
<p>I really see no reason to switch. I've used vi for a long time and am quite comfortable with it; about every six months I would install emacs to give it a go, then quickly just switch back. Yes there were things I much preferred about vi, but the main reason I never stuck with it is because the time investment to ...
7,036
<p>At home, I use CTRL+SHIFT+B or F7 or whatever key sequence initiates the build for my build tool. At work, this doesn't quite cut it.</p> <p>At my first job (an internship) we used a product called Visual Build, which I have come to like very much. It's the best build tool I've ever worked with. The down side he...
<p>We use FinalBuilder - I think it's very similar to VisualBuild, though I've not used the latter. </p> <p>It does run from the command line, and you can integrate it with CC.Net if you want.</p>
<p>Going back to the keystrokes thing for a sec, I found <a href="http://www.bcheck.net/apps/#hoekey" rel="nofollow noreferrer">Hoekey</a> which the CTO loves. I don't use it myself, but as a way of assign keystrokes to things, it's pretty good.</p>
41,520
<p>Here's the scenario. I'm using myopenid for, among other things, StackOverflow. When I initially set up my openid account with myopenid, I decided to try out Cardspace because they had support.</p> <p>I later wanted to access Stackoverflow from another machine so I chose to back up my card. I gave it a password and...
<p>It <em>should</em> work; however if you have 3.5SP1 on one machine and 3.5 or less on another there was an (unannounced) breaking change with the code to generate the unique ID from the card; which may explain why it doesn't work.</p> <p>I would try sending a test transaction to <a href="https://sharpsts.com/demos/...
<p>In Cardspace, the card is locked to the computer. You can move it around by exporting/importing. The next version "Geneva" will allow you to store your cards in a directory service which is useful for those running Active Directory.</p>
8,136
<p>I'm reading the book "The Software Architect's Profession" by Marc and Laura Sewell (<a href="https://rads.stackoverflow.com/amzn/click/com/0130607967" rel="noreferrer" rel="nofollow noreferrer">Amazon link</a>) and it got me wondering whether a software architect is a part of the old non-agile BDUF approach.</p> <...
<p>My role as architect in Scrum includes the following.</p> <ol> <li><p>Technical spikes -- proofs of concept -- how will we do that. ("It would be simpler if you'd simply using the SMTP library directly, it already wraps the existing SMTP libraries; writing your own wrapper around our wrapper doesn't help much. We...
<p>I dont think there is the need as the SCRUM guide written by the original formants of SCRUM Dr Jeff Sutherland and Ken Schwaber doesnt mention the need for one. </p>
21,423
<p>Can anyone explaine me, what is MVC, why we use it and how we can use it. Benefits of using this? and can we use ASP.NET MVC in ASP.NET 2.0 (VS 2005)</p>
<p>You'll use MVC when you need total control over the HTML output from ASP.NET. It also allows for better/easier unit-testing. It is based on a Model View Controller architecture.</p> <p>Scott Gutherie introduces it well here: <a href="http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx" re...
<p><strong>Asp.net MVC</strong> is based on MVC design pattern. Now Question is raised that what is <strong>MVC design pattern</strong>. MVC design pattern allows you to develop the application with loosely coupled components. It separates the application into different layers like <strong>Data</strong>, <strong>busine...
48,715
<p>What causes the publish error: "fl.getDocumentDOM() has no properties" ?</p> <p>The error occurs only when using the "Test Project" button in the project pane. It doesn't cause the publish to fail, it's just annoying.</p>
<p><a href="http://www.w3.org/TR/css3-background/#the-border-radius" rel="nofollow noreferrer">CSS3 has <code>border-radius</code></a>.</p> <p>For now, Mozilla- and WebKit-based browsers have experimental support, <code>-moz-border-radius</code> and <code>-webkit-border-radius</code>. It's not bad to use them now, as ...
<p>Any CSS property that starts with a dash (e.g. <code>-moz</code>, <code>-webkit</code>) is a browser-specific property.</p> <p>This allows browser vendors to experiment with new CSS properties. Doing so is a common part of the process for writing new CSS specs, to allow web developers to see how the properties work...
42,751
<p>I have a set of applications that all rely on a cross-platform library (in-house development), and everything is stored in subversion. Now, this library is part of every app and as such a copy of it has to be in each app's working directory. </p> <p>In order to be able to go back to any version of an app and have t...
<p>The problem with your problem is that your library is not a library, at least not in a strict sense of the expression.</p> <p>Your "library" is better described as a project that happens to be shared by the teams working on the different applications that rely on that core.</p> <p>In this context, the biggest issu...
<p>You can use <a href="http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.advanced.vendorbr" rel="nofollow noreferrer">Vendor Branches</a>.</p>
32,660
<p>I am looking to print an enclosure, which will have a PCB inside with some LED indicators. I was wondering if it is possible to 3D print the enclosure such that the following look can be achieved? What material and technique?</p> <p>When LEDs are off, it looks something like this:</p> <p><a href="https://i.stack.i...
<p>Achieving this with 3D printing would be quite difficult, and you might be better served by creating this effect some other way (I would personally recommend getting some inkjet transparencies and stacking a few layers together: an entirely black layer, and a few layers with the symbols in negative space).</p> <p>O...
<p>You can print the "lid" in translucent (gray) and stick a piece of laser printed transparency film under it with the symbols (print it "negative" so the symbols are transparent and the rest is black). Depending on the quality of the printed black you might want to stack two printouts to minimize light sipping throug...
358
<p>In this asp.net I'm cleaning up it's possible for deadlocks to occur. I want to make sure that the code deals with them properly, so I'm trying to write NUnit tests which trigger a deadlock.....</p> <p>The DAO is split by entity. Each entity has a set of tests which are surrounded by Startup() and Teardown() meth...
<p>If your deadlock results in an exception being thrown, you want to use a Mock Object to emulate the exception being thrown.</p> <p>The basic idea is that you tell your Mock Object framework (I like <a href="http://www.typemock.com/" rel="nofollow noreferrer">TypeMock</a>) to throw an exception instead, something li...
<p>What if one of your tests in the middle of your transaction just does a "wait" for like 5 minutes? Or, you simply write a test that starts a transaction, creates a new record, and then updates that record without committing. Then, start a new transaction in and try to read that record that was created and is curre...
21,564
<p>I just purchased this Ender 3 Pro about 1 week ago and since then I've been having nightmares with leveling/tramming the printer bed. From having to tram it again after every print to not being able to level it at all. Since then I've been reading and watching a lot of problem-related content to try and find a solut...
<p>This is an old hotend type, it is called a <a href="https://www.google.com/search?q=j+head+nozzle" rel="noreferrer">J-Head</a> (see e.g. the <a href="https://reprap.org/wiki/J_Head_Nozzle#Mk_V" rel="noreferrer">J-Head Nozzle Mk V</a>, I'm unsure which exact version you have). The hotend is serviceable, you can buy s...
<p>Not exactly the type of answer you probably want, but this hotend does not look servicable. The nozzle is usually considered a consumable part unless it's made of something like tungsten carbide, or at least steel. The nozzle is almost surely long past its useful life unless the printer was barely used, and the enti...
2,210
<p>I am a new to the prefuse visualization toolkit and have a couple of general questions. For my purpose, I would like to perform an initial visualization using prefuse (graphview / graphml). Once rendered, upon a user click of a node, I would like to completely reload a new xml file for a new visualization. I want...
<p>Of course as you said, one option is loading all nodes and then set the nodes you don't need to be invisible. Prefuse scales fairly well, but of course it has its limits. The second option is to just create a brand new panel and replace the old panel. I've used the option 2 and it works quite well.</p>
<p>I'm far from an expert on Prefuse's performance issues, but I think it is definitely more resource intensive to have a huge xml file loaded at once than to do the processing to only re-load the necessary nodes. </p> <p>I don't know what kind of graph you are using, but I would place a 'refreshGraph' that removes th...
21,316
<p>Is there any way to reboot the JVM? As in don't actually exit, but close and reload all classes, and run main from the top?</p>
<p>Your best bet is probably to run the java interpreter within a loop, and just exit. For example:</p> <pre><code>#!/bin/sh while true do java MainClass done </code></pre> <p>If you want the ability to reboot or shutdown entirely, you could test the exit status:</p> <pre><code>#!/bin/sh STATUS=0 while [ $STATU...
<p>AFAIK there is no such way. </p> <p>Notice that if there were a way to do that, it would highly depend on the current loaded code to properly release all held resources in order to provide a graceful restart (think about files, socket/tcp/http/database connections, threads, etc).</p> <p>Some applications, like Jbo...
32,396
<p>Having this route:</p> <pre><code>map.foo 'foo/*path', :controller =&gt; 'foo', :action =&gt; 'index' </code></pre> <p>I have the following results for the <code>link_to</code> call</p> <pre><code>link_to "Foo", :controller =&gt; 'foo', :path =&gt; 'bar/baz' # &lt;a href="/foo/bar%2Fbaz"&gt;Foo&lt;/a&gt; </code><...
<p>Instead of passing path a string, give it an array.</p> <pre><code>link_to "Foo", :controller =&gt; 'foo', :path =&gt; %w(bar baz) # &lt;a href="/foo/bar/baz"&gt;Foo&lt;/a&gt; </code></pre> <p>If you didn't have the route in your routes file, this same link_to would instead create this:</p> <pre><code># &lt;a hre...
<p>Any reason why you're needing to generate the URL with that path though?</p> <p>It would be cleaner to just define an extra route to cover that URL.</p>
18,216
<p>How do I write a program that tells when my other program ends?</p>
<p>The only way to do a waitpid() or waitid() on a program that isn't spawned by yourself is to become its parent by ptrace'ing it.</p> <p>Here is an example of how to use ptrace on a posix operating system to temporarily become another processes parent, and then wait until that program exits. As a side effect you can...
<p>This is called the "halting problem" and is not solvable. See <a href="http://en.wikipedia.org/wiki/Halting_problem" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Halting_problem</a></p>
15,280
<p>I'm sure you have all been there, you take on a project where there is a creaky old code base which is barely fit for purpose and you have to make the decision to either re-write it from scratch or repair what already exists. </p> <p>Conventional wisdom tends to suggest that you should never attempt a re-write fro...
<p>It really depends on how bad it is.</p> <p>If it's a small system, and you fully understand it, then a rewrite is not crazy.</p> <p>On the other hand, if it's a giant legacy monster with ten million lines of undocumented mystery code, then you're really going to have a hard time with a full rewrite.</p> <p>Points...
<p>It's not so black and white... it really depends on a lot of factors (the more important being "what does the person paying you want you to do")</p> <p>Where I work we re-wrote a development framework, and on the other hand, we keep modifying some old systems that cannot be migrated (because of the client's technol...
5,568
<p>When I type <code>git diff</code>, I want to view the output with my visual diff tool of choice (SourceGear "diffmerge" on Windows). How do I configure git to do this?</p>
<p>Since Git1.6.3, you can use the <strong>git difftool script</strong>: see <a href="https://stackoverflow.com/questions/255202/how-do-i-view-git-diff-output-with-visual-diff-program/949242#949242">my answer below</a>.</p> <hr> <p>May be this <a href="https://web.archive.org/web/20170508180316/http://git.net:80/ml/v...
<p>You may want to try out <a href="http://github.com/jiqingtang/xd" rel="nofollow noreferrer">xd</a>, which is a GUI wrapper for Git/SVN diff. It is <em>not</em> a diff tool itself.</p> <p>You run <code>xd</code> when you want to run <code>git diff</code> or <code>svn diff</code> and it will show you a list of files, ...
31,843
<p>By default each row of a Gridview maps to each row in a datatable or dataset attached to its datasource. But what if I want to display these rows in multiple columns. For example if it has 10 rows, 5 rows each should be displayed in 2 columns side by side. Also can I do this with the Infragistics grid. Is this possi...
<p>You can use a <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist.aspx" rel="noreferrer"><code>DataList</code></a> control instead. It has a <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist.repeatcolumns.aspx" rel="noreferrer"><code>RepeatColumns</co...
<p>Can't you just put two identical bound columns one after the other?</p>
4,019
<p>I have a webservice @ <a href="http://recpushdata.cyndigo.com/Jobs.asmx" rel="nofollow noreferrer">http://recpushdata.cyndigo.com/Jobs.asmx</a> but I'm not able to access it though I am adding it as a WebReference properly.</p> <p>Any Help would be great.</p>
<p>My guess is that this is a bug of some sorts. In SQL 2005 I was able to create such an indexed view without a problem (code is below). When I tried to run it on SQL 2000 though I got the same error as you are getting.</p> <p>The following seems to work on SQL 2000, but I get a warning that the index will be ignored...
<p>Look at <a href="https://stackoverflow.com/questions/309492/user-defined-functions-sql-server-2005-flagged-incorrectly-as-non-deterministic">that question asked and answered by Cade Roux</a>. Perhaps the solution would be to create a function using WITH SCHEMABINDING and then use it in the computed column</p> <p><s...
39,877
<p>I have started using Linq to SQL in a (bit DDD like) system which looks (overly simplified) like this:</p> <pre><code>public class SomeEntity // Imagine this is a fully mapped linq2sql class. { public Guid SomeEntityId { get; set; } public AnotherEntity Relation { get; set; } } public class AnotherEntity /...
<p>Rick Strahl has a nice article about DataContext lifecycle management here: <a href="http://www.west-wind.com/weblog/posts/246222.aspx" rel="nofollow noreferrer">http://www.west-wind.com/weblog/posts/246222.aspx</a>.</p> <p>Basically, the atomic action approach is nice in theory but you're going to need to keep you...
<blockquote> <p>Specifying DataLoadOptions to fetch related elements. As I want my Business Logic Layer to just reply with some entities in some cases, I do not know which sub-properties they need to use. </p> </blockquote> <p>If the caller is granted the coupling necessary to use the .Relation property, then the c...
32,425
<p>How to add offline access functionality to <a href="http://moinmo.in" rel="noreferrer">MoinMoin wiki</a>?</p> <p>As a minimum, I would love to have browsing access to all pages on a server-based wiki (while being offline). Search and other things, which do not modify the content, are secondary. An added bonus woul...
<p><em>By using Gears with the Firefox Greasemonkey plugin, you can inject Gears code into any website that you want. Don't wait for your favorite website to enable offline support -- do it yourself.</em> <a href="http://code.google.com/apis/gears/articles/gearsmonkey.html" rel="nofollow noreferrer">http://code.google....
<p>Have a look at <a href="http://moinmo.in/DesktopEdition" rel="nofollow noreferrer">MoinMoin Desktop Edition</a>.</p>
21,313
<p>If possible I want to catch pressure sensitive input from a Wacom tablet in Python. Are there any Python libraries available that can do this?</p>
<p>You could perhaps take a look at the <a href="http://www.alexmac.cc/tablet-apps/tablet-apps-0.3.1.tar.bz2" rel="nofollow noreferrer">software</a> described <a href="http://www.alexmac.cc/tablet-apps/" rel="nofollow noreferrer">here</a>. It is a gnome applet, written in Python.</p> <p>From the web site:</p> <p>"The...
<p>Pressure data is available in <a href="http://python-gtk-3-tutorial.readthedocs.org/en/latest/" rel="nofollow">PyGObject to access Gtk+ 3</a> on multiple platforms, though "Windows users may still want to keep using PyGTK until more convenient installers are published." [<a href="https://wiki.python.org/moin/PyGtk" ...
6,739
<p>The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object instance. Although I know how to code the singleton pattern in C++ and Java, I was wondering if anyone know how to implement it in Ruby?</p>
<p>Actually, the above answer was not completely correct.</p> <pre><code>require 'singleton' class Example include Singleton end </code></pre> <p>You also need to include the require 'singleton' statement.</p>
<p>You could use modules to the same effect I believe, although its not "the singleton pattern" you can have global state that way (which is what a singleton is ! Naughty global state !).</p>
2,670
<p>How do I revert a modified file to its previous revision at a specific commit hash (which I determined via <a href="https://git-scm.com/docs/git-log" rel="noreferrer"><code>git log</code></a> and <a href="https://git-scm.com/docs/git-diff" rel="noreferrer"><code>git diff</code></a>)?</p>
<p>Assuming the hash of the commit you want is <code>c5f567</code>:</p> <pre><code>git checkout c5f567 -- file1/to/restore file2/to/restore </code></pre> <p>The <a href="https://git-scm.com/docs/git-checkout" rel="noreferrer">git checkout</a> man page gives more information.</p> <p>If you want to revert to the commit b...
<ul> <li><strong>Run the following command that does a soft reset and the changes comes to your local.</strong></li> </ul> <pre><code>git reset --soft HEAD^1 </code></pre> <ul> <li><strong>See the status of files that you previously committed that comes to your local and then make the change.</strong></li> </ul> <pre><...
26,513
<p>Comparing string in C# is pretty simple. In fact there are several ways to do it. I have listed some in the block below. What I am curious about are the differences between them and when one should be used over the others? Should one be avoided at all costs? Are there more I haven't listed? </p> <pre><code>st...
<p>Here are the rules for how these functions work:</p> <p><strong><code>stringValue.CompareTo(otherStringValue)</code></strong></p> <ol> <li><code>null</code> comes before a string</li> <li>it uses <code>CultureInfo.CurrentCulture.CompareInfo.Compare</code>, which means it will use a culture-dependent comparison. Th...
<p>Using .Equals is also a lot easier to <em>read</em>.</p>
6,603
<p>You get a compilation error if you define the string parameter to have a size greater than 8000</p> <p>e.g. </p> <pre><code>The size (9000) given to the type 'varchar' exceeds the maximum allowed for any data type (8000). </code></pre> <p>Any ideas?</p>
<p>you need to store it as TEXT instead of varchar for string larger than 8000 in sql 2000</p>
<p>You can't use text as a parameter value for a stored proc in SQL 2000, so usually the technique is to break up the information into chunks of 8000 characters or less and reassemble in the proc.</p>
36,113
<p>What is the best way to password protect folder using php without a database or user name but using. Basically I have a page that will list contacts for organization and need to password protect that folder without having account for every user . Just one password that gets changes every so often and distributed to...
<p><strong>Edit: SHA1 is no longer considered secure. Stored password hashes should also be <a href="https://en.wikipedia.org/wiki/Salt_(cryptography)" rel="nofollow noreferrer">salted</a>. There are now much better solutions to this problem.</strong></p> <hr /> <p>You could use something like this:</p> <pre><code>//ac...
<p>Well since you <em>know</em> it's insecure to begin with, you could store a password in a text file somewhere on your web server. When someone accesses the page you could show a form that asks for a password. If the password matches what is in the text file, then you reload the page and display the information. Usin...
36,492
<p>What are the tensions between multithreading and exception-safety in C++? Are there good guidelines to follow? Does a thread terminate because of an uncaught exception?</p>
<p>I believe the C++ standard does not make any mention of multithreading - multithreading is a platform-specific feature.</p> <p>I'm not exactly sure what the C++ standard says about uncaught exceptions in general, but according to <a href="http://www.devx.com/tips/Tip/14240" rel="noreferrer">this page</a>, what happ...
<p>I don't recommend letting any exception remain uncaught. Wrap your top-level thread functions in catch-all handlers that can more gracefully (or at least verbosely) shut down the program.</p>
42,642
<p>I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose UI requires the use of a ComboBox control. Unfortunately, for devices with neither a hardware fullsize keyboard nor a touchscreen interface, there is no way to move (tab) from the ComboBox control to another control on the s...
<p>I believe directionals are only captured on <code>KeyDown</code> and <code>KeyUp</code>, not on <code>KeyPress</code>.</p> <p>Alternatively to using a ComboBox, you could use several RadioButtons if the numer of ListItems is static and relatively small.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb985500.aspx#GeneralRules" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/bb985500.aspx#GeneralRules</a> provides UI navigation rules. </p>
7,534
<p>Is it better to initialize class member variables on declaration</p> <pre><code>private List&lt;Thing&gt; _things = new List&lt;Thing&gt;(); private int _arb = 99; </code></pre> <p>or in the default constructor?</p> <pre><code>private List&lt;Thing&gt; _things; private int _arb; public TheClass() { _things = n...
<p>In terms of performance, there is no real difference; field initializers are implemented as constructor logic. The only difference is that field initializers happen before any "base"/"this" constructor.</p> <p>The constructor approach can be used with auto-implemented properties (field initializers cannot) - i.e.</...
<p>On added point to the above - You always have a constructor when implementing classes that have an implementation. If you do not declare one then the default instructor is inferred by the compiler [public Foo(){}]; a constructor that takes no arguments.</p> <p>Often times I like to offer both approaches. Allow co...
38,159
<p>The rich text editor must be implemented in Java, provide Swing support, and preferably be open source.</p> <p>I'm looking to integrate it into an existing Java/Swing application. </p> <p>Thanks.</p>
<p>This is probably not as drop-in-place as what you were after... but JTextPane supports rich text and HTML. Its trivial to get it to <em>display</em> rtf or html, just set the encoding type before you fill it with content. </p> <p>As for making the little "B" and "<em>I</em>" etc style-modifying buttons, well if it...
<p>Have a look at <a href="http://www.pilotltd.com/index_en.jsp?pagenum=90004" rel="nofollow noreferrer">JWord</a> or <a href="https://github.com/hoesterholt/JRichTextEditor" rel="nofollow noreferrer">JRichTextEditor</a></p> <p>JWord is a commercial swing rich text editor, with tables, paging and RTF/opendoc/XML suppo...
23,943
<p>Is there a tool that creates a diff of a file structure, perhaps based on an MD5 manifest. My goal is to send a package across the wire that contains new/updated files and a list of files to remove. It needs to copy over new/updated files and remove files that have been deleted on the source file structure?</p>
<p>You might try rsync. Depending on your needs, the command might be as simple as this: </p> <pre><code>rsync -az --del /path/to/master dup-site:/path/to/duplicate </code></pre> <p>Quoting from <a href="http://samba.anu.edu.au/rsync/" rel="nofollow noreferrer">rsync's web site</a>:</p> <blockquote> <p>rsync is an...
<p>You might try rsync. Depending on your needs, the command might be as simple as this: </p> <pre><code>rsync -az --del /path/to/master dup-site:/path/to/duplicate </code></pre> <p>Quoting from <a href="http://samba.anu.edu.au/rsync/" rel="nofollow noreferrer">rsync's web site</a>:</p> <blockquote> <p>rsync is an...
22,738
<p><a href="http://www.5axismaker.com/5axis/" rel="nofollow noreferrer">5AxisMaker</a> has a 5 axis CNC/3D printer combo machine. I understand what the benefits of 5 axis are for CNC machines, but are there any benefits for 3D printing. In this <a href="https://youtu.be/w8Fl8L4yk8M" rel="nofollow noreferrer">video</a...
<p>One aspect of having this level of control with 3d printing of a model is the removal of the need for supports and the attendant post-processing. In the case of the model shown in the video, some effects are created by printing the continents in a conformal manner that would otherwise be impossible with conventional...
<p>Slicing prints for printing in 5 Axis is not going to be simple with the current software. If you look at the web site for the 5AxisMaker you can see they are using Algorithmic modeling software (Grasshopper). You would probably need to buy this as well and then spend a decent amount of time learning how to use this...
428
<p>Given an empty method body, will the JIT optimize out the call (I know the C# compiler won't). How would I go about finding out? What tools should I be using and where should I be looking?</p> <p>Since I'm sure it'll be asked, the reason for the empty method is a preprocessor directive.</p> <hr> <p>@Chris: Makes ...
<p>This chap has quite a good treatment of JIT optimisations, do a search on the page for 'method is empty', it's about half way down the article -</p> <p><a href="http://www.codeproject.com/KB/dotnet/JITOptimizations.aspx" rel="noreferrer">http://www.codeproject.com/KB/dotnet/JITOptimizations.aspx</a></p> <p>Apparen...
<p>All things being equal, yes it should be optimized out. The JIT inlines functions where appropriate and there are few things more appropriate than empty functions :)</p> <p>If you really want to be sure then change your empty method to throw an exception and print out the stack trace it contains.</p>
3,289
<p>This will require a little setup. Trust me that this is for a good cause.</p> <h2>The Background</h2> <p>A friend of mine has run a non-profit public interest website for two years. The site is designed to counteract misinformation about a certain public person. Of course, over the last two years those of us wh...
<p>Google will detect the decrease in links to the old domain and that will hurt it.</p> <p>Include some new interesting content on the new domain. This will encourage Google to crawl this domain.</p> <p>The 301 redirects will be forgotten, in time. Perhaps several months. Note that they redirected one set of URLs to...
<p>Time heals all wounds...</p> <p>Losing control of the domain is a big blow, and it will take time to recover. It sounds like you're following all the correct procedures (getting people to change links, using 301s, etc.)</p> <p>Has the content of the original site changed since being put up again? If not, you sho...
32,795