instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I've Googled this in various ways, and there's no shortage of software to do it. Since this is something I'm unlikely ever to do again, I'd prefer a free solution, but I'm also willing to pay if the best solution requires it.</p> <p>I'm a fairly skilled software developer in multiple languages, so if anyone knows o...
<p><a href="http://handbrake.fr/" rel="nofollow noreferrer">Handbrake</a> takes FLV files as source and can convert to h264. It is free, relies on VLC (which is again available in 64 bit on Mac so you can use Handbrake 64) and can manage a processing queue.</p>
<p>You should have a look at <a href="http://www.ffmpegx.com/" rel="nofollow noreferrer">ffmpegx</a> which I am use fairly often and which works perfect for my needs.</p> <p>But it looks like it cant convert .swf - but to be sure you should try it. It's free software.</p> <p>greets</p>
25,467
<p>my shared hosting only allows me to create 2 virtual directories. and i want to host multiple webapps... say an asp.net mvc blog, a forum, a personal site etc... </p> <p>isnt there any other way of doing this? cant i simply just ftp the blog folder to one of my virtual directories and then access it online??</p>
<p>For ASP.NET web applications, typically each would live in its own virtual directory which serves as the application starting point.</p> <p>Technically you could "piggy-back" two applications on the same application starting point in one of two ways:</p> <ol> <li>Put all the files for each application in the same ...
<p>Can't you just put each app in a separate subdirectory in either of the virtual directories. e.g. if you had <a href="http://server.com/vd1" rel="nofollow noreferrer">http://server.com/vd1</a>, you could partition it like <a href="http://server.com/vd1/app1" rel="nofollow noreferrer">http://server.com/vd1/app1</a>, ...
29,426
<p>What is the most memory efficient way to search within a string in ANSI C? (put the code up)</p> <p>An example where this is needed is in embedded devices that are very short on available memory but nowadays have reasonable clock cycles.</p>
<p>It depends on what you're looking for...but strchr() or strstr() are often appropriate. And those are extremely memory efficient since they use no extra memory.</p>
<p>I recently came across this problem and just want to share my thoughts.</p> <p>"Memory efficient" as I interpreted it is the ability to search a long string of size M given only N amount of available memory, M > N. This is alternative to an efficient use of memory per character available in the string to search. An...
26,251
<p><a href="http://svnbook.red-bean.com/nightly/en/svn.tour.importing.html#svn.tour.importing.layout" rel="nofollow noreferrer"><em>Version Control with Subversion</em></a> recommends the following layout for (single-project) repositories (complemented by <a href="https://stackoverflow.com/questions/49356/what-is-a-goo...
<p>The main difference between the recommended layout and your proposed layout is that the recommended layout is somewhat self-documenting as to where to commit things, and how it behaves.</p> <p>For example, in the recommended layout, it's obvious that all new development is committed to trunk, and most branches are ...
<p>I think your plan is pretty good, really. How will you account for branches where a programmer is wandering off on their own just trying something? Maybe like /development/jfm3-messing-around ?</p>
13,401
<p>In <a href="http://msdn.microsoft.com/en-us/library/ms155365%28SQL.90%29.aspx" rel="nofollow noreferrer">this MSDN article</a>, MS explains how to specify other delimiters besides commas for csv-type exports from SSRS 2005, however, literal tab characters are stripped by the config file parser, and it doesn't appear...
<p>In case anyone needs it this is working very well for me.</p> <pre><code>&lt;Extension Name="Tabs" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering"&gt; &lt;OverrideNames&gt; &lt;Name Language="en-US"&gt;Tab-delimited&lt;/Name&gt; &lt;/OverrideName...
<p>Call me Mr Silly but wouldn't it be simpler to have XML returned from a stored proc or a SQL statement? An XSLT transformation to CSV is trivial. </p> <p>Or you could write an equally trivial ASP.NET page that obtains the data using ADO.NET, clears the output stream, sets the mime type to text/csv and writes CSV to...
15,044
<p>I'm just starting out writing trying to write a simple program in C and I am using Visual Studios to do so. I heard that it does compile C as well as C++. And I know that it does because it says it compiles. The only problem is that when I go to the output directory, there isn't a .exe file in the directory! It has ...
<p>By default when you're creating a new C++ project within a new solution, you're getting folder structure like this:</p> <p>C:\Projects\YourSolution C:\Projects\YourSolution\YourCppProject</p> <p>YourSolution contains YourSolution.sln and YourCppProject contains YourCppProject.vcproj.</p> <p>When you build the sol...
<p><a href="http://msdn.microsoft.com/en-us/library/ms235299.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms235299.aspx</a></p> <blockquote> <blockquote> <p>Note:</p> <p>It is not supported to redistribute C/C++ applications that are built without a manifest. Visual C+...
37,445
<p>What are the things that you would consider when defining indexes, clustered and non-clustered, for SQL Server? Are there any anti-patterns that DB newbies should be aware of? Please explain the "Why" or provide references if possible.</p>
<p>An index is basically a "cheat sheet". It allows the DBMS to find a particular value (or range of values) on disk without having to scan the whole table. Generally, you pay a little bit of penalty on INSERT / UPDATE / DELETE by having an index, but rarely so much that it's a bottleneck on its own. A good DBMS will o...
<p>Consider reading <a href="https://rads.stackoverflow.com/amzn/click/com/0471719994" rel="nofollow noreferrer" rel="nofollow noreferrer">Relational Database Index Design and the Optimizers</a>. It will give you a lot of ideas and the reasons why they are good.</p>
45,783
<p>I need to make a Java component that turns the background a certain colour when a process passed, and another colour when the process failed.</p> <p>My first thought was: green for success, red for failure.</p> <p>But then I read that 10% of males <a href="https://en.wikipedia.org/wiki/Color_blindness" rel="nofollow...
<p><a href="https://i.stack.imgur.com/HPxSk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HPxSk.png" alt="alt text"></a> Red + x = Failure</p> <p><a href="https://i.stack.imgur.com/jMHTo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jMHTo.png" alt="alt text"></a> Green + check...
<p>Maybe a visual representation of a traffic light? In a neutral state, all three lights are greyed out, although still discernible by colour. In a "green" state, the green light is brighter, and the contrast between the background and the light is increased. Same for the red-light state.</p> <p>I have to admit th...
49,492
<p>When filament is too short for the extruder to push will there be a stop in printing on the Ender 3, meaning that I should replace the filament when the end of the filament is near the extruder?</p>
<p>The extruder can't push anymore when the filament is past the extruder gear. If your filament has run out to that point, the print will <em>not</em> halt but print without a filament, meaning that the print will fail. You need to pause the print in time and then put fresh filament into the printer.</p> <p>If the en...
<p>The extruder can't push anymore when the filament is past the extruder gear. If your filament has run out to that point, the print will <em>not</em> halt but print without a filament, meaning that the print will fail. You need to pause the print in time and then put fresh filament into the printer.</p> <p>If the en...
1,271
<p>I have a corrupt database. If I open it in MS Access, MS Access offers to repair it, and it succeeds.</p> <p>How can I do that with code? On a machine where MS Access is not installed.</p> <p>I know from trying it that JRO.JetEngine.CompactDatabase does NOT work.</p> <p>In other words, I want to do what Access...
<p>You need to go to <a href="http://support.microsoft.com" rel="nofollow noreferrer">http://support.microsoft.com</a> and search for the JetComp.exe utility, which will attempt to repair and compact your MDB without opening the file. The reason none of the suggestions above work is because they have to open the MDB to...
<p>I'm not a MS Acccess guru, but it appears as though <a href="http://www.codetoad.com/vb_compact_db.asp" rel="nofollow noreferrer">this utility</a> contains the DLLs you'd need to compact and repair a corrupt database file.</p>
17,142
<p>I've got the following situation</p> <ul> <li>A rails application that makes use of rjs / Scriptaculous to offer AJAX functionality</li> <li>Lot of nice javascript written using jQuery (for a separate application)</li> </ul> <p>I want to combine the two and use my jQuery based functionality in my Rails application...
<pre><code>jQuery.noConflict(); </code></pre> <p>Then use jQuery instead of $ to refer to jQuery. e.g.,</p> <pre><code>jQuery('div.foo').doSomething() </code></pre> <p>If you need to adapt jQuery code that uses $, you can surround it with this:</p> <pre><code>(function($) { ...your code here... })(jQuery); </code><...
<p><a href="http://ennerchi.com/projects/jrails" rel="nofollow noreferrer">jRails</a> is a drop-in replacement for scriptaculous/prototype in Rails using the jQuery library, it does exactly what you're looking for.</p>
13,776
<p>I would like to use javascript to develop general-purpose GUI applications. Initially these are to run on Windows, but I would like them to ultimately be cross-platform. </p> <p>Is there a way to do this without having to make the application run in a browser? </p>
<p>Check out <a href="http://en.wikipedia.org/wiki/Adobe_AIR" rel="nofollow noreferrer">Adobe AIR</a>.</p> <p>From Wikipedia:</p> <p><i>Adobe AIR is a cross-platform runtime environment for building rich Internet applications using Adobe Flash, Adobe Flex, HTML, or Ajax, that can be deployed as a desktop application....
<p>Try AIR, you can even use your JS toolkit of choice Using it with dojo look at this: <a href="http://dojocampus.org/content/2008/04/02/dojo-on-air-a-fancy-file-uploader/" rel="nofollow noreferrer">http://dojocampus.org/content/2008/04/02/dojo-on-air-a-fancy-file-uploader/</a></p>
14,572
<p>I see 2 main ways to set events in JavaScript:</p> <ol> <li><p>Add an event directly inside the tag like this:</p> <p><code>&lt;a href="" onclick="doFoo()"&gt;do foo&lt;/a&gt;</code></p></li> <li><p>Set them by JavaScript like this:</p> <p><code>&lt;a id="bar" href=""&gt;do bar&lt;/a&gt;</code></p></li> </ol> <p...
<blockquote> <p>I think the first method is easier to read and maintain</p> </blockquote> <p>I've found the opposite to be true. Bear in mind that sometimes more than one event handler will be bound to a given control.</p> <p>Declaring all events in one central place helps to organize the actions taking place on th...
<p>Libraries like YUI and jQuery provide methods to add events only once the DOM is ready, which can be before window.onload. They also ensure that you can add multiple event handlers so that you can use scripts from different sources without the different event handlers overwriting each other.</p> <p>So your practica...
5,430
<p>I need to create an ASP page (classic, not ASP.NET) which runs remote shell scripts on a UNIX server, then captures the output into variables in VBScript within the page itself.</p> <p>I have never done ASP or VBScipt before. I have tried to google this stuff, but all I find are references to remote server side scr...
<p>You'll want Win32's GetComputerName:</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms724295(VS.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms724295(VS.85).aspx</a></p>
<p>I agree with Pascal on using winsock's gethostname() function. Here you go:</p> <pre><code>#include &lt;winsock2.h&gt; //of course this is the way to go on windows only #pragma comment(lib, "Ws2_32.lib") void GetHostName(std::string&amp; host_name) { WSAData wsa_data; int ret_code; char buf[MAX_PATH]...
3,231
<p>How do I build an escape sequence string in hexadecimal notation. </p> <p>Example:</p> <pre><code>string s = "\x1A"; // this will create the hex-value 1A or dec-value 26 </code></pre> <p>I want to be able to build strings with hex-values between 00 to FF like this (in this example 1B)</p> <pre><code>string s = "...
<p>You don't store hexadecimal values in strings. </p> <p>You can, but it would just be that, a string, and would have to be cast to an integer or a byte to actually read its value.</p> <p>You can assign a hexadecimal value as a literal to an int or a byte though:</p> <pre><code>Byte value = 0x0FF; int value = 0x1B;...
<p>There's an '\u' escape code for hexadecimal <strong>16 bits</strong> unicode character codes.</p> <pre><code>Console.WriteLine( "Look, I'm so happy : \u263A" ); </code></pre>
36,041
<p>I'm using IIS in Windows 2003 Server for a SharePoint intranet. <br />External incoming requests will be using the host header <code>portal.mycompany.com</code> and be forced to use SSL.</p> <p>I was wondering if there's a way to set up an alternate host header such as <br /><code>http://internalportal/</code> <br ...
<p>Daniel, keep in mind that just because something is possbile in IIS, and via any number of off box solutions (like hardware load balancers and SSL) doesn't mean that it is supported by SharePoint, <strong>or</strong> that it is implemented in the same way.</p> <p>You can do what you are asking for, however you shou...
<p>Assuming that <a href="http://internalportal/" rel="nofollow noreferrer">http://internalportal/</a> wasn't accessible from outside the company, you could set up two websites in IIS. The first site, configured to use a host header value of 'portal.mycompany.com', would require SSL. The second site, configured to use ...
2,739
<p>I'm looking at developing a device which will need to support Ethernet over USB (hosted in Linux, XP, and Vista). As I understand it, Vista and Linux support the industry standard USB CDC. However, in classic Windows style, XP only supports it's own Remote NDIS. So, now I'm thinking of just bowing down and doing it ...
<p>The filesystem backend is only worth looking at if you're not going to use a database for any other part of your system. If you are using a database then the filesystem backend has nothing to recommend it.</p> <p>The memcache backend is much quicker than the database backend, but you run the risk of a session being...
<p>If the database have a DBA that isn't you, you may not be allowed to use a database-backed session (it being a front-end matter only). Until django supports easily merging data from several databases, so that you can have frontend-specific stuff like sessions and user-messages (the messages in django.contrib.auth ar...
7,338
<p>I'm trying to find the most reusable, yet elegant, piece of code possible for determining if an IEnumerable. In the ideal, this should be a function I can call absolutely any time I need to tell if an IEnumerable is empty.</p> <p>While I have developed an answer for .NET 3.5 that has worked well for me so far, my ...
<pre><code>!enumerable.Any() </code></pre> <p>Will attempt to grab the first element only.</p> <p>To expand on how/why this works, any determines if any of the components of an <code>IEnumerable</code> match a given function, if none is given, then any component will succeed, meaning the function will return true if ...
<p>One thing to be careful of with either of these methods is that not all enumerations can be rolled-back, for instance all implementations of System.Data.IDataReader can only run through once.</p> <p>In these cases you don't really have a cost in a <code>foreach</code> loop, so long as you account for the fact that ...
14,292
<p>Say we have normal distribution n(x): mean=0 and \int_{-a}^{a} n(x) = P.</p> <p>What is the easiest way to compute standard deviation of such distribution? May be there are standard libraries for python or C, that are suitable for that task?</p>
<p>The standard deviation of a mean-zero gaussian distribution with Pr(-a &lt; X &lt; a) = P is</p> <pre><code>a/(sqrt(2)*inverseErf(P)) </code></pre> <p>which is the expression you're looking for, where inverseErf is the inverse of the error function (commonly known as erf).</p> <p>For C, the Gnu Scientific Library...
<p>Take a look at the <a href="http://scipy.org/" rel="nofollow noreferrer">sciPy Project</a>, it should have what you need.</p>
41,080
<p>I have an import-from-excel script as part of a CMS that previously ran without issue.</p> <p>My shared-hosting provider has recently upgraded their infrastructure, including PHP from 5.1 to 5.2.6, and the script now returns "Uninitialized string offset: -XXX in /path/scriptname.php on line 27" (XXX being a decreas...
<blockquote> <p>Uninitialized string offset:</p> </blockquote> <p>... means that <code>$data</code> is not an array.</p>
<p>Thanks for the input, the situation has 'resolved itself' via me finding a more recent version of the parsing library I was using. My guess is the issue was something to do with the difference between php versions, though I'm unsure exactly what. Fixed but frustrating.</p> <p>EDIT: I'm going to accept Till's answer...
22,402
<p>I have an ASP.NET web application hosted on DiscountASP.NET with its domain name registered on GoDaddy. This site is working perfectly and runs great, but I hate the domain name.</p> <p>So now, I decide to purchase a domain name I like better. How do I set it up so that this domain name runs the same web app as m...
<p>This should be quite simple. Go to the host/registrar of your new domain and point it to the same ip addresses that the godaddy url points to.</p> <p>You can have the old url and new url coexist. The DNS servers just map to the the physical IP your app is hosted on.</p> <p>If you've been naughty and use absolute...
<p>Either move the application files over and create a redirect from the old URL to the new, or set up a rewrite under the new URL to transparently pass requests to the existing one.</p>
43,611
<p>Basically what the title says. (Forgive me because I am a .NET newb)</p> <p>In my department, we have a server running .net 3.5 and ever since I got into this section I have been using LINQ. However, I am starting a personal project on a different server (obviously), so 2 questions: </p> <p>What do I need to get ...
<p>To get up and running, I would definitely recommend checking out <a href="https://rads.stackoverflow.com/amzn/click/com/1933988169" rel="nofollow noreferrer" rel="nofollow noreferrer" title="LINQ in Action">LINQ in Action</a>.</p> <p><img src="https://i.stack.imgur.com/MextA.jpg" alt="alt text"></p> <p>Your compil...
<p>LINQ requires framework 3/3.5, because it use a lot of extensions of 3/3.5 (Extension method, lambda expression Func&lt;> delegate etc).Then it doesn' t work with 2.0 version.</p> <p>If you develop a project using linq on your local pc, simply make a standard deploy (e.g. copy dll, aspx etc) to server production an...
14,304
<p>I wish to implement a 2d bit map class in Python. The class would have the following requirements:</p> <ol> <li><p>Allow the creating of arbitrarily sized 2d bitmaps. i.e. to create an 8 x 8 bitmap (8 bytes), something like:</p> <pre><code>bitmap = Bitmap(8,8) </code></pre></li> <li><p>provide an API to access the...
<p><a href="http://mentat.za.net/numpy/refguide/routines.bitwise.xhtml#bit-packing" rel="noreferrer">Bit-Packing</a> numpy ( <a href="http://www.scipy.org/" rel="noreferrer">SciPY</a> ) arrays does what you are looking for. The example shows 4x3 bit (Boolean) array packed into 4 8-bit bytes. <em>unpackbits</em> unpacks...
<p>No need to create this yourself.</p> <p>Use the very good <a href="http://www.pythonware.com/products/pil/" rel="nofollow noreferrer">Python Imaging Library</a> (PIL)</p>
20,675
<p>I've got a Renkforce RF1000 which should be a good 3D printer. I got it second-hand for my birthday one year ago. I've got no way of contacting the old owner.</p> <p>I spend a good amount of hours fine-tuning the slicer settings last year but at best got mediocre prints. Between September and a week ago I lived some...
<p>One hundred percent infill is not necessarily stronger than lower values. By having such a high infill figure, the forces on the model as it cools are magnified and not in a particularly good manner.</p> <p>Consider that you could use twenty to thirty percent infill to get the strength you require for this applicat...
<p>The reason for this sort of error might be either 1) a clogged nozzel, <a href="https://www.youtube.com/watch?v=bg4sOaSvimY" rel="nofollow noreferrer">try doing this </a> 2) disturbed bed level,<a href="https://www.youtube.com/watch?v=lL3Gmy4hh3Y" rel="nofollow noreferrer">resolve this issue </a> 3) poor filament q...
1,644
<p>I recently inherited a small Java program that takes information from a large database, does some processing and produces a detailed image regarding the information. The original author wrote the code using a single thread, then later modified it to allow it to use multiple threads. </p> <p>In the code he defines a...
<p>Threads are fine, but as others have noted, you have to be highly aware of your bottlenecks. Your algorithm sounds like it would be susceptible to cache contention between multiple CPUs - this is particularly nasty because it has the potential to hit the performance of all of your threads (normally you think of usi...
<p>The benefit of using threads is to reduce wall-clock execution time of your program by allowing your program to work on a different part of the job while another part is waiting for something to happen (usually I/O). If your program is totally CPU bound adding threads will only slow it down. If it is fully or part...
15,846
<p>Is there a common or established algorithm for peer-nodes in a network to decide on a unique "network-channel" (or any other form of semi-secret identifier)?</p> <p>The environment I'm working in is SecondLife. I am trying to figure out how to get many identical peer scripted objects to agree on a "channel" number...
<p>How would a new object know which network to join (new or existing)? Depending on what exactly you need, there are number of approaches.</p> <h2>First method</h2> <p>You can use less precise timer than every second, for example something like this:</p> <pre><code>integer time = llGetUnixTime(); integer channel = ...
<p>Are your objects being rezzed by another object? If so, then the easy solution is to provide the channel number in the integer parameter of llRezObject. The rezzed (child) objects can then just use the param from their on_rez events as the channel.</p> <p>For example, the rezzer parent would do something like thi...
32,825
<p>I have 3 tables</p> <ol> <li><b>Links</b><br/> Link ID<br/> Link Name<br/> GroupID (FK into Groups)<br/> SubGroupID (FK into Subgroups)<br/> <br/></li> <li><p><b>Groups</b><br/> GroupID<br/> GroupName<br/></p></li> <li><p><b>SubGroup</b><br/> SubGroupID<br/> SubGroupName<br/> GroupID (FK into Groups)<br/></p></li> ...
<p>This assumes that there is at most only 1 subgroup per group. if there are more, then you have the potential to get additional records.</p> <pre><code>select links.linkname, groups.groupname, subgroup.subgroupname from links inner join groups on (links.groupid = groups.groupid) left outer join subgroup on (lin...
<p>You're not too clear, but I think you want to get all rows including those that don't have a correspondent in the SubGroup table.</p> <p>For this you can use LEFT JOIN, it will fetch NULLs if there are no matching rows.</p>
19,647
<p>A member of our hackspace wants to get their 8- and 11- year old kids<sup>1</sup> excited about 3D-printing and CNC cutting and makering in general. We have a weekly open training where people can design and print/CNC/laser an item of their choice like a dogboned box or a two-piece sword and hilt, or a name tag, or ...
<p>Our local library makerspace holds summer camp for a limited number of lucky attendees, ages from 12-15 and the curriculum has a segment which appears to match your objective.</p> <p>In the case of the Launch Pad Camp, the campers will be using <a href="http://onshape.com/" rel="nofollow noreferrer">OnShape</a> to ...
<p>Our local library makerspace holds summer camp for a limited number of lucky attendees, ages from 12-15 and the curriculum has a segment which appears to match your objective.</p> <p>In the case of the Launch Pad Camp, the campers will be using <a href="http://onshape.com/" rel="nofollow noreferrer">OnShape</a> to ...
955
<p>Is it possible to exclude a complete namespace from all FxCop analysis while still analyzing the rest of the assembly using the <code>SuppressMessageAttribute</code>?</p> <p>In my current case, I have a bunch of classes generated by LINQ to SQL which cause a lot of FxCop issues, and obviously, I will not modify all...
<p>If you tag your classes with the <code>[GeneratedCode]</code> attribute, you can use the /ignoregeneratedcode flag with FxCop as described in this MSDN post:</p> <p><a href="http://blogs.msdn.com/b/codeanalysis/archive/2008/02/28/faq-how-do-i-prevent-fxcop-1-36-from-firing-warnings-against-generated-code.aspx" rel=...
<p>Use the Generated Code Attribute, heres the <a href="http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the-compilergeneratedattribute-and-the-generatedcodeattribute.aspx" rel="nofollow noreferrer">blog post</a> from the Code Analysis team on the subject.</p> <p>This at the top of the namespace should ...
45,987
<p>On IIS 6, is it possible to have multiple domain names pointing to the same web application, and conditionally serve CSS from within the web application based on the domain name?</p> <p>I need to host hundreds of different "skins" on the same web application, with the skin being dependent upon the domain name, and ...
<p>+1 to rhinof for adding multiple identities, but creating a HttpModule is a bit over kill. You can simply switch the URL of the tag in a Master Page by examining the contents of Request.Headers["HOST"]</p>
<p>If you use themes, you can change the theme, thereby changing the css, etc. in the Page.PreInit depending on the value of the domain in Request.ServerVariables["Url"] (note, there might be a better server variable to get the domain name, look it up).</p> <p>If you aren't using themes, you can programatically swap o...
34,397
<p>I need to present a wizard once, the first time my windows forms application is run after install. I could use a user setting like firstrun = false I suppose. But I also need handle the case where the program is uninstalled, then reinstalled. How will that user setting be reset? It's already present in the config fi...
<p>It's probably best to have your installer create the FirstRun key in the registry and set it to true (or 1 or whatever), and make sure your uninstaller deletes this key entirely. Then just have your application read this key when it starts, and set it to false (or 0 or whatever).</p> <p>If the user uninstalls and ...
<p>You could create a file in the program directory. The uninstaller won't remove this, since it wasn't added by the installer.</p>
25,903
<p>Today as I booted up Visual Studio 2008 to do my work, I saw on the Start page a new blog post about <a href="http://channel9.msdn.com/shows/10-4/10-4-Episode-1-Working-with-the-Visual-Studio-2010-CTP-VPC/" rel="nofollow noreferrer">Visual Studio 2010 and .NET 4.0</a>.</p> <p>I can't help but feel a little overwhel...
<p>You don't need to be constantly updating your production work to use the latest and greatest technology. But you should stay knowledgable about what is out there and what is being created. There will come a time when it is appropriate to start using the new technology, but that all heavily depends on your projects a...
<p>Study study study. Read read read. Participate participate participate. Code code code.</p> <p>There are 24 hours in a day. Keeping current is what keeps us relevant and needed.</p>
49,612
<p>This is more of a design question. </p> <p>I am building a tool that displays business objects in various ways (ie Tree Nodes, List View Items, Combo Boxes, Text Fields, etc). Anytime the user changes any of one of them, an event is raised that signals that that business object has been changed or the collection ...
<p>Use a messaging system. Create a delegate like this:</p> <pre><code>public delegate void ObjectRefresh(BusinessObject obj); </code></pre> <p>Then, in your BusinessObject class:</p> <pre><code>public event ObjectRefresh; </code></pre> <p>And when a property is changed:</p> <pre><code>if (ObjectRefresh) Objec...
<p>Have a look at Bindable Linq ... a solution to this problem by Paul Stovell.</p> <p><a href="http://www.codeplex.com/bindablelinq" rel="nofollow noreferrer">http://www.codeplex.com/bindablelinq</a></p> <p>If it doesn't provide a solution to your problem it would give you some insite into writing this yourself.</p>...
23,050
<p>I've tested my iPhone app on the iPhone. Now I want to test it on the iPod touch. Assuming I have an iPod touch what else do I need?</p> <p>I just want to make sure all the certificates and stuff that I used for the iPhone will work for the iPod touch too.</p>
<p>The certificates will work fine as is. If you really want to test against a touch I would recommend using the ad-hoc method and asking one of the people who have requested support if they would like to test it. If you haven't done an ad-hoc distribution there are instruction in the portal. You may have to upload a n...
<p>You'll have to make a new provisioning profile that has device ids for your iPhone and iPod touch. But your certs will be fine as is.</p>
26,639
<p>I'm using Visual Studio 2008 to develop ASP.NET applications. Currently I'm debugging with running on IIS. I would like to switch to the development web server (Cassini) for debugging, so that I can use features like edit and continue. The reason that I'm not, is because the development web server only starts up whe...
<p>Rihan is partially correct...</p> <p>In your Project Property page, Web tab: Enable Edit and Continue</p> <p>If checked - The Development server will close when the app (not VS) stops.</p> <p>If unchecked - Development server keeps running</p>
<p>I have 3 web sites, with Single sign on between each site so I need to start all 3 with attach to process. However, there was no process to attach the debugger to, and whenever I started a project with F5 then stop it, the visual studio web server closed.</p> <p>The Enable Edit and Continue option didn't change any...
31,997
<p>I'm just starting to design some embedded devices, and am looking for resources.</p> <p>What I want to be able to do is to connect a GPS receiver to a lightweight SBC or mini-ITX, x86-based computer, and track a remote-controlled vehicle's location/progress.</p> <p>Ideally, this could morph into building some hobb...
<p><a href="http://www.openembedded.org" rel="nofollow noreferrer">OpenEmbedded</a> is a good place to go to get started. A lot of embedded products use ARM and other processors, so cross-compiling is a big deal. <a href="http://buildroot.uclibc.org/" rel="nofollow noreferrer">Buildroot</a> is another resource for bu...
<p>Some people here have suggested devices like the gumstix - embedded devices which cost $149 without GPS. I don't understand that bit. A off-the-shelf TomTom comes with running Linux on ARM, built-in GPS, lots of flash, battery and screen. It's hard to beat the price advantage that comes with mass production. For you...
8,185
<p>I'm scared that one day, I'm going to put a space or miss out something in the command I currently use:</p> <pre><code>rm -rf ./* </code></pre> <p>Is there a safer way of emptying the current directory's contents?</p>
<p>The safest way is to sit on your hands before pressing Enter.</p> <p>That aside, you could create an alias like this one (for Bash)</p> <pre> alias rm="pwd;read;rm" </pre> <p>That will show you your directory, wait for an enter press and then remove what you specified with the proper flags. You can cancel by pres...
<p>You could always turn on <code>-i</code> which would prompt you on every file, but that would be really time consuming for large directories.</p> <p>I always do a <code>pwd</code> first.</p> <p>I'll even go as far as to create an alias so that it forces the prompt for my users. Red Hat does that by default, I thi...
48,795
<p>Is there any supported way of mapping datetimeoffset the new datatype in SQL 2008 to the System.DateTimeOffset using nhibernate?</p>
<p>NH 2.1 (or compiling from NHibernate trunk) supports this and more out-of-the-box. <a href="http://nhforge.org/blogs/nhibernate/archive/2009/03/11/nhibernate-and-ms-sql-server-2008-date-time-datetime2-and-datetimeoffset.aspx" rel="nofollow noreferrer">Check it out</a></p>
<p>(Assuming google didn't turn of anything) You will probably need to create a simple IUserType to handle this, also I am sure that the NH team would gladly accept it as a patch for everyone to benifit.</p> <p>Ayende has a good post <a href="http://ayende.com/Blog/archive/2008/07/31/Entities-dependencies-best-practic...
42,401
<p>I looking for a way, specifically in PHP that I will be guaranteed to always get a unique key.</p> <p>I have done the following:</p> <pre><code>strtolower(substr(crypt(time()), 0, 7)); </code></pre> <p>But I have found that once in a while I end up with a duplicate key (rarely, but often enough).</p> <p>I have a...
<p>There are only 3 ways to generate unique values, rather they be passwords, user IDs, etc.:</p> <ol> <li>Use an effective GUID generator - these are long and cannot be shrunk. If you only use part <strong>you FAIL</strong>. </li> <li>At least part of the number is sequentially generated off of a single sequence. Y...
<p>I usually do a random substring (randomize how many chars between 8 an 32, or less for user convenience) or the MD5 of some value I have gotten in, or the time, or some combination. For more randomness I do MD5 of come value (say last name) concatenate that with the time, MD5 it again, then take the random substring...
7,895
<p>... I'm working on a couple of theories, but I'm interested to hear other opinions.</p> <p>This has been verified on three different machines, two windows the other linux. The compiler used is flexbuild (Presumably mxmlc) and ant with mxmlc.</p> <p>We <em>added</em> code to a small stand-alone single .as file proj...
<p>Have seen this behaviour in .NET assemblies before. </p> <p>My guess about this behaviour (wherever it occurs) is that whatever gets added allows the compiler to do more optimizing than it could have previously. </p> <p>Why that might be would require much more detailed knowledge of the inner workings of compilers...
<p>I'm just guessing, but when it comes to files this small, maybe you're seeing the slack from the hard drive sectors?</p>
29,838
<p>From time to time my applications GUI stops redrawing. There a lot of threads that are firing all kinds of events (like timers or network data ready etc.). Also there are a lot of controls that are subscribing these events. Because of that, all the event handlers play the InvokeRequired/Invoke game. Now I figured ou...
<p>Invoke waits until the event is handled in the GUI thread. If you want it to be asynchronous use BeginInvoke()</p>
<p>The most likely answer (deadlock) has already been suggested.</p> <p>Another way to simulate this behaviour is to reduce the number of pool threads and IO completion ports; you haven't called <code>ThreadPool.SetMaxThreads(...)</code> by any chance?</p>
36,524
<p>I have a custom attribute which can be assigned to a class, <code>[FooAttribute]</code>. What I would like to do, from within the attribute, is determine which type has actually used me. e.g. If I have:</p> <pre><code>[FooAttribute] public class Bar { } </code></pre> <p>In the code for FooAttribute, how can I dete...
<p>First off, you might consider the existing <code>[DisplayName]</code> for keeping friendly names. As has already been covered, you simply can't get this information inside the attribute. You can look up the attribute from Bar, but in general, the only way to do it from the attribute would be to pass the type <em>int...
<p>From your sentence "I just want to set a friendly name using reflection" I think you want to set the "MyFriendlyNameForThisClass" name to the attribute at runtime. if so, I don't think that's possible. Please see <a href="https://stackoverflow.com/questions/51269/change-attributes-parameter-at-runtime">this thread</...
34,771
<p>I've ran some "ALTER" scripts on the database [SQL Server Server 2005], and overwrote some sprocs. Is there any way to undo changes and get my old sprocs back?</p> <p>Is there a way to get the scripts that were executed out of the .LDf file? That way i can re-run my initial "create" script for my sprocs.</p> <p>I ...
<p>FIRST: DO NOT TAKE ANY BACKUPS JUST YET.</p> <p>There are several tools on the market to do this sort of thing. </p> <p>You might try this one:</p> <p><a href="http://www.apexsql.com/sql_tools_log.asp" rel="nofollow noreferrer">ApexSQL Log</a></p>
<p>yo do can!! go to sql server managment studio,connect to your db, left click on your db and go to "tasks". select restore -> database. then click the "timeline" button and select 'especific date' and select the day before your mistake. All programs that have access to your db mus be closed. It worked for me, i had t...
24,861
<p>I have two methods that I need to call in my WCF application from the client.</p> <p>Authenticate(username, password) GetUser(username)</p> <p>Is it possible to combine these calls to avoid so many calls being sent back/forth?</p>
<p>There are a few ways to handle this type of thing. First, you can use WCF sessions to initiate a group of commands that need to maintain some context between calls:</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms733136.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms733136.aspx<...
<p>This is a very old thread, but this sounds like a good application of a Service Bus. I read about Rhino Service Bus a little while back and it fits the bill from what you said.</p> <p><a href="http://msdn.microsoft.com/en-us/magazine/ff796225.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/magazine/ff796225....
27,013
<p>I have a webservice in java that receives a list of information to be inserted or updated in a database. I don't know which one is to insert or update.</p> <p>Which one is the best approach to abtain better performance results:</p> <ol> <li><p>Iterate over the list(a object list, with the table pk on it), try to i...
<p>If your database supports MERGE, I would have thought that was most efficient (and treats all the data as a single set).</p> <p>See:</p> <p><a href="http://www.oracle.com/technology/products/oracle9i/daily/Aug24.html" rel="nofollow noreferrer">http://www.oracle.com/technology/products/oracle9i/daily/Aug24.html</a>...
<p>If performance is your goal then first get rid of the word iterate from your vocabulary! learn to do things in sets.</p> <p>If you need to update or insert, always do the update first. Otherwise it is easy to find yourself updating the record you just inserted by accident. If you are doing this it helps to have an ...
49,990
<p>Is there any DRM or license management solution for 3D printing? I'm looking for something, that would help me limit the number of prints someone can make from my projects. Basically, I would like to sell the "right to make no more than X copies" of my design. I don't expect it to be bullet-proof (like Widevine L1 f...
<p>Good luck with that.</p> <p>Issues you will face:</p> <ul> <li>using a G-code editor (or built-in printer software) to create multiple copies of the object in a single print session</li> <li>user writing the printer file to an SD card, then block-copying the SD card</li> <li>defining a "print". Specifically:</li> ...
<h2>Generally: No</h2> <p>Let's face the obvious problems of the files exchanged and the files used for printing, and then look into why it is a bad idea in the first place.</p> <h2>G-code</h2> <p>G-code is in its design a .txt file that contains specific orders for a machine. There is a g-code command that forces the ...
1,676
<p>I have a few links that should all open in the same window or tab. To accomplish this I've given the window a name like in this example code:</p> <pre><code>&lt;a href="#" onClick='window.open("http://somesite.com", "mywindow", "");'&gt;link 1&lt;/a&gt; &lt;a href="#" onClick='window.open("http://someothersite.com"...
<p>The window.open() function in Javascript is specifically designed to open a new window, please see: <a href="http://www.w3schools.com/HTMLDOM/met_win_open.asp" rel="noreferrer">w3schools documentation</a>. It actually sounds like IE is handling things in a non-standard way (which is hardly surprising). </p> <p>If y...
<p>Why don't you just use plain HTML like</p> <p><code>&lt;a href="http://www.google.com" target="my_window_tab_frame_or_iframe"&gt;Link&lt;/a&gt;</code></p> <p>instead of using JavaScript?</p>
33,758
<p>I have a question with fluent interfaces.</p> <p>We have some objects that are used as parameter objects for a SQL interface, here's an example:</p> <pre><code>using (DatabaseCommand cmd = conn.CreateCommand( "SELECT A, B, C FROM tablename WHERE ID = :ID", SqlParameter.Int32(":ID", 1234))) { ... } </co...
<p><code>SqlParameterOption's</code> methods can all be instance methods that returns the same object:</p> <pre><code>class SqlParameterOption { public SqlParameterOption Precision(int p) {/* ... */; return this;} public SqlParameterOption Substitute() {/* ... */; return this;} /* ... */ } /* ......
<p>You can have overloaded <em>methods</em> though. For example, if it was Substitute(). You can't normally have both static and instance versions of a method, but extension methods might be of some use... but if the two versions of Substitute have different meanings, it would be cleaner to simply have different types ...
26,811
<p>How can I horizontally center a <code>&lt;div&gt;</code> within another <code>&lt;div&gt;</code> using CSS?</p> <pre class="lang-html prettyprint-override"><code>&lt;div id=&quot;outer&quot;&gt; &lt;div id=&quot;inner&quot;&gt;Foo foo&lt;/div&gt; &lt;/div&gt; </code></pre>
<p>You can apply this CSS to the inner <code>&lt;div&gt;</code>:</p> <pre class="lang-css prettyprint-override"><code>#inner { width: 50%; margin: 0 auto; } </code></pre> <p>Of course, you don't have to set the <code>width</code> to <code>50%</code>. Any width less than the containing <code>&lt;div&gt;</code> will ...
<p>Centering: Auto-width Margins</p> <p>This box is horizontally centered by setting its right and left margin widths to "auto". This is the preferred way to accomplish horizontal centering with CSS and works very well in most browsers with CSS&nbsp;2 support. Unfortunately, Internet&nbsp;Explorer&nbsp;5/Windows does ...
13,986
<p>I think I might be approaching this in the wrong way, so I would appreciate any comments/guidance. Hopefully I can explain coherently enough what I am trying to achieve:</p> <ul> <li><p>I want to create a block of HTML (e.g. a box containing a user's profile), which I will load as part of my layout on most pages th...
<p>Create a view to generate the block of HTML for the user's profile and call it from your controller using:</p> <pre><code>$user_html = $this-&gt;load-&gt;view('user_view', $user_data, true); </code></pre> <p>The third parameter returns the view as a string instead of displaying it. This can then be passed into ano...
<p>As far as data is concerned, you dont 'need' to generate the HTML with PHP. You can use <a href="http://jquery.com/" rel="nofollow noreferrer" title="jQuery">jQuery</a> to generate the necessary elements from a JSON object output in the page source. You can then show a nice little 'loading' animation on the element ...
42,183
<p>I have a ContextMenu that is displayed after a user right clicks on a ComboBox. When the user selects an item in the context menu, a form is brought up using the <code>ShowDialog()</code> method. </p> <pre><code>If frmOptions.ShowDialog() = Windows.Forms.DialogResult.Cancel Then LoadComboBoxes() End If </code>...
<p>One way to handle this would be to use the context menu's Popup event to grab the selected index of the combobox launching the menu. When the dialog form closes reset the selected index.</p>
<p>I figured it out.</p> <p>I created a method that passed the <strong>ContextMenu.SourceControl()</strong> property by reference so I could manipulate the control that called the ContextMenu. In the beginning of the method, I got the <strong>SelectedValue</strong> of the ComboBox and the reloaded the data in the Com...
7,336
<p>I use the <a href="https://addons.mozilla.org/en-US/firefox/addon/6543" rel="nofollow noreferrer">Nightly Tester Tools</a> for Firefox and <a href="http://fiddlertool.com/fiddler/" rel="nofollow noreferrer">Fiddler</a> for IE. What do you use?</p>
<p>Web Developer toolbar for Firefox, Visual Studio JIT debugger for IE, and Chrome's Resource Inspector. We don't use Opera for debugging due to the aforementioned tools, but we do take a look at our stuff to make sure it looks correct in Opera to be on the safe side.</p>
<p>A nice question. I have never think about it before. We test our website with a large range of custom configure browser. This are the browser of the different developers. The inhomogeneous is program.</p> <p>Problems we had only with 2 plugins: Adblock and FlashBlock</p> <p>I would also test NoScript.</p>
15,723
<p>i've found how to bind an asp:Menu to XML. i've found how to bind an asp:Menu to a site map (which is really binding it to XML). How do you bind an asp:Menu to a database?</p> <p>The .NET Framework provides multiple data sources:</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.hierarchi...
<p>There is a good article on aspalliance.com: <a href="http://aspalliance.com/822" rel="noreferrer"><strong>Building a Database Driven Hierarchical Menu using ASP.NET 2.0</strong></a>. Each step is explained and nicely illustrated.</p> <p><em>"In this article, Michael demonstrates how to create a database driven hier...
<p>There is a good article on aspalliance.com: <a href="http://aspalliance.com/822" rel="noreferrer"><strong>Building a Database Driven Hierarchical Menu using ASP.NET 2.0</strong></a>. Each step is explained and nicely illustrated.</p> <p><em>"In this article, Michael demonstrates how to create a database driven hier...
36,083
<p>I would like to get data from from different webpages such as addresses of restaurants or dates of different events for a given location and so on. What is the best library I can use for extracting this data from a given set of sites? </p>
<p>If using python, take a good look at Beautiful Soup (<a href="http://crummy.com/software/BeautifulSoup" rel="noreferrer">http://crummy.com/software/BeautifulSoup</a>).</p> <p>An extremely capable library, makes scraping a breeze.</p>
<p>What language do you want to use?</p> <p>curl with awk might be all you need.</p>
9,263
<p>I would like to make a nightly cron job that fetches my stackoverflow page and diffs it from the previous day's page, so I can see a change summary of my questions, answers, ranking, etc.</p> <p>Unfortunately, I couldn't get the right set of cookies, etc, to make this work. Any ideas?</p> <p>Also, when the beta i...
<p>Your status page is available now without logging in (click <a href="https://stackoverflow.com/users/logout?returnurl=%2fquestions%2f2815%2fhow-to-curl-or-wget-a-stackoverflow-page">logout</a> and try it). When the beta-cookie is disabled, there will be nothing between you and your status page.</p> <p>For wget:</p>...
<p>Nice idea :)</p> <p>I presume you've used wget's</p> <pre><code>--load-cookies (filename) </code></pre> <p>might help a little but it might be easier to use something like Mechanize (in Perl or python) to mimic a browser more fully to get a good spider.</p>
2,497
<p>when they say the action controller in the struts framework is multi threaded, does it mean that there are multiple instances of the servlet taking the request and forwarding it to the model. OR does it mean that there is one single instance taking all the requests? Any visuals will be appreciated</p>
<p>Some profiler like profiler4j can show the managed and the unmanaged memory (live curve). Then you can see if you has a leak and when the leak occur. But you does not find more informations.</p> <p>After this there are 2 possible solutions:</p> <ol> <li>You can with the live curve isolate the problem and create a ...
<p>I love valgrind ( <a href="http://valgrind.org/" rel="nofollow noreferrer">http://valgrind.org/</a> ), if you are executing it on a system it supports. It really rocks!</p>
13,346
<p><strong>Scenario</strong></p> <p>I have an HTML/javascript website that uses javascriptSOAPClient communicate with an ASP.NET 1.1 web service in order to read/write to a SQL database. (<a href="http://www.codeproject.com/KB/ajax/JavaScriptSOAPClient.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/ajax...
<p>A few suggestions to consider: </p> <ul> <li><strong>List the threats</strong>, and compare each to your current setup. </li> <li>Use <strong>SSL / HTTPS</strong>. This alleviates a whole class of vulnerabilities. </li> <li>Use <strong>username/password</strong>, generated on the server side and sent out of band ...
<p>Can you incorporate a certificate authentication mechanism? So that only clients that have keys you can verify can communicate? That's how the product I work with has its managed devices communicate back to the core.</p>
21,137
<p>I want to capture the HTTP request header fields, primarily the Referer and User-Agent, within my client-side JavaScript. How may I access them?</p> <hr> <p>Google Analytics manages to get the data via JavaScript that they have you embed in you pages, so it is definitely possible.</p> <blockquote> <p><strong>R...
<p>If you want to access referrer and user-agent, those are available to client-side Javascript, but not by accessing the headers directly.</p> <p>To retrieve the referrer, use <a href="https://developer.mozilla.org/en-US/docs/DOM/document.referrer" rel="noreferrer"><code>document.referrer</code></a>.<br> To access th...
<pre><code>var ref = Request.ServerVariables("HTTP_REFERER"); </code></pre> <p>Type within the quotes any other server variable name you want.</p>
27,105
<p>Has anybody had any success with developing for Android platform using Netbeans (5.5+ ) IDE? I know of atleast netbeans one plugin that is supposed to support it but wanted to hear if anyone is using netbeans for Android development and how easy it is to set it up.</p>
<p>There is a project called nbandroid (formerly called undroid) which is a Netbeans version of ADT and it works quite fine with SDK 1.0</p> <p><a href="http://nbandroid.org/" rel="nofollow noreferrer">http://nbandroid.org/</a></p> <p>In the past it was hosted at undroid.nolimit.cz and nbandroid.kenai.com, both these...
<p>Android was built with the Eclipse IDE in mind. </p> <p>It can work with any IDE, but if you don't have any strong feelings towards NetBeans you're probably better off developing for it with Eclipse.</p>
47,763
<p>I currently use a BLtouch 3.1, which is known to stop operating at about 35-40 °C. In fact, when I preheat the bed at 100 °C close to the probe, I sometimes get issues with the pin not retracting correctly.</p> <p>I would like in the future to enclose and heat the printer chamber, therefore I need a probe capable of...
<p>Have you considered using or adapting Prusa’s P.I.N.D.A. V2 or SuperPINDA? Seems that within some bounds they’ve solved the temperature compensation issue.</p> <p>The older P.I.N.D.A. V1 sensor seems to be temperature-sensitive. See more information in <a href="https://help.prusa3d.com/en/article/p-i-n-d-a-superpind...
<p>There are various designs which can be made to work at 100 °C.</p> <p>For example this <a href="https://www.thingiverse.com/thing:4390007" rel="nofollow noreferrer">solenoid probe</a> uses a solenoid to lift a plunger during print, letting it drop during probing. The design uses a rare earth magnet which usually los...
1,860
<p>I am trying to perform some unit testing on the iphone but for some reason I cannot get it to build the executable</p> <p>I have downloaded TestMyApp from the Standford lecture slides and that compiles and runs perfectly. I have created a test project and even gone as far as to use the test code from the Stanford s...
<p>If you right click on your unit test target and select the "get info" menu you will see your target options. At the bottom of the pane, you'll see a section called "User Defined": remove the entry containing the path to cocoa.h. I don't remember the name of this entry as I removed it, but this fixes the same probl...
<p>Do you have the iPhone SDK 2.2 installed? Without using the GTM for iPhone, OCunit doesn't work with iPhone SDK &lt; 2.2.</p> <p>I have been working with the Stanford example code as well. When I try to set up my own project, I wasn't able to get my tests to run. So, I took the Stanford example projects and renamed...
48,192
<p>I am trying to export a Ruby framework via XML-RPC. However I am having some problems when trying to call a method from a class not directly added as a handler to the XML-RPC server. Please see my example below:</p> <p>I have a test Ruby XML-RPC server as follows:</p> <pre><code>require "xmlrpc/server" class Exam...
<p>Your client (s in you Python code) is a ServerProxy object. It only accepts return values of type boolean, integers, floats, arrays, structures, dates or binary data.</p> <p>However, without you doing the wiring, there is no way for it to return another ServerProxy, which you would need for accessing another class....
<p>XML-RPC can't pass objects. The set of parameter types is limited (as jakber says).</p>
33,078
<p>I accidentally let the print head of my Anet A8 crash into one of 2 clips that are holding a glass sheet onto the hot bed, and suddenly the screen went blank and the printer rebooted, then it started reading 739°C from the extruder thermistor. I tried changing the thermistor, but that didn't have any effect. Also tr...
<blockquote> <p>and found out it has a resistance of 1.5kΩ, while it should have a resistance of 4.7kΩ, so I suspect this is the main reason behind this high reading. Now the only thing left to figure out is how the resistance of this resistor changed.</p> </blockquote> <p>You can't measure the resistance of a resis...
<blockquote> <p>and found out it has a resistance of 1.5kΩ, while it should have a resistance of 4.7kΩ, so I suspect this is the main reason behind this high reading. Now the only thing left to figure out is how the resistance of this resistor changed.</p> </blockquote> <p>You can't measure the resistance of a resis...
761
<p>I redirect the user to the login page when user click log out however I don't think it clears any application or session because all the data persisted when the user logs back in.</p> <p>Currently the login page has a login control and the code behind on the page is only wired up the login Authenticate.</p> <p>Can...
<pre><code>Session.Abandon() </code></pre> <p><a href="http://msdn.microsoft.com/en-us/library/ms524310.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms524310.aspx</a></p> <p>Here is a little more detail on the <code>HttpSessionState</code> object:</p> <p><a href="http://msdn.microsoft.com/en-us/lib...
<p>Go to file <strong>Global.asax.cs</strong> in your project and add the following code.</p> <pre><code> protected void Application_BeginRequest() { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now.AddHours(-1)); Response.Cache.SetNoStore(...
44,905
<p>I'm the second dev and a recent hire here at a PHP/MySQL shop. I was hired mostly due to my experience in wrangling some sort of process out of a chaotic mess. At least, that's what I did at my last company. ;)</p> <p>Since I've been here (a few months now), I've brought on board my boss, my product manager and s...
<p>While Scrum other agile methodologies like it embody a lot of good practices, sometimes giving it a name and making it (as many bloggers have commented on) a "religion" that must be adopted in the workplace is rather offputting to a lot of people, including myself.</p> <p>It depends on what your options and commitm...
<p>Continue your efforts to involve the other developer. Remember you are the one who wants to make this change. Ask for help with problems you have. Invite them to the daily stand up meeting. I currently do the planning for the daily stand up and I make sure all the pigs and chickens are invited. If you are the lead o...
5,539
<p>Are there any tools or plugins to design a Panel independently of a Form (Windows, not Web Form) within Visual Studio?</p> <p>I've been using the designer and manually extracting the bits I want from the source, but surely there is a nicer way.</p>
<p>You could do all the design work inside of a UserControl.</p> <p>If you go that route, instead of just copying the bits out of the user control, simply use the user control itself.</p>
<p>As Chris Karcher said, you should probably use a user control. This will allow easy, VS-supported/-integrated reuse without having to manually fiddle with designer code.</p>
5,759
<p>I understand the need to test a class that has logic (for instance, one that can calculate discounts), where you can test the <em>actual</em> class. </p> <p>But I just started writing unit tests for a project that will act as a repository (get objects from a database). I find myself writing a 'fake' repository that...
<p>You are not testing your mock object but some other class that is interacting with it. So you could for example test that a controller forwards a save method call to your fake repository. There is something wrong if you are "testing your fake objects"</p>
<p>You write "fake" class called Stub or Mock object because you want to test an implementation in a simple way without testing the real concrete class. The purpose is to simplify the testing by testing only the Interface (or abstract class).</p> <p>In your example, you are testing something that has a dictionnary. It...
40,549
<p>I use both ruby on rails and Java. I really enjoy using migrations when I am working on a rails project. so I am wondering is there a migrations like tool for Java? If there is no such tool is it a good idea to use migrations as a tool to control a database used by a Java project? </p>
<p>For a <strong>feature comparison</strong> between </p> <ul> <li>Flyway</li> <li>Liquibase</li> <li>c5-db-migration</li> <li>dbdeploy</li> <li>mybatis</li> <li>MIGRATEdb</li> <li>migrate4j</li> <li>dbmaintain</li> <li>AutoPatch</li> </ul> <p>have a look at <a href="http://flywaydb.org" rel="noreferrer">http://flywa...
<p><a href="http://migrate4j.sourceforge.net/" rel="nofollow noreferrer">Migrate4j</a> seems like a candidate, but the project doesn't look mature enough for production usage.</p>
15,909
<p>What is the easiest way to use a <code>DLL</code> file from within <code>Python</code>?</p> <p>Specifically, how can this be done <em>without</em> writing any additional wrapper <code>C++</code> code to expose the functionality to <code>Python</code>?</p> <p>Native <code>Python</code> functionality is strongly pre...
<p>For ease of use, <a href="http://docs.python.org/library/ctypes.html" rel="noreferrer">ctypes</a> is the way to go.</p> <p>The following example of ctypes is from actual code I've written (in Python 2.5). This has been, by far, the easiest way I've found for doing what you ask.</p> <pre><code>import ctypes # Loa...
<p>ctypes will be the easiest thing to use but (mis)using it makes Python subject to crashing. If you are trying to do something quickly, and you are careful, it's great.</p> <p>I would encourage you to check out <a href="http://www.boost.org/doc/libs/1_36_0/libs/python/doc/index.html" rel="nofollow noreferrer">Boost ...
31,450
<p>I have a rich-text editor on my site that I'm trying to protect against XSS attacks. I think I have pretty much everything handled, but I'm still unsure about what to do with images. Right now I'm using the following regex to validate image URLs, which I'm assuming will block inline javascript XSS attacks: </p> <p...
<p>Another thing to worry about is that you can easily embed PHP code inside an image and upload that most of the time. The only thing an attack would then have to be able to do is find a way to include the image. (Only the PHP code will get executed, the rest is just echoed). Check the MIME-type won't help you with th...
<p>In that case, look at the context around it: do users only supply a URL? In that case it's fine to just validate the URLs semantics and MIME-type. If the user also gets to input tags of some sort you'll have to make sure that they are not manipulatable to do anything other then display images.</p>
29,826
<p>I have a little Perl script (On Windows) that checks some files for me as an aid to my day-to-day business. At the moment it prints out something like...</p> <pre><code>0% 25% 50% 75% Complete </code></pre> <p>But I can remember scripts I've used in the past that didn't print progress on a line-by-line basis, but ...
<p>In addition to the other answers, \r will go back to the beginning of the current line</p>
<p>I don't know if this works in Perl, but in C/C++ you can use <pre>\b</pre> for a backspace. Using several of those, you can move the cursor to overwrite old values.</p>
35,002
<p>Does your software handle newline characters from other systems?</p> <pre><code>Linux/BSD linefeed ^J 10 x0A Windows/IBM return linefeed ^M^J 13 10 x0D x0A old Macs return ^M 13 x0D others? </code></pre> <p>For reasons of insanity, I am going with using the Linux version ...
<p>As they say, be strict in what you write and liberal in what you read.</p> <p>Your application should be able to work properly reading both line endings. If you want to use linefeeds, and potentially upset Windows users, that's fine.</p> <p>But save for Notepad, most programs I play with seem to be happy with both...
<p>Not sure what you mean when you say 'deal' with, but basically you can just say something like:</p> <pre><code>string convertLineBreaks(String line, String lineBreakYouWant) { replace all ^M^J or ^M or ^J in line with lineBreakYouWant return line } </code></pre> <hr> <p><strong>Edit:</strong> I suspect after...
16,671
<p>I'm building an installer for an application. The user gets to select a datasource they have configured and nominate what type of database it is. I want to confirm that the database type is indeed Postgres, and if possible, what version of Postgres they are running by sending a SQL statement to the datasource.</p>
<p>Try this:</p> <pre><code>mk=# SELECT version(); version ----------------------------------------------------------------------------------------------- PostgreSQL 8.3.3 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.3 (Ubun...
<p>Interesting ... version() is a function! I wonder why? Version is not going to change or return different values under different inputs/circumstances. </p> <p>Curious because I remember from old days that in Sybase it used to be a global variable and version could be found out by doing "select @@version"</p>
12,662
<p>I have been searching for recent performance benchmarks that compare L2S and EF and couldnt find any that tested calling stored procedures using the released version of EF. So, I ran some of my own tests and found some interesting results.</p> <p>Do these results look right? Should I be testing it in a different wa...
<p>I think you should test it in a somewhat different way, in order to distinguish <a href="http://oakleafblog.blogspot.com/2008/08/entity-framework-instantiation-times.html" rel="noreferrer">startup costs vs. execution costs</a>. The Entity Framework, in particular, has substantial <a href="http://blogs.msdn.com/adon...
<p>I did a couple of test asp.net pages trying to see which performs better. My test was:</p> <p>Delete 10,000 records Insert 10,000 records Edit 10,000 records Databind the 10,000 records to a GridView and display on the page</p> <p>I was expecting LinqToSQL to be faster but doing the above LinqToSQL takes nearly 2...
32,067
<p>We use SQL Server 2000/2005 and Vault or SVN on most of our projects. I haven't found a decent solution for capturing database schema/proc changes in either source control system.</p> <p>Our current solution is quite cumbersome and difficult to enforce (script out the object you change and commit it to the database...
<p>Use Visual studio database edition to script out your database. Works like a charm and you can use any Source control system, of course best if it has VS plugins. This tool has also a number of other useful features. Check them out here in this great blog post</p> <p><a href="http://www.vitalygorn.com/blog/post/200...
<p>Our dbas periodically check prod against what is in SVN and delete any objects not under source control. It only takes once before the devlopers never forget to put something in source control again.</p> <p>We also do not allow anyone to move objects to prod without a script as our devs do not have prod rights this...
45,951
<p>I really want to use SimpleDB, but I worry that without real locking and transactions the entire system is fatally flawed. I understand that for high-read/low-write apps it makes sense, since eventually the system becomes consistent, but what about that time in between? Seems like the right query in an inconsistent ...
<p>This is the pretty classic battle between consistency and scalability and - to some extent - availability. Some data doesn't always need to be that consistent. For instance, look at digg.com and the number of diggs against a story. There's a good chance that value is duplicated in the "digg" record rather than fo...
<p>Assuming you're talking about <a href="http://www.cs.bc.edu/~sciore/simpledb/intro.html" rel="nofollow noreferrer">this SimpleDB</a>, you're not being a worrywart; there are real reasons not to use it as a real world DBMS.</p> <p>The properties that you get from transaction support in a DBMS can be abbreviated by t...
42,391
<p>I am divided between using a C# implementation and a pure SQL 2005/2008 implementation. I need to determine the length of usage based on timestamps of their last actions. My table contains "friendID" (uniqueIdentifier) and "lastAction" datetime. Here is an example:</p> <pre> Bob, 1:00 PM Bob, 1:01 PM Bob, 1:20...
<p>Here's a pure SQL example:</p> <p>If you only need the start times of the session:</p> <pre> select u, t from test a where not exists ( select 1 from test b where a.u = b.u and b.t >= a.t - '60 minutes'::interval and b.t </pre> <p>If you really need the dura...
<p>Record the start time of the first action in the session. Record the last time in the session as well. Look at te Globals.asax events. There should be something like OnSessionEnd (If anyone knows the exact event, please comment). When this happens, record the durration between start time and last time. If you a...
49,842
<p>I was wondering peoples opinions on the naming of ID columns in database tables.</p> <p>If I have a table called Invoices with a primary key of an identity column I would call that column InvoiceID so that I would not conflict with other tables and it's obvious what it is.</p> <p>Where I am workind current they ha...
<p>I always prefered ID to TableName + ID for the id column and then TableName + ID for a foreign key. That way all tables have a the same name for the id field and there isn't a redundant description. This seems simpler to me because all the tables have the same primary key field name. </p> <p>As far as joining ta...
<p>You could use the following naming convention. It has its flaws but it solves your particular problems.</p> <ol> <li>Use short (3-4 characters) nicknames for the table names, i.e. Invoice - <code>inv</code>, InvoiceLines - <code>invl</code></li> <li>Name the columns in the table using those nicknames, i.e. <code>in...
25,592
<p>I've been printing for a week now on my new printer and have been getting great results, including great adhesion. However, most of my prints have had a fairly small footprint.</p> <p>Now, I'm stepping up the types of items I'm printing, and I've started to run into a problem. Long, thin parts are starting to lift ...
<p>There are several things you could try without spending much but even PLA will warp on an unheated bed. I had a Legacy Kossel that I switched to an acrylic bed and had many issues with warping and prints pulling off the bed. </p> <p>Some cheap things to try would be...</p> <ol> <li>Adding a brim to the print.</l...
<p>Try a dilute solution of PVA glue (approx. 5:1 water:PVA) applied to the bed or the BuildTak like sheet and allowed to dry. Keep the ambient temperature as high as possible (but not so high as to soften any plastic on the printer obviously). Big brims help - consider adding them to the model rather than just apply...
146
<p>What is the best way to implement a 2D grid of radio buttons so that only one option in each column and one option in each row can be selected?</p>
<p>A 1D array of 1D arrays of radio buttons. Each row (or column) would use the normal radio button functionality, while each column (or row) would be updated by a loop called whenever an individual radio button is toggled.</p>
<p>Something like this?</p> <pre><code>using System; using System.Drawing; using System.Windows.Forms; class Program { static RadioButton[] bs = new RadioButton[9]; static void HandleCheckedChanged (object o, EventArgs a) { RadioButton b = o as RadioButton; if (b.Checked) { Conso...
41,688
<p>I'm currently looking for a webhost that offers Windows 2008 virtual or dedicated hosting for my ASP.NET app. On dedicated hosting you pay a monthly fee for Windows, I noticed there's a noticeable difference in cost between the web edition and the standard edition, so, my question is:</p> <p>Does the standard editi...
<p>No version of Windows Server 2008 OS (Web, Standard, Enterprise) comes with Exchange. They all have basic outgoing smtp capabilities but if your want imap, pop3, or webmail you need to look for a 3rd party product.</p> <p>A popular free mail server is <a href="http://www.smartertools.com/" rel="nofollow noreferrer"...
<p>As far as I know the web edition is only for hosting web sites. It does not include any mail server like exchange. It should have an smtp server and should be able to accept mail, but nothing like Exchange.</p> <p>It might be possible to install a mail server on web edition, but I don't have enough knowledge to k...
34,534
<p>I use Jasper reports with the <a href="http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatView.html" rel="nofollow noreferrer">JasperReportsMultiFormatView</a> class provided by the Spring framework. This class takes care of compiling th...
<p>I, like you, started out with the Spring helper classes for Jasper Reports but quickly abandoned them as being too coarse-grained and inflexible, which is unusual for Spring. Its like they were added as an afterthought.</p> <p>The big problem I had with them was that once they were compiled, it required an appserv...
<p>The report is compiled the first time its run, put a break point in AbstractJasperReportsView protected final JasperReport loadReport(Resource resource) method to confirm this.</p> <p>However the above post is correct that you'll need to extend the JasperReportsMultiFormatView if you want to provide any specific co...
40,547
<p>I have been trying to do a fill using the open source <a href="http://srecord.sourceforge.net/" rel="nofollow noreferrer">Srecord</a> Program. I need to do a fill that is <code>0xC2AF00</code>. It appears the program can only do fills that are a byte long (ex: <code>0xff</code>). If this is not possible with the <...
<p>The -repeat-data generator can take multiple bytes as parameters. The following will fill bytes 16 through 31 with C2AF00C2AF00...</p> <pre><code>srec_cat -Output -Intel -generate 0x10 0x20 -repeat-data 0xC2 0xAF 0x00 </code></pre> <p>Combine with your actual input, or other generators, to fill the appropriate ran...
<p>You can have full control over generating Intel Hex file with some special library, e.g. <a href="http://www.bialix.com/intelhex/" rel="nofollow noreferrer">with this IntelHex Python library</a></p>
48,399
<p>I compiled my app in release mode. I then went ahead and 'published' the site.</p> <p>Copies all files and moved them to a staging server with a static ip. Restarted IIS.</p> <p>Went to another machine and hit my web site. It took about 4 seconds for just the default page, which is pure HTML with no custom framewo...
<p>Sounds like it is just the application pool spinning up. Assuming that you are the first person to hit it after deployment, this isn't uncommon. It appears fine after the first page hit, correct?</p>
<p>If you set the @Page directive variable "Trace=True" does that show you any load times which out out of place? Also, if you are connected to a database, running SQL Profiler for example will show you any database queries which are too slow.</p> <p>Lastly, I had a strange issue where I had a virtual directory setup...
49,991
<p>I have a form with a lot of controls on it. How can I detect when the mouse leaves the form? I've tried wiring up a MouseLeave event for every single control and the form, but that does not work because those events fire all the time as the mouse passes over controls. Is there a way that actually works.?</p>
<p>You should listen:</p> <ul> <li>MouseLeave events of all controls of the form</li> <li>MouseLeave event of the form</li> </ul> <p>Just link your listeners to a function that checks whether the cursor is in the forms client are or not.</p> <p>Try this:</p> <pre><code> protected override void OnControlAdded(Con...
<p>Put this in timer:</p> <pre class="lang-vb prettyprint-override"><code>If PointToClient(MousePosition).X &lt; Me.Size.Width AndAlso PointToClient(MousePosition).X &gt; -1 AndAlso PointToClient(MousePosition).Y &lt; Me.Size.Height AndAlso PointToClient(MousePosition).Y &gt; -1 Then 'Mouse is inside the form Else...
35,318
<p>I wanted to show the users Name Address (see <a href="http://www.ipchicken.com" rel="nofollow noreferrer">www.ipchicken.com</a>), but the only thing I can find is the IP Address. I tried a reverse lookup, but didn't work either:</p> <pre><code>IPAddress ip = IPAddress.Parse(this.lblIp.Text); string hostName = Dns.G...
<p>Edit of my previous answer. Try (in vb.net): </p> <pre><code> Dim sTmp As String Dim ip As IPHostEntry sTmp = MaskedTextBox1.Text Dim ipAddr As IPAddress = IPAddress.Parse(sTmp) ip = Dns.GetHostEntry(ipAddr) MaskedTextBox2.Text = ip.HostName </code></pre> <p>Dns.resolve appears to be obsol...
<p>Not all IP addresses need to have hostnames. I think that's what is happening in your case. Try it ouy with more well-known IP/hostname pairs eg:</p> <blockquote> <p>Name: google.com Address: 72.14.207.99</p> <p>Name: google.com Address: 64.233.187.99</p> <p>Name: google.com Address: 64.233.167.99</...
3,839
<p>I am working on a project that is built on an extended version of the default PDO and PDOStatement classes and as such it uses PDO style named parameters instead of the "?" placeholder for variables. </p> <p>However, the client is now requesting that we look into using a different driver because their version OS X ...
<p>PDO and ADODB both support prepared statements, but the API is not great. Most frameworks provide an abstraction to one of those.</p> <p>I'm using Zend_Db from the Zend Framework and I highly recommend it. It has a select class for composing queries (which turn into prepared statements when queried against the data...
<p>I've used PEAR::MDB2 as well as PDO. MDB2's documentation is a little shaky, but once you get it all working its a dream to work with.</p> <p><a href="http://pear.php.net/package/MDB2" rel="nofollow noreferrer">http://pear.php.net/package/MDB2</a></p>
21,092
<p>I'm currently attempting to make a repstrap using paper printed parts, like this guy : <a href="http://www.mariolukas.de/2012/05/repstrap-3d-drucker-aus-computerschrott-teil-1/" rel="nofollow noreferrer">http://www.mariolukas.de/2012/05/repstrap-3d-drucker-aus-computerschrott-teil-1/</a> I replaced the DC motor in ...
<p>Axis should definitely be at proper position. Otherwise you will get at least 2 issues.</p> <ol> <li>Carriage will be pulled up which will cause stresses on rollers or slides and it will stress your belt</li> <li>The way the carriage will go will change but because carriage itself is fixed then it will change the s...
<p>A rotation of the stepper motor 90 degrees clockwise or counter-clockwise would move it more to the center. You would only need lengthen or shorten the belt.</p>
365
<p>I'm trying to add a very simple action to the context menu of Eclipse: clicking with right button over a folder object, this action should call an external tool (configured in the "External Tools") using the path of the folder as the only parameter.</p> <p>I've found a <a href="http://www.eclipse.org/articles/artic...
<p>If you want to extend Eclipse with functionality such as editing context menu's, the only way to go is by writing a plug-in. However, this can be very light-weight and targeted to your needs, so the tutorial you found might be a good way to do it. </p>
<p>Check out <a href="http://basti1302.github.com/startexplorer/" rel="nofollow">StartExplorer</a>. It's very handy. It's the equivalent of the IntelliJ "Neighborhood" plugin.</p> <p>It comes with the basics of explore, command shell, open, and copy path for Windows, Mac and Linux. It also supports <a href="http://bas...
33,733
<p>I'm trying to make a TCP Client program in C where the client will start up, connect to a server. Then it will send a little information and then just listen to what it receives and react accordingly.</p> <p>The part that I'm having trouble with is the continuous listening. Here is what I have</p> <pre><code>... ...
<p>Print out the number of bytes received - it is likely to be zero, but confirm that.</p> <p>It would be worth checking that you aren't getting an error - and therefore underflowing your buffer.</p> <p>[<em>Note: from here onwards is the work of Pax - <strong>thank you</strong>, and I've converted it to Community Wi...
<p>EDIT: the answer below was based on a misunderstanding of the question - the OP's code is actually trying to recv() on a socket that it open()ed to a remote server. Stuff below left for posterity.</p> <hr> <p>Please show more of your code.</p> <p>A few observations though:</p> <ul> <li>is the socket <code>liste...
41,321
<p>I'm working on a C++ prettyprinter and would like to show the results of the prettyprinter by comparing code before and after running it. Does anyone know where I can find some ugly C++ code to run through the prettypretty? Ideally the code would come from some open source software.</p>
<p>Anything coded to the <a href="http://www.gnu.org/prep/standards/html_node/Formatting.html#Formatting" rel="noreferrer">GNU coding standards</a> will give you a shitty indentation style to practise on. Verbatim example:</p> <pre><code> if (x &lt; foo (y, z)) haha = bar[4] + 5; else { while (z) {...
<p>Look at "golfed" <a href="https://codegolf.stackexchange.com/questions/tagged/c%2b%2b">C++ programs on the Code Golf Stack Exchange site</a>. They are uglified in order to save space.</p>
28,056
<p>Bearing in mind this is for <strong>classic asp</strong></p> <p>Which is better, all HTML contained within Response.Write Statements or inserting variables into HTML via &lt;%= %>.<br> Eg </p> <pre><code>Response.Write "&lt;table&gt;" &amp; vbCrlf Response.Write "&lt;tr&gt;" &amp;vbCrLf Response.Write "&lt;td cla...
<p>First, The most important factor you should be looking at is ease of maintenance. You could buy a server farm with the money and time you would otherwise waste by having to decipher a messy web site to maintain it.</p> <p>In any case, it doesn't matter. At the end of the day, all ASP does is just execute a script! ...
<p><code>&lt;%= %&gt;</code> and the rest get expanded to <code>Response.Write()</code> so it's the same in the end.</p>
18,255
<p>Apparently using the URL is no good - why is this the case, and how do you generate a good one?</p>
<p>Mark Pilgrim's article <a href="http://web.archive.org/web/20110514113830/http://diveintomark.org/archives/2004/05/28/howto-atom-id" rel="noreferrer">How to make a good ID in Atom</a> is good. Here's part of it:</p> <blockquote> <p><strong>Why you shouldn’t use your permalink as an Atom ID</strong></p> <p>I...
<p>Use a GUID for the ID.</p> <p>depends what language you use, but you could use </p> <p>System.Guid for .NET.</p>
18,174
<p>Given a table (mytable) containing a numeric field (mynum), how would one go about writing an SQL query which summarizes the table's data based on ranges of values in that field rather than each distinct value?</p> <p>For the sake of a more concrete example, let's make it intervals of 3 and just "summarize" with a ...
<p>The idea is to compute some function of the field that has constant value within each group you want:</p> <pre><code>select count(*), round(mynum/3.0) foo from mytable group by foo; </code></pre>
<p>I do not know if this is applicable to mySql, anyway in SQL Server I think you can "simply" use group by in both the select list AND the group by list.</p> <p>Something like:</p> <pre><code>select CASE WHEN id &lt;= 20 THEN 'lessthan20' WHEN id &gt; 20 and id &lt;= 30 THEN '20and30' ELSE 'm...
23,999
<p>I'm making a Circuit etching machine (CNC) and I need a good DC motor and drill bit for the spindle. </p> <p>My machine should be able to <strong>etch</strong>, <strong>drill</strong>, and <strong>cut</strong>:</p> <ul> <li><strong>Etching</strong>: take copper off the surface like chemicals or a laser would</li> ...
<p>There are several sources of PCB "etching" bits. They tend to be single straight flutes and high angle, very pointy bits.</p> <p>For the motor, high speed is good. Look for 30k+ RPM. The main thing to be concerned about is the amount of runout, or wobble in the tip. With a tiny tip, you can't afford much runout...
<h3>TL;DR</h3> <p>From Davo's and cmm's answers there seems to be a wide range of drill spindle speeds used (3k-30k rpm). So, just to add to that... 11,000 rpm would appear to be adequate.</p> <hr /> <p>I have been looking into converting a Wilson II 3D printer chassis into a CNC PCB etching machine, recently. In parti...
1,428
<p>How do you estimate the time needed to implement a user story? If it's something you had done before you know how long it'll take. But what about if it's completely new to you? How much time do you reserve for "surprises"?</p>
<p>A great technique for this is to break the story down to somewhat smaller tasks, and estimate them <em>compared to each other</em> (instead of absolutely). So you can say:</p> <ul> <li>Task A will take 2 units (arbitrary)</li> <li>Task B is about 2 times as complicated as Task A (4 units)</li> <li>Task C is about h...
<p>A technique implemented where i work. For each user story write it on a piece of card with a heading.Get each person to take a card and write on it the number of hours they think it will take to complete. Get them to place the cards against the task without showing them to each other. Once you have all the results ...
44,624
<p>For a web app I'm working on, I need to know the lat/lon of about 300 US cities. I also need to know the lat/lon for every US zip code.</p> <p>Does anyone know of a free source to get this information?</p>
<p><a href="http://freebase.com" rel="nofollow noreferrer">Freebase</a> will likely be able to help you. <a href="http://www.freebase.com/view/guid/9202a8c04000641f80000000002f8906" rel="nofollow noreferrer">Here is New York</a> and it has Lat/Long. </p> <p>The <a href="http://blog.kiwitobes.com/?p=51" rel="nofollow...
<p>Take a look at Ben Fry's <a href="http://benfry.com/zipdecode/" rel="nofollow noreferrer">Zip Code Visualizer</a>. This is part of his book <a href="https://rads.stackoverflow.com/amzn/click/com/0596514557" rel="nofollow noreferrer" rel="nofollow noreferrer">Visualizing Data</a>.</p>
27,914
<p>I'm trying to create classes to read from my config file using ConfigurationSection and ConfigurationElementCollection but am having a hard time.</p> <p>As an example of the config:</p> <pre><code> &lt;PaymentMethodSettings&gt; &lt;PaymentMethods&gt; &lt;PaymentMethod name="blah blah" code="1"/&gt; &lt;P...
<p>The magic here is to use ConfigurationSection classes.</p> <p>These classes just need to contain properties that match 1:1 with your configuration schema. You use attributes to let .NET know which properties match which elements.</p> <p>So, you could create PaymentMethod and have it inherit from ConfigurationSecti...
<p><a href="http://msdn.microsoft.com/en-us/library/2tw134k3.aspx" rel="nofollow noreferrer">This</a> should help you figure out how to create configuration sections correctly, and then read from them.</p>
31,811
<ul> <li>What types of applications have you used <a href="http://en.wikipedia.org/wiki/Model_checking" rel="noreferrer">model checking</a> for?</li> <li>What model checking tool did you use?</li> <li>How would you summarize your experience w/ the technique, specifically in evaluating its effectiveness in delivering hi...
<p>I just finished a class on model checking and the big tools we used were <a href="http://spinroot.com/spin/whatispin.html" rel="nofollow noreferrer">Spin</a> and <a href="http://www.cs.cmu.edu/~modelcheck/smv.html" rel="nofollow noreferrer">SMV</a>. We ended up using them to check properties on common synchronizatio...
<p>I used SPIN to find a concurrency issue in PLC software. It found an unsuspected race condition that would have been very tough to find by inspection or testing.</p> <p>By the way, is there a "SPIN for Dummies" book? I had to learn it out of "The SPIN Model Checker" book and various on-line tutorials.</p>
4,475
<p>I'm pretty green still when it comes to web programming, I've spent most of my time on client applications. So I'm curious about the common exploits I should fear/test for in my site.</p>
<p><a href="http://www.owasp.org/index.php/Main_Page" rel="noreferrer">OWASP</a> keeps a list of the <a href="http://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project" rel="noreferrer">Top 10</a> web attacks to watch our for, in addition to a ton of other useful security information for web development.</p>
<p>The most common are probably database injection attacks and cross-site scripting attacks; mainly because those are the easiest to accomplish (that's likely because those are the ones programmers are laziest about).</p>
4,310