instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>I noticed that one edge (which is also the starting point of the print) is always bigger than the other three. Additionally, the walls do not have the same thickness as well. The wall thickness (starting from the thick edge) starts very thin and gets thicker till reaching the thick edge again. Does anyone have a clu... | <p>As Fernando suggests, the problem is likely with your source file. One easy way to verify this is to slice twice, rotating the STL by 90 degrees. If both prints produce fat/thin sides in the same dimension on the print bed, then it's a printer problem. If the fat side rotated with the STL orientation, then the ST... | <p>As Fernando suggests, the problem is likely with your source file. One easy way to verify this is to slice twice, rotating the STL by 90 degrees. If both prints produce fat/thin sides in the same dimension on the print bed, then it's a printer problem. If the fat side rotated with the STL orientation, then the ST... | 906 |
<p>How should I describe this part which looks like a small gear so that I can research replacements?</p>
<p><a href="https://i.stack.imgur.com/51BdD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/51BdD.jpg" alt="image of a pulley"></a></p>
<p>This came with my FLSUN 3D printer, which may be based... | <p>This is a timing belt pulley.</p>
<p>Specifically, is a GT2 timing pulley, 2 mm pitch (between teeth), 6 mm wide. The drive diameter is measured by the number of teeth (16 in this case) , the shaft diameter (bore) is measured in mm.</p>
<p>The 'GT2' part refers to the tooth profile, some other examples a... | <p>It is an "aluminum timing pulley"</p>
<p><a href="https://www.google.com/search?psb=1&tbm=shop&q=aluminum%20timing%20pulley&ved=0CAMQr4sDKAFqFwoTCMis1KHmiuMCFRoMswAdMqUElxAB" rel="nofollow noreferrer">https://www.google.com/search?psb=1&tbm=shop&q=aluminum%20timing%20pulley&ved=0CAMQr4sDKAF... | 1,382 |
<p>Has anyone had any luck of using Oracle from .Net on a 64 bit machine, and using the UDT capabilities of Oracle?</p>
<p>I've been able to use an x64 ODP.Net client, but cannot find one with any support for UDTs.</p>
<p>Thanks</p>
<p>Nick</p>
<p>[Edit]
I've posted an answer below. The latest (as of December 2008)... | <p>You need to use 11.1.0.7 release. This has UDT support and works with 32 and 64 bit.</p>
| <p>I've been trying for some time to get the 64-bit edition of Windows Server 2003 to connect to an Oracle 8i instance. It doesn't seem to be possible other than doing it through a 32-bit VM.</p>
<p>Forced upgrading can really suck!</p>
| 8,138 |
<p>I recently bought some SUNLU PLA black filament and was attempting a small print with it and it started to come out in strings and lumps and was incredibly inconsistent. Before this I'd been using some Eryone PLA and those prints were superb, been printing back to back successfully but after using the SUNLU all of m... | <p>This is under extrusion, not delamination. Delamination is the result of the under extrusion.</p>
<p>It typically happens when the wrong filament diameter has been set in the slicer (a larger diameter than used, e.g 2.85 mm instead of 1.75 mm). Another option is that you accidentally put the printer in volumetric pr... | <p>This is under extrusion, not delamination. Delamination is the result of the under extrusion.</p>
<p>It typically happens when the wrong filament diameter has been set in the slicer (a larger diameter than used, e.g 2.85 mm instead of 1.75 mm). Another option is that you accidentally put the printer in volumetric pr... | 1,699 |
<p>So my site uses <a href="http://mjijackson.com/shadowbox/" rel="nofollow noreferrer">shadowbox</a> to do display some dynamic text. Problem is I need the user to be able to copy and paste that text. </p>
<p>Right-clicking and selecting copy works but <kbd>Ctrl</kbd>+<kbd>C</kbd> doesn't (no keyboard shortcuts do)... | <p>The best option is to disable keyboard navigation shortcuts in the shadowbox by setting the "enableKeys" option to false (see <a href="http://mjijackson.com/shadowbox/doc/api.html" rel="nofollow noreferrer">this page</a>).</p>
<p>Alternatively you could do what Robby suggests and modify the shadowbox.js file, <stro... | <p>The solution is to set the enableKeys option to false. However, this doesn't seem to work on an open() call for inline HTML. It does work, however, if you set it in your init() call.</p>
| 7,276 |
<p>How do I use the profiler in Visual Studio 2008?</p>
<p>I know theres a build option in Config Properties -> Linker -> Advanced -> Profile (/PROFILE), however I can't find anything about actauly using it, only articles I was able to find appear to only apply to older versions of Visual Studio (eg most say to goto B... | <p>Microsoft has released stand-alone Profiler for VS 2008 <a href="http://www.microsoft.com/downloads/details.aspx?familyid=fd02c7d6-5306-41f2-a1be-b7dcb74c9c0b&displaylang=en" rel="noreferrer">here</a></p>
| <p>As I understood from reading a few sites, when you use VS 2008 stand alone profiler to create <code>.vsp</code> files, you will need either VS2008 Premium or Ultimate to view <code>.vsp</code> files.</p>
<p>By the way, I installed VS2012 Release candidate which is available for free (trial version?) and I can use ... | 8,689 |
<p>Does Delphi call inherited on overridden procedures if there is no explicit call in the code ie (inherited;), I have the following structure (from super to sub class)</p>
<p>TForm >> TBaseForm >> TAnyOtherForm</p>
<p>All the forms in the project will be derived from TBaseForm, as this will have all the standard se... | <p>No, if you leave the call to inherited away, it will not be called. Otherwise it would not be possible to override a method and totally ommit the parent version of it.</p>
| <p>No. That's the whole point of overriding.</p>
| 7,725 |
<p>I have a .Net compact framework application with a frankly unimpressive UI.</p>
<p>My win32 app uses Dev Express components and looks great, but I can't find anything similar for the compact framework.</p>
<p>Can anyone recommend components that will jazz up my UI?</p>
<p>Does such a thing exist, oram I going to ... | <p><a href="http://www.opennetcf.com/" rel="nofollow noreferrer">OpenNETCF</a> is a large collection of classes, components and controls for the compact framework. I'm not sure that they have anything that'll jazz up your UI, but it'd be worth a look.</p>
| <p>I really like Resco's mobile controls. They are solid and the support is good.</p>
<p>I purchased a few controls from Pocket PC Controls. They are not bad, but if you run into bugs its hit or miss if you hear back from the developer. Basically, it doesn't seem like the components are constantly being updated.</p>
... | 5,650 |
<p>I was just working on fixing up exception handling in a .NET 2.0 app, and I stumbled onto some weird issue with <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.application.threadexception.aspx" rel="nofollow noreferrer">Application.ThreadException</a>.</p>
<p>What I want is to be able to catch... | <p>This question is more usefully phrased and answered here: </p>
<p><a href="https://stackoverflow.com/questions/347502/why-does-the-inner-exception-reach-the-threadexception-handler-and-not-the-actual">Why does the inner exception reach the ThreadException handler and not the actual thrown exception?</a></p>
| <p>According to the MSDN documentation:</p>
<p><em>When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.</em> </p>
<pre><code> Public Overridable Function GetBaseException() As Exception
Dim innerException As Exception = Me.InnerException
... | 8,653 |
<p>I've been having a hard time lately getting the raft off of my ABS prints.</p>
<p>Is that a symptom of either a nozzle or bed that are too hot? Or is there some other factor I should be looking in to?</p>
<p>I have an UP mini that I've modified both the nozzle and bed to customize the temperatures on.</p>
<p>Bed ... | <p>A couple things to consider:</p>
<ul>
<li>Ensure that your build plate is flat and level. An un-parallel HBP could result in the object "welding" to the raft.</li>
<li>Turn down your nozzle temperature. It is likely that the material is hotter than it needs as it is extruding. This results in a slower "cool-down ra... | <p>I haven't got a printer with a heated bed so have only tested this on PLA but I have found editing the G code so the printer cools the nozzle down and then heats it up again gives the raft enough time to cool down so that it peels off easier when the print is finished. </p>
| 300 |
<p>What's the best way to close the loop and have a desktop app "call home" with customer feedback? Right now our code will login to our SMTP server and send me some email.</p>
| <p>The site GetSatisfaction has been an increasingly popular way to get customer feedback.</p>
<p><a href="http://getsatisfaction.com/" rel="nofollow noreferrer">http://getsatisfaction.com/</a></p>
<p>GetSatisfaction is a community based site that builds a community around your application. Users can post questions,... | <p>Personally, I would also POST the information. However, I would send it to a PHP script that would then insert it into a mySQL database. This way, your data can be pre-sorted and pre-categorized for analysis later. It also gives you the potential to track multiple entries by single users.</p>
| 5,034 |
<p>I'm new to the 3D printing world and got my first Ender 3 (with the 32-bit controller board).</p>
<p>I have a problem with every single print. I've upgraded to the newest Marlin firmware, did the mesh leveling then started printing and fix the Z bed option in "Tune - Z bed" during the print (so the first l... | <p>It sounds like your bed is unstable. This is what I had to do with my Tronxy X1, and I fixed it by installing a decent bed stabiliser. Now that I have a stable bed, I only have to re-level it occasionally. However, the Tronxy X1 is a cantilever printer with a single rail for the bed, not an Ender 3.</p>
<p>I would s... | <p>Thanks everybody for their help, but apparently it was a slicer/software/gcode (i don't really know :D) issue...</p>
<p>So i just added this line M420 S1 after the G28 command to my Cura printer settings and now the nozzle height is always at the point i set before, no changing every print.</p>
<p>Hope my solve will... | 1,902 |
<p>How do I create a self signed SSL certificate for an Apache Server to use while testing a web app?</p>
| <blockquote>
<p><strong>How do I create a self-signed SSL
Certificate for testing purposes?</strong></p>
</blockquote>
<p>from <a href="http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#selfcert" rel="noreferrer" title="How do I create a self-signed SSL Certificate for testing purposes?">http://httpd.apache.org/do... | <p>Use OpenSSL (<a href="http://www.openssl.org/" rel="nofollow noreferrer">http://www.openssl.org/</a>)</p>
<p>Here's a tutorial: <a href="http://novosial.org/openssl/self-signed/" rel="nofollow noreferrer">http://novosial.org/openssl/self-signed/</a></p>
<p>Here is the good tutorial to start with: <a href="http://w... | 3,865 |
<p>One of the fun parts of multi-cultural programming is number formats.</p>
<ul>
<li>Americans use 10,000.50</li>
<li>Germans use 10.000,50</li>
<li>French use 10 000,50</li>
</ul>
<p>My first approach would be to take the string, parse it backwards until I encounter a separator and use this as my decimal separator.... | <p>I think the best you can do in this case is to take their input and then show them what you think they meant. If they disagree, show them the format you're expecting and get them to enter it again.</p>
| <p>The difference between 12.345 in French and English is a factor of 1000. If you supply an expected range where max < 1000*min, you can easily guess. </p>
<p>Take for example the height of a person (including babies and children) in mm.</p>
<p>By using a range of 200-3000, an input of 1.800 or 1,800 can unambigu... | 2,269 |
<p>My organization has a form to allow users to update their email address with us.
It's suggested that we have two input boxes for email: the second as an email confirmation.</p>
<p>I always copy/paste my email address when faced with the confirmation.
I'm assuming most of our users are not so savvy.</p>
<p>Regardle... | <p>I would just use one input box. The "Confirm" input is a remnant form the "Confirm Password" method. </p>
<p>With passwords, this is useful because they are usually typed as little circles. So, you can't just look at it to make sure that you typed it correctly. </p>
<p>With a regular text box, you can visually che... | <p>I'd say that this is ok but should only be reserved for forms where the email is essential. If you mistype your email for your flight booking then you have severed the two-way link between yourself and the other party and risk not getting the confirmation number, here on StackOverflow it would only mean your Gravata... | 2,686 |
<p>Why can't you do this and is there are work around?</p>
<p>You get this error.</p>
<p>Msg 2714, Level 16, State 1, Line 13
There is already an object named '#temptable' in the database.</p>
<pre><code>declare @x int
set @x = 1
if (@x = 0)
begin
select 1 as Value into #temptable
end
else
begin
select 2 as... | <p>This is a two-part question and while Kev Fairchild provides a good answer to the second question he totally ignores the first - <em>why is the error produced?</em></p>
<p>The answer lies in the way the preprocessor works. This</p>
<pre><code>SELECT field-list INTO #symbol ...
</code></pre>
<p>is resolved into a ... | <p>I am going to guess that the issue is that you haven't created the #temptable.</p>
<p>Sorry I can't be more detailed but since you haven't even tried to explain what you are seeing you get a less than stellar answer.</p>
| 6,863 |
<p>I've just started using Linq to SQL, and I'm wondering if anyone has any best practices they can share for managing dbml files.</p>
<ul>
<li>How do you keep them up to date with the database?</li>
<li>Do you have a single dbml file for the entire database, or is it split into multiple logical units? </li>
<li>How ... | <p>Have you looked at <a href="http://msdn.microsoft.com/en-us/library/bb386987.aspx" rel="nofollow noreferrer">SqlMetal</a>? It's officially supported, although not promoted too much. You can use it to build dbmls from the commandline - we've used it as part of a db's continous integration updates (make sure you have ... | <p>Here is a link that provides good information about LINQ to SQL best practices</p>
<p><a href="http://www.a2zmenu.com/LINQ/LINQ%20to%20SQL%20Best%20Practice.aspx" rel="nofollow">http://www.a2zmenu.com/LINQ/LINQ%20to%20SQL%20Best%20Practice.aspx</a></p>
| 5,373 |
<p>Since both a <code>Table Scan</code> and a <code>Clustered Index Scan</code> essentially scan all records in the table, why is a Clustered Index Scan supposedly better?</p>
<p>As an example - what's the performance difference between the following when there are many records?:</p>
<pre><code>declare @temp table(
... | <p>In a table without a clustered index (a heap table), data pages are not linked together - so traversing pages requires a <a href="http://msdn.microsoft.com/en-us/library/ms188270.aspx" rel="noreferrer">lookup into the Index Allocation Map</a>.</p>
<p>A clustered table, however, has it's <a href="http://msdn.microso... | <p>A table scan has to examine every single row of the table. The clustered index scan only needs to scan the index. It doesn't scan every record in the table. That's the point, really, of indices.</p>
| 3,930 |
<p>I've been having some bed adhesion problems that I have been trying to solve by leveling the bed. I think that it's pretty level now but when I start a print the lines seem pretty flat. Is this true? I used a feeler gauge to have a 0.2 mm gap between the bed and nozzle, but the center feels as though there's more sp... | <p><strong>No</strong>, the <strong>bed does not look too close to the nozzle</strong>, it could well be that it is <strong>too far</strong> from the nozzle. However, the brim looks okay, but the method you follow is questionable. </p>
<p>Using a feeler gauge of 0.2 mm is larger than the recommended paper method ... | <p>I cannot stress enough how much purple glue stick helps with this exact problem.</p>
<p>I had a cheap XYZ printer that I used nearly half a spool of filament on trying to align and get prints to stick. After ten hours straight of hair pulling and desperation, I smeared some purple glue stick across the build plate ... | 1,173 |
<p>Is there a way to conveniently define a C-like structure in Python? I'm tired of writing stuff like:</p>
<pre><code>class MyStruct():
def __init__(self, field1, field2, field3):
self.field1 = field1
self.field2 = field2
self.field3 = field3
</code></pre>
| <p>Use a <a href="https://docs.python.org/2/library/collections.html#collections.namedtuple" rel="noreferrer">named tuple</a>, which was added to the <a href="http://docs.python.org/library/collections.html" rel="noreferrer">collections module</a> in the standard library in Python 2.6. It's also possible to use Raymond... | <p>I think Python structure dictionary is suitable for this requirement.</p>
<pre class="lang-py prettyprint-override"><code>d = dict{}
d[field1] = field1
d[field2] = field2
d[field2] = field3
</code></pre>
| 5,660 |
<p>How do you get around this Ajax cross site scripting problem on FireFox 3?</p>
| <p>If you're using jQuery it has a callback function to overcome this:</p>
<p><a href="http://docs.jquery.com/Ajax/jQuery.ajax#options" rel="noreferrer">http://docs.jquery.com/Ajax/jQuery.ajax#options</a></p>
<blockquote>
<p>As of jQuery 1.2, you can load JSON
data located on another domain if you
specify a JSO... | <p>Some more details would be nice: which AJAX library are you using, what would you like to achive, how you do it.</p>
<p>For example it can be a cross-domain Ajax request, which is not allowed. In this case use <a href="http://www.json.org/" rel="nofollow noreferrer">JSON</a>.</p>
| 7,432 |
<p>I have several wpf pages with update/delete/add buttons. I want to display to the user messages like "successful delete", etc. How can I best implement this so the message is defined in a single place (similar to an asp.net master page) and I can update this message from anywhere?</p>
| <p>You may want to consider doing a publish/subscribe ("Observer" pattern) -- define a "status changed" event on a base page, and create a custom control that sets up a delegate and event handler to listen for status updates.</p>
<p>Then you could drop the custom control on any page that inherits from the base, and it... | <p>I don't think you have the ASP.Net master pages translated to the <em>WPF Page</em> world just yet.<br>
A workaround till MS gets there, I would probably put a Control at the top of the page (or wherever) that just displays a particular User-level "<a href="http://msdn.microsoft.com/en-us/library/ms171565.aspx" rel=... | 7,284 |
<p>I have a DirectShow graph to render MPEG2/4 movies from a network stream. When I assemble the graph by connecting the pins manually it doesn't render. But when I call Render on the GraphBuilder it renders fine. </p>
<p>Obviously there is some setup step that I'm not performing on some filter in the graph that Graph... | <p>You can watch the graph you created using GraphEdit, a tool from the DirectShow SDK. In GraphEdit, select File->Connect to remote Graph...</p>
<p>In order to find your graph in the list, you have to register it in the running object table:</p>
<pre><code>void AddToRot( IUnknown *pUnkGraph, DWORD *pdwRegister )
{
... | <p>Older versions of DirectX, I belive 9a, but not 9b had a "debug mode" for dshow. It would output logs of debug info into the debug console. </p>
<p>So download an older version, set it to debug. then open up debugview or load graphedt.exe in visual studio to see the debug info.</p>
| 4,748 |
<p>I've recently switched to PETG , and I'm using Cura as slicer and Ender 3 as printer.</p>
<p>I'm printing a model which Cura declares to be <strong>35 g</strong>, but if I weigh the printed model it weighs <strong>23 g</strong>.</p>
<p>I'm printing with just 1 line of skirt, so its weight is negligible on total weig... | <p>The density of the filament can be specified in the material model of the filament in Cura (Preferences -> Configure Cura... -> Materials and click on the material/filament you are using to slice your model for PETG), look at the value behind <em>Density</em>, the PETG filament I use is using 1.28 g/cm³ (<a hr... | <p>The density of the filament can be specified in the material model of the filament in Cura (Preferences -> Configure Cura... -> Materials and click on the material/filament you are using to slice your model for PETG), look at the value behind <em>Density</em>, the PETG filament I use is using 1.28 g/cm³ (<a hr... | 1,923 |
<p>I have been reading through the <a href="http://yosefk.com/c++fqa/" rel="noreferrer">C++ FAQ</a> and was curious about the <a href="http://yosefk.com/c++fqa/friend.html" rel="noreferrer"><code>friend</code></a> declaration. I personally have never used it, however I am interested in exploring the language. </p>
<p>... | <p>Firstly (IMO) don't listen to people who say <code>friend</code> is not useful. It IS useful. In many situations you will have objects with data or functionality that are not intended to be publicly available. This is particularly true of large codebases with many authors who may only be superficially familiar with ... | <p>Friends are also useful for callbacks. You could implement callbacks as static methods</p>
<pre><code>class MyFoo
{
private:
static void callback(void * data, void * clientData);
void localCallback();
...
};
</code></pre>
<p>where <code>callback</code> calls <code>localCallback</code> internally, and t... | 3,809 |
<p>I mean 3D forms like these? In a small scale (height: 1-2 cm, width: 0.5 cm).</p>
<p><a href="https://i.stack.imgur.com/Yd8Cl.png" rel="nofollow noreferrer" title="Detailed 3D form#1"><img src="https://i.stack.imgur.com/Yd8Cl.png" alt="Detailed 3D form#1" title="Detailed 3D form#1"></a></p>
<p><a href="https://i.s... | <p>Best option for something like this would be to use an SLA printer. They can do sharper image detail compared to FDM style printers.</p>
<p>That being said, printing something like this poses its own set of challenges. In order to print a part, some surface needs to be in contact with the built platform, and depend... | <p>You could use something like a Stratsys Objet 30 Pro. </p>
<p>The printer uses layers of liquid deposited on a bed and cured with UV light, instead of extruded plastics. This just means that the level of detail you can achieve is far higher than that typically achieved by a conventional ABS or PLA printer. That bei... | 575 |
<p>Hoping to get some help with something I'm trying to accomplish. Unfortunately, due to my being a noob with 3D modeling in general, I'm coming here for hopefully more direct help.</p>
<pre><code>Env. Details: OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: R... | <p>A wide line works if there is something below it to squeeze the filament against, but if you don't have a full layer below it, it will stay thinner and it will droop. I would not use extreme ratios on overhangs. Still, do a parametric test: a overhang tower (a compact one) at different line widths and layer heights.... | <p>In terms of Cura's model for showing overhangs, I'm nearly sure it's just the ratio - rise over run, or rather run over rise. And indeed that's what makes sense mathematically:</p>
<p>At least some portion of the wall extrusion in layer N+1 needs to sit on top of the corresponding wall extrusion in layer N. For a g... | 1,666 |
<p>I have a list of addresses from a Database for which I'd like to put markers on a Yahoo Map. The <a href="http://developer.yahoo.com/maps/ajax/V3.8/index.html#YMap" rel="nofollow noreferrer"><code>addMarker()</code> method</a> on YMap takes a YGeoPoint, which requires a latitude and longitude. However, Yahoo Maps mu... | <p>You can ask the map object to do the geoCoding, and catch the callback:</p>
<pre><code><script type="text/javascript">
var map = new YMap(document.getElementById('map'));
map.drawZoomAndCenter("Algeria", 17);
map.geoCodeAddress("Cambridge, UK");
YEvent.Capture(map, EventsList.onEndGeoCode, function(geoCode... | <p>If you're working with U.S. addresses, you can use <a href="http://geocoder.us/" rel="nofollow noreferrer">geocoder.us</a>, which has <a href="http://geocoder.us/help/" rel="nofollow noreferrer">APIs</a>.</p>
<p>Also, <em>Google Maps Hacks</em> has a hack, <a href="http://safari.oreilly.com/0596101619/googlemapshks... | 9,925 |
<p>The Add view and the Edit view are often incredibly similar that it is unwarranted to write 2 views. As the app evolves you would be making the same changes to both.</p>
<p>However, there are usually subtle differences. For instance, a field might be read-only once it's been added, and if that field is a DropDownLi... | <p>It's pretty easy really. Let's assume you're editing a blog post.</p>
<p>Here's your 2 actions for new/edit:</p>
<pre><code>public class BlogController : Controller
{
public ActionResult New()
{
var post = new Post();
return View("Edit", post);
}
public ActionResult Edit(int id)
{
... | <p>You can specify a CustomViewData class and pass the parameters here.</p>
<pre><code>
public class MyViewData {
public bool IsReadOnly { get; set; }
public ModelObject MyObject { get; set; }
}
</code></pre>
<p>And both views should implement this ViewData.
As a result you can use provided IsReadOnly propert... | 3,929 |
<p>We have a situation where users are allowed to upload content, and then separately make some changes, then submit a form based on those changes.</p>
<p>This works fine in a single-server, non-failover environment, however we would like some sort of solution for sharing the files between servers that supports failov... | <p>At a former job we had a cluster of web servers with an F5 load balancer in front of them. We had a very similar problem in that our applications allowed users to upload content which might include photo's and such. These were legacy applications and we did not want to edit them to use a database and a SAN solutio... | <p>The best solution for this is usually to provide the shared area on some form of SAN, which will be accessible from all servers and contain failover.</p>
<p>This also has the benefit that you don't have to provide sticky load balancing, the upload can be handled by one server, and the edit by another.</p>
| 4,263 |
<p>So, we have <a href="https://stackoverflow.com/questions/1711/what-is-the-single-most-influential-book-every-programmer-should-read">coding books</a>, <a href="https://stackoverflow.com/questions/5119/what-are-the-best-rss-feeds-for-programmersdevelopers">coding RSS feeds</a>, and <a href="https://stackoverflow.com/... | <p>The venerable <a href="http://www.ddj.com/" rel="noreferrer">Dr. Dobbs Journal</a> is still pretty good. It covers multiple platforms, and mixes some fairly hard-core technical articles with lighter fare (interviews with notables, a "Developer Diaries" column that profiles regular-Joe (and Jane) developers from a ra... | <p>I like Embedded Systems. Even if you don't program for embedded systems, the software articles are excellent. <a href="http://www.embedded.com/" rel="nofollow noreferrer">http://www.embedded.com/</a></p>
| 6,157 |
<p>I am working on an ASP.NET web application, it seems to be working properly when I try to debug it in Visual Studio. However when I emulate heavy load, IIS crashes without any trace -- log entry in the system journal is very generic, "The World Wide Web Publishing service terminated unexpectedly. It has done this 4 ... | <p>Crash dump of <a href="http://blogs.msdn.com/tess/archive/tags/ASP.NET/default.aspx" rel="nofollow noreferrer">asp.net process</a> should give you <a href="http://blogs.msdn.com/tess/pages/net-debugging-demos-information-and-setup-instructions.aspx" rel="nofollow noreferrer">tons of info</a>..If you want to quickly ... | <p>The key is <em>"without any trace"</em>. You need to put your own trace logging in to create some chatter. Then you'll be able to spot where the chatter stops.</p>
| 8,823 |
<p>Given the URL (single line):<br>
<a href="http://test.example.com/dir/subdir/file.html" rel="noreferrer">http://test.example.com/dir/subdir/file.html</a></p>
<p>How can I extract the following parts using regular expressions:</p>
<ol>
<li>The Subdomain (test)</li>
<li>The Domain (example.com)</li>
<li>The path wit... | <blockquote>
<p>A single regex to parse and breakup a
full URL including query parameters
and anchors e.g.</p>
<p><a href="https://www.google.com/dir/1/2/search.html?arg=0-a&arg1=1-b&arg3-c#hash" rel="noreferrer">https://www.google.com/dir/1/2/search.html?arg=0-a&arg1=1-b&arg3-c#hash</a> </p>... | <pre><code>String s = "https://www.thomas-bayer.com/axis2/services/BLZService?wsdl";
String regex = "(^http.?://)(.*?)([/\\?]{1,})(.*)";
System.out.println("1: " + s.replaceAll(regex, "$1"));
System.out.println("2: " + s.replaceAll(regex, "$2"));
System.out.println("3: " + s.replaceAll(regex, "$3"));
System.out.print... | 4,741 |
<p>My company is using CVS as our de-facto standard for source control. However, I've heard a lot of people say that SVN is better.</p>
<p>I know SVN is newer, but other than that, I'm unfamiliar with its benefits.</p>
<p>What I'm looking for is a good, succinct comparison of the two systems, noting any advantages or... | <p>CVS only tracks modification on a file-by-file basis, while SVN tracks a whole commit as a new revision, which means that it is easier to follow the history of your project. Add the fact that all modern source control software use the concept of revision so it is far easier to migrate from SVN than it is from CVS.</... | <p>you might also choose to migrate only the latest code from CVS into SVN and freeze your current CVS repo. this will make migration easier and you might also build your legacy releases in the old CVS repo.</p>
| 2,365 |
<p>I have an Anet A8 with the Anet 1.7 board, Skynet3d v2.3.2, and the stock sensor. I originally had this configuration with the stock extruder, but recently purchased an E3D v6 clone with a Bowden extruder. After installing a new bracket I had printed (<a href="https://www.thingiverse.com/thing:2099577" rel="nofollow... | <p>If you have done major revisions to the printhead by changing to another carriage, it could be that the nozzle in the carriage is not at the exact position as in the previous carriage.</p>
<p>So, have you made sure that the new carriage has the appropriate values so that the nozzle is at (0, 0) when commanded to th... | <p>Do you have eeprom enabled? Because if you do, you can change configuration.h all you want but it's always gonna use the values from eeprom. I advise you to install repetier and change the eeprom values with that. Or maybe you can use the display if you have one.</p>
| 1,517 |
<p>I would like to gauge what solutions other people put in place to get Team System functionality. We all know that Team System can be pricey for some of us. I know they offer a small team edition with five licenses with a MSDN subscription, but what if your team is bigger than five or you don't want to use Team Sys... | <p>I'm stunned that nobody has mentioned the <strong>free</strong> and excellent <a href="http://www.jetbrains.com/teamcity/index.html" rel="noreferrer">TeamCity</a> product from JetBrains. It includes:</p>
<ul>
<li>Continous Integration </li>
<li>Software Build management</li>
<li>Project Management, Monitoring and ... | <p>SVN with the TortoiseSVN add-on makes for a solid and easy to use interface. WinMerge is a great tool to thrown in that mix as well.</p>
| 3,297 |
<p>I want to be able to get an estimate of how much code & static data is used by my C++ program?</p>
<p>Is there a way to find this out by looking at the executable or object files? Or perhaps something I can do at runtime?</p>
<p>Will objdump & readelf help?</p>
| <p>"size" is the traditional tool. "readelf" has a lot of options.</p>
<pre><code>$ size /bin/sh
text data bss dec hex filename
712739 37524 21832 772095 bc7ff /bin/sh
</code></pre>
| <p><code>readelf</code> will indeed help. You can use the <code>-S</code> option; that will show the sizes of all sections. <code>.text</code> is (the bulk of) your executable code. <code>.data</code> and <code>.rodata</code> is your static data. There are other sections too, some of which are used at runtime, others o... | 5,596 |
<p>When I'm working with DataBound controls in ASP.NET 2.0 such as a Repeater, I know the fastest way to retrieve a property of a bound object (instead of using Reflection with the Eval() function) is to cast the DataItem object to the type it is and then use that object natively, like the following:</p>
<pre><code>&l... | <p>I believe you can add something like:</p>
<pre><code><%@ Import Namespace="RootNamespace.SubNamespace1" %>
</code></pre>
<p>At the top of the page.</p>
| <p>What you're looking for is the <a href="http://msdn.microsoft.com/en-us/library/eb44kack(v=VS.80).aspx" rel="nofollow noreferrer" title="MSDN">@Import page directive</a>.</p>
| 4,138 |
<p>I had been happily coding along on a decent sized solution (just over 13k LOC, 5 projects) which utilizes Linq to Sql for it's data access. All of sudden I performed a normal build and I received a sweet, sweet ambiguous message:</p>
<p><strong>Error 1 Build failed due to validation errors in C:\xxx\xxx.dbml. Open ... | <p>TBH, I have had a couple of instances like this where files "seemed to go crazy".. However, upon investigation it has appeared that the files have changed in some way, shape or form.. (e.g. sometimes changes can be made to the file by inadvertantly changing a property somewhere that <em>seems</em> unrelated).</p>
<... | <p>I had the same issue in VS 2010 (build failed due to validation errors in dbml file). I resolved this by viewing the designer view of the dbml file and dragging a table slightly to a different location so that it refreshed the dbml layout etc files. This seemed to do the trick, but was a bit of a weird issue.</p>
| 4,848 |
<p>Is there available any tool for PHP which can be used to generate code for consuming a <a href="http://en.wikipedia.org/wiki/Web_service" rel="noreferrer">web service</a> based on its <a href="http://en.wikipedia.org/wiki/Web_Services_Description_Language" rel="noreferrer">WSDL</a>? Something comparable to clicking ... | <p>In PHP 5 you can use <a href="http://www.php.net/manual/en/ref.soap.php" rel="noreferrer">SoapClient</a> on the WSDL to call the web service functions. <a href="http://www.php.net/manual/en/soapclient.construct.php" rel="noreferrer">For example</a>:</p>
<pre><code>$client = new SoapClient("some.wsdl");
</code></pre... | <p>Well, those features are specific to a tool that you are using for development in those languages.</p>
<p>You wouldn't have those tools if (for example) you were using notepad to write code. So, maybe you should ask the question for the tool you are using.</p>
<p>For PHP: <a href="http://webservices.xml.com/pub/a/... | 2,643 |
<p>On my side job as programmer, I am to write a program in C++ to convert audio files from/to various formats. Probably, this will involve building a simple GUI.</p>
<p>Will it be a great effort to build seperate GUIs for Mac and Windows using Cocoa and WinForms instead of a cross-platform toolkit like Qt or GTK? <br... | <p>If you have the expertise, use native frontends, it'll effectively double the job you have to do for UI but from my experience non-native UI is a little bit clunkier than their native counterparts.</p>
| <p>wxWidgets used standard c++ syntax and preprocessor thus make you easily alter from plain C or C++. And will produce very native look where is appear, be it on GTK, X11, MS-Windows or Mac.</p>
<p>It's mature since 20yrs of 1rst release, has complete documentation with easy navigating, and supported by large communi... | 5,454 |
<p>What is the easiest way to merge XML from two distinct DOM Documents? Is there a way other than using the Canonical <a href="http://support.microsoft.com/kb/311530" rel="nofollow noreferrer">DataReader</a> approach and then messing with the outputted DOM. What I basically want is to AppendChild to XmlElements with... | <p>You can use the XmlDocument.ImportNode method to copy a node from a XmlDocument to another.</p>
| <p>You might be interested in <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.importnode.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.importnode.aspx</a>. But take a close look at the "The following table describes the specific behavior for each ... | 8,189 |
<p>Using Vim I often want to replace a block of code with a block that I just yanked.</p>
<p>But when I delete the block of code that is to be replaced, that block itself goes into the register which erases the block I just yanked. So I've got in the habit of yanking, then inserting, then deleting what I didn't want, ... | <p>To delete something without saving it in a register, you can use the "black hole register":</p>
<pre><code>"_d
</code></pre>
<p>Of course you could also use any of the other registers that don't hold anything you are interested in.</p>
| <p>You can make a simple macro with:
<code>q"_dwq</code></p>
<p>Now to delete the next word without overwriting the register, you can use <code>@d</code></p>
| 7,789 |
<p>Is there any UI library that can be to build both a text user interface (ncurses) and graphical user interface (GTK? QT?) from the same source?
I know that debconf can be used with various frontends, I would like to build something similar but programmable.</p>
| <p>you could write your program to uses ncurses, and then use <a href="http://pdcurses.sourceforge.net/" rel="nofollow noreferrer">PDCurses</a> to convert it to an X11 application - as the readme advertise.</p>
<p>I know it because I've used it as portable curses, though I've never tested its X11 capabilities</p>
| <p>Maybe tcl/tk would provide what you want <a href="http://www.tcl.tk/" rel="nofollow noreferrer">http://www.tcl.tk/</a></p>
<p>Here's the page on interfacing with curses. There is a claim there of integration with ncurses.</p>
<p><a href="http://www2.tcl.tk/2372" rel="nofollow noreferrer">http://www2.tcl.tk/2372</a... | 6,147 |
<p>I'm trying to find the correct names for these 2 "types" of coding expressions in LINQ so that I can refer to them correctly. I want to say that the first is called "Fluent Style"?</p>
<pre><code>var selectVar = arrayVar.Select( (a,i) => new { Line = a });
var selectVar =
from s in arrayVar
select new ... | <ul>
<li>First - calling an extension method.
This style of coding is called "<a href="http://www.martinfowler.com/bliki/FluentInterface.html" rel="nofollow noreferrer">fluent interface</a>" as you mentioned.</li>
<li>Second method is called <a href="http://en.wikipedia.org/wiki/Language_Integrated_Query" rel="nofollo... | <p>The first isn't even really LINQ, it's a lambda expression, with a type invariant object created. </p>
<pre><code>(a) => new { blah = b}
</code></pre>
<p>The second is a LINQ query filling an on the fly class that has a property Line.<br>
There is no hashrocket operator in this one, so this one is just plain o... | 6,813 |
<p>Which files should I include in <code>.gitignore</code> when using <em>Git</em> in conjunction with <em>Xcode</em>?</p>
|
<p>I was previously using the top-voted answer, but it needs a bit of cleanup, so here it is redone for Xcode 4, with some improvements.</p>
<p>I've researched <em>every</em> file in this list, but several of them do not exist in Apple's official Xcode documentation, so I had to go on Apple mailing lists.</p>
<p>Ap... | <blockquote>
<p><em>A Structure of a standerd .gitignore file for Xcode project ></em></p>
</blockquote>
<pre><code>.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectiv... | 7,209 |
<p>When editing XAML in VS2008 SP1, the editor is really slow. devenv process seems to be around at 40% CPU (the machine I’m using at the moment is only dual core, so that’s almost maxing out one core) most of the time. It spikes up a bit more when I switch to another XAML file. I do also have ReSharper installed, but ... | <p>You can speed it up a lot by only viewing the XML view. Tools / Options / Text Editor / XAML / Always open documents in full XAML view (check this box).</p>
| <p>Maybe you can edit the XAML file outside Visual Studio. Use tools like:</p>
<ul>
<li><a href="http://blogs.msdn.com/llobo/archive/2008/08/25/xamlpadx-4-0.aspx" rel="nofollow noreferrer">XamlPadX 4</a></li>
<li><a href="http://www.kaxaml.com/" rel="nofollow noreferrer">Kaxaml</a></li>
</ul>
| 6,004 |
<p>I have only just set up my Anet A6 today. I am trying to print a calibration box, but the print is moving around the bed while trying to print. Any ideas how to fix this? The documentation is very vague.</p>
<p>Basically I am very new to 3D printing. I purchased an Anet A6 and have set it up stock. I am trying to j... | <p>If the printed material moves with the nozzle, you might have several problems at hand, e.g.:</p>
<ul>
<li>adhesion, </li>
<li>nozzle to bed distance and </li>
<li>overall level.</li>
</ul>
<p>Nozzle to bed distance needs to be the thickness of a plain A4 or Letter paper. This needs to be at the same distance (whe... | <p>Chances are, you're not levelled close enough. try levelling your bed when it's heated around 60C (or as high as you can get if your machine's FW won't let it go that high) with a piece of standard printer paper. you should get a bit of resistance, and play around with the paper for a bit, find a happy medium. Try s... | 1,231 |
<p>I originally posted this on Meta StackExchange to judge whether my thoughts fit within SE and have been redirected back to our Meta.</p>
<p>We've received a few questions along the lines of purchasing references since we've opened in Beta. While I personally don't think direct questions about "<em>What is the best ... | <h2>I like the idea of incorporating product reviews into the 3dprinting StackExchange</h2>
<p><strong>Why?</strong></p>
<ol>
<li>It fits the Q&A model of Stack Exchange</li>
<li>Product pre-purchase questions are probably the number 1 question every new user wants to ask and needs to know (<a href="https://3dpri... | <p>I've seen a few questions in the past week or so of people asking questions that would fit under the printer-review or buyer review tags you've suggested. However I don't think they are quite within the scope of the main site. </p>
<p>Specific questions regarding the benefits of one style of printer over another wo... | 33 |
<p>What is the best approach to write <strong>hooks</strong> for <strong>Subversion</strong> in <strong>Windows</strong>? As far as I know, only executable files can be used. So what is the best choice? </p>
<ul>
<li>Plain batch files (very limited but perhaps OK for very simple solutions)</li>
<li>Dedicated compiled ... | <p>I’ve just spent several days procrastinating about exactly this question. There are third party products available and plenty of PERL and Python scripts but I wanted something simple and a language I was familiar with so ended up just writing hooks in a C# console app. It’s very straight forward:</p>
<pre><code>pub... | <p>Depending on the complexity, each situation is different, If I am just simply moving files around, I'll write a quick batch file. If I want to do something more complex Ill normally just skip the scripting part and write a quick c# program that can handle it. </p>
<p>The question then is do you put that c# program ... | 2,711 |
<p>Recently I was talking to a co-worker about C++ and lamented that there was no way to take a string with the name of a class field and extract the field with that name; in other words, it lacks reflection. He gave me a baffled look and asked when anyone would ever need to do such a thing.</p>
<p>Off the top of my ... | <p>I can list following usage for reflection:</p>
<ul>
<li>Late binding</li>
<li>Security (introspect code for security reasons)</li>
<li>Code analysis</li>
<li>Dynamic typing (duck typing is not possible without reflection)</li>
<li>Metaprogramming</li>
</ul>
<p>Some real-world usages of reflection from my personal ... | <p>Writing dispatchers. Twisted uses python's reflective capabilities to dispatch XML-RPC and SOAP calls. RMI uses Java's reflection api for dispatch.</p>
<p>Command line parsing. Building up a config object based on the command line parameters that are passed in.</p>
<p>When writing unit tests, it can be helpful to ... | 7,235 |
<p>I wonder what the best practice for this scenario is:</p>
<p>I have a Sharepoint Site (MOSS2007) with an ASPX Page on it. However, I cannot use any inline source and stuff like Event handlers do not work, because Sharepoint does not allow Server Side Script on ASPX Pages per default.</p>
<p>Two solutions:</p>
<ol... | <p>So in that case I would wrap it up in a feature and deploy it via a solution. This way I think you will avoid the issue you are seeing. This is especially useful if you plan to use this functionality within other sites too. </p>
<p>You can also embed web parts directly in the page, much like you do a WebControl, th... | <p>Well, it's a page that hosts user controls. It's a custom .aspx Page that will be created on the site, specially because I do not want to create WebParts.</p>
<p>It's essentially an application running within Sharepoint, utilizing Lists and other functions, but all the functionality is only useful within the applic... | 6,290 |
<p>When creating a web application, and lets say you have a User object denoting a single user, what do you think is the best way to store that the user has logged in?</p>
<p>Two ways I've thought about have been:</p>
<ul>
<li>Stored the user database id in a session variable</li>
<li>Stored the entire user object in... | <p>I recommend storing the id rather than the object. The downside is that you have to hit the database every time you want to get that user's information. However, unless every millisecond counts in your page, the performance shouldn't be an issue. Here are two advantages:</p>
<ol>
<li><p>If the user's information... | <p>I store the user in the session, usually. The can't-change-until login problem can be solved by replacing the object in the session with a new copy after you've made changes.</p>
| 4,135 |
<p>I've just noticed this Meta post, <a href="https://meta.stackexchange.com/q/364007/280335">Testing three-vote close and reopen on 13 network sites</a> and I wondered whether we should employ it here, and what do other people think?</p>
<p>We are a smallish site, with a smallish number of active users (although it is... | <h2>Yes, we should have a <em>three</em> vote close question review queue</h2>
| <h2>No, we should stay with the <em>five</em> vote close question review queue</h2>
| 79 |
<p>I need advice on how to have my C# console application display text to the user through the standard output while still being able access it later on. The actual feature I would like to implement is to dump the entire output buffer to a text file at the end of program execution.</p>
<p>The workaround I use while I ... | <p>The perfect solution for this is to use <a href="http://logging.apache.org/log4net/" rel="noreferrer">log4net</a> with a console appender and a file appender. There are many other appenders available as well. It also allows you to turn the different appenders off and on at runtime. </p>
| <p>Consider refactoring your application to separate the user-interaction portions from the business logic. In my experience, such a separation is quite beneficial to the structure of your program.</p>
<p>For the particular problem you're trying to solve here, it becomes straightforward for the user-interaction part ... | 8,624 |
<p>I switched to the dvorak keyboard layout about a year ago. I now use <a href="https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard" rel="nofollow noreferrer">dvorak</a> full-time at work and at home.</p>
<p>Recently, I went on vacation to Peru and found myself in quite a conundrum. Internet cafes were qwerty-onl... | <h2>Web</h2>
<p>For your situation of being at a public computer that you cannot switch the keyboard layout on, you can go to this website:
<a href="http://www.dvzine.org/type/DVconverter.html" rel="noreferrer">http://www.dvzine.org/type/DVconverter.html</a></p>
<p>Use this to translate your typing and then use copy ... | <p>I've never used a public computer, but carry a keyboard and(/or, if you are good enough) just change the settings on the machine.</p>
| 3,261 |
<p>Does anyone have any information about using a soldering iron to fix and retouch 3D prints?
On the market, for example, we can find Modifi3D pen. Why has nobody created a simple soldering tip for this use?</p>
<p>I have a TS100 soldering iron which has great temperature control and I think it would be perfect for th... | <p>I have used a standard soldering iron to modify and fix 3D prints in the past. You have to keep some things in mind when doing so:</p>
<ul>
<li>Don't overheat your material. PLA can take a soldering iron of about 230 °C before charring.</li>
<li>Don't use a tip with solder, or you will get grey deposits in the plast... | <p>Cutting materials with a 'hot knife' isn't anything new. There should be a fairly established toolset for working foam. For 3D prints, I prefer to add coatings rather than modify surfaces with a hand held tool after. I do run a drill bit through printed holes though.</p>
| 1,911 |
<p>I want to compress some files (into the <a href="http://en.wikipedia.org/wiki/ZIP_%28file_format%29" rel="nofollow noreferrer">ZIP</a> format) and encrypt them if possible using C#. Is there some way to do this?</p>
<p>Can encryption be done as a part of the compression itself?</p>
| <p>For compression, look at the <a href="http://msdn.microsoft.com/en-us/library/system.io.compression.aspx" rel="nofollow noreferrer"><code>System.IO.Compression</code></a> namespace and for encryption look at <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.aspx" rel="nofollow noreferrer"... | <p>Here is a useful topic:</p>
<p><a href="https://stackoverflow.com/questions/71000/help-in-creating-zip-files-from-net-and-reading-them-from-java">Help in creating Zip files from .Net and reading them from Java</a></p>
<p>System.IO.Packaging namespace gives you useful classes to compress data in zip format and <a h... | 9,652 |
<p>I am looking for a lightweight source control system for use on "hobby" projects with only one person (myself) working on the project. Does anyone have any suggestions? Ideally it should interface with Visual Studio either naively or through another plug-in, outside of that, anything that works would be nice to be r... | <p>You can use <a href="http://www.assembla.com/home" rel="nofollow noreferrer">assembla.com</a> to host your project. They offer subversion, git and mercurial hosting. I personally use their subversion hosting for a free and private one-man project. As an added bonus, you also get a wiki and a ticketing system. Which ... | <p>i will never use SVN again for a personal project - ya its great compared to CVS, but isn't even in the same class as the modern breed of distributed version control systems. GIT has been mentioned already but a) it has shaky windows support b) complicated learning curve. I now use BZR which "just works".</p>
<p>... | 3,753 |
<p>What are the pros / cons of using <code>pthread_cond_wait</code> or using a semaphore ?
I am waiting for a state change like this :</p>
<pre><code>pthread_mutex_lock(&cam->video_lock);
while(cam->status == WAIT_DISPLAY) {
pthread_cond_wait(&cam->video_cond, &cam->video_lock);
}
pthread_m... | <p>A semaphore is suited cleanly to a producer-consumer model, although it has other uses. Your program logic is responsible for ensuring that the right number of posts are made for the number of waits. If you post a semaphore and nobody is waiting on it yet, then when they do wait they continue immediately. If your pr... | <p>In your second snippet, you're getting the lock multitude of times, never releasing it.</p>
<p>In general, the state you're waintin on can be completely expressed by a semaphore, then you can use just that. A lock structure is smaller in size, and it requires less atomic operations to check/set/release.</p>
<p>Ot... | 9,624 |
<p>I've noticed a lot of sites, SO included, use XHTML as their mark-up language and then fail to adhere to the spec. Just browsing the source for SO there are missing closing tags for paragraphs, invalid elements, etc.</p>
<p>So should tools (and developers) use the XHTML doctype if they are going to produce invalid ... | <p>There are <a href="https://validator.w3.org/docs/why.html" rel="nofollow noreferrer">many reasons</a> to use valid markup. My favorite is that it allows you to use validation as a form of regression testing, preventing the markup equivalent of "delta rot" from leading to real rendering problems once the e... | <p>It depends. I had that <a href="http://www.stum.de/2008/02/29/valid-xhtml-and-youtube-embedding/" rel="nofollow noreferrer">issue with my blog</a> where a YouTube video caused invalid XHTML, but it rendered fine. On the other hand, I have a "Valid XHTML" link, and a combination of a "Valid XHTML" claim and invalid X... | 2,557 |
<p>Is there a way of getting the process id of my C++ application? I am using the Carbon framework, but not Cocoa…</p>
| <p>can you use the getpid() function found in unistd.h ?</p>
<p><a href="https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getpid.2.html" rel="nofollow noreferrer">osx reference</a></p>
| <p>GetProcessPID is what you need. This takes a ProcessSerialNumber, which you can obtain from GetCurrentProcess.</p>
| 6,305 |
<p>I keep reading about people who are "test infected", meaning that they don't just "get" TDD but also can't live without it. They've "had the makeover" as it were. The question is, how do I get like that?</p>
| <p>Part of the point of being "test infected" is that you've used TDD enough and seen the successes enough that <strong>you don't want to code without it</strong>. Once you've gone through a cycle of writing tests first, then coding and refactoring and seeing your bug counts go down and your code get better as a result... | <p>One word, practice! There is some overhead with doing TDD and the way to overcome it is to practice and make sure you are using tools to help the process. You need to learn the tools like the back of your hand. Once you learn the tools to go along with the process you are learning, then it will click and you will... | 6,995 |
<p>I've always been intrigued by Map Routing, but I've never found any good introductory (or even advanced!) level tutorials on it. Does anybody have any pointers, hints, etc?</p>
<p><strong>Update:</strong> I'm primarily looking for pointers as to how a map system is implemented (data structures, algorithms, etc).</p... | <p>Take a look at the <a href="http://www.openstreetmap.org/" rel="noreferrer">open street map project</a> to see how this sort of thing is being tackled in a truely free software project using only user supplied and licensed data and have a <a href="http://wiki.openstreetmap.org/index.php/Main_Page" rel="noreferrer">w... | <p>Another thought occurs to me regarding the cost of each traversal, but would increase the time and processing power required to compute. </p>
<p><strong>Example:</strong> There are 3 ways I can take (where I live) to go from point A to B, according to the GoogleMaps. Garmin units offer each of these 3 paths in th... | 2,493 |
<p>All my prints come out about 1 mm too short in the Z dimension. So for example a 20 mm cube comes out 19 mm high. A 10 mm cube comes out 9 mm high. The X and Y dimensions are fine. There's a little bit of visible elephant's foot at the bottom, so I assume whatever is happening is in the first couple of layers. The p... | <p>Do you have any “slop” on the right side (non motor) of the gantry?</p>
<p>I’ve noticed that my gantry will settle on the right side and lag behind the motor driven - ever so slightly - when it starts to drive up. It will, after that first lag, move fine for the rest of the time. Z axis travel seems barely affected ... | <p>I have the exact same issue on my Ender 3 V2, perfect bed level using a dial gauge,
perfect first layer test prints (printing 9 squares all 1 layer high).</p>
<p>I can only get rid of it two ways:</p>
<ol>
<li>Using a Raft as you have said (annoying).</li>
<li>Adjusting the Z-height Just exactly as the 1st layer fin... | 1,701 |
<p>I have a printer with a 0.1 mm typical layer thickness. Of course I can choose some different sizes in Cura or other slicing software, but most prints on this machine will be .1mm. In my (admittedly limited) experience thus far, the 0.1 mm seems typical for other printers, too.</p>
<p>I want to get a sense of just ... | <p>I'm not sure exactly what you mean by your comment to Davo's answer, but with respect to your use of a sheet of paper reference, it seems like you can still use <em>80 gsm</em> paper as a reference for 0.1 mm layers.</p>
<p>From <a href="http://www.printware.co.uk/Blog/311/Paper-Sizes-Explained.html" rel="nofo... | <p>IMO, better way for the thickness visualization is the <a href="https://en.wikipedia.org/wiki/Feeler_gauge" rel="nofollow noreferrer">feeler gauge</a>. Also it can be successfully used for the calibration of gap between the nozzle and the hotbed (instead paper)</p>
| 993 |
<p>I am currently working on a project that is moving from .NET 2.0 to 3.5 across the board.</p>
<p>I am well aware that 3.5 is basically a set of added functionality (libraries, if you will) on top of what 2.0 offers.</p>
<p>Are there any gotchas that I might hit by simply re-targeting the compiler to 3.5?</p>
| <p>This isn't a gotcha, it's more of a heads up. .NET v3.0 and v3.5 are not new CLRs but simply an added set up assemblies, compilers, resources etc...</p>
<p><strong>Both .NET v3.0 AND v3.5 use the v2.0 CLR.</strong> Because of this you won't be able to say set an IIS App Pool to use a v3.5 CLR...cause it doesn't exi... | <p>Nope</p>
<p>3.5 is completely compatible with 2.0, not the other way around of course</p>
| 8,168 |
<p>I have a scenario where I need to make a call to a telephone(landline/mobile) or send SMS to a particular set of users only using ASP.NET and C#. The web application is not a mobile application.</p>
<p>How do I go about doing these? What typically would be the hardware requirements? I would be <strong>extremely gr... | <p>Most carriers provide an email address that you can send text messages to — for example, with Verizon, you can send an email to <em>phonenumber@vtext.com</em> and it will show up as a text message to that number.</p>
<p><a href="http://en.wikipedia.org/wiki/SMS_gateway#Carrier-provided_Email_or_Web_to_SMS_gat... | <p>Via <a href="http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=20" rel="nofollow noreferrer">WebServiceX</a>, you can send SMS messages anywhere in the world. For phone calls I'd use <a href="http://www.codeproject.com/KB/IP/AsteriskIAXClientWrapper.aspx" rel="nofollow noreferrer">Asterisk</a>.</p>
| 6,714 |
<p>I was considering printing some pieces for my irrigation system, like tube connectors and such. I am aware that PLA is hydrophilic so I was wondering with what kind of product I could coat the pieces, non-toxicity is a requirement because it will water edible greens.</p>
<p>So, what kind of non-toxic product can I ... | <p>Before worrying too much about the hydrophilic properties of PLA, it might be worthwhile to test a fitting.</p>
<p>First, print a fitting and see that the freshly made print is strong enough to carry the pressure of the water, and the compression force of hose clamp you may need to connect the stiff irrigation hose... | <p>PLA will biodegrade over time. ABS would last longer, and stand up to higher temps.</p>
| 887 |
<p>I'm using TinyMCE in an ASP.Net project, and I need a spell check. The only TinyMCE plugins I've found use PHP on the server side, and I guess I could just break down and install PHP on my server and do that, but quite frankly, what a pain. I don't want to do that.</p>
<p>As it turns out, Firefox's built-in spell c... | <p>TinyMCE only goes out of its way to disable spell-checking when you don't specify the <code>gecko_spellcheck</code> option (i verified this with their example code). Might want to double-check your <code>tinyMCE.init()</code> call - it should look something like this:</p>
<pre><code>tinyMCE.init({
mode : "texta... | <p>I know at least <a href="http://developer.yahoo.com/yui/editor/" rel="nofollow noreferrer">yahoo!'s Rich Text Editor</a> will let you use the included spell checker in FireFox.</p>
<p>I also tested FCKeditor, but that requires the users to install additional plugins on their computer.</p>
| 4,353 |
<p>How can I go about hosting flash content inside a WPF form and still use transparency/alpha on my WPF window? Hosting a WinForms flash controls does not allow this.</p>
| <p>Unless the control you use to display the Flash content is built in WPF, you will run in to these "airspace" issues. Every display technology from Win32 to WinForms used HWNDs "under the hood", but WPF uses DirectX. The Window Manager in Windows however, still only understands HWNDs, so WPF apps ... | <p>Just have been struggling with same problem of how to upload & Make WPF transparent with ability of displaying Flash, because if you enable on your MainWindow "Allow transparency" Flash will not show once the application will run.</p>
<p><strong>1)</strong> I used WebBrowser Control to play Flash(.swf) files. T... | 9,273 |
<p>I will be creating a small tube styled piece to use as a junction between two pieces of plastic. The idea is to reattach the two pieces and provide strength so they don't break apart again. I plan on using PLA.</p>
<p>My question is, will superglue (cyanoacrylate) work best for this or are there better choices for a... | <p>PLA is a nice one, and gluing has been a topic on some of our most favorite maker's channels. For example Stefan from CNC kitchen (<a href="https://www.youtube.com/watch?v=JSff8OMRHtw" rel="nofollow noreferrer">this video</a>) and Joel the 3DPrinting Nerd (<a href="https://www.youtube.com/watch?v=s1q2D_pK0BE" rel="n... | <p><a href="https://www.3dgloop.com/shop/pla-gloop" rel="nofollow noreferrer">PLA Gloop</a> is dedicated glue for PLA. It contains chloroform, so be careful.</p>
<ul>
<li><a href="https://www.youtube.com/watch?v=gTtW_NXFMCY" rel="nofollow noreferrer">3D Gloop! // 3D Printing Adhesive Spotlight</a></li>
<li><a href="htt... | 1,011 |
<p>How can I use the nifty JavaScript date and time widgets that the default admin uses with my custom view?</p>
<p>I have looked through <a href="https://docs.djangoproject.com/en/dev/topics/forms/" rel="noreferrer">the Django forms documentation</a>, and it briefly mentions django.contrib.admin.widgets, but I don't ... | <p>The growing complexity of this answer over time, and the many hacks required, probably ought to caution you against doing this at all. It's relying on undocumented internal implementation details of the admin, is likely to break again in future versions of Django, and is no easier to implement than just finding anot... | <p>In Django 10.
myproject/urls.py:
at the beginning of urlpatterns</p>
<pre><code> from django.views.i18n import JavaScriptCatalog
urlpatterns = [
url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
.
.
.]
</code></pre>
<p>In my template.html:</p>
<pre><code>{% load staticfiles %}
... | 5,950 |
<p>I completely understand the concept of expression trees, but I am having a hard time trying to find situations in which they are useful. Is there a specific instance in which expression trees can be applied? Or is it only useful as a transport mechanism for code? I feel like I am missing something here. Thanks!</p>
| <blockquote>
<p>Or is it only useful as a transport mechanism for code?</p>
</blockquote>
<p>It's useful as an <em>execution mechanism</em> for code. Using the <a href="http://en.wikipedia.org/wiki/Interpreter_pattern" rel="noreferrer">interpreter pattern</a>, expression trees can directly be interpreted. This is us... | <p>Expression trees are useful when you need to access function logic in order to alter or reapply it in some way.</p>
<p>Linq to SQL is a good example:</p>
<pre><code>//a linq to sql statement
var recs (
from rec in LinqDataContext.Table
where rec.IntField > 5
select rec );
</code></pre>
<p>If we did... | 4,736 |
<p>I have the following query:</p>
<pre><code>select column_name, count(column_name)
from table
group by column_name
having count(column_name) > 1;
</code></pre>
<p>What would be the difference if I replaced all calls to <code>count(column_name)</code> to <code>count(*)</code>?</p>
<p>This question was inspired b... | <p><code>count(*)</code> counts NULLs and <code>count(column)</code> does not</p>
<p>[edit] added this code so that people can run it</p>
<pre><code>create table #bla(id int,id2 int)
insert #bla values(null,null)
insert #bla values(1,null)
insert #bla values(null,1)
insert #bla values(1,null)
insert #bla values(null,... | <p>It is best to use</p>
<pre><code>Count(1) in place of column name or *
</code></pre>
<p>to count the number of rows in a table, it is faster than any format because it never go to check the column name into table exists or not</p>
| 8,383 |
<p>What's the best way to asynchronously load an BitmapImage in C# using WPF? </p>
| <p>I was just looking into this and had to throw in my two cents, though a few years after the original post (just in case any one else comes looking for this same thing I was looking into). </p>
<p>I have an <strong>Image</strong> control that needs to have it's image loaded in the background using a <strong>Stream</... | <p>Use or extend System.ComponentModel.BackgroundWorker:<br>
<a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx</a></p>
<p>Personally, I find this to be the easiest w... | 5,736 |
<p>We are looking for a way to automate windows forms for acceptance testing. Our requirements are:</p>
<ul>
<li><strong>Must be usable by non-developers</strong> (ie: people with no development environment installed)</li>
<li>Must have a recorder</li>
<li>Must support third-party controls</li>
<li>Must have basic fun... | <blockquote>
<p>Must be usable by non-developers</p>
</blockquote>
<p>Any not-web test automation tool will need either dev`s well-known ide (Eclipse etc.) or test tool ide. SilkTest, TestComplete etc. will also make u to write some code.</p>
<p>U can separate work between devs and testers using tool for creating "... | <p>The Vermont HighTest:
<a href="http://www.vtsoft.com/vcsproducts/index.html" rel="nofollow noreferrer">http://www.vtsoft.com/vcsproducts/index.html</a></p>
<p>The 30 day trial looked pretty good!</p>
| 9,758 |
<p>Is it ready for that?</p>
<p>I've been playing with it for a short amount of time and it seems quite reasonable. Is anyone using it for live sites?</p>
<p>any issues to be aware of?</p>
| <p>Well, <a href="http://stackoverflow.com">stackoverflow.com</a> is.</p>
| <p>Stackoverflow uses ASP.Net MVC. Seems to be doing pretty well here from my experience with the site.</p>
| 9,394 |
<p>I have a small JS function that does Ajax for me and another like it that adds in POST data to the request. With Ajax being such a big topic with so many libraries about it, what am I missing from my function, is it insecure or something else worrying?</p>
<pre><code>function loadPage(pagePath, displayElement)
{
... | <p>I strongly recommend you not roll your own Ajax code. Instead, use a framework such as Prototype, Dojo, or any of the others. They've taken care of handling all the ReadyStates you're not handling (2 means it's been sent, 3 means it's in process, etc.), and they should escape the reponse you're getting so you don't ... | <p>If you really want to see what you are missing, read the jQuery or Prototype source code for their ajax routines. If there are bug numbers in the comments, look those up as well.</p>
| 5,471 |
<p>I thought that I had the latest CTP of PowerShell 2 but when I try the command:</p>
<p><code>invoke-expression –computername Server01 –command 'get-process PowerShell'</code></p>
<p>I get an error message:<br>
<strong>A parameter cannot be found that matches parameter name 'computername'.</strong></p>
<p>So the q... | <p><code>$host.version.tostring()</code> will return the version number.</p>
<p>RTM of v1 is 1.0.0.0</p>
<p>Couldn't honestly tell you what the latest version of the previews are because I haven't had a chance to play yet.</p>
| <p>I'm guessing that this is a change to the cmdlet made during the configuration process Configure-Wsman.ps1. I don't have an environment setup to test right now, but I'm guessing something went wrong with the configuration. I can verify that on XP the parameter is not available (duh). I'd assume that you will find... | 3,352 |
<p>I would like to create an SSL connection for generic TCP communication. I think I figured out how to do it in the code, using the info here: <a href="http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.net.security.ssls... | <p>I haven't found a <em>simple</em> way to do this yet, but I found <a href="http://www.herongyang.com/crypto/openssl_crt.html" rel="nofollow noreferrer">this site</a> helpful a few months back.</p>
<p>O'Reilly also published a book called Network Security Hacks (available on Safari) that has a section starting at Ha... | <p>For anybody else attempting this the pkcs12 certificate created as detailed here <a href="https://stackoverflow.com/questions/440762/openssl-command-line-troubles">openssl question</a> and using the X509Certificate2.CreateFromCertFile method gets past the private key problem. Note I used openssl with cygwin on Windo... | 4,114 |
<p>I wondered if anyone can give an example of a professional use of RSS/Atom feeds in a company product. Does anyone use feeds for other things than updating news?</p>
<p>For example, did you create a product that gives results as RSS/Atom feeds? Like price listings or current inventory, or maybe dates of training le... | <p>Some of my team's new systems generate RSS feeds that the developers syndicate.
These feeds push out events that interest the developers at certain times and the information is controlled using different loggers. Thus when debugging you can get the debugging feed, when you want to see completed transactions you go t... | <p>I have seen RSS used to syndicate gas prices from a service for a specific zip code.</p>
| 3,691 |
<p>I understand how JS is run and I think I understand most of the DOM but I've no idea about animation. Does anybody here know of a good guide that can explain to me how it's done in Javascript?</p>
<p>In addition, should I even consider Javascript for animation? Should I instead be looking to learn flash?</p>
| <p>Avoid flash, its a horrible requirement, uncrawlable by Google, unsopported by a bunch of browsers and systems (eg iPhone) and most importantly: it forces you to reinvent web standards (e.g. scroll bars and whatnot), Javascript on the other hand is easier to maintain and code for in the noscript case.</p>
<p>try <a... | <p>If you aren't concerned with IE support, you could also try experimenting with the canvas element:</p>
<p>MOZILLA DEVELOPER NETWORK <a href="https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_animations" rel="nofollow noreferrer">Basic animations</a></p>
| 3,130 |
<p>Although I'm specifically interested in web application information, I would also be somewhat curious about desktop application development as well. This question is driven by my work on my personal website as well as my job, where I have developed a few features, but left it to others to integrate into the look and... | <p>Usually, each operating System has user Interface Guidelines. For Windows, have a <a href="http://blogs.msdn.com/acoat/archive/2006/09/27/773148.aspx" rel="nofollow noreferrer">look here</a>. (Edit: The links in that post are broken. But a Search for "<a href="http://search.msdn.microsoft.com/Default.aspx?query... | <p>As for desktop applications: Whatever you do, do not use hand-picked colors. Stick with the named system colors such as "Window Background", "Menu Text", etc. Otherwise, people relying on OS accessibility features will be locked with your color choices (unable to choose a high-contrast theme, for instance) and to pe... | 2,721 |
<p>I want our team to develop against local instances of an Oracle database. With MS SQL, I can use SQL Express Edition. What are my options?</p>
| <p>Oracle has an express edition as well. I believe it is more limited though (IIRC, you can only have one database on an instance)</p>
<p><a href="http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html" rel="noreferrer">Oracle XE</a></p>
| <p>I don't recommend Oracle XE. My co-workers and I have been doing a project in Oracle and got severely tripped up after trying to use XE for our local development instances. The database worked fine until we started running local stress tests, at which point it started dropping connections.</p>
<p>I don't know whe... | 4,558 |
<p>I'm having some inheritance issues as I've got a group of inter-related abstract classes that need to all be overridden together to create a client implementation. Ideally I would like to do something like the following:</p>
<pre><code>abstract class Animal
{
public Leg GetLeg() {...}
}
abstract class Leg { }
... | <p>The short answer is that GetLeg is invariant in its return type. The long answer can be found here: <a href="http://blogs.msdn.com/ericlippert/archive/2007/10/16/covariance-and-contravariance-in-c-part-one.aspx" rel="noreferrer">Covariance and contravariance</a></p>
<p>I'd like to add that while inheritance is usua... | <p>Right, I understand that I can just cast, but that means the client has to know that Dogs have DogLegs. What I'm wondering is if there are technical reasons why this isn't possible, given that an implicit conversion exists.</p>
| 6,913 |
<p>When launching a process from Java, both stderr and stdout can block on output if I don't read from the pipes. Currently I have a thread that pro-actively reads from one and the main thread blocks on the other.</p>
<p>Is there an easy way to join the two streams or otherwise cause the subprocess to continue while ... | <p>Set the redirectErrorStream property on ProcessBuilder to send stderr output to stdout:</p>
<pre><code>ProcessBuilder builder = new ProcessBuilder(command);
builder.redirectErrorStream(true);
</code></pre>
<p>You should then create a thread to deal with the process stream, something like the following:</p>
<pre><... | <p>Just have two threads, one reading from stdout, one from stderr?</p>
| 8,946 |
<p>I'm trying to use the following code but it's returning the wrong day of month.</p>
<pre><code>Calendar cal = Calendar.getInstance();
cal.setTime(sampleDay.getTime());
cal.set(Calendar.MONTH, sampleDay.get(Calendar.MONTH)+1);
cal.set(Calendar.DAY_OF_MONTH, 0);
return cal.getTime();
</code></pre>
| <p>Get the number of days for this month:</p>
<p><pre><code>
Calendar cal = Calendar.getInstance();
cal.setTime(sampleDay.getTime());
int noOfLastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
</pre></code></p>
<p>Set the Calendar to the last day of this month:</p>
<p><pre><code>
Calendar cal = Calendar.getInst... | <p>I think this should work nicely:</p>
<pre><code>Dim MyDate As Date = #11/14/2012# 'This is just an example date
MyDate = MyDate.AddDays(DateTime.DaysInMonth(MyDate.Year, MyDate.Month) - MyDate.Day)
</code></pre>
| 9,800 |
<p>I've been using Emacs's sql interactive mode to talk to the MySQL db server and gotten to enjoy it. A developer has set up another db on a new non-default port number but I don't know how to access it using sql-mysql.</p>
<p>How do I specify a port number when I'm trying to connect to a database?</p>
<p>It would b... | <p>After digging through the sql.el file, I found a variable that allows me to specify a port when I try to create a connection.</p>
<p>This option was added GNU Emacs 24.1.</p>
<blockquote>
<p><strong>sql-mysql-login-params</strong></p>
<p>List of login parameters needed to connect to MySQL.</p>
</blockquote>
<p>I add... | <pre><code>(setq sql-mysql-options (list "-P <port number>"))
</code></pre>
| 3,369 |
<p>I've just built my son's A6 and have connected all cables apart from the last power cables. The mainboard says hotbed line and extruder line but the cable says heatbed.</p>
<p>The cables are two red which are crimped together and two black crimped together.</p>
<p>All of the videos online show a different mainboar... | <p>The manual appears to be available here, <a href="https://www.elektor.com/amfile/file/download/file/1606/product/8457/&usg=AOvVaw3bQeEWg--MsnW9KbsTKc_c" rel="nofollow noreferrer">Installation Instruction_Anet A6 3D Printer - Elektor</a></p>
<p>However, according to <a href="https://www.thingiverse.com/groups/ane... | <p>Thanx for the help, got it running now.
The board in the pic is the older version, my problem was the wires for the extruder had been cut really short for some reason and not labled.</p>
| 1,455 |
<p>I would like to be able to embed a command line interpreter inside a dockable window in Visual Studio. Is there any nice way to do this?</p>
| <p>See the <a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=VSCmdShell" rel="noreferrer">VS Command shell</a> project</p>
| <p>Checkout <a href="https://marketplace.visualstudio.com/items?itemName=MadsKristensen.OpenCommandLine" rel="nofollow noreferrer">Open Command Line</a> by Mads Kristensen. <strong>note</strong> it doesn't really "embed" the shell in VS, rather it adds a keyboard shortcut to open the shell at the project directory</p>
... | 8,247 |
<p>I'm trying to fetch some HTML from various blogs and have noticed that different providers use the same tag in different ways.</p>
<p>For example, here are two major providers that use the meta name generator tag differently:</p>
<ul>
<li>Blogger: <code><meta content='blogger' name='generator'/></code> (cont... | <p>The answer is: <strong>don't use regular expressions</strong>.</p>
<p>Seriously. Use a SGML parser, or an XML parser if you happen to know it's valid XML (probably almost never true). You will absolutely screw up and waste tons of time trying to get it right. Just use what's already available.</p>
| <p>Ok, since you are looking for language-agnostic then you can try a REGEX like <code>/<meta\s.*content=.*>/</code> and take the result from that and parse out the specific values that you are looking for. I'm by no means a REGEX expert so there is probably a better way but in using the tool at <a href="http://w... | 5,148 |
<p>I purchased a (very) low tier printer a while back, and now I am looking to start upgrading. First on my list is to upgrade the controller<sup>1)</sup>.</p>
<p>My initial plan was to upgrade to an Arduino Mega with a RAMPS 1.4 running Marlin, but as I started to try to find a RAMPS 1.4 board I started questioning m... | <p>If you own a Raspberry Pi , you may first want to try Klipper firmware. This firmware does the heavy lifting on the RPi itself and sends commands to the printer board via USB. </p>
<p>My Ender 3 pro works much better with this firmware. </p>
| <p>As per <a href="https://reprap.org/wiki/RAMPS_1.6" rel="nofollow noreferrer">https://reprap.org/wiki/RAMPS_1.6</a>,</p>
<blockquote>
<p>The RAMPS 1.6 is the second RAMPS iteration released by BIQU/BIGTREETECH. It replaces the original green power connector with a pair of screw terminals, adds a larger heatsink over ... | 1,587 |
<p>I have been in both situations: </p>
<ul>
<li>Creating too many custom Exceptions</li>
<li>Using too many general Exception class</li>
</ul>
<p>In both cases the project started OK but soon became an overhead to maintain (and refactor).</p>
<p>So what is the best practice regarding the creation of your own Except... | <p><a href="http://www.javaspecialists.eu/" rel="noreferrer">The Java Specialists</a> wrote a post about <a href="http://www.javaspecialists.eu/archive/Issue162.html" rel="noreferrer">Exceptions in Java</a>, and in it they list a few "best practices" for creating Exceptions, summarized below:</p>
<ul>
<li><p>Don't Wri... | <h3>Don't eat exceptions, throw them <a href="https://stackoverflow.com/a/921583/1097600">https://stackoverflow.com/a/921583/1097600</a></h3>
<p>Avoid creating your own exception. Use the below ones that are already there.</p>
<pre><code>IllegalStateException
UnsupportedOperationException
IllegalArgumentException
NoS... | 4,662 |
<p>C# doesn't require you to specify a generic type parameter if the compiler can infer it, for instance:</p>
<pre><code>List<int> myInts = new List<int> {0,1,1,
2,3,5,8,13,21,34,55,89,144,233,377,
610,987,1597,2584,4181,6765};
//this statement is clunky
List<string> myStrings = myInts.
... | <p>Actually, your question isn't bad. I've been toying with a generic programming language for last few years and although I've never come around to actually develop it (and probably never will), I've thought a lot about generic type inference and one of my top priorities has always been to allow the construction of cl... | <p>Thanks Konrad, that's a good response (+1), but just to expand on it.</p>
<p>Let's pretend that C# has an explicit constructor function:</p>
<pre><code>//your example
var x = new Foo( 1 );
//becomes
var x = Foo.ctor( 1 );
//your problem is valid because this would be
var x = Foo<T>.ctor<int>( 1 );
//... | 6,753 |
<p>I use <a href="http://rsync.samba.org/" rel="nofollow noreferrer">rsync</a> to synchronize files to Windows clients in a server agnostic way. What methods are available to send the progress of rsync to the parent process for display in a gui progress bar?</p>
<p>I imagine two or three choices exist. (1) Watch STDOU... | <p>For this type of tasks, I use my own <a href="http://www.autoitscript.com/autoit3/" rel="nofollow noreferrer">AutoIt</a> script (freeware, Windows only). The script redirects the standard output into a graphical window, displaying it with the ability to scroll back, etc (very useful in long processes like XCOPYs / P... | <p>Check out <a href="http://www.download.com/DeltaCopy/3000-2242_4-10471616.html" rel="nofollow noreferrer">DeltaCopy</a>. It is a Windows GUI for rsync.</p>
| 2,955 |
<p>I have an SSIS Package that sets some variable data from a SQL Server Package Configuration Table. (Selecting the "Specify configuration setings directly" option)</p>
<p>This works well when I'm using the Database connection that I specified when developing the package. However when I run it on a server (64 bit) in... | <p>The only way I was able to do this was to use Windows Environment Variables. You can specify things like connection strings and user preferences in environment variables, and then pick up those environment variables from your SSIS Task.</p>
| <p>We want to keep our package configs in a database table, we know it gets backuped with our other data and we know where to find it. Just a preference.</p>
<p>I have found that to get this to work I can use an environment variable configuration to set the connection string of the connection manager that I am reading... | 5,972 |
<p>I'm considering moving a number of small client sites to an unmanaged VPS hosting provider. I haven't decided which one yet, but my understanding is that they'll give me a base OS install (I'd prefer Debian or Ubuntu), an IP address, a root account, SSH, and that's about it.</p>
<p>Ideally, I would like to create a... | <p>Quick Answer: <a href="http://www.riastats.com" rel="nofollow noreferrer">www.riastats.com</a></p>
<p>This site compares the different RIA plugins using graphical charts and graphs.</p>
<p>It gets its data from small snippets of javascripts running on sites accross the web (approx 400,000 last time I looked)</p>
... | <p>The larger question is how many users will your site lose if implemented in Silverlight. And, it very much depends on your audience.</p>
<p>If you're running a site about the joys of Linux kernel hacking or the virtues of Internet security, you'll probably lose a significant chunk of your audience. If you're runnin... | 8,495 |
<p>Right now I'm working with an ASP.NET website that automatically generates images and stores them in a temporary folder. When working on my local system these go going into a temporary folder that gets picked up by Visual Source Safe which then wants to check them in. As such, I am wondering if there is a way to jus... | <p>I think you've found one of the main reasons MS went back to projects in VS2008 and in MVC.</p>
<p>It's been a long time since I've used VSS (mainly because it's really out of date now), but most source providers let you exclude files and folders as a setting of the provider, rather than the project under control.<... | <p>I'm not sure if this is an option for you, but if you exclude your temporary folder from VSS (delete the folder inside VSS using the VSS UI), the files that go into it should not get "picked up" again.</p>
| 6,310 |
<p>What's going on here?</p>
<p>printf.sh:</p>
<pre><code>#! /bin/sh
NAME="George W. Bush"
printf "Hello, %s\n" $NAME
</code></pre>
<p>Command line session:</p>
<pre><code>$ ./printf.sh
Hello, George
Hello, W.
Hello, Bush
</code></pre>
<p>UPDATE: <code>printf "Hello, %s\n" "$NAME"</code> works. For why I'm not usi... | <p>Your NAME variable is being substituted like this:</p>
<pre><code>printf "Hello, %s\n" George W. Bush
</code></pre>
<p>Use this:</p>
<pre><code>#! /bin/sh
NAME="George W. Bush"
printf "Hello, %s\n" "$NAME"
</code></pre>
| <p>If you want all of those words to be printed out on their own, use <strong>print</strong> instead of <strong>printf</strong> </p>
<p><strong>printf</strong> takes the formatting specification and applies it to each argument that you pass in. Since you have three arguments {George, W., Bush}, it outputs the string t... | 6,346 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.